@blueking/ai-ui-sdk 0.3.0-beta.20 → 0.3.0-beta.22

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 (128) hide show
  1. package/dist/common/constants.d.ts +1 -0
  2. package/dist/common/constants.ts.js +1 -0
  3. package/dist/components/render-agent/agent-type.vue.css +3 -3
  4. package/dist/components/render-agent/agent-type.vue.js +1 -1
  5. package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
  6. package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
  7. package/dist/components/render-auto-refresh/index.vue.css +8 -8
  8. package/dist/components/render-auto-refresh/index.vue.js +1 -1
  9. package/dist/components/render-card/agent/index.script.vue.js.js +3 -1
  10. package/dist/components/render-card/agent/prefix-info-tool.vue.css +5 -5
  11. package/dist/components/render-card/agent/prefix-info-tool.vue.js +1 -1
  12. package/dist/components/render-card/agent-command/name-suffix.script.vue.js.js +20 -47
  13. package/dist/components/render-card/base.script.vue.js +5 -2
  14. package/dist/components/render-card/base.vue.css +12 -12
  15. package/dist/components/render-card/base.vue.d.ts +1 -0
  16. package/dist/components/render-card/base.vue.js +1 -1
  17. package/dist/components/render-card/llm/corner-badge.vue.css +3 -3
  18. package/dist/components/render-card/llm/corner-badge.vue.js +1 -1
  19. package/dist/components/render-card/llm/icons.vue.css +2 -2
  20. package/dist/components/render-card/llm/icons.vue.js +1 -1
  21. package/dist/components/render-card/llm/info.vue.css +1 -1
  22. package/dist/components/render-card/llm/info.vue.js +1 -1
  23. package/dist/components/render-card/llm/tag-prefix.vue.css +3 -3
  24. package/dist/components/render-card/llm/tag-prefix.vue.js +1 -1
  25. package/dist/components/render-card/mcp/name-suffix.vue.css +2 -2
  26. package/dist/components/render-card/mcp/name-suffix.vue.js +1 -1
  27. package/dist/components/render-card/prompt/icons.vue.css +1 -1
  28. package/dist/components/render-card/prompt/icons.vue.js +1 -1
  29. package/dist/components/render-card/skill/index.script.vue.js.js +3 -1
  30. package/dist/components/render-card/skill/tag-prefix.vue.css +3 -3
  31. package/dist/components/render-card/skill/tag-prefix.vue.js +1 -1
  32. package/dist/components/render-checkbox/index.vue.css +9 -9
  33. package/dist/components/render-checkbox/index.vue.js +1 -1
  34. package/dist/components/render-choose-tag/index.vue.css +7 -7
  35. package/dist/components/render-choose-tag/index.vue.js +1 -1
  36. package/dist/components/render-collapse/index.vue.css +2 -2
  37. package/dist/components/render-collapse/index.vue.js +1 -1
  38. package/dist/components/render-collection/content/index.vue.css +4 -4
  39. package/dist/components/render-collection/content/index.vue.js +1 -1
  40. package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.css +3 -3
  41. package/dist/components/render-dataset/components/batch-delete-dataset-data/index.vue.js +1 -1
  42. package/dist/components/render-dataset/components/batch-edit-valid-dataset-data/index.vue.css +1 -1
  43. package/dist/components/render-dataset/components/batch-edit-valid-dataset-data/index.vue.js +1 -1
  44. package/dist/components/render-dataset/components/dataset-data-tool-icons/index.script.vue.js +1 -1
  45. package/dist/components/render-dataset/components/dataset-data-valid/index.vue.css +1 -1
  46. package/dist/components/render-dataset/components/dataset-data-valid/index.vue.js +1 -1
  47. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +3 -3
  48. package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
  49. package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
  50. package/dist/components/render-dataset/components/operation-record/index.vue.js +1 -1
  51. package/dist/components/render-dataset/components/operation-record/table/index.vue.css +1 -1
  52. package/dist/components/render-dataset/components/operation-record/table/index.vue.js +1 -1
  53. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +2 -2
  54. package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
  55. package/dist/components/render-dataset/components/plus-dataset/index.vue.css +2 -2
  56. package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
  57. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.css +2 -2
  58. package/dist/components/render-dataset/components/plus-dataset-data/form/api.vue.js +1 -1
  59. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
  60. package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
  61. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +2 -2
  62. package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
  63. package/dist/components/render-dataset/components/review-dataset-data/index.vue.css +10 -10
  64. package/dist/components/render-dataset/components/review-dataset-data/index.vue.js +1 -1
  65. package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
  66. package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
  67. package/dist/components/render-dataset-list/components/main.vue.css +3 -3
  68. package/dist/components/render-dataset-list/components/main.vue.js +1 -1
  69. package/dist/components/render-dataset-list/index.vue.css +2 -2
  70. package/dist/components/render-dataset-list/index.vue.js +1 -1
  71. package/dist/components/render-dialog/choose-resource.vue.css +3 -3
  72. package/dist/components/render-dialog/choose-resource.vue.js +1 -1
  73. package/dist/components/render-dialog/choose-result.vue.css +14 -14
  74. package/dist/components/render-dialog/choose-result.vue.js +1 -1
  75. package/dist/components/render-dialog/choose-space.script.vue.js.js +2 -1
  76. package/dist/components/render-dialog/choose-space.vue.css +11 -8
  77. package/dist/components/render-dialog/choose-space.vue.js +1 -1
  78. package/dist/components/render-dialog/index.vue.css +6 -6
  79. package/dist/components/render-dialog/index.vue.js +1 -1
  80. package/dist/components/render-file-card/index.vue.css +11 -11
  81. package/dist/components/render-file-card/index.vue.js +1 -1
  82. package/dist/components/render-file-type-icon/index.vue.css +6 -6
  83. package/dist/components/render-file-type-icon/index.vue.js +1 -1
  84. package/dist/components/render-generate-tag/index.vue.css +5 -5
  85. package/dist/components/render-generate-tag/index.vue.js +1 -1
  86. package/dist/components/render-header/index.vue.css +3 -3
  87. package/dist/components/render-header/index.vue.js +1 -1
  88. package/dist/components/render-knowledge/icon/index.vue.css +1 -1
  89. package/dist/components/render-knowledge/icon/index.vue.js +1 -1
  90. package/dist/components/render-like/index.vue.css +5 -5
  91. package/dist/components/render-like/index.vue.js +1 -1
  92. package/dist/components/render-prompt/content/index.vue.css +1 -1
  93. package/dist/components/render-prompt/content/index.vue.js +1 -1
  94. package/dist/components/render-reference/index.vue.css +2 -2
  95. package/dist/components/render-reference/index.vue.js +1 -1
  96. package/dist/components/render-resource-info/index.script.vue.js +6 -1
  97. package/dist/components/render-resource-info/index.vue.d.ts +1 -0
  98. package/dist/components/render-resource-version/index.vue.css +2 -2
  99. package/dist/components/render-resource-version/index.vue.js +1 -1
  100. package/dist/components/render-router-tab/index.vue.css +3 -3
  101. package/dist/components/render-router-tab/index.vue.js +1 -1
  102. package/dist/components/render-select-plus-extension/index.vue.css +3 -3
  103. package/dist/components/render-select-plus-extension/index.vue.js +1 -1
  104. package/dist/components/render-skill/install/index.script.vue.js.js +266 -30
  105. package/dist/components/render-skill/install/openclaw-linux-guide.script.vue.js.js +52 -0
  106. package/dist/components/render-skill/install/openclaw-linux-guide.vue.d.ts +8 -0
  107. package/dist/components/render-skill/install/openclaw-linux-guide.vue.js +3 -0
  108. package/dist/components/render-skill/install/openclaw-windows-instances.script.vue.js.js +134 -0
  109. package/dist/components/render-skill/install/openclaw-windows-instances.vue.d.ts +14 -0
  110. package/dist/components/render-skill/install/openclaw-windows-instances.vue.js +3 -0
  111. package/dist/components/render-t-table/index.vue.css +27 -27
  112. package/dist/components/render-t-table/index.vue.js +1 -1
  113. package/dist/components/render-tag-tree/index.vue.css +7 -7
  114. package/dist/components/render-tag-tree/index.vue.js +1 -1
  115. package/dist/components/render-tags/index.vue.css +6 -6
  116. package/dist/components/render-tags/index.vue.js +1 -1
  117. package/dist/css/g-utilities.css +28 -0
  118. package/dist/css/g-utilities.manifest.json +7 -0
  119. package/dist/hooks/use-skill-http.d.ts +9 -1
  120. package/dist/hooks/use-skill-http.ts.js +37 -1
  121. package/dist/http/helper/agent.ts.js +4 -2
  122. package/dist/http/helper/skill.d.ts +9 -1
  123. package/dist/http/helper/skill.ts.js +40 -0
  124. package/dist/types/agent.d.ts +2 -0
  125. package/dist/types/enum.d.ts +13 -0
  126. package/dist/types/enum.ts.js +15 -0
  127. package/dist/types/skill.d.ts +61 -1
  128. package/package.json +1 -1
@@ -1,16 +1,99 @@
1
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2
+ try {
3
+ var info = gen[key](arg);
4
+ var value = info.value;
5
+ } catch (error) {
6
+ reject(error);
7
+ return;
8
+ }
9
+ if (info.done) {
10
+ resolve(value);
11
+ } else {
12
+ Promise.resolve(value).then(_next, _throw);
13
+ }
14
+ }
15
+ function _async_to_generator(fn) {
16
+ return function() {
17
+ var self = this, args = arguments;
18
+ return new Promise(function(resolve, reject) {
19
+ var gen = fn.apply(self, args);
20
+ function _next(value) {
21
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
22
+ }
23
+ function _throw(err) {
24
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
25
+ }
26
+ _next(undefined);
27
+ });
28
+ };
29
+ }
30
+ function _define_property(obj, key, value) {
31
+ if (key in obj) {
32
+ Object.defineProperty(obj, key, {
33
+ value: value,
34
+ enumerable: true,
35
+ configurable: true,
36
+ writable: true
37
+ });
38
+ } else {
39
+ obj[key] = value;
40
+ }
41
+ return obj;
42
+ }
43
+ function _object_spread(target) {
44
+ for(var i = 1; i < arguments.length; i++){
45
+ var source = arguments[i] != null ? arguments[i] : {};
46
+ var ownKeys = Object.keys(source);
47
+ if (typeof Object.getOwnPropertySymbols === "function") {
48
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
49
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
50
+ }));
51
+ }
52
+ ownKeys.forEach(function(key) {
53
+ _define_property(target, key, source[key]);
54
+ });
55
+ }
56
+ return target;
57
+ }
58
+ function ownKeys(object, enumerableOnly) {
59
+ var keys = Object.keys(object);
60
+ if (Object.getOwnPropertySymbols) {
61
+ var symbols = Object.getOwnPropertySymbols(object);
62
+ if (enumerableOnly) {
63
+ symbols = symbols.filter(function(sym) {
64
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
65
+ });
66
+ }
67
+ keys.push.apply(keys, symbols);
68
+ }
69
+ return keys;
70
+ }
71
+ function _object_spread_props(target, source) {
72
+ source = source != null ? source : {};
73
+ if (Object.getOwnPropertyDescriptors) {
74
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
75
+ } else {
76
+ ownKeys(Object(source)).forEach(function(key) {
77
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
78
+ });
79
+ }
80
+ return target;
81
+ }
1
82
  import { defineComponent as _defineComponent } from 'vue';
2
- import { createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode } from "vue";
83
+ import { createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode } from "vue";
3
84
  const _hoisted_1 = {
4
85
  class: "g-flex-row"
5
86
  };
6
87
  const _hoisted_2 = {
7
88
  class: "g-text-14 g-text-gray"
8
89
  };
9
- import { ref, toRef, watch } from 'vue';
10
- // 需确认render-markdown
11
- import RenderMarkdown from '../../render-markdown/view.ts.js';
12
- import RenderSearchEmpty from '../../render-search-empty/index.vue.js';
90
+ import { Message } from 'bkui-vue';
91
+ import { onBeforeUnmount, ref, toRef, useTemplateRef, watch } from 'vue';
92
+ import RenderOpenclawLinuxGuide from './openclaw-linux-guide.vue.js';
93
+ import RenderOpenclawWindowsInstances from './openclaw-windows-instances.vue.js';
94
+ import { TEN_SECONDS } from '../../../common/constants.ts.js';
13
95
  import { useSkillHttp } from '../../../hooks/use-skill-http.ts.js';
96
+ import { SkillInstallTargetType, SkillInstallTaskStatus } from '../../../types/enum.ts.js';
14
97
  export default /*@__PURE__*/ _defineComponent({
15
98
  props: {
16
99
  isShow: {
@@ -26,71 +109,224 @@ export default /*@__PURE__*/ _defineComponent({
26
109
  setup (__props, { emit: __emit }) {
27
110
  const props = __props;
28
111
  const emits = __emit;
29
- const { getSkillInstallGuide } = useSkillHttp(props.apiPrefix, toRef(props, 'spaceId'));
30
- const installGuide = ref('');
31
- const isLoading = ref(false);
112
+ const { getSkillInstallTargets, installSkillToOpenclawWindows, getSkillOpenclawWindowsInstallTasksStatus } = useSkillHttp(props.apiPrefix, toRef(props, 'spaceId'));
113
+ const formRef = useTemplateRef('formRef');
114
+ const isLoadingInstallTargets = ref(false);
115
+ const isConfirming = ref(false);
116
+ const installTargets = ref([]);
117
+ const selectedInstallTargetType = ref();
118
+ const selectedOpenclawWindowsInstances = ref([]);
119
+ let isPollingStopped = false;
32
120
  const handleClose = ()=>{
33
121
  emits('update:isShow', false);
34
122
  };
35
- const handleGetInstallGuide = ()=>{
36
- isLoading.value = true;
37
- getSkillInstallGuide(props.selectedSkill.id).then((res)=>{
38
- installGuide.value = res.markdown;
123
+ const handleConfirm = ()=>{
124
+ if (selectedInstallTargetType.value === SkillInstallTargetType.OpenclawLinux) {
125
+ handleClose();
126
+ }
127
+ if (selectedInstallTargetType.value === SkillInstallTargetType.OpenclawWindows) {
128
+ handleInstallOpenclawWindows();
129
+ }
130
+ };
131
+ const handleInstallOpenclawWindows = function() {
132
+ var _ref = _async_to_generator(function*() {
133
+ try {
134
+ var _formRef_value;
135
+ yield (_formRef_value = formRef.value) === null || _formRef_value === void 0 ? void 0 : _formRef_value.validate();
136
+ isConfirming.value = true;
137
+ isPollingStopped = false;
138
+ const installTasks = yield installSkillToOpenclawWindows({
139
+ skillId: props.selectedSkill.id,
140
+ workspaces: selectedOpenclawWindowsInstances.value
141
+ });
142
+ const taskIds = Object.values(installTasks).map((task)=>task.taskId);
143
+ const taskHostMap = Object.entries(installTasks).reduce((result, [hostName, task])=>_object_spread_props(_object_spread({}, result), {
144
+ [String(task.taskId)]: hostName
145
+ }), {});
146
+ const loopGetSkillOpenclawWindowsInstallTask = function() {
147
+ var _ref = _async_to_generator(function*() {
148
+ const taskStatusMap = yield getSkillOpenclawWindowsInstallTasksStatus({
149
+ taskIds
150
+ });
151
+ let isRunning = false;
152
+ const successHosts = [];
153
+ const failedHosts = [];
154
+ taskIds.forEach((taskId)=>{
155
+ const taskIdKey = String(taskId);
156
+ switch(taskStatusMap[taskIdKey]){
157
+ case SkillInstallTaskStatus.Pending:
158
+ case SkillInstallTaskStatus.Running:
159
+ case SkillInstallTaskStatus.Polling:
160
+ case SkillInstallTaskStatus.WaitingCallback:
161
+ isRunning = true;
162
+ break;
163
+ case SkillInstallTaskStatus.Success:
164
+ successHosts.push(taskHostMap[taskIdKey]);
165
+ break;
166
+ case SkillInstallTaskStatus.Failed:
167
+ case SkillInstallTaskStatus.Cancelled:
168
+ failedHosts.push(taskHostMap[taskIdKey]);
169
+ break;
170
+ }
171
+ });
172
+ if (isRunning) {
173
+ // 等待 10 秒
174
+ yield new Promise((resolve)=>{
175
+ setTimeout(resolve, TEN_SECONDS);
176
+ });
177
+ // 如果未停止轮询,则继续轮询
178
+ if (!isPollingStopped) {
179
+ yield loopGetSkillOpenclawWindowsInstallTask();
180
+ }
181
+ return;
182
+ }
183
+ const message = `${successHosts.length > 0 ? `安装成功:${successHosts.join('、')}。` : ''}${failedHosts.length > 0 ? `安装失败:${failedHosts.join('、')}` : ''}`;
184
+ const theme = successHosts.length > 0 ? 'success' : 'error';
185
+ Message({
186
+ theme,
187
+ message
188
+ });
189
+ handleClose();
190
+ });
191
+ return function loopGetSkillOpenclawWindowsInstallTask() {
192
+ return _ref.apply(this, arguments);
193
+ };
194
+ }();
195
+ yield loopGetSkillOpenclawWindowsInstallTask();
196
+ } catch (error) {
197
+ console.error(error);
198
+ } finally{
199
+ isConfirming.value = false;
200
+ }
201
+ });
202
+ return function handleInstallOpenclawWindows() {
203
+ return _ref.apply(this, arguments);
204
+ };
205
+ }();
206
+ const handleClearTimer = ()=>{
207
+ isPollingStopped = true;
208
+ getSkillOpenclawWindowsInstallTasksStatus.abort();
209
+ };
210
+ const handleGetInstallTargets = ()=>{
211
+ isLoadingInstallTargets.value = true;
212
+ getSkillInstallTargets().then((res)=>{
213
+ var _res_;
214
+ installTargets.value = res;
215
+ selectedInstallTargetType.value = (_res_ = res[0]) === null || _res_ === void 0 ? void 0 : _res_.targetType;
39
216
  }).finally(()=>{
40
- isLoading.value = false;
217
+ isLoadingInstallTargets.value = false;
41
218
  });
42
219
  };
220
+ const handleChangeInstallTargetType = ()=>{
221
+ selectedOpenclawWindowsInstances.value = [];
222
+ };
43
223
  watch(()=>props.isShow, (val)=>{
44
224
  if (val) {
45
- installGuide.value = '';
46
- handleGetInstallGuide();
225
+ selectedOpenclawWindowsInstances.value = [];
226
+ handleGetInstallTargets();
47
227
  }
48
228
  });
229
+ onBeforeUnmount(handleClearTimer);
49
230
  return (_ctx, _cache)=>{
50
- const _component_bk_loading = _resolveComponent("bk-loading");
231
+ const _component_bk_select = _resolveComponent("bk-select");
232
+ const _component_bk_form_item = _resolveComponent("bk-form-item");
233
+ const _component_bk_form = _resolveComponent("bk-form");
51
234
  const _component_bk_dialog = _resolveComponent("bk-dialog");
52
235
  return _openBlock(), _createBlock(_component_bk_dialog, {
53
236
  width: 600,
54
237
  "is-show": props.isShow,
238
+ "is-loading": isConfirming.value,
55
239
  onClosed: handleClose,
56
- onConfirm: handleClose
240
+ onConfirm: handleConfirm
57
241
  }, {
58
242
  header: _withCtx(()=>[
59
243
  _createElementVNode("section", _hoisted_1, [
60
- _cache[0] || (_cache[0] = _createElementVNode("span", {
244
+ _cache[2] || (_cache[2] = _createElementVNode("span", {
61
245
  class: "g-text-16 g-mr-14"
62
246
  }, " 安装 Skill ", -1 /* CACHED */ )),
63
- _cache[1] || (_cache[1] = _createElementVNode("span", {
247
+ _cache[3] || (_cache[3] = _createElementVNode("span", {
64
248
  class: "g-gap g-mr-10"
65
249
  }, null, -1 /* CACHED */ )),
66
250
  _createElementVNode("span", _hoisted_2, _toDisplayString(props.selectedSkill.skillName), 1 /* TEXT */ )
67
251
  ])
68
252
  ]),
69
253
  default: _withCtx(()=>[
70
- _createVNode(_component_bk_loading, {
71
- loading: isLoading.value
254
+ _createVNode(_component_bk_form, {
255
+ ref_key: "formRef",
256
+ ref: formRef,
257
+ "form-type": "vertical",
258
+ class: "g-small-form g-small-gap-form",
259
+ model: {
260
+ selectedInstallTargetType: selectedInstallTargetType.value,
261
+ selectedOpenclawWindowsInstances: selectedOpenclawWindowsInstances.value
262
+ }
72
263
  }, {
73
264
  default: _withCtx(()=>[
74
- installGuide.value ? (_openBlock(), _createBlock(_unref(RenderMarkdown), {
265
+ _createVNode(_component_bk_form_item, {
266
+ label: "安装至",
267
+ property: "selectedInstallTargetType",
268
+ required: ""
269
+ }, {
270
+ default: _withCtx(()=>[
271
+ _createVNode(_component_bk_select, {
272
+ modelValue: selectedInstallTargetType.value,
273
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>selectedInstallTargetType.value = $event),
274
+ "id-key": "targetType",
275
+ "display-key": "displayName",
276
+ list: installTargets.value,
277
+ loading: isLoadingInstallTargets.value,
278
+ clearable: false,
279
+ onChange: handleChangeInstallTargetType
280
+ }, null, 8 /* PROPS */ , [
281
+ "modelValue",
282
+ "list",
283
+ "loading"
284
+ ])
285
+ ]),
286
+ _: 1 /* STABLE */
287
+ }),
288
+ selectedInstallTargetType.value === _unref(SkillInstallTargetType).OpenclawLinux ? (_openBlock(), _createBlock(RenderOpenclawLinuxGuide, {
75
289
  key: 0,
76
- value: installGuide.value,
77
- padding: "0"
290
+ id: props.selectedSkill.id,
291
+ "api-prefix": props.apiPrefix,
292
+ "space-id": props.spaceId
78
293
  }, null, 8 /* PROPS */ , [
79
- "value"
80
- ])) : !isLoading.value ? (_openBlock(), _createBlock(RenderSearchEmpty, {
294
+ "id",
295
+ "api-prefix",
296
+ "space-id"
297
+ ])) : _createCommentVNode("v-if", true),
298
+ selectedInstallTargetType.value === _unref(SkillInstallTargetType).OpenclawWindows ? (_openBlock(), _createBlock(_component_bk_form_item, {
81
299
  key: 1,
82
- scene: "part",
83
- description: "暂无安装指南"
300
+ label: "请选择 Openclaw 实例",
301
+ property: "selectedOpenclawWindowsInstances",
302
+ required: ""
303
+ }, {
304
+ default: _withCtx(()=>[
305
+ _createVNode(RenderOpenclawWindowsInstances, {
306
+ "selected-openclaw-windows-instances": selectedOpenclawWindowsInstances.value,
307
+ "onUpdate:selectedOpenclawWindowsInstances": _cache[1] || (_cache[1] = ($event)=>selectedOpenclawWindowsInstances.value = $event),
308
+ "skill-id": props.selectedSkill.id,
309
+ "api-prefix": props.apiPrefix,
310
+ "space-id": props.spaceId
311
+ }, null, 8 /* PROPS */ , [
312
+ "selected-openclaw-windows-instances",
313
+ "skill-id",
314
+ "api-prefix",
315
+ "space-id"
316
+ ])
317
+ ]),
318
+ _: 1 /* STABLE */
84
319
  })) : _createCommentVNode("v-if", true)
85
320
  ]),
86
321
  _: 1 /* STABLE */
87
322
  }, 8 /* PROPS */ , [
88
- "loading"
323
+ "model"
89
324
  ])
90
325
  ]),
91
326
  _: 1 /* STABLE */
92
327
  }, 8 /* PROPS */ , [
93
- "is-show"
328
+ "is-show",
329
+ "is-loading"
94
330
  ]);
95
331
  };
96
332
  }
@@ -0,0 +1,52 @@
1
+ import { defineComponent as _defineComponent } from 'vue';
2
+ import { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, withCtx as _withCtx } from "vue";
3
+ import { onBeforeMount, ref, toRef } from 'vue';
4
+ import RenderMarkdown from '../../render-markdown/view.ts.js';
5
+ import RenderSearchEmpty from '../../render-search-empty/index.vue.js';
6
+ import { useSkillHttp } from '../../../hooks/use-skill-http.ts.js';
7
+ export default /*@__PURE__*/ _defineComponent({
8
+ props: {
9
+ id: {},
10
+ apiPrefix: {},
11
+ spaceId: {}
12
+ },
13
+ setup (__props) {
14
+ const props = __props;
15
+ const { getSkillInstallGuide } = useSkillHttp(props.apiPrefix, toRef(props, 'spaceId'));
16
+ const isLoading = ref(false);
17
+ const installGuide = ref('');
18
+ const handleGetLinuxInstallGuide = ()=>{
19
+ if (!props.id) return;
20
+ isLoading.value = true;
21
+ getSkillInstallGuide(props.id).then((res)=>{
22
+ installGuide.value = res.markdown;
23
+ }).finally(()=>{
24
+ isLoading.value = false;
25
+ });
26
+ };
27
+ onBeforeMount(handleGetLinuxInstallGuide);
28
+ return (_ctx, _cache)=>{
29
+ const _component_bk_loading = _resolveComponent("bk-loading");
30
+ return _openBlock(), _createBlock(_component_bk_loading, {
31
+ loading: isLoading.value
32
+ }, {
33
+ default: _withCtx(()=>[
34
+ installGuide.value ? (_openBlock(), _createBlock(_unref(RenderMarkdown), {
35
+ key: 0,
36
+ value: installGuide.value,
37
+ padding: "0"
38
+ }, null, 8 /* PROPS */ , [
39
+ "value"
40
+ ])) : !isLoading.value ? (_openBlock(), _createBlock(RenderSearchEmpty, {
41
+ key: 1,
42
+ scene: "part",
43
+ description: "暂无安装指南"
44
+ })) : _createCommentVNode("v-if", true)
45
+ ]),
46
+ _: 1 /* STABLE */
47
+ }, 8 /* PROPS */ , [
48
+ "loading"
49
+ ]);
50
+ };
51
+ }
52
+ });
@@ -0,0 +1,8 @@
1
+ interface IProps {
2
+ id?: number;
3
+ apiPrefix: string;
4
+ spaceId?: string;
5
+ }
6
+ declare const __VLS_export: import("vue").DefineComponent<IProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import script from './openclaw-linux-guide.script.vue.js.js';
2
+ script.__file = "./src/components/render-skill/install/openclaw-linux-guide.vue";
3
+ export default script;
@@ -0,0 +1,134 @@
1
+ import { defineComponent as _defineComponent } from 'vue';
2
+ import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createVNode as _createVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, normalizeClass as _normalizeClass, createBlock as _createBlock } from "vue";
3
+ const _hoisted_1 = [
4
+ "onClick"
5
+ ];
6
+ const _hoisted_2 = {
7
+ class: "g-flex-truncate g-mr-16"
8
+ };
9
+ const _hoisted_3 = {
10
+ "data-ellipsis-tooltip": "",
11
+ class: "!g-text-12 g-leading-22 g-font-bold g-mb-4 g-truncate"
12
+ };
13
+ const _hoisted_4 = {
14
+ "data-ellipsis-tooltip": "",
15
+ class: "!g-text-12 g-text-gray g-leading-22 g-mb-4 g-truncate"
16
+ };
17
+ const _hoisted_5 = {
18
+ "data-ellipsis-tooltip": "",
19
+ class: "!g-text-12 g-text-gray g-leading-22 g-truncate"
20
+ };
21
+ import { onBeforeMount, ref, toRef } from 'vue';
22
+ import RenderCheckbox from '../../render-checkbox/index.vue.js';
23
+ import { useSkillHttp } from '../../../hooks/use-skill-http.ts.js';
24
+ export default /*@__PURE__*/ _defineComponent({
25
+ props: {
26
+ selectedOpenclawWindowsInstances: {},
27
+ skillId: {},
28
+ apiPrefix: {},
29
+ spaceId: {}
30
+ },
31
+ emits: [
32
+ "update:selectedOpenclawWindowsInstances"
33
+ ],
34
+ setup (__props, { emit: __emit }) {
35
+ const props = __props;
36
+ const emits = __emit;
37
+ const { getSkillOpenclawWindowsInstances, getSkillOpenclawWindowsInstancesStatus } = useSkillHttp(props.apiPrefix, toRef(props, 'spaceId'));
38
+ const isLoadingInstances = ref(false);
39
+ const isLoadingInstanceStatus = ref(false);
40
+ const openclawWindowsInstances = ref([]);
41
+ const instanceStatusMap = ref({});
42
+ const getIsInstanceChecked = (instance)=>{
43
+ const isSelected = props.selectedOpenclawWindowsInstances.some((item)=>item.hostName === instance.hostName);
44
+ const isInstalled = getIsInstanceInstalled(instance);
45
+ return isSelected || isInstalled;
46
+ };
47
+ const getIsInstanceInstalled = (instance)=>{
48
+ var _instanceStatusMap_value_instance_hostName;
49
+ return (_instanceStatusMap_value_instance_hostName = instanceStatusMap.value[instance.hostName]) === null || _instanceStatusMap_value_instance_hostName === void 0 ? void 0 : _instanceStatusMap_value_instance_hostName.isInstalled;
50
+ };
51
+ const handleSelectOpenclawWindowsInstance = (instance)=>{
52
+ if (getIsInstanceInstalled(instance)) return;
53
+ if (props.selectedOpenclawWindowsInstances.some((item)=>item.hostName === instance.hostName)) {
54
+ emits('update:selectedOpenclawWindowsInstances', props.selectedOpenclawWindowsInstances.filter((item)=>item.hostName !== instance.hostName));
55
+ } else {
56
+ emits('update:selectedOpenclawWindowsInstances', [
57
+ ...props.selectedOpenclawWindowsInstances,
58
+ instance
59
+ ]);
60
+ }
61
+ };
62
+ const handleGetOpenclawWindowsInstanceStatus = (workspaces)=>{
63
+ if (workspaces.length <= 0) return;
64
+ isLoadingInstanceStatus.value = true;
65
+ getSkillOpenclawWindowsInstancesStatus({
66
+ skillId: props.skillId,
67
+ workspaces
68
+ }).then((res)=>{
69
+ instanceStatusMap.value = res;
70
+ }).finally(()=>{
71
+ isLoadingInstanceStatus.value = false;
72
+ });
73
+ };
74
+ const handleGetOpenclawWindowsInstances = ()=>{
75
+ isLoadingInstances.value = true;
76
+ getSkillOpenclawWindowsInstances().then((res)=>{
77
+ openclawWindowsInstances.value = res;
78
+ handleGetOpenclawWindowsInstanceStatus(res);
79
+ }).finally(()=>{
80
+ isLoadingInstances.value = false;
81
+ });
82
+ };
83
+ onBeforeMount(handleGetOpenclawWindowsInstances);
84
+ return (_ctx, _cache)=>{
85
+ const _component_bk_loading = _resolveComponent("bk-loading");
86
+ return _openBlock(), _createBlock(_component_bk_loading, {
87
+ loading: isLoadingInstances.value,
88
+ class: "g-max-h-400 g-scrollbar"
89
+ }, {
90
+ default: _withCtx(()=>[
91
+ (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(openclawWindowsInstances.value, (instance, index)=>{
92
+ return _openBlock(), _createElementBlock("section", {
93
+ key: instance.hostName,
94
+ class: _normalizeClass([
95
+ 'g-flex-row g-rounded-2 !g-cursor-pointer',
96
+ 'g-pt-12 g-pb-12 !g-pr-16 g-pl-12',
97
+ '!g-bg-dark-gray hover:!g-bg-light-blue',
98
+ index > 0 ? 'g-mt-10' : ''
99
+ ]),
100
+ onClick: ($event)=>handleSelectOpenclawWindowsInstance(instance)
101
+ }, [
102
+ _createElementVNode("section", _hoisted_2, [
103
+ _createElementVNode("h3", _hoisted_3, _toDisplayString(instance.displayName), 1 /* TEXT */ ),
104
+ _createElementVNode("h5", _hoisted_4, " 云桌面:" + _toDisplayString(instance.hostDescription), 1 /* TEXT */ ),
105
+ _createElementVNode("h5", _hoisted_5, " 主机:" + _toDisplayString(instance.hostName), 1 /* TEXT */ )
106
+ ]),
107
+ _createVNode(_component_bk_loading, {
108
+ loading: isLoadingInstanceStatus.value,
109
+ mode: "spin",
110
+ class: "g-flex-row !g-items-center"
111
+ }, {
112
+ default: _withCtx(()=>[
113
+ _createVNode(RenderCheckbox, {
114
+ checked: getIsInstanceChecked(instance),
115
+ disabled: getIsInstanceInstalled(instance)
116
+ }, null, 8 /* PROPS */ , [
117
+ "checked",
118
+ "disabled"
119
+ ])
120
+ ]),
121
+ _: 2 /* DYNAMIC */
122
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */ , [
123
+ "loading"
124
+ ])
125
+ ], 10 /* CLASS, PROPS */ , _hoisted_1);
126
+ }), 128 /* KEYED_FRAGMENT */ ))
127
+ ]),
128
+ _: 1 /* STABLE */
129
+ }, 8 /* PROPS */ , [
130
+ "loading"
131
+ ]);
132
+ };
133
+ }
134
+ });
@@ -0,0 +1,14 @@
1
+ import { ISkillOpenclawWindowsInstance } from '@/types/skill';
2
+ interface IProps {
3
+ selectedOpenclawWindowsInstances: ISkillOpenclawWindowsInstance[];
4
+ skillId?: number;
5
+ apiPrefix: string;
6
+ spaceId?: string;
7
+ }
8
+ declare const __VLS_export: import("vue").DefineComponent<IProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
+ "update:selectedOpenclawWindowsInstances": (value: ISkillOpenclawWindowsInstance[]) => any;
10
+ }, string, import("vue").PublicProps, Readonly<IProps> & Readonly<{
11
+ "onUpdate:selectedOpenclawWindowsInstances"?: (value: ISkillOpenclawWindowsInstance[]) => any;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import script from './openclaw-windows-instances.script.vue.js.js';
2
+ script.__file = "./src/components/render-skill/install/openclaw-windows-instances.vue";
3
+ export default script;