diff --git a/server/model/monitor.js b/server/model/monitor.js index ef71eacc8..27f52312b 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -673,8 +673,6 @@ class Monitor extends BeanModel { } else if (this.type === "docker") { log.debug("monitor", `[${this.name}] Prepare Options for Axios`); - const dockerHost = await R.load("docker_host", this.docker_host); - const options = { url: `/containers/${this.docker_container}/json`, timeout: this.interval * 1000 * 0.8, @@ -690,6 +688,12 @@ class Monitor extends BeanModel { }), }; + const dockerHost = await R.load("docker_host", this.docker_host); + + if (!dockerHost) { + throw new Error("Failed to load docker host config"); + } + if (dockerHost._dockerType === "socket") { options.socketPath = dockerHost._dockerDaemon; } else if (dockerHost._dockerType === "tcp") { diff --git a/src/components/ActionSelect.vue b/src/components/ActionSelect.vue index ae09e6566..78daebc26 100644 --- a/src/components/ActionSelect.vue +++ b/src/components/ActionSelect.vue @@ -1,9 +1,9 @@