@operato/scene-integration 1.0.0-alpha.34 → 1.0.0-alpha.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/assets/favicon.ico +0 -0
- package/assets/images/spinner.png +0 -0
- package/dist/client-api.js +2 -2
- package/dist/client-api.js.map +1 -1
- package/dist/connection-control.d.ts +0 -5
- package/dist/connection-control.js +2 -27
- package/dist/connection-control.js.map +1 -1
- package/dist/connection-state-subscription.js +2 -2
- package/dist/connection-state-subscription.js.map +1 -1
- package/dist/data-subscription.js +1 -1
- package/dist/data-subscription.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/scenario-control.d.ts +0 -4
- package/dist/scenario-control.js +11 -32
- package/dist/scenario-control.js.map +1 -1
- package/dist/scenario-instance-subscription.js +1 -1
- package/dist/scenario-instance-subscription.js.map +1 -1
- package/dist/scenario-queue-subscription.js +1 -1
- package/dist/scenario-queue-subscription.js.map +1 -1
- package/dist/scenario-run.d.ts +0 -4
- package/dist/scenario-run.js +6 -26
- package/dist/scenario-run.js.map +1 -1
- package/dist/scenario-start.d.ts +0 -5
- package/dist/scenario-start.js +1 -27
- package/dist/scenario-start.js.map +1 -1
- package/dist/scenario-stop.d.ts +0 -5
- package/dist/scenario-stop.js +1 -27
- package/dist/scenario-stop.js.map +1 -1
- package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +15 -0
- package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +15 -0
- package/logs/application-2022-07-17-17.log +13 -0
- package/logs/connections-2022-07-17-17.log +105 -0
- package/package.json +6 -7
- package/src/client-api.ts +2 -2
- package/src/connection-control.ts +2 -34
- package/src/connection-state-subscription.ts +2 -3
- package/src/data-subscription.ts +1 -2
- package/src/scenario-control.ts +13 -36
- package/src/scenario-instance-subscription.ts +1 -1
- package/src/scenario-queue-subscription.ts +1 -2
- package/src/scenario-run.ts +7 -30
- package/src/scenario-start.ts +1 -33
- package/src/scenario-stop.ts +1 -33
- package/tsconfig.tsbuildinfo +1 -1
- package/src/origin-client.ts +0 -133
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenario-start.js","sourceRoot":"","sources":["../src/scenario-start.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAmB,UAAU,EAAc,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"scenario-start.js","sourceRoot":"","sources":["../src/scenario-start.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAmB,UAAU,EAAc,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAC5G,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,cAAc;SACrB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,cAAc;YACpB,QAAQ,EAAE;gBACR,OAAO,EAAE,SAAS;aACnB;SACF;QACD;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,WAAW;SAClB;KACF;IACD,gBAAgB,EAAE,WAAW;IAC7B,IAAI,EAAE,gCAAgC;CACvC,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAGpE,MAAM,KAAK,KAAK;QACd,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE;YACzB,aAAa,CAAC,MAAM,GAAG,IAAI,KAAK,EAAE,CAAA;YAClC,aAAa,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,oCAAoC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;SAC/F;QACD,OAAO,aAAa,CAAC,MAAM,CAAA;IAC7B,CAAC;IAED,MAAM,CAAC,OAAiC;QACtC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAC9C,OAAO,CAAC,SAAS,EAAE,CAAA;QACnB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IACxE,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,KAAiB;QAC9B,IAAI,WAAW,IAAI,KAAK,EAAE;YACxB,IAAI,CAAC,WAAW,EAAE,CAAA;SACnB;IACH,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAA;IAC7B,CAAC;IAED,IAAI,SAAS,CAAC,SAAS;QACrB,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;IACvC,CAAC;IAED,KAAK,CAAC,WAAW;;QACf,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAC1D,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU;YAAE,OAAM;QAEjD,IAAI;YACF,SAAS,GAAG,OAAO,SAAS,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;SAC7E;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;SACjB;QAED,IAAI,MAAM,EAAE;YACV,IAAI,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;gBAChC,KAAK,EAAE,GAAG,CAAA;;;;;;;;SAQT;gBACD,SAAS,EAAE;oBACT,YAAY,EAAE,YAAY;oBAC1B,YAAY,EAAE,YAAY;oBAC1B,SAAS;iBACV;aACF,CAAC,CAAA;YAEF,IAAI,CAAC,IAAI,GAAG,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,0CAAE,aAAa,0CAAE,IAAI,CAAA;SAChD;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nimport { Component, ComponentNature, DataSource, Properties, RectPath, Shape } from '@hatiolab/things-scene'\nimport { client } from '@operato/graphql'\n\nimport { scenarios } from './client-api'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'string',\n label: 'instance-name',\n name: 'instanceName'\n },\n {\n type: 'select',\n label: 'scenario-name',\n name: 'scenarioName',\n property: {\n options: scenarios\n }\n },\n {\n type: 'data',\n label: 'variables',\n name: 'variables'\n }\n ],\n 'value-property': 'variables',\n help: 'scene/component/scenario-start'\n}\n\nexport default class ScenarioStart extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!ScenarioStart._image) {\n ScenarioStart._image = new Image()\n ScenarioStart._image.src = new URL('../icons/symbol-scenario-start.png', import.meta.url).href\n }\n return ScenarioStart._image\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n context.beginPath()\n this.drawImage(context, ScenarioStart.image, left, top, width, height)\n }\n\n get nature() {\n return NATURE\n }\n\n async onchange(after: Properties) {\n if ('variables' in after) {\n this.requestData()\n }\n }\n\n get variables() {\n return this.state.variables\n }\n\n set variables(variables) {\n this.setState('variables', variables)\n }\n\n async requestData() {\n let { instanceName, scenarioName, variables } = this.state\n if (!scenarioName || !this.app.isViewMode) return\n\n try {\n variables = typeof variables == 'string' ? JSON.parse(variables) : variables\n } catch (e) {\n console.error(e)\n }\n\n if (client) {\n var response = await client.query({\n query: gql`\n mutation ($instanceName: String, $scenarioName: String!, $variables: Object) {\n startScenario(instanceName: $instanceName, scenarioName: $scenarioName, variables: $variables) {\n state\n message\n data\n }\n }\n `,\n variables: {\n instanceName: instanceName,\n scenarioName: scenarioName,\n variables\n }\n })\n\n this.data = response?.data?.startScenario?.data\n }\n }\n}\n\nComponent.register('scenario-start', ScenarioStart)\n"]}
|
package/dist/scenario-stop.d.ts
CHANGED
|
@@ -6,16 +6,11 @@ declare const ScenarioStop_base: (new (...args: any[]) => {
|
|
|
6
6
|
export default class ScenarioStop extends ScenarioStop_base {
|
|
7
7
|
static _image: HTMLImageElement;
|
|
8
8
|
static get image(): HTMLImageElement;
|
|
9
|
-
private _client;
|
|
10
9
|
render(context: CanvasRenderingContext2D): void;
|
|
11
|
-
ready(): void;
|
|
12
|
-
_initScenario(): void;
|
|
13
|
-
dispose(): void;
|
|
14
10
|
get nature(): ComponentNature;
|
|
15
11
|
onchange(after: Properties): void;
|
|
16
12
|
get nothing(): any;
|
|
17
13
|
set nothing(nothing: any);
|
|
18
|
-
get client(): any;
|
|
19
14
|
requestData(): Promise<void>;
|
|
20
15
|
}
|
|
21
16
|
export {};
|
package/dist/scenario-stop.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import gql from 'graphql-tag';
|
|
2
2
|
import { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene';
|
|
3
|
+
import { client } from '@operato/graphql';
|
|
3
4
|
import { scenarios } from './client-api';
|
|
4
|
-
import { getClient } from './origin-client';
|
|
5
5
|
const NATURE = {
|
|
6
6
|
mutable: false,
|
|
7
7
|
resizable: true,
|
|
@@ -37,28 +37,6 @@ export default class ScenarioStop extends DataSource(RectPath(Shape)) {
|
|
|
37
37
|
context.beginPath();
|
|
38
38
|
this.drawImage(context, ScenarioStop.image, left, top, width, height);
|
|
39
39
|
}
|
|
40
|
-
ready() {
|
|
41
|
-
super.ready();
|
|
42
|
-
this._initScenario();
|
|
43
|
-
}
|
|
44
|
-
_initScenario() {
|
|
45
|
-
if (!this.app.isViewMode) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
this._client = getClient();
|
|
49
|
-
}
|
|
50
|
-
dispose() {
|
|
51
|
-
super.dispose();
|
|
52
|
-
try {
|
|
53
|
-
if (this._client) {
|
|
54
|
-
this._client.stop();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
catch (e) {
|
|
58
|
-
console.error(e);
|
|
59
|
-
}
|
|
60
|
-
delete this._client;
|
|
61
|
-
}
|
|
62
40
|
get nature() {
|
|
63
41
|
return NATURE;
|
|
64
42
|
}
|
|
@@ -73,16 +51,12 @@ export default class ScenarioStop extends DataSource(RectPath(Shape)) {
|
|
|
73
51
|
set nothing(nothing) {
|
|
74
52
|
this.setState('nothing', nothing);
|
|
75
53
|
}
|
|
76
|
-
get client() {
|
|
77
|
-
return this._client;
|
|
78
|
-
}
|
|
79
54
|
async requestData() {
|
|
80
55
|
var _a, _b;
|
|
81
56
|
let { instanceName, scenarioName } = this.state;
|
|
82
57
|
instanceName = instanceName || scenarioName;
|
|
83
58
|
if (!instanceName || !this.app.isViewMode)
|
|
84
59
|
return;
|
|
85
|
-
var client = this._client;
|
|
86
60
|
if (client) {
|
|
87
61
|
var response = await client.query({
|
|
88
62
|
query: gql `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenario-stop.js","sourceRoot":"","sources":["../src/scenario-stop.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAmB,UAAU,EAAc,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"scenario-stop.js","sourceRoot":"","sources":["../src/scenario-stop.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAmB,UAAU,EAAc,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAC5G,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,cAAc;SACrB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,cAAc;YACpB,QAAQ,EAAE;gBACR,OAAO,EAAE,SAAS;aACnB;SACF;KACF;IACD,gBAAgB,EAAE,SAAS;IAC3B,IAAI,EAAE,+BAA+B;CACtC,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAGnE,MAAM,KAAK,KAAK;QACd,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;YACxB,YAAY,CAAC,MAAM,GAAG,IAAI,KAAK,EAAE,CAAA;YACjC,YAAY,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,mCAAmC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;SAC7F;QACD,OAAO,YAAY,CAAC,MAAM,CAAA;IAC5B,CAAC;IAED,MAAM,CAAC,OAAiC;QACtC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAC9C,OAAO,CAAC,SAAS,EAAE,CAAA;QACnB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IACvE,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;IAED,QAAQ,CAAC,KAAiB;QACxB,IAAI,SAAS,IAAI,KAAK,EAAE;YACtB,IAAI,CAAC,WAAW,EAAE,CAAA;SACnB;IACH,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAA;IAC3B,CAAC;IAED,IAAI,OAAO,CAAC,OAAO;QACjB,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IACnC,CAAC;IAED,KAAK,CAAC,WAAW;;QACf,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAC/C,YAAY,GAAG,YAAY,IAAI,YAAY,CAAA;QAC3C,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU;YAAE,OAAM;QAEjD,IAAI,MAAM,EAAE;YACV,IAAI,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;gBAChC,KAAK,EAAE,GAAG,CAAA;;;;;;;;SAQT;gBACD,SAAS,EAAE;oBACT,YAAY,EAAE,YAAY;iBAC3B;aACF,CAAC,CAAA;YAEF,IAAI,CAAC,IAAI,GAAG,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,0CAAE,YAAY,0CAAE,IAAI,CAAA;SAC/C;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,YAAY,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nimport { Component, ComponentNature, DataSource, Properties, RectPath, Shape } from '@hatiolab/things-scene'\nimport { client } from '@operato/graphql'\n\nimport { scenarios } from './client-api'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'string',\n label: 'instance-name',\n name: 'instanceName'\n },\n {\n type: 'select',\n label: 'scenario-name',\n name: 'scenarioName',\n property: {\n options: scenarios\n }\n }\n ],\n 'value-property': 'nothing',\n help: 'scene/component/scenario-stop'\n}\n\nexport default class ScenarioStop extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!ScenarioStop._image) {\n ScenarioStop._image = new Image()\n ScenarioStop._image.src = new URL('../icons/symbol-scenario-stop.png', import.meta.url).href\n }\n return ScenarioStop._image\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n context.beginPath()\n this.drawImage(context, ScenarioStop.image, left, top, width, height)\n }\n\n get nature() {\n return NATURE\n }\n\n onchange(after: Properties) {\n if ('nothing' in after) {\n this.requestData()\n }\n }\n\n get nothing() {\n return this.state.nothing\n }\n\n set nothing(nothing) {\n this.setState('nothing', nothing)\n }\n\n async requestData() {\n let { instanceName, scenarioName } = this.state\n instanceName = instanceName || scenarioName\n if (!instanceName || !this.app.isViewMode) return\n\n if (client) {\n var response = await client.query({\n query: gql`\n mutation ($instanceName: String!) {\n stopScenario(instanceName: $instanceName) {\n state\n message\n data\n }\n }\n `,\n variables: {\n instanceName: instanceName\n }\n })\n\n this.data = response?.data?.stopScenario?.data\n }\n }\n}\n\nComponent.register('scenario-stop', ScenarioStop)\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"keep": {
|
|
3
|
+
"days": true,
|
|
4
|
+
"amount": 2
|
|
5
|
+
},
|
|
6
|
+
"auditLog": "logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json",
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"date": 1658046812429,
|
|
10
|
+
"name": "logs/application-2022-07-17-17.log",
|
|
11
|
+
"hash": "59e196d1430e62346c0e6fc4ecd3273621c9435a0d7b71b60f98b49442becbd4"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"hashType": "sha256"
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"keep": {
|
|
3
|
+
"days": true,
|
|
4
|
+
"amount": 14
|
|
5
|
+
},
|
|
6
|
+
"auditLog": "logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json",
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"date": 1658046814367,
|
|
10
|
+
"name": "logs/connections-2022-07-17-17.log",
|
|
11
|
+
"hash": "45ebb71aced34ec2034006039aa7aa4e2e8e677eb8bf8e4e85795f0c4b410d92"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"hashType": "sha256"
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
2022-07-17T17:33:33+09:00 info: File Storage is Ready.
|
|
2
|
+
2022-07-17T17:33:49+09:00 info: File Storage is Ready.
|
|
3
|
+
2022-07-17T17:33:51+09:00 info: Database connection established
|
|
4
|
+
2022-07-17T17:33:53+09:00 info: 🚀 Server ready at http://0.0.0.0:3000/graphql
|
|
5
|
+
2022-07-17T17:33:53+09:00 info: 🚀 Subscriptions ready at ws://0.0.0.0:3000/graphql
|
|
6
|
+
2022-07-17T17:38:47+09:00 info: File Storage is Ready.
|
|
7
|
+
2022-07-17T17:38:51+09:00 info: Database connection established
|
|
8
|
+
2022-07-17T17:38:52+09:00 info: 🚀 Server ready at http://0.0.0.0:3000/graphql
|
|
9
|
+
2022-07-17T17:38:52+09:00 info: 🚀 Subscriptions ready at ws://0.0.0.0:3000/graphql
|
|
10
|
+
2022-07-17T17:45:43+09:00 info: File Storage is Ready.
|
|
11
|
+
2022-07-17T17:45:47+09:00 info: Database connection established
|
|
12
|
+
2022-07-17T17:45:50+09:00 info: 🚀 Server ready at http://0.0.0.0:3000/graphql
|
|
13
|
+
2022-07-17T17:45:50+09:00 info: 🚀 Subscriptions ready at ws://0.0.0.0:3000/graphql
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
2022-07-17T17:33:53+09:00 info: Initializing ConnectionManager...
|
|
2
|
+
2022-07-17T17:33:53+09:00 info: Connector 'echo-back-server' started to ready
|
|
3
|
+
2022-07-17T17:33:53+09:00 info: Connector 'echo-back' started to ready
|
|
4
|
+
2022-07-17T17:33:53+09:00 info: Connector 'http-connector' started to ready
|
|
5
|
+
2022-07-17T17:33:53+09:00 info: Connector 'graphql-connector' started to ready
|
|
6
|
+
2022-07-17T17:33:53+09:00 info: Connector 'sqlite-connector' started to ready
|
|
7
|
+
2022-07-17T17:33:53+09:00 info: Connector 'postgresql-connector' started to ready
|
|
8
|
+
2022-07-17T17:33:53+09:00 info: Connector 'mqtt-connector' started to ready
|
|
9
|
+
2022-07-17T17:33:53+09:00 info: Connector 'mssql-connector' started to ready
|
|
10
|
+
2022-07-17T17:33:53+09:00 info: Connector 'oracle-connector' started to ready
|
|
11
|
+
2022-07-17T17:33:53+09:00 info: Connector 'mysql-connector' started to ready
|
|
12
|
+
2022-07-17T17:33:53+09:00 info: Connector 'socket-server' started to ready
|
|
13
|
+
2022-07-17T17:33:53+09:00 info: echo-back-servers are ready
|
|
14
|
+
2022-07-17T17:33:53+09:00 info: echo-back connections are ready
|
|
15
|
+
2022-07-17T17:33:53+09:00 info: http-connector connections are ready
|
|
16
|
+
2022-07-17T17:33:53+09:00 info: graphql-connector connections are ready
|
|
17
|
+
2022-07-17T17:33:53+09:00 info: sqlite-connector connections are ready
|
|
18
|
+
2022-07-17T17:33:53+09:00 info: postgresql-connector connections are ready
|
|
19
|
+
2022-07-17T17:33:53+09:00 info: mqtt-connector connections are ready
|
|
20
|
+
2022-07-17T17:33:53+09:00 info: mssql-connector connections are ready
|
|
21
|
+
2022-07-17T17:33:53+09:00 info: oracle-connector connections are ready
|
|
22
|
+
2022-07-17T17:33:53+09:00 info: mysql-connector connections are ready
|
|
23
|
+
2022-07-17T17:33:53+09:00 info: socket servers are ready
|
|
24
|
+
2022-07-17T17:33:53+09:00 info: All connector for 'echo-back-server' ready
|
|
25
|
+
2022-07-17T17:33:53+09:00 info: All connector for 'echo-back' ready
|
|
26
|
+
2022-07-17T17:33:53+09:00 info: All connector for 'http-connector' ready
|
|
27
|
+
2022-07-17T17:33:53+09:00 info: All connector for 'graphql-connector' ready
|
|
28
|
+
2022-07-17T17:33:53+09:00 info: All connector for 'sqlite-connector' ready
|
|
29
|
+
2022-07-17T17:33:53+09:00 info: All connector for 'postgresql-connector' ready
|
|
30
|
+
2022-07-17T17:33:53+09:00 info: All connector for 'mqtt-connector' ready
|
|
31
|
+
2022-07-17T17:33:53+09:00 info: All connector for 'mssql-connector' ready
|
|
32
|
+
2022-07-17T17:33:53+09:00 info: All connector for 'oracle-connector' ready
|
|
33
|
+
2022-07-17T17:33:53+09:00 info: All connector for 'mysql-connector' ready
|
|
34
|
+
2022-07-17T17:33:53+09:00 info: All connector for 'socket-server' ready
|
|
35
|
+
2022-07-17T17:33:53+09:00 info: ConnectionManager initialization done:
|
|
36
|
+
2022-07-17T17:38:53+09:00 info: Initializing ConnectionManager...
|
|
37
|
+
2022-07-17T17:38:53+09:00 info: Connector 'echo-back-server' started to ready
|
|
38
|
+
2022-07-17T17:38:53+09:00 info: Connector 'echo-back' started to ready
|
|
39
|
+
2022-07-17T17:38:53+09:00 info: Connector 'http-connector' started to ready
|
|
40
|
+
2022-07-17T17:38:53+09:00 info: Connector 'graphql-connector' started to ready
|
|
41
|
+
2022-07-17T17:38:53+09:00 info: Connector 'sqlite-connector' started to ready
|
|
42
|
+
2022-07-17T17:38:53+09:00 info: Connector 'postgresql-connector' started to ready
|
|
43
|
+
2022-07-17T17:38:53+09:00 info: Connector 'mqtt-connector' started to ready
|
|
44
|
+
2022-07-17T17:38:53+09:00 info: Connector 'mssql-connector' started to ready
|
|
45
|
+
2022-07-17T17:38:53+09:00 info: Connector 'oracle-connector' started to ready
|
|
46
|
+
2022-07-17T17:38:53+09:00 info: Connector 'mysql-connector' started to ready
|
|
47
|
+
2022-07-17T17:38:53+09:00 info: Connector 'socket-server' started to ready
|
|
48
|
+
2022-07-17T17:38:53+09:00 info: echo-back-servers are ready
|
|
49
|
+
2022-07-17T17:38:53+09:00 info: echo-back connections are ready
|
|
50
|
+
2022-07-17T17:38:53+09:00 info: http-connector connections are ready
|
|
51
|
+
2022-07-17T17:38:53+09:00 info: graphql-connector connections are ready
|
|
52
|
+
2022-07-17T17:38:53+09:00 info: sqlite-connector connections are ready
|
|
53
|
+
2022-07-17T17:38:53+09:00 info: postgresql-connector connections are ready
|
|
54
|
+
2022-07-17T17:38:53+09:00 info: mqtt-connector connections are ready
|
|
55
|
+
2022-07-17T17:38:53+09:00 info: mssql-connector connections are ready
|
|
56
|
+
2022-07-17T17:38:53+09:00 info: oracle-connector connections are ready
|
|
57
|
+
2022-07-17T17:38:53+09:00 info: mysql-connector connections are ready
|
|
58
|
+
2022-07-17T17:38:53+09:00 info: socket servers are ready
|
|
59
|
+
2022-07-17T17:38:53+09:00 info: All connector for 'echo-back-server' ready
|
|
60
|
+
2022-07-17T17:38:53+09:00 info: All connector for 'echo-back' ready
|
|
61
|
+
2022-07-17T17:38:53+09:00 info: All connector for 'http-connector' ready
|
|
62
|
+
2022-07-17T17:38:53+09:00 info: All connector for 'graphql-connector' ready
|
|
63
|
+
2022-07-17T17:38:53+09:00 info: All connector for 'sqlite-connector' ready
|
|
64
|
+
2022-07-17T17:38:53+09:00 info: All connector for 'postgresql-connector' ready
|
|
65
|
+
2022-07-17T17:38:53+09:00 info: All connector for 'mqtt-connector' ready
|
|
66
|
+
2022-07-17T17:38:53+09:00 info: All connector for 'mssql-connector' ready
|
|
67
|
+
2022-07-17T17:38:53+09:00 info: All connector for 'oracle-connector' ready
|
|
68
|
+
2022-07-17T17:38:53+09:00 info: All connector for 'mysql-connector' ready
|
|
69
|
+
2022-07-17T17:38:53+09:00 info: All connector for 'socket-server' ready
|
|
70
|
+
2022-07-17T17:38:53+09:00 info: ConnectionManager initialization done:
|
|
71
|
+
2022-07-17T17:45:51+09:00 info: Initializing ConnectionManager...
|
|
72
|
+
2022-07-17T17:45:51+09:00 info: Connector 'echo-back-server' started to ready
|
|
73
|
+
2022-07-17T17:45:51+09:00 info: Connector 'echo-back' started to ready
|
|
74
|
+
2022-07-17T17:45:51+09:00 info: Connector 'http-connector' started to ready
|
|
75
|
+
2022-07-17T17:45:51+09:00 info: Connector 'graphql-connector' started to ready
|
|
76
|
+
2022-07-17T17:45:51+09:00 info: Connector 'sqlite-connector' started to ready
|
|
77
|
+
2022-07-17T17:45:51+09:00 info: Connector 'postgresql-connector' started to ready
|
|
78
|
+
2022-07-17T17:45:51+09:00 info: Connector 'mqtt-connector' started to ready
|
|
79
|
+
2022-07-17T17:45:51+09:00 info: Connector 'mssql-connector' started to ready
|
|
80
|
+
2022-07-17T17:45:51+09:00 info: Connector 'oracle-connector' started to ready
|
|
81
|
+
2022-07-17T17:45:51+09:00 info: Connector 'mysql-connector' started to ready
|
|
82
|
+
2022-07-17T17:45:51+09:00 info: Connector 'socket-server' started to ready
|
|
83
|
+
2022-07-17T17:45:51+09:00 info: echo-back-servers are ready
|
|
84
|
+
2022-07-17T17:45:51+09:00 info: echo-back connections are ready
|
|
85
|
+
2022-07-17T17:45:51+09:00 info: http-connector connections are ready
|
|
86
|
+
2022-07-17T17:45:51+09:00 info: graphql-connector connections are ready
|
|
87
|
+
2022-07-17T17:45:51+09:00 info: sqlite-connector connections are ready
|
|
88
|
+
2022-07-17T17:45:51+09:00 info: postgresql-connector connections are ready
|
|
89
|
+
2022-07-17T17:45:51+09:00 info: mqtt-connector connections are ready
|
|
90
|
+
2022-07-17T17:45:51+09:00 info: mssql-connector connections are ready
|
|
91
|
+
2022-07-17T17:45:51+09:00 info: oracle-connector connections are ready
|
|
92
|
+
2022-07-17T17:45:51+09:00 info: mysql-connector connections are ready
|
|
93
|
+
2022-07-17T17:45:51+09:00 info: socket servers are ready
|
|
94
|
+
2022-07-17T17:45:51+09:00 info: All connector for 'echo-back-server' ready
|
|
95
|
+
2022-07-17T17:45:51+09:00 info: All connector for 'echo-back' ready
|
|
96
|
+
2022-07-17T17:45:51+09:00 info: All connector for 'http-connector' ready
|
|
97
|
+
2022-07-17T17:45:51+09:00 info: All connector for 'graphql-connector' ready
|
|
98
|
+
2022-07-17T17:45:51+09:00 info: All connector for 'sqlite-connector' ready
|
|
99
|
+
2022-07-17T17:45:51+09:00 info: All connector for 'postgresql-connector' ready
|
|
100
|
+
2022-07-17T17:45:51+09:00 info: All connector for 'mqtt-connector' ready
|
|
101
|
+
2022-07-17T17:45:51+09:00 info: All connector for 'mssql-connector' ready
|
|
102
|
+
2022-07-17T17:45:51+09:00 info: All connector for 'oracle-connector' ready
|
|
103
|
+
2022-07-17T17:45:51+09:00 info: All connector for 'mysql-connector' ready
|
|
104
|
+
2022-07-17T17:45:51+09:00 info: All connector for 'socket-server' ready
|
|
105
|
+
2022-07-17T17:45:51+09:00 info: ConnectionManager initialization done:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operato/scene-integration",
|
|
3
3
|
"description": "Things factory integration component for things-scene",
|
|
4
|
-
"version": "1.0.0-alpha.
|
|
4
|
+
"version": "1.0.0-alpha.37",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "heartyoh",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -26,15 +26,14 @@
|
|
|
26
26
|
"migration": "things-factory-migration"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@apollo/client": "^3.6.9",
|
|
30
29
|
"@hatiolab/things-scene": "^3.0.18",
|
|
31
|
-
"graphql
|
|
32
|
-
"
|
|
30
|
+
"@operato/graphql": "^1.0.0-beta.49",
|
|
31
|
+
"graphql-tag": "^2.12.6"
|
|
33
32
|
},
|
|
34
33
|
"devDependencies": {
|
|
35
34
|
"@hatiolab/prettier-config": "^1.0.0",
|
|
36
|
-
"@things-factory/builder": "^5.0.0-zeta.
|
|
37
|
-
"@things-factory/operato-board": "^5.0.0-zeta.
|
|
35
|
+
"@things-factory/builder": "^5.0.0-zeta.22",
|
|
36
|
+
"@things-factory/operato-board": "^5.0.0-zeta.22",
|
|
38
37
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
39
38
|
"@typescript-eslint/parser": "^4.33.0",
|
|
40
39
|
"@web/dev-server": "^0.1.28",
|
|
@@ -59,5 +58,5 @@
|
|
|
59
58
|
"prettier --write"
|
|
60
59
|
]
|
|
61
60
|
},
|
|
62
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "98c88c7d72cf5818eb4a033f9dc33d88b9b45155"
|
|
63
62
|
}
|
package/src/client-api.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import gql from 'graphql-tag'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { client } from '@operato/graphql'
|
|
4
4
|
|
|
5
5
|
export const scenarios = async () => {
|
|
6
|
-
var response = await
|
|
6
|
+
var response = await client.query({
|
|
7
7
|
query: gql`
|
|
8
8
|
query {
|
|
9
9
|
scenarios {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import gql from 'graphql-tag'
|
|
2
2
|
|
|
3
3
|
import { Component, ComponentNature, RectPath, Shape } from '@hatiolab/things-scene'
|
|
4
|
-
|
|
5
|
-
import { getClient } from './origin-client'
|
|
4
|
+
import { client } from '@operato/graphql'
|
|
6
5
|
|
|
7
6
|
const NATURE: ComponentNature = {
|
|
8
7
|
mutable: false,
|
|
@@ -15,7 +14,7 @@ const NATURE: ComponentNature = {
|
|
|
15
14
|
name: 'connectionName',
|
|
16
15
|
property: {
|
|
17
16
|
options: async () => {
|
|
18
|
-
var response = await
|
|
17
|
+
var response = await client.query({
|
|
19
18
|
query: gql`
|
|
20
19
|
query {
|
|
21
20
|
connections {
|
|
@@ -71,46 +70,16 @@ export default class ConnectionControl extends RectPath(Shape) {
|
|
|
71
70
|
return ConnectionControl._image
|
|
72
71
|
}
|
|
73
72
|
|
|
74
|
-
private _client: any
|
|
75
|
-
|
|
76
73
|
render(context: CanvasRenderingContext2D) {
|
|
77
74
|
var { left, top, width, height } = this.bounds
|
|
78
75
|
context.beginPath()
|
|
79
76
|
this.drawImage(context, ConnectionControl.image, left, top, width, height)
|
|
80
77
|
}
|
|
81
78
|
|
|
82
|
-
ready() {
|
|
83
|
-
super.ready()
|
|
84
|
-
this._init()
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
_init() {
|
|
88
|
-
if (!this.app.isViewMode) return
|
|
89
|
-
|
|
90
|
-
this._client = getClient()
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
dispose() {
|
|
94
|
-
super.dispose()
|
|
95
|
-
|
|
96
|
-
try {
|
|
97
|
-
if (this._client) {
|
|
98
|
-
this._client.stop()
|
|
99
|
-
}
|
|
100
|
-
} catch (e) {
|
|
101
|
-
console.error(e)
|
|
102
|
-
}
|
|
103
|
-
delete this._client
|
|
104
|
-
}
|
|
105
|
-
|
|
106
79
|
get nature() {
|
|
107
80
|
return NATURE
|
|
108
81
|
}
|
|
109
82
|
|
|
110
|
-
get client() {
|
|
111
|
-
return this._client
|
|
112
|
-
}
|
|
113
|
-
|
|
114
83
|
get controlType() {
|
|
115
84
|
return this.getState('controlType')
|
|
116
85
|
}
|
|
@@ -135,7 +104,6 @@ export default class ConnectionControl extends RectPath(Shape) {
|
|
|
135
104
|
controlType = 'disconnect'
|
|
136
105
|
}
|
|
137
106
|
|
|
138
|
-
var client = this._client
|
|
139
107
|
var query = ''
|
|
140
108
|
|
|
141
109
|
query = `mutation{
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import gql from 'graphql-tag'
|
|
2
2
|
|
|
3
3
|
import { Component, ComponentNature, DataSource, RectPath, Shape } from '@hatiolab/things-scene'
|
|
4
|
-
|
|
5
|
-
import { getClient, subscribe } from './origin-client'
|
|
4
|
+
import { client, subscribe } from '@operato/graphql'
|
|
6
5
|
|
|
7
6
|
const NATURE: ComponentNature = {
|
|
8
7
|
mutable: false,
|
|
@@ -15,7 +14,7 @@ const NATURE: ComponentNature = {
|
|
|
15
14
|
name: 'connectionName',
|
|
16
15
|
property: {
|
|
17
16
|
options: async () => {
|
|
18
|
-
var response = await
|
|
17
|
+
var response = await client.query({
|
|
19
18
|
query: gql`
|
|
20
19
|
query {
|
|
21
20
|
connections {
|
package/src/data-subscription.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import gql from 'graphql-tag'
|
|
2
2
|
|
|
3
3
|
import { Component, ComponentNature, DataSource, RectPath, Shape } from '@hatiolab/things-scene'
|
|
4
|
-
|
|
5
|
-
import { subscribe } from './origin-client'
|
|
4
|
+
import { subscribe } from '@operato/graphql'
|
|
6
5
|
|
|
7
6
|
const NATURE: ComponentNature = {
|
|
8
7
|
mutable: false,
|
package/src/scenario-control.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import gql from 'graphql-tag'
|
|
2
2
|
|
|
3
3
|
import { Component, ComponentNature, DataSource, Properties, RectPath, Shape } from '@hatiolab/things-scene'
|
|
4
|
+
import { client } from '@operato/graphql'
|
|
4
5
|
|
|
5
6
|
import { scenarios } from './client-api'
|
|
6
|
-
import { getClient } from './origin-client'
|
|
7
7
|
|
|
8
8
|
const NATURE: ComponentNature = {
|
|
9
9
|
mutable: false,
|
|
@@ -55,8 +55,6 @@ export default class ScenarioControl extends DataSource(RectPath(Shape)) {
|
|
|
55
55
|
return ScenarioControl._image
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
private _client: any
|
|
59
|
-
|
|
60
58
|
render(context: CanvasRenderingContext2D) {
|
|
61
59
|
var { left, top, width, height } = this.bounds
|
|
62
60
|
context.beginPath()
|
|
@@ -65,27 +63,10 @@ export default class ScenarioControl extends DataSource(RectPath(Shape)) {
|
|
|
65
63
|
|
|
66
64
|
ready() {
|
|
67
65
|
super.ready()
|
|
68
|
-
this._initScenario()
|
|
69
|
-
}
|
|
70
66
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
this._client = getClient()
|
|
75
|
-
this.requestData()
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
dispose() {
|
|
79
|
-
super.dispose()
|
|
80
|
-
|
|
81
|
-
try {
|
|
82
|
-
if (this._client) {
|
|
83
|
-
this._client.stop()
|
|
84
|
-
}
|
|
85
|
-
} catch (e) {
|
|
86
|
-
console.error(e)
|
|
67
|
+
if (this.app.isViewMode) {
|
|
68
|
+
this.requestData()
|
|
87
69
|
}
|
|
88
|
-
delete this._client
|
|
89
70
|
}
|
|
90
71
|
|
|
91
72
|
get nature() {
|
|
@@ -98,10 +79,6 @@ export default class ScenarioControl extends DataSource(RectPath(Shape)) {
|
|
|
98
79
|
}
|
|
99
80
|
}
|
|
100
81
|
|
|
101
|
-
get client() {
|
|
102
|
-
return this._client
|
|
103
|
-
}
|
|
104
|
-
|
|
105
82
|
get controlType() {
|
|
106
83
|
return this.getState('controlType')
|
|
107
84
|
}
|
|
@@ -112,8 +89,10 @@ export default class ScenarioControl extends DataSource(RectPath(Shape)) {
|
|
|
112
89
|
|
|
113
90
|
async requestData() {
|
|
114
91
|
let { controlType, scenarioName } = this.state
|
|
115
|
-
if (!controlType || !scenarioName || !this.app.isViewMode)
|
|
116
|
-
|
|
92
|
+
if (!controlType || !scenarioName || !this.app.isViewMode) {
|
|
93
|
+
return
|
|
94
|
+
}
|
|
95
|
+
|
|
117
96
|
var query = ''
|
|
118
97
|
if (controlType == 'start') {
|
|
119
98
|
query = `mutation{
|
|
@@ -129,15 +108,13 @@ export default class ScenarioControl extends DataSource(RectPath(Shape)) {
|
|
|
129
108
|
}`
|
|
130
109
|
}
|
|
131
110
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
query
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
})
|
|
111
|
+
var response = await client.query({
|
|
112
|
+
query: gql`
|
|
113
|
+
${query}
|
|
114
|
+
`
|
|
115
|
+
})
|
|
138
116
|
|
|
139
|
-
|
|
140
|
-
}
|
|
117
|
+
this.data = response
|
|
141
118
|
}
|
|
142
119
|
}
|
|
143
120
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import gql from 'graphql-tag'
|
|
2
2
|
|
|
3
3
|
import { Component, ComponentNature, DataSource, RectPath, Shape } from '@hatiolab/things-scene'
|
|
4
|
+
import { subscribe } from '@operato/graphql'
|
|
4
5
|
|
|
5
6
|
import { scenarios } from './client-api'
|
|
6
|
-
import { subscribe } from './origin-client'
|
|
7
7
|
|
|
8
8
|
const NATURE: ComponentNature = {
|
|
9
9
|
mutable: false,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import gql from 'graphql-tag'
|
|
2
2
|
|
|
3
3
|
import { Component, ComponentNature, DataSource, RectPath, Shape } from '@hatiolab/things-scene'
|
|
4
|
-
|
|
5
|
-
import { subscribe } from './origin-client'
|
|
4
|
+
import { subscribe } from '@operato/graphql'
|
|
6
5
|
|
|
7
6
|
const NATURE: ComponentNature = {
|
|
8
7
|
mutable: false,
|
package/src/scenario-run.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import gql from 'graphql-tag'
|
|
2
2
|
|
|
3
3
|
import { Component, ComponentNature, DataSource, Properties, RectPath, Shape } from '@hatiolab/things-scene'
|
|
4
|
+
import { client } from '@operato/graphql'
|
|
4
5
|
|
|
5
6
|
import { scenarios } from './client-api'
|
|
6
|
-
import { getClient } from './origin-client'
|
|
7
7
|
|
|
8
8
|
const NATURE: ComponentNature = {
|
|
9
9
|
mutable: false,
|
|
@@ -44,8 +44,6 @@ export default class ScenarioRun extends DataSource(RectPath(Shape)) {
|
|
|
44
44
|
return ScenarioRun._image
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
private _client: any
|
|
48
|
-
|
|
49
47
|
render(context: CanvasRenderingContext2D) {
|
|
50
48
|
var { left, top, width, height } = this.bounds
|
|
51
49
|
context.beginPath()
|
|
@@ -54,30 +52,12 @@ export default class ScenarioRun extends DataSource(RectPath(Shape)) {
|
|
|
54
52
|
|
|
55
53
|
ready() {
|
|
56
54
|
super.ready()
|
|
57
|
-
this._initScenario()
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
_initScenario() {
|
|
61
|
-
if (!this.app.isViewMode) {
|
|
62
|
-
return
|
|
63
|
-
}
|
|
64
|
-
this._client = getClient()
|
|
65
|
-
if (this.state.runOnStart) {
|
|
66
|
-
this.requestData()
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
55
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
try {
|
|
74
|
-
if (this._client) {
|
|
75
|
-
this._client.stop()
|
|
56
|
+
if (this.app.isViewMode) {
|
|
57
|
+
if (this.state.runOnStart) {
|
|
58
|
+
this.requestData()
|
|
76
59
|
}
|
|
77
|
-
} catch (e) {
|
|
78
|
-
console.error(e)
|
|
79
60
|
}
|
|
80
|
-
delete this._client
|
|
81
61
|
}
|
|
82
62
|
|
|
83
63
|
get nature() {
|
|
@@ -98,15 +78,12 @@ export default class ScenarioRun extends DataSource(RectPath(Shape)) {
|
|
|
98
78
|
this.setState('variables', variables)
|
|
99
79
|
}
|
|
100
80
|
|
|
101
|
-
get client() {
|
|
102
|
-
return this._client
|
|
103
|
-
}
|
|
104
|
-
|
|
105
81
|
async requestData() {
|
|
106
82
|
let { scenarioName, variables } = this.state
|
|
107
|
-
if (!scenarioName || !this.app.isViewMode)
|
|
83
|
+
if (!scenarioName || !this.app.isViewMode) {
|
|
84
|
+
return
|
|
85
|
+
}
|
|
108
86
|
|
|
109
|
-
var client = this._client
|
|
110
87
|
try {
|
|
111
88
|
variables = typeof variables == 'string' ? JSON.parse(variables) : variables
|
|
112
89
|
} catch (e) {
|