agents defs from DB

This commit is contained in:
STEINNI
2025-10-12 19:45:18 +00:00
parent f62a7176d4
commit a38d2da3e4
11 changed files with 64 additions and 1014 deletions
+8 -2
View File
@@ -31,14 +31,20 @@
"molecule2": { "molecule2": {
"type": "Mesh", "type": "Mesh",
"geometry": { "type": "SphereGeometry", "args": [1, 1, 1] }, "geometry": { "type": "SphereGeometry", "args": [1, 1, 1] },
"material": { "type": "MeshStandardMaterial", "color": "green" }, "material": { "type": "MeshStandardMaterial", "color": "blue" },
"children": [ "children": [
{ {
"type": "Mesh", "type": "Mesh",
"geometry": { "type": "SphereGeometry", "args": [0.3, 16, 16] }, "geometry": { "type": "SphereGeometry", "args": [0.3, 16, 16] },
"material": { "type": "MeshStandardMaterial", "color": "red" }, "material": { "type": "MeshStandardMaterial", "color": "red" },
"position": [0, 1, 0] "position": [0, 1, 0]
} },
{
"type": "Mesh",
"geometry": { "type": "SphereGeometry", "args": [0.3, 16, 16] },
"material": { "type": "MeshStandardMaterial", "color": "red" },
"position": [0, -1, 0]
}
] ]
} }
} }
+8 -978
View File
@@ -1,982 +1,12 @@
{ {
"success": true, "success": true,
"error": "", "error": "",
"payload": [ "payload": {
{ "/agents": {
"resource": "services", "getSprites": {
"actions": [ "uri": "/api/agent-sprites/{group}",
{ "method": "GET"
"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"
}
}
]
}
]
} }
@@ -13,7 +13,8 @@
"position.y": "coords.z" "position.y": "coords.z"
}, },
"tween": true, "tween": true,
"tweenDelay": 200 "tweenDelay": 150,
"tweenEasing":"Linear"
} }
] ]
} }
+7 -3
View File
@@ -13,8 +13,9 @@ class DashboardsController extends EICController {
* *
* @returns * @returns
*/ */
spaceViewer() { async spaceViewer() {
const models = { const models = {
agents : new AgentsModel('/agents')
} }
const ttb = new app.LoadedModules.Threetobus({ const ttb = new app.LoadedModules.Threetobus({
@@ -26,8 +27,11 @@ class DashboardsController extends EICController {
grid: true, grid: true,
}) })
const m1 = ttb.agentFromJSON('agent42', this.agentDefs.molecule1) this.agentDefs = await models.agents.getSprites('Basic 3D')
ttb.scene.add(m1) 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 //TODO: eventsMapping: address child by suffix in assignations
@@ -13,6 +13,7 @@
} }
], ],
"models": [ "models": [
"AgentsModel"
], ],
"views": [ "views": [
"visualisers/SpaceView" "visualisers/SpaceView"
@@ -34,7 +35,6 @@
], ],
"json": [ "json": [
{"id":"arenaConfig", "name": "arena/arenaConfig1.json"}, {"id":"arenaConfig", "name": "arena/arenaConfig1.json"},
{"id":"agentDefs", "name": "agents/basic3D.json"},
{"id":"eventsMapping", "name": "threetobus/eventsMapping.json"} {"id":"eventsMapping", "name": "threetobus/eventsMapping.json"}
] ]
} }
-24
View File
@@ -32,30 +32,6 @@ class EICModel extends Model {
this.setPrivileges(resource, privileges); 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) { setPrivileges(resource, privileges) {
this.resource = resource; this.resource = resource;
this.privileges = privileges || []; this.privileges = privileges || [];
+15 -2
View File
@@ -34,7 +34,20 @@ class myUser extends app.LoadedClasses.User {
* @returns {Array<string>} * @returns {Array<string>}
*/ */
getRoles() { return(app.User.roles); } getRoles() { return(app.User.roles); }
/**
*
* @returns {Promise<Array>}
*/
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.model = new MyUserModleModel()
this.loadPreferences() this.loadPreferences()
this.fetchServices()
}, 'myUser') }, 'myUser')
} }
@@ -191,7 +205,6 @@ class myUser extends app.LoadedClasses.User {
loadPreferences() { loadPreferences() {
this.model.getPreferences().then(settings => { this.model.getPreferences().then(settings => {
console.log("Prefs received from bus:", settings)
this.preferences = settings.value || {} this.preferences = settings.value || {}
}) })
} }
+18
View File
@@ -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);
+4 -2
View File
@@ -130,6 +130,7 @@ export class Threetobus{
&& (typeof(tweenProps[tweenGroup].method)=='function')){ && (typeof(tweenProps[tweenGroup].method)=='function')){
tweenProps[tweenGroup].props.object = obj3D tweenProps[tweenGroup].props.object = obj3D
tweenProps[tweenGroup].props.delay = mapping.tweenDelay tweenProps[tweenGroup].props.delay = mapping.tweenDelay
tweenProps[tweenGroup].props.easing = mapping.tweenEasing
tweenProps[tweenGroup].method(tweenProps[tweenGroup].props) tweenProps[tweenGroup].method(tweenProps[tweenGroup].props)
} // else { console.log('avoided tween', tweenGroup)} } // else { console.log('avoided tween', tweenGroup)}
} }
@@ -262,11 +263,12 @@ export class Threetobus{
// Relative: dx,dy,dz // Relative: dx,dy,dz
// delay: ms // delay: ms
// easings: Linear, Quadratic, Cubic, Quartic, Quintic, Sinusoidal, Exponential, Circular, Elastic, Back, Bounce // 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. // Out → starts fast, decelerates smoothly.
// InOut → slow at both ends, faster in the middle. // InOut → slow at both ends, faster in the middle.
options.easing = options.easing ? options.easing : 'Quadratic' 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) let newX = parseFloat(options.x)
newX = isNaN(newX) ? options.object.position.x : newX newX = isNaN(newX) ? options.object.position.x : newX
-1
View File
@@ -772,7 +772,6 @@ label[secondary],p[secondary],b[secondary],span[secondary] { color: var(--eicui-
[eicapp] h1 { [eicapp] h1 {
font: normal normal 400 2rem/2.5rem arial,sans-serif; 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); color: var(--eicui-base-color-primary-100);
font-size: var(--eicui-base-font-size-4xl); font-size: var(--eicui-base-font-size-4xl);
margin: var(--eicui-base-font-size-3xl) 0 var(--eicui-base-font-size-2xl); margin: var(--eicui-base-font-size-3xl) 0 var(--eicui-base-font-size-2xl);
+1
View File
@@ -42,6 +42,7 @@ class SpaceView extends EICDomContent {
this.renderingEngine.camera.layers.disable(layerId) this.renderingEngine.camera.layers.disable(layerId)
} }
} }
//TODO save & restore in prefs
} }
} }