修复付款成功后创建云服务器失败的问题
This commit is contained in:
parent
e9f327af93
commit
27060bfe67
@ -471,10 +471,12 @@ def create_server_async(order_name):
|
|||||||
if not result or not result.get('success'):
|
if not result or not result.get('success'):
|
||||||
raise Exception(f"阿里云创建失败: {result.get('message', '未知错误')}")
|
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.status = "Active"
|
||||||
|
server.running_status = "运行中"
|
||||||
server.instance_id = instance_id
|
server.instance_id = instance_id
|
||||||
server.save(ignore_permissions=True)
|
server.save(ignore_permissions=True)
|
||||||
|
|
||||||
|
|||||||
@ -117,7 +117,6 @@
|
|||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"collapsible": 1,
|
|
||||||
"fieldname": "server_section",
|
"fieldname": "server_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"label": "服务器信息"
|
"label": "服务器信息"
|
||||||
@ -158,9 +157,10 @@
|
|||||||
{
|
{
|
||||||
"fetch_from": "virtual_machine.public_ip_address",
|
"fetch_from": "virtual_machine.public_ip_address",
|
||||||
"fieldname": "running_status",
|
"fieldname": "running_status",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Select",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "运行状态",
|
"label": "运行状态",
|
||||||
|
"options": "\n运行中\n已停机",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -172,21 +172,19 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "planid",
|
"fieldname": "planid",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 1,
|
|
||||||
"label": "套餐ID",
|
"label": "套餐ID",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "period",
|
"fieldname": "period",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"hidden": 1,
|
|
||||||
"label": "购买时长(月)",
|
"label": "购买时长(月)",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-07-27 22:04:39.820405",
|
"modified": "2025-07-27 23:19:16.648233",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Jcloud",
|
"module": "Jcloud",
|
||||||
"name": "Jsite Server",
|
"name": "Jsite Server",
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class JsiteServer(Document):
|
|||||||
planid: DF.Data | None
|
planid: DF.Data | None
|
||||||
region: DF.Data | None
|
region: DF.Data | None
|
||||||
root_public_key: DF.Code | 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_port: DF.Int
|
||||||
ssh_user: DF.Data | None
|
ssh_user: DF.Data | None
|
||||||
status: DF.Literal["Pending", "Installing", "Active", "Broken", "Archived"]
|
status: DF.Literal["Pending", "Installing", "Active", "Broken", "Archived"]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user