@blueking/ai-ui-sdk 0.6.0-beta.2 → 0.6.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/common/constants.d.ts +4 -0
- package/dist/common/constants.ts.js +30 -0
- package/dist/common/util.d.ts +5 -2
- package/dist/common/util.ts.js +12 -3
- package/dist/components/render-agent/agent-type.vue.css +4 -4
- package/dist/components/render-agent/agent-type.vue.js +1 -1
- 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.script.vue.js.js +39 -15
- package/dist/components/render-auto-refresh/index.vue.js +0 -2
- package/dist/components/render-card/agent/prefix-info-tool.vue.css +5 -5
- package/dist/components/render-card/agent/prefix-info-tool.vue.js +1 -1
- package/dist/components/render-card/agent/upgrade.vue.css +2 -2
- package/dist/components/render-card/agent/upgrade.vue.js +1 -1
- package/dist/components/render-card/base/approval-strategy-popover.script.vue.js.js +2 -2
- package/dist/components/render-card/base.vue.css +13 -13
- package/dist/components/render-card/base.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.vue.css +2 -2
- package/dist/components/render-card/llm/icons.vue.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 +2 -2
- package/dist/components/render-card/llm/tag-prefix.vue.js +1 -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/prompt/icons.vue.css +1 -1
- package/dist/components/render-card/prompt/icons.vue.js +1 -1
- package/dist/components/render-card/skill/scanner.vue.css +3 -3
- package/dist/components/render-card/skill/scanner.vue.js +1 -1
- package/dist/components/render-checkbox/index.vue.css +4 -4
- package/dist/components/render-checkbox/index.vue.js +1 -1
- 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.vue.css +2 -2
- package/dist/components/render-collapse/index.vue.js +1 -1
- 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.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/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.vue.css +1 -1
- 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.vue.css +1 -1
- 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-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.vue.css +3 -3
- package/dist/components/render-dataset-list/components/main.vue.js +1 -1
- package/dist/components/render-dataset-list/index.vue.css +2 -2
- package/dist/components/render-dataset-list/index.vue.js +1 -1
- package/dist/components/render-dialog/choose-resource.vue.css +3 -3
- package/dist/components/render-dialog/choose-resource.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.vue.css +9 -9
- package/dist/components/render-dialog/choose-space.vue.js +1 -1
- package/dist/components/render-dialog/index.vue.css +6 -6
- package/dist/components/render-dialog/index.vue.js +1 -1
- package/dist/components/render-dropdown/index.vue.css +1 -0
- package/dist/components/render-exception/index.vue.css +9 -9
- package/dist/components/render-exception/index.vue.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.vue.css +6 -6
- package/dist/components/render-file-type-icon/index.vue.js +1 -1
- package/dist/components/render-generate-tag/index.script.vue.js.js +6 -0
- package/dist/components/render-generate-tag/index.vue.css +13 -5
- package/dist/components/render-generate-tag/index.vue.js +1 -1
- package/dist/components/render-header/index.script.vue.js.js +5 -2
- 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-markdown/common.ts.js +2 -1
- package/dist/components/render-markdown/edit.ts.js +4 -6
- package/dist/components/render-markdown/filter-css.ts.js +3 -8
- package/dist/components/render-markdown/html.d.ts +2 -0
- package/dist/components/render-markdown/html.ts.js +67 -0
- package/dist/components/render-markdown/image.d.ts +3 -0
- package/dist/components/render-markdown/image.ts.js +98 -0
- package/dist/components/render-markdown/katex.ts.js +14 -4
- package/dist/components/render-markdown/view.d.ts +10 -0
- package/dist/components/render-markdown/view.ts.js +69 -2
- 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.vue.css +2 -2
- package/dist/components/render-reference/index.vue.js +1 -1
- 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.vue.css +3 -3
- package/dist/components/render-router-tab/index.vue.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/install/index.script.vue.js.js +38 -28
- package/dist/components/render-skill/install/{openclaw-windows-instances.script.vue.js.js → openclaw-instances.script.vue.js.js} +23 -21
- package/dist/components/render-skill/install/{openclaw-windows-instances.vue.d.ts → openclaw-instances.vue.d.ts} +6 -4
- package/dist/components/render-skill/install/openclaw-instances.vue.js +3 -0
- package/dist/components/render-t-table/index.vue.css +33 -29
- 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/components/render-tree/index.script.vue.js +1 -1
- package/dist/css/bk-icon/fonts/iconcool.eot +0 -0
- package/dist/css/bk-icon/fonts/iconcool.svg +3 -0
- package/dist/css/bk-icon/fonts/iconcool.ttf +0 -0
- package/dist/css/bk-icon/fonts/iconcool.woff +0 -0
- package/dist/css/bk-icon/iconcool.js +1 -1
- package/dist/css/bk-icon/style.css +3 -0
- package/dist/css/bk-patch.css +31 -6
- package/dist/css/g-utilities.css +75 -0
- package/dist/css/g-utilities.manifest.json +18 -0
- package/dist/css/variable/token.d.ts +11 -0
- package/dist/css/variable/token.ts.js +16 -1
- package/dist/hooks/use-form-rule.d.ts +31 -2
- package/dist/hooks/use-form-rule.ts.js +65 -26
- package/dist/hooks/use-meta-http.d.ts +6 -2
- package/dist/hooks/use-meta-http.ts.js +19 -5
- package/dist/hooks/use-scroll-load.d.ts +12 -3
- package/dist/hooks/use-skill-http.d.ts +7 -6
- package/dist/hooks/use-skill-http.ts.js +19 -17
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.ts.js +1 -0
- package/dist/http/helper/agent.ts.js +12 -2
- package/dist/http/helper/model.ts.js +42 -1
- package/dist/http/helper/skill.d.ts +9 -9
- package/dist/http/helper/skill.ts.js +12 -10
- package/dist/i18n/en-US.d.ts +20 -0
- package/dist/i18n/en-US.ts.js +21 -1
- package/dist/i18n/zh-CN.d.ts +20 -0
- package/dist/i18n/zh-CN.ts.js +21 -1
- package/dist/types/agent.d.ts +11 -1
- package/dist/types/enum.d.ts +6 -1
- package/dist/types/enum.ts.js +6 -0
- package/dist/types/model.d.ts +16 -0
- package/dist/types/skill.d.ts +26 -22
- package/package.json +3 -3
- package/dist/components/render-auto-refresh/index.vue.css +0 -46
- package/dist/components/render-skill/install/openclaw-windows-instances.vue.js +0 -3
|
@@ -26,10 +26,35 @@ function _object_spread(target) {
|
|
|
26
26
|
}
|
|
27
27
|
return target;
|
|
28
28
|
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
29
53
|
import { defineComponent, h, onMounted, onUnmounted, ref, watch } from 'vue';
|
|
30
54
|
import Viewer from '@toast-ui/editor/dist/toastui-editor-viewer';
|
|
31
55
|
import { commonConfig } from './common.ts.js';
|
|
32
56
|
import { escapeHtml } from './filter-css.ts.js';
|
|
57
|
+
import { createImageCustomRenderer, REQUEST_IMAGE_ATTR } from './image.ts.js';
|
|
33
58
|
import '@toast-ui/editor/dist/toastui-editor-viewer.css';
|
|
34
59
|
import './view.postcss.css';
|
|
35
60
|
export default defineComponent({
|
|
@@ -44,28 +69,70 @@ export default defineComponent({
|
|
|
44
69
|
padding: {
|
|
45
70
|
type: String,
|
|
46
71
|
default: '12px 16px'
|
|
72
|
+
},
|
|
73
|
+
requestOptions: {
|
|
74
|
+
type: [
|
|
75
|
+
Object,
|
|
76
|
+
Function
|
|
77
|
+
]
|
|
47
78
|
}
|
|
48
79
|
},
|
|
49
80
|
setup (props) {
|
|
50
81
|
const viewerRef = ref();
|
|
82
|
+
const imageObjectUrls = new Map();
|
|
51
83
|
let viewer;
|
|
84
|
+
const getRequestHeaders = ()=>{
|
|
85
|
+
const { requestOptions } = props;
|
|
86
|
+
const { headers } = (typeof requestOptions === 'function' ? requestOptions() : requestOptions) || {};
|
|
87
|
+
return typeof headers === 'function' ? headers() : headers;
|
|
88
|
+
};
|
|
89
|
+
const requestImage = (url)=>{
|
|
90
|
+
if (!imageObjectUrls.has(url)) {
|
|
91
|
+
imageObjectUrls.set(url, fetch(url, {
|
|
92
|
+
credentials: 'include',
|
|
93
|
+
headers: getRequestHeaders()
|
|
94
|
+
}).then((response)=>{
|
|
95
|
+
if (!response.ok) throw new Error(response.statusText);
|
|
96
|
+
return response.blob();
|
|
97
|
+
}).then((blob)=>URL.createObjectURL(blob)));
|
|
98
|
+
}
|
|
99
|
+
return imageObjectUrls.get(url);
|
|
100
|
+
};
|
|
101
|
+
const handleRequestImages = ()=>{
|
|
102
|
+
if (!props.requestOptions) return;
|
|
103
|
+
viewerRef.value.querySelectorAll(`img[${REQUEST_IMAGE_ATTR}]`).forEach((img)=>{
|
|
104
|
+
const url = img.getAttribute(REQUEST_IMAGE_ATTR);
|
|
105
|
+
img.removeAttribute(REQUEST_IMAGE_ATTR);
|
|
106
|
+
if (!url) return;
|
|
107
|
+
requestImage(url).then((objectUrl)=>img.setAttribute('src', objectUrl)).catch(()=>imageObjectUrls.delete(url));
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
const handleRevokeImages = ()=>{
|
|
111
|
+
imageObjectUrls.forEach((objectUrl)=>objectUrl.then(URL.revokeObjectURL, ()=>{}));
|
|
112
|
+
imageObjectUrls.clear();
|
|
113
|
+
};
|
|
52
114
|
const handleInit = ()=>{
|
|
53
|
-
viewer = new Viewer(_object_spread({
|
|
115
|
+
viewer = new Viewer(_object_spread_props(_object_spread({
|
|
54
116
|
el: viewerRef.value,
|
|
55
117
|
initialValue: props.value,
|
|
56
118
|
customHTMLSanitizer: escapeHtml
|
|
57
|
-
}, commonConfig)
|
|
119
|
+
}, commonConfig), {
|
|
120
|
+
customHTMLRenderer: _object_spread({}, commonConfig.customHTMLRenderer, createImageCustomRenderer(()=>!!props.requestOptions))
|
|
121
|
+
}));
|
|
58
122
|
viewer.eventEmitter.listen('updatePreview', (editResult)=>{
|
|
59
123
|
editResult.forEach((item)=>viewer.preview.replaceRangeNodes(item));
|
|
60
124
|
});
|
|
125
|
+
handleRequestImages();
|
|
61
126
|
};
|
|
62
127
|
const handleDestroy = ()=>{
|
|
63
128
|
viewer.destroy();
|
|
64
129
|
viewer = null;
|
|
130
|
+
handleRevokeImages();
|
|
65
131
|
};
|
|
66
132
|
watch(()=>props.value, (value)=>{
|
|
67
133
|
if (!viewer) return;
|
|
68
134
|
viewer.setMarkdown(value || '');
|
|
135
|
+
handleRequestImages();
|
|
69
136
|
});
|
|
70
137
|
onMounted(handleInit);
|
|
71
138
|
onUnmounted(handleDestroy);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
.resource-version[data-v-
|
|
2
|
+
.resource-version[data-v-xvvwr04w] {
|
|
3
3
|
border-radius: var(--aidev-radius-s);
|
|
4
4
|
text-align: left;
|
|
5
5
|
color: var(--aidev-tag-color);
|
|
6
6
|
background-color: var(--aidev-tag-background);
|
|
7
7
|
white-space: nowrap;
|
|
8
8
|
}
|
|
9
|
-
.resource-version .bkaidev-rizhifenxi[data-v-
|
|
9
|
+
.resource-version .bkaidev-rizhifenxi[data-v-xvvwr04w] {
|
|
10
10
|
color: var(--aidev-clickable-color);
|
|
11
11
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
.router-tab[data-v-
|
|
2
|
+
.router-tab[data-v-i4x8b0bh] {
|
|
3
3
|
margin-top: 2px;
|
|
4
4
|
height: 42px;
|
|
5
5
|
background: #FFFFFF;
|
|
6
6
|
box-shadow: 0 2px 4px 0 #1919290d;
|
|
7
7
|
padding: 0 24px;
|
|
8
8
|
}
|
|
9
|
-
.router-tab a[data-v-
|
|
9
|
+
.router-tab a[data-v-i4x8b0bh] {
|
|
10
10
|
padding: 0 8px;
|
|
11
11
|
margin-right: 24px;
|
|
12
12
|
font-size: 14px;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
color: var(--aidev-main-color);
|
|
16
16
|
box-sizing: border-box;
|
|
17
17
|
}
|
|
18
|
-
.router-tab a.router-link-exact-active[data-v-
|
|
18
|
+
.router-tab a.router-link-exact-active[data-v-i4x8b0bh] {
|
|
19
19
|
color: var(--aidev-clickable-color);
|
|
20
20
|
border-bottom: 2px solid var(--aidev-clickable-color);
|
|
21
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
.select-plus-extension[data-v-
|
|
2
|
+
.select-plus-extension[data-v-ht9g1oqx] {
|
|
3
3
|
cursor: pointer;
|
|
4
4
|
width: 100%;
|
|
5
5
|
display: flex;
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
font-size: 12px;
|
|
9
9
|
line-height: 20px;
|
|
10
10
|
}
|
|
11
|
-
.select-plus-extension .ai-ui-sdk-icon[data-v-
|
|
11
|
+
.select-plus-extension .ai-ui-sdk-icon[data-v-ht9g1oqx] {
|
|
12
12
|
font-size: 14px;
|
|
13
13
|
margin-right: 6px;
|
|
14
14
|
}
|
|
15
|
-
.select-plus-extension[data-v-
|
|
15
|
+
.select-plus-extension[data-v-ht9g1oqx]:hover {
|
|
16
16
|
color: var(--aidev-clickable-color);
|
|
17
17
|
}
|
|
@@ -93,7 +93,7 @@ const _hoisted_3 = {
|
|
|
93
93
|
import { Message } from 'bkui-vue';
|
|
94
94
|
import { onBeforeUnmount, ref, toRef, useTemplateRef, watch } from 'vue';
|
|
95
95
|
import RenderInstallGuide from './install-guide.vue.js';
|
|
96
|
-
import
|
|
96
|
+
import RenderOpenclawInstances from './openclaw-instances.vue.js';
|
|
97
97
|
import { TEN_SECONDS } from '../../../common/constants.ts.js';
|
|
98
98
|
import { useSkillHttp } from '../../../hooks/use-skill-http.ts.js';
|
|
99
99
|
import { t } from '../../../i18n/index.ts.js';
|
|
@@ -113,48 +113,53 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
113
113
|
setup (__props, { emit: __emit }) {
|
|
114
114
|
const props = __props;
|
|
115
115
|
const emits = __emit;
|
|
116
|
-
const { getSkillInstallTargets,
|
|
116
|
+
const { getSkillInstallTargets, installSkillToOpenclaw, getSkillOpenclawInstallTasksStatus } = useSkillHttp(props.apiPrefix, toRef(props, 'spaceId'));
|
|
117
117
|
const formRef = useTemplateRef('formRef');
|
|
118
118
|
const isLoadingInstallTargets = ref(false);
|
|
119
119
|
const isConfirming = ref(false);
|
|
120
120
|
const installTargets = ref([]);
|
|
121
121
|
const selectedInstallTargetType = ref();
|
|
122
|
-
const
|
|
122
|
+
const selectedOpenclawInstances = ref([]);
|
|
123
123
|
let isPollingStopped = false;
|
|
124
|
+
const getIsShowInstances = ()=>[
|
|
125
|
+
SkillInstallTargetType.OpenclawWindows,
|
|
126
|
+
SkillInstallTargetType.OpenclawLinux
|
|
127
|
+
].includes(selectedInstallTargetType.value);
|
|
124
128
|
const handleClose = ()=>{
|
|
125
129
|
emits('update:isShow', false);
|
|
126
130
|
};
|
|
127
131
|
const handleConfirm = ()=>{
|
|
128
132
|
switch(selectedInstallTargetType.value){
|
|
129
|
-
case SkillInstallTargetType.OpenclawLinux:
|
|
130
133
|
case SkillInstallTargetType.Cursor:
|
|
131
134
|
handleClose();
|
|
132
135
|
break;
|
|
136
|
+
case SkillInstallTargetType.OpenclawLinux:
|
|
133
137
|
case SkillInstallTargetType.OpenclawWindows:
|
|
134
|
-
|
|
138
|
+
handleInstallOpenclaw();
|
|
135
139
|
break;
|
|
136
140
|
default:
|
|
137
141
|
break;
|
|
138
142
|
}
|
|
139
143
|
};
|
|
140
|
-
const
|
|
144
|
+
const handleInstallOpenclaw = function() {
|
|
141
145
|
var _ref = _async_to_generator(function*() {
|
|
142
146
|
try {
|
|
143
147
|
var _formRef_value;
|
|
144
148
|
yield (_formRef_value = formRef.value) === null || _formRef_value === void 0 ? void 0 : _formRef_value.validate();
|
|
145
149
|
isConfirming.value = true;
|
|
146
150
|
isPollingStopped = false;
|
|
147
|
-
const installTasks = yield
|
|
151
|
+
const installTasks = yield installSkillToOpenclaw({
|
|
148
152
|
skillId: props.selectedSkill.id,
|
|
149
|
-
workspaces:
|
|
153
|
+
workspaces: selectedOpenclawInstances.value,
|
|
154
|
+
targetType: selectedInstallTargetType.value
|
|
150
155
|
});
|
|
151
156
|
const taskIds = Object.values(installTasks).map((task)=>task.taskId);
|
|
152
157
|
const taskHostMap = Object.entries(installTasks).reduce((result, [hostName, task])=>_object_spread_props(_object_spread({}, result), {
|
|
153
158
|
[String(task.taskId)]: hostName
|
|
154
159
|
}), {});
|
|
155
|
-
const
|
|
160
|
+
const loopGetSkillOpenclawInstallTask = function() {
|
|
156
161
|
var _ref = _async_to_generator(function*() {
|
|
157
|
-
const taskStatusMap = yield
|
|
162
|
+
const taskStatusMap = yield getSkillOpenclawInstallTasksStatus({
|
|
158
163
|
taskIds
|
|
159
164
|
});
|
|
160
165
|
let isRunning = false;
|
|
@@ -189,7 +194,7 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
189
194
|
});
|
|
190
195
|
// 如果未停止轮询,则继续轮询
|
|
191
196
|
if (!isPollingStopped) {
|
|
192
|
-
yield
|
|
197
|
+
yield loopGetSkillOpenclawInstallTask();
|
|
193
198
|
}
|
|
194
199
|
return;
|
|
195
200
|
}
|
|
@@ -208,24 +213,24 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
208
213
|
});
|
|
209
214
|
handleClose();
|
|
210
215
|
});
|
|
211
|
-
return function
|
|
216
|
+
return function loopGetSkillOpenclawInstallTask() {
|
|
212
217
|
return _ref.apply(this, arguments);
|
|
213
218
|
};
|
|
214
219
|
}();
|
|
215
|
-
yield
|
|
220
|
+
yield loopGetSkillOpenclawInstallTask();
|
|
216
221
|
} catch (error) {
|
|
217
222
|
console.error(error);
|
|
218
223
|
} finally{
|
|
219
224
|
isConfirming.value = false;
|
|
220
225
|
}
|
|
221
226
|
});
|
|
222
|
-
return function
|
|
227
|
+
return function handleInstallOpenclaw() {
|
|
223
228
|
return _ref.apply(this, arguments);
|
|
224
229
|
};
|
|
225
230
|
}();
|
|
226
231
|
const handleClearTimer = ()=>{
|
|
227
232
|
isPollingStopped = true;
|
|
228
|
-
|
|
233
|
+
getSkillOpenclawInstallTasksStatus.abort();
|
|
229
234
|
};
|
|
230
235
|
const handleGetInstallTargets = ()=>{
|
|
231
236
|
isLoadingInstallTargets.value = true;
|
|
@@ -238,11 +243,11 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
238
243
|
});
|
|
239
244
|
};
|
|
240
245
|
const handleChangeInstallTargetType = ()=>{
|
|
241
|
-
|
|
246
|
+
selectedOpenclawInstances.value = [];
|
|
242
247
|
};
|
|
243
248
|
const handleClearChoosen = ()=>{
|
|
244
249
|
selectedInstallTargetType.value = undefined;
|
|
245
|
-
|
|
250
|
+
selectedOpenclawInstances.value = [];
|
|
246
251
|
};
|
|
247
252
|
watch(()=>props.isShow, (val)=>{
|
|
248
253
|
if (val) {
|
|
@@ -277,7 +282,7 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
277
282
|
_createVNode(_component_bk_form, {
|
|
278
283
|
model: {
|
|
279
284
|
selectedInstallTargetType: selectedInstallTargetType.value,
|
|
280
|
-
|
|
285
|
+
selectedOpenclawInstances: selectedOpenclawInstances.value
|
|
281
286
|
},
|
|
282
287
|
ref_key: "formRef",
|
|
283
288
|
ref: formRef,
|
|
@@ -289,7 +294,8 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
289
294
|
class: _normalizeClass({
|
|
290
295
|
'!g-mb-6': [
|
|
291
296
|
_unref(SkillInstallTargetType).OpenclawLinux,
|
|
292
|
-
_unref(SkillInstallTargetType).Cursor
|
|
297
|
+
_unref(SkillInstallTargetType).Cursor,
|
|
298
|
+
_unref(SkillInstallTargetType).OpenclawWindows
|
|
293
299
|
].includes(selectedInstallTargetType.value)
|
|
294
300
|
}),
|
|
295
301
|
label: _unref(t)('安装至'),
|
|
@@ -319,7 +325,8 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
319
325
|
]),
|
|
320
326
|
[
|
|
321
327
|
_unref(SkillInstallTargetType).OpenclawLinux,
|
|
322
|
-
_unref(SkillInstallTargetType).Cursor
|
|
328
|
+
_unref(SkillInstallTargetType).Cursor,
|
|
329
|
+
_unref(SkillInstallTargetType).OpenclawWindows
|
|
323
330
|
].includes(selectedInstallTargetType.value) ? (_openBlock(), _createBlock(RenderInstallGuide, {
|
|
324
331
|
key: 0,
|
|
325
332
|
"skill-install-target-type": selectedInstallTargetType.value,
|
|
@@ -332,25 +339,28 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
332
339
|
"space-id",
|
|
333
340
|
"id"
|
|
334
341
|
])) : _createCommentVNode("v-if", true),
|
|
335
|
-
|
|
342
|
+
getIsShowInstances() ? (_openBlock(), _createBlock(_component_bk_form_item, {
|
|
336
343
|
key: 1,
|
|
337
344
|
label: _unref(t)('Openclaw 实例'),
|
|
338
|
-
property: "
|
|
345
|
+
property: "selectedOpenclawInstances",
|
|
339
346
|
required: ""
|
|
340
347
|
}, {
|
|
341
348
|
default: _withCtx(()=>[
|
|
342
|
-
|
|
343
|
-
"selected-openclaw-
|
|
344
|
-
"onUpdate:
|
|
349
|
+
(_openBlock(), _createBlock(RenderOpenclawInstances, {
|
|
350
|
+
"selected-openclaw-instances": selectedOpenclawInstances.value,
|
|
351
|
+
"onUpdate:selectedOpenclawInstances": _cache[1] || (_cache[1] = ($event)=>selectedOpenclawInstances.value = $event),
|
|
352
|
+
"target-type": selectedInstallTargetType.value,
|
|
345
353
|
"skill-id": props.selectedSkill.id,
|
|
346
354
|
"api-prefix": props.apiPrefix,
|
|
347
|
-
"space-id": props.spaceId
|
|
355
|
+
"space-id": props.spaceId,
|
|
356
|
+
key: selectedInstallTargetType.value
|
|
348
357
|
}, null, 8 /* PROPS */ , [
|
|
349
|
-
"selected-openclaw-
|
|
358
|
+
"selected-openclaw-instances",
|
|
359
|
+
"target-type",
|
|
350
360
|
"skill-id",
|
|
351
361
|
"api-prefix",
|
|
352
362
|
"space-id"
|
|
353
|
-
])
|
|
363
|
+
]))
|
|
354
364
|
]),
|
|
355
365
|
_: 1 /* STABLE */
|
|
356
366
|
}, 8 /* PROPS */ , [
|
|
@@ -26,24 +26,25 @@ import { useSkillHttp } from '../../../hooks/use-skill-http.ts.js';
|
|
|
26
26
|
import { t } from '../../../i18n/index.ts.js';
|
|
27
27
|
export default /*@__PURE__*/ _defineComponent({
|
|
28
28
|
props: {
|
|
29
|
-
|
|
29
|
+
selectedOpenclawInstances: {},
|
|
30
|
+
targetType: {},
|
|
30
31
|
skillId: {},
|
|
31
32
|
apiPrefix: {},
|
|
32
33
|
spaceId: {}
|
|
33
34
|
},
|
|
34
35
|
emits: [
|
|
35
|
-
"update:
|
|
36
|
+
"update:selectedOpenclawInstances"
|
|
36
37
|
],
|
|
37
38
|
setup (__props, { emit: __emit }) {
|
|
38
39
|
const props = __props;
|
|
39
40
|
const emits = __emit;
|
|
40
|
-
const {
|
|
41
|
+
const { getSkillOpenclawInstances, getSkillOpenclawInstancesStatus } = useSkillHttp(props.apiPrefix, toRef(props, 'spaceId'));
|
|
41
42
|
const isLoadingInstances = ref(false);
|
|
42
43
|
const isLoadingInstanceStatus = ref(false);
|
|
43
|
-
const
|
|
44
|
+
const openclawInstances = ref([]);
|
|
44
45
|
const instanceStatusMap = ref({});
|
|
45
46
|
const getIsInstanceChecked = (instance)=>{
|
|
46
|
-
const isSelected = props.
|
|
47
|
+
const isSelected = props.selectedOpenclawInstances.some((item)=>item.hostName === instance.hostName);
|
|
47
48
|
const isInstalled = getIsInstanceInstalled(instance);
|
|
48
49
|
return isSelected || isInstalled;
|
|
49
50
|
};
|
|
@@ -51,39 +52,40 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
51
52
|
var _instanceStatusMap_value_instance_hostName;
|
|
52
53
|
return (_instanceStatusMap_value_instance_hostName = instanceStatusMap.value[instance.hostName]) === null || _instanceStatusMap_value_instance_hostName === void 0 ? void 0 : _instanceStatusMap_value_instance_hostName.isInstalled;
|
|
53
54
|
};
|
|
54
|
-
const
|
|
55
|
+
const handleSelectOpenclawInstance = (instance)=>{
|
|
55
56
|
if (isLoadingInstanceStatus.value || getIsInstanceInstalled(instance)) return;
|
|
56
|
-
if (props.
|
|
57
|
-
emits('update:
|
|
57
|
+
if (props.selectedOpenclawInstances.some((item)=>item.hostName === instance.hostName)) {
|
|
58
|
+
emits('update:selectedOpenclawInstances', props.selectedOpenclawInstances.filter((item)=>item.hostName !== instance.hostName));
|
|
58
59
|
} else {
|
|
59
|
-
emits('update:
|
|
60
|
-
...props.
|
|
60
|
+
emits('update:selectedOpenclawInstances', [
|
|
61
|
+
...props.selectedOpenclawInstances,
|
|
61
62
|
instance
|
|
62
63
|
]);
|
|
63
64
|
}
|
|
64
65
|
};
|
|
65
|
-
const
|
|
66
|
+
const handleGetOpenclawInstanceStatus = (workspaces)=>{
|
|
66
67
|
if (workspaces.length <= 0) return;
|
|
67
68
|
isLoadingInstanceStatus.value = true;
|
|
68
|
-
|
|
69
|
+
getSkillOpenclawInstancesStatus({
|
|
69
70
|
skillId: props.skillId,
|
|
70
|
-
workspaces
|
|
71
|
+
workspaces,
|
|
72
|
+
targetType: props.targetType
|
|
71
73
|
}).then((res)=>{
|
|
72
74
|
instanceStatusMap.value = res;
|
|
73
75
|
}).finally(()=>{
|
|
74
76
|
isLoadingInstanceStatus.value = false;
|
|
75
77
|
});
|
|
76
78
|
};
|
|
77
|
-
const
|
|
79
|
+
const handleGetOpenclawInstances = ()=>{
|
|
78
80
|
isLoadingInstances.value = true;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
getSkillOpenclawInstances(props.targetType).then((res)=>{
|
|
82
|
+
openclawInstances.value = res;
|
|
83
|
+
handleGetOpenclawInstanceStatus(res);
|
|
82
84
|
}).finally(()=>{
|
|
83
85
|
isLoadingInstances.value = false;
|
|
84
86
|
});
|
|
85
87
|
};
|
|
86
|
-
onBeforeMount(
|
|
88
|
+
onBeforeMount(handleGetOpenclawInstances);
|
|
87
89
|
return (_ctx, _cache)=>{
|
|
88
90
|
const _component_bk_loading = _resolveComponent("bk-loading");
|
|
89
91
|
return _openBlock(), _createBlock(_component_bk_loading, {
|
|
@@ -91,7 +93,7 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
91
93
|
class: "g-max-h-400 g-scrollbar g-min-h-98"
|
|
92
94
|
}, {
|
|
93
95
|
default: _withCtx(()=>[
|
|
94
|
-
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(
|
|
96
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(openclawInstances.value, (instance, index)=>{
|
|
95
97
|
return _openBlock(), _createElementBlock("section", {
|
|
96
98
|
class: _normalizeClass([
|
|
97
99
|
'g-flex-row g-rounded-[var(--aidev-radius)]',
|
|
@@ -101,7 +103,7 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
101
103
|
isLoadingInstanceStatus.value ? 'g-disabled' : 'g-cursor-pointer'
|
|
102
104
|
]),
|
|
103
105
|
key: instance.hostName,
|
|
104
|
-
onClick: ($event)=>
|
|
106
|
+
onClick: ($event)=>handleSelectOpenclawInstance(instance)
|
|
105
107
|
}, [
|
|
106
108
|
_createElementVNode("section", _hoisted_2, [
|
|
107
109
|
_createElementVNode("h3", _hoisted_3, _toDisplayString(instance.displayName), 1 /* TEXT */ ),
|
|
@@ -135,7 +137,7 @@ export default /*@__PURE__*/ _defineComponent({
|
|
|
135
137
|
])
|
|
136
138
|
], 10 /* CLASS, PROPS */ , _hoisted_1);
|
|
137
139
|
}), 128 /* KEYED_FRAGMENT */ )),
|
|
138
|
-
_unref(isEmpty)(
|
|
140
|
+
_unref(isEmpty)(openclawInstances.value) ? (_openBlock(), _createBlock(RenderException, {
|
|
139
141
|
key: 0,
|
|
140
142
|
description: _unref(t)('暂无 Openclaw 实例'),
|
|
141
143
|
class: "agent-empty",
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SkillInstallTargetType } from '@/types/enum';
|
|
2
|
+
import { ISkillOpenclawInstance } from '@/types/skill';
|
|
2
3
|
interface IProps {
|
|
3
|
-
|
|
4
|
+
selectedOpenclawInstances: ISkillOpenclawInstance[];
|
|
5
|
+
targetType: SkillInstallTargetType;
|
|
4
6
|
skillId?: number;
|
|
5
7
|
apiPrefix: string;
|
|
6
8
|
spaceId?: string;
|
|
7
9
|
}
|
|
8
10
|
declare const __VLS_export: import("vue").DefineComponent<IProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
9
|
-
"update:
|
|
11
|
+
"update:selectedOpenclawInstances": (value: ISkillOpenclawInstance[]) => any;
|
|
10
12
|
}, string, import("vue").PublicProps, Readonly<IProps> & Readonly<{
|
|
11
|
-
"onUpdate:
|
|
13
|
+
"onUpdate:selectedOpenclawInstances"?: (value: ISkillOpenclawInstance[]) => any;
|
|
12
14
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
15
|
declare const _default: typeof __VLS_export;
|
|
14
16
|
export default _default;
|