refactor: remove shutdown button for Docker deployment
Docker 容器化部署是长期运行的服务,移除关闭服务按钮: - 删除前端 header.ts 中的关闭按钮 - 删除 main.go 中的 /api/shutdown 接口 - 删除 router.go 中的 quit 路由和处理函数 Co-Authored-By: AI
This commit is contained in:
+2
-10
@@ -2,7 +2,7 @@ import van from 'vanjs-core'
|
||||
import { now } from 'vanjs-router'
|
||||
import { GLOBAL_HAS_LOGIN, getApi } from './mixin'
|
||||
|
||||
const { a, div, button, span } = van.tags
|
||||
const { a, div, span } = van.tags
|
||||
|
||||
export const FFmpegAvailable = van.state<boolean | null>(null)
|
||||
|
||||
@@ -18,12 +18,6 @@ export const checkFFmpeg = async () => {
|
||||
export default () => {
|
||||
const classStr = (name: string) => van.derive(() => `text-nowrap nav-link ${now.val.split('/')[0] == name ? 'active' : ''}`)
|
||||
|
||||
const shutdown = async () => {
|
||||
if (confirm('确定要关闭服务吗?')) {
|
||||
await getApi('/shutdown')
|
||||
}
|
||||
}
|
||||
|
||||
return div({ class: 'hstack gap-4' },
|
||||
div({ class: 'fs-4 fw-bold text-nowrap' }, 'Bilidown'),
|
||||
div({ class: 'nav nav-underline flex-nowrap overflow-auto' },
|
||||
@@ -46,9 +40,7 @@ export default () => {
|
||||
span({ class: () => `badge ${FFmpegAvailable.val === true ? 'bg-success' : FFmpegAvailable.val === false ? 'bg-danger' : 'bg-secondary'}` },
|
||||
() => FFmpegAvailable.val === true ? 'FFmpeg ✓' : FFmpegAvailable.val === false ? 'FFmpeg ✗' : '检查中...'
|
||||
)
|
||||
),
|
||||
// 关闭按钮
|
||||
button({ class: 'btn btn-outline-danger btn-sm', onclick: shutdown }, '关闭服务')
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user