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