@binblink/wasmnest-plugin-sdk-mobile 0.0.0-stage → 0.0.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/README.md +439 -2
- package/README_en.md +415 -0
- package/bin/build.js +271 -0
- package/bin/cli.js +96 -0
- package/bin/lib.js +349 -0
- package/bin/manifest-gen.js +327 -0
- package/bin/package.js +151 -0
- package/bin/scaffold.js +299 -0
- package/dev-shell/README.md +151 -0
- package/dev-shell/index.html +27 -0
- package/dev-shell/package.json +27 -0
- package/dev-shell/pnpm-workspace.yaml +9 -0
- package/dev-shell/postcss.config.js +6 -0
- package/dev-shell/src/App.vue +90 -0
- package/dev-shell/src/apps/mock-terminal/MockTerminalSlotCard.vue +43 -0
- package/dev-shell/src/apps/mock-terminal/MockTerminalView.vue +168 -0
- package/dev-shell/src/apps/mock-terminal/index.ts +50 -0
- package/dev-shell/src/components/DevToolbar.vue +100 -0
- package/dev-shell/src/components/DialogHost.vue +119 -0
- package/dev-shell/src/components/LogPanel.vue +80 -0
- package/dev-shell/src/i18n.ts +22 -0
- package/dev-shell/src/loader.ts +239 -0
- package/dev-shell/src/locale.ts +29 -0
- package/dev-shell/src/locales/en-shell.ts +332 -0
- package/dev-shell/src/locales/index.ts +70 -0
- package/dev-shell/src/locales/shell.ts +331 -0
- package/dev-shell/src/main.ts +58 -0
- package/dev-shell/src/mock/dialog-service.ts +58 -0
- package/dev-shell/src/mock/file-transfer.ts +390 -0
- package/dev-shell/src/mock/mobile-api.ts +369 -0
- package/dev-shell/src/mock/preset-tasks.ts +186 -0
- package/dev-shell/src/mock/session.ts +121 -0
- package/dev-shell/src/mock-context.ts +374 -0
- package/dev-shell/src/registry.ts +151 -0
- package/dev-shell/src/shared-runtime.ts +44 -0
- package/dev-shell/src/shell/ShellView.vue +52 -0
- package/dev-shell/src/shell/adapters/devAppSource.ts +144 -0
- package/dev-shell/src/shell/components/PluginContextHost.vue +40 -0
- package/dev-shell/src/shell/components/ShellAppCell.vue +75 -0
- package/dev-shell/src/shell/components/ShellAppIcon.vue +111 -0
- package/dev-shell/src/shell/components/ShellAppSurface.vue +46 -0
- package/dev-shell/src/shell/components/ShellBrandTile.vue +27 -0
- package/dev-shell/src/shell/components/ShellCapsuleMenu.vue +123 -0
- package/dev-shell/src/shell/components/ShellChip.vue +49 -0
- package/dev-shell/src/shell/components/ShellGroupCard.vue +17 -0
- package/dev-shell/src/shell/components/ShellHost.vue +75 -0
- package/dev-shell/src/shell/components/ShellNotificationShade.vue +501 -0
- package/dev-shell/src/shell/components/ShellPermissionPrompt.vue +127 -0
- package/dev-shell/src/shell/components/ShellPlaceholderSurface.vue +33 -0
- package/dev-shell/src/shell/components/ShellSection.vue +27 -0
- package/dev-shell/src/shell/components/ShellSheet.vue +74 -0
- package/dev-shell/src/shell/components/ShellStatusbar.vue +84 -0
- package/dev-shell/src/shell/components/screens/PluginRoutePage.vue +98 -0
- package/dev-shell/src/shell/components/screens/ShellAppDetailScreen.vue +359 -0
- package/dev-shell/src/shell/components/screens/ShellAppRunScreen.vue +90 -0
- package/dev-shell/src/shell/components/screens/ShellAppsScreen.vue +195 -0
- package/dev-shell/src/shell/components/screens/ShellHomeScreen.vue +357 -0
- package/dev-shell/src/shell/components/screens/ShellPermissionsScreen.vue +376 -0
- package/dev-shell/src/shell/components/screens/ShellSettingsScreen.vue +240 -0
- package/dev-shell/src/shell/components/screens/ShellSwitcherScreen.vue +559 -0
- package/dev-shell/src/shell/components/ui/ConfirmDialog.vue +137 -0
- package/dev-shell/src/shell/components/ui/Toggle.vue +53 -0
- package/dev-shell/src/shell/composables/useShellApps.ts +417 -0
- package/dev-shell/src/shell/composables/useShellNavigation.ts +197 -0
- package/dev-shell/src/shell/composables/useShellNotifications.ts +115 -0
- package/dev-shell/src/shell/composables/useShellOpen.ts +44 -0
- package/dev-shell/src/shell/composables/useShellOverlays.ts +101 -0
- package/dev-shell/src/shell/composables/useShellPreferences.ts +143 -0
- package/dev-shell/src/shell/composables/useShellRecent.ts +84 -0
- package/dev-shell/src/shell/composables/useSlotCarousel.ts +238 -0
- package/dev-shell/src/shell/composables/useToast.ts +33 -0
- package/dev-shell/src/shell/index.ts +88 -0
- package/dev-shell/src/shell/logger.ts +45 -0
- package/dev-shell/src/shell/permissions.ts +145 -0
- package/dev-shell/src/shell/registry.ts +220 -0
- package/dev-shell/src/shell/slotCards.ts +47 -0
- package/dev-shell/src/shell/styles/shell.css +1155 -0
- package/dev-shell/src/shell/surfaceIntent.ts +107 -0
- package/dev-shell/src/shell/types.ts +152 -0
- package/dev-shell/src/shell/utils.ts +54 -0
- package/dev-shell/src/styles/main.css +153 -0
- package/dev-shell/src/styles/mobile.css +981 -0
- package/dev-shell/src/styles/wallpaper.css +130 -0
- package/dev-shell/src/theme.ts +71 -0
- package/dev-shell/src/vite-env.d.ts +20 -0
- package/dev-shell/tailwind.config.js +101 -0
- package/dev-shell/tsconfig.json +16 -0
- package/dev-shell/vite.config.ts +130 -0
- package/dist/index.d.ts +124 -0
- package/dist/index.js +229 -0
- package/dist/types.d.ts +738 -0
- package/dist/types.js +0 -0
- package/dist/vite-plugin.d.ts +16 -0
- package/dist/vite-plugin.js +95 -0
- package/package.json +88 -3
- package/src/constants.ts +6 -0
- package/src/global-dialog.ts +168 -0
- package/src/index.ts +96 -0
- package/src/runtime.ts +44 -0
- package/src/types.ts +822 -0
- package/src/ui/AppUpdateSection.d.ts +44 -0
- package/src/ui/AppUpdateSection.vue +253 -0
- package/src/ui/PluginGlobalDialog.vue +388 -0
- package/src/ui/QuickCard.d.ts +33 -0
- package/src/ui/QuickCard.vue +167 -0
- package/src/ui/Select.d.ts +37 -0
- package/src/ui/Select.vue +307 -0
- package/src/ui/plugin-global-dialog.d.ts +11 -0
- package/src/ui/useSwipeTabs.d.ts +20 -0
- package/src/ui/useSwipeTabs.ts +53 -0
- package/src/update.ts +123 -0
- package/src/vite-plugin.ts +132 -0
- package/template/.gitignore +4 -0
- package/template/README.md +46 -0
- package/template/package.json +23 -0
- package/template/plugin.json +13 -0
- package/template/rust/Cargo.toml +19 -0
- package/template/rust/src/lib.rs +33 -0
- package/template/src/env.d.ts +24 -0
- package/template/src/index.ts +37 -0
- package/template/tsconfig.json +17 -0
- package/template/vite.config.ts +21 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col h-full min-h-0">
|
|
3
|
+
<!-- ==================== 返回行 ==================== -->
|
|
4
|
+
<div class="flex items-center gap-2 px-2 pt-2 pb-1">
|
|
5
|
+
<button
|
|
6
|
+
type="button"
|
|
7
|
+
class="flex items-center justify-center rounded-[10px] min-w-[var(--mobile-touch-target-min)] min-h-[var(--mobile-touch-target-min)] transition-colors duration-200 active:bg-[var(--mobile-accent-muted)]"
|
|
8
|
+
:aria-label="t('shell.detail.back')"
|
|
9
|
+
@click="nav.back()"
|
|
10
|
+
>
|
|
11
|
+
<svg width="21" height="21" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
12
|
+
<path d="M15 6l-6 6 6 6" />
|
|
13
|
+
</svg>
|
|
14
|
+
</button>
|
|
15
|
+
<span class="text-[var(--font-size-base)] font-semibold text-[var(--mobile-text-primary)]">
|
|
16
|
+
{{ t('shell.detail.title') }}
|
|
17
|
+
</span>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div v-if="app" class="flex-1 min-h-0 overflow-y-auto pb-6">
|
|
21
|
+
<!-- ==================== Hero ==================== -->
|
|
22
|
+
<div class="flex items-center gap-3.5 px-4 pt-2 pb-4">
|
|
23
|
+
<ShellAppIcon :app="app" :size="60" />
|
|
24
|
+
<div class="flex-1 min-w-0">
|
|
25
|
+
<div class="flex items-center gap-2">
|
|
26
|
+
<b class="text-[var(--font-size-xl)] text-[var(--mobile-text-primary)] truncate">{{ app.name }}</b>
|
|
27
|
+
<ShellChip v-if="app.official" :label="t('shell.detail.official')" tone="accent" />
|
|
28
|
+
</div>
|
|
29
|
+
<div class="mt-0.5 text-[var(--font-size-sm)] text-[var(--mobile-text-secondary)] truncate">
|
|
30
|
+
{{ app.version ? t('shell.detail.version', { version: app.version }) : '' }}
|
|
31
|
+
<span v-if="app.author"> · {{ app.author }}</span>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="mt-1 flex items-center gap-1.5 text-[var(--font-size-xs)]">
|
|
34
|
+
<span class="w-1.5 h-1.5 rounded-full flex-shrink-0" :style="{ background: stateDot }" aria-hidden="true" />
|
|
35
|
+
<span :style="{ color: 'var(--mobile-text-secondary)' }">{{ stateLabel }}</span>
|
|
36
|
+
<span v-if="app.error" class="truncate" :style="{ color: 'var(--mobile-error)' }"> · {{ app.error }}</span>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<!-- ==================== 待审批(需要用户动作:整单批准 + 哈希钉扎) ==================== -->
|
|
42
|
+
<div v-if="app.state === 'approval'" class="px-4 pb-1">
|
|
43
|
+
<div
|
|
44
|
+
class="rounded-[12px] border px-3 py-3"
|
|
45
|
+
:style="{
|
|
46
|
+
background: 'var(--mobile-warning-muted)',
|
|
47
|
+
borderColor: 'var(--mobile-warning)',
|
|
48
|
+
}"
|
|
49
|
+
>
|
|
50
|
+
<p class="text-[var(--font-size-sm)] text-[var(--mobile-text-primary)]">
|
|
51
|
+
{{ t('shell.detail.approvalDesc', { count: app.permissions.length }) }}
|
|
52
|
+
</p>
|
|
53
|
+
<button
|
|
54
|
+
type="button"
|
|
55
|
+
class="mt-2.5 w-full rounded-[10px] px-4 py-2.5 text-[var(--font-size-base)] transition-opacity duration-200 active:opacity-80 min-h-[var(--mobile-touch-target-min)]"
|
|
56
|
+
:style="{ background: 'var(--mobile-accent)', color: 'var(--mobile-text-on-accent)' }"
|
|
57
|
+
@click="handleApprove"
|
|
58
|
+
>
|
|
59
|
+
{{ t('shell.detail.approveStart') }}
|
|
60
|
+
</button>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<!-- ==================== 运行状态 ==================== -->
|
|
65
|
+
<!-- 应用自持连接,平台不知道它的连接对端;这里只投影平台确实掌握的事实:运行态 -->
|
|
66
|
+
<ShellSection :title="t('shell.detail.state')" />
|
|
67
|
+
<div class="px-4 pb-1">
|
|
68
|
+
<ShellGroupCard>
|
|
69
|
+
<div class="flex items-center gap-3 px-3 py-3">
|
|
70
|
+
<span class="w-1.5 h-1.5 rounded-full flex-shrink-0" :style="{ background: stateDot }" aria-hidden="true" />
|
|
71
|
+
<div class="flex-1 min-w-0">
|
|
72
|
+
<div class="text-[var(--font-size-base)] font-medium text-[var(--mobile-text-primary)]">
|
|
73
|
+
{{ app.name }}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
<ShellChip :label="stateLabel" :tone="stateTone" />
|
|
77
|
+
</div>
|
|
78
|
+
</ShellGroupCard>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<!-- ==================== 权限 ====================
|
|
82
|
+
与移动端宿主 / 桌面端同口径:权限随应用包声明,由宿主整单裁决,
|
|
83
|
+
详情页只读呈现,不提供逐项开关。 -->
|
|
84
|
+
<ShellSection :title="t('shell.detail.permissions')" :note="permissionsNote" />
|
|
85
|
+
<div class="px-4 pb-1">
|
|
86
|
+
<ShellGroupCard v-if="permissionGroups.length > 0">
|
|
87
|
+
<template v-for="group in permissionGroups" :key="group.id">
|
|
88
|
+
<div class="px-3 pt-2.5 pb-1 text-[var(--font-size-xs)] font-semibold text-[var(--mobile-text-muted)]">
|
|
89
|
+
{{ t(group.titleKey) }}
|
|
90
|
+
</div>
|
|
91
|
+
<div
|
|
92
|
+
v-for="grant in group.items"
|
|
93
|
+
:key="grant.key"
|
|
94
|
+
class="flex items-center gap-3 px-3 py-2.5 min-h-[var(--mobile-touch-target-min)]"
|
|
95
|
+
>
|
|
96
|
+
<div class="flex-1 min-w-0">
|
|
97
|
+
<div class="text-[var(--font-size-base)] font-medium text-[var(--mobile-text-primary)]">
|
|
98
|
+
{{ permissionTitle(grant.key) }}
|
|
99
|
+
<code class="ml-1.5 text-[var(--font-size-xs)] text-[var(--mobile-text-secondary)]">{{ grant.key }}</code>
|
|
100
|
+
</div>
|
|
101
|
+
<div
|
|
102
|
+
v-if="permissionDesc(grant.key)"
|
|
103
|
+
class="text-[var(--font-size-xs)] text-[var(--mobile-text-secondary)]"
|
|
104
|
+
>
|
|
105
|
+
{{ permissionDesc(grant.key) }}
|
|
106
|
+
</div>
|
|
107
|
+
<div v-if="grant.locked" class="text-[var(--font-size-xs)] text-[var(--mobile-text-secondary)]">
|
|
108
|
+
{{ t('shell.detail.permissionLocked') }}
|
|
109
|
+
</div>
|
|
110
|
+
<div v-else-if="grant.scope" class="text-[var(--font-size-xs)] text-[var(--mobile-text-secondary)]">
|
|
111
|
+
{{ grant.scope }}
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
<!-- 锁定项:只标徽标——隐藏会让用户误以为应用没有该能力 -->
|
|
115
|
+
<ShellChip v-if="grant.locked" :label="t('shell.detail.permissionLocked')" tone="neutral" />
|
|
116
|
+
</div>
|
|
117
|
+
</template>
|
|
118
|
+
</ShellGroupCard>
|
|
119
|
+
<p
|
|
120
|
+
v-else
|
|
121
|
+
class="rounded-[12px] border border-dashed border-[var(--mobile-border-hover)] px-3 py-4 text-center text-[var(--font-size-xs)] text-[var(--mobile-text-secondary)]"
|
|
122
|
+
>
|
|
123
|
+
{{ t('mobile.plugin.noPermissions') }}
|
|
124
|
+
</p>
|
|
125
|
+
<!-- 只读说明:权限松紧由 manifest 声明与宿主整单裁决决定,详情页不提供开关 -->
|
|
126
|
+
<p
|
|
127
|
+
v-if="permissionGroups.length > 0"
|
|
128
|
+
class="mt-2 px-1 text-[var(--font-size-xs)] text-[var(--mobile-text-secondary)]"
|
|
129
|
+
>
|
|
130
|
+
{{ t('shell.detail.permissionsReadonly') }}
|
|
131
|
+
</p>
|
|
132
|
+
<!-- 审批失败等动作错误:不伪造成功态 -->
|
|
133
|
+
<p v-if="actionError" class="mt-2 px-1 text-[var(--font-size-xs)]" :style="{ color: 'var(--mobile-error)' }">
|
|
134
|
+
{{ actionError }}
|
|
135
|
+
</p>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<!-- ==================== 存储 ==================== -->
|
|
139
|
+
<ShellSection :title="t('shell.detail.storage')" />
|
|
140
|
+
<div class="px-4 pb-1">
|
|
141
|
+
<ShellGroupCard>
|
|
142
|
+
<div class="flex items-center px-3 py-3 min-h-[var(--mobile-touch-target-min)]">
|
|
143
|
+
<span class="flex-1 text-[var(--font-size-base)] text-[var(--mobile-text-primary)]">
|
|
144
|
+
{{ t('shell.detail.appData') }}
|
|
145
|
+
</span>
|
|
146
|
+
<span class="text-[var(--font-size-sm)] text-[var(--mobile-text-secondary)]">{{ formatBytes(app.sizeBytes) }}</span>
|
|
147
|
+
</div>
|
|
148
|
+
<!-- 缓存行已删:后端没有缓存统计源,永远显示「—」的行属于空白项 -->
|
|
149
|
+
</ShellGroupCard>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<!-- ==================== 授权记录 ==================== -->
|
|
153
|
+
<ShellSection :title="t('shell.detail.grants')" :note="t('shell.detail.grantsNote')" />
|
|
154
|
+
<div class="px-4 pb-1">
|
|
155
|
+
<p
|
|
156
|
+
class="rounded-[12px] border border-dashed border-[var(--mobile-border-hover)] px-3 py-4 text-center text-[var(--font-size-xs)] text-[var(--mobile-text-secondary)]"
|
|
157
|
+
>
|
|
158
|
+
{{ t('shell.detail.grantsEmpty') }}
|
|
159
|
+
</p>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<!-- ==================== 操作 ==================== -->
|
|
163
|
+
<!-- 层级:停用(次要)→ 卸载(危险,描边而非淡粉底:淡粉底在浅色主题下
|
|
164
|
+
看起来像 disabled 按钮,反而弱化了危险性 -->
|
|
165
|
+
<div class="px-4 pt-3 flex flex-col gap-2.5">
|
|
166
|
+
<button
|
|
167
|
+
type="button"
|
|
168
|
+
class="w-full rounded-[10px] border border-[var(--mobile-border)] px-4 py-3 text-[var(--font-size-base)] text-[var(--mobile-text-primary)] transition-colors duration-200 active:bg-[var(--mobile-accent-muted)] min-h-[var(--mobile-touch-target-min)]"
|
|
169
|
+
@click="handleStop"
|
|
170
|
+
>
|
|
171
|
+
{{ t('shell.detail.disable') }}
|
|
172
|
+
</button>
|
|
173
|
+
<button
|
|
174
|
+
v-if="canRemove"
|
|
175
|
+
type="button"
|
|
176
|
+
class="w-full rounded-[10px] border px-4 py-3 text-[var(--font-size-base)] transition-colors duration-200 active:opacity-80 min-h-[var(--mobile-touch-target-min)]"
|
|
177
|
+
:style="{
|
|
178
|
+
borderColor: 'var(--mobile-error)',
|
|
179
|
+
color: 'var(--mobile-error)',
|
|
180
|
+
background: 'transparent',
|
|
181
|
+
}"
|
|
182
|
+
@click="confirmRemove = true"
|
|
183
|
+
>
|
|
184
|
+
{{ t('shell.detail.uninstall') }}
|
|
185
|
+
</button>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<!-- 应用已卸载/不存在:给出原因与出口,不留白屏 -->
|
|
190
|
+
<div v-else class="flex-1 flex items-center justify-center px-8 text-center">
|
|
191
|
+
<p class="text-[var(--font-size-base)] text-[var(--mobile-text-secondary)]">
|
|
192
|
+
{{ t('shell.run.notFound') }}
|
|
193
|
+
</p>
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
<!-- 危险操作二次确认:复用平台通用 ConfirmDialog,不用原生对话框
|
|
197
|
+
(原生 confirm 是系统弹窗,视觉与平台不一致,且不可本地化按钮)。
|
|
198
|
+
放在 `v-if="app"` / `v-else` 配对之外,避免打断两者的相邻关系。 -->
|
|
199
|
+
<ConfirmDialog
|
|
200
|
+
:model-value="confirmRemove"
|
|
201
|
+
variant="danger"
|
|
202
|
+
:title="t('shell.detail.uninstall')"
|
|
203
|
+
:message="app ? t('shell.apps.uninstallConfirm', { name: app.name }) : ''"
|
|
204
|
+
:confirm-text="t('shell.detail.uninstall')"
|
|
205
|
+
:cancel-text="t('shell.common.cancel')"
|
|
206
|
+
@update:model-value="confirmRemove = $event"
|
|
207
|
+
@confirm="handleRemove"
|
|
208
|
+
/>
|
|
209
|
+
</div>
|
|
210
|
+
</template>
|
|
211
|
+
|
|
212
|
+
<script setup lang="ts">
|
|
213
|
+
/**
|
|
214
|
+
* 应用详情与权限
|
|
215
|
+
*
|
|
216
|
+
* 权限清单只读(与移动端宿主 / 桌面端对齐):裁决在宿主端——审批整单 +
|
|
217
|
+
* 内容哈希钉扎,没有逐项授权命令。详情页只呈现声明事实,不提供开关。
|
|
218
|
+
* 授权记录区没有后端真源,渲染空态而不是编造几条示例。
|
|
219
|
+
*/
|
|
220
|
+
import { computed, ref, watch } from 'vue'
|
|
221
|
+
import { useI18n } from 'vue-i18n'
|
|
222
|
+
import ConfirmDialog from '../ui/ConfirmDialog.vue'
|
|
223
|
+
import { useToast } from '../../composables/useToast'
|
|
224
|
+
import { useShellApps } from '../../composables/useShellApps'
|
|
225
|
+
import { useShellNavigation } from '../../composables/useShellNavigation'
|
|
226
|
+
import { groupPermissions, permissionDescKey, permissionTitleKey } from '../../permissions'
|
|
227
|
+
import { formatBytes } from '../../utils'
|
|
228
|
+
import ShellAppIcon from '../ShellAppIcon.vue'
|
|
229
|
+
import ShellChip from '../ShellChip.vue'
|
|
230
|
+
import ShellGroupCard from '../ShellGroupCard.vue'
|
|
231
|
+
import ShellSection from '../ShellSection.vue'
|
|
232
|
+
|
|
233
|
+
const { t } = useI18n()
|
|
234
|
+
const toast = useToast()
|
|
235
|
+
const nav = useShellNavigation()
|
|
236
|
+
const {
|
|
237
|
+
getApp,
|
|
238
|
+
supportsRemove,
|
|
239
|
+
removeApp,
|
|
240
|
+
stop,
|
|
241
|
+
approveApp,
|
|
242
|
+
launch,
|
|
243
|
+
} = useShellApps()
|
|
244
|
+
|
|
245
|
+
/** 应用 id 来自导航参数(壳内导航不落 URL) */
|
|
246
|
+
const appId = computed(() => nav.params.value.appId ?? '')
|
|
247
|
+
const app = computed(() => getApp(appId.value))
|
|
248
|
+
|
|
249
|
+
const canRemove = computed(() => (appId.value ? supportsRemove(appId.value) : false))
|
|
250
|
+
|
|
251
|
+
/** 权限按能力域分组;未归类的新权限进「其他」组,保证不会因未归类而消失 */
|
|
252
|
+
const permissionGroups = computed(() =>
|
|
253
|
+
groupPermissions(app.value?.permissions ?? [], 'shell.permission.group.other'),
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
const permissionsNote = computed(() => {
|
|
257
|
+
const list = app.value?.permissions ?? []
|
|
258
|
+
const granted = list.filter((p) => p.granted).length
|
|
259
|
+
const locked = list.filter((p) => p.locked).length
|
|
260
|
+
return t('shell.detail.permissionsNote', { granted, locked })
|
|
261
|
+
})
|
|
262
|
+
|
|
263
|
+
/** 权限标题:复用既有本地化文案,未知权限回退原始权限词(不显示为空白) */
|
|
264
|
+
function permissionTitle(key: string): string {
|
|
265
|
+
const i18nKey = permissionTitleKey(key)
|
|
266
|
+
return i18nKey ? t(i18nKey) : key
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** 权限说明:已知说明 key 才展示(dev-shell 只维护 metrics:read 的能力边界文案) */
|
|
270
|
+
function permissionDesc(key: string): string {
|
|
271
|
+
const i18nKey = permissionDescKey(key)
|
|
272
|
+
return i18nKey ? t(i18nKey) : ''
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
const stateLabel = computed(() => {
|
|
276
|
+
switch (app.value?.state) {
|
|
277
|
+
case 'running':
|
|
278
|
+
return t('shell.common.running')
|
|
279
|
+
case 'approval':
|
|
280
|
+
return t('shell.common.approval')
|
|
281
|
+
case 'disabled':
|
|
282
|
+
return t('shell.common.disabled')
|
|
283
|
+
case 'error':
|
|
284
|
+
return t('shell.common.error')
|
|
285
|
+
default:
|
|
286
|
+
return t('shell.common.stopped')
|
|
287
|
+
}
|
|
288
|
+
})
|
|
289
|
+
|
|
290
|
+
const stateTone = computed<'success' | 'warn' | 'danger' | 'neutral'>(() => {
|
|
291
|
+
switch (app.value?.state) {
|
|
292
|
+
case 'running':
|
|
293
|
+
return 'success'
|
|
294
|
+
case 'approval':
|
|
295
|
+
return 'warn'
|
|
296
|
+
case 'disabled':
|
|
297
|
+
return 'warn'
|
|
298
|
+
case 'error':
|
|
299
|
+
return 'danger'
|
|
300
|
+
default:
|
|
301
|
+
return 'neutral'
|
|
302
|
+
}
|
|
303
|
+
})
|
|
304
|
+
|
|
305
|
+
const stateDot = computed(() => {
|
|
306
|
+
switch (app.value?.state) {
|
|
307
|
+
case 'running':
|
|
308
|
+
return 'var(--mobile-success)'
|
|
309
|
+
case 'approval':
|
|
310
|
+
return 'var(--mobile-warning)'
|
|
311
|
+
case 'error':
|
|
312
|
+
return 'var(--mobile-error)'
|
|
313
|
+
default:
|
|
314
|
+
return 'var(--mobile-text-disabled)'
|
|
315
|
+
}
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
const actionError = ref<string | null>(null)
|
|
319
|
+
/** 卸载二次确认(复用平台 ConfirmDialog,见模板) */
|
|
320
|
+
const confirmRemove = ref(false)
|
|
321
|
+
// 切换应用时清掉上一条的失败提示,避免张冠李戴
|
|
322
|
+
watch(appId, () => {
|
|
323
|
+
actionError.value = null
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
async function handleStop(): Promise<void> {
|
|
327
|
+
if (!appId.value) return
|
|
328
|
+
await stop(appId.value)
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* 批准并启动
|
|
333
|
+
*
|
|
334
|
+
* 审批是整单的(后端 plugin_approve:全部声明权限 + 内容哈希钉扎);批准失败时
|
|
335
|
+
* 不继续启动——半途而废的「已批准」假象比直接报错更危险(权限是安全面)。
|
|
336
|
+
*/
|
|
337
|
+
async function handleApprove(): Promise<void> {
|
|
338
|
+
if (!app.value) return
|
|
339
|
+
const approved = await approveApp(app.value.id)
|
|
340
|
+
if (!approved) {
|
|
341
|
+
actionError.value = t('shell.permissions.approveFailed')
|
|
342
|
+
return
|
|
343
|
+
}
|
|
344
|
+
const started = await launch(app.value.id)
|
|
345
|
+
if (started) nav.openApp(app.value.id)
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
async function handleRemove(): Promise<void> {
|
|
349
|
+
confirmRemove.value = false
|
|
350
|
+
if (!app.value) return
|
|
351
|
+
const ok = await removeApp(app.value.id)
|
|
352
|
+
if (ok) {
|
|
353
|
+
toast.success(t('shell.apps.uninstallSuccess', { name: app.value.name }))
|
|
354
|
+
nav.back()
|
|
355
|
+
} else {
|
|
356
|
+
toast.error(t('shell.apps.uninstallFailed', { error: t('shell.run.notFound') }))
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
</script>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 根节点自铺默认页面底色:平台顶栏与应用运行面是同一个应用窗口
|
|
3
|
+
(与真机 ShellAppRunScreen 同形)。 -->
|
|
4
|
+
<div class="flex flex-col h-full min-h-0 bg-[var(--mobile-bg-primary)]">
|
|
5
|
+
<!--
|
|
6
|
+
平台顶栏:左侧应用身份(图标 + 名称),右侧胶囊(菜单 / 多任务 / 回主屏)。
|
|
7
|
+
三个按钮都是显式点击路径,不依赖系统手势;胶囊对齐小程序形态——平台的
|
|
8
|
+
控制项浮在应用之上,但**不**在界面上讲解自己是什么(2026-10-14 修订)。
|
|
9
|
+
-->
|
|
10
|
+
<header class="flex items-center gap-2.5 px-3 pt-1.5 pb-1 flex-shrink-0">
|
|
11
|
+
<ShellAppIcon v-if="app" :app="app" :size="30" />
|
|
12
|
+
<span
|
|
13
|
+
class="flex-1 min-w-0 text-[var(--font-size-base)] font-medium text-[var(--mobile-text-primary)] truncate"
|
|
14
|
+
>
|
|
15
|
+
{{ app?.name ?? t('shell.run.notFound') }}
|
|
16
|
+
</span>
|
|
17
|
+
|
|
18
|
+
<div class="shell-capsule">
|
|
19
|
+
<button
|
|
20
|
+
type="button"
|
|
21
|
+
class="shell-capsule-btn"
|
|
22
|
+
:aria-label="t('shell.run.menu')"
|
|
23
|
+
aria-haspopup="dialog"
|
|
24
|
+
@click="overlays.openCapsule(appId)"
|
|
25
|
+
>
|
|
26
|
+
<svg width="19" height="19" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
27
|
+
<circle cx="5" cy="12" r="1.9" />
|
|
28
|
+
<circle cx="12" cy="12" r="1.9" />
|
|
29
|
+
<circle cx="19" cy="12" r="1.9" />
|
|
30
|
+
</svg>
|
|
31
|
+
</button>
|
|
32
|
+
<span class="shell-capsule-divider" aria-hidden="true" />
|
|
33
|
+
<button
|
|
34
|
+
type="button"
|
|
35
|
+
class="shell-capsule-btn"
|
|
36
|
+
:aria-label="t('shell.run.recents')"
|
|
37
|
+
@click="nav.openSwitcher()"
|
|
38
|
+
>
|
|
39
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
40
|
+
<rect x="7" y="3" width="14" height="14" rx="3" />
|
|
41
|
+
<path d="M3 7v10a4 4 0 0 0 4 4h10" />
|
|
42
|
+
</svg>
|
|
43
|
+
</button>
|
|
44
|
+
<span class="shell-capsule-divider" aria-hidden="true" />
|
|
45
|
+
<button
|
|
46
|
+
type="button"
|
|
47
|
+
class="shell-capsule-btn"
|
|
48
|
+
:aria-label="t('shell.run.home')"
|
|
49
|
+
@click="nav.goHome()"
|
|
50
|
+
>
|
|
51
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
52
|
+
<path d="M3 10.5L12 3l9 7.5" />
|
|
53
|
+
<path d="M5 9.5V21h14V9.5" />
|
|
54
|
+
</svg>
|
|
55
|
+
</button>
|
|
56
|
+
</div>
|
|
57
|
+
</header>
|
|
58
|
+
|
|
59
|
+
<!-- ==================== 应用运行面 ==================== -->
|
|
60
|
+
<ShellAppSurface :app-id="appId" />
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<script setup lang="ts">
|
|
65
|
+
/**
|
|
66
|
+
* 应用运行屏
|
|
67
|
+
*
|
|
68
|
+
* 平台只叠加两样东西:顶部一行应用身份,与右侧胶囊(菜单 / 多任务 / 回主屏)。
|
|
69
|
+
* 应用内部界面由应用自持(ShellAppSurface),平台不画应用内页头,也不给应用
|
|
70
|
+
* 加返回键——返回不是这一层的语义,退出走「回主屏」。
|
|
71
|
+
*
|
|
72
|
+
* 底部系统条已在 2026-10-14 修订中整条退役:入口收进本屏胶囊(多任务 / 回主屏),
|
|
73
|
+
* 非根屏的返回由各屏自己的页头承担。这样平台导航条不再长期占用应用的可视高度。
|
|
74
|
+
*/
|
|
75
|
+
import { computed } from 'vue'
|
|
76
|
+
import { useI18n } from 'vue-i18n'
|
|
77
|
+
import { useShellApps } from '../../composables/useShellApps'
|
|
78
|
+
import { useShellNavigation } from '../../composables/useShellNavigation'
|
|
79
|
+
import { useShellOverlays } from '../../composables/useShellOverlays'
|
|
80
|
+
import ShellAppIcon from '../ShellAppIcon.vue'
|
|
81
|
+
import ShellAppSurface from '../ShellAppSurface.vue'
|
|
82
|
+
|
|
83
|
+
const { t } = useI18n()
|
|
84
|
+
const nav = useShellNavigation()
|
|
85
|
+
const overlays = useShellOverlays()
|
|
86
|
+
const { getApp } = useShellApps()
|
|
87
|
+
|
|
88
|
+
const appId = computed(() => nav.params.value.appId ?? '')
|
|
89
|
+
const app = computed(() => getApp(appId.value))
|
|
90
|
+
</script>
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col h-full min-h-0">
|
|
3
|
+
<!-- ==================== 页头(带返回:系统宫格进入的屏,不是栈底) ==================== -->
|
|
4
|
+
<header class="flex items-center gap-2 px-2 pt-2 pb-1">
|
|
5
|
+
<button
|
|
6
|
+
type="button"
|
|
7
|
+
class="flex items-center justify-center rounded-[10px] min-w-[var(--mobile-touch-target-min)] min-h-[var(--mobile-touch-target-min)] transition-colors duration-200 active:bg-[var(--mobile-accent-muted)]"
|
|
8
|
+
:aria-label="t('shell.detail.back')"
|
|
9
|
+
@click="nav.back()"
|
|
10
|
+
>
|
|
11
|
+
<svg width="21" height="21" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
12
|
+
<path d="M15 6l-6 6 6 6" />
|
|
13
|
+
</svg>
|
|
14
|
+
</button>
|
|
15
|
+
<div class="flex-1 min-w-0">
|
|
16
|
+
<h1 class="text-[var(--font-size-lg)] font-semibold text-[var(--mobile-text-primary)] truncate">
|
|
17
|
+
{{ t('shell.apps.title') }}
|
|
18
|
+
</h1>
|
|
19
|
+
<p class="text-[var(--font-size-xs)] text-[var(--mobile-text-secondary)] truncate">
|
|
20
|
+
{{ t('shell.apps.subtitle', { installed: stats.installed, running: stats.running }) }}
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
</header>
|
|
24
|
+
|
|
25
|
+
<div class="flex-1 min-h-0 overflow-y-auto pb-6">
|
|
26
|
+
<!-- ==================== 统计条 ==================== -->
|
|
27
|
+
<!-- 单行指标条而非三张等宽卡片:三项指标同质,拆成三栏只会拉长竖向空间并显得像模板;
|
|
28
|
+
零值不再用 success 色——「0 个运行中」是中性事实,染绿会被误读为健康指示灯 -->
|
|
29
|
+
<div class="px-4 pb-1">
|
|
30
|
+
<div
|
|
31
|
+
class="flex items-center gap-2 rounded-[12px] border border-[var(--mobile-group-border)] bg-[var(--mobile-bg-card)] px-3.5 py-3"
|
|
32
|
+
:style="{ boxShadow: 'var(--mobile-card-shadow)' }"
|
|
33
|
+
>
|
|
34
|
+
<template v-for="(metric, index) in metrics" :key="metric.label">
|
|
35
|
+
<span v-if="index > 0" class="text-[var(--font-size-xs)] text-[var(--mobile-text-muted)]" aria-hidden="true">·</span>
|
|
36
|
+
<span class="flex items-baseline gap-1.5 min-w-0">
|
|
37
|
+
<b
|
|
38
|
+
class="text-[var(--font-size-base)] font-semibold tabular-nums"
|
|
39
|
+
:style="{ color: metric.highlight ? 'var(--mobile-success)' : 'var(--mobile-text-primary)' }"
|
|
40
|
+
>
|
|
41
|
+
{{ metric.value }}
|
|
42
|
+
</b>
|
|
43
|
+
<span class="text-[var(--font-size-xs)] text-[var(--mobile-text-secondary)] truncate">
|
|
44
|
+
{{ metric.label }}
|
|
45
|
+
</span>
|
|
46
|
+
</span>
|
|
47
|
+
</template>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<!-- ==================== 已安装列表 ==================== -->
|
|
52
|
+
<ShellSection :title="t('shell.apps.installedTitle')" />
|
|
53
|
+
<div class="px-4 pb-1">
|
|
54
|
+
<ShellGroupCard v-if="sortedApps.length > 0">
|
|
55
|
+
<button
|
|
56
|
+
v-for="app in sortedApps"
|
|
57
|
+
:key="app.id"
|
|
58
|
+
type="button"
|
|
59
|
+
class="flex items-center gap-3 w-full px-3 py-3 text-left transition-colors duration-200 active:bg-[var(--mobile-group-row-active)] min-h-[var(--mobile-touch-target-min)]"
|
|
60
|
+
@click="nav.openDetail(app.id)"
|
|
61
|
+
>
|
|
62
|
+
<ShellAppIcon :app="app" :size="40" />
|
|
63
|
+
<span class="flex-1 min-w-0">
|
|
64
|
+
<span class="flex items-center gap-1.5">
|
|
65
|
+
<b class="text-[var(--font-size-base)] text-[var(--mobile-text-primary)] truncate">{{ app.name }}</b>
|
|
66
|
+
<ShellChip v-if="app.official" :label="t('shell.detail.official')" tone="accent" />
|
|
67
|
+
<ShellChip
|
|
68
|
+
v-if="app.state === 'running'"
|
|
69
|
+
:label="t('shell.common.running')"
|
|
70
|
+
tone="success"
|
|
71
|
+
/>
|
|
72
|
+
<ShellChip
|
|
73
|
+
v-else-if="app.state === 'disabled'"
|
|
74
|
+
:label="t('shell.common.disabled')"
|
|
75
|
+
tone="neutral"
|
|
76
|
+
/>
|
|
77
|
+
<ShellChip
|
|
78
|
+
v-else-if="app.state === 'error'"
|
|
79
|
+
:label="t('shell.common.error')"
|
|
80
|
+
tone="danger"
|
|
81
|
+
/>
|
|
82
|
+
</span>
|
|
83
|
+
<span class="block text-[var(--font-size-xs)] text-[var(--mobile-text-secondary)] truncate">
|
|
84
|
+
{{ appMeta(app) }}
|
|
85
|
+
</span>
|
|
86
|
+
</span>
|
|
87
|
+
<svg class="flex-shrink-0" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" :style="{ color: 'var(--mobile-text-secondary)' }">
|
|
88
|
+
<path d="M9 6l6 6-6 6" />
|
|
89
|
+
</svg>
|
|
90
|
+
</button>
|
|
91
|
+
</ShellGroupCard>
|
|
92
|
+
<p
|
|
93
|
+
v-else
|
|
94
|
+
class="rounded-[12px] border border-dashed border-[var(--mobile-border-hover)] px-3 py-5 text-center text-[var(--font-size-xs)] text-[var(--mobile-text-secondary)]"
|
|
95
|
+
>
|
|
96
|
+
{{ t('shell.apps.empty') }}
|
|
97
|
+
</p>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<!-- ==================== 添加应用(按数据源能力渲染) ==================== -->
|
|
101
|
+
<ShellSection v-if="canInstall" :title="t('shell.apps.addTitle')" />
|
|
102
|
+
<div v-if="canInstall" class="px-4 pb-2">
|
|
103
|
+
<ShellGroupCard>
|
|
104
|
+
<button
|
|
105
|
+
type="button"
|
|
106
|
+
class="flex items-center gap-3 w-full px-3 py-3 text-left transition-colors duration-200 active:bg-[var(--mobile-group-row-active)] min-h-[var(--mobile-touch-target-min)]"
|
|
107
|
+
:disabled="installing"
|
|
108
|
+
@click="handleInstall"
|
|
109
|
+
>
|
|
110
|
+
<svg class="flex-shrink-0" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" :style="{ color: 'var(--mobile-text-secondary)' }">
|
|
111
|
+
<path d="M12 3v12" />
|
|
112
|
+
<path d="M7 10l5 5 5-5" />
|
|
113
|
+
<path d="M4 21h16" />
|
|
114
|
+
</svg>
|
|
115
|
+
<span class="flex-1 text-[var(--font-size-base)] text-[var(--mobile-text-primary)]">
|
|
116
|
+
{{ t('shell.apps.installLocal') }}
|
|
117
|
+
</span>
|
|
118
|
+
<span class="flex-shrink-0 text-[var(--font-size-xs)]" :style="{ color: 'var(--mobile-warning)' }">
|
|
119
|
+
{{ installing ? t('shell.common.loading') : t('shell.apps.installLocalHint') }}
|
|
120
|
+
</span>
|
|
121
|
+
</button>
|
|
122
|
+
</ShellGroupCard>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
</template>
|
|
127
|
+
|
|
128
|
+
<script setup lang="ts">
|
|
129
|
+
/**
|
|
130
|
+
* WASM 应用管理
|
|
131
|
+
*
|
|
132
|
+
* 列表只展示平台掌握的事实(版本 / 权限项数 / 数据占用),不猜测应用内部状态。
|
|
133
|
+
* 「添加应用」按数据源能力渲染:没有安装能力的形态不会出现点了没反应的按钮。
|
|
134
|
+
*/
|
|
135
|
+
import { computed, ref } from 'vue'
|
|
136
|
+
import { useI18n } from 'vue-i18n'
|
|
137
|
+
import { useToast } from '../../composables/useToast'
|
|
138
|
+
import { useShellApps } from '../../composables/useShellApps'
|
|
139
|
+
import { useShellNavigation } from '../../composables/useShellNavigation'
|
|
140
|
+
import type { ShellApp } from '../../types'
|
|
141
|
+
import { formatBytes } from '../../utils'
|
|
142
|
+
import ShellAppIcon from '../ShellAppIcon.vue'
|
|
143
|
+
import ShellChip from '../ShellChip.vue'
|
|
144
|
+
import ShellGroupCard from '../ShellGroupCard.vue'
|
|
145
|
+
import ShellSection from '../ShellSection.vue'
|
|
146
|
+
|
|
147
|
+
const { t } = useI18n()
|
|
148
|
+
const toast = useToast()
|
|
149
|
+
const nav = useShellNavigation()
|
|
150
|
+
const { sortedApps, stats, supportsInstall, installFromLocalPackage, refresh } = useShellApps()
|
|
151
|
+
|
|
152
|
+
const installing = ref(false)
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* 安装能力是「是否有数据源支持」的派生值,做成 computed 而不是在模板里
|
|
156
|
+
* 直接放函数引用——放函数引用的 v-if 恒为真(函数本身永远存在)。
|
|
157
|
+
*/
|
|
158
|
+
const canInstall = computed(() => supportsInstall())
|
|
159
|
+
|
|
160
|
+
/** 总占用:任一应用未统计时显示「—」,不把缺失值当 0 累加成假数字 */
|
|
161
|
+
const totalSizeLabel = computed(() =>
|
|
162
|
+
stats.value.totalBytes === undefined ? t('shell.common.na') : formatBytes(stats.value.totalBytes),
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
/** 指标条数据项(单行展示,与顶部副标题不再重复计数——副标题只说“本机共几个”) */
|
|
166
|
+
const metrics = computed(() => [
|
|
167
|
+
{ value: String(stats.value.installed), label: t('shell.apps.statInstalled'), highlight: false },
|
|
168
|
+
{ value: String(stats.value.running), label: t('shell.apps.statRunning'), highlight: stats.value.running > 0 },
|
|
169
|
+
{ value: totalSizeLabel.value, label: t('shell.apps.statSize'), highlight: false },
|
|
170
|
+
])
|
|
171
|
+
|
|
172
|
+
/** 列表副标题:版本 · 权限项数 · 数据占用 */
|
|
173
|
+
function appMeta(app: ShellApp): string {
|
|
174
|
+
const parts = [app.version ? `v${app.version}` : '']
|
|
175
|
+
parts.push(t('shell.apps.permissionCount', { count: app.permissions.length }))
|
|
176
|
+
parts.push(formatBytes(app.sizeBytes))
|
|
177
|
+
return parts.filter(Boolean).join(' · ')
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
async function handleInstall(): Promise<void> {
|
|
181
|
+
installing.value = true
|
|
182
|
+
try {
|
|
183
|
+
const installedId = await installFromLocalPackage()
|
|
184
|
+
// 取消选包不是失败,不弹错误
|
|
185
|
+
if (installedId !== null) {
|
|
186
|
+
toast.success(t('shell.apps.installSuccess'))
|
|
187
|
+
await refresh()
|
|
188
|
+
}
|
|
189
|
+
} catch (e) {
|
|
190
|
+
toast.error(t('shell.apps.installFailed', { error: e instanceof Error ? e.message : String(e) }))
|
|
191
|
+
} finally {
|
|
192
|
+
installing.value = false
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
</script>
|