@operato/scene-integration 0.0.26 → 0.1.3

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.
Files changed (103) hide show
  1. package/CHANGELOG.md +55 -92
  2. package/dist/client-api.d.ts +1 -0
  3. package/dist/client-api.js +22 -0
  4. package/dist/client-api.js.map +1 -0
  5. package/dist/connection-control.js +2 -3
  6. package/dist/connection-control.js.map +1 -1
  7. package/dist/connection-state-subscription.d.ts +1 -0
  8. package/dist/connection-state-subscription.js +2 -3
  9. package/dist/connection-state-subscription.js.map +1 -1
  10. package/dist/data-subscription.d.ts +1 -0
  11. package/dist/data-subscription.js +2 -3
  12. package/dist/data-subscription.js.map +1 -1
  13. package/dist/scenario-control.d.ts +1 -0
  14. package/dist/scenario-control.js +4 -20
  15. package/dist/scenario-control.js.map +1 -1
  16. package/dist/scenario-instance-subscription.d.ts +1 -0
  17. package/dist/scenario-instance-subscription.js +5 -21
  18. package/dist/scenario-instance-subscription.js.map +1 -1
  19. package/dist/scenario-queue-subscription.d.ts +1 -0
  20. package/dist/scenario-queue-subscription.js +2 -3
  21. package/dist/scenario-queue-subscription.js.map +1 -1
  22. package/dist/scenario-run.d.ts +1 -0
  23. package/dist/scenario-run.js +4 -20
  24. package/dist/scenario-run.js.map +1 -1
  25. package/dist/scenario-start.d.ts +1 -0
  26. package/dist/scenario-start.js +4 -20
  27. package/dist/scenario-start.js.map +1 -1
  28. package/dist/scenario-stop.d.ts +1 -0
  29. package/dist/scenario-stop.js +4 -20
  30. package/dist/scenario-stop.js.map +1 -1
  31. package/dist/templates/connection-control.d.ts +1 -1
  32. package/dist/templates/connection-control.js +1 -1
  33. package/dist/templates/connection-control.js.map +1 -1
  34. package/dist/templates/connection-state-subscription.d.ts +1 -1
  35. package/dist/templates/connection-state-subscription.js +1 -1
  36. package/dist/templates/connection-state-subscription.js.map +1 -1
  37. package/dist/templates/data-subscription.d.ts +1 -1
  38. package/dist/templates/data-subscription.js +1 -1
  39. package/dist/templates/data-subscription.js.map +1 -1
  40. package/dist/templates/index.d.ts +1 -1
  41. package/dist/templates/scenario-control.d.ts +1 -1
  42. package/dist/templates/scenario-control.js +1 -1
  43. package/dist/templates/scenario-control.js.map +1 -1
  44. package/dist/templates/scenario-instance-subscription.d.ts +1 -1
  45. package/dist/templates/scenario-instance-subscription.js +1 -1
  46. package/dist/templates/scenario-instance-subscription.js.map +1 -1
  47. package/dist/templates/scenario-queue-subscription.d.ts +1 -1
  48. package/dist/templates/scenario-queue-subscription.js +1 -1
  49. package/dist/templates/scenario-queue-subscription.js.map +1 -1
  50. package/dist/templates/scenario-run.d.ts +1 -1
  51. package/dist/templates/scenario-run.js +1 -1
  52. package/dist/templates/scenario-run.js.map +1 -1
  53. package/dist/templates/scenario-start.d.ts +1 -1
  54. package/dist/templates/scenario-start.js +1 -1
  55. package/dist/templates/scenario-start.js.map +1 -1
  56. package/dist/templates/scenario-stop.d.ts +1 -1
  57. package/dist/templates/scenario-stop.js +1 -1
  58. package/dist/templates/scenario-stop.js.map +1 -1
  59. package/{assets → icons}/icon-camera-stream.png +0 -0
  60. package/{assets → icons}/icon-connection-control.png +0 -0
  61. package/{assets → icons}/icon-connection-state-subscription.png +0 -0
  62. package/{assets → icons}/icon-data-subscription.png +0 -0
  63. package/{assets → icons}/icon-integration.png +0 -0
  64. package/{assets → icons}/icon-scenario-control.png +0 -0
  65. package/{assets → icons}/icon-scenario-instance-subscription.png +0 -0
  66. package/{assets → icons}/icon-scenario-queue-subscription.png +0 -0
  67. package/{assets → icons}/icon-scenario-run.png +0 -0
  68. package/{assets → icons}/icon-scenario-start.png +0 -0
  69. package/{assets → icons}/icon-scenario-stop.png +0 -0
  70. package/{assets → icons}/no-image.png +0 -0
  71. package/{assets → icons}/symbol-connection-control.png +0 -0
  72. package/{assets → icons}/symbol-connection-state-subscription.png +0 -0
  73. package/{assets → icons}/symbol-data-subscription.png +0 -0
  74. package/{assets → icons}/symbol-integration.png +0 -0
  75. package/{assets → icons}/symbol-scenario-control.png +0 -0
  76. package/{assets → icons}/symbol-scenario-instance-subscription.png +0 -0
  77. package/{assets → icons}/symbol-scenario-queue-subscription.png +0 -0
  78. package/{assets → icons}/symbol-scenario-run.png +0 -0
  79. package/{assets → icons}/symbol-scenario-start.png +0 -0
  80. package/{assets → icons}/symbol-scenario-stop.png +0 -0
  81. package/package.json +6 -6
  82. package/src/client-api.ts +25 -0
  83. package/src/connection-control.ts +3 -3
  84. package/src/connection-state-subscription.ts +7 -4
  85. package/src/data-subscription.ts +3 -3
  86. package/src/scenario-control.ts +5 -21
  87. package/src/scenario-instance-subscription.ts +9 -22
  88. package/src/scenario-queue-subscription.ts +6 -3
  89. package/src/scenario-run.ts +5 -21
  90. package/src/scenario-start.ts +5 -21
  91. package/src/scenario-stop.ts +5 -21
  92. package/src/templates/connection-control.ts +1 -1
  93. package/src/templates/connection-state-subscription.ts +1 -1
  94. package/src/templates/data-subscription.ts +1 -1
  95. package/src/templates/scenario-control.ts +1 -1
  96. package/src/templates/scenario-instance-subscription.ts +1 -1
  97. package/src/templates/scenario-queue-subscription.ts +1 -1
  98. package/src/templates/scenario-run.ts +1 -1
  99. package/src/templates/scenario-start.ts +1 -1
  100. package/src/templates/scenario-stop.ts +1 -1
  101. package/tsconfig.json +1 -1
  102. package/tsconfig.tsbuildinfo +1 -1
  103. package/@types/global/index.d.ts +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"scenario-instance-subscription.js","sourceRoot":"","sources":["../src/scenario-instance-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAC/E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEtD,OAAO,eAAe,MAAM,qDAAqD,CAAA;AACjF,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IAC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IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,OAAO,CAAC,SAAS,EAAE,CAAA;QACnB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,4BAA4B,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IACvF,CAAC;IAED,KAAK;QACH,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU;YAAE,OAAM;QAChC,IAAI,CAAC,iCAAiC,EAAE,CAAA;IAC1C,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;IAED,iCAAiC;QAC/B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU;YAAE,OAAM;QAChC,IAAI,CAAC,cAAc,EAAE,CAAA;IACvB,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,IAAI,EAAE,YAAY,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAEpD,YAAY,GAAG,YAAY,IAAI,YAAY,CAAA;QAE3C,IAAI,CAAC,YAAY,GAAG,MAAM,SAAS,CACjC;YACE,KAAK,EAAE,GAAG,CAAA;;iDAE+B,YAAY,qBAAqB,YAAY;;;;;;;;;;;;;;;;OAgBvF;SACA,EACD;YACE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAiB,EAAE,EAAE;gBACtC,IAAI,IAAI,EAAE;oBACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,qBAAqB,CAAA;iBACvC;YACH,CAAC;SACF,CACF,CAAA;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,gCAAgC,EAAE,4BAA4B,CAAC,CAAA","sourcesContent":["import { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene'\nimport { getClient, subscribe } from './origin-client'\n\nimport COMPONENT_IMAGE from '../assets/symbol-scenario-instance-subscription.png'\nimport gql from 'graphql-tag'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'select',\n label: 'scenario-name',\n name: 'scenarioName',\n property: {\n options: async () => {\n var response = await getClient().query({\n query: gql`\n query {\n scenarios {\n items {\n name\n }\n }\n }\n `\n })\n if (response.errors) {\n return ['']\n }\n\n return [''].concat(response.data.scenarios.items.map((item: any) => item.name))\n }\n }\n },\n {\n type: 'string',\n label: 'instance-name',\n name: 'instanceName'\n }\n ],\n help: 'scene/component/scenario-instance-subscription'\n}\n\nexport default class ScenarioInstanceSubscription extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!ScenarioInstanceSubscription._image) {\n ScenarioInstanceSubscription._image = new Image()\n ScenarioInstanceSubscription._image.src = COMPONENT_IMAGE\n }\n\n return ScenarioInstanceSubscription._image\n }\n\n private subscription?: {\n unsubscribe(): void\n }\n\n dispose() {\n super.dispose()\n\n this.subscription?.unsubscribe()\n delete this.subscription\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, ScenarioInstanceSubscription.image, left, top, width, height)\n }\n\n ready() {\n if (!this.app.isViewMode) return\n this._initScenarioInstanceSubscription()\n }\n\n get nature() {\n return NATURE\n }\n\n _initScenarioInstanceSubscription() {\n if (!this.app.isViewMode) return\n this.startSubscribe()\n }\n\n async startSubscribe() {\n var { instanceName, scenarioName = '' } = this.state\n\n instanceName = instanceName || scenarioName\n\n this.subscription = await subscribe(\n {\n query: gql`\n subscription {\n scenarioInstanceState(instanceName: \"${instanceName}\", scenarioName: \"${scenarioName}\") {\n instanceName\n scenarioName\n state\n variables\n progress{\n rounds\n rate\n steps\n step\n }\n data\n message\n timestamp\n }\n }\n `\n },\n {\n next: async ({ data }: { data: any }) => {\n if (data) {\n this.data = data.scenarioInstanceState\n }\n }\n }\n )\n }\n}\n\nComponent.register('scenario-instance-subscription', ScenarioInstanceSubscription)\n"]}
1
+ {"version":3,"file":"scenario-instance-subscription.js","sourceRoot":"","sources":["../src/scenario-instance-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,MAAM,GAAG;IACb,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;YACpB,QAAQ,EAAE;gBACR,OAAO,EAAE,SAAS;aACnB;SACF;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,cAAc;SACrB;KACF;IACD,IAAI,EAAE,gDAAgD;CACvD,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,4BAA6B,SAAQ,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAGnF,MAAM,KAAK,KAAK;QACd,IAAI,CAAC,4BAA4B,CAAC,MAAM,EAAE;YACxC,4BAA4B,CAAC,MAAM,GAAG,IAAI,KAAK,EAAE,CAAA;YACjD,4BAA4B,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,GAAG,CAC/C,oDAAoD,EACpD,MAAM,CAAC,IAAI,CAAC,GAAG,CAChB,CAAC,IAAI,CAAA;SACP;QAED,OAAO,4BAA4B,CAAC,MAAM,CAAA;IAC5C,CAAC;IAMD,OAAO;;QACL,KAAK,CAAC,OAAO,EAAE,CAAA;QAEf,MAAA,IAAI,CAAC,YAAY,0CAAE,WAAW,EAAE,CAAA;QAChC,OAAO,IAAI,CAAC,YAAY,CAAA;IAC1B,CAAC;IAED,MAAM,CAAC,OAAiC;QACtC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,OAAO,CAAC,SAAS,EAAE,CAAA;QACnB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,4BAA4B,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IACvF,CAAC;IAED,KAAK;QACH,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU;YAAE,OAAM;QAChC,IAAI,CAAC,iCAAiC,EAAE,CAAA;IAC1C,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;IAED,iCAAiC;QAC/B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU;YAAE,OAAM;QAChC,IAAI,CAAC,cAAc,EAAE,CAAA;IACvB,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,IAAI,EAAE,YAAY,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAEpD,YAAY,GAAG,YAAY,IAAI,YAAY,CAAA;QAE3C,IAAI,CAAC,YAAY,GAAG,MAAM,SAAS,CACjC;YACE,KAAK,EAAE,GAAG,CAAA;;iDAE+B,YAAY,qBAAqB,YAAY;;;;;;;;;;;;;;;;OAgBvF;SACA,EACD;YACE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAiB,EAAE,EAAE;gBACtC,IAAI,IAAI,EAAE;oBACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,qBAAqB,CAAA;iBACvC;YACH,CAAC;SACF,CACF,CAAA;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,gCAAgC,EAAE,4BAA4B,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nimport { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport { scenarios } from './client-api'\nimport { subscribe } from './origin-client'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'select',\n label: 'scenario-name',\n name: 'scenarioName',\n property: {\n options: scenarios\n }\n },\n {\n type: 'string',\n label: 'instance-name',\n name: 'instanceName'\n }\n ],\n help: 'scene/component/scenario-instance-subscription'\n}\n\nexport default class ScenarioInstanceSubscription extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!ScenarioInstanceSubscription._image) {\n ScenarioInstanceSubscription._image = new Image()\n ScenarioInstanceSubscription._image.src = new URL(\n '../icons/symbol-scenario-instance-subscription.png',\n import.meta.url\n ).href\n }\n\n return ScenarioInstanceSubscription._image\n }\n\n private subscription?: {\n unsubscribe(): void\n }\n\n dispose() {\n super.dispose()\n\n this.subscription?.unsubscribe()\n delete this.subscription\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, ScenarioInstanceSubscription.image, left, top, width, height)\n }\n\n ready() {\n if (!this.app.isViewMode) return\n this._initScenarioInstanceSubscription()\n }\n\n get nature() {\n return NATURE\n }\n\n _initScenarioInstanceSubscription() {\n if (!this.app.isViewMode) return\n this.startSubscribe()\n }\n\n async startSubscribe() {\n var { instanceName, scenarioName = '' } = this.state\n\n instanceName = instanceName || scenarioName\n\n this.subscription = await subscribe(\n {\n query: gql`\n subscription {\n scenarioInstanceState(instanceName: \"${instanceName}\", scenarioName: \"${scenarioName}\") {\n instanceName\n scenarioName\n state\n variables\n progress{\n rounds\n rate\n steps\n step\n }\n data\n message\n timestamp\n }\n }\n `\n },\n {\n next: async ({ data }: { data: any }) => {\n if (data) {\n this.data = data.scenarioInstanceState\n }\n }\n }\n )\n }\n}\n\nComponent.register('scenario-instance-subscription', ScenarioInstanceSubscription)\n"]}
@@ -1,6 +1,7 @@
1
1
  import { Shape } from '@hatiolab/things-scene';
2
2
  declare const ScenarioQueueSubscription_base: (new (...args: any[]) => {
3
3
  isDataSource(): boolean;
4
+ _convertDataFormat(data: any, format: string): any;
4
5
  }) & typeof Shape;
5
6
  export default class ScenarioQueueSubscription extends ScenarioQueueSubscription_base {
6
7
  static _image: HTMLImageElement;
@@ -1,6 +1,5 @@
1
- import { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene';
2
- import COMPONENT_IMAGE from '../assets/symbol-scenario-queue-subscription.png';
3
1
  import gql from 'graphql-tag';
2
+ import { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene';
4
3
  import { subscribe } from './origin-client';
5
4
  const NATURE = {
6
5
  mutable: false,
@@ -13,7 +12,7 @@ export default class ScenarioQueueSubscription extends DataSource(RectPath(Shape
13
12
  static get image() {
14
13
  if (!ScenarioQueueSubscription._image) {
15
14
  ScenarioQueueSubscription._image = new Image();
16
- ScenarioQueueSubscription._image.src = COMPONENT_IMAGE;
15
+ ScenarioQueueSubscription._image.src = new URL('../icons/symbol-scenario-queue-subscription.png', import.meta.url).href;
17
16
  }
18
17
  return ScenarioQueueSubscription._image;
19
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"scenario-queue-subscription.js","sourceRoot":"","sources":["../src/scenario-queue-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE/E,OAAO,eAAe,MAAM,kDAAkD,CAAA;AAC9E,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,6CAA6C;CACpD,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAGhF,MAAM,KAAK,K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;YACH,CAAC;SACF,CACF,CAAA;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,6BAA6B,EAAE,yBAAyB,CAAC,CAAA","sourcesContent":["import { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport COMPONENT_IMAGE from '../assets/symbol-scenario-queue-subscription.png'\nimport gql from 'graphql-tag'\nimport { subscribe } from './origin-client'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [],\n help: 'scene/component/scenario-queue-subscription'\n}\n\nexport default class ScenarioQueueSubscription extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!ScenarioQueueSubscription._image) {\n ScenarioQueueSubscription._image = new Image()\n ScenarioQueueSubscription._image.src = COMPONENT_IMAGE\n }\n\n return ScenarioQueueSubscription._image\n }\n\n private subscription?: {\n unsubscribe(): void\n }\n\n dispose() {\n super.dispose()\n\n this.subscription?.unsubscribe()\n delete this.subscription\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, ScenarioQueueSubscription.image, left, top, width, height)\n }\n\n ready() {\n if (!this.app.isViewMode) return\n this._initScenarioQueueSubscription()\n }\n\n get nature() {\n return NATURE\n }\n\n _initScenarioQueueSubscription() {\n if (!this.app.isViewMode) return\n this.startSubscribe()\n }\n\n async startSubscribe() {\n this.subscription = await subscribe(\n {\n query: gql`\n subscription {\n scenarioQueueState {\n queue {\n stuff\n due\n priority\n tag\n }\n }\n }\n `\n },\n {\n next: async ({ data }: { data: any }) => {\n if (data) {\n this.data = data.scenarioQueueState\n }\n }\n }\n )\n }\n}\n\nComponent.register('scenario-queue-subscription', ScenarioQueueSubscription)\n"]}
1
+ {"version":3,"file":"scenario-queue-subscription.js","sourceRoot":"","sources":["../src/scenario-queue-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAE,U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,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;IAED,8BAA8B;QAC5B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU;YAAE,OAAM;QAChC,IAAI,CAAC,cAAc,EAAE,CAAA;IACvB,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,IAAI,CAAC,YAAY,GAAG,MAAM,SAAS,CACjC;YACE,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;SAWT;SACF,EACD;YACE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAiB,EAAE,EAAE;gBACtC,IAAI,IAAI,EAAE;oBACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAA;iBACpC;YACH,CAAC;SACF,CACF,CAAA;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,6BAA6B,EAAE,yBAAyB,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nimport { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport { subscribe } from './origin-client'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [],\n help: 'scene/component/scenario-queue-subscription'\n}\n\nexport default class ScenarioQueueSubscription extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!ScenarioQueueSubscription._image) {\n ScenarioQueueSubscription._image = new Image()\n ScenarioQueueSubscription._image.src = new URL(\n '../icons/symbol-scenario-queue-subscription.png',\n import.meta.url\n ).href\n }\n\n return ScenarioQueueSubscription._image\n }\n\n private subscription?: {\n unsubscribe(): void\n }\n\n dispose() {\n super.dispose()\n\n this.subscription?.unsubscribe()\n delete this.subscription\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, ScenarioQueueSubscription.image, left, top, width, height)\n }\n\n ready() {\n if (!this.app.isViewMode) return\n this._initScenarioQueueSubscription()\n }\n\n get nature() {\n return NATURE\n }\n\n _initScenarioQueueSubscription() {\n if (!this.app.isViewMode) return\n this.startSubscribe()\n }\n\n async startSubscribe() {\n this.subscription = await subscribe(\n {\n query: gql`\n subscription {\n scenarioQueueState {\n queue {\n stuff\n due\n priority\n tag\n }\n }\n }\n `\n },\n {\n next: async ({ data }: { data: any }) => {\n if (data) {\n this.data = data.scenarioQueueState\n }\n }\n }\n )\n }\n}\n\nComponent.register('scenario-queue-subscription', ScenarioQueueSubscription)\n"]}
@@ -1,6 +1,7 @@
1
1
  import { Properties, Shape } from '@hatiolab/things-scene';
2
2
  declare const ScenarioRun_base: (new (...args: any[]) => {
3
3
  isDataSource(): boolean;
4
+ _convertDataFormat(data: any, format: string): any;
4
5
  }) & typeof Shape;
5
6
  export default class ScenarioRun extends ScenarioRun_base {
6
7
  static _image: HTMLImageElement;
@@ -1,7 +1,7 @@
1
+ import gql from 'graphql-tag';
1
2
  import { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene';
2
- import COMPONENT_IMAGE from '../assets/symbol-scenario-run.png';
3
+ import { scenarios } from './client-api';
3
4
  import { getClient } from './origin-client';
4
- import gql from 'graphql-tag';
5
5
  const NATURE = {
6
6
  mutable: false,
7
7
  resizable: true,
@@ -12,23 +12,7 @@ const NATURE = {
12
12
  label: 'scenario-name',
13
13
  name: 'scenarioName',
14
14
  property: {
15
- options: async () => {
16
- var response = await getClient().query({
17
- query: gql `
18
- query {
19
- scenarios {
20
- items {
21
- name
22
- }
23
- }
24
- }
25
- `
26
- });
27
- if (response.errors) {
28
- return [''];
29
- }
30
- return [''].concat(response.data.scenarios.items.map((item) => item.name));
31
- }
15
+ options: scenarios
32
16
  }
33
17
  },
34
18
  {
@@ -49,7 +33,7 @@ export default class ScenarioRun extends DataSource(RectPath(Shape)) {
49
33
  static get image() {
50
34
  if (!ScenarioRun._image) {
51
35
  ScenarioRun._image = new Image();
52
- ScenarioRun._image.src = COMPONENT_IMAGE;
36
+ ScenarioRun._image.src = new URL('../icons/symbol-scenario-run.png', import.meta.url).href;
53
37
  }
54
38
  return ScenarioRun._image;
55
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"scenario-run.js","sourceRoot":"","sources":["../src/scenario-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAc,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE3F,OAAO,eAAe,MAAM,mCAAmC,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,MAAM,MAAM,GAAG;IACb,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;YACpB,QAAQ,EAAE;gBACR,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,IAAI,QAAQ,GAAG,MAAM,SAAS,EAAE,CAAC,KAAK,CAAC;wBACrC,KAAK,EAAE,GAAG,CAAA;;;;;;;;aAQT;qBACF,CAAC,CAAA;oBACF,IAAI,QAAQ,CAAC,MAAM,EAAE;wBACnB,OAAO,CAAC,EAAE,CAAC,CAAA;qBACZ;oBAED,OAAO,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;gBACjF,CAAC;aACF;SACF;QACD;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,WAAW;SAClB;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,YAAY;SACnB;KACF;IACD,gBAAgB,EAAE,WAAW;IAC7B,IAAI,EAAE,8BAA8B;CACrC,CAAA;AAED,M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cesContent":["import { Component, DataSource, Properties, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport COMPONENT_IMAGE from '../assets/symbol-scenario-run.png'\nimport { getClient } from './origin-client'\nimport gql from 'graphql-tag'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'select',\n label: 'scenario-name',\n name: 'scenarioName',\n property: {\n options: async () => {\n var response = await getClient().query({\n query: gql`\n query {\n scenarios {\n items {\n name\n }\n }\n }\n `\n })\n if (response.errors) {\n return ['']\n }\n\n return [''].concat(response.data.scenarios.items.map((item: any) => item.name))\n }\n }\n },\n {\n type: 'data',\n label: 'variables',\n name: 'variables'\n },\n {\n type: 'checkbox',\n label: 'run-on-start',\n name: 'runOnStart'\n }\n ],\n 'value-property': 'variables',\n help: 'scene/component/scenario-run'\n}\n\nexport default class ScenarioRun extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!ScenarioRun._image) {\n ScenarioRun._image = new Image()\n ScenarioRun._image.src = COMPONENT_IMAGE\n }\n return ScenarioRun._image\n }\n\n private _client: any\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n context.beginPath()\n this.drawImage(context, ScenarioRun.image, left, top, width, height)\n }\n\n ready() {\n super.ready()\n this._initScenario()\n }\n\n _initScenario() {\n if (!this.app.isViewMode) {\n return\n }\n this._client = getClient()\n if (this.state.runOnStart) {\n this.requestData()\n }\n }\n\n dispose() {\n super.dispose()\n\n try {\n if (this._client) {\n this._client.stop()\n }\n } catch (e) {\n console.error(e)\n }\n delete this._client\n }\n\n get nature() {\n return NATURE\n }\n\n 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 get client() {\n return this._client\n }\n\n async requestData() {\n let { scenarioName, variables } = this.state\n if (!scenarioName || !this.app.isViewMode) return\n\n var client = this._client\n try {\n variables = typeof variables == 'string' ? JSON.parse(variables) : variables\n } catch (e) {\n console.warn('runScenario mutation variable is not an object')\n }\n\n if (client) {\n var response = await client.query({\n query: gql`\n mutation ($scenarioName: String!, $variables: Object) {\n runScenario(scenarioName: $scenarioName, variables: $variables) {\n state\n message\n data\n }\n }\n `,\n variables: {\n scenarioName: scenarioName,\n variables\n }\n })\n\n this.data = response?.data?.runScenario?.data\n }\n }\n}\n\nComponent.register('scenario-run', ScenarioRun)\n"]}
1
+ {"version":3,"file":"scenario-run.js","sourceRoot":"","sources":["../src/scenario-run.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAc,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE3F,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,MAAM,GAAG;IACb,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;YACpB,QAAQ,EAAE;gBACR,OAAO,EAAE,SAAS;aACnB;SACF;QACD;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,WAAW;SAClB;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,YAAY;SACnB;KACF;IACD,gBAAgB,EAAE,WAAW;IAC7B,IAAI,EAAE,8BAA8B;CACrC,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAGlE,MAAM,KAAK,KAAK;QACd,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;YACvB,WAAW,CAAC,MAAM,GA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AAW,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,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,WAAW;;QACf,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAC5C,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU;YAAE,OAAM;QAEjD,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,CAAA;QACzB,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,IAAI,CAAC,gDAAgD,CAAC,CAAA;SAC/D;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,SAAS;iBACV;aACF,CAAC,CAAA;YAEF,IAAI,CAAC,IAAI,GAAG,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,0CAAE,WAAW,0CAAE,IAAI,CAAA;SAC9C;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nimport { Component, DataSource, Properties, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport { scenarios } from './client-api'\nimport { getClient } from './origin-client'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\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 type: 'checkbox',\n label: 'run-on-start',\n name: 'runOnStart'\n }\n ],\n 'value-property': 'variables',\n help: 'scene/component/scenario-run'\n}\n\nexport default class ScenarioRun extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!ScenarioRun._image) {\n ScenarioRun._image = new Image()\n ScenarioRun._image.src = new URL('../icons/symbol-scenario-run.png', import.meta.url).href\n }\n return ScenarioRun._image\n }\n\n private _client: any\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n context.beginPath()\n this.drawImage(context, ScenarioRun.image, left, top, width, height)\n }\n\n ready() {\n super.ready()\n this._initScenario()\n }\n\n _initScenario() {\n if (!this.app.isViewMode) {\n return\n }\n this._client = getClient()\n if (this.state.runOnStart) {\n this.requestData()\n }\n }\n\n dispose() {\n super.dispose()\n\n try {\n if (this._client) {\n this._client.stop()\n }\n } catch (e) {\n console.error(e)\n }\n delete this._client\n }\n\n get nature() {\n return NATURE\n }\n\n 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 get client() {\n return this._client\n }\n\n async requestData() {\n let { scenarioName, variables } = this.state\n if (!scenarioName || !this.app.isViewMode) return\n\n var client = this._client\n try {\n variables = typeof variables == 'string' ? JSON.parse(variables) : variables\n } catch (e) {\n console.warn('runScenario mutation variable is not an object')\n }\n\n if (client) {\n var response = await client.query({\n query: gql`\n mutation ($scenarioName: String!, $variables: Object) {\n runScenario(scenarioName: $scenarioName, variables: $variables) {\n state\n message\n data\n }\n }\n `,\n variables: {\n scenarioName: scenarioName,\n variables\n }\n })\n\n this.data = response?.data?.runScenario?.data\n }\n }\n}\n\nComponent.register('scenario-run', ScenarioRun)\n"]}
@@ -1,6 +1,7 @@
1
1
  import { Properties, Shape } from '@hatiolab/things-scene';
2
2
  declare const ScenarioStart_base: (new (...args: any[]) => {
3
3
  isDataSource(): boolean;
4
+ _convertDataFormat(data: any, format: string): any;
4
5
  }) & typeof Shape;
5
6
  export default class ScenarioStart extends ScenarioStart_base {
6
7
  static _image: HTMLImageElement;
@@ -1,7 +1,7 @@
1
+ import gql from 'graphql-tag';
1
2
  import { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene';
2
- import COMPONENT_IMAGE from '../assets/symbol-scenario-start.png';
3
+ import { scenarios } from './client-api';
3
4
  import { getClient } from './origin-client';
4
- import gql from 'graphql-tag';
5
5
  const NATURE = {
6
6
  mutable: false,
7
7
  resizable: true,
@@ -17,23 +17,7 @@ const NATURE = {
17
17
  label: 'scenario-name',
18
18
  name: 'scenarioName',
19
19
  property: {
20
- options: async () => {
21
- var response = await getClient().query({
22
- query: gql `
23
- query {
24
- scenarios {
25
- items {
26
- name
27
- }
28
- }
29
- }
30
- `
31
- });
32
- if (response.errors) {
33
- return [''];
34
- }
35
- return [''].concat(response.data.scenarios.items.map((item) => item.name));
36
- }
20
+ options: scenarios
37
21
  }
38
22
  },
39
23
  {
@@ -49,7 +33,7 @@ export default class ScenarioStart extends DataSource(RectPath(Shape)) {
49
33
  static get image() {
50
34
  if (!ScenarioStart._image) {
51
35
  ScenarioStart._image = new Image();
52
- ScenarioStart._image.src = COMPONENT_IMAGE;
36
+ ScenarioStart._image.src = new URL('../icons/symbol-scenario-start.png', import.meta.url).href;
53
37
  }
54
38
  return ScenarioStart._image;
55
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"scenario-start.js","sourceRoot":"","sources":["../src/scenario-start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAc,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE3F,OA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C,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,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,MAAM,GAAG,IAAI,CAAC,OAAO,CAAA;QACzB,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 { Component, DataSource, Properties, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport COMPONENT_IMAGE from '../assets/symbol-scenario-start.png'\nimport { getClient } from './origin-client'\nimport gql from 'graphql-tag'\n\nconst NATURE = {\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: async () => {\n var response = await getClient().query({\n query: gql`\n query {\n scenarios {\n items {\n name\n }\n }\n }\n `\n })\n if (response.errors) {\n return ['']\n }\n\n return [''].concat(response.data.scenarios.items.map((item: any) => item.name))\n }\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 = COMPONENT_IMAGE\n }\n return ScenarioStart._image\n }\n\n private _client: any\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 ready() {\n super.ready()\n this._initScenario()\n }\n\n _initScenario() {\n if (!this.app.isViewMode) {\n return\n }\n this._client = getClient()\n }\n\n dispose() {\n super.dispose()\n\n try {\n if (this._client) {\n this._client.stop()\n }\n } catch (e) {\n console.error(e)\n }\n delete this._client\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 get client() {\n return this._client\n }\n\n async requestData() {\n let { instanceName, scenarioName, variables } = this.state\n if (!scenarioName || !this.app.isViewMode) return\n\n var client = this._client\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', Scenario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AAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAC1D,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU;YAAE,OAAM;QAEjD,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,CAAA;QACzB,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, DataSource, Properties, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport { scenarios } from './client-api'\nimport { getClient } from './origin-client'\n\nconst NATURE = {\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 private _client: any\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 ready() {\n super.ready()\n this._initScenario()\n }\n\n _initScenario() {\n if (!this.app.isViewMode) {\n return\n }\n this._client = getClient()\n }\n\n dispose() {\n super.dispose()\n\n try {\n if (this._client) {\n this._client.stop()\n }\n } catch (e) {\n console.error(e)\n }\n delete this._client\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 get client() {\n return this._client\n }\n\n async requestData() {\n let { instanceName, scenarioName, variables } = this.state\n if (!scenarioName || !this.app.isViewMode) return\n\n var client = this._client\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"]}
@@ -1,6 +1,7 @@
1
1
  import { Properties, Shape } from '@hatiolab/things-scene';
2
2
  declare const ScenarioStop_base: (new (...args: any[]) => {
3
3
  isDataSource(): boolean;
4
+ _convertDataFormat(data: any, format: string): any;
4
5
  }) & typeof Shape;
5
6
  export default class ScenarioStop extends ScenarioStop_base {
6
7
  static _image: HTMLImageElement;
@@ -1,7 +1,7 @@
1
+ import gql from 'graphql-tag';
1
2
  import { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene';
2
- import COMPONENT_IMAGE from '../assets/symbol-scenario-stop.png';
3
+ import { scenarios } from './client-api';
3
4
  import { getClient } from './origin-client';
4
- import gql from 'graphql-tag';
5
5
  const NATURE = {
6
6
  mutable: false,
7
7
  resizable: true,
@@ -17,23 +17,7 @@ const NATURE = {
17
17
  label: 'scenario-name',
18
18
  name: 'scenarioName',
19
19
  property: {
20
- options: async () => {
21
- var response = await getClient().query({
22
- query: gql `
23
- query {
24
- scenarios {
25
- items {
26
- name
27
- }
28
- }
29
- }
30
- `
31
- });
32
- if (response.errors) {
33
- return [''];
34
- }
35
- return [''].concat(response.data.scenarios.items.map((item) => item.name));
36
- }
20
+ options: scenarios
37
21
  }
38
22
  }
39
23
  ],
@@ -44,7 +28,7 @@ export default class ScenarioStop extends DataSource(RectPath(Shape)) {
44
28
  static get image() {
45
29
  if (!ScenarioStop._image) {
46
30
  ScenarioStop._image = new Image();
47
- ScenarioStop._image.src = COMPONENT_IMAGE;
31
+ ScenarioStop._image.src = new URL('../icons/symbol-scenario-stop.png', import.meta.url).href;
48
32
  }
49
33
  return ScenarioStop._image;
50
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"scenario-stop.js","sourceRoot":"","sources":["../src/scenario-stop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAc,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE3F,OAAO,eAAe,MAAM,oCAAoC,CAAA;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,MAAM,MAAM,GAAG;IACb,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;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,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 { Component, DataSource, Properties, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport COMPONENT_IMAGE from '../assets/symbol-scenario-stop.png'\nimport { getClient } from './origin-client'\nimport gql from 'graphql-tag'\n\nconst NATURE = {\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: async () => {\n var response = await getClient().query({\n query: gql`\n query {\n scenarios {\n items {\n name\n }\n }\n }\n `\n })\n if (response.errors) {\n return ['']\n }\n\n return [''].concat(response.data.scenarios.items.map((item: any) => item.name))\n }\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 = COMPONENT_IMAGE\n }\n return ScenarioStop._image\n }\n\n private _client: any\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 ready() {\n super.ready()\n this._initScenario()\n }\n\n _initScenario() {\n if (!this.app.isViewMode) {\n return\n }\n this._client = getClient()\n }\n\n dispose() {\n super.dispose()\n\n try {\n if (this._client) {\n this._client.stop()\n }\n } catch (e) {\n console.error(e)\n }\n delete this._client\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 get client() {\n return this._client\n }\n\n async requestData() {\n let { instanceName, scenarioName } = this.state\n instanceName = instanceName || scenarioName\n if (!instanceName || !this.app.isViewMode) return\n\n var client = this._client\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"]}
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,EAAE,UAAU,EAAc,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE3F,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,MAAM,GAAG;IACb,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,C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,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,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,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,GAAG,IAAI,CAAC,OAAO,CAAA;QACzB,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, DataSource, Properties, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport { scenarios } from './client-api'\nimport { getClient } from './origin-client'\n\nconst NATURE = {\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 private _client: any\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 ready() {\n super.ready()\n this._initScenario()\n }\n\n _initScenario() {\n if (!this.app.isViewMode) {\n return\n }\n this._client = getClient()\n }\n\n dispose() {\n super.dispose()\n\n try {\n if (this._client) {\n this._client.stop()\n }\n } catch (e) {\n console.error(e)\n }\n delete this._client\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 get client() {\n return this._client\n }\n\n async requestData() {\n let { instanceName, scenarioName } = this.state\n instanceName = instanceName || scenarioName\n if (!instanceName || !this.app.isViewMode) return\n\n var client = this._client\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"]}
@@ -2,7 +2,7 @@ declare const _default: {
2
2
  type: string;
3
3
  description: string;
4
4
  group: string;
5
- icon: any;
5
+ icon: string;
6
6
  model: {
7
7
  type: string;
8
8
  left: number;
@@ -1,4 +1,4 @@
1
- import icon from '../../assets/icon-connection-control.png';
1
+ const icon = new URL('../../icons/icon-connection-control.png', import.meta.url).href;
2
2
  export default {
3
3
  type: 'connection-control',
4
4
  description: 'connection-control',
@@ -1 +1 @@
1
- {"version":3,"file":"connection-control.js","sourceRoot":"","sources":["../../src/templates/connection-control.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,0CAA0C,CAAA;AAE3D,eAAe;IACb,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["import icon from '../../assets/icon-connection-control.png'\n\nexport default {\n type: 'connection-control',\n description: 'connection-control',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'connection-control',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
1
+ {"version":3,"file":"connection-control.js","sourceRoot":"","sources":["../../src/templates/connection-control.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,yCAAyC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAErF,eAAe;IACb,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-connection-control.png', import.meta.url).href\n\nexport default {\n type: 'connection-control',\n description: 'connection-control',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'connection-control',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
@@ -2,7 +2,7 @@ declare const _default: {
2
2
  type: string;
3
3
  description: string;
4
4
  group: string;
5
- icon: any;
5
+ icon: string;
6
6
  model: {
7
7
  type: string;
8
8
  left: number;
@@ -1,4 +1,4 @@
1
- import icon from '../../assets/icon-connection-state-subscription.png';
1
+ const icon = new URL('../../icons/icon-connection-state-subscription.png', import.meta.url).href;
2
2
  export default {
3
3
  type: 'connection-state-subscription',
4
4
  description: 'connection-state-subscription',
@@ -1 +1 @@
1
- {"version":3,"file":"connection-state-subscription.js","sourceRoot":"","sources":["../../src/templates/connection-state-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,qDAAqD,CAAA;AAEtE,eAAe;IACb,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,+BAA+B;IAC5C,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,+BAA+B;QACrC,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["import icon from '../../assets/icon-connection-state-subscription.png'\n\nexport default {\n type: 'connection-state-subscription',\n description: 'connection-state-subscription',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'connection-state-subscription',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
1
+ {"version":3,"file":"connection-state-subscription.js","sourceRoot":"","sources":["../../src/templates/connection-state-subscription.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,oDAAoD,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEhG,eAAe;IACb,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,+BAA+B;IAC5C,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,+BAA+B;QACrC,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-connection-state-subscription.png', import.meta.url).href\n\nexport default {\n type: 'connection-state-subscription',\n description: 'connection-state-subscription',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'connection-state-subscription',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
@@ -2,7 +2,7 @@ declare const _default: {
2
2
  type: string;
3
3
  description: string;
4
4
  group: string;
5
- icon: any;
5
+ icon: string;
6
6
  model: {
7
7
  type: string;
8
8
  left: number;
@@ -1,4 +1,4 @@
1
- import icon from '../../assets/icon-data-subscription.png';
1
+ const icon = new URL('../../icons/icon-data-subscription.png', import.meta.url).href;
2
2
  export default {
3
3
  type: 'data-subscription',
4
4
  description: 'data-subscription',
@@ -1 +1 @@
1
- {"version":3,"file":"data-subscription.js","sourceRoot":"","sources":["../../src/templates/data-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,yCAAyC,CAAA;AAE1D,eAAe;IACb,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,mBAAmB;QACzB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["import icon from '../../assets/icon-data-subscription.png'\n\nexport default {\n type: 'data-subscription',\n description: 'data-subscription',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'data-subscription',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
1
+ {"version":3,"file":"data-subscription.js","sourceRoot":"","sources":["../../src/templates/data-subscription.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,wCAAwC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEpF,eAAe;IACb,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,mBAAmB;QACzB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-data-subscription.png', import.meta.url).href\n\nexport default {\n type: 'data-subscription',\n description: 'data-subscription',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'data-subscription',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
@@ -2,7 +2,7 @@ declare const _default: {
2
2
  type: string;
3
3
  description: string;
4
4
  group: string;
5
- icon: any;
5
+ icon: string;
6
6
  model: {
7
7
  type: string;
8
8
  left: number;
@@ -2,7 +2,7 @@ declare const _default: {
2
2
  type: string;
3
3
  description: string;
4
4
  group: string;
5
- icon: any;
5
+ icon: string;
6
6
  model: {
7
7
  type: string;
8
8
  left: number;
@@ -1,4 +1,4 @@
1
- import icon from '../../assets/icon-scenario-control.png';
1
+ const icon = new URL('../../icons/icon-scenario-control.png', import.meta.url).href;
2
2
  export default {
3
3
  type: 'scenario-control',
4
4
  description: 'scenario-control',
@@ -1 +1 @@
1
- {"version":3,"file":"scenario-control.js","sourceRoot":"","sources":["../../src/templates/scenario-control.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,wCAAwC,CAAA;AAEzD,eAAe;IACb,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["import icon from '../../assets/icon-scenario-control.png'\n\nexport default {\n type: 'scenario-control',\n description: 'scenario-control',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-control',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n controlType: '',\n hidden: true\n }\n}\n"]}
1
+ {"version":3,"file":"scenario-control.js","sourceRoot":"","sources":["../../src/templates/scenario-control.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,uCAAuC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEnF,eAAe;IACb,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-scenario-control.png', import.meta.url).href\n\nexport default {\n type: 'scenario-control',\n description: 'scenario-control',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-control',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n controlType: '',\n hidden: true\n }\n}\n"]}
@@ -2,7 +2,7 @@ declare const _default: {
2
2
  type: string;
3
3
  description: string;
4
4
  group: string;
5
- icon: any;
5
+ icon: string;
6
6
  model: {
7
7
  type: string;
8
8
  left: number;
@@ -1,4 +1,4 @@
1
- import icon from '../../assets/icon-scenario-queue-subscription.png';
1
+ const icon = new URL('../../icons/icon-scenario-queue-subscription.png', import.meta.url).href;
2
2
  export default {
3
3
  type: 'scenario-queue-subscription',
4
4
  description: 'scenario-queue-subscription',
@@ -1 +1 @@
1
- {"version":3,"file":"scenario-instance-subscription.js","sourceRoot":"","sources":["../../src/templates/scenario-instance-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,mDAAmD,CAAA;AAEpE,eAAe;IACb,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE,6BAA6B;IAC1C,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,6BAA6B;QACnC,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["import icon from '../../assets/icon-scenario-queue-subscription.png'\n\nexport default {\n type: 'scenario-queue-subscription',\n description: 'scenario-queue-subscription',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-queue-subscription',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
1
+ {"version":3,"file":"scenario-instance-subscription.js","sourceRoot":"","sources":["../../src/templates/scenario-instance-subscription.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,kDAAkD,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAE9F,eAAe;IACb,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE,6BAA6B;IAC1C,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,6BAA6B;QACnC,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-scenario-queue-subscription.png', import.meta.url).href\n\nexport default {\n type: 'scenario-queue-subscription',\n description: 'scenario-queue-subscription',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-queue-subscription',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
@@ -2,7 +2,7 @@ declare const _default: {
2
2
  type: string;
3
3
  description: string;
4
4
  group: string;
5
- icon: any;
5
+ icon: string;
6
6
  model: {
7
7
  type: string;
8
8
  left: number;
@@ -1,4 +1,4 @@
1
- import icon from '../../assets/icon-scenario-instance-subscription.png';
1
+ const icon = new URL('../../icons/icon-scenario-instance-subscription.png', import.meta.url).href;
2
2
  export default {
3
3
  type: 'scenario-instance-subscription',
4
4
  description: 'scenario-instance-subscription',
@@ -1 +1 @@
1
- {"version":3,"file":"scenario-queue-subscription.js","sourceRoot":"","sources":["../../src/templates/scenario-queue-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,sDAAsD,CAAA;AAEvE,eAAe;IACb,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE,gCAAgC;IAC7C,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,gCAAgC;QACtC,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["import icon from '../../assets/icon-scenario-instance-subscription.png'\n\nexport default {\n type: 'scenario-instance-subscription',\n description: 'scenario-instance-subscription',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-instance-subscription',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
1
+ {"version":3,"file":"scenario-queue-subscription.js","sourceRoot":"","sources":["../../src/templates/scenario-queue-subscription.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,qDAAqD,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEjG,eAAe;IACb,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE,gCAAgC;IAC7C,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,gCAAgC;QACtC,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-scenario-instance-subscription.png', import.meta.url).href\n\nexport default {\n type: 'scenario-instance-subscription',\n description: 'scenario-instance-subscription',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-instance-subscription',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
@@ -2,7 +2,7 @@ declare const _default: {
2
2
  type: string;
3
3
  description: string;
4
4
  group: string;
5
- icon: any;
5
+ icon: string;
6
6
  model: {
7
7
  type: string;
8
8
  left: number;
@@ -1,4 +1,4 @@
1
- import icon from '../../assets/icon-scenario-run.png';
1
+ const icon = new URL('../../icons/icon-scenario-run.png', import.meta.url).href;
2
2
  export default {
3
3
  type: 'scenario-run',
4
4
  description: 'scenario-run',
@@ -1 +1 @@
1
- {"version":3,"file":"scenario-run.js","sourceRoot":"","sources":["../../src/templates/scenario-run.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,oCAAoC,CAAA;AAErD,eAAe;IACb,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["import icon from '../../assets/icon-scenario-run.png'\n\nexport default {\n type: 'scenario-run',\n description: 'scenario-run',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-run',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
1
+ {"version":3,"file":"scenario-run.js","sourceRoot":"","sources":["../../src/templates/scenario-run.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,mCAAmC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAE/E,eAAe;IACb,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-scenario-run.png', import.meta.url).href\n\nexport default {\n type: 'scenario-run',\n description: 'scenario-run',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-run',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
@@ -2,7 +2,7 @@ declare const _default: {
2
2
  type: string;
3
3
  description: string;
4
4
  group: string;
5
- icon: any;
5
+ icon: string;
6
6
  model: {
7
7
  type: string;
8
8
  left: number;
@@ -1,4 +1,4 @@
1
- import icon from '../../assets/icon-scenario-start.png';
1
+ const icon = new URL('../../icons/icon-scenario-start.png', import.meta.url).href;
2
2
  export default {
3
3
  type: 'scenario-start',
4
4
  description: 'scenario-start',
@@ -1 +1 @@
1
- {"version":3,"file":"scenario-start.js","sourceRoot":"","sources":["../../src/templates/scenario-start.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,sCAAsC,CAAA;AAEvD,eAAe;IACb,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["import icon from '../../assets/icon-scenario-start.png'\n\nexport default {\n type: 'scenario-start',\n description: 'scenario-start',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-start',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
1
+ {"version":3,"file":"scenario-start.js","sourceRoot":"","sources":["../../src/templates/scenario-start.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,qCAAqC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEjF,eAAe;IACb,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-scenario-start.png', import.meta.url).href\n\nexport default {\n type: 'scenario-start',\n description: 'scenario-start',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-start',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
@@ -2,7 +2,7 @@ declare const _default: {
2
2
  type: string;
3
3
  description: string;
4
4
  group: string;
5
- icon: any;
5
+ icon: string;
6
6
  model: {
7
7
  type: string;
8
8
  left: number;
@@ -1,4 +1,4 @@
1
- import icon from '../../assets/icon-scenario-stop.png';
1
+ const icon = new URL('../../icons/icon-scenario-stop.png', import.meta.url).href;
2
2
  export default {
3
3
  type: 'scenario-stop',
4
4
  description: 'scenario-stop',
@@ -1 +1 @@
1
- {"version":3,"file":"scenario-stop.js","sourceRoot":"","sources":["../../src/templates/scenario-stop.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,qCAAqC,CAAA;AAEtD,eAAe;IACb,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["import icon from '../../assets/icon-scenario-stop.png'\n\nexport default {\n type: 'scenario-stop',\n description: 'scenario-stop',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-stop',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
1
+ {"version":3,"file":"scenario-stop.js","sourceRoot":"","sources":["../../src/templates/scenario-stop.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,oCAAoC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEhF,eAAe;IACb,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,KAAK,EAAE,YAAY;IACnB,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,IAAI;KACb;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/icon-scenario-stop.png', import.meta.url).href\n\nexport default {\n type: 'scenario-stop',\n description: 'scenario-stop',\n group: 'dataSource',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'scenario-stop',\n left: 10,\n top: 10,\n width: 100,\n height: 100,\n hidden: true\n }\n}\n"]}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes