-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lestarch: adding dictionary information to GUI (#80)
* lestarch: adding dictionary information to GUI * lestarch: sp * lestarch: nitpick
- Loading branch information
Showing
18 changed files
with
144 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,6 +116,7 @@ datastore | |
datastructures | ||
datetime | ||
dblclick | ||
Dct | ||
ddl | ||
DDTHH | ||
Ded | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/fprime_gds/flask/static/addons/dictionary/addon-templates.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
export let dictionary_template = ` | ||
<div class="fp-flex-repeater"> | ||
<div class="fp-flex-repeater"> | ||
<ul class="nav nav-tabs"> | ||
<li :class="['nav-item', 'nav-link', { active: active == key }]" | ||
v-for="key in Object.keys(this.dictionaries)" > | ||
<a @click="change(key)">{{ capitalize(key) }}</a> | ||
</li> | ||
</ul> | ||
<div class="container-fluid fp-flex-repeater" v-show="active == key" v-for="key in Object.keys(this.dictionaries)"> | ||
<h2>{{ capitalize(key) }} Dictionary</h2> | ||
<fp-table :header-columns="['ID', 'Name', 'Description']" | ||
:items="dictionaries[key]" | ||
:item-to-columns="columnify" | ||
:item-to-unique="(item) => item" | ||
></fp-table> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
export let version_template = ` | ||
<small> | ||
Dictionary Version: {{ project_version }} | ||
Dictionary Schema: {{ framework_version }} | ||
</small> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import {dictionary_template, version_template} from "./addon-templates.js"; | ||
import {_dictionaries} from "../../js/datastore.js"; | ||
import {sentenceCase} from "../../js/vue-support/utils.js" | ||
|
||
function copy(text) { | ||
navigator.clipboard.writeText(text); | ||
} | ||
/** | ||
* Sequencer component used to represent the composition and editing of sequences. | ||
*/ | ||
Vue.component("dictionary", { | ||
template: dictionary_template, | ||
data() { | ||
return { | ||
dictionaries: { | ||
commands: Object.values(_dictionaries.commands_by_id), | ||
events: Object.values(_dictionaries.events), | ||
channels: Object.values(_dictionaries.channels) | ||
}, | ||
active: "commands", | ||
}; | ||
}, | ||
methods: { | ||
capitalize(key) { | ||
return sentenceCase(key); | ||
}, | ||
change(new_key) { | ||
this.active = new_key; | ||
}, | ||
columnify(item) { | ||
return [this.keyify(item), item.full_name, item.description || item.ch_desc]; | ||
}, | ||
keyify(item) { | ||
return item.id || item.opcode; | ||
} | ||
} | ||
}); | ||
Vue.component("dictionary-version", { | ||
template: version_template, | ||
data() { | ||
return { | ||
"framework_version": _dictionaries.framework_version, | ||
"project_version": _dictionaries.project_version | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters