From 08de28212102dcf7605cf96aee41152df95f3f84 Mon Sep 17 00:00:00 2001 From: suixinio Date: Tue, 22 Oct 2024 10:49:18 +0000 Subject: [PATCH] fix: delete node --- hub-ui/src/utils/date.js | 4 ++-- hub-ui/src/views/headscale/node/index.vue | 2 +- hub/Dockerfile | 9 +++------ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/hub-ui/src/utils/date.js b/hub-ui/src/utils/date.js index 2a593f1..6bc6165 100644 --- a/hub-ui/src/utils/date.js +++ b/hub-ui/src/utils/date.js @@ -99,9 +99,9 @@ export function formatAfterDateTime(timestamp = { seconds: 0, nanos: 0 }) { return `${Math.floor(diff / (60 * 1000))} 分前` } else if (diff <= 24 * 60 * 60 * 1000) { // options = { hour: 'numeric', minute: 'numeric' } - return `${Math.floor(diff / (24 * 60 * 1000))} 小时前}` + return `${Math.floor(diff / (24 * 60 * 1000))} 小时前` } else if (diff <= 3 * 24 * 60 * 60 * 1000) { - return `${Math.floor(diff / (24 * 60 * 60 * 1000))} 天前}` + return `${Math.floor(diff / (24 * 60 * 60 * 1000))} 天前` } else { options = { year: 'numeric', month: 'long', day: 'numeric' } } diff --git a/hub-ui/src/views/headscale/node/index.vue b/hub-ui/src/views/headscale/node/index.vue index cd3ab4a..f1dd799 100644 --- a/hub-ui/src/views/headscale/node/index.vue +++ b/hub-ui/src/views/headscale/node/index.vue @@ -132,7 +132,7 @@ export default { // 单个删除 async singleDelete(Id) { this.loading = true - await deleteNode({ node_key: Id }).then(res => { + await deleteNode({ node_id: Id }).then(res => { this.$message({ showClose: true, message: '删除成功', diff --git a/hub/Dockerfile b/hub/Dockerfile index fa64a35..cf6b286 100644 --- a/hub/Dockerfile +++ b/hub/Dockerfile @@ -1,21 +1,18 @@ FROM golang:1.23.0-alpine AS builder - WORKDIR /hub +RUN apk update +RUN apk add --no-cache build-base COPY go.mod go.mod COPY go.sum go.sum RUN go mod download - COPY . . -RUN go build -o headscale-hub . +RUN CGO_ENABLED=1 go build -o headscale-hub . FROM alpine:latest - RUN apk --no-cache add tzdata && \ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ echo "Asia/Shanghai" > /etc/timezone - WORKDIR /hub - COPY --from=builder /hub/headscale-hub /bin/headscale-hub EXPOSE 8088/tcp CMD ["headscale-hub", "-c", "/hub/config.yml"]