This commit is contained in:
bwcx_jzy 2023-03-01 09:08:00 +08:00
parent 66bd9251fe
commit 2a6fdf5148
No known key found for this signature in database
GPG Key ID: 5E48E9372088B9E5
5 changed files with 83 additions and 87 deletions

View File

@ -7,6 +7,7 @@
2. ~~SSH 管理~~ 2. ~~SSH 管理~~
3. dokcer 管理 3. dokcer 管理
4. docker 集群 4. docker 集群
5. ssh 监控
2. **资产管理** 2. **资产管理**
3. scp 发布实践案例 3. scp 发布实践案例
4. netty-agent 4. netty-agent

View File

@ -44,20 +44,11 @@
</a-tooltip> </a-tooltip>
</template> </template>
<template v-else> <template v-else>
<template v-if="showOptVisible[record.id]"> <a-tooltip :title="`${text} 点击进入节点管理`" @click="handleNode(record)">
<a-tooltip title="我在这里" :visible="showOptVisible[record.id]" @click="handleNode(record)"> <a-button type="link" style="padding: 0px" size="small">
<a-button type="link" style="padding: 0px" size="small"> <a-icon type="fullscreen" /><span>{{ text }}</span>
<a-icon type="fullscreen" /><span>{{ text }}</span> </a-button>
</a-button> </a-tooltip>
</a-tooltip>
</template>
<template v-else>
<a-tooltip :title="`${text} 点击进入节点管理`" @click="handleNode(record)">
<a-button type="link" style="padding: 0px" size="small">
<a-icon type="fullscreen" /><span>{{ text }}</span>
</a-button>
</a-tooltip>
</template>
</template> </template>
</template> </template>
<a-tooltip <a-tooltip
@ -114,51 +105,49 @@
</template> </template>
<template slot="operation" slot-scope="text, record, index"> <template slot="operation" slot-scope="text, record, index">
<a-tooltip title="我在这里" :visible="showOptVisible[record.id]"> <a-space>
<a-space> <a-tooltip title="如果按钮不可用则表示当前节点已经关闭啦,需要去编辑中启用">
<a-tooltip title="如果按钮不可用则表示当前节点已经关闭啦,需要去编辑中启用"> <a-button size="small" class="jpom-node-manage-btn" type="primary" @click="handleNode(record)" :disabled="record.openStatus !== 1"><a-icon type="apartment" />管理</a-button>
<a-button size="small" class="jpom-node-manage-btn" type="primary" @click="handleNode(record)" :disabled="record.openStatus !== 1"><a-icon type="apartment" />管理</a-button> </a-tooltip>
</a-tooltip> <a-tooltip title="需要到编辑中去为一个节点绑定一个 ssh信息才能启用该功能">
<a-tooltip title="需要到编辑中去为一个节点绑定一个 ssh信息才能启用该功能"> <a-button size="small" type="primary" @click="handleTerminal(record)" :disabled="!record.sshId"><a-icon type="code" />终端</a-button>
<a-button size="small" type="primary" @click="handleTerminal(record)" :disabled="!record.sshId"><a-icon type="code" />终端</a-button> </a-tooltip>
</a-tooltip>
<a-dropdown> <a-dropdown>
<a class="ant-dropdown-link" @click="(e) => e.preventDefault()"> <a class="ant-dropdown-link" @click="(e) => e.preventDefault()">
更多 更多
<a-icon type="down" /> <a-icon type="down" />
</a> </a>
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item> <a-menu-item>
<a-button size="small" type="primary" @click="handleEdit(record)">编辑</a-button> <a-button size="small" type="primary" @click="handleEdit(record)">编辑</a-button>
</a-menu-item> </a-menu-item>
<a-menu-item> <a-menu-item>
<a-tooltip placement="leftBottom" title="删除会检查数据关联性,并且节点不存在项目或者脚本"> <a-tooltip placement="leftBottom" title="删除会检查数据关联性,并且节点不存在项目或者脚本">
<a-button size="small" type="danger" @click="handleDelete(record)">删除</a-button> <a-button size="small" type="danger" @click="handleDelete(record)">删除</a-button>
</a-tooltip> </a-tooltip>
</a-menu-item> </a-menu-item>
<a-menu-item> <a-menu-item>
<a-tooltip placement="leftBottom" title="解绑会检查数据关联性,同时将自动删除节点项目和脚本缓存信息,一般用于服务器无法连接且已经确定不再使用"> <a-tooltip placement="leftBottom" title="解绑会检查数据关联性,同时将自动删除节点项目和脚本缓存信息,一般用于服务器无法连接且已经确定不再使用">
<a-button size="small" type="danger" @click="handleUnbind(record)">解绑</a-button> <a-button size="small" type="danger" @click="handleUnbind(record)">解绑</a-button>
</a-tooltip> </a-tooltip>
</a-menu-item> </a-menu-item>
<a-menu-divider /> <a-menu-divider />
<a-menu-item> <a-menu-item>
<a-button size="small" type="primary" :disabled="(listQuery.page - 1) * listQuery.limit + (index + 1) <= 1" @click="sortItemHander(record, index, 'top')">置顶</a-button> <a-button size="small" type="primary" :disabled="(listQuery.page - 1) * listQuery.limit + (index + 1) <= 1" @click="sortItemHander(record, index, 'top')">置顶</a-button>
</a-menu-item> </a-menu-item>
<a-menu-item> <a-menu-item>
<a-button size="small" type="primary" :disabled="(listQuery.page - 1) * listQuery.limit + (index + 1) <= 1" @click="sortItemHander(record, index, 'up')">上移</a-button> <a-button size="small" type="primary" :disabled="(listQuery.page - 1) * listQuery.limit + (index + 1) <= 1" @click="sortItemHander(record, index, 'up')">上移</a-button>
</a-menu-item> </a-menu-item>
<a-menu-item> <a-menu-item>
<a-button size="small" type="primary" :disabled="(listQuery.page - 1) * listQuery.limit + (index + 1) === listQuery.total" @click="sortItemHander(record, index, 'down')"> <a-button size="small" type="primary" :disabled="(listQuery.page - 1) * listQuery.limit + (index + 1) === listQuery.total" @click="sortItemHander(record, index, 'down')">
下移 下移
</a-button> </a-button>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</a-dropdown> </a-dropdown>
</a-space> </a-space>
</a-tooltip>
</template> </template>
</a-table> </a-table>
@ -284,7 +273,7 @@ export default {
list: [], list: [],
groupList: [], groupList: [],
showOptVisible: {},
temp: {}, temp: {},
editNodeVisible: false, editNodeVisible: false,
@ -332,36 +321,20 @@ export default {
}; };
}, },
}, },
watch: { watch: {},
$route() {
this.findTipNode();
},
},
created() { created() {
this.loadData().then(() => { const searchNodeName = this.$route.query.searchNodeName;
this.findTipNode(); if (searchNodeName) {
}); this.listQuery = { ...this.listQuery, "%name%": searchNodeName };
}
this.loadData();
this.loadGroupList(); this.loadGroupList();
}, },
methods: { methods: {
formatDuration, formatDuration,
renderSize, renderSize,
findTipNode() {
if (this.$route.query.tipNodeId) {
this.showOptVisible[this.$route.query.tipNodeId] = true;
this.showOptVisible = { ...this.showOptVisible };
setTimeout(() => {
this.showOptVisible[this.$route.query.tipNodeId] = false;
this.showOptVisible = { ...this.showOptVisible };
let query = Object.assign({}, this.$route.query);
delete query.tipNodeId;
this.$router.replace({
query: query,
});
}, 10000);
}
},
// //
introGuide() { introGuide() {
this.$store.dispatch("tryOpenGuide", { this.$store.dispatch("tryOpenGuide", {

View File

@ -31,7 +31,7 @@
<template slot="nodeId" slot-scope="text, record"> <template slot="nodeId" slot-scope="text, record">
<template v-if="record.linkNode"> <template v-if="record.linkNode">
<a-tooltip placement="topLeft" :title="`节点名称:${record.linkNode.name}`"> <a-tooltip placement="topLeft" :title="`节点名称:${record.linkNode.name}`">
<a-button size="small" style="width: 90px; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis" type="" @click="toNode(record.linkNode.id)"> <a-button size="small" style="width: 90px; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis" type="" @click="toNode(record.linkNode)">
{{ record.linkNode.name }} {{ record.linkNode.name }}
</a-button> </a-button>
</a-tooltip> </a-tooltip>
@ -344,14 +344,28 @@ export default {
}); });
}, },
// //
toNode(nodeId) { toNode(node) {
this.$router.push({ const newpage = this.$router.resolve({
name: "node_" + node.id,
path: "/node/list", path: "/node/list",
query: { query: {
...this.$route.query, ...this.$route.query,
tipNodeId: nodeId, nodeId: node.id,
pId: "manage",
id: "manageList",
wid: node.workspaceId,
searchNodeName: node.name,
}, },
}); });
window.open(newpage.href, "_blank");
// this.$router.push({
// path: "/node/list",
// query: {
// ...this.$route.query,
// tipNodeId: nodeId,
// },
// });
}, },
// //

View File

@ -301,7 +301,7 @@
<a-row> <a-row>
<a-col :span="10">节点名称{{ item.name }}</a-col> <a-col :span="10">节点名称{{ item.name }}</a-col>
<a-col :span="10">所属工作空间 {{ item.workspace && item.workspace.name }}</a-col> <a-col :span="10">所属工作空间 {{ item.workspace && item.workspace.name }}</a-col>
<a-col :span="4"> <a-button type="link" icon="login" @click="toNode(item.id, item.workspace && item.workspace.id)"> </a-button></a-col> <a-col :span="4"> <a-button type="link" icon="login" @click="toNode(item.id, item.name, item.workspace && item.workspace.id)"> </a-button></a-col>
</a-row> </a-row>
</a-list-item> </a-list-item>
</a-list> </a-list>
@ -605,7 +605,7 @@ export default {
} }
}); });
}, },
toNode(nodeId, wid) { toNode(nodeId, name, wid) {
const newpage = this.$router.resolve({ const newpage = this.$router.resolve({
name: "node_" + nodeId, name: "node_" + nodeId,
path: "/node/list", path: "/node/list",
@ -615,6 +615,7 @@ export default {
pId: "manage", pId: "manage",
id: "manageList", id: "manageList",
wid: wid, wid: wid,
searchNodeName: name,
}, },
}); });
window.open(newpage.href, "_blank"); window.open(newpage.href, "_blank");

View File

@ -240,9 +240,15 @@
</a-modal> </a-modal>
<a-modal destroyOnClose v-model="configWorkspaceSshVisible" width="50%" title="配置ssh" @ok="handleConfigWorkspaceSshOk" :maskClosable="false"> <a-modal destroyOnClose v-model="configWorkspaceSshVisible" width="50%" title="配置ssh" @ok="handleConfigWorkspaceSshOk" :maskClosable="false">
<a-form-model ref="editConfigWorkspaceSshForm" :rules="rules" :model="temp" :label-col="{ span: 4 }" :wrapper-col="{ span: 18 }"> <a-form-model ref="editConfigWorkspaceSshForm" :rules="rules" :model="temp" :label-col="{ span: 4 }" :wrapper-col="{ span: 18 }">
<a-form-model-item label="" :label-col="{ span: 0 }" :wrapper-col="{ span: 24 }">
<a-alert message="当前配置仅对选择的工作空间生效,其他工作空间需要另行配置" banner />
</a-form-model-item>
<a-form-model-item label="SSH 名称"> <a-form-model-item label="SSH 名称">
<a-input v-model="temp.name" :disabled="true" :maxLength="50" placeholder="SSH 名称" /> <a-input v-model="temp.name" :disabled="true" :maxLength="50" placeholder="SSH 名称" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="工作空间名称">
<a-input v-model="temp.workspaceName" :disabled="true" :maxLength="50" placeholder="工作空间名称" />
</a-form-model-item>
<a-form-model-item prop="fileDirs"> <a-form-model-item prop="fileDirs">
<template slot="label"> <template slot="label">
@ -551,6 +557,7 @@ export default {
name: item.name, name: item.name,
fileDirs: item.fileDirs ? JSON.parse(item.fileDirs).join("\r\n") : "", fileDirs: item.fileDirs ? JSON.parse(item.fileDirs).join("\r\n") : "",
allowEditSuffix: item.allowEditSuffix ? JSON.parse(item.allowEditSuffix).join("\r\n") : "", allowEditSuffix: item.allowEditSuffix ? JSON.parse(item.allowEditSuffix).join("\r\n") : "",
workspaceName: item.workspace?.name,
}; };
this.configWorkspaceSshVisible = true; this.configWorkspaceSshVisible = true;
}, },