Commit 791451cd authored by 张俊's avatar 张俊

Merge branch 'dev' of https://cloud.wodcloud.com/git/apaas/apaas-v3-ui into dev

parents 950baf62 ea35f905
...@@ -184,7 +184,7 @@ export default { ...@@ -184,7 +184,7 @@ export default {
this.hideDialog(); this.hideDialog();
} else { } else {
this.$message({ this.$message({
message: "分配失败", message: data.errMsg || "分配失败",
type: "warning", type: "warning",
}); });
} }
......
...@@ -222,7 +222,7 @@ ...@@ -222,7 +222,7 @@
:max="10" :max="10"
placeholder="请选择内存最高使用量" placeholder="请选择内存最高使用量"
></el-input-number> ></el-input-number>
<div class="input_right"></div> <div class="input_right">GB</div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="11"> <el-col :span="11">
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
:max="10" :max="10"
placeholder="请选择内存默认使用量" placeholder="请选择内存默认使用量"
></el-input-number> ></el-input-number>
<div class="input_right"></div> <div class="input_right">GB</div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
...@@ -1197,51 +1197,84 @@ export default { ...@@ -1197,51 +1197,84 @@ export default {
}); });
} }
}, },
checkNamespace(namespace, cb) {
this.$http
.get("/apaas/service/v3/resource/apply/checkNs", {
params: { namespace },
})
.then(({ data }) => {
if (data.success === 1) {
if (data.data === 1) {
typeof cb === "function" && cb();
} else if (data.data === -1) {
this.$message({
message: `命名空间名称已存在`,
type: "error",
});
} else if (data.data === -1) {
this.$message({
message: `命名空间名称验证失败`,
type: "error",
});
}
}
})
.catch((error) => {
console.log(error);
this.$message({
message: `命名空间名称验证失败`,
type: "error",
});
});
},
determineSubmit() { determineSubmit() {
if (this.activeName == 0) { if (this.activeName == 0) {
let query = { this.checkNamespace(this.formNew.namespace, () => {
resource_info: { let query = {
namespace: this.formNew.namespace, resource_info: {
workplace: this.formNew.workplace, namespace: this.formNew.namespace,
workplacedesc: this.formNew.workplacedesc, workplace: this.formNew.workplace,
}, workplacedesc: this.formNew.workplacedesc,
resource_apply: { },
apply_file: this.formNew.apply_file, resource_apply: {
cpu: Number(this.formNew.cpu), apply_file: this.formNew.apply_file,
duration: this.formNew.appDuration, cpu: Number(this.formNew.cpu),
duration_unit: Number(this.formNew.durType), duration: this.formNew.appDuration,
apply_connect_username: this.form.link_man, duration_unit: Number(this.formNew.durType),
apply_connect_mobile: this.form.phone, apply_connect_username: this.form.link_man,
memory: Number(this.formNew.memory), apply_connect_mobile: this.form.phone,
containers: this.formNew.containerGroup, memory: Number(this.formNew.memory),
disk_num: this.formNew.dataDisk, containers: this.formNew.containerGroup,
disk_cap: this.formNew.perDataDisk,
one_cpu_min: this.formNew.perCPU,
one_cpu_max: this.formNew.perCPUs,
one_memory_min: this.formNew.perRAM,
one_memory_max: this.formNew.perRAMs,
},
disks: [
{
disk_num: this.formNew.dataDisk, disk_num: this.formNew.dataDisk,
disk_cap: this.formNew.perDataDisk, disk_cap: this.formNew.perDataDisk,
store_type: this.formNew.store_type, one_cpu_min: this.formNew.perCPU,
one_cpu_max: this.formNew.perCPUs,
one_memory_min: this.formNew.perRAM,
one_memory_max: this.formNew.perRAMs,
}, },
], disks: [
}; {
this.$api.serviceShop.applicationCloud(query).then((response) => { disk_num: this.formNew.dataDisk,
if (response.data.success == 1) { disk_cap: this.formNew.perDataDisk,
this.$message({ store_type: this.formNew.store_type,
message: "申请成功", },
type: "success", ],
}); };
this.$router.push("/services_shop"); this.$api.serviceShop.applicationCloud(query).then((response) => {
} else { if (response.data.success == 1) {
this.$message({ this.$message({
message: `申请失败,${response.data.errMsg}`, message: "申请成功",
type: "error", type: "success",
}); });
} this.$router.push("/services_shop");
} else {
this.$message({
message: `申请失败,${response.data.errMsg}`,
type: "error",
});
}
});
}); });
} else { } else {
let query = { let query = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment