@@ -6,6 +6,7 @@ import { HideEdgeNames, SETTINGS, SimplifyNodeNames } from "./Settings";
66import { EditorModeController } from "./editorMode" ;
77import { Theme , ThemeManager } from "./Theme" ;
88import { ShownLabels , ShownLabelsValue } from "./ShownLabels" ;
9+ import hashJson from './hash.json'
910
1011@injectable ( )
1112export class SettingsUI extends AccordionUiExtension {
@@ -42,13 +43,29 @@ export class SettingsUI extends AccordionUiExtension {
4243 this . addBooleanSwitch ( grid , "Hide Edge Names" , this . hideEdgeNames ) ;
4344 this . addBooleanSwitch ( grid , "Simplify Node Names" , this . simplifyNodeNames ) ;
4445 this . addSwitch ( grid , "Read Only" , this . editorModeController , { true : "view" , false : "edit" } ) ;
46+ contentElement . appendChild ( this . buildCommitHash ( ) )
4547 }
4648
4749 protected initializeHeaderContent ( headerElement : HTMLElement ) : void {
4850 headerElement . classList . add ( "settings-accordion-icon" ) ;
4951 headerElement . innerText = "Settings" ;
5052 }
5153
54+ private buildCommitHash ( ) : HTMLElement {
55+ const holder = document . createElement ( 'div' )
56+ holder . id = 'hashHolder'
57+ holder . innerHTML = 'Commit:'
58+
59+ const link = document . createElement ( 'a' )
60+ link . innerHTML = hashJson . hash . substring ( 0 , 6 )
61+ link . href = `https://github.com/DataFlowAnalysis/OnlineEditor/tree/${ hashJson . hash } `
62+ link . id = 'hash'
63+ link . target = '_blank'
64+
65+ holder . appendChild ( link )
66+ return holder
67+ }
68+
5269 private addBooleanSwitch ( container : HTMLElement , title : string , value : SettingsValue < boolean > ) : void {
5370 this . addSwitch < boolean > ( container , title , value , { true : true , false : false } ) ;
5471 }
0 commit comments