Skip to content

Commit

Permalink
convert tables to work with new performance mode options
Browse files Browse the repository at this point in the history
  • Loading branch information
davetsay committed Jul 19, 2024
1 parent 5629560 commit 8442362
Show file tree
Hide file tree
Showing 39 changed files with 125 additions and 101 deletions.
16 changes: 16 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,22 @@
}
],
*/
/**
* Table Performance Mode Configuration
* Can increase performance by limiting the maximum rows retained and displayed by tables
* Affects all bounded table types such as Telemetry and EVR tables
* Does not affect latest available tables such as Channel tables
* @typedef TablePerformanceOptions
* @type {object}
* @property {('performance'|'unlimited')} telemetryMode performance mode limits the maximum table rows
* @property {Boolean} persistModeChange whether changes in the UI are persisted with the table
* @property {Number} rowLimit the maximum number of rows in performance mode
*/
tablePerformanceOptions: {
telemetryMode: 'unlimited',
persistModeChange: false,
rowLimit: 50
},
/**
* Developer Settings-- do not modify these unless you know what
* they do!
Expand Down
10 changes: 5 additions & 5 deletions loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ define([
}
));
openmct.install(ClearDataIndicator.default(config.globalStalenessInterval));
openmct.install(CommandEventsViewPlugin.default());
openmct.install(MessagesPlugin.default());
openmct.install(ProductStatusPlugin.default());
openmct.install(CommandEventsViewPlugin.default(config.tablePerformanceOptions));
openmct.install(MessagesPlugin.default(config.tablePerformanceOptions));
openmct.install(ProductStatusPlugin.default(config.tablePerformanceOptions));
openmct.install(openmct.plugins.UTCTimeSystem())
openmct.install(openmct.plugins.Notebook());
openmct.install(MetadataActionPlugin.default());
openmct.install(DictionaryViewPlugin.default());
openmct.install(PacketSummaryPlugin.default());
openmct.install(DictionaryViewPlugin.default(config.tablePerformanceOptions));
openmct.install(PacketSummaryPlugin.default(config.tablePerformanceOptions));
openmct.install(ContainerViewPlugin.default());
openmct.install(openmct.plugins.Clock(
{ useClockIndicator: false }
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"mini-css-extract-plugin": "2.6.0",
"moment": "2.29.4",
"node-bourbon": "^4.2.3",
"openmct": "nasa/openmct#omm-release/5.3",
"openmct": "nasa/openmct#omm-release/5.3-next",
"printj": "^1.2.1",
"raw-loader": "^0.5.1",
"resolve-url-loader": "5.0.0",
Expand Down
10 changes: 5 additions & 5 deletions src/AMMOSPlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ define([

mcwsClient.default.configure(options, identityPlugin.login);

openmct.install(MultipleHistoricalSessions.default());
openmct.install(MultipleHistoricalSessions.default(options.tablePerformanceOptions));
openmct.install(RealtimeSessions.default());

openmct.install(new HistoricalTelemetryPlugin(options));
Expand All @@ -108,12 +108,12 @@ define([
openmct.install(new VenuePlugin.default(options));
openmct.install(FrameWatchViewPlugin.default());
openmct.install(FrameEventFilterViewPlugin.default());
openmct.install(new ChannelTablePlugin.default());
openmct.install(new ChannelTablePlugin.default(options.tablePerformanceOptions));
openmct.install(new ChannelTableSetPlugin.default());
openmct.install(new ChannelLimitsPlugin.default());
openmct.install(new FrameAccountabilityPlugin.default(options.frameAccountabilityExpectedVcidList));
openmct.install(EVRViewPlugin.default(options.taxonomy));
openmct.install(new AlarmsViewPlugin.default());
openmct.install(new FrameAccountabilityPlugin.default(options));
openmct.install(EVRViewPlugin.default(options));
openmct.install(new AlarmsViewPlugin.default(options.tablePerformanceOptions));
openmct.install(MCWSIndicatorPlugin.default());

if (window.openmctMCWSConfig.messageStreamUrl && window.openmctMCWSConfig.messageStreamUrl !== '') {
Expand Down
6 changes: 4 additions & 2 deletions src/alarmsView/AlarmsAutoclearViewProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import AlarmsAutoclear from './AlarmsAutoclear.vue';
import TelemetryTableConfiguration from 'openmct.tables.TelemetryTableConfiguration';

export default class AlarmsAutoClearViewProvider {
constructor(openmct) {
constructor(openmct, options) {
this.key = 'vista.alarmsView-configuration';
this.name = 'Autoclear';

this.openmct = openmct;
this.options = options;
this._destroy = null;
}

Expand All @@ -22,7 +24,7 @@ export default class AlarmsAutoClearViewProvider {

view(selection) {
const domainObject = selection[0][0].context.item;
const tableConfiguration = new TelemetryTableConfiguration(domainObject, openmct);
const tableConfiguration = new TelemetryTableConfiguration(domainObject, openmct, this.options);

return {
show: function (element) {
Expand Down
5 changes: 3 additions & 2 deletions src/alarmsView/AlarmsViewProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import TableComponent from 'openmct.tables.components.Table';
import AlarmsTable from './AlarmsTable.js';

export default class AlarmsViewProvider {
constructor(openmct) {
constructor(openmct, options) {
this.openmct = openmct;
this.options = options;

this.key = 'vista.alarmsView';
this.name = 'Alarms Table';
Expand All @@ -19,7 +20,7 @@ export default class AlarmsViewProvider {
let component;
let _destroy = null;

const table = new AlarmsTable(domainObject, openmct);
const table = new AlarmsTable(domainObject, openmct, this.options);
const markingProp = {
enable: true,
useAlternateControlBar: false,
Expand Down
9 changes: 5 additions & 4 deletions src/alarmsView/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import AlarmsAutoclearViewProvider from './AlarmsAutoclearViewProvider';
import AlarmsViewActions from './AlarmsViewActions';
import VistaTableConfigurationProvider from '../tables/VistaTableConfigurationProvider';

export default function AlarmsViewPlugin() {
export default function AlarmsViewPlugin(options) {
return function install(openmct) {
openmct.objectViews.addProvider(new AlarmsViewProvider(openmct));
openmct.inspectorViews.addProvider(new AlarmsAutoclearViewProvider(openmct));
openmct.objectViews.addProvider(new AlarmsViewProvider(openmct, options));
openmct.inspectorViews.addProvider(new AlarmsAutoclearViewProvider(openmct, options));

AlarmsViewActions.forEach(action => {
openmct.actions.register(action);
Expand All @@ -28,7 +28,8 @@ export default function AlarmsViewPlugin() {
openmct.inspectorViews.addProvider(new VistaTableConfigurationProvider(
'vista.alarm-view-configuration',
'Config',
'vista.alarmsView'
'vista.alarmsView',
options
));

openmct.composition.addPolicy((parent, child) => {
Expand Down
5 changes: 3 additions & 2 deletions src/channelTable/channelTablePlugin/ChannelTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import EmptyChannelTableRow from './EmptyChannelTableRow';
import ObjectNameColumn from './ObjectNameColumn';

export default class ChannelTable extends TelemetryTable {
constructor(domainObject, openmct) {
super(domainObject, openmct);
constructor(domainObject, openmct, options) {
super(domainObject, openmct, options);

this.updateConfiguration = this.updateConfiguration.bind(this);
this.reorder = this.reorder.bind(this);
this.addDummyRowForObject = this.addDummyRowForObject.bind(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import CellFormatConfigurationComponent from './CellFormatConfigurationComponent
import TelemetryTableConfiguration from 'openmct.tables.TelemetryTableConfiguration';
import mount from 'utils/mountVueComponent';

export default function ChannelTableFormatViewProvider(openmct) {
export default function ChannelTableFormatViewProvider(openmct, options) {
return {
key: 'channel-list-format',
name: 'Format',
Expand All @@ -20,7 +20,7 @@ export default function ChannelTableFormatViewProvider(openmct) {
view: function (selection) {
let _destroy = null;
let domainObject = selection[0][1].context.item;
const tableConfiguration = new TelemetryTableConfiguration(domainObject, openmct);
const tableConfiguration = new TelemetryTableConfiguration(domainObject, openmct, options);

return {
show: function (element) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import TableComponent from 'openmct.tables.components.Table';
import mount from 'utils/mountVueComponent';

export default class ChannelTableViewProvider {
constructor(openmct) {
constructor(openmct, options) {
this.openmct = openmct;
this.options = options;

this.key = 'vista.channel-list';
this.name = 'Channel List';
this.cssClass = 'icon-tabular-realtime';
Expand All @@ -30,7 +32,7 @@ export default class ChannelTableViewProvider {
rowName: '',
rowNamePlural: ''
};
const table = new ChannelTable(domainObject, this.openmct);
const table = new ChannelTable(domainObject, this.openmct, this.options);

const view = {
show(element, isEditing, { renderWhenVisible }) {
Expand Down
9 changes: 5 additions & 4 deletions src/channelTable/channelTablePlugin/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ChannelTableViewProvider from './ChannelTableViewProvider';
import ChannelTableFormatViewProvider from './ChannelTableFormatViewProvider';
import VistaTableConfigurationProvider from '../../tables/VistaTableConfigurationProvider';

export default function install() {
export default function install(options) {
return function ChannelTablePlugin(openmct) {
openmct.types.addType(CHANNEL_TABLE_KEY, {
name: CHANNEL_TABLE_NAME,
Expand All @@ -19,16 +19,17 @@ export default function install() {
}
});

openmct.objectViews.addProvider(new ChannelTableViewProvider(openmct));
openmct.objectViews.addProvider(new ChannelTableViewProvider(openmct, options));

openmct.inspectorViews.addProvider(
new VistaTableConfigurationProvider(
'vista.channel-list-configuration',
'Config',
CHANNEL_TABLE_KEY
CHANNEL_TABLE_KEY,
options
)
);
openmct.inspectorViews.addProvider(new ChannelTableFormatViewProvider(openmct));
openmct.inspectorViews.addProvider(new ChannelTableFormatViewProvider(openmct, options));

openmct.composition.addPolicy((parent, child) => {
if (parent.type === CHANNEL_TABLE_KEY) {
Expand Down
4 changes: 0 additions & 4 deletions src/commandEventsView/CommandEventsTable.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import TelemetryTable from 'openmct.tables.TelemetryTable';
export default class CommandEventsTable extends TelemetryTable {
constructor(domainObject, openmct) {
super(domainObject, openmct);
}

initialize() {
this.filterObserver = this.openmct.objects.observe(
this.domainObject,
Expand Down
5 changes: 3 additions & 2 deletions src/commandEventsView/CommandEventsViewProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import TableComponent from 'openmct.tables.components.Table';
import mount from 'utils/mountVueComponent';

export default class CommandEventsViewProvider {
constructor(openmct) {
constructor(openmct, options) {
this.openmct = openmct;
this.options = options;

this.key = 'vista.commandEventsView';
this.name = 'Command Events View';
Expand All @@ -19,7 +20,7 @@ export default class CommandEventsViewProvider {
let component;
let _destroy = null;

const table = new CommandEventsTable(domainObject, openmct);
const table = new CommandEventsTable(domainObject, openmct, this.options);
const markingProp = {
enable: true,
useAlternateControlBar: false,
Expand Down
7 changes: 4 additions & 3 deletions src/commandEventsView/plugin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import CommandEventsViewProvider from './CommandEventsViewProvider.js';
import VistaTableConfigurationProvider from '../tables/VistaTableConfigurationProvider.js';

export default function CommandEventsViewPlugin() {
export default function CommandEventsViewPlugin(options) {
return function install(openmct) {
openmct.types.addType('vista.commandEventsView', {
name: 'Command Events View',
Expand All @@ -16,7 +16,7 @@ export default function CommandEventsViewPlugin() {
}
});

openmct.objectViews.addProvider(new CommandEventsViewProvider(openmct));
openmct.objectViews.addProvider(new CommandEventsViewProvider(openmct, options));

const wrappedGet = openmct.objectViews.get;
openmct.objectViews.get = function (domainObject) {
Expand All @@ -30,7 +30,8 @@ export default function CommandEventsViewPlugin() {
new VistaTableConfigurationProvider(
'vista.command-events-view-configuration',
'Config',
'vista.commandEventsView'
'vista.commandEventsView',
options
)
);

Expand Down
5 changes: 3 additions & 2 deletions src/dictionaryView/dictionaryViewProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import DictionaryViewTable from './dictionaryViewTable.js';
import mount from 'utils/mountVueComponent';

export default class DictionaryViewProvider {
constructor(openmct) {
constructor(openmct, options) {
this.key = 'dictionary-view';
this.name = 'Dictionary View';
this.cssClass = 'icon-dataset';

this.openmct = openmct;
this.options = options;
}

canView(domainObject) {
Expand All @@ -19,7 +20,7 @@ export default class DictionaryViewProvider {
let component;
let _destroy = null;

const table = new DictionaryViewTable(domainObject, openmct);
const table = new DictionaryViewTable(domainObject, openmct, this.options);
const markingProp = {
enable: true,
useAlternateControlBar: false,
Expand Down
4 changes: 2 additions & 2 deletions src/dictionaryView/dictionaryViewTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import TelemetryTableRow from 'openmct.tables.TelemetryTableRow';
import mcws from 'services/mcws/mcws';

export default class DictionaryViewTable extends TelemetryTable {
constructor(domainObject, openmct, metadata = []) {
super(domainObject, openmct);
constructor(domainObject, openmct, options, metadata = []) {
super(domainObject, openmct, options);

this.metadata = metadata;
this.data = [];
Expand Down
4 changes: 2 additions & 2 deletions src/dictionaryView/plugin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DictionaryViewProvider from './dictionaryViewProvider';

export default function plugin() {
export default function plugin(options) {
return function install(openmct) {
openmct.objectViews.addProvider(new DictionaryViewProvider(openmct));
openmct.objectViews.addProvider(new DictionaryViewProvider(openmct, options));
}
}
4 changes: 0 additions & 4 deletions src/evrView/EVRTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import TelemetryTable from 'openmct.tables.TelemetryTable'
import EVRLevelIndicatorTableRow from './EVRLevelIndicatorTableRow'

export default class EVRTable extends TelemetryTable {
constructor(domainObject, openmct) {
super(domainObject, openmct);
}

initialize() {
if (this.domainObject.type === 'vista.evrView') {
this.filterObserver = this.openmct.objects.observe(
Expand Down
5 changes: 3 additions & 2 deletions src/evrView/EVRViewProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ function providesEVRData(domainObject) {
));
}
export default class EVRViewProvider {
constructor(openmct) {
constructor(openmct, options) {
this.key = 'vista.evrView';
this.name = 'EVR View';
this.cssClass = 'icon-tabular-realtime';
this.openmct = openmct;
this.options = options;

this.view = this.view.bind(this);
}
Expand All @@ -39,7 +40,7 @@ export default class EVRViewProvider {
let component;
let _destroy = null;

const table = new EVRTable(domainObject, this.openmct);
const table = new EVRTable(domainObject, this.openmct, this.options);
const markingProp = {
enable: true,
useAlternateControlBar: false,
Expand Down
9 changes: 6 additions & 3 deletions src/evrView/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import EVRViewLevelsConfigurationViewProvider from './EVRViewLevelsConfiguration
import VistaTableConfigurationProvider from '../tables/VistaTableConfigurationProvider';

export default function EVRViewPlugin(options) {
const { taxonomy, tablePerformanceOptions } = options;

return function install(openmct) {
openmct.objectViews.addProvider(new EVRViewProvider(openmct));
openmct.objectViews.addProvider(new EVRViewProvider(openmct, tablePerformanceOptions));

openmct.types.addType('vista.evrView', {
name: "EVR View",
Expand All @@ -20,14 +22,15 @@ export default function EVRViewPlugin(options) {
});

openmct.inspectorViews.addProvider(
new EVRViewLevelsConfigurationViewProvider(options)
new EVRViewLevelsConfigurationViewProvider(taxonomy)
);

openmct.inspectorViews.addProvider(
new VistaTableConfigurationProvider(
'vista.evr-view-configuration',
'Config',
'vista.evrView'
'vista.evrView',
tablePerformanceOptions
)
);

Expand Down
Loading

0 comments on commit 8442362

Please sign in to comment.