diff --git a/app/assets/json/agents/basic3D.json b/app/assets/json/agents/basic3D.json index 8c2db51..df1682b 100644 --- a/app/assets/json/agents/basic3D.json +++ b/app/assets/json/agents/basic3D.json @@ -31,14 +31,20 @@ "molecule2": { "type": "Mesh", "geometry": { "type": "SphereGeometry", "args": [1, 1, 1] }, - "material": { "type": "MeshStandardMaterial", "color": "green" }, + "material": { "type": "MeshStandardMaterial", "color": "blue" }, "children": [ { "type": "Mesh", "geometry": { "type": "SphereGeometry", "args": [0.3, 16, 16] }, "material": { "type": "MeshStandardMaterial", "color": "red" }, "position": [0, 1, 0] - } + }, + { + "type": "Mesh", + "geometry": { "type": "SphereGeometry", "args": [0.3, 16, 16] }, + "material": { "type": "MeshStandardMaterial", "color": "red" }, + "position": [0, -1, 0] + } ] } } diff --git a/app/assets/json/global/services.json b/app/assets/json/global/services.json index 4768783..f966c7c 100644 --- a/app/assets/json/global/services.json +++ b/app/assets/json/global/services.json @@ -1,982 +1,12 @@ { "success": true, "error": "", - "payload": [ - { - "resource": "services", - "actions": [ - { - "action": "getServices", - "availableMethod": { - "uri": "https://__host__/stable/apis/services", - "method": "GET" - } - } - ] - }, - { - "resource": "/files", - "actions": [ - { - "action": "get", - "availableMethod": { - "uri": "/files/{id}", - "method": "GET" - } - } - ] - }, - { - "resource": "company", - "actions": [ - { - "action": "revoke", - "availableMethod": { - "uri": "https://__host__/stable/bypass/company/{pic}/token", - "method": "DELETE" - } - }, - { - "action": "search", - "availableMethod": { - "uri": "https://__host__/stable/bypass/company/{pic}/token", - "method": "POST" - } - }, - { - "action": "grant", - "availableMethod": { - "uri": "https://__host__/stable/bypass/company/{pic}/token", - "method": "PUT" - } - } - ] - }, - { - "resource": "programs", - "actions": [ - { - "action": "removeProgram", - "availableMethod": { - "uri": "https://__host__/stable/bypass/programs", - "method": "DELETE" - } - }, - { - "action": "getPrograms", - "availableMethod": { - "uri": "https://__host__/stable/bypass/programs", - "method": "POST" - } - }, - { - "action": "addProgram", - "availableMethod": { - "uri": "https://__host__/stable/bypass/programs", - "method": "PUT" - } - } - ] - }, - { - "resource": "roles", - "actions": [ - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/bypass/roles", - "method": "GET" - } - } - ] - }, - { - "resource": "tokens", - "actions": [ - { - "action": "consume", - "availableMethod": { - "uri": "https://__host__/stable/bypass/tokens/consume", - "method": "POST" - } - }, - { - "action": "getSettings", - "availableMethod": { - "uri": "https://__host__/stable/bypass/tokens/settings", - "method": "POST" - } - }, - { - "action": "setSettings", - "availableMethod": { - "uri": "https://__host__/stable/bypass/tokens/settings", - "method": "PUT" - } - }, - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/bypass/tokens", - "method": "POST" - } - }, - { - "action": "view", - "availableMethod": { - "uri": "https://__host__/stable/bypass/tokens/{tokenid}", - "method": "GET" - } - }, - { - "action": "assign", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals/bypass", - "method": "PUT" - } - } - ] - }, - { - "resource": "XXXtokens", - "actions": [ - { - "action": "consume", - "availableMethod": { - "uri": "https://__host__/stable/bypass/tokens/consume", - "method": "POST" - } - }, - { - "action": "getSettings", - "availableMethod": { - "uri": "https://__host__/stable/bypass/tokens/settings", - "method": "POST" - } - }, - { - "action": "setSettings", - "availableMethod": { - "uri": "https://__host__/stable/bypass/tokens/settings", - "method": "PUT" - } - }, - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/bypass/tokens", - "method": "POST" - } - }, - { - "action": "view", - "availableMethod": { - "uri": "https://__host__/stable/bypass/tokens/{tokenid}", - "method": "GET" - } - }, - { - "action": "assign", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals/bypass", - "method": "PUT" - } - } - ] - }, - { - "resource": "users", - "actions": [ - { - "action": "search", - "availableMethod": { - "uri": "https://__host__/stable/users/search", - "method": "POST" - } - }, - { - "action": "revoke", - "availableMethod": { - "uri": "https://__host__/stable/bypass/users/{id}", - "method": "DELETE" - } - }, - { - "action": "get", - "availableMethod": { - "uri": "https://__host__/stable/bypass/users/{id}", - "method": "GET" - } - }, - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/bypass/users", - "method": "POST" - } - }, - { - "action": "create", - "availableMethod": { - "uri": "https://__host__/stable/bypass/users", - "method": "PUT" - } - } - ] - }, - { - "resource": "/S3Files", - "actions": [ - { - "action": "viewDocument", - "availableMethod": { - "uri": "https://__host__/stable/vod/source?file=", - "method": "GET" - } - }, - { - "action": "viewVideo", - "availableMethod": { - "uri": "https://__host__/stable/vod/manifest?file=", - "method": "GET" - } - }, - { - "action": "uploadPdf", - "availableMethod": { - "getSignedUrl": "https://__host__/stable/vod/source?file=", - "getSignedMethod": "PUT" - } - }, - { - "action": "uploadVideo", - "availableMethod": { - "getSignedUrl": "https://__host__/stable/vod/source?file=", - "getSignedMethod": "PUT" - } - }, - { - "action": "checkVideoConversion", - "availableMethod": { - "uri": "https://__host__/stable/vod/jobs", - "method": "POST" - } - } - ] - }, - { - "resource": "/organisations", - "actions": [ - { - "action": "search", - "availableMethod": { - "uri": "https://__host__/stable/organisations", - "method": "POST" - } - }, - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/organisations", - "method": "GET" - } - }, - { - "action": "apply", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/members/{uid}", - "method": "PUT" - } - } - ] - }, - { - "resource": "/organisations/{pic}", - "actions": [ - { - "action": "read", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}", - "method": "GET" - } - }, - { - "action": "update", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}", - "method": "PUT" - } - } - ] - }, - { - "resource": "/organisations/{pic}/members", - "actions": [ - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/members", - "method": "GET" - } - }, - { - "action": "grant", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/members/{uid}", - "method": "PUT" - } - }, - { - "action": "revoke", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/members/{uid}", - "method": "PUT" - } - }, - { - "action": "update", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/members/{uid}", - "method": "PUT" - } - }, - { - "action": "add", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/members/{uid}", - "method": "PUT" - } - }, - { - "action": "search", - "availableMethod": { - "uri": "https://__host__/stable/users/search", - "method": "POST" - } - } - ] - }, - { - "resource": "/organisations/{pic}/members/{uid}", - "actions": [ - { - "action": "grant", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/members/{uid}", - "method": "PUT" - } - }, - { - "action": "revoke", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/members/{uid}", - "method": "PUT" - } - }, - { - "action": "update", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/members/{uid}", - "method": "PUT" - } - } - ] - }, - { - "resource": "/organisations/{pic}/coachings", - "actions": [ - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/coachings", - "method": "GET" - } - }, - { - "action": "read", - "availableMethod": { - "uri": "https://eic__stage__.eismea.eu/mydashboard/mycoaching", - "method": "GET" - } - } - ] - }, - { - "resource": "/organisations/{pic}/proposals", - "actions": [ - { - "action": "search", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals", - "method": "POST" - } - }, - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals", - "method": "GET" - } - }, - { - "action": "apply", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals/{pid}/members/{uid}", - "method": "PUT" - } - }, - { - "action": "create", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals", - "method": "PUT" - } - } - ] - }, - { - "resource": "/organisations/{pic}/proposals/{pid}", - "actions": [ - { - "action": "read", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals/{pid}", - "method": "GET" - } - }, - { - "action": "update", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals/{pid}", - "method": "PUT" - } - }, - { - "action": "organisationUpdate", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}", - "method": "GET" - } - }, - { - "action": "clone", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals", - "method": "PUT" - } - }, - { - "action": "complain", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals/{pid}/complaint", - "method": "PUT" - } - } - ] - }, - { - "resource": "/organisations/{pic}/proposals/{pid}/members", - "actions": [ - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals/{pid}/members", - "method": "GET" - } - }, - { - "action": "grant", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals/{pid}/members/{uid}", - "method": "PUT" - } - }, - { - "action": "revoke", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals/{pid}/members/{uid}", - "method": "PUT" - } - } - ] - }, - { - "resource": "/organisations/{pic}/proposals/{pid}/complaints", - "actions": [ - { - "action": "get", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals/{pid}/complaints", - "method": "GET" - } - }, - { - "action": "create", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals/{pid}/complaints", - "method": "PUT" - } - } - ] - }, - { - "resource": "/organisations/{pic}/proposals/{pid}/team", - "actions": [ - { - "action": "create", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals/{pid}/team", - "method": "PUT" - } - }, - { - "action": "update", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals/{pid}/team/{uid}", - "method": "PUT" - } - }, - { - "action": "delete", - "availableMethod": { - "uri": "https://__host__/stable/organisations/{pic}/proposals/{pid}/team/{uid}", - "method": "DELETE" - } - } - ] - }, - { - "resource": "explorer", - "actions": [ - { - "action": "filters", - "availableMethod": { - "uri": "https://__host__/stable/storage/entities", - "method": "GET" - } - }, - { - "action": "search", - "availableMethod": { - "uri": "https://__host__/stable/storage/entities", - "method": "POST" - } - } - ] - }, - { - "resource": "/zammad/tickets", - "actions": [ - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/zammad/tickets", - "method": "GET" - } - }, - { - "action": "create", - "availableMethod": { - "uri": "https://__host__/stable/zammad/tickets", - "method": "POST" - } - }, - { - "action": "get", - "availableMethod": { - "uri": "https://__host__/stable/zammad/tickets/{id}", - "method": "GET" - } - }, - { - "action": "update", - "availableMethod": { - "uri": "https://__host__/stable/zammad/tickets/{id}/articles", - "method": "POST" - } - }, - { - "action": "download", - "availableMethod": { - "uri": "https://__host__/files/stable/zammad/tickets/{ticid}/articles/{artid}/attachments/{attid}", - "method": "GET" - } - - } - ] - }, - { - "resource": "/soe", - "actions": [ - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/soe", - "method": "GET" - } - }, - { - "action": "members", - "availableMethod": { - "uri": "https://__host__/stable/soe/members", - "method": "GET" - } - }, - { - "action": "project", - "availableMethod": { - "uri": "https://__host__/stable/soe/organisations/{pic}/projects/{projectId}/fundings", - "method": "GET" - } - - }, - { - "action": "create", - "availableMethod": { - "uri": "https://__host__/stable/soe/organisations/{pic}/projects/{projectId}/fundings", - "method": "PUT" - } - }, - { - "action": "funding", - "availableMethod": { - "uri": "https://__host__/stable/soe/organisations/{pic}/projects/{projectId}/fundings/{fundingId}", - "method": "GET" - } - }, - { - "action": "delete", - "availableMethod": { - "uri": "https://__host__/stable/soe/organisations/{pic}/projects/{projectId}/fundings/{fundingId}", - "method": "DELETE" - } - }, - { - "action": "update", - "availableMethod": { - "uri": "https://__host__/stable/soe/organisations/{pic}/projects/{projectId}/fundings/{fundingId}", - "method": "PUT" - } - } - ] - }, - { - "resource": "/icmp", - "actions": [ - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/icmp/projects", - "method": "POST" - } - }, - { - "action": "getProject", - "availableMethod": { - "uri": "https://__host__/stable/icmp/projects/{projectId}", - "method": "GET" - } - }, - { - "action": "getProjectDocuments", - "availableMethod": { - "uri": "https://__host__/stable/icmp/projects/{projectId}/documents", - "method": "GET" - } - }, - { - "action": "getProjectContributors", - "availableMethod": { - "uri": "https://__host__/stable/icmp/projects/{projectId}/contributors", - "method": "GET" - } - }, - { - "action": "getProjectNode", - "availableMethod": { - "uri": "https://__host__/stable/icmp/projects/{projectId}/{node}/{nodeId}", - "method": "GET" - } - }, - { - "action": "saveProjectNode", - "availableMethod": { - "uri": "https://__host__/stable/icmp/projects/{projectId}/{node}/{nodeId}", - "method": "PUT" - } - }, - { - "action": "saveProjectNodeComments", - "availableMethod": { - "uri": "https://__host__/stable/icmp/projects/{projectId}/{node}/{nodeId}/comments", - "method": "PUT" - } - } - ] - }, - { - "resource": "/mailing", - "actions": [ - { - "action": "search", - "availableMethod": { - "uri": "https://__host__/stable/mailing", - "method": "POST" - } - }, - { - "action": "save", - "availableMethod": { - "uri": "https://__host__/stable/mailing", - "method": "PUT" - } - }, - { - "action": "read", - "availableMethod": { - "uri": "https://__host__/stable/mailing/{mid}", - "method": "GET" - } - }, - { - "action": "delete", - "availableMethod": { - "uri": "https://__host__/stable/mailing/{mid}", - "method": "DELETE" - } - }, - { - "action": "test", - "availableMethod": { - "uri": "https://__host__/stable/mailing/{mid}/test", - "method": "PUT" - } - }, - { - "action": "schedule", - "availableMethod": { - "uri": "https://__host__/stable/mailing/{mid}", - "method": "PUT" - } - } - ] - }, - { - "resource": "/mailing/folders", - "actions": [ - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/mailing/folders", - "method": "POST" - } - }, - { - "action": "add", - "availableMethod": { - "uri": "https://__host__/stable/mailing/folders", - "method": "PUT" - } - }, - { - "action": "delete", - "availableMethod": { - "uri": "https://__host__/stable/mailing/folders", - "method": "DELETE" - } - } - ] - }, - { - "resource": "/mailing/{mid}/recipients", - "actions": [ - { - "action": "read", - "availableMethod": { - "uri": "https://__host__/stable/mailing/{mid}/recipients", - "method": "GET" - } - } - ] - }, - { - "resource": "/mailing/{mid}/bounces", - "actions": [ - { - "action": "read", - "availableMethod": { - "uri": "https://__host__/stable/mailing/{mid}/bounces", - "method": "GET" - } - } - ] - }, - { - "resource": "/mailing/{mid}/imports", - "actions": [ - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/mailing/{mid}/imports", - "method": "GET" - } - }, - { - "action": "save", - "availableMethod": { - "uri": "https://__host__/stable/mailing/{mid}/imports", - "method": "PUT" - } - }, - { - "action": "read", - "availableMethod": { - "uri": "https://__host__/stable/mailing/{mid}/imports/{iid}", - "method": "GET" - } - }, - { - "action": "delete", - "availableMethod": { - "uri": "https://__host__/stable/mailing/{mid}/imports", - "method": "DELETE" - } - } - ] - }, - { - "resource": "/templates", - "actions": [ - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/templitor", - "method": "POST" - } - }, - { - "action": "search", - "availableMethod": { - "uri": "https://__host__/stable/templitor", - "method": "POST" - } - }, - { - "action": "getImages", - "availableMethod": { - "uri": "https://__host__/stable/templitor/images", - "method": "POST" - } - }, - { - "action": "addImage", - "availableMethod": { - "uri": "https://__host__/stable/templitor/images", - "method": "PUT" - } - }, - { - "action": "deleteImage", - "availableMethod": { - "uri": "https://__host__/stable/templitor/images/{pid}", - "method": "DELETE" - } - }, - { - "action": "save", - "availableMethod": { - "uri": "https://__host__/stable/templitor", - "method": "PUT" - } - }, - { - "action": "read", - "availableMethod": { - "uri": "https://__host__/stable/templitor/{tid}", - "method": "GET" - } - }, - { - "action": "delete", - "availableMethod": { - "uri": "https://__host__/stable/templitor/{tid}", - "method": "DELETE" - } - }, - { - "action": "testTemplateMail", - "availableMethod": { - "uri": "https://__host__/stable/templitor/{tid}", - "method": "PUT" - } - }, - { - "action": "uploadTplImage", - "availableMethod": { - "uri": "https://__host__/stable/public/{tplImgName}", - "method": "PUT" - } - } - ] - }, - { - "resource": "/templitor/folders", - "actions": [ - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/templitor/folders", - "method": "POST" - } - }, - { - "action": "add", - "availableMethod": { - "uri": "https://__host__/stable/templitor/folders", - "method": "PUT" - } - }, - { - "action": "delete", - "availableMethod": { - "uri": "https://__host__/stable/templitor/folders", - "method": "DELETE" - } - } - ] - }, - { - "resource": "/contactMgr", - "actions": [ - { - "action": "list", - "availableMethod": { - "uri": "https://__host__/stable/contactMgr", - "method": "GET" - } - }, - { - "action": "get", - "availableMethod": { - "uri": "https://__host__/stable/contactMgr/{qcid}", - "method": "GET" - } - }, - { - "action": "getFields", - "availableMethod": { - "uri": "https://__host__/stable/contactMgr/{qcid}/fields", - "method": "POST" - } - }, - { - "action": "execute", - "availableMethod": { - "uri": "https://__host__/stable/contactMgr/{qcid}", - "method": "PUT" - } - } - ] - } - ] + "payload": { + "/agents": { + "getSprites": { + "uri": "/api/agent-sprites/{group}", + "method": "GET" + } + } + } } diff --git a/app/assets/json/threetobus/eventsMapping.json b/app/assets/json/threetobus/eventsMapping.json index 62506c3..78921c1 100644 --- a/app/assets/json/threetobus/eventsMapping.json +++ b/app/assets/json/threetobus/eventsMapping.json @@ -13,7 +13,8 @@ "position.y": "coords.z" }, "tween": true, - "tweenDelay": 200 + "tweenDelay": 150, + "tweenEasing":"Linear" } ] } diff --git a/app/controllers/live/DashboardsController.js b/app/controllers/live/DashboardsController.js index 80547c6..750be36 100644 --- a/app/controllers/live/DashboardsController.js +++ b/app/controllers/live/DashboardsController.js @@ -13,8 +13,9 @@ class DashboardsController extends EICController { * * @returns */ - spaceViewer() { + async spaceViewer() { const models = { + agents : new AgentsModel('/agents') } const ttb = new app.LoadedModules.Threetobus({ @@ -26,8 +27,11 @@ class DashboardsController extends EICController { grid: true, }) - const m1 = ttb.agentFromJSON('agent42', this.agentDefs.molecule1) - ttb.scene.add(m1) + this.agentDefs = await models.agents.getSprites('Basic 3D') + const a1 = ttb.agentFromJSON('agent42', this.agentDefs.nocode1) + const a2 = ttb.agentFromJSON('agent42', this.agentDefs.nocode2) + ttb.scene.add(a1) + ttb.scene.add(a2) //TODO: eventsMapping: address child by suffix in assignations diff --git a/app/controllers/live/DashboardsController.json b/app/controllers/live/DashboardsController.json index b205a0a..9c5ae2a 100644 --- a/app/controllers/live/DashboardsController.json +++ b/app/controllers/live/DashboardsController.json @@ -13,6 +13,7 @@ } ], "models": [ + "AgentsModel" ], "views": [ "visualisers/SpaceView" @@ -34,7 +35,6 @@ ], "json": [ {"id":"arenaConfig", "name": "arena/arenaConfig1.json"}, - {"id":"agentDefs", "name": "agents/basic3D.json"}, {"id":"eventsMapping", "name": "threetobus/eventsMapping.json"} ] } diff --git a/app/libs/EIC/EICModel.js b/app/libs/EIC/EICModel.js index ca80ef0..a8adca4 100755 --- a/app/libs/EIC/EICModel.js +++ b/app/libs/EIC/EICModel.js @@ -32,30 +32,6 @@ class EICModel extends Model { this.setPrivileges(resource, privileges); } - /** - * - * @param {*} action - * @param {*} resource - * @returns {object} - */ - getApiEndpoint(action, resource=null) { - resource = resource || this.resource; - for(let ApiBizObj of Object.keys(app.config.api)) { - - //If called without real ids - if(ApiBizObj==resource) return(JSON.parse(JSON.stringify(app.config.api[ApiBizObj][action]))); - - //If called with real ids - let re = new RegExp('^'+ApiBizObj.replace(/\//g,'\\/').replace(/\{\w+\}/gi,'([0-9a-zA-Z]+)')+'$', 'm') - if(resource.match(re)) { - if(app.config.api[ApiBizObj].hasOwnProperty(action)) return(JSON.parse(JSON.stringify(app.config.api[ApiBizObj][action]))); - else console.error(`No API endpoint for action "${action}" on resource "${resource}"`) - } - } - console.error(`No API service for resource:${resource}`) - return({ "method":null, "uri": null }); - } - setPrivileges(resource, privileges) { this.resource = resource; this.privileges = privileges || []; diff --git a/app/libs/myUser.js b/app/libs/myUser.js index 0ce6f69..d346ce5 100755 --- a/app/libs/myUser.js +++ b/app/libs/myUser.js @@ -34,7 +34,20 @@ class myUser extends app.LoadedClasses.User { * @returns {Array} */ getRoles() { return(app.User.roles); } - + + /** + * + * @returns {Promise} + */ + fetchServices() { + return(fetch('/app/assets/json/global/services.json?'+crypto.randomUUID(), { + method: 'GET' + }) + .then(response => response.text()) + .then(response => JSON.parse(response)) + .then(response => app.config.api = response.payload) + ) + } /** * @@ -103,6 +116,7 @@ class myUser extends app.LoadedClasses.User { }) this.model = new MyUserModleModel() this.loadPreferences() + this.fetchServices() }, 'myUser') } @@ -191,7 +205,6 @@ class myUser extends app.LoadedClasses.User { loadPreferences() { this.model.getPreferences().then(settings => { - console.log("Prefs received from bus:", settings) this.preferences = settings.value || {} }) } diff --git a/app/models/AgentsModel.js b/app/models/AgentsModel.js new file mode 100644 index 0000000..7a997ab --- /dev/null +++ b/app/models/AgentsModel.js @@ -0,0 +1,18 @@ +class AgentsModel extends EICModel { + + constructor() { + super() + this.ressource = '/agents' + } + + async getSprites(group) { + let endpoint = app.config.api[this.ressource].getSprites + endpoint.uri = endpoint.uri.replace('{group}', group) + return ( + this.request(endpoint.uri, endpoint.method) + .then( async serverData => serverData.payload.agentSprites) + ) + } +} + +app.registerClass('AgentsModel', AgentsModel); \ No newline at end of file diff --git a/app/thirdparty/Threetobus/threetobus.module.js b/app/thirdparty/Threetobus/threetobus.module.js index f13b0e7..efad0bd 100644 --- a/app/thirdparty/Threetobus/threetobus.module.js +++ b/app/thirdparty/Threetobus/threetobus.module.js @@ -130,6 +130,7 @@ export class Threetobus{ && (typeof(tweenProps[tweenGroup].method)=='function')){ tweenProps[tweenGroup].props.object = obj3D tweenProps[tweenGroup].props.delay = mapping.tweenDelay + tweenProps[tweenGroup].props.easing = mapping.tweenEasing tweenProps[tweenGroup].method(tweenProps[tweenGroup].props) } // else { console.log('avoided tween', tweenGroup)} } @@ -262,11 +263,12 @@ export class Threetobus{ // Relative: dx,dy,dz // delay: ms // easings: Linear, Quadratic, Cubic, Quartic, Quintic, Sinusoidal, Exponential, Circular, Elastic, Back, Bounce - // easingMode: In → starts slow, accelerates towards the end. + // easingMode: None (mandatory for 'Linear') + // In → starts slow, accelerates towards the end. // Out → starts fast, decelerates smoothly. // InOut → slow at both ends, faster in the middle. options.easing = options.easing ? options.easing : 'Quadratic' - options.easingMode = options.easingMode ? options.easingMode : 'InOut' + options.easingMode = options.easingMode ? options.easingMode : ((options.easing !='Linear') ? 'InOut' : 'None') let newX = parseFloat(options.x) newX = isNaN(newX) ? options.object.position.x : newX diff --git a/app/thirdparty/eicui/eicui-2.0.css b/app/thirdparty/eicui/eicui-2.0.css index cad17b2..d748162 100755 --- a/app/thirdparty/eicui/eicui-2.0.css +++ b/app/thirdparty/eicui/eicui-2.0.css @@ -772,7 +772,6 @@ label[secondary],p[secondary],b[secondary],span[secondary] { color: var(--eicui- [eicapp] h1 { font: normal normal 400 2rem/2.5rem arial,sans-serif; - border-bottom: 1px solid var(--eicui-base-color-grey-75); color: var(--eicui-base-color-primary-100); font-size: var(--eicui-base-font-size-4xl); margin: var(--eicui-base-font-size-3xl) 0 var(--eicui-base-font-size-2xl); diff --git a/app/views/visualisers/SpaceView.js b/app/views/visualisers/SpaceView.js index 6c8197e..b4f22e8 100644 --- a/app/views/visualisers/SpaceView.js +++ b/app/views/visualisers/SpaceView.js @@ -42,6 +42,7 @@ class SpaceView extends EICDomContent { this.renderingEngine.camera.layers.disable(layerId) } } + //TODO save & restore in prefs } }