From 8ced61697aea943aa0e25ff52f6b705715614242 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sat, 30 Jul 2022 19:48:12 +0800 Subject: [PATCH] Fix save docker host issue --- server/client.js | 2 +- server/docker.js | 4 ++-- server/model/docker_host.js | 10 +++++----- src/components/DockerHostDialog.vue | 11 ++++++++++- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/server/client.js b/server/client.js index 69892e662..a0c52e1e4 100644 --- a/server/client.js +++ b/server/client.js @@ -139,7 +139,7 @@ async function sendDockerHostList(socket) { ]); for (let bean of list) { - result.push(bean.export()); + result.push(bean.toJSON()); } io.to(socket.userID).emit("dockerHostList", result); diff --git a/server/docker.js b/server/docker.js index 1c939d647..177fa6cb6 100644 --- a/server/docker.js +++ b/server/docker.js @@ -26,8 +26,8 @@ class DockerHost { } bean.user_id = userID; - bean.docker_daemon = dockerHost.docker_daemon; - bean.docker_type = dockerHost.docker_type; + bean.docker_daemon = dockerHost.dockerDaemon; + bean.docker_type = dockerHost.dockerType; bean.name = dockerHost.name; await R.store(bean); diff --git a/server/model/docker_host.js b/server/model/docker_host.js index 229a9a52d..205982922 100644 --- a/server/model/docker_host.js +++ b/server/model/docker_host.js @@ -7,11 +7,11 @@ class DockerHost extends BeanModel { */ toJSON() { return { - id: this._id, - userId: this._user_id, - daemon: this._dockerDaemon, - type: this._dockerType, - name: this._name, + id: this.id, + userID: this.user_id, + dockerDaemon: this.docker_daemon, + dockerType: this.docker_type, + name: this.name, }; } } diff --git a/src/components/DockerHostDialog.vue b/src/components/DockerHostDialog.vue index d7cf2de0d..681cc244f 100644 --- a/src/components/DockerHostDialog.vue +++ b/src/components/DockerHostDialog.vue @@ -52,8 +52,9 @@