mirror of
https://github.com/nasa/openmct.git
synced 2025-01-27 14:49:28 +00:00
3b195e9c7d
* WIP: imagery vue refactor * cleaup * show orange border when paused. * resize image and thumbs wrappers. * scrollToBottom fixed. * fixed lint errors * use multipane vue component for resize + cleanup + style adjustments. * added min-height to image pane and thumbs-layout pane. * remove old plugin and using es6 const. * using ES6 imports. * clean up + formatting changes. * updated as per review comments. * extracted styles from vue component. * fixed lint errors. * updated as per review comments + cleanup.
48 lines
1.4 KiB
JavaScript
48 lines
1.4 KiB
JavaScript
import ImageryViewLayout from './components/ImageryViewLayout.vue';
|
|
import Vue from 'vue';
|
|
|
|
export default function ImageryViewProvider(openmct) {
|
|
const type = 'example.imagery';
|
|
|
|
const hasImageTelemetry = function (domainObject) {
|
|
const metadata = openmct.telemetry.getMetadata(domainObject);
|
|
if (!metadata) {
|
|
return false;
|
|
}
|
|
|
|
return metadata.valuesForHints(['image']).length > 0;
|
|
};
|
|
|
|
return {
|
|
key: type,
|
|
name: 'Imagery Layout',
|
|
cssClass: 'icon-image',
|
|
canView: function (domainObject) {
|
|
return hasImageTelemetry(domainObject);
|
|
},
|
|
view: function (domainObject) {
|
|
let component;
|
|
|
|
return {
|
|
show: function (element) {
|
|
component = new Vue({
|
|
components: {
|
|
ImageryViewLayout
|
|
},
|
|
provide: {
|
|
openmct,
|
|
domainObject
|
|
},
|
|
el: element,
|
|
template: '<imagery-view-layout ref="ImageryLayout"></imagery-view-layout>'
|
|
});
|
|
},
|
|
destroy: function () {
|
|
component.$destroy();
|
|
component = undefined;
|
|
}
|
|
};
|
|
}
|
|
}
|
|
}
|