前端Jsite Server详情页增加内网IP字段

This commit is contained in:
jingrow 2025-08-15 15:43:15 +08:00
parent b72a4b2031
commit 3d1319b228
5 changed files with 29 additions and 9 deletions

View File

@ -214,10 +214,6 @@
</div> </div>
<div class="p-5"> <div class="p-5">
<div class="space-y-3"> <div class="space-y-3">
<div class="flex justify-between">
<span class="text-gray-600">公网IP:</span>
<span class="font-mono text-gray-900">{{ $jsiteServer.pg.public_ip || '未分配' }}</span>
</div>
<div class="flex justify-between"> <div class="flex justify-between">
<span class="text-gray-600">SSH端口:</span> <span class="text-gray-600">SSH端口:</span>
<span class="font-mono text-gray-900">{{ $jsiteServer.pg.ssh_port || '22' }}</span> <span class="font-mono text-gray-900">{{ $jsiteServer.pg.ssh_port || '22' }}</span>
@ -705,7 +701,15 @@ export default {
}, },
{ {
label: '实例ID', label: '实例ID',
value: this.$jsiteServer.pg?.instance_id || '未分配', value: this.$jsiteServer.pg?.instance_id || '',
},
{
label: '公网IP',
value: this.$jsiteServer.pg?.public_ip || '',
},
{
label: '内网IP',
value: this.$jsiteServer.pg?.private_ip || '',
}, },
{ {
label: '区域', label: '区域',
@ -713,7 +717,7 @@ export default {
}, },
{ {
label: '系统', label: '系统',
value: this.$jsiteServer.pg?.system || '未知', value: this.$jsiteServer.pg?.system || '',
}, },
]; ];
}, },

View File

@ -29,6 +29,7 @@ export default {
'memory', 'memory',
'disk_size', 'disk_size',
'public_ip', 'public_ip',
'private_ip',
'end_date', 'end_date',
'bandwidth', 'bandwidth',
'team', 'team',

View File

@ -1525,6 +1525,8 @@ def update_server_record(instance_ids):
server.public_ip = instance_info.get('public_ip_address') server.public_ip = instance_info.get('public_ip_address')
server.private_ip = instance_info.get('inner_ip_address') or instance_info.get('network_attributes', [{}])[0].get('private_ip_address')
# 更新end_date从expired_time转换 # 更新end_date从expired_time转换
expired_time = instance_info.get('expired_time') expired_time = instance_info.get('expired_time')
if expired_time: if expired_time:
@ -1588,6 +1590,7 @@ def update_server_record(instance_ids):
"message": "服务器信息更新成功", "message": "服务器信息更新成功",
"updated_fields": { "updated_fields": {
"public_ip": instance_info.get('public_ip_address'), "public_ip": instance_info.get('public_ip_address'),
"private_ip": server.private_ip,
"end_date": server.end_date, "end_date": server.end_date,
"status": instance_info.get('status'), "status": instance_info.get('status'),
"system": server.system, "system": server.system,

View File

@ -13,6 +13,7 @@
"status", "status",
"order_id", "order_id",
"planid", "planid",
"end_date",
"auto_renew", "auto_renew",
"server_section", "server_section",
"instance_id", "instance_id",
@ -22,10 +23,10 @@
"system", "system",
"image_id", "image_id",
"column_break_aliyun", "column_break_aliyun",
"end_date",
"memory", "memory",
"bandwidth", "bandwidth",
"public_ip", "public_ip",
"private_ip",
"os_type", "os_type",
"period", "period",
"ssh_section", "ssh_section",
@ -230,11 +231,19 @@
"fieldtype": "Table", "fieldtype": "Table",
"label": "Firewall Rules", "label": "Firewall Rules",
"options": "Firewall Rules" "options": "Firewall Rules"
},
{
"fetch_from": "virtual_machine.public_ip_address",
"fieldname": "private_ip",
"fieldtype": "Data",
"in_list_view": 1,
"label": "内网IP",
"read_only": 1
} }
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2025-08-09 17:37:10.451472", "modified": "2025-08-15 15:19:18.272352",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Jcloud", "module": "Jcloud",
"name": "Jsite Server", "name": "Jsite Server",

View File

@ -12,6 +12,7 @@ class JsiteServer(Document):
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
if TYPE_CHECKING: if TYPE_CHECKING:
from jcloud.jcloud.pagetype.firewall_rules.firewall_rules import FirewallRules
from jingrow.types import DF from jingrow.types import DF
auto_renew: DF.Check auto_renew: DF.Check
@ -19,7 +20,7 @@ class JsiteServer(Document):
cpu: DF.Data | None cpu: DF.Data | None
disk_size: DF.Data | None disk_size: DF.Data | None
end_date: DF.Datetime | None end_date: DF.Datetime | None
firewall_rules: DF.Data | None firewall_rules: DF.Table[FirewallRules]
image_id: DF.Data | None image_id: DF.Data | None
instance_id: DF.Data | None instance_id: DF.Data | None
key_pair_name: DF.Data | None key_pair_name: DF.Data | None
@ -31,6 +32,7 @@ class JsiteServer(Document):
plan_price: DF.Int plan_price: DF.Int
plan_type: DF.Data | None plan_type: DF.Data | None
planid: DF.Data | None planid: DF.Data | None
private_ip: DF.Data | None
private_key: DF.Text | None private_key: DF.Text | None
public_ip: DF.Data | None public_ip: DF.Data | None
region: DF.Data | None region: DF.Data | None
@ -50,6 +52,7 @@ class JsiteServer(Document):
"memory", "memory",
"disk_size", "disk_size",
"public_ip", "public_ip",
"private_ip",
"end_date", "end_date",
"bandwidth", "bandwidth",
"team", "team",