diff --git a/src/apis/home.ts b/src/apis/home.ts index 476e642..4c49cc3 100644 --- a/src/apis/home.ts +++ b/src/apis/home.ts @@ -52,3 +52,8 @@ export const exchangePoint=(params:any)=>request.put('/v1/balance/exchange_point //创建实例 export const createHost=(params:any)=>request.post('/v1/host/host_case',params) +//释放实例 +export const releaseCase=(caseId:string)=>request.post(`/v1/host_case/release_case/${caseId}`) +//重置实例 +export const reStartCase=(caseId:string)=>request.post(`/v1/host_case/restart_case/${caseId}`) + diff --git a/src/utils/dict.ts b/src/utils/dict.ts new file mode 100644 index 0000000..fca3540 --- /dev/null +++ b/src/utils/dict.ts @@ -0,0 +1,15 @@ +export const payTypeDic = new Map([ + ["PayOnTime", "按量计费"], + ["PayOnDay", "包日"], + ["PayOnWeek", "包周"], + ["PayOnMonth", "包月"], + ["PayOnYear", "包年"], +]); + +export const instanceStatus = new Map([ + ["RUNNING", { text: "运行中", color: "#67C23A" }], + ["STOPPED", { text: "已停止", color: "#909399" }], + ["CREATING", { text: "创建中", color: "#E6A23C" }], + ["RESTARTING", { text: "重启中", color: "#E6A23C" }], + ["RELEASED", { text: "已释放", color: "#F56C6C" }], +]); diff --git a/src/views/admin/instance/index.vue b/src/views/admin/instance/index.vue index 1bf15ad..dd58f96 100644 --- a/src/views/admin/instance/index.vue +++ b/src/views/admin/instance/index.vue @@ -6,8 +6,8 @@