feat(应用管理): 添加 APM 可用性检查并调整相关逻辑

当 APM 不可用时,自动切换到 Spark 应用管理
禁用 APM 软件标签页的切换按钮
移除侧边栏中 APM 可用性检查的冗余条件
This commit is contained in:
2026-04-05 22:48:19 +08:00
parent f7424ba4a7
commit 593cb8ea75
3 changed files with 8 additions and 1 deletions

View File

@@ -119,6 +119,7 @@
:error="installedError" :error="installedError"
:active-origin="activeInstalledOrigin" :active-origin="activeInstalledOrigin"
:store-filter="storeFilter" :store-filter="storeFilter"
:apm-available="apmAvailable"
@close="closeInstalledModal" @close="closeInstalledModal"
@refresh="refreshInstalledApps" @refresh="refreshInstalledApps"
@uninstall="uninstallInstalledApp" @uninstall="uninstallInstalledApp"
@@ -885,6 +886,10 @@ const upgradeSelectedApps = async () => {
const openInstalledModal = () => { const openInstalledModal = () => {
showInstalledModal.value = true; showInstalledModal.value = true;
// 如果没有 APM 可用,默认切换到 Spark 应用管理
if (!apmAvailable.value && activeInstalledOrigin.value === "apm") {
activeInstalledOrigin.value = "spark";
}
refreshInstalledApps(); refreshInstalledApps();
}; };

View File

@@ -89,7 +89,7 @@
<div class="border-t border-slate-200 pt-4 dark:border-slate-800"> <div class="border-t border-slate-200 pt-4 dark:border-slate-800">
<button <button
v-if="apmAvailable && storeFilter !== 'spark'" v-if="storeFilter !== 'spark'"
type="button" type="button"
class="flex w-full items-center gap-3 rounded-2xl border border-transparent px-4 py-3 text-left text-sm font-medium text-slate-600 transition hover:border-brand/30 hover:bg-brand/5 hover:text-brand focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/40 dark:text-slate-300 dark:hover:bg-slate-800" class="flex w-full items-center gap-3 rounded-2xl border border-transparent px-4 py-3 text-left text-sm font-medium text-slate-600 transition hover:border-brand/30 hover:bg-brand/5 hover:text-brand focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/40 dark:text-slate-300 dark:hover:bg-slate-800"
@click="$emit('list')" @click="$emit('list')"

View File

@@ -39,6 +39,7 @@
? 'bg-brand/10 text-brand dark:bg-brand/15' ? 'bg-brand/10 text-brand dark:bg-brand/15'
: 'text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200' : 'text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200'
" "
:disabled="!apmAvailable"
@click="$emit('switch-origin', 'apm')" @click="$emit('switch-origin', 'apm')"
> >
APM 软件 APM 软件
@@ -183,6 +184,7 @@ defineProps<{
error: string; error: string;
activeOrigin: "apm" | "spark"; activeOrigin: "apm" | "spark";
storeFilter: "spark" | "apm" | "both"; storeFilter: "spark" | "apm" | "both";
apmAvailable: boolean;
}>(); }>();
defineEmits<{ defineEmits<{