From f9b8f6229c5b5d4bcb10199d3d8d296e4549ff2a Mon Sep 17 00:00:00 2001 From: jingrow Date: Tue, 29 Jul 2025 18:55:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=89=8D=E7=AB=AF=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E8=AF=A6=E6=83=85=E9=A1=B5=E6=8E=92=E7=89=88?= =?UTF-8?q?=EF=BC=8C=E5=88=9B=E5=BB=BA=E6=9C=8D=E5=8A=A1=E5=99=A8=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=97=B6=E5=A2=9E=E5=8A=A0plan=5Fprice=E5=86=99?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src2/components/JsiteServerOverview.vue | 127 ++++++++++-------- jcloud/api/aliyun_server_light.py | 1 + .../pagetype/jsite_server/jsite_server.json | 16 ++- .../pagetype/jsite_server/jsite_server.py | 7 +- 4 files changed, 86 insertions(+), 65 deletions(-) diff --git a/dashboard/src2/components/JsiteServerOverview.vue b/dashboard/src2/components/JsiteServerOverview.vue index f322746..46ea373 100644 --- a/dashboard/src2/components/JsiteServerOverview.vue +++ b/dashboard/src2/components/JsiteServerOverview.vue @@ -5,23 +5,16 @@ >
- +
-

服务器状态

+

当前套餐

-
- - {{ getStatusText($jsiteServer.pg.status) }} - - +
+ ¥{{ $jsiteServer.pg.plan_price }}/月
@@ -31,18 +24,11 @@
-
@@ -87,22 +73,22 @@

服务器配置

-
-
-
{{ $jsiteServer.pg.cpu || '未知' }}
-
CPU核心
+
+
+ CPU核心: + {{ $jsiteServer.pg.cpu || '未知' }}
-
-
{{ $jsiteServer.pg.memory || '未知' }}GB
-
内存
+
+ 内存: + {{ $jsiteServer.pg.memory || '未知' }}GB
-
-
{{ $jsiteServer.pg.disk_size || '未知' }}GB
-
磁盘
+
+ 磁盘: + {{ $jsiteServer.pg.disk_size || '未知' }}GB
-
-
{{ $jsiteServer.pg.bandwidth || '未知' }}Mbps
-
带宽
+
+ 带宽: + {{ $jsiteServer.pg.bandwidth || '未知' }}Mbps
@@ -128,9 +114,17 @@ {{ $jsiteServer.pg.ssh_user || 'root' }}
- 密钥对: + 服务器密码: + {{ $jsiteServer.pg.password || '未设置' }} +
+
+ 密钥对名称: {{ $jsiteServer.pg.key_pair_name || '未设置' }}
+
+ 私钥: + {{ $jsiteServer.pg.private_key || '未设置' }} +
@@ -178,20 +172,47 @@ export default { }; return variantMap[status] || 'default'; }, - rebootServer() { + getRegionText(region) { + const regionMap = { + 'cn-qingdao': '华北1(青岛)', + 'cn-beijing': '华北2(北京)', + 'cn-zhangjiakou': '华北3(张家口)', + 'cn-huhehaote': '华北5(呼和浩特)', + 'cn-hangzhou': '华东1(杭州)', + 'cn-shanghai': '华东2(上海)', + 'cn-shenzhen': '华南1(深圳)', + 'cn-heyuan': '华南2(河源)', + 'cn-chengdu': '西南1(成都)', + 'cn-guangzhou': '华南3(广州)', + 'cn-wulanchabu': '华北6(乌兰察布)', + 'cn-nanjing': '华东5(南京)', + 'cn-fuzhou': '华东6(福州)', + 'cn-wuhan-lr': '华中1(武汉)', + 'cn-hongkong': '中国香港', + 'ap-southeast-1': '新加坡', + 'ap-southeast-3': '马来西亚(吉隆坡)', + 'ap-southeast-5': '印度尼西亚(雅加达)', + 'ap-northeast-1': '日本(东京)', + 'us-west-1': '美国(硅谷)', + 'us-east-1': '美国(弗吉尼亚)', + 'eu-central-1': '德国(法兰克福)', + 'eu-west-1': '英国(伦敦)', + 'ap-southeast-6': '菲律宾(马尼拉)', + 'ap-southeast-7': '泰国(曼谷)', + 'ap-northeast-2': '韩国(首尔)' + }; + return regionMap[region] || region; + }, + renewServer() { toast.promise( - this.$jsiteServer.reboot.submit(), + this.$jsiteServer.renew?.submit() || Promise.resolve(), { - loading: '正在重启服务器...', - success: '服务器重启命令已发送', + loading: '正在处理续费请求...', + success: '续费请求已提交', error: (e) => getToastErrorMessage(e), }, ); }, - renameServer() { - // 这里可以实现重命名功能 - toast.info('重命名功能待实现'); - }, }, computed: { serverInformation() { @@ -205,29 +226,17 @@ export default { value: this.$jsiteServer.pg?.instance_id || '未分配', }, { - label: '订单ID', - value: this.$jsiteServer.pg?.order_id || '未分配', + label: '状态', + value: this.getStatusText(this.$jsiteServer.pg?.status), }, { label: '区域', - value: this.$jsiteServer.pg?.region || '未知', + value: this.getRegionText(this.$jsiteServer.pg?.region), }, { label: '系统', value: this.$jsiteServer.pg?.system || '未知', }, - { - label: '套餐ID', - value: this.$jsiteServer.pg?.planid || '未知', - }, - { - label: '镜像ID', - value: this.$jsiteServer.pg?.image_id || '未知', - }, - { - label: '购买时长', - value: this.$jsiteServer.pg?.period ? `${this.$jsiteServer.pg.period}个月` : '未知', - }, ]; }, $jsiteServer() { diff --git a/jcloud/api/aliyun_server_light.py b/jcloud/api/aliyun_server_light.py index d72d3db..13dc71c 100644 --- a/jcloud/api/aliyun_server_light.py +++ b/jcloud/api/aliyun_server_light.py @@ -794,6 +794,7 @@ def create_server_order(**kwargs): "title": f"{region_id} - {selected_plan.get('core')}核/{selected_plan.get('memory')}GB", "planid": plan_id, "period": period, + "plan_price": monthly_price, "cpu": selected_plan.get('core'), "memory": selected_plan.get('memory'), "disk_size": selected_plan.get('disk_size'), diff --git a/jcloud/jcloud/pagetype/jsite_server/jsite_server.json b/jcloud/jcloud/pagetype/jsite_server/jsite_server.json index d2aba15..a652aa6 100644 --- a/jcloud/jcloud/pagetype/jsite_server/jsite_server.json +++ b/jcloud/jcloud/pagetype/jsite_server/jsite_server.json @@ -12,18 +12,19 @@ "order_id", "server_section", "instance_id", + "planid", "cpu", "disk_size", "region", - "image_id", - "planid", + "system", + "period", "column_break_aliyun", "end_date", + "plan_price", "memory", "bandwidth", "public_ip", - "system", - "period", + "image_id", "ssh_section", "ssh_user", "ssh_port", @@ -193,11 +194,16 @@ "fieldname": "key_pair_name", "fieldtype": "Data", "label": "密钥对名称" + }, + { + "fieldname": "plan_price", + "fieldtype": "Int", + "label": "套餐价格(元/月)" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2025-07-28 20:45:29.493153", + "modified": "2025-07-29 18:37:36.194789", "modified_by": "Administrator", "module": "Jcloud", "name": "Jsite Server", diff --git a/jcloud/jcloud/pagetype/jsite_server/jsite_server.py b/jcloud/jcloud/pagetype/jsite_server/jsite_server.py index c94a03d..bd2f01b 100644 --- a/jcloud/jcloud/pagetype/jsite_server/jsite_server.py +++ b/jcloud/jcloud/pagetype/jsite_server/jsite_server.py @@ -25,6 +25,7 @@ class JsiteServer(Document): order_id: DF.Data | None password: DF.Password | None period: DF.Int + plan_price: DF.Int planid: DF.Data | None private_key: DF.Text | None public_ip: DF.Data | None @@ -52,7 +53,11 @@ class JsiteServer(Document): "order_id", "planid", "image_id", - "system" + "system", + "plan_price", + "key_pair_name", + "private_key", + "password" ) @staticmethod