mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 13:17:53 +00:00
Merge pull request #1400 from nasa/plugins-1398
[Plugins] Adapt legacy plugins
This commit is contained in:
commit
290dd0abf0
15
API.md
15
API.md
@ -269,12 +269,27 @@ The plugin will be invoked to configure Open MCT before it is started.
|
||||
|
||||
Open MCT is packaged along with a few general-purpose plugins:
|
||||
|
||||
* `openmct.plugins.CouchDB` is an adapter for using CouchDB for persistence
|
||||
of user-created objects. This is a constructor that takes the URL for the
|
||||
CouchDB database as a parameter, e.g.
|
||||
`openmct.install(new openmct.plugins.CouchDB('http://localhost:5984/openmct'))`
|
||||
* `openmct.plugins.Elasticsearch` is an adapter for using Elasticsearch for
|
||||
persistence of user-created objects. This is a
|
||||
constructor that takes the URL for the Elasticsearch instance as a
|
||||
parameter, e.g.
|
||||
`openmct.install(new openmct.plugins.CouchDB('http://localhost:9200'))`.
|
||||
Domain objects will be indexed at `/mct/domain_object`.
|
||||
* `openmct.plugins.espresso` and `openmct.plugins.snow` are two different
|
||||
themes (dark and light) available for Open MCT. Note that at least one
|
||||
of these themes must be installed for Open MCT to appear correctly.
|
||||
* `openmct.plugins.localStorage` provides persistence of user-created
|
||||
objects in browser-local storage. This is particularly useful in
|
||||
development environments.
|
||||
* `openmct.plugins.myItems` adds a top-level folder named "My Items"
|
||||
when the application is first started, providing a place for a
|
||||
user to store created items.
|
||||
* `openmct.plugins.utcTimeSystem` provides support for using the time
|
||||
conductor with UTC time.
|
||||
|
||||
Generally, you will want to either install these plugins, or install
|
||||
different plugins that provide persistence and an initial folder
|
||||
|
@ -32,12 +32,13 @@
|
||||
[
|
||||
'example/imagery',
|
||||
'example/eventGenerator',
|
||||
'example/generator',
|
||||
'platform/features/my-items',
|
||||
'platform/persistence/local'
|
||||
'example/generator'
|
||||
].forEach(
|
||||
openmct.legacyRegistry.enable.bind(openmct.legacyRegistry)
|
||||
);
|
||||
openmct.install(openmct.plugins.myItems);
|
||||
openmct.install(openmct.plugins.localStorage);
|
||||
openmct.install(openmct.plugins.espresso);
|
||||
openmct.start();
|
||||
});
|
||||
</script>
|
||||
|
@ -109,7 +109,6 @@ define([
|
||||
'platform/commonUI/general',
|
||||
'platform/commonUI/inspect',
|
||||
'platform/commonUI/mobile',
|
||||
'platform/commonUI/themes/espresso',
|
||||
'platform/commonUI/notification',
|
||||
'platform/containment',
|
||||
'platform/execution',
|
||||
|
@ -21,13 +21,67 @@
|
||||
*****************************************************************************/
|
||||
|
||||
define([
|
||||
], function () {
|
||||
return {
|
||||
localStorage: function (openmct) {
|
||||
openmct.legacyRegistry.enable('platform/persistence/local');
|
||||
},
|
||||
myItems: function (openmct) {
|
||||
openmct.legacyRegistry.enable('platform/features/my-items');
|
||||
}
|
||||
'lodash'
|
||||
], function (_) {
|
||||
var bundleMap = {
|
||||
couchDB: 'platform/persistence/couch',
|
||||
elasticsearch: 'platform/persistence/elastic',
|
||||
espresso: 'platform/commonUI/themes/espresso',
|
||||
localStorage: 'platform/persistence/local',
|
||||
myItems: 'platform/features/my-items',
|
||||
snow: 'platform/commonUI/themes/snow',
|
||||
utcTimeSystem: 'platform/features/conductor/utcTimeSystem'
|
||||
};
|
||||
|
||||
var plugins = _.mapValues(bundleMap, function (bundleName, pluginName) {
|
||||
return function (openmct) {
|
||||
openmct.legacyRegistry.enable(bundleName);
|
||||
};
|
||||
});
|
||||
|
||||
plugins.CouchDB = function (url) {
|
||||
return function (openmct) {
|
||||
if (url) {
|
||||
var bundleName = "config/couch";
|
||||
openmct.legacyRegistry.register(bundleName, {
|
||||
"extensions": {
|
||||
"constants": [
|
||||
{
|
||||
"key": "COUCHDB_PATH",
|
||||
"value": url,
|
||||
"priority": "mandatory"
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
openmct.legacyRegistry.enable(bundleName);
|
||||
}
|
||||
|
||||
openmct.legacyRegistry.enable(bundleMap.couchDB);
|
||||
};
|
||||
};
|
||||
|
||||
plugins.Elasticsearch = function (url) {
|
||||
return function (openmct) {
|
||||
if (url) {
|
||||
var bundleName = "config/elastic";
|
||||
openmct.legacyRegistry.register(bundleName, {
|
||||
"extensions": {
|
||||
"constants": [
|
||||
{
|
||||
"key": "ELASTIC_ROOT",
|
||||
"value": url,
|
||||
"priority": "mandatory"
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
openmct.legacyRegistry.enable(bundleName);
|
||||
}
|
||||
|
||||
openmct.legacyRegistry.enable(bundleMap.elasticsearch);
|
||||
};
|
||||
};
|
||||
|
||||
return plugins;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user