Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ACE font handling #1849

Merged
merged 1 commit into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix ACE font handling
  • Loading branch information
predictiple committed Jun 7, 2022
commit d5e9acbc11828ed8be8faa5a719bc553842a43ce
12 changes: 8 additions & 4 deletions gui/velociraptor/src/components/hunts/hunt-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,15 +423,19 @@ export function getHuntColumns() {
let stopped = row.stats && row.stats.stopped;

if (stopped || cell === "STOPPED") {
return <FontAwesomeIcon icon="stop"/>;
return <div className="hunt-status-icon">
<FontAwesomeIcon icon="stop"/></div>;
}
if (cell === "RUNNING") {
return <FontAwesomeIcon icon="hourglass"/>;
return <div className="hunt-status-icon">
<FontAwesomeIcon icon="hourglass"/></div>;
}
if (cell === "PAUSED") {
return <FontAwesomeIcon icon="pause"/>;
return <div className="hunt-status-icon">
<FontAwesomeIcon icon="pause"/></div>;
}
return <FontAwesomeIcon icon="exclamation"/>;
return <div className="hunt-status-icon">
<FontAwesomeIcon icon="exclamation"/></div>;
}
},
{dataField: "hunt_id", text: T("Hunt ID")},
Expand Down
4 changes: 4 additions & 0 deletions gui/velociraptor/src/components/hunts/hunt.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
margin-right: 20px;
margin-left: 20px;
}

div .hunt-status-icon {
text-align: center;
}
9 changes: 8 additions & 1 deletion gui/velociraptor/src/components/users/user-label.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,23 +216,30 @@ export default class UserLabel extends React.Component {
setSettings = (options) => {
// Set the ACE theme according to the theme so they match.
let ace_options = JSON.parse(this.context.traits.ui_settings || "{}");
ace_options.fontSize = "18px";
if (options.theme === "no-theme") {
ace_options.theme = "ace/theme/xcode";
ace_options.fontFamily = "monospace";
} else if (options.theme === "veloci-dark") {
ace_options.theme = "ace/theme/vibrant_ink";
ace_options.fontFamily = "monospace";
} else if(options.theme === "veloci-light") {
ace_options.theme = "ace/theme/xcode";
ace_options.fontFamily = "monospace";
} else if(options.theme === "pink-light") {
ace_options.theme = "ace/theme/xcode";
ace_options.fontFamily = "monospace";
} else if(options.theme === "ncurses") {
ace_options.theme = "ace/theme/sqlserver";
ace_options.fontFamily = "fixedsys";
} else if(options.theme === "github-dimmed-dark") {
ace_options.theme = "ace/theme/vibrant_ink";
ace_options.fontFamily = "monospace";
} else if(options.theme === "github-dimmed-light") {
ace_options.theme = "ace/theme/sqlserver";
ace_options.fontFamily = "monospace";
} else if(options.theme === "coolgray-dark") {
ace_options.theme = "ace/theme/nord_dark";
ace_options.fontFamily = "monospace";
}
options.options = JSON.stringify(ace_options);

Expand Down
Binary file added gui/velociraptor/src/fonts/FSEX300.woff2
Binary file not shown.
Binary file removed gui/velociraptor/src/fonts/fixedsys-ligatures.woff2
Binary file not shown.
2 changes: 1 addition & 1 deletion gui/velociraptor/src/themes/ncurses.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
font-style: normal;
font-weight: 400;
src: local(""),
url("../fonts/fixedsys-ligatures.woff2") format("woff2");
url("../fonts/FSEX300.woff2") format("woff2");
font-display: block;
}

Expand Down
2 changes: 1 addition & 1 deletion services/users/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (

const (
// Default settings for reasonable GUI
default_user_options = `{"selectionStyle":"line","highlightActiveLine":true,"highlightSelectedWord":true,"copyWithEmptySelection":false,"cursorStyle":"ace","mergeUndoDeltas":true,"behavioursEnabled":true,"wrapBehavioursEnabled":true,"showLineNumbers":true,"relativeLineNumbers":true,"hScrollBarAlwaysVisible":false,"vScrollBarAlwaysVisible":false,"highlightGutterLine":true,"animatedScroll":false,"showInvisibles":false,"showPrintMargin":true,"printMarginColumn":80,"printMargin":80,"fadeFoldWidgets":false,"showFoldWidgets":true,"displayIndentGuides":true,"showGutter":true,"fontSize":12,"fontFamily":"monospace","scrollPastEnd":0,"theme":"ace/theme/xcode","useTextareaForIME":true,"scrollSpeed":2,"dragDelay":0,"dragEnabled":true,"focusTimeout":0,"tooltipFollowsMouse":true,"firstLineNumber":1,"overwrite":false,"newLineMode":"auto","useSoftTabs":true,"navigateWithinSoftTabs":false,"tabSize":4,"wrap":"free","indentedSoftWrap":true,"foldStyle":"markbegin","enableMultiselect":true,"enableBlockSelect":true,"enableEmmet":true,"enableBasicAutocompletion":true,"enableLiveAutocompletion":true}`
default_user_options = `{"selectionStyle":"line","highlightActiveLine":true,"highlightSelectedWord":true,"copyWithEmptySelection":false,"cursorStyle":"ace","mergeUndoDeltas":true,"behavioursEnabled":true,"wrapBehavioursEnabled":true,"showLineNumbers":true,"relativeLineNumbers":true,"hScrollBarAlwaysVisible":false,"vScrollBarAlwaysVisible":false,"highlightGutterLine":true,"animatedScroll":false,"showInvisibles":false,"showPrintMargin":true,"printMarginColumn":80,"printMargin":80,"fadeFoldWidgets":false,"showFoldWidgets":true,"displayIndentGuides":true,"showGutter":true,"fontSize":14,"fontFamily":"monospace","scrollPastEnd":0,"theme":"ace/theme/xcode","useTextareaForIME":true,"scrollSpeed":2,"dragDelay":0,"dragEnabled":true,"focusTimeout":0,"tooltipFollowsMouse":true,"firstLineNumber":1,"overwrite":false,"newLineMode":"auto","useSoftTabs":true,"navigateWithinSoftTabs":false,"tabSize":4,"wrap":"free","indentedSoftWrap":true,"foldStyle":"markbegin","enableMultiselect":true,"enableBlockSelect":true,"enableEmmet":true,"enableBasicAutocompletion":true,"enableLiveAutocompletion":true}`
)

type UserManager struct {
Expand Down