97 lines
2.9 KiB
Vue
97 lines
2.9 KiB
Vue
<script>
|
|
/**
|
|
* 云服务器列表入口:校验动态菜单参数 m 为正的安全整数,然后把云服务器模块组与菜单 ID 交给 HostList。错误参数显示提示,不静默展示其他分组。
|
|
*/
|
|
import "~/assets/styles/PaymentDialog.BNFKQF1U.css";
|
|
import "~/assets/styles/OsIcon.CAi4Iz2S.css";
|
|
import "~/assets/styles/HostList.B3U15sJm.css";
|
|
import { createBlock } from "vue";
|
|
import { withCtx } from "vue";
|
|
import { computed } from "vue";
|
|
import { createTextVNode } from "vue";
|
|
import { unref } from "vue";
|
|
import { defineComponent } from "vue";
|
|
import { createVNode } from "vue";
|
|
import { openBlock } from "vue";
|
|
import { useRoute } from "#app";
|
|
import { NuxtLink } from "#components";
|
|
import button from "primevue/button";
|
|
import message from "primevue/message";
|
|
import { t as modules_t } from "~/lib/modules.js";
|
|
import HostList from "~/components/HostList.vue";
|
|
var m = defineComponent({
|
|
__name: `index`,
|
|
setup(a) {
|
|
let m = useRoute(),
|
|
h = computed(() =>
|
|
/^\d+$/.test(String(m.query.m ?? ``)) &&
|
|
Number.isSafeInteger(Number(m.query.m)) &&
|
|
Number(m.query.m) > 0
|
|
? Number(m.query.m)
|
|
: void 0,
|
|
);
|
|
// m 参数非法时只呈现错误;有效时复用 HostList,menu-id 变化通过 key 重建列表状态。
|
|
return (n, a) => {
|
|
let c = message,
|
|
g = button,
|
|
_ = NuxtLink,
|
|
v = HostList;
|
|
return unref(m).query.m !== void 0 && !unref(h)
|
|
? (openBlock(),
|
|
createBlock(
|
|
c,
|
|
{
|
|
key: 0,
|
|
severity: `error`,
|
|
closable: !1,
|
|
},
|
|
{
|
|
default: withCtx(() => [
|
|
...(a[0] ||= [createTextVNode(`服务器导航参数无效`, -1)]),
|
|
]),
|
|
_: 1,
|
|
},
|
|
))
|
|
: (openBlock(),
|
|
createBlock(
|
|
v,
|
|
{
|
|
key: unref(h) ?? `default`,
|
|
"menu-id": unref(h),
|
|
modules: (`SERVER_MODULE_GROUPS` in n
|
|
? n.SERVER_MODULE_GROUPS
|
|
: unref(modules_t)
|
|
).cloud,
|
|
title: `云服务器`,
|
|
description: `管理你的云服务器实例`,
|
|
},
|
|
{
|
|
actions: withCtx(() => [
|
|
createVNode(
|
|
_,
|
|
{
|
|
to: `/products`,
|
|
},
|
|
{
|
|
default: withCtx(() => [
|
|
createVNode(g, {
|
|
label: `订购云服务器`,
|
|
icon: `pi pi-plus`,
|
|
}),
|
|
]),
|
|
_: 1,
|
|
},
|
|
),
|
|
]),
|
|
_: 1,
|
|
},
|
|
8,
|
|
[`menu-id`, `modules`],
|
|
));
|
|
};
|
|
},
|
|
});
|
|
export {};
|
|
export default m;
|
|
</script>
|