feat: update home.vue and auto-update.sh

This commit is contained in:
Ming.wei 2025-11-22 23:40:52 +08:00
parent e591850ae7
commit 85c9047b84
2 changed files with 11 additions and 10 deletions

View file

@ -14,7 +14,7 @@
{{ $t('home.wish') }}
</div>
<div class="hi-hint">
let's have a wonderful day!
let's have a wonderful day!!
</div>
<div class="add-device-btn">
<div class="left-add" @click="showAddDialog">

View file

@ -207,13 +207,13 @@ enter_project_dir() {
record_current_images() {
log INFO "记录当前镜像信息..."
# 记录镜像 ID
OLD_SERVER_IMAGE=$(docker images --format "{{.ID}}" "$SERVER_IMAGE" 2>/dev/null | head -1 || echo "none")
OLD_WEB_IMAGE=$(docker images --format "{{.ID}}" "$WEB_IMAGE" 2>/dev/null | head -1 || echo "none")
# 记录镜像 ID(使用 grep 过滤更可靠)
OLD_SERVER_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}} {{.ID}}" | grep "^${SERVER_IMAGE} " | awk '{print $2}' || echo "none")
OLD_WEB_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}} {{.ID}}" | grep "^${WEB_IMAGE} " | awk '{print $2}' || echo "none")
# 记录镜像 Digest(用于完整性验证)
OLD_SERVER_DIGEST=$(docker images --digests --format "{{.Digest}}" "$SERVER_IMAGE" 2>/dev/null | head -1 || echo "none")
OLD_WEB_DIGEST=$(docker images --digests --format "{{.Digest}}" "$WEB_IMAGE" 2>/dev/null | head -1 || echo "none")
OLD_SERVER_DIGEST=$(docker images --digests --format "{{.Repository}}:{{.Tag}} {{.Digest}}" | grep "^${SERVER_IMAGE} " | awk '{print $2}' || echo "none")
OLD_WEB_DIGEST=$(docker images --digests --format "{{.Repository}}:{{.Tag}} {{.Digest}}" | grep "^${WEB_IMAGE} " | awk '{print $2}' || echo "none")
log INFO "当前 Server 镜像 ID: $OLD_SERVER_IMAGE"
log INFO "当前 Web 镜像 ID: $OLD_WEB_IMAGE"
@ -248,11 +248,12 @@ pull_latest_images() {
check_image_updates() {
log INFO "检查镜像是否有更新..."
NEW_SERVER_IMAGE=$(docker images --format "{{.ID}}" "$SERVER_IMAGE" 2>/dev/null | head -1 || echo "none")
NEW_WEB_IMAGE=$(docker images --format "{{.ID}}" "$WEB_IMAGE" 2>/dev/null | head -1 || echo "none")
# 使用 grep 过滤更可靠
NEW_SERVER_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}} {{.ID}}" | grep "^${SERVER_IMAGE} " | awk '{print $2}' || echo "none")
NEW_WEB_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}} {{.ID}}" | grep "^${WEB_IMAGE} " | awk '{print $2}' || echo "none")
NEW_SERVER_DIGEST=$(docker images --digests --format "{{.Digest}}" "$SERVER_IMAGE" 2>/dev/null | head -1 || echo "none")
NEW_WEB_DIGEST=$(docker images --digests --format "{{.Digest}}" "$WEB_IMAGE" 2>/dev/null | head -1 || echo "none")
NEW_SERVER_DIGEST=$(docker images --digests --format "{{.Repository}}:{{.Tag}} {{.Digest}}" | grep "^${SERVER_IMAGE} " | awk '{print $2}' || echo "none")
NEW_WEB_DIGEST=$(docker images --digests --format "{{.Repository}}:{{.Tag}} {{.Digest}}" | grep "^${WEB_IMAGE} " | awk '{print $2}' || echo "none")
log INFO "新 Server 镜像 ID: $NEW_SERVER_IMAGE"
log INFO "新 Web 镜像 ID: $NEW_WEB_IMAGE"