|
|
@@ -82,7 +82,7 @@
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button icon="el-icon-position" size="mini" type="primary" @click="resetQuery"
|
|
|
+ <el-button icon="el-icon-position" size="mini" type="primary" @click="showUpgradeDialog('','batch')"
|
|
|
>批量升级
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
@@ -100,11 +100,15 @@
|
|
|
<span v-text="getPageIndex(scope.$index)"> </span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="所属机构" prop="orgName"/>
|
|
|
+ <el-table-column align="center" label="所属机构" prop="orgName" :show-overflow-tooltip="true" scoped-slot="hostIp" width="360"/>
|
|
|
<el-table-column align="center" label="主机IP" prop="hostIp" :show-overflow-tooltip="true" scoped-slot="hostIp" width="320"/>
|
|
|
<el-table-column align="center" label="白令海状态" prop="hostStatus">
|
|
|
- <template slot-scope="scope">
|
|
|
+<!-- <template slot-scope="scope">
|
|
|
<dict-tag :options="dict.type.deploy_bering_status" :value="scope.row.hostStatus"/>
|
|
|
+ </template>-->
|
|
|
+ <template v-slot:default="scope">
|
|
|
+ <span v-if="scope.row.hostStatus === 1" style="color: #00B83F">在线</span>
|
|
|
+ <span v-else style="color: red">离线</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="白令海当前版本号" prop="agentVersion"/>
|
|
|
@@ -116,11 +120,11 @@
|
|
|
width="120"
|
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
|
- <el-button v-if="row.upgradeFlag === 1 && row.hostStatus === 1"
|
|
|
+ <el-button v-if="row.upgradeFlag === '1' && row.hostStatus === 1"
|
|
|
class="el-icon-position"
|
|
|
size="mini"
|
|
|
type="primary"
|
|
|
- @click="onManageContent(row)"
|
|
|
+ @click="showUpgradeDialog(row.id,'single')"
|
|
|
>升级
|
|
|
</el-button
|
|
|
>
|
|
|
@@ -140,15 +144,47 @@
|
|
|
<pagination v-show="total > 0" :limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNum" :total="total"
|
|
|
@pagination="getList"/>
|
|
|
|
|
|
+
|
|
|
+ <DialogCom :title="'白令海升级'" :visible.sync="open" append-to-body width="780px">
|
|
|
+ <div class="form-group" style="text-align: center;margin-top: 20px">
|
|
|
+ 若主机当前版本号大于等于选中的升级包版本号,则不进行该主机白令海升级;且白令海状态离线的主机,不进行升级!
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="180px" :style="{height:'500px',margin:'35px'}">
|
|
|
+
|
|
|
+ <el-form-item label="白令海升级包" prop="agentPackageId">
|
|
|
+ <el-select
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form.agentPackageId"
|
|
|
+ placeholder="请选择升级包"
|
|
|
+ @change="onUpgradePackageChange"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in upgradePackages"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.text"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </DialogCom>
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
- upgradeBeringList,beringVersionList
|
|
|
+ upgradeBeringList,beringVersionList,upgradePackageList,upgradeBering
|
|
|
} from "@/api/deploy/bering";
|
|
|
import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
|
|
|
+import {validateUpgradeHost} from "@/api/deploy/hostInfo";
|
|
|
|
|
|
export default {
|
|
|
name: "BeringStatus",
|
|
|
@@ -184,19 +220,36 @@ export default {
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
+ checkSub: true,
|
|
|
hostOrg: null,
|
|
|
agentVersion: null,
|
|
|
uploadVersion: null,
|
|
|
hostIp: null,
|
|
|
- hostStatus:null
|
|
|
+ hostStatus:null,
|
|
|
+ //升级需要参数
|
|
|
+ type: null,
|
|
|
+ hostId: null,
|
|
|
+ agentPackageId: null,
|
|
|
},
|
|
|
beringVersions:[],
|
|
|
+ upgradePackages: [],
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ agentPackageId: [
|
|
|
+ {required: true, message: "请选择白令海升级包", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
beringVersionList().then((d) => {
|
|
|
this.beringVersions = d.data;
|
|
|
});
|
|
|
+ upgradePackageList().then((d) => {
|
|
|
+ this.upgradePackages = d.data;
|
|
|
+ });
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -225,7 +278,7 @@ export default {
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
console.log("123456")
|
|
|
- this.queryParams.hostOrg = null;
|
|
|
+ //this.queryParams.hostOrg = null;
|
|
|
upgradeBeringList(this.queryParams).then(response => {
|
|
|
this.packageInfoList = response.rows;
|
|
|
this.total = response.total;
|
|
|
@@ -244,6 +297,9 @@ export default {
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
this.dateRange = [];
|
|
|
+ this.queryParams.type = null;
|
|
|
+ this.queryParams.hostId = null;
|
|
|
+ this.queryParams.agentPackageId = null;
|
|
|
this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
@@ -265,6 +321,57 @@ export default {
|
|
|
this.queryParams.uploadVersion = data.text;
|
|
|
}
|
|
|
},
|
|
|
+ showUpgradeDialog(hostId,type){
|
|
|
+ if (type === 'batch'){
|
|
|
+ //为0代表升级所有主机
|
|
|
+ this.queryParams.hostId = null;
|
|
|
+ this.getList();
|
|
|
+ }else {
|
|
|
+ this.queryParams.hostId = hostId;
|
|
|
+ }
|
|
|
+ this.open = true;
|
|
|
+ this.queryParams.type = type;
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ agentPackageId: null,
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ onUpgradePackageChange(val){
|
|
|
+ this.$refs["form"].clearValidate(["agentPackageId"]);
|
|
|
+ },
|
|
|
+ submitForm(){
|
|
|
+ console.log("agentPackageId:"+this.form.agentPackageId);
|
|
|
+ console.log("queryParams:"+this.queryParams);
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.$modal
|
|
|
+ .confirm("是否确认升级查询结果列表中的主机?")
|
|
|
+ .then(function () {
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.queryParams.agentPackageId = this.form.agentPackageId;
|
|
|
+ upgradeBering(this.queryParams).then((res) => {
|
|
|
+ let {code, msg} = res;
|
|
|
+ if (code == 200) {
|
|
|
+ this.$modal.msgSuccess("升级任务下发成功!");
|
|
|
+ this.resetQuery();
|
|
|
+ this.cancel();
|
|
|
+ } else {
|
|
|
+ this.$modal.msgError(msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|