@privateaim/client-vue 0.8.23 → 0.8.25
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/index.mjs +29 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +18 -18
package/dist/index.mjs
CHANGED
|
@@ -1751,9 +1751,9 @@ const FAnalysisCommand = defineComponent({
|
|
|
1751
1751
|
],
|
|
1752
1752
|
setup (props, { emit, slots }) {
|
|
1753
1753
|
const apiClient = injectCoreHTTPClient();
|
|
1754
|
-
const
|
|
1754
|
+
const isBusy = ref(false);
|
|
1755
1755
|
const entity = toRef(props, 'entity');
|
|
1756
|
-
const execute = wrapFnWithBusyState(
|
|
1756
|
+
const execute = wrapFnWithBusyState(isBusy, async ()=>{
|
|
1757
1757
|
try {
|
|
1758
1758
|
const response = await apiClient.analysis.runCommand(entity.value.id, props.command);
|
|
1759
1759
|
emit('executed', props.command);
|
|
@@ -6543,26 +6543,49 @@ var _sfc_main$j = defineComponent({
|
|
|
6543
6543
|
},
|
|
6544
6544
|
props: {
|
|
6545
6545
|
entityId: {
|
|
6546
|
-
type: String
|
|
6546
|
+
type: String,
|
|
6547
|
+
required: true
|
|
6547
6548
|
},
|
|
6548
6549
|
type: {
|
|
6549
6550
|
type: String
|
|
6550
6551
|
}
|
|
6551
6552
|
},
|
|
6552
|
-
|
|
6553
|
+
emits: [
|
|
6554
|
+
'updated',
|
|
6555
|
+
'executed',
|
|
6556
|
+
'failed'
|
|
6557
|
+
],
|
|
6558
|
+
setup (props, { emit }) {
|
|
6553
6559
|
const vNode = useTemplateRef('analysisBucket');
|
|
6560
|
+
const httpClient = injectCoreHTTPClient();
|
|
6554
6561
|
const forward = (name, ...args)=>{
|
|
6555
6562
|
emit(name, ...args);
|
|
6556
6563
|
};
|
|
6557
|
-
const
|
|
6564
|
+
const isBusy = ref(false);
|
|
6565
|
+
const execute = wrapFnWithBusyState(isBusy, async ()=>{
|
|
6566
|
+
try {
|
|
6567
|
+
const response = await httpClient.analysis.runCommand(props.entityId, AnalysisCommand.STORAGE_CHECK);
|
|
6568
|
+
emit('executed', AnalysisCommand.STORAGE_CHECK);
|
|
6569
|
+
emit('updated', response);
|
|
6570
|
+
} catch (e) {
|
|
6571
|
+
if (e instanceof Error) {
|
|
6572
|
+
emit('failed', e);
|
|
6573
|
+
}
|
|
6574
|
+
}
|
|
6575
|
+
});
|
|
6576
|
+
const refresh = ()=>{
|
|
6558
6577
|
if (vNode.value) {
|
|
6559
6578
|
vNode.value.resolve({
|
|
6560
6579
|
reset: true
|
|
6561
6580
|
});
|
|
6562
6581
|
}
|
|
6563
6582
|
};
|
|
6583
|
+
const retry = ()=>{
|
|
6584
|
+
Promise.resolve().then(()=>execute()).then(()=>refresh());
|
|
6585
|
+
};
|
|
6564
6586
|
return {
|
|
6565
6587
|
forward,
|
|
6588
|
+
refresh,
|
|
6566
6589
|
retry
|
|
6567
6590
|
};
|
|
6568
6591
|
}
|
|
@@ -6577,7 +6600,7 @@ function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6577
6600
|
analysis_id: _ctx.entityId,
|
|
6578
6601
|
type: _ctx.type
|
|
6579
6602
|
}
|
|
6580
|
-
},
|
|
6603
|
+
}, toHandlers(_ctx.forward)), {
|
|
6581
6604
|
default: withCtx((props) => [
|
|
6582
6605
|
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(props)))
|
|
6583
6606
|
]),
|