feat: mobile style ope

This commit is contained in:
engigu
2025-12-24 11:04:39 +08:00
parent 05aeea6863
commit f70aaf058b
7 changed files with 32 additions and 32 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>白虎面板</title>
<title></title>
</head>
<body>
<div id="app"></div>
+1 -1
View File
@@ -115,7 +115,7 @@ onMounted(() => {
<Button variant="ghost" size="icon" class="h-8 w-8 lg:hidden" @click="mobileMenuOpen = true">
<Menu class="h-5 w-5" />
</Button>
<span class="text-sm text-muted-foreground hidden sm:block">{{ sentence }}</span>
<span class="text-sm text-muted-foreground truncate max-w-[200px] sm:max-w-none">{{ sentence }}</span>
</div>
<ThemeToggle />
</div>
+8 -8
View File
@@ -123,10 +123,10 @@ onMounted(loadEnvVars)
<div class="rounded-lg border bg-card overflow-x-auto">
<!-- 表头 -->
<div class="flex items-center gap-4 px-4 py-2 border-b bg-muted/50 text-sm text-muted-foreground font-medium min-w-[500px]">
<span class="w-48 shrink-0">变量名</span>
<span class="flex-1"></span>
<span class="w-48 shrink-0 hidden md:block">备注</span>
<span class="w-24 shrink-0 text-center">操作</span>
<span class="w-32 sm:w-48 shrink-0">变量名</span>
<span class="w-24 sm:flex-1 shrink-0 sm:shrink"></span>
<span class="w-32 sm:w-48 shrink-0 hidden md:block">备注</span>
<span class="w-20 sm:w-24 shrink-0 text-center">操作</span>
</div>
<!-- 列表 -->
<div class="divide-y min-w-[500px]">
@@ -138,14 +138,14 @@ onMounted(loadEnvVars)
:key="env.id"
class="flex items-center gap-4 px-4 py-2 hover:bg-muted/50 transition-colors"
>
<code class="w-48 font-medium truncate shrink-0 text-xs bg-muted px-2 py-1 rounded">{{ env.name }}</code>
<span class="flex-1 font-mono text-muted-foreground truncate text-xs">
<code class="w-32 sm:w-48 font-medium truncate shrink-0 text-xs bg-muted px-2 py-1 rounded">{{ env.name }}</code>
<span class="w-24 sm:flex-1 shrink-0 sm:shrink font-mono text-muted-foreground truncate text-xs">
<TextOverflow :text="showValues[env.id] ? env.value : maskValue(env.value)" title="变量值" />
</span>
<span class="w-48 shrink-0 text-muted-foreground truncate text-sm hidden md:block">
<span class="w-32 sm:w-48 shrink-0 text-muted-foreground truncate text-sm hidden md:block">
<TextOverflow :text="env.remark || '-'" title="备注" />
</span>
<span class="w-24 shrink-0 flex justify-center gap-1">
<span class="w-20 sm:w-24 shrink-0 flex justify-center gap-1">
<Button variant="ghost" size="icon" class="h-7 w-7" @click="toggleShow(env.id)" :title="showValues[env.id] ? '隐藏' : '显示'">
<Eye v-if="!showValues[env.id]" class="h-3.5 w-3.5" />
<EyeOff v-else class="h-3.5 w-3.5" />
+4 -4
View File
@@ -142,8 +142,8 @@ watch(() => route.query.task_id, (newTaskId) => {
<!-- 表头 -->
<div class="flex items-center gap-4 px-4 py-2 border-b bg-muted/50 text-sm text-muted-foreground font-medium overflow-x-auto">
<span class="w-12 shrink-0">ID</span>
<span class="w-32 shrink-0">任务名称</span>
<span :class="selectedLog ? 'w-40 shrink-0 hidden sm:block' : 'flex-1'">命令</span>
<span class="w-20 sm:w-28 shrink-0">任务名称</span>
<span :class="selectedLog ? 'w-40 shrink-0 hidden sm:block' : 'w-32 sm:flex-1 shrink-0 sm:shrink'">命令</span>
<span class="w-12 shrink-0 text-center">状态</span>
<span class="w-20 text-right shrink-0">耗时</span>
<span v-if="!selectedLog" class="w-40 text-right shrink-0 hidden md:block">执行时间</span>
@@ -163,10 +163,10 @@ watch(() => route.query.task_id, (newTaskId) => {
@click="selectLog(log)"
>
<span class="w-12 shrink-0 text-muted-foreground text-sm">#{{ log.id }}</span>
<span class="w-32 font-medium truncate shrink-0 text-sm">
<span class="w-20 sm:w-28 font-medium truncate shrink-0 text-sm">
<TextOverflow :text="log.task_name" title="任务名称" />
</span>
<code :class="['text-muted-foreground truncate text-xs bg-muted px-2 py-1 rounded', selectedLog ? 'w-40 shrink-0 hidden sm:block' : 'flex-1']">
<code :class="['text-muted-foreground truncate text-xs bg-muted px-2 py-1 rounded', selectedLog ? 'w-40 shrink-0 hidden sm:block' : 'w-32 sm:flex-1 shrink-0 sm:shrink']">
<TextOverflow :text="log.command" title="执行命令" />
</code>
<span class="w-12 flex justify-center shrink-0">
+10 -10
View File
@@ -87,11 +87,11 @@ onMounted(loadLogs)
<div class="rounded-lg border bg-card overflow-x-auto">
<!-- 表头 -->
<div class="flex items-center gap-4 px-4 py-2 border-b bg-muted/50 text-sm text-muted-foreground font-medium min-w-[500px]">
<span class="w-24 shrink-0">用户名</span>
<span class="w-32 shrink-0">IP 地址</span>
<span class="w-16 shrink-0 text-center">状态</span>
<span class="flex-1 hidden md:block">User Agent</span>
<span class="w-40 shrink-0 text-right">时间</span>
<span class="w-20 sm:w-24 shrink-0">用户名</span>
<span class="w-24 sm:w-32 shrink-0">IP 地址</span>
<span class="w-12 sm:w-16 shrink-0 text-center">状态</span>
<span class="w-32 sm:flex-1 shrink-0 sm:shrink hidden md:block">User Agent</span>
<span class="w-32 sm:w-40 shrink-0 text-right">时间</span>
</div>
<!-- 列表 -->
<div class="divide-y min-w-[500px]">
@@ -103,15 +103,15 @@ onMounted(loadLogs)
:key="log.id"
class="flex items-center gap-4 px-4 py-2 hover:bg-muted/50 transition-colors"
>
<span class="w-24 shrink-0 font-medium text-sm truncate">{{ log.username }}</span>
<code class="w-32 shrink-0 text-xs text-muted-foreground bg-muted px-2 py-1 rounded">{{ log.ip }}</code>
<span class="w-16 shrink-0 flex justify-center">
<span class="w-20 sm:w-24 shrink-0 font-medium text-sm truncate">{{ log.username }}</span>
<code class="w-24 sm:w-32 shrink-0 text-xs text-muted-foreground bg-muted px-2 py-1 rounded truncate">{{ log.ip }}</code>
<span class="w-12 sm:w-16 shrink-0 flex justify-center">
<span :class="['h-2 w-2 rounded-full', log.status === 'success' ? 'bg-green-500' : 'bg-red-500']"></span>
</span>
<span class="flex-1 text-xs text-muted-foreground truncate hidden md:block">
<span class="w-32 sm:flex-1 shrink-0 sm:shrink text-xs text-muted-foreground truncate hidden md:block">
<TextOverflow :text="log.user_agent || '-'" title="User Agent" />
</span>
<span class="w-40 shrink-0 text-right text-xs text-muted-foreground">{{ log.created_at }}</span>
<span class="w-32 sm:w-40 shrink-0 text-right text-xs text-muted-foreground">{{ log.created_at }}</span>
</div>
</div>
<!-- 分页 -->
+4 -4
View File
@@ -64,23 +64,23 @@ onMounted(loadSettings)
<template>
<div class="space-y-4">
<div class="grid grid-cols-1 sm:grid-cols-4 items-start gap-2 sm:gap-4">
<Label class="sm:text-right pt-2">Worker数</Label>
<Label class="sm:text-right pt-2">Worker数</Label>
<div class="sm:col-span-3 space-y-1">
<Input v-model="form.worker_count" type="number" class="w-24" />
<Input v-model="form.worker_count" type="number" class="w-full sm:w-24" />
<span class="text-xs text-muted-foreground block">并发执行任务的 worker 数量</span>
</div>
</div>
<div class="grid grid-cols-1 sm:grid-cols-4 items-start gap-2 sm:gap-4">
<Label class="sm:text-right pt-2">队列大小</Label>
<div class="sm:col-span-3 space-y-1">
<Input v-model="form.queue_size" type="number" class="w-24" />
<Input v-model="form.queue_size" type="number" class="w-full sm:w-24" />
<span class="text-xs text-muted-foreground block">任务队列缓冲区大小</span>
</div>
</div>
<div class="grid grid-cols-1 sm:grid-cols-4 items-start gap-2 sm:gap-4">
<Label class="sm:text-right pt-2">速率间隔</Label>
<div class="sm:col-span-3 space-y-1">
<Input v-model="form.rate_interval" type="number" class="w-24" />
<Input v-model="form.rate_interval" type="number" class="w-full sm:w-24" />
<span class="text-xs text-muted-foreground block">ms任务启动间隔200ms = 每秒最多5个</span>
</div>
</div>
+4 -4
View File
@@ -232,8 +232,8 @@ onMounted(() => {
<!-- 表头 -->
<div class="flex items-center gap-4 px-4 py-2 border-b bg-muted/50 text-sm text-muted-foreground font-medium min-w-[700px]">
<span class="w-12 shrink-0">ID</span>
<span class="w-40 shrink-0">名称</span>
<span class="flex-1">命令</span>
<span class="w-20 sm:w-28 shrink-0">名称</span>
<span class="w-32 sm:flex-1 shrink-0 sm:shrink">命令</span>
<span class="w-32 shrink-0 hidden md:block">定时规则</span>
<span class="w-40 shrink-0 hidden lg:block">上次执行</span>
<span class="w-40 shrink-0 hidden lg:block">下次执行</span>
@@ -251,10 +251,10 @@ onMounted(() => {
class="flex items-center gap-4 px-4 py-2 hover:bg-muted/50 transition-colors"
>
<span class="w-12 shrink-0 text-muted-foreground text-sm">#{{ task.id }}</span>
<span class="w-40 font-medium truncate shrink-0 text-sm">
<span class="w-20 sm:w-28 font-medium truncate shrink-0 text-sm">
<TextOverflow :text="task.name" title="任务名称" />
</span>
<code class="flex-1 text-muted-foreground truncate text-xs bg-muted px-2 py-1 rounded">
<code class="w-32 sm:flex-1 shrink-0 sm:shrink text-muted-foreground truncate text-xs bg-muted px-2 py-1 rounded">
<TextOverflow :text="task.command" title="执行命令" />
</code>
<code class="w-36 shrink-0 text-muted-foreground text-xs bg-muted px-2 py-1 rounded hidden md:block">{{ task.schedule }}</code>