Skip to content

Commit 2aed0df

Browse files
committed
- update admin package
1 parent eb023eb commit 2aed0df

File tree

7 files changed

+193
-277
lines changed

7 files changed

+193
-277
lines changed

addons/system-admin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"models":{"19fe71f8af13886":{"_id":"19fe71f8af13886","_name":"Worker","_inherit":["RuntimeComponent"],"_core":true,"worker":{"type":"sharedWorker","readOnly":false,"mandatory":false,"default":{}},"send":{"params":[{"name":"message","type":"object"}]}},"138a81fa1f16435":{"_id":"138a81fa1f16435","_name":"RuntimeAdmin","_inherit":["RuntimeComponent"],"_core":true,"start":{"params":[{"name":"path","type":"string","mandatory":false,"default":""}]},"stop":{}},"135c71078810af2":{"_id":"135c71078810af2","_name":"RuntimeChannel","_inherit":["RuntimeComponent"],"sync":{},"loadSystem":{"params":[{"name":"system","type":"object"}]},"createSchema":{"params":[{"name":"id","type":"string"},{"name":"schema","type":"object"}]},"updateSchema":{"params":[{"name":"id","type":"string"},{"name":"schema","type":"object"}]},"deleteSchema":{"params":[{"name":"id","type":"string"}]},"createModel":{"params":[{"name":"id","type":"string"},{"name":"model","type":"object"}]},"updateModel":{"params":[{"name":"id","type":"string"},{"name":"model","type":"object"}]},"deleteModel":{"params":[{"name":"id","type":"string"}]},"createType":{"params":[{"name":"id","type":"string"},{"name":"type","type":"object"}]},"updateType":{"params":[{"name":"id","type":"string"},{"name":"type","type":"object"}]},"deleteType":{"params":[{"name":"id","type":"string"}]},"createComponent":{"params":[{"name":"collection","type":"string"},{"name":"component","type":"object"}]},"updateComponent":{"params":[{"name":"id","type":"string"},{"name":"collection","type":"string"},{"name":"component","type":"object"}]},"deleteComponent":{"params":[{"name":"id","type":"string"},{"name":"collection","type":"string"}]},"createBehavior":{"params":[{"name":"behavior","type":"object"}]},"updateBehavior":{"params":[{"name":"id","type":"string"},{"name":"behavior","type":"object"}]},"deleteBehavior":{"params":[{"name":"id","type":"string"}]}}},"schemas":{"155ab18d911ad9f":{"_id":"155ab18d911ad9f","_name":"Worker","_inherit":["RuntimeComponent"],"_core":true,"worker":"property","send":"method"},"10374180581a41f":{"_id":"10374180581a41f","_name":"RuntimeAdmin","_inherit":["RuntimeComponent"],"_core":true,"start":"method","stop":"method"},"104ad1f48518376":{"_id":"104ad1f48518376","_name":"RuntimeChannel","sync":"event","loadSystem":"event","createSchema":"event","updateSchema":"event","deleteSchema":"event","createModel":"event","updateModel":"event","deleteModel":"event","createType":"event","updateType":"event","deleteType":"event","createComponent":"event","updateComponent":"event","deleteComponent":"event","createBehavior":"event","updateBehavior":"event","deleteBehavior":"event"}},"types":{"sharedWorker":{"name":"sharedWorker","type":"object","core":true}},"behaviors":{"1c00c107e01c9b3":{"_id":"1c00c107e01c9b3","component":"RuntimeAdmin","state":"start","action":"function start(path) {\n var Worker = null,\n worker = null,\n workerPath = '',\n RuntimeChannel = null,\n runtimeChannel = null;\n \n if (path) {\n workerPath = path + '/scripts/worker.js';\n workerPath = workerPath.replace(/\\/\\//g,'/');\n } else {\n workerPath = '/designer/scripts/worker.js';\n }\n \n if (typeof SharedWorker !== 'undefined') {\n \n if (!this.require('channel-admin')) {\n RuntimeChannel = this.require('RuntimeChannel');\n runtimeChannel = new RuntimeChannel({\n '_id': 'channel-admin',\n '_core': true\n });\n \n runtimeChannel.on('send', function send(message) {\n this.require('worker-admin').worker().port.postMessage(message);\n });\n \n // schema change events\n runtimeChannel.on('createSchema', function createSchema(id, schema) {\n this.require('metamodel').schema(schema);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('updateSchema', function updateSchema(id, schema) {\n this.require('metamodel').type(schema);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('deleteSchema', function deleteSchema(id) {\n $db['Runtime'].remove({'_id': id});\n this.require('metamodel').create();\n }, true);\n \n // model change events\n runtimeChannel.on('createModel', function createModel(id, model) {\n this.require('metamodel').schema(model);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('updateModel', function updateModel(id, model) {\n this.require('metamodel').type(model);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('deleteModel', function deleteModel(id) {\n $db['Runtime'].remove({'_id': id});\n this.require('metamodel').create();\n $component.removeFromMemory(id);\n }, true);\n \n // type change events\n runtimeChannel.on('createType', function createType(id, type) {\n this.require('metamodel').type(type);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('updateType', function updateType(id, type) {\n this.require('metamodel').type(type);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('deleteType', function deleteType(id) {\n $db['RuntimeType'].remove({'_id': id});\n this.require('metamodel').create();\n }, true);\n \n // component change events\n runtimeChannel.on('createComponent', function createComponent(model, component) {\n $db[model].insert(component);\n }, true);\n \n runtimeChannel.on('updateComponent', function updateComponent(id, collection, component) {\n $db[collection].update({'_id': id}, component);\n }, true);\n \n runtimeChannel.on('deleteComponent', function deleteComponent(id, collection) {\n $db[collection].remove({'_id': id});\n }, true);\n \n // behavior change events\n runtimeChannel.on('createBehavior', function createBehavior(component) {\n $db['RuntimeBehavior'].insert(component);\n }, true);\n runtimeChannel.on('updateBehavior', function updateBehavior(id, behavior) {\n this.require(id).action(behavior.action);\n });\n runtimeChannel.on('deleteBehavior', function deleteBehavior(id) {\n $db['RuntimeBehavior'].remove({'_id': id}); \n }, true);\n \n // System Designer event\n runtimeChannel.on('sync', function sync() {\n this.loadSystem(JSON.parse(this.require('db').system()));\n });\n \n Worker = this.require('Worker');\n worker = new Worker({\n '_id': 'worker-admin',\n '_core': true,\n 'worker': new SharedWorker(workerPath),\n });\n \n worker.worker().port.onmessage = function (e) {\n $db.RuntimeMessage.insert(e.data);\n };\n \n this.require('logger').info('admin is started');\n } else {\n this.require('logger').info('admin is already started');\n }\n } else {\n this.require('logger').warn('the browser can not run admin features');\n }\n}","useCoreAPI":true,"core":true},"1d7151dd2d1558f":{"_id":"1d7151dd2d1558f","component":"RuntimeAdmin","state":"stop","action":"function stop() {\n var worker = null,\n channel = null;\n \n worker = this.require('worker-admin');\n if (worker && worker.worker()) {\n worker.worker().port.onmessage = function () {};\n worker.destroy();\n \n channel = this.require('channel-admin');\n if (channel) {\n channel.destroy();\n }\n \n this.require('logger').info('admin is stopped');\n }\n}","useCoreAPI":true,"core":true}},"components":{"RuntimeAdmin":{"admin":{"_id":"admin","_core":true}}},"name":"system-admin","version":"0.3.0","description":"Runtime Component administration ","_id":"18ed81de331252c","master":false,"subsystem":false}
1+
{"models":{"138a81fa1f16435":{"_id":"138a81fa1f16435","_name":"RuntimeAdmin","_inherit":["RuntimeComponent"],"_core":true,"start":{},"stop":{}},"135c71078810af2":{"_id":"135c71078810af2","_name":"RuntimeChannel","_inherit":["RuntimeComponent"],"sync":{},"loadSystem":{"params":[{"name":"system","type":"object"}]},"createSchema":{"params":[{"name":"id","type":"string"},{"name":"schema","type":"object"}]},"updateSchema":{"params":[{"name":"id","type":"string"},{"name":"schema","type":"object"}]},"deleteSchema":{"params":[{"name":"id","type":"string"}]},"createModel":{"params":[{"name":"id","type":"string"},{"name":"model","type":"object"}]},"updateModel":{"params":[{"name":"id","type":"string"},{"name":"model","type":"object"}]},"deleteModel":{"params":[{"name":"id","type":"string"}]},"createType":{"params":[{"name":"id","type":"string"},{"name":"type","type":"object"}]},"updateType":{"params":[{"name":"id","type":"string"},{"name":"type","type":"object"}]},"deleteType":{"params":[{"name":"id","type":"string"}]},"createComponent":{"params":[{"name":"collection","type":"string"},{"name":"component","type":"object"}]},"updateComponent":{"params":[{"name":"id","type":"string"},{"name":"collection","type":"string"},{"name":"component","type":"object"}]},"deleteComponent":{"params":[{"name":"id","type":"string"},{"name":"collection","type":"string"}]},"createBehavior":{"params":[{"name":"behavior","type":"object"}]},"updateBehavior":{"params":[{"name":"id","type":"string"},{"name":"behavior","type":"object"}]},"deleteBehavior":{"params":[{"name":"id","type":"string"}]}}},"schemas":{"10374180581a41f":{"_id":"10374180581a41f","_name":"RuntimeAdmin","_inherit":["RuntimeComponent"],"_core":true,"start":"method","stop":"method"},"104ad1f48518376":{"_id":"104ad1f48518376","_name":"RuntimeChannel","sync":"event","loadSystem":"event","createSchema":"event","updateSchema":"event","deleteSchema":"event","createModel":"event","updateModel":"event","deleteModel":"event","createType":"event","updateType":"event","deleteType":"event","createComponent":"event","updateComponent":"event","deleteComponent":"event","createBehavior":"event","updateBehavior":"event","deleteBehavior":"event"}},"types":{},"behaviors":{"1c00c107e01c9b3":{"_id":"1c00c107e01c9b3","component":"RuntimeAdmin","state":"start","action":"function start() {\n var RuntimeChannel = null,\n runtimeChannel = null;\n \n if (!this.require('channel-admin')) {\n RuntimeChannel = this.require('RuntimeChannel');\n runtimeChannel = new RuntimeChannel({\n '_id': 'channel-admin',\n '_core': true\n });\n \n runtimeChannel.on('send', function send(message) {\n localStorage.setItem('system-designer-message', JSON.stringify(message));\n });\n \n // schema change events\n runtimeChannel.on('createSchema', function createSchema(id, schema) {\n this.require('metamodel').schema(schema);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('updateSchema', function updateSchema(id, schema) {\n this.require('metamodel').type(schema);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('deleteSchema', function deleteSchema(id) {\n $db.Runtime.remove({'_id': id});\n this.require('metamodel').create();\n }, true);\n \n // model change events\n runtimeChannel.on('createModel', function createModel(id, model) {\n this.require('metamodel').schema(model);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('updateModel', function updateModel(id, model) {\n this.require('metamodel').type(model);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('deleteModel', function deleteModel(id) {\n $db['Runtime'].remove({'_id': id});\n this.require('metamodel').create();\n $component.removeFromMemory(id);\n }, true);\n \n // type change events\n runtimeChannel.on('createType', function createType(id, type) {\n this.require('metamodel').type(type);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('updateType', function updateType(id, type) {\n this.require('metamodel').type(type);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('deleteType', function deleteType(id) {\n $db.RuntimeType.remove({'_id': id});\n this.require('metamodel').create();\n }, true);\n \n // component change events\n runtimeChannel.on('createComponent', function createComponent(model, component) {\n $db[model].insert(component);\n }, true);\n \n runtimeChannel.on('updateComponent', function updateComponent(id, collection, component) {\n $db[collection].update({'_id': id}, component);\n }, true);\n \n runtimeChannel.on('deleteComponent', function deleteComponent(id, collection) {\n $db[collection].remove({'_id': id});\n }, true);\n \n // behavior change events\n runtimeChannel.on('createBehavior', function createBehavior(component) {\n $db.RuntimeBehavior.insert(component);\n }, true);\n runtimeChannel.on('updateBehavior', function updateBehavior(id, behavior) {\n this.require(id).action(behavior.action);\n });\n runtimeChannel.on('deleteBehavior', function deleteBehavior(id) {\n $db.RuntimeBehavior.remove({'_id': id}); \n }, true);\n \n // System Designer event\n runtimeChannel.on('sync', function sync() {\n this.loadSystem(JSON.parse(this.require('db').system()));\n });\n\n window.addEventListener('storage', function (e) {\n if (e.key === 'system-designer-message') {\n $db.RuntimeMessage.insert(JSON.parse(e.newValue));\n }\n });\n \n this.require('logger').info('admin is started');\n } else {\n this.require('logger').info('admin is already started');\n }\n}","useCoreAPI":true,"core":true},"1d7151dd2d1558f":{"_id":"1d7151dd2d1558f","component":"RuntimeAdmin","state":"stop","action":"function stop() {\n}","useCoreAPI":true,"core":true}},"components":{"RuntimeAdmin":{"admin":{"_id":"admin","_core":true}}},"name":"system-admin","version":"0.4.0","description":"Runtime Component administration ","_id":"18ed81de331252c","master":false,"subsystem":false}

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "system-runtime",
3-
"version": "1.5.2",
3+
"version": "1.5.3",
44
"description": "Runtime, the System Runtime Environment",
55
"license": "Apache-2.0",
66
"homepage": "https://system-runtime.github.io",

0 commit comments

Comments
 (0)