Skip to content

Commit

Permalink
fix: delete node
Browse files Browse the repository at this point in the history
  • Loading branch information
suixinio committed Oct 22, 2024
1 parent 108743a commit 08de282
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions hub-ui/src/utils/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
}
Expand Down
2 changes: 1 addition & 1 deletion hub-ui/src/views/headscale/node/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: '删除成功',
Expand Down
9 changes: 3 additions & 6 deletions hub/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 08de282

Please sign in to comment.