@adminforth/mcp 1.4.1 → 1.4.2
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/custom/McpConfirm.vue +11 -12
- package/package.json +1 -1
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="af-mcp-confirm flex min-h-screen items-center justify-center bg-gray-100 p-4 dark:bg-gray-800">
|
|
3
|
-
<div class="w-full max-w-lg rounded-lg bg-white p-6 shadow dark:bg-gray-700">
|
|
3
|
+
<div v-if="resultMessage || error" class="w-full max-w-lg rounded-lg bg-white p-6 shadow dark:bg-gray-700">
|
|
4
4
|
<template v-if="pending">
|
|
5
5
|
<h1 class="text-xl font-medium text-gray-900 dark:text-white">{{ title }}</h1>
|
|
6
6
|
<p class="mt-3 text-sm text-gray-600 dark:text-gray-300">
|
|
7
7
|
<b>{{ pending.connectionName }}</b>
|
|
8
8
|
{{ $t('asks to run this action on your behalf. | asks to run these actions on your behalf.', pending.actions.length) }}
|
|
9
9
|
</p>
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
</ul>
|
|
17
|
-
</template>
|
|
18
|
-
<Spinner v-else class="mx-auto mt-4 h-8 w-8" />
|
|
10
|
+
<p class="mt-4 text-sm font-medium" :class="failed ? 'text-red-700 dark:text-red-300' : 'text-green-700 dark:text-green-300'">
|
|
11
|
+
{{ resultMessage }}
|
|
12
|
+
</p>
|
|
13
|
+
<ul v-if="failedErrors.length" class="mt-2 list-disc space-y-1 pl-5 text-sm text-red-700 dark:text-red-300">
|
|
14
|
+
<li v-for="(failedError, i) in failedErrors" :key="i">{{ failedError }}</li>
|
|
15
|
+
</ul>
|
|
19
16
|
</template>
|
|
20
|
-
<template v-else
|
|
17
|
+
<template v-else>
|
|
21
18
|
<h1 class="text-xl font-medium text-gray-900 dark:text-white">{{ $t('Cannot run the action') }}</h1>
|
|
22
19
|
<p class="mt-3 text-sm text-gray-600 dark:text-gray-300">{{ error }}</p>
|
|
23
20
|
</template>
|
|
24
|
-
<Spinner v-else class="mx-auto h-8 w-8" />
|
|
25
21
|
</div>
|
|
22
|
+
<Spinner v-else-if="running" class="h-8 w-8" />
|
|
26
23
|
</div>
|
|
27
24
|
</template>
|
|
28
25
|
|
|
@@ -49,6 +46,7 @@ const route = useRoute();
|
|
|
49
46
|
const pending = ref<PendingConfirmation | null>(null);
|
|
50
47
|
const error = ref('');
|
|
51
48
|
const failed = ref(false);
|
|
49
|
+
const running = ref(false);
|
|
52
50
|
const resultMessage = ref('');
|
|
53
51
|
const failedErrors = ref<string[]>([]);
|
|
54
52
|
const ids = computed(() => pending.value!.actions.map((action) => action.id));
|
|
@@ -90,6 +88,7 @@ async function confirm() {
|
|
|
90
88
|
}
|
|
91
89
|
return;
|
|
92
90
|
}
|
|
91
|
+
running.value = true;
|
|
93
92
|
const response = await callAdminForthApi({ method: 'POST', path: '/mcp/confirmation/run', body: { ids: ids.value, verificationResult } });
|
|
94
93
|
if (!response || response.error) {
|
|
95
94
|
failed.value = true;
|