diff --git a/docker/orion-ops/Dockerfile b/docker/orion-ops/Dockerfile
index 602715d0..069ff5c2 100644
--- a/docker/orion-ops/Dockerfile
+++ b/docker/orion-ops/Dockerfile
@@ -13,7 +13,7 @@ RUN sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config &&
ssh-keygen -t ed25519 -P '' -f /etc/ssh/ssh_host_ed25519_key && \
echo 'root:orionadmin' | chpasswd
WORKDIR /app
-COPY orion-ops-api/target/orion-ops-api-1.2.0.jar /app/app.jar
+COPY orion-ops-api/orion-ops-web/target/orion-ops-web-1.2.0.jar /app/app.jar
COPY orion-ops-vue/dist/index.html /usr/share/nginx/html/
COPY orion-ops-vue/dist /usr/share/nginx/html/ops
ADD docker/orion-ops/entrypoint.sh /app/entrypoint.sh
diff --git a/orion-ops-vue/src/lib/api.js b/orion-ops-vue/src/lib/api.js
index 9bebbf4b..88a227e9 100644
--- a/orion-ops-vue/src/lib/api.js
+++ b/orion-ops-vue/src/lib/api.js
@@ -2427,6 +2427,24 @@ const $api = {
})
},
+ /**
+ * 安装机器监控插件
+ */
+ installMachineMonitorAgent: param => {
+ return $http.$post('/monitor/install', param, {
+ loading: '正在安装/启动...'
+ })
+ },
+
+ /**
+ * 升级机器监控插件
+ */
+ upgradeMachineMonitorAgent: param => {
+ return $http.$post('/monitor/upgrade', param, {
+ loading: '正在升级...'
+ })
+ },
+
/**
* 查询机器监控指标
*/
diff --git a/orion-ops-vue/src/lib/enum.js b/orion-ops-vue/src/lib/enum.js
index fa50dcd3..06791786 100644
--- a/orion-ops-vue/src/lib/enum.js
+++ b/orion-ops-vue/src/lib/enum.js
@@ -191,14 +191,14 @@ export const MACHINE_PROXY_TYPE = {
label: 'http',
color: '#228BE6'
},
- SOCKET4: {
+ SOCKS4: {
value: 2,
- label: 'socket4',
+ label: 'socks4',
color: '#1098AD'
},
- SOCKET5: {
+ SOCKS5: {
value: 3,
- label: 'socket5',
+ label: 'socks5',
color: '#0CA678'
}
}
@@ -2459,25 +2459,20 @@ export const IMPORT_TYPE = {
* 监控状态
*/
export const MONITOR_STATUS = {
- NOT_INSTALL: {
- value: 1,
- label: '未安装',
- color: ''
- },
- INSTALLING: {
- value: 2,
- label: '安装中',
- color: 'green'
- },
NOT_START: {
- value: 3,
- label: '未运行',
- color: ''
+ value: 1,
+ label: '未启动',
+ status: 'default'
},
- STARTED: {
- value: 4,
+ STARTING: {
+ value: 2,
+ label: '启动中',
+ status: 'success'
+ },
+ RUNNING: {
+ value: 3,
label: '运行中',
- color: 'blue'
+ status: 'processing'
}
}
diff --git a/orion-ops-vue/src/views/machine/MachineMonitorList.vue b/orion-ops-vue/src/views/machine/MachineMonitorList.vue
index d1cb7965..fcabaedd 100644
--- a/orion-ops-vue/src/views/machine/MachineMonitorList.vue
+++ b/orion-ops-vue/src/views/machine/MachineMonitorList.vue
@@ -53,9 +53,8 @@
-
- {{ record.status | formatStatus('label') }}
-
+
@@ -69,43 +68,30 @@
最新版本: V{{ record.latestVersion }} 点击进行升级
-
+
升级
-
+
+ @click="installMonitor(record)">
+ 安装
+
+
+
监控
-
-
- 安装
-
-
-
- 启动
-
-
-
- 同步
-
-
插件配置
报警配置
@@ -226,17 +212,21 @@ export default {
this.getList({})
}
},
- toMonitor(machineId) {
- this.$message.success(machineId)
+ installMonitor(record) {
+ record.status = MONITOR_STATUS.STARTING.value
+ this.$api.installMachineMonitorAgent({
+ machineId: record.machineId
+ }).then(({ data }) => {
+ record.status = data
+ })
},
- installMonitor(machineId) {
- this.$message.success(machineId)
- },
- upgradeVersion(machineId) {
- this.$message.success(machineId)
- },
- syncMonitor(machineId) {
- this.$message.success(machineId)
+ upgradeVersion(record) {
+ record.status = MONITOR_STATUS.STARTING.value
+ this.$api.upgradeMachineMonitorAgent({
+ machineId: record.machineId
+ }).then(({ data }) => {
+ record.status = data
+ })
},
openAgentSetting(machineId) {
this.$refs.configModal.open(machineId)
@@ -244,7 +234,6 @@ export default {
resetForm() {
this.$refs.query.resetFields()
this.$refs.machineSelector.reset()
- this.$refs.userSelector && this.$refs.userSelector.reset()
this.query.machineId = undefined
this.query.machineName = undefined
this.query.status = undefined
diff --git a/orion-ops-vue/src/views/machine/MachineMonitorMetrics.vue b/orion-ops-vue/src/views/machine/MachineMonitorMetrics.vue
index 81ef47a9..a47a7aae 100644
--- a/orion-ops-vue/src/views/machine/MachineMonitorMetrics.vue
+++ b/orion-ops-vue/src/views/machine/MachineMonitorMetrics.vue
@@ -124,7 +124,7 @@ export default {
machineId: this.machineId
}).then(({ data }) => {
this.config = data
- this.monitorStarted = MONITOR_STATUS.STARTED.value === data.status
+ this.monitorStarted = MONITOR_STATUS.RUNNING.value === data.status
if (!this.monitorStarted && (this.active === 1 || this.active === 2)) {
this.$message.warning('监控插件未运行')
}