@nsshunt/stsvueutils 1.2.19 → 1.2.20

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.
@@ -8307,13 +8307,7 @@ const ModelStore = defineStore("__sts__ModelStore", {
8307
8307
  // https://pinia.vuejs.org/core-concepts/state.html
8308
8308
  state: () => {
8309
8309
  return {
8310
- serviceModel: {},
8311
- agentModel: {},
8312
- modelMeta: {},
8313
- serviceModelSubscriptionKey: null,
8314
- agentModelSubscriptionKey: null,
8315
- friendlyName: {},
8316
- friendNameIndex: 1
8310
+ _models: {}
8317
8311
  };
8318
8312
  },
8319
8313
  // Getters
@@ -8376,25 +8370,48 @@ const ModelStore = defineStore("__sts__ModelStore", {
8376
8370
  }
8377
8371
  },
8378
8372
  */
8379
- UpdateServiceModel(model, subscriptionKey) {
8380
- this.serviceModel = _cloneDeep(model);
8381
- this.serviceModelSubscriptionKey = subscriptionKey;
8373
+ SetupNewModelId(modelId) {
8374
+ this._models[modelId] = {
8375
+ serviceModel: {},
8376
+ agentModel: {},
8377
+ modelMeta: {},
8378
+ serviceModelSubscriptionKey: null,
8379
+ agentModelSubscriptionKey: null,
8380
+ friendlyName: {},
8381
+ friendNameIndex: 1
8382
+ };
8382
8383
  },
8383
- UpdateAgentModel(model, subscriptionKey) {
8384
- this.agentModel = _cloneDeep(model);
8385
- this.agentModelSubscriptionKey = subscriptionKey;
8384
+ UpdateServiceModel(modelId, model, subscriptionKey) {
8385
+ try {
8386
+ if (!this._models[modelId]) {
8387
+ this.SetupNewModelId(modelId);
8388
+ }
8389
+ this._models[modelId].serviceModel = _cloneDeep(model);
8390
+ this._models[modelId].serviceModelSubscriptionKey = subscriptionKey;
8391
+ } catch (error) {
8392
+ console.error(error);
8393
+ }
8386
8394
  },
8387
- GetFriendName(id) {
8388
- if (!this.friendlyName[id]) {
8389
- this.friendlyName[id] = `FN${this.friendNameIndex++}@${id.split("@")[1]}`;
8395
+ UpdateAgentModel(modelId, model, subscriptionKey) {
8396
+ if (!this._models[modelId]) {
8397
+ this.SetupNewModelId(modelId);
8398
+ }
8399
+ this._models[modelId].agentModel = _cloneDeep(model);
8400
+ this._models[modelId].agentModelSubscriptionKey = subscriptionKey;
8401
+ },
8402
+ GetFriendName(modelId, id) {
8403
+ try {
8404
+ if (!this._models[modelId]) {
8405
+ this.SetupNewModelId(modelId);
8406
+ }
8407
+ if (!this._models[modelId].friendlyName[id]) {
8408
+ this._models[modelId].friendlyName[id] = `FN${this._models[modelId].friendNameIndex++}@${id.split("@")[1]}`;
8409
+ }
8410
+ return this._models[modelId].friendlyName[id];
8411
+ } catch (error) {
8412
+ return `Error: ${error}`;
8390
8413
  }
8391
- return this.friendlyName[id];
8392
- }
8393
- /*
8394
- UpdateSubscriptions(subscriptions: ISubscriptions): void {
8395
- this.currentsubscriptions = subscriptions;
8396
8414
  }
8397
- */
8398
8415
  }
8399
8416
  });
8400
8417
  /*! @license DOMPurify 3.0.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.11/LICENSE */
@@ -9405,6 +9422,7 @@ const _hoisted_43 = ["innerHTML"];
9405
9422
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
9406
9423
  __name: "UXModelInstrumentServiceCommon",
9407
9424
  props: {
9425
+ modelId: {},
9408
9426
  instrumentdata: {},
9409
9427
  contextdata: {},
9410
9428
  isleafnode: { type: Boolean },
@@ -9416,7 +9434,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
9416
9434
  chalk$1.level = 3;
9417
9435
  const friendlyTitle = (id) => {
9418
9436
  if (id.length > 30) {
9419
- return store.GetFriendName(id);
9437
+ return store.GetFriendName(props.modelId, id);
9420
9438
  } else {
9421
9439
  return id;
9422
9440
  }
@@ -9501,18 +9519,22 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
9501
9519
  };
9502
9520
  computed({
9503
9521
  get: () => {
9504
- if (store.modelMeta[props.nodeid] && store.modelMeta[props.nodeid].detailView) {
9505
- return store.modelMeta[props.nodeid].detailView;
9522
+ if (store._models[props.modelId]) {
9523
+ if (store._models[props.modelId].modelMeta[props.nodeid] && store._models[props.modelId].modelMeta[props.nodeid].detailView) {
9524
+ return store._models[props.modelId].modelMeta[props.nodeid].detailView;
9525
+ }
9506
9526
  }
9507
9527
  return false;
9508
9528
  },
9509
9529
  set: (val) => {
9510
- if (store.modelMeta[props.nodeid]) {
9511
- store.modelMeta[props.nodeid].detailView = val;
9512
- } else {
9513
- store.modelMeta[props.nodeid] = {
9514
- detailView: val
9515
- };
9530
+ if (store._models[props.modelId]) {
9531
+ if (store._models[props.modelId].modelMeta[props.nodeid]) {
9532
+ store._models[props.modelId].modelMeta[props.nodeid].detailView = val;
9533
+ } else {
9534
+ store._models[props.modelId].modelMeta[props.nodeid] = {
9535
+ detailView: val
9536
+ };
9537
+ }
9516
9538
  }
9517
9539
  }
9518
9540
  });
@@ -10000,8 +10022,8 @@ const _export_sfc = (sfc, props) => {
10000
10022
  }
10001
10023
  return target2;
10002
10024
  };
10003
- const UXModelInstrumentServiceCommon = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-98746b22"]]);
10004
- const _withScopeId = (n) => (pushScopeId("data-v-ad136411"), n = n(), popScopeId(), n);
10025
+ const UXModelInstrumentServiceCommon = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-02af10f2"]]);
10026
+ const _withScopeId = (n) => (pushScopeId("data-v-3eab32be"), n = n(), popScopeId(), n);
10005
10027
  const _hoisted_1$1 = { class: "ststitle" };
10006
10028
  const _hoisted_2$1 = {
10007
10029
  key: 0,
@@ -10063,6 +10085,7 @@ const _hoisted_28 = {
10063
10085
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10064
10086
  __name: "UXModelInstrumentServiceSmall",
10065
10087
  props: {
10088
+ modelId: {},
10066
10089
  instrumentdata: {},
10067
10090
  contextdata: {},
10068
10091
  isleafnode: { type: Boolean },
@@ -10089,7 +10112,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10089
10112
  let barUpdate = 0;
10090
10113
  const friendlyTitle = (id) => {
10091
10114
  if (id.length > 30) {
10092
- return store.GetFriendName(id);
10115
+ return store.GetFriendName(props.modelId, id);
10093
10116
  } else {
10094
10117
  return id;
10095
10118
  }
@@ -10572,12 +10595,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10572
10595
  };
10573
10596
  }
10574
10597
  });
10575
- const UXModelInstrumentServiceSmall = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ad136411"]]);
10598
+ const UXModelInstrumentServiceSmall = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-3eab32be"]]);
10576
10599
  const _hoisted_1 = ["value"];
10577
10600
  const _hoisted_2 = { key: 0 };
10578
10601
  const _sfc_main = /* @__PURE__ */ defineComponent({
10579
10602
  __name: "UXModelNode",
10580
10603
  props: {
10604
+ modelId: {},
10581
10605
  nodeid: {},
10582
10606
  smallMode: { type: Boolean }
10583
10607
  },
@@ -10585,12 +10609,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10585
10609
  setup(__props, { emit: __emit }) {
10586
10610
  chalk$1.level = 3;
10587
10611
  const store = ModelStore();
10612
+ const props = __props;
10588
10613
  const emit = __emit;
10589
10614
  computed(() => {
10590
- return store.agentModel;
10615
+ if (store._models[props.modelId]) {
10616
+ return store._models[props.modelId].agentModel;
10617
+ } else {
10618
+ return {};
10619
+ }
10591
10620
  });
10592
10621
  const serviceModel = computed(() => {
10593
- return store.serviceModel;
10622
+ if (store._models[props.modelId]) {
10623
+ return store._models[props.modelId].serviceModel;
10624
+ } else {
10625
+ return {};
10626
+ }
10594
10627
  });
10595
10628
  const cpu = (model) => {
10596
10629
  try {
@@ -10613,12 +10646,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10613
10646
  cpu(svc) > 0 ? (openBlock(), createElementBlock("div", _hoisted_2, [
10614
10647
  (openBlock(), createBlock(resolveDynamicComponent(_ctx.smallMode ? UXModelInstrumentServiceSmall : UXModelInstrumentServiceCommon), {
10615
10648
  isleafnode: false,
10649
+ "model-id": props.modelId,
10616
10650
  nodeid: svc.id,
10617
10651
  contextdata: svc.context,
10618
10652
  instrumentdata: svc.instruments,
10619
10653
  title: svc.id,
10620
10654
  onMyclick: navigate
10621
- }, null, 40, ["nodeid", "contextdata", "instrumentdata", "title"]))
10655
+ }, null, 40, ["model-id", "nodeid", "contextdata", "instrumentdata", "title"]))
10622
10656
  ])) : createCommentVNode("", true)
10623
10657
  ], 8, _hoisted_1);
10624
10658
  }), 128);