From 565dc55c8a1057e771202b8e143836ea28fbcfa2 Mon Sep 17 00:00:00 2001 From: Chenyang Gao Date: Thu, 11 May 2023 17:06:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B1=E4=BD=BF=E7=94=A8TS=E5=8C=85=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E4=BD=BF=E7=94=A8=E6=A0=B8=E5=BF=83=E4=BB=93=E5=AD=90?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=EF=BC=9B=E5=A2=9E=E5=8A=A0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=EF=BC=8C=E4=B8=8E=E5=AE=A2=E6=88=B7=E7=AB=AF=E4=B8=80?= =?UTF-8?q?=E8=87=B4=EF=BC=9B=E6=8E=A7=E5=88=B6=E5=8F=B0=E5=92=8C=E9=A9=BE?= =?UTF-8?q?=E9=A9=B6=E8=88=B1=E5=A2=9E=E5=8A=A0=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=EF=BC=9B=E5=A2=9E=E5=8A=A0=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Chenyang Gao --- .gitignore | 2 + .gitmodules | 4 ++ MirageClient | 1 + cockpit_web/package-lock.json | 4 +- cockpit_web/src/App.vue | 11 ++- console_web/src/Console.vue | 5 ++ controller/cockpit.go | 11 ++- controller/cockpit_syscfg_dex.go | 2 +- controller/console.go | 24 ++++--- controller/db.go | 3 +- controller/protocol_noise_navictrl.go | 16 +++-- dex | 2 +- dist/build.go | 98 +++++++++++++++++++++++++++ go.mod | 24 +++++-- go.sum | 37 +++++----- go.work | 1 + go.work.sum | 70 +++++++------------ 17 files changed, 225 insertions(+), 90 deletions(-) create mode 160000 MirageClient create mode 100644 dist/build.go diff --git a/.gitignore b/.gitignore index 760e647..896fa78 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.so *.dylib __debug_bin +.swp /MirageServer # Test binary, built with `go test -c` @@ -16,6 +17,7 @@ __debug_bin # Dependency directories (remove the comment below to include it) # vendor/ +/dist/dist /output /.mirage /Mirage diff --git a/.gitmodules b/.gitmodules index 1736570..2cc46c7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,7 @@ [submodule "dex"] path = dex url = https://github.com/MirageNetwork/dex.git +[submodule "MirageClient"] + path = MirageClient + url = https://github.com/MirageNetwork/MirageClient.git + branch = main diff --git a/MirageClient b/MirageClient new file mode 160000 index 0000000..ae9f955 --- /dev/null +++ b/MirageClient @@ -0,0 +1 @@ +Subproject commit ae9f95586f6c88f0149e42bf47c27c9f7eb87adc diff --git a/cockpit_web/package-lock.json b/cockpit_web/package-lock.json index 5033974..cf931ed 100644 --- a/cockpit_web/package-lock.json +++ b/cockpit_web/package-lock.json @@ -1,11 +1,11 @@ { - "name": "newadmin", + "name": "cockpit", "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "newadmin", + "name": "cockpit", "version": "0.0.0", "dependencies": { "element-plus": "^2.3.1", diff --git a/cockpit_web/src/App.vue b/cockpit_web/src/App.vue index cd5234f..dfd21a7 100644 --- a/cockpit_web/src/App.vue +++ b/cockpit_web/src/App.vue @@ -37,6 +37,7 @@ const currentRoute = computed(() => { if (curPath.substring(0, 5) == "/navi") return "navi"; }); +const controllerVersion = ref("未知版本"); const serviceSwitch = ref(null); const serviceState = ref("stopped"); const serviceStateStr = { @@ -98,7 +99,10 @@ function getServiceState() { axios .get("/cockpit/api/service/state") .then((res) => { - serviceState.value = res.data["data"] ? "running" : "stopped"; + if (res.data["status"] == "success") { + controllerVersion.value = res.data["data"]["ctrlver"]; + serviceState.value = res.data["data"]["isRunning"] ? "running" : "stopped"; + } }) .catch((err) => { toastMsg.value = err; @@ -228,8 +232,9 @@ function doLogout() {
- diff --git a/console_web/src/Console.vue b/console_web/src/Console.vue index 3801093..af8b435 100644 --- a/console_web/src/Console.vue +++ b/console_web/src/Console.vue @@ -44,6 +44,7 @@ const currentRoute = computed(() => { }); //数据填充控制部分 +const ControllerVersion = ref("未知版本"); const SelfAccount = ref(""); const Basedomain = ref(""); const SelfName = ref(""); @@ -58,6 +59,7 @@ function getSelf() { .then(function (response) { // 处理成功情况 if (response.data["status"] == "success") { + ControllerVersion.value = response.data["data"]["ctrlver"]; SelfAccount.value = response.data["data"]["useraccount"]; Basedomain.value = response.data["data"]["basedomain"]; SelfName.value = response.data["data"]["username"]; @@ -166,6 +168,9 @@ onMounted(() => {