Compare commits
3 Commits
refresh-ap
...
openmct-hl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d67889eba2 | ||
|
|
965ac5d1f8 | ||
|
|
4494c70727 |
@@ -62,6 +62,12 @@ export default {
|
|||||||
|
|
||||||
return defaultNotebookObject;
|
return defaultNotebookObject;
|
||||||
},
|
},
|
||||||
|
linkToObject() {
|
||||||
|
return '#/browse/' + this.objectPath
|
||||||
|
.map(o => o && this.openmct.objects.makeKeyString(o.identifier))
|
||||||
|
.reverse()
|
||||||
|
.join('/');
|
||||||
|
},
|
||||||
async showMenu(event) {
|
async showMenu(event) {
|
||||||
const notebookTypes = [];
|
const notebookTypes = [];
|
||||||
const elementBoundingClientRect = this.$el.getBoundingClientRect();
|
const elementBoundingClientRect = this.$el.getBoundingClientRect();
|
||||||
@@ -102,11 +108,10 @@ export default {
|
|||||||
|| document.getElementsByClassName('l-shell__main-container')[0];
|
|| document.getElementsByClassName('l-shell__main-container')[0];
|
||||||
|
|
||||||
const bounds = this.openmct.time.bounds();
|
const bounds = this.openmct.time.bounds();
|
||||||
|
const objectPath = this.objectPath || this.openmct.router.path;
|
||||||
const link = !this.ignoreLink
|
const link = !this.ignoreLink
|
||||||
? window.location.hash
|
? window.location.hash
|
||||||
: null;
|
: this.linkToObject();
|
||||||
|
|
||||||
const objectPath = this.objectPath || this.openmct.router.path;
|
|
||||||
const snapshotMeta = {
|
const snapshotMeta = {
|
||||||
bounds,
|
bounds,
|
||||||
link,
|
link,
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ export default function NotebookPlugin() {
|
|||||||
openmct.types.addType('notebook', notebookType);
|
openmct.types.addType('notebook', notebookType);
|
||||||
|
|
||||||
const snapshotContainer = new SnapshotContainer(openmct);
|
const snapshotContainer = new SnapshotContainer(openmct);
|
||||||
|
openmct.snapshotContainer = snapshotContainer;
|
||||||
const notebookSnapshotIndicator = new Vue ({
|
const notebookSnapshotIndicator = new Vue ({
|
||||||
provide: {
|
provide: {
|
||||||
openmct,
|
openmct,
|
||||||
|
|||||||
@@ -41,21 +41,29 @@ export default {
|
|||||||
this.$listeners,
|
this.$listeners,
|
||||||
{
|
{
|
||||||
input: function (event) {
|
input: function (event) {
|
||||||
vm.$emit('input', event.target.value);
|
vm.changeInputValue(event.target.value);
|
||||||
vm.active = (event.target.value.length > 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.changeInputValue(this.value);
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value(inputValue) {
|
value(inputValue) {
|
||||||
if (!inputValue.length) {
|
if (!inputValue.length) {
|
||||||
this.clearInput();
|
this.clearInput();
|
||||||
|
} else {
|
||||||
|
this.changeInputValue(inputValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
changeInputValue(value) {
|
||||||
|
this.$emit('input', value);
|
||||||
|
this.active = (value.length > 0);
|
||||||
|
},
|
||||||
clearInput() {
|
clearInput() {
|
||||||
// Clear the user's input and set 'active' to false
|
// Clear the user's input and set 'active' to false
|
||||||
this.$emit('clear', '');
|
this.$emit('clear', '');
|
||||||
|
|||||||
@@ -13,6 +13,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="l-browse-bar__end">
|
<div class="l-browse-bar__end">
|
||||||
|
<NotebookMenuSwitcher v-if="notebookEnabled"
|
||||||
|
:domain-object="domainObject"
|
||||||
|
:object-path="path"
|
||||||
|
:ignoreLink="true"
|
||||||
|
class="c-notebook-snapshot-menubutton"
|
||||||
|
/>
|
||||||
<view-switcher
|
<view-switcher
|
||||||
:v-if="!hideViewSwitcher"
|
:v-if="!hideViewSwitcher"
|
||||||
:views="views"
|
:views="views"
|
||||||
@@ -39,6 +45,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ViewSwitcher from '../../ui/layout/ViewSwitcher.vue';
|
import ViewSwitcher from '../../ui/layout/ViewSwitcher.vue';
|
||||||
|
import NotebookMenuSwitcher from '@/plugins/notebook/components/NotebookMenuSwitcher.vue';
|
||||||
|
|
||||||
const HIDDEN_ACTIONS = [
|
const HIDDEN_ACTIONS = [
|
||||||
'remove',
|
'remove',
|
||||||
'move',
|
'move',
|
||||||
@@ -50,6 +58,7 @@ export default {
|
|||||||
'openmct'
|
'openmct'
|
||||||
],
|
],
|
||||||
components: {
|
components: {
|
||||||
|
NotebookMenuSwitcher,
|
||||||
ViewSwitcher
|
ViewSwitcher
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@@ -88,7 +97,9 @@ export default {
|
|||||||
return {
|
return {
|
||||||
type: this.openmct.types.get(this.domainObject.type),
|
type: this.openmct.types.get(this.domainObject.type),
|
||||||
statusBarItems: [],
|
statusBarItems: [],
|
||||||
menuActionItems: []
|
menuActionItems: [],
|
||||||
|
notebookEnabled: this.openmct.types.get('notebook'),
|
||||||
|
path: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -106,6 +117,14 @@ export default {
|
|||||||
this.actionCollection.on('update', this.updateActionItems);
|
this.actionCollection.on('update', this.updateActionItems);
|
||||||
this.updateActionItems(this.actionCollection.getActionsObject());
|
this.updateActionItems(this.actionCollection.getActionsObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.notebookEnabled) {
|
||||||
|
this.openmct.objects
|
||||||
|
.getOriginalPath(this.domainObject.identifier)
|
||||||
|
.then(objectPath => {
|
||||||
|
this.path = objectPath;
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setView(view) {
|
setView(view) {
|
||||||
|
|||||||
Reference in New Issue
Block a user