Files

2117 lines
113 KiB
Vue

<script>
/** 旧财务独立服务器详情的展示适配层;原始 data/加载状态由父级提供,不据此宣称支持统一电源控制。 */
import "~/assets/styles/LegacyDcimActions.DcIrQby6.css";
import "~/assets/styles/InstanceLoadingShell.CwfiUwdU.css";
import "~/assets/styles/LegacyProductUpgrade.dzWGwGgY.css";
import "~/assets/styles/RemfUpgrade.4stQ5ASH.css";
import "~/assets/styles/PaymentDialog.BNFKQF1U.css";
import "~/assets/styles/OsIcon.CAi4Iz2S.css";
import "~/assets/styles/LegacyDcimManage.5YRq508t.css";
import { toDisplayString } from "vue";
import { renderList } from "vue";
import { onBeforeUnmount } from "vue";
import { mergeModels } from "vue";
import { useModel } from "vue";
import { watch } from "vue";
import { defineAsyncComponent } from "vue";
import { createBlock } from "vue";
import { ref } from "vue";
import { withCtx } from "vue";
import { createCommentVNode } from "vue";
import { computed } from "vue";
import { isRef } from "vue";
import { createElementBlock } from "vue";
import { Fragment } from "vue";
import { createElementVNode } from "vue";
import { createTextVNode } from "vue";
import { unref } from "vue";
import { defineComponent } from "vue";
import { createVNode } from "vue";
import { openBlock } from "vue";
import { loadModule } from "~/utils/load-module.js";
import dialog from "primevue/dialog";
import button from "primevue/button";
import { t as _plugin_vue_export_helper_t } from "~/lib/_plugin-vue_export-helper.js";
import message from "primevue/message";
import { r as dict_r } from "~/lib/dict.js";
import OsIcon from "~/components/OsIcon.vue";
import PaymentDialog from "~/components/PaymentDialog.vue";
import { t as os_name_t } from "~/lib/os-name.js";
import { t as configuration_display_t } from "~/lib/configuration-display.js";
import RemfUpgrade from "~/components/instance/RemfUpgrade.vue";
import LegacyProductUpgrade from "~/components/instance/LegacyProductUpgrade.vue";
import InstanceLoadingShell from "~/components/instance/InstanceLoadingShell.vue";
import InstanceStatusTag from "~/components/instance/InstanceStatusTag.vue";
import tabs from "primevue/tabs";
import tabpanels from "primevue/tabpanels";
import tabpanel from "primevue/tabpanel";
import progressbar from "primevue/progressbar";
import tablist from "primevue/tablist";
import tab from "primevue/tab";
import LegacyDcimActions from "~/components/instance/LegacyDcimActions.vue";
function T(e) {
if (typeof e == `string`)
try {
return T(JSON.parse(e));
} catch {
return {};
}
return e && typeof e == `object` && !Array.isArray(e) ? e : {};
}
function E(e) {
if (typeof e == `string`)
try {
return E(JSON.parse(e));
} catch {
return [];
}
return Array.isArray(e)
? e.filter((e) => e && typeof e == `object` && !Array.isArray(e)).map(T)
: [];
}
function D(e) {
return typeof e == `string` || typeof e == `number` ? String(e) : ``;
}
function O(e) {
return (
e === !0 || e === 1 || [`1`, `on`, `true`].includes(D(e).toLowerCase())
);
}
function k(e) {
if (e == null || e === `` || typeof e == `boolean`) return null;
let t = Number(e);
return Number.isFinite(t) && t >= 0 ? t : null;
}
function A(e) {
// 旧协议可能把对象/数组包成 JSON 文本,归一化后提取 IP、系统、可见自定义字段与流量。
// 总流量为 0 明确表示不限量,缺少字段则保留 null,不能混成“已用 0”。
let t = T(e),
n = T(t.host_data),
r = T(t.dcim),
i = E(t.config_options)
.map((e, t) => ({
key: `config:${D(e.id) || t}:${t}`,
name: D(e.name),
value: D(e.sub_name),
type: D(e.option_type),
}))
.filter((e) => e.name || e.value),
a = (e) => i.find((t) => Number(t.type) === e)?.value || ``,
o = (...e) => i.find((t) => e.includes(t.name.trim()))?.value || ``,
s = n.assignedips;
if (typeof s == `string`)
try {
s = JSON.parse(s);
} catch {}
let c = D(n.dedicatedip).trim(),
l = [
...new Set(
[c, ...(Array.isArray(s) ? s.map(D) : D(s).split(/[\s,;]+/))]
.map((e) => e.trim())
.filter(Boolean),
),
],
u = k(n.bwlimit),
d = k(n.bwusage),
f = D(n.bwunit).toUpperCase();
return {
ip: c || l[0] || ``,
ips: l,
username: D(n.username),
password: D(n.password),
port: D(n.port),
os: D(n.os) || a(5) || o(`操作系统`),
region: D(r.area_name) || a(12) || o(`区域`, `机房`, `数据中心`),
spec:
o(`硬件配置`) ||
[a(6) || o(`CPU`, `处理器`), a(8) || o(`内存`)]
.filter(Boolean)
.join(` | `),
bandwidth: a(18) || a(10) || o(`带宽`, `上行带宽`),
config: i,
customFields: E(t.custom_field_data).flatMap((e, t) =>
O(e.showdetail) && D(e.fieldname)
? [
{
key: `custom:${t}`,
name: D(e.fieldname),
value: D(e.value),
},
]
: [],
),
traffic: {
visible: O(n.show_traffic_usage ?? t.show_traffic_usage),
total: u,
used: d,
unit: [`B`, `KB`, `MB`, `GB`, `TB`].includes(f) ? f : `GB`,
unlimited: u === 0,
remaining: u !== null && u > 0 && d !== null ? Math.max(0, u - d) : null,
percent:
u !== null && u > 0 && d !== null ? Math.min(100, (d / u) * 100) : null,
},
};
}
var j = defineAsyncComponent(() =>
loadModule(
() =>
import("~/components/instance/DcimMonitor.vue").then(
(e) => e.default || e,
),
[],
import.meta.url,
),
),
M = defineAsyncComponent(() =>
loadModule(
() =>
import("~/components/instance/DcimBilling.vue").then(
(e) => e.default || e,
),
[],
import.meta.url,
),
),
N = defineAsyncComponent(() =>
loadModule(
() =>
import("~/components/mfcloud/MfCloudLogs.vue").then(
(e) => e.default || e,
),
[],
import.meta.url,
),
),
P = {
class: `legacy-dcim-manage`,
},
F = {
key: 0,
class: `overview`,
},
I = {
class: `stack`,
},
L = {
class: `card`,
},
_e = {
key: 0,
class: `resource-list`,
},
ve = {
key: 1,
class: `muted`,
},
ye = {
class: `stack`,
},
be = {
class: `card`,
},
xe = {
class: `os`,
},
Se = {
class: `compact-rows`,
},
Ce = {
class: `mono`,
},
we = {
key: 0,
class: `card`,
},
Te = {
class: `flow-used`,
},
Ee = {
class: `compact-rows`,
},
De = {
class: `stack`,
},
Oe = {
class: `card`,
},
ke = {
class: `compact-rows`,
},
Ae = {
class: `card`,
},
je = {
class: `compact-rows`,
},
Me = {
key: 0,
},
Ne = {
class: `mono`,
},
Pe = {
key: 0,
class: `detail-content`,
},
R = {
class: `rows`,
},
Fe = {
class: `mono`,
},
Ie = {
class: `mono`,
},
Le = {
key: 0,
class: `detail-content`,
},
Re = {
class: `rows`,
},
ze = {
key: 0,
},
Be = {
class: `ip-list`,
},
Ve = {
key: 0,
},
He = {
class: `rows`,
},
Ue = {
key: 0,
},
We = {
class: `usage`,
},
z = Object.assign(
_plugin_vue_export_helper_t(
defineComponent({
__name: `LegacyDcimManage`,
props: mergeModels(
{
hostId: {},
host: {},
data: {},
loading: {
type: Boolean,
},
error: {},
busy: {
type: Boolean,
},
productState: {},
},
{
tab: {
default: `overview`,
},
tabModifiers: {},
},
),
emits: mergeModels(
[`refresh`, `renew`, `presentation`],
[`update:tab`],
),
setup(r, { emit: o }) {
let v = r,
x = o,
S = useModel(r, `tab`),
T = [
{
value: `overview`,
label: `概要`,
},
{
value: `monitor`,
label: `监控`,
},
{
value: `access`,
label: `访问控制`,
},
{
value: `network`,
label: `网络与流量`,
},
{
value: `billing`,
label: `计费`,
},
{
value: `log`,
label: `日志`,
},
],
E = computed(() => A(v.data)),
D = computed(() => v.host.status === `Active`),
O = computed(
() =>
v.loading ||
!!v.error ||
v.busy ||
!v.data ||
!D.value ||
String(v.host.id) !== v.hostId,
),
k = ref(!1),
z = ref(``),
B = ref(``),
V = ref(!1),
H = ref(!1),
U = ref(null),
W = ref(``),
G = ref(null),
K = ref(null),
q = computed(() => G.value?.busy || K.value?.busy || !1);
function J(e) {
((V.value = !1),
(U.value = e.order_id),
(W.value = e.amount),
(H.value = !0));
}
let Y = 0,
X = !1;
async function Z(e, t) {
// 剪贴板异步完成时核对实例与请求序号,避免在切换详情后显示上一实例复制成功。
if (!e) return;
let n = ++Y,
r = v.hostId;
try {
if (
(await navigator.clipboard.writeText(e),
X || n !== Y || r !== v.hostId)
)
return;
((z.value = t), (B.value = ``));
} catch {
!X &&
n === Y &&
r === v.hostId &&
(B.value = `复制失败,请手动选择并复制内容`);
}
}
function Q(e) {
return e === null
? `未提供`
: `${e.toLocaleString(`zh-CN`, {
maximumFractionDigits: 2,
})}${E.value.traffic.unit ? ` ${E.value.traffic.unit}` : ``}`;
}
return (
watch(
S,
(e) => {
T.some((t) => t.value === e) || (S.value = `overview`);
},
{
immediate: !0,
},
),
watch(
() => v.hostId,
() => {
(Y++, (k.value = !1), (z.value = ``), (B.value = ``));
},
{
flush: `sync`,
},
),
watch(
() => E.value.password,
() => {
((k.value = !1), (z.value = ``));
},
),
watch(
E,
(e) =>
x(`presentation`, {
region: e.region,
spec: e.spec,
ip: e.ip,
power: ``,
control: !1,
}),
{
immediate: !0,
},
),
onBeforeUnmount(() => {
((X = !0), Y++);
}),
(n, i) => {
let a = button,
o = message,
c = InstanceLoadingShell,
d = tab,
v = tablist,
A = OsIcon,
Y = progressbar,
X = InstanceStatusTag,
$ = tabpanel,
Ge = j,
Ke = LegacyDcimActions,
qe = M,
Je = N,
Ye = tabpanels,
Xe = tabs,
Ze = RemfUpgrade,
Qe = LegacyProductUpgrade,
$e = dialog,
et = PaymentDialog;
return (
openBlock(),
createElementBlock(`div`, P, [
r.error
? (openBlock(),
createBlock(
o,
{
key: 0,
severity: `error`,
closable: !1,
},
{
default: withCtx(() => [
createTextVNode(toDisplayString(r.error), 1),
createVNode(
a,
{
label: `重试`,
text: ``,
size: `small`,
loading: r.loading,
onClick: (i[0] ||= (e) => x(`refresh`)),
},
null,
8,
[`loading`],
),
]),
_: 1,
},
))
: createCommentVNode(``, !0),
!r.data && r.loading
? (openBlock(),
createBlock(c, {
key: 1,
dcim: ``,
}))
: (openBlock(),
createBlock(
Xe,
{
key: 2,
value: S.value,
"onUpdate:value": (i[16] ||= (e) => (S.value = e)),
lazy: ``,
},
{
default: withCtx(() => [
createVNode(v, null, {
default: withCtx(() => [
(openBlock(),
createElementBlock(
Fragment,
null,
renderList(T, (t) =>
createVNode(
d,
{
key: t.value,
value: t.value,
},
{
default: withCtx(() => [
createTextVNode(
toDisplayString(t.label),
1,
),
]),
_: 2,
},
1032,
[`value`],
),
),
64,
)),
]),
_: 1,
}),
createVNode(Ye, null, {
default: withCtx(() => [
!unref(D) && S.value !== `billing`
? (openBlock(),
createBlock(
o,
{
key: 0,
severity: `info`,
closable: !1,
},
{
default: withCtx(() => [
...(i[20] ||= [
createTextVNode(
`实例尚未开通或当前不可用,管理信息将在服务恢复后显示。`,
-1,
),
]),
]),
_: 1,
},
))
: !r.data && !r.error && S.value !== `billing`
? (openBlock(),
createBlock(
o,
{
key: 1,
severity: `info`,
closable: !1,
},
{
default: withCtx(() => [
(i[21] ||= createTextVNode(
`暂无实例管理信息。`,
-1,
)),
createVNode(a, {
label: `重新加载`,
text: ``,
size: `small`,
onClick: (i[1] ||= (e) =>
x(`refresh`)),
}),
]),
_: 1,
},
))
: createCommentVNode(``, !0),
createVNode(
$,
{
value: `overview`,
},
{
default: withCtx(() => [
unref(D) && r.data
? (openBlock(),
createElementBlock(`div`, F, [
createElementVNode(`div`, I, [
createElementVNode(`section`, L, [
(i[22] ||= createElementVNode(
`h3`,
null,
`配置信息`,
-1,
)),
unref(E).config.length ||
unref(E).customFields.length
? (openBlock(),
createElementBlock(
`dl`,
_e,
[
(openBlock(!0),
createElementBlock(
Fragment,
null,
renderList(
unref(E).config,
(t) => (
openBlock(),
createElementBlock(
`div`,
{
key: t.key,
},
[
createElementVNode(
`dt`,
null,
toDisplayString(
unref(
configuration_display_t,
)(
t.name,
t.type,
) ||
`配置`,
),
1,
),
createElementVNode(
`dd`,
null,
toDisplayString(
Number(
t.type,
) === 5
? unref(
os_name_t,
)(
t.value,
)
: t.value ||
`—`,
),
1,
),
],
)
),
),
128,
)),
(openBlock(!0),
createElementBlock(
Fragment,
null,
renderList(
unref(E)
.customFields,
(t) => (
openBlock(),
createElementBlock(
`div`,
{
key: t.key,
},
[
createElementVNode(
`dt`,
null,
toDisplayString(
t.name,
),
1,
),
createElementVNode(
`dd`,
null,
toDisplayString(
t.value ||
`—`,
),
1,
),
],
)
),
),
128,
)),
],
))
: (openBlock(),
createElementBlock(
`p`,
ve,
`暂无配置信息`,
)),
]),
]),
createElementVNode(`div`, ye, [
createElementVNode(
`section`,
be,
[
createElementVNode(
`h3`,
null,
[
createElementVNode(
`button`,
{
class: `card-title`,
onClick: (i[2] ||= (
e,
) =>
(S.value = `access`)),
},
[
...(i[23] ||= [
createTextVNode(
`访问`,
-1,
),
createElementVNode(
`i`,
{
class: `pi pi-angle-right`,
"aria-hidden": `true`,
},
null,
-1,
),
]),
],
),
],
),
createElementVNode(
`div`,
xe,
[
createVNode(
A,
{
name: unref(E).os,
size: 56,
},
null,
8,
[`name`],
),
createElementVNode(
`strong`,
null,
toDisplayString(
unref(os_name_t)(
unref(E).os,
) || `操作系统未提供`,
),
1,
),
],
),
createElementVNode(`dl`, Se, [
createElementVNode(
`div`,
null,
[
(i[24] ||=
createElementVNode(
`dt`,
null,
`IP 地址`,
-1,
)),
createElementVNode(
`dd`,
null,
[
createElementVNode(
`span`,
Ce,
toDisplayString(
unref(E).ip ||
`—`,
),
1,
),
unref(E).ip
? (openBlock(),
createBlock(
a,
{
key: 0,
icon:
unref(
z,
) === `ip`
? `pi pi-check`
: `pi pi-copy`,
"aria-label": `复制 IP 地址`,
text: ``,
size: `small`,
onClick:
(i[3] ||=
(e) =>
Z(
unref(
E,
)
.ip,
`ip`,
)),
},
null,
8,
[`icon`],
))
: createCommentVNode(
``,
!0,
),
],
),
],
),
createElementVNode(
`div`,
null,
[
(i[25] ||=
createElementVNode(
`dt`,
null,
`用户名`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
unref(E).username ||
`未提供`,
),
1,
),
],
),
createElementVNode(
`div`,
null,
[
(i[26] ||=
createElementVNode(
`dt`,
null,
`连接端口`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
unref(E).port ||
`未提供`,
),
1,
),
],
),
]),
createVNode(a, {
label: `查看访问信息`,
icon: `pi pi-angle-right`,
outlined: ``,
class: `card-bottom`,
onClick: (i[4] ||= (e) =>
(S.value = `access`)),
}),
],
),
unref(E).traffic.visible
? (openBlock(),
createElementBlock(
`section`,
we,
[
createElementVNode(
`h3`,
null,
[
createElementVNode(
`button`,
{
class: `card-title`,
onClick: (i[5] ||=
(e) =>
(S.value = `network`)),
},
[
...(i[27] ||= [
createTextVNode(
`流量`,
-1,
),
createElementVNode(
`i`,
{
class: `pi pi-angle-right`,
"aria-hidden": `true`,
},
null,
-1,
),
]),
],
),
],
),
unref(E).traffic
.percent === null
? createCommentVNode(
``,
!0,
)
: (openBlock(),
createBlock(
Y,
{
key: 0,
value:
unref(E).traffic
.percent,
"show-value": !1,
},
null,
8,
[`value`],
)),
createElementVNode(
`p`,
Te,
`已用流量 ` +
toDisplayString(
Q(
unref(E).traffic
.used,
),
),
1,
),
createElementVNode(
`dl`,
Ee,
[
createElementVNode(
`div`,
null,
[
(i[28] ||=
createElementVNode(
`dt`,
null,
`总流量`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
unref(E)
.traffic
.unlimited
? `不限`
: Q(
unref(E)
.traffic
.total,
),
),
1,
),
],
),
createElementVNode(
`div`,
null,
[
(i[29] ||=
createElementVNode(
`dt`,
null,
`剩余流量`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
unref(E)
.traffic
.unlimited
? `不限`
: Q(
unref(E)
.traffic
.remaining,
),
),
1,
),
],
),
],
),
],
))
: createCommentVNode(``, !0),
]),
createElementVNode(`div`, De, [
createElementVNode(
`section`,
Oe,
[
createElementVNode(
`h3`,
null,
[
createElementVNode(
`button`,
{
class: `card-title`,
onClick: (i[6] ||= (
e,
) =>
(S.value = `billing`)),
},
[
...(i[30] ||= [
createTextVNode(
`计费`,
-1,
),
createElementVNode(
`i`,
{
class: `pi pi-angle-right`,
"aria-hidden": `true`,
},
null,
-1,
),
]),
],
),
],
),
createElementVNode(`dl`, ke, [
createElementVNode(
`div`,
null,
[
(i[31] ||=
createElementVNode(
`dt`,
null,
`计费方式`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
r.host
.billing_cycle_name ||
r.host
.billing_cycle ||
`—`,
),
1,
),
],
),
createElementVNode(
`div`,
null,
[
(i[32] ||=
createElementVNode(
`dt`,
null,
`产品状态`,
-1,
)),
createElementVNode(
`dd`,
null,
[
createVNode(
X,
{
state:
r.productState,
lifecycle:
r.host.status,
},
null,
8,
[
`state`,
`lifecycle`,
],
),
],
),
],
),
createElementVNode(
`div`,
null,
[
(i[33] ||=
createElementVNode(
`dt`,
null,
`续费金额`,
-1,
)),
createElementVNode(
`dd`,
null,
[
createElementVNode(
`strong`,
null,
`¥` +
toDisplayString(
r.host
.renew_amount,
),
1,
),
],
),
],
),
createElementVNode(
`div`,
null,
[
(i[34] ||=
createElementVNode(
`dt`,
null,
`到期时间`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
(`formatTime` in n
? n.formatTime
: unref(dict_r))(
r.host.due_time,
),
),
1,
),
],
),
]),
createVNode(
a,
{
label: `续费`,
icon: `pi pi-wallet`,
class: `card-bottom`,
disabled:
!!r.host
.renew_forbidden,
onClick: (i[7] ||= (e) =>
x(`renew`)),
},
null,
8,
[`disabled`],
),
],
),
createElementVNode(
`section`,
Ae,
[
createElementVNode(
`h3`,
null,
[
createElementVNode(
`button`,
{
class: `card-title`,
onClick: (i[8] ||= (
e,
) =>
(S.value = `network`)),
},
[
...(i[35] ||= [
createTextVNode(
`网络`,
-1,
),
createElementVNode(
`i`,
{
class: `pi pi-angle-right`,
"aria-hidden": `true`,
},
null,
-1,
),
]),
],
),
],
),
createElementVNode(`dl`, je, [
createElementVNode(
`div`,
null,
[
(i[36] ||=
createElementVNode(
`dt`,
null,
`区域`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
unref(E).region ||
`未提供`,
),
1,
),
],
),
unref(E).bandwidth
? (openBlock(),
createElementBlock(
`div`,
Me,
[
(i[37] ||=
createElementVNode(
`dt`,
null,
`带宽上限`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
unref(E)
.bandwidth,
),
1,
),
],
))
: createCommentVNode(
``,
!0,
),
createElementVNode(
`div`,
null,
[
(i[38] ||=
createElementVNode(
`dt`,
null,
`主 IP 地址`,
-1,
)),
createElementVNode(
`dd`,
Ne,
toDisplayString(
unref(E).ip ||
`未提供`,
),
1,
),
],
),
createElementVNode(
`div`,
null,
[
(i[39] ||=
createElementVNode(
`dt`,
null,
`IP 地址数量`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
unref(E).ips
.length ||
`未提供`,
),
1,
),
],
),
]),
createVNode(a, {
label: `查看网络与流量`,
icon: `pi pi-angle-right`,
outlined: ``,
class: `card-bottom`,
onClick: (i[9] ||= (e) =>
(S.value = `network`)),
}),
],
),
]),
]))
: createCommentVNode(``, !0),
]),
_: 1,
},
),
createVNode(
$,
{
value: `monitor`,
},
{
default: withCtx(() => [
unref(D) &&
r.data &&
S.value === `monitor`
? (openBlock(),
createBlock(
Ge,
{
key: 0,
"host-id": r.hostId,
module: `remf_finance_dcim`,
},
null,
8,
[`host-id`],
))
: createCommentVNode(``, !0),
]),
_: 1,
},
),
createVNode(
$,
{
value: `access`,
},
{
default: withCtx(() => [
unref(D) && r.data
? (openBlock(),
createElementBlock(`div`, Pe, [
(i[45] ||= createElementVNode(
`h3`,
null,
`访问信息`,
-1,
)),
createElementVNode(`dl`, R, [
createElementVNode(`div`, null, [
(i[40] ||= createElementVNode(
`dt`,
null,
`主 IP 地址`,
-1,
)),
createElementVNode(`dd`, null, [
createElementVNode(
`span`,
Fe,
toDisplayString(
unref(E).ip || `未提供`,
),
1,
),
unref(E).ip
? (openBlock(),
createBlock(
a,
{
key: 0,
icon:
unref(z) === `ip`
? `pi pi-check`
: `pi pi-copy`,
"aria-label": `复制 IP 地址`,
text: ``,
size: `small`,
onClick: (i[10] ||= (
e,
) =>
Z(
unref(E).ip,
`ip`,
)),
},
null,
8,
[`icon`],
))
: createCommentVNode(
``,
!0,
),
]),
]),
createElementVNode(`div`, null, [
(i[41] ||= createElementVNode(
`dt`,
null,
`操作系统`,
-1,
)),
createElementVNode(`dd`, null, [
createVNode(
A,
{
name: unref(E).os,
size: 28,
},
null,
8,
[`name`],
),
createTextVNode(
toDisplayString(
unref(os_name_t)(
unref(E).os,
) || `未提供`,
),
1,
),
]),
]),
createElementVNode(`div`, null, [
(i[42] ||= createElementVNode(
`dt`,
null,
`用户名`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
unref(E).username ||
`未提供`,
),
1,
),
]),
createElementVNode(`div`, null, [
(i[43] ||= createElementVNode(
`dt`,
null,
`连接端口`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
unref(E).port || `未提供`,
),
1,
),
]),
createElementVNode(`div`, null, [
(i[44] ||= createElementVNode(
`dt`,
null,
`密码`,
-1,
)),
createElementVNode(`dd`, null, [
createElementVNode(
`span`,
Ie,
toDisplayString(
unref(E).password
? unref(k)
? unref(E).password
: `••••••••••`
: `未提供`,
),
1,
),
unref(E).password
? (openBlock(),
createBlock(
a,
{
key: 0,
icon: unref(k)
? `pi pi-eye-slash`
: `pi pi-eye`,
"aria-label": unref(k)
? `隐藏实例密码`
: `显示实例密码`,
text: ``,
size: `small`,
onClick: (i[11] ||= (
e,
) =>
(k.value =
!unref(k))),
},
null,
8,
[`icon`, `aria-label`],
))
: createCommentVNode(
``,
!0,
),
unref(E).password
? (openBlock(),
createBlock(
a,
{
key: 1,
icon:
unref(z) ===
`password`
? `pi pi-check`
: `pi pi-copy`,
"aria-label": `复制实例密码`,
text: ``,
size: `small`,
onClick: (i[12] ||= (
e,
) =>
Z(
unref(E).password,
`password`,
)),
},
null,
8,
[`icon`],
))
: createCommentVNode(
``,
!0,
),
]),
]),
]),
unref(B)
? (openBlock(),
createBlock(
o,
{
key: 0,
severity: `warn`,
closable: !1,
},
{
default: withCtx(() => [
createTextVNode(
toDisplayString(
unref(B),
),
1,
),
]),
_: 1,
},
))
: createCommentVNode(``, !0),
createVNode(
Ke,
{
"host-id": r.hostId,
host: r.host,
data: r.data,
disabled: unref(O),
onRefresh: (i[13] ||= (e) =>
x(`refresh`)),
},
null,
8,
[
`host-id`,
`host`,
`data`,
`disabled`,
],
),
]))
: createCommentVNode(``, !0),
]),
_: 1,
},
),
createVNode(
$,
{
value: `network`,
},
{
default: withCtx(() => [
unref(D) && r.data
? (openBlock(),
createElementBlock(`div`, Le, [
(i[54] ||= createElementVNode(
`h3`,
null,
`网络信息`,
-1,
)),
createElementVNode(`dl`, Re, [
createElementVNode(`div`, null, [
(i[46] ||= createElementVNode(
`dt`,
null,
`区域`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
unref(E).region || `未提供`,
),
1,
),
]),
unref(E).bandwidth
? (openBlock(),
createElementBlock(
`div`,
ze,
[
(i[47] ||=
createElementVNode(
`dt`,
null,
`带宽上限`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
unref(E).bandwidth,
),
1,
),
],
))
: createCommentVNode(``, !0),
createElementVNode(`div`, null, [
(i[48] ||= createElementVNode(
`dt`,
null,
`IP 地址`,
-1,
)),
createElementVNode(`dd`, Be, [
(openBlock(!0),
createElementBlock(
Fragment,
null,
renderList(
unref(E).ips,
(t) => (
openBlock(),
createElementBlock(
`span`,
{
key: t,
class: `mono`,
},
[
createTextVNode(
toDisplayString(
t,
),
1,
),
createVNode(
a,
{
icon:
unref(z) === t
? `pi pi-check`
: `pi pi-copy`,
"aria-label": `复制 ${t}`,
text: ``,
size: `small`,
onClick: (e) =>
Z(t, t),
},
null,
8,
[
`icon`,
`aria-label`,
`onClick`,
],
),
],
)
),
),
128,
)),
unref(E).ips.length
? createCommentVNode(``, !0)
: (openBlock(),
createElementBlock(
`span`,
Ve,
`未提供`,
)),
]),
]),
]),
unref(E).traffic.visible
? (openBlock(),
createElementBlock(
Fragment,
{
key: 0,
},
[
(i[53] ||=
createElementVNode(
`h3`,
{
class: `section-gap`,
},
`流量使用情况`,
-1,
)),
createElementVNode(
`dl`,
He,
[
createElementVNode(
`div`,
null,
[
(i[49] ||=
createElementVNode(
`dt`,
null,
`已用流量`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
Q(
unref(E)
.traffic
.used,
),
),
1,
),
],
),
createElementVNode(
`div`,
null,
[
(i[50] ||=
createElementVNode(
`dt`,
null,
`总流量`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
unref(E).traffic
.unlimited
? `不限`
: Q(
unref(E)
.traffic
.total,
),
),
1,
),
],
),
createElementVNode(
`div`,
null,
[
(i[51] ||=
createElementVNode(
`dt`,
null,
`剩余流量`,
-1,
)),
createElementVNode(
`dd`,
null,
toDisplayString(
unref(E).traffic
.unlimited
? `不限`
: Q(
unref(E)
.traffic
.remaining,
),
),
1,
),
],
),
unref(E).traffic
.percent === null
? createCommentVNode(
``,
!0,
)
: (openBlock(),
createElementBlock(
`div`,
Ue,
[
(i[52] ||=
createElementVNode(
`dt`,
null,
`使用比例`,
-1,
)),
createElementVNode(
`dd`,
We,
[
createVNode(
Y,
{
value:
unref(
E,
)
.traffic
.percent,
"show-value":
!1,
},
null,
8,
[`value`],
),
createElementVNode(
`span`,
null,
toDisplayString(
Math.round(
unref(
E,
)
.traffic
.percent,
),
) + `%`,
1,
),
],
),
],
)),
],
),
],
64,
))
: createCommentVNode(``, !0),
unref(B)
? (openBlock(),
createBlock(
o,
{
key: 1,
severity: `warn`,
closable: !1,
},
{
default: withCtx(() => [
createTextVNode(
toDisplayString(
unref(B),
),
1,
),
]),
_: 1,
},
))
: createCommentVNode(``, !0),
]))
: createCommentVNode(``, !0),
]),
_: 1,
},
),
createVNode(
$,
{
value: `billing`,
},
{
default: withCtx(() => [
S.value === `billing`
? (openBlock(),
createBlock(
qe,
{
key: 0,
"host-id": r.hostId,
host: r.host,
onRefresh: (i[14] ||= (e) =>
x(`refresh`)),
},
null,
8,
[`host-id`, `host`],
))
: createCommentVNode(``, !0),
unref(D) && r.host.upgrade_allowed !== !1
? (openBlock(),
createBlock(a, {
key: 1,
label: `配置与商品升级`,
onClick: (i[15] ||= (e) =>
(V.value = !0)),
}))
: createCommentVNode(``, !0),
]),
_: 1,
},
),
createVNode(
$,
{
value: `log`,
},
{
default: withCtx(() => [
unref(D) && r.data && S.value === `log`
? (openBlock(),
createBlock(
Je,
{
key: 0,
"host-id": r.hostId,
module: `remf_finance_dcim`,
},
null,
8,
[`host-id`],
))
: createCommentVNode(``, !0),
]),
_: 1,
},
),
]),
_: 1,
}),
]),
_: 1,
},
8,
[`value`],
)),
createVNode(
$e,
{
visible: unref(V),
"onUpdate:visible": (i[17] ||= (e) =>
isRef(V) ? (V.value = e) : null),
header: `配置与商品升级`,
modal: ``,
closable: !unref(q),
"close-on-escape": !unref(q),
style: {
width: `700px`,
maxWidth: `calc(100vw - 24px)`,
},
},
{
default: withCtx(() => [
unref(V)
? (openBlock(),
createBlock(
Ze,
{
key: 0,
ref_key: `configUpgrade`,
ref: G,
"host-id": r.hostId,
module: `remf_finance_dcim`,
"upgrade-allowed": r.host.upgrade_allowed,
onPay: J,
},
null,
8,
[`host-id`, `upgrade-allowed`],
))
: createCommentVNode(``, !0),
unref(V)
? (openBlock(),
createBlock(
Qe,
{
key: 1,
ref_key: `productUpgrade`,
ref: K,
"host-id": r.hostId,
module: `remf_finance_dcim`,
"upgrade-allowed": r.host.upgrade_allowed,
onPay: J,
},
null,
8,
[`host-id`, `upgrade-allowed`],
))
: createCommentVNode(``, !0),
]),
_: 1,
},
8,
[`visible`, `closable`, `close-on-escape`],
),
createVNode(
et,
{
modelValue: unref(H),
"onUpdate:modelValue": (i[18] ||= (e) =>
isRef(H) ? (H.value = e) : null),
"order-id": unref(U),
amount: unref(W),
onSuccess: (i[19] ||= (e) => x(`refresh`)),
},
null,
8,
[`modelValue`, `order-id`, `amount`],
),
])
);
}
);
},
}),
[[`__scopeId`, `data-v-f40d7201`]],
),
{
__name: `LegacyDcimManage`,
},
);
export {};
export default z;
</script>