@blueking/ai-ui-sdk 0.3.0-beta.2 → 0.3.0-beta.21
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/assets/svg/lock.svg +43 -0
- package/dist/common/constants.d.ts +1 -0
- package/dist/common/constants.ts.js +1 -0
- package/dist/components/render-agent/agent-search.script.vue.js.js +1 -1
- package/dist/components/render-agent/agent-share.script.vue.js.js +2 -2
- 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-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 +74 -71
- package/dist/components/render-card/agent/actions.vue.d.ts +3 -0
- package/dist/components/render-card/agent/index.script.vue.js.js +26 -7
- 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 +15 -12
- 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 +16 -5
- 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 +9 -9
- 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 +12 -4
- package/dist/components/render-card/base/reference-icon.vue.d.ts +6 -1
- package/dist/components/render-card/base/tag-suffix.script.vue.js.js +1 -1
- package/dist/components/render-card/base.script.vue.js +37 -23
- 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 +20 -7
- 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 +22 -8
- 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 +11 -3
- package/dist/components/render-card/llm/actions.vue.d.ts +6 -1
- package/dist/components/render-card/llm/corner-badge.script.vue.js +4 -4
- 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 +4 -4
- 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 +13 -5
- package/dist/components/render-card/llm/index.vue.d.ts +4 -1
- package/dist/components/render-card/llm/info.script.vue.js.js +1 -1
- 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 +15 -17
- package/dist/components/render-card/mcp/actions.vue.d.ts +3 -0
- package/dist/components/render-card/mcp/code-suffix.script.vue.js +2 -2
- package/dist/components/render-card/mcp/index.script.vue.js.js +23 -6
- package/dist/components/render-card/mcp/index.vue.d.ts +8 -1
- package/dist/components/render-card/mcp/name-suffix.script.vue.js +2 -2
- 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 +3 -3
- 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 +22 -9
- package/dist/components/render-card/prompt/index.vue.d.ts +7 -1
- package/dist/components/render-card/role/index.script.vue.js.js +22 -8
- package/dist/components/render-card/role/index.vue.d.ts +7 -1
- package/dist/components/render-card/skill/index.script.vue.js.js +51 -10
- package/dist/components/render-card/skill/index.vue.d.ts +18 -1
- package/dist/components/render-card/skill/prefix-info-tool.script.vue.js +185 -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 +7 -7
- 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 +11 -6
- package/dist/components/render-card/tool/actions.vue.d.ts +3 -0
- package/dist/components/render-card/tool/index.script.vue.js.js +21 -7
- 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 +3 -3
- package/dist/components/render-checkbox/index.script.vue.js.js +2 -2
- 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 +4 -4
- 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 +15 -16
- package/dist/components/render-collection/actions/index.vue.d.ts +3 -0
- package/dist/components/render-collection/content/index.script.vue.js +5 -5
- 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-collection/search/index.script.vue.js.js +1 -1
- package/dist/components/render-dataset/components/batch-delete-dataset-data/index.script.vue.js +3 -3
- 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 +5 -5
- 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/batch-review-dataset-data/index.script.vue.js.js +1 -1
- package/dist/components/render-dataset/components/dataset-data-level/index.script.vue.js +1 -1
- package/dist/components/render-dataset/components/dataset-data-status/index.script.vue.js.js +1 -1
- package/dist/components/render-dataset/components/dataset-data-tool-icons/index.script.vue.js +3 -3
- package/dist/components/render-dataset/components/dataset-data-valid/index.script.vue.js.js +8 -8
- 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.script.vue.js.js +8 -8
- 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.script.vue.js +4 -4
- 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.script.vue.js.js +2 -2
- 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/dataset-footer.script.vue.js.js +2 -2
- package/dist/components/render-dataset/components/plus-dataset/dataset-form.script.vue.js +4 -4
- package/dist/components/render-dataset/components/plus-dataset/index.vue.css +2 -2
- package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/api.script.vue.js.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/file.script.vue.js.js +2 -2
- 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.vue.css +2 -2
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/manual.script.vue.js.js +2 -2
- package/dist/components/render-dataset/components/plus-dataset-data/index.script.vue.js.js +1 -1
- package/dist/components/render-dataset/components/review-dataset-data/index.script.vue.js.js +6 -6
- 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 +10 -8
- package/dist/components/render-dataset-detail/components/header.vue.d.ts +6 -1
- package/dist/components/render-dataset-detail/index.script.vue.js.js +17 -11
- package/dist/components/render-dataset-detail/index.vue.d.ts +6 -1
- package/dist/components/render-dataset-detail-origin-data/components/batch-operation/index.script.vue.js.js +2 -2
- package/dist/components/render-dataset-detail-origin-data/components/table/index.script.vue.js +7 -7
- package/dist/components/render-dataset-detail-origin-data/index.script.vue.js.js +1 -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 +8 -3
- 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 +13 -16
- 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 +86 -27
- package/dist/components/render-dialog/choose-footer.vue.d.ts +3 -0
- package/dist/components/render-dialog/choose-resource.script.vue.js +75 -27
- 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 +3 -3
- 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 +80 -103
- package/dist/components/render-dialog/choose-space.vue.css +8 -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} +84 -74
- 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 +4 -4
- 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 +4 -4
- 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.script.vue.js.js +1 -1
- package/dist/components/render-knowledge/search/index.vue.d.ts +1 -1
- package/dist/components/render-knowledgebase/search/index.script.vue.js.js +1 -1
- package/dist/components/render-knowledgebase/search/index.vue.d.ts +1 -1
- package/dist/components/render-like/index.script.vue.js.js +8 -8
- 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 +5 -5
- package/dist/components/render-markdown/filter-css.d.ts +1 -0
- package/dist/components/render-markdown/filter-css.ts.js +86 -0
- package/dist/components/render-markdown/view.ts.js +3 -92
- package/dist/components/render-mcp/search/index.script.vue.js.js +1 -1
- package/dist/components/render-permission-tag/index.script.vue.js +4 -4
- package/dist/components/render-prompt/actions/index.script.vue.js.js +15 -16
- package/dist/components/render-prompt/actions/index.vue.d.ts +3 -0
- package/dist/components/render-prompt/content/index.script.vue.js.js +1 -1
- 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-prompt/search/index.script.vue.js.js +1 -1
- package/dist/components/render-reference/index.script.vue.js +42 -43
- 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.js +215 -60
- package/dist/components/render-relate-agent/index.vue.d.ts +13 -6
- package/dist/components/render-resource-info/index.script.vue.js +8 -3
- 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 +3 -3
- package/dist/components/render-search-select/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 +2 -2
- package/dist/components/render-skill/install/index.script.vue.js.js +266 -30
- package/dist/components/render-skill/install/openclaw-linux-guide.script.vue.js.js +52 -0
- package/dist/components/{render-card/base/application-code-suffix.vue.d.ts → render-skill/install/openclaw-linux-guide.vue.d.ts} +3 -8
- package/dist/components/render-skill/install/openclaw-linux-guide.vue.js +3 -0
- package/dist/components/render-skill/install/openclaw-windows-instances.script.vue.js.js +134 -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/search/index.script.vue.js.js +1 -1
- package/dist/components/render-t-table/index.script.vue.js +20 -9
- 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.script.vue.js.js +3 -3
- 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.script.vue.js +3 -3
- package/dist/components/render-tags/index.vue.css +6 -6
- package/dist/components/render-tags/index.vue.js +1 -1
- package/dist/components/render-tool/search/index.script.vue.js.js +1 -1
- package/dist/components/render-tree/index.script.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 +1018 -0
- package/dist/css/g-utilities.manifest.json +183 -0
- 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-knowledge-http.d.ts +9 -3
- package/dist/hooks/use-knowledge-http.ts.js +8 -6
- package/dist/hooks/use-mcp-http.d.ts +4 -1
- package/dist/hooks/use-mcp-http.ts.js +4 -3
- 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 +20 -5
- package/dist/hooks/use-skill-http.ts.js +52 -5
- package/dist/hooks/use-style.d.ts +1 -1
- package/dist/hooks/use-style.ts.js +1 -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 +22 -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.ts.js +2 -2
- package/dist/http/helper/prompt.ts.js +2 -2
- package/dist/http/helper/skill.d.ts +15 -1
- package/dist/http/helper/skill.ts.js +73 -5
- package/dist/http/helper/tool.ts.js +2 -2
- package/dist/types/agent.d.ts +18 -0
- package/dist/types/common.d.ts +7 -7
- package/dist/types/enum.d.ts +43 -0
- package/dist/types/enum.ts.js +47 -0
- package/dist/types/navigate.d.ts +82 -0
- package/dist/types/navigate.ts.js +1 -0
- package/dist/types/skill.d.ts +100 -5
- 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/css/tailwind.css +0 -1115
|
@@ -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,
|
|
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 {
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
import
|
|
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 {
|
|
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
|
+
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
|
-
|
|
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
|
-
|
|
46
|
-
|
|
225
|
+
selectedOpenclawWindowsInstances.value = [];
|
|
226
|
+
handleGetInstallTargets();
|
|
47
227
|
}
|
|
48
228
|
});
|
|
229
|
+
onBeforeUnmount(handleClearTimer);
|
|
49
230
|
return (_ctx, _cache)=>{
|
|
50
|
-
const
|
|
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:
|
|
240
|
+
onConfirm: handleConfirm
|
|
57
241
|
}, {
|
|
58
242
|
header: _withCtx(()=>[
|
|
59
243
|
_createElementVNode("section", _hoisted_1, [
|
|
60
|
-
_cache[
|
|
244
|
+
_cache[2] || (_cache[2] = _createElementVNode("span", {
|
|
61
245
|
class: "g-text-16 g-mr-14"
|
|
62
246
|
}, " 安装 Skill ", -1 /* CACHED */ )),
|
|
63
|
-
_cache[
|
|
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(
|
|
71
|
-
|
|
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
|
-
|
|
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
|
-
|
|
77
|
-
|
|
290
|
+
id: props.selectedSkill.id,
|
|
291
|
+
"api-prefix": props.apiPrefix,
|
|
292
|
+
"space-id": props.spaceId
|
|
78
293
|
}, null, 8 /* PROPS */ , [
|
|
79
|
-
"
|
|
80
|
-
|
|
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
|
-
|
|
83
|
-
|
|
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
|
-
"
|
|
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
|
+
});
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { Module } from '@/types/enum';
|
|
2
1
|
interface IProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
id: number;
|
|
7
|
-
name: string;
|
|
8
|
-
}[];
|
|
9
|
-
module: Module;
|
|
2
|
+
id?: number;
|
|
3
|
+
apiPrefix: string;
|
|
4
|
+
spaceId?: string;
|
|
10
5
|
}
|
|
11
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>;
|
|
12
7
|
declare const _default: typeof __VLS_export;
|
|
@@ -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;
|
|
@@ -89,7 +89,7 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
89
89
|
};
|
|
90
90
|
return (_ctx, _cache)=>{
|
|
91
91
|
return _openBlock(), _createBlock(RenderSearchSelect, {
|
|
92
|
-
class: "g-bg-white",
|
|
92
|
+
class: "!g-bg-white",
|
|
93
93
|
placeholder: "搜索中英文名称、描述、更新人",
|
|
94
94
|
"model-value": props.search,
|
|
95
95
|
data: searchOptions.value,
|