diff --git a/dashboard/src2/pages/NewJsiteServer.vue b/dashboard/src2/pages/NewJsiteServer.vue index 9e0f5d6..8f7ff43 100644 --- a/dashboard/src2/pages/NewJsiteServer.vue +++ b/dashboard/src2/pages/NewJsiteServer.vue @@ -608,6 +608,7 @@ export default { image_id: this.selectedImageId, period: this.period, region_id: this.selectedRegionId, + plan_type: this.getSelectedPlanType(), payment_method: this.selectedPaymentMethod }); @@ -714,6 +715,10 @@ export default { const selectedPlan = this.filteredPlans.find(plan => plan.plan_id === this.selectedPlanId); return selectedPlan ? (selectedPlan.origin_price || 0) : 0; }, + getSelectedPlanType() { + const selectedPlan = this.filteredPlans.find(plan => plan.plan_id === this.selectedPlanId); + return selectedPlan ? (selectedPlan.plan_type || '') : ''; + }, getTotalAmount() { const monthlyPrice = this.getSelectedPlanPrice(); return (monthlyPrice * this.period).toFixed(2); diff --git a/jcloud/api/aliyun_server_light.py b/jcloud/api/aliyun_server_light.py index f0e80fc..3ceccfa 100644 --- a/jcloud/api/aliyun_server_light.py +++ b/jcloud/api/aliyun_server_light.py @@ -980,6 +980,7 @@ def create_server_order(**kwargs): image_id = kwargs.get('image_id') period = kwargs.get('period', 1) region_id = kwargs.get('region_id', 'cn-shanghai') + plan_type = kwargs.get('plan_type', '') if not plan_id or not image_id: jingrow.throw("缺少必要参数") @@ -1009,6 +1010,7 @@ def create_server_order(**kwargs): "image_id": image_id, "period": period, "region_id": region_id, + "plan_type": plan_type, "monthly_price": monthly_price, "total_amount": total_amount, "plan_info": { @@ -1360,6 +1362,7 @@ def create_aliyun_server(order_name): image_id = biz_params.get("image_id") period = biz_params.get("period", 1) region_id = biz_params.get("region_id", "cn-shanghai") + plan_type = biz_params.get("plan_type", "") monthly_price = biz_params.get("monthly_price", 0) plan_info = biz_params.get("plan_info", {}) @@ -1390,6 +1393,7 @@ def create_aliyun_server(order_name): "end_date": jingrow.utils.add_months(jingrow.utils.nowdate(), period), "title": f"{region_id} - {plan_info.get('core', '')}核/{plan_info.get('memory', '')}GB", "planid": plan_id, + "plan_type": plan_type, "period": period, "plan_price": monthly_price, "cpu": plan_info.get('core'),