diff --git a/jcloud/api/aliyun_server_light.py b/jcloud/api/aliyun_server_light.py index 1e99f2a..ad707f8 100644 --- a/jcloud/api/aliyun_server_light.py +++ b/jcloud/api/aliyun_server_light.py @@ -471,10 +471,12 @@ def create_server_async(order_name): if not result or not result.get('success'): raise Exception(f"阿里云创建失败: {result.get('message', '未知错误')}") - instance_id = result['data']['instance_id'] + # 阿里云API返回的是instance_ids数组,取第一个实例ID + instance_id = result['data']['instance_ids'][0] # 更新服务器记录状态 server.status = "Active" + server.running_status = "运行中" server.instance_id = instance_id server.save(ignore_permissions=True) diff --git a/jcloud/jcloud/pagetype/jsite_server/jsite_server.json b/jcloud/jcloud/pagetype/jsite_server/jsite_server.json index f100f10..7106632 100644 --- a/jcloud/jcloud/pagetype/jsite_server/jsite_server.json +++ b/jcloud/jcloud/pagetype/jsite_server/jsite_server.json @@ -117,7 +117,6 @@ "read_only": 1 }, { - "collapsible": 1, "fieldname": "server_section", "fieldtype": "Section Break", "label": "服务器信息" @@ -158,9 +157,10 @@ { "fetch_from": "virtual_machine.public_ip_address", "fieldname": "running_status", - "fieldtype": "Data", + "fieldtype": "Select", "in_list_view": 1, "label": "运行状态", + "options": "\n运行中\n已停机", "read_only": 1 }, { @@ -172,21 +172,19 @@ { "fieldname": "planid", "fieldtype": "Data", - "hidden": 1, "label": "套餐ID", "read_only": 1 }, { "fieldname": "period", "fieldtype": "Int", - "hidden": 1, "label": "购买时长(月)", "read_only": 1 } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2025-07-27 22:04:39.820405", + "modified": "2025-07-27 23:19:16.648233", "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 0c0a705..b505a1a 100644 --- a/jcloud/jcloud/pagetype/jsite_server/jsite_server.py +++ b/jcloud/jcloud/pagetype/jsite_server/jsite_server.py @@ -26,7 +26,7 @@ class JsiteServer(Document): planid: DF.Data | None region: DF.Data | None root_public_key: DF.Code | None - running_status: DF.Data | None + running_status: DF.Literal["", "\u8fd0\u884c\u4e2d", "\u5df2\u505c\u673a"] ssh_port: DF.Int ssh_user: DF.Data | None status: DF.Literal["Pending", "Installing", "Active", "Broken", "Archived"]