fix: Telegram 开关多 worker 同步与服务器行内详情展开

关闭 notify_* 后通过 Redis 广播同步各 worker 内存设置;修复 expanded id 类型不匹配导致点击名称无法展开详情。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Nexus Agent
2026-06-08 13:05:22 +08:00
parent a5b1d34cec
commit 27da842a20
182 changed files with 3593 additions and 49 deletions
+40
View File
@@ -846,3 +846,43 @@
{"ts":"2026-06-08T12:47:57+08:00","date":"2026-06-08","gate":"shell_eol","result":"PASS","detail":"all tracked sh LF"}
{"ts":"2026-06-08T12:47:57+08:00","date":"2026-06-08","gate":"text_eol","result":"PASS","detail":"git index LF"}
{"ts":"2026-06-08T12:47:57+08:00","date":"2026-06-08","gate":"summary","result":"PASS","detail":"7/7"}
{"ts":"2026-06-08T12:55:08+08:00","date":"2026-06-08","gate":"changelog","result":"PASS","detail":"2026-06-08-servers-unset-path-batch-parity.md 27lines"}
{"ts":"2026-06-08T12:55:08+08:00","date":"2026-06-08","gate":"audit","result":"PASS","detail":"2026-06-08-servers-unset-path-batch-parity.md"}
{"ts":"2026-06-08T12:55:08+08:00","date":"2026-06-08","gate":"test","result":"PASS","detail":"all passed"}
{"ts":"2026-06-08T12:55:08+08:00","date":"2026-06-08","gate":"lint","result":"PASS","detail":"0 violations"}
{"ts":"2026-06-08T12:55:08+08:00","date":"2026-06-08","gate":"import","result":"PASS","detail":"ok"}
{"ts":"2026-06-08T12:55:08+08:00","date":"2026-06-08","gate":"security","result":"PASS","detail":"0 HIGH"}
{"ts":"2026-06-08T12:55:08+08:00","date":"2026-06-08","gate":"review","result":"BLOCK","detail":"audit missing changed files"}
{"ts":"2026-06-08T12:55:08+08:00","date":"2026-06-08","gate":"shell_eol","result":"PASS","detail":"all tracked sh LF"}
{"ts":"2026-06-08T12:55:08+08:00","date":"2026-06-08","gate":"text_eol","result":"PASS","detail":"git index LF"}
{"ts":"2026-06-08T12:55:08+08:00","date":"2026-06-08","gate":"summary","result":"BLOCK","detail":"6/7"}
{"ts":"2026-06-08T12:55:20+08:00","date":"2026-06-08","gate":"changelog","result":"PASS","detail":"2026-06-08-servers-unset-path-batch-parity.md 27lines"}
{"ts":"2026-06-08T12:55:20+08:00","date":"2026-06-08","gate":"audit","result":"PASS","detail":"2026-06-08-servers-unset-path-batch-parity.md"}
{"ts":"2026-06-08T12:55:20+08:00","date":"2026-06-08","gate":"test","result":"PASS","detail":"all passed"}
{"ts":"2026-06-08T12:55:20+08:00","date":"2026-06-08","gate":"lint","result":"PASS","detail":"0 violations"}
{"ts":"2026-06-08T12:55:20+08:00","date":"2026-06-08","gate":"import","result":"PASS","detail":"ok"}
{"ts":"2026-06-08T12:55:20+08:00","date":"2026-06-08","gate":"security","result":"PASS","detail":"0 HIGH"}
{"ts":"2026-06-08T12:55:20+08:00","date":"2026-06-08","gate":"review","result":"PASS","detail":"audit covers changes"}
{"ts":"2026-06-08T12:55:20+08:00","date":"2026-06-08","gate":"shell_eol","result":"PASS","detail":"all tracked sh LF"}
{"ts":"2026-06-08T12:55:20+08:00","date":"2026-06-08","gate":"text_eol","result":"PASS","detail":"git index LF"}
{"ts":"2026-06-08T12:55:20+08:00","date":"2026-06-08","gate":"summary","result":"PASS","detail":"7/7"}
{"ts":"2026-06-08T13:04:19+08:00","date":"2026-06-08","gate":"changelog","result":"PASS","detail":"2026-06-08-servers-inline-detail-expand-fix.md 28lines"}
{"ts":"2026-06-08T13:04:19+08:00","date":"2026-06-08","gate":"audit","result":"PASS","detail":"2026-06-08-notify-toggle-inline-detail-deploy.md"}
{"ts":"2026-06-08T13:04:19+08:00","date":"2026-06-08","gate":"test","result":"BLOCK","detail":"tests failed"}
{"ts":"2026-06-08T13:04:19+08:00","date":"2026-06-08","gate":"lint","result":"PASS","detail":"0 violations"}
{"ts":"2026-06-08T13:04:19+08:00","date":"2026-06-08","gate":"import","result":"PASS","detail":"ok"}
{"ts":"2026-06-08T13:04:19+08:00","date":"2026-06-08","gate":"security","result":"PASS","detail":"0 HIGH"}
{"ts":"2026-06-08T13:04:19+08:00","date":"2026-06-08","gate":"review","result":"PASS","detail":"audit covers changes"}
{"ts":"2026-06-08T13:04:19+08:00","date":"2026-06-08","gate":"shell_eol","result":"PASS","detail":"all tracked sh LF"}
{"ts":"2026-06-08T13:04:19+08:00","date":"2026-06-08","gate":"text_eol","result":"PASS","detail":"git index LF"}
{"ts":"2026-06-08T13:04:19+08:00","date":"2026-06-08","gate":"summary","result":"BLOCK","detail":"6/7"}
{"ts":"2026-06-08T13:04:52+08:00","date":"2026-06-08","gate":"changelog","result":"PASS","detail":"2026-06-08-servers-inline-detail-expand-fix.md 28lines"}
{"ts":"2026-06-08T13:04:52+08:00","date":"2026-06-08","gate":"audit","result":"PASS","detail":"2026-06-08-notify-toggle-inline-detail-deploy.md"}
{"ts":"2026-06-08T13:04:52+08:00","date":"2026-06-08","gate":"test","result":"PASS","detail":"all passed"}
{"ts":"2026-06-08T13:04:52+08:00","date":"2026-06-08","gate":"lint","result":"PASS","detail":"0 violations"}
{"ts":"2026-06-08T13:04:52+08:00","date":"2026-06-08","gate":"import","result":"PASS","detail":"ok"}
{"ts":"2026-06-08T13:04:52+08:00","date":"2026-06-08","gate":"security","result":"PASS","detail":"0 HIGH"}
{"ts":"2026-06-08T13:04:52+08:00","date":"2026-06-08","gate":"review","result":"PASS","detail":"audit covers changes"}
{"ts":"2026-06-08T13:04:52+08:00","date":"2026-06-08","gate":"shell_eol","result":"PASS","detail":"all tracked sh LF"}
{"ts":"2026-06-08T13:04:52+08:00","date":"2026-06-08","gate":"text_eol","result":"PASS","detail":"git index LF"}
{"ts":"2026-06-08T13:04:52+08:00","date":"2026-06-08","gate":"summary","result":"PASS","detail":"7/7"}
@@ -0,0 +1,31 @@
# 审计 — Telegram 开关多 Worker 同步 + 服务器行内详情展开
**Changelog**:
- `docs/changelog/2026-06-08-notify-toggle-multi-worker-sync.md`
- `docs/changelog/2026-06-08-servers-inline-detail-expand-fix.md`
## 变更文件
`server/config.py` · `server/infrastructure/settings_broadcast.py` · `server/utils/notify_toggles.py` · `server/api/settings.py` · `server/main.py` · `server/infrastructure/telegram/__init__.py` · `tests/test_notify_toggle_sync.py` · `frontend/src/pages/ServersPage.vue` · `frontend/src/components/servers/ServerUnsetPathPanel.vue`
## Step 3
| 项 | 结论 |
|----|------|
| NOTIFY_* 关闭后 Telegram 不发送 | PASShelper + 单测 9 开关) |
| 多 worker 热更新 | PASSRedis `nexus:settings` 广播) |
| WebSocket / alert_logs 仍记录 | PASS(仅 Telegram 门控,符合设置页文案) |
| expanded 与 item-value 数字 id 一致 | PASSnumber[] + computed 桥接) |
| 无静默吞错 | PASSbroadcast publish 失败打 warning |
## Closure
Gate 7/7 待跑 · pytest notify 31/31 · frontend build PASS
## DoD
- [x] Settings 关 CPU 告警 → 任意 worker 不推 Telegram
- [x] 点击服务器名称展开 ServerInlineDetail
- [x] 未设路径区块同样可展开
- [x] changelog ×2
- [ ] 生产 /health + 浏览器验收
@@ -0,0 +1,43 @@
# 2026-06-08 — 告警 Telegram 开关多 Worker 同步
## 摘要
修复 Settings 关闭「CPU/内存/磁盘等资源告警 Telegram 通知」后仍收到 Telegram 的问题。根因:多 uvicorn worker 下仅处理 PUT 的进程热更新了内存 `settings`,处理 Agent 心跳的其他 worker 仍认为开关为开启。
## 动机
用户关闭「CPU 超阈值告警」等 notify_* 开关后 Telegram 仍推送;设置页文案已说明「关闭后不发送 Telegram」,但生产 `--workers 4` 时行为不一致。
## 变更
1. **`server/config.py`** — 新增 `apply_db_override(db_key, value)`,统一单条设置热更新逻辑。
2. **`server/infrastructure/settings_broadcast.py`** — 新增 Redis 频道 `nexus:settings`PUT 后 publish,各 worker 订阅并 `apply_db_override`
3. **`server/main.py`** — lifespan 启动/停止 settings subscriber。
4. **`server/api/settings.py`** — `set_setting` 热更新后调用 `publish_setting_change`
5. **`server/utils/notify_toggles.py`** — 集中 `notify_enabled` / `resource_alert_notify_enabled` 等 helper。
6. **`server/infrastructure/telegram/__init__.py`** — 全部 Telegram 发送入口复用 notify helper(行为不变,逻辑集中)。
7. **`tests/test_notify_toggle_sync.py`** — 开关解析、Telegram 跳过、广播 publish 测试。
## 涉及文件
- `server/config.py`
- `server/infrastructure/settings_broadcast.py`
- `server/main.py`
- `server/api/settings.py`
- `server/utils/notify_toggles.py`
- `server/infrastructure/telegram/__init__.py`
- `tests/test_notify_toggle_sync.py`
## 迁移 / 重启
- 无 DB 迁移。
- 需重启后端(或部署)以加载 settings subscriber。
## 验证
```bash
pytest tests/test_notify_toggle_sync.py tests/test_settings_telegram.py -q
```
- Settings 关闭 CPU 告警 → 任意 worker 处理心跳时 `send_telegram_alert` 返回 False,不调用 Telegram API。
- WebSocket 告警与 `alert_logs` 仍记录(与设置页说明一致)。
@@ -0,0 +1,28 @@
# 2026-06-08 — 服务器名称点击展开详情修复
## 摘要
修复服务器列表点击名称后箭头旋转但行内详情(CPU/内存/同步日志)不显示的问题。
## 动机
`v-data-table-server``item-value="id"` 为数字,但 `v-model:expanded` 误用 `string[]``String(item.id)`),Vuetify 无法匹配展开行,仅自定义 chevron 图标会切换。
## 变更
- `frontend/src/pages/ServersPage.vue``expandedMainIds` / `expandedUnsetIds` 改为 `number[]`
- `frontend/src/components/servers/ServerUnsetPathPanel.vue` — 同步 expanded ids 类型
## 涉及文件
- `frontend/src/pages/ServersPage.vue`
- `frontend/src/components/servers/ServerUnsetPathPanel.vue`
## 迁移 / 重启
无;前端构建部署即可。
## 验证
- 服务器页表格模式:点击名称 → 展开 `ServerInlineDetail`(资源指标 + 同步日志)
- 未设路径区块同样可展开
@@ -189,7 +189,7 @@ const props = defineProps<{
page: number
itemsPerPage: number
itemsPerPageOptions: ReadonlyArray<{ readonly value: number; readonly title: string }>
expandedIds: string[]
expandedIds: number[]
selectedItems: Array<ServerApiItem | number>
selectAllLoading: boolean
editingPathId: number | null
@@ -202,7 +202,7 @@ const emit = defineEmits<{
'update:page': [page: number]
'update:items-per-page': [n: number]
'update:selected-items': [items: Array<ServerApiItem | number>]
'update:expanded-ids': [ids: string[]]
'update:expanded-ids': [ids: number[]]
'update:editing-path-value': [value: string]
'select-all-filtered': []
'toggle-expand': [item: ServerApiItem]
@@ -238,12 +238,17 @@ const headers = [
const selectedCount = computed(() => normalizeServerIds(props.selectedItems).length)
const expandedModel = computed({
get: () => props.expandedIds,
set: (ids: string[]) => emit('update:expanded-ids', ids),
get: () => props.expandedIds as unknown as readonly string[],
set: (ids: readonly string[]) => {
emit(
'update:expanded-ids',
ids.map((id) => Number(id)).filter((n) => !Number.isNaN(n)),
)
},
})
function isExpandedId(id: number): boolean {
return props.expandedIds.includes(String(id))
return props.expandedIds.includes(id)
}
</script>
+23 -14
View File
@@ -122,7 +122,7 @@
show-select
v-model="selectedItems"
v-model:sort-by="sortBy"
v-model:expanded="expandedMainIds"
v-model:expanded="expandedMainIdsModel"
show-expand
class="server-main-table"
@update:page="onMainPageChange"
@@ -141,7 +141,7 @@
@click.stop="toggleMainExpand(item)"
>
<v-icon size="small" class="mr-1">
{{ expandedMainIds.includes(String(item.id)) ? 'mdi-chevron-down' : 'mdi-chevron-right' }}
{{ expandedMainIds.includes(item.id) ? 'mdi-chevron-down' : 'mdi-chevron-right' }}
</v-icon>
<span class="font-weight-medium">{{ item.name }}</span>
</div>
@@ -588,7 +588,7 @@
</template>
<script setup lang="ts">
import { ref, computed, watch, onMounted, onBeforeUnmount } from 'vue'
import { ref, computed, watch, onMounted, onBeforeUnmount, type Ref } from 'vue'
import { usePageAutoRefresh } from '@/composables/usePageAutoRefresh'
import { usePageActivateRefresh } from '@/composables/usePageActivateRefresh'
import { CACHE_KEYS, cachedFetch } from '@/composables/useCachedQuery'
@@ -692,8 +692,20 @@ const unsetPathTotal = ref(0)
const unsetPathLoading = ref(false)
const unsetPathPage = ref(1)
const unsetPathItemsPerPage = ref(10)
const expandedMainIds = ref<string[]>([])
const expandedUnsetIds = ref<string[]>([])
const expandedMainIds = ref<number[]>([])
const expandedUnsetIds = ref<number[]>([])
/** v-data-table 运行时按 item-value(数字 id)匹配,类型声明为 string[] */
function expandedTableModel(source: Ref<number[]>) {
return computed({
get: () => source.value as unknown as readonly string[],
set: (ids: readonly string[]) => {
source.value = ids.map((id) => Number(id)).filter((n) => !Number.isNaN(n))
},
})
}
const expandedMainIdsModel = expandedTableModel(expandedMainIds)
const unsetSelectedItems = ref<Array<ServerApiItem | number>>([])
const unsetSelectedIds = computed(() => new Set(normalizeServerIds(unsetSelectedItems.value)))
const selectAllUnsetLoading = ref(false)
@@ -752,13 +764,11 @@ async function loadUnsetPathServers(silent = false) {
}
function toggleMainExpand(item: ServerApiItem) {
const key = String(item.id)
expandedMainIds.value = expandedMainIds.value.includes(key) ? [] : [key]
expandedMainIds.value = expandedMainIds.value.includes(item.id) ? [] : [item.id]
}
function toggleUnsetExpand(item: ServerApiItem) {
const key = String(item.id)
expandedUnsetIds.value = expandedUnsetIds.value.includes(key) ? [] : [key]
expandedUnsetIds.value = expandedUnsetIds.value.includes(item.id) ? [] : [item.id]
}
function onMainPageChange(p: number) {
@@ -795,10 +805,9 @@ async function detectPathSingle(item: ServerApiItem) {
}
function clearExpandedForPathMigration(serverId: number, newPath: string) {
const key = String(serverId)
const unset = isUnsetTargetPath(newPath)
if (expandedMainIds.value.includes(key) && unset) expandedMainIds.value = []
if (expandedUnsetIds.value.includes(key) && !unset) expandedUnsetIds.value = []
if (expandedMainIds.value.includes(serverId) && unset) expandedMainIds.value = []
if (expandedUnsetIds.value.includes(serverId) && !unset) expandedUnsetIds.value = []
}
const {
@@ -1454,8 +1463,8 @@ async function doDelete() {
try {
await http.delete(`/servers/${deletedId}`)
showDelete.value = false
expandedMainIds.value = expandedMainIds.value.filter(id => id !== String(deletedId))
expandedUnsetIds.value = expandedUnsetIds.value.filter(id => id !== String(deletedId))
expandedMainIds.value = expandedMainIds.value.filter(id => id !== deletedId)
expandedUnsetIds.value = expandedUnsetIds.value.filter(id => id !== deletedId)
await Promise.all([loadServers(), loadUnsetPathServers()])
loadStats()
snackbar('已删除')
+4 -11
View File
@@ -385,17 +385,10 @@ async def set_setting(
import logging
_logger = logging.getLogger("nexus.settings")
from server.config import settings as _settings
attr_name = _settings.DB_OVERRIDE_MAP.get(key)
if attr_name and hasattr(_settings, attr_name):
value = setting.value
if attr_name in _settings.INT_SETTINGS:
try:
value = int(value)
except (ValueError, TypeError):
_logger.warning("hot-reload: %s'%s' 无法转为 int,已跳过热更新", attr_name, value)
value = None # Skip setattr for invalid int
if value is not None:
setattr(_settings, attr_name, value)
from server.infrastructure.settings_broadcast import publish_setting_change
if _settings.apply_db_override(key, setting.value):
await publish_setting_change(key, setting.value)
# Audit log
audit_repo = AuditLogRepositoryImpl(db)
+20
View File
@@ -199,6 +199,26 @@ class Settings(BaseSettings):
logger.error(f"Failed to load settings from DB: {e}")
return 0
def apply_db_override(self, db_key: str, value: str) -> bool:
"""Apply one MySQL settings row to this in-memory instance.
Used by PUT hot-reload and Redis Pub/Sub cross-worker sync.
"""
attr_name = self.DB_OVERRIDE_MAP.get(db_key)
if not attr_name or not hasattr(self, attr_name):
return False
if value is None:
return False
parsed: str | int = value
if attr_name in self.INT_SETTINGS:
try:
parsed = int(value)
except (ValueError, TypeError):
logger.warning("Invalid int value for %s: %s, skipping hot-reload", db_key, value)
return False
setattr(self, attr_name, parsed)
return True
async def ensure_api_base_url_in_db(self, session: AsyncSession) -> None:
"""Migrate api_base_url from .env to MySQL settings table if missing.
+104
View File
@@ -0,0 +1,104 @@
"""Redis Pub/Sub — sync in-memory settings across uvicorn workers.
When one worker handles PUT /settings/{key}, it hot-reloads locally and
publishes to nexus:settings so other workers apply the same override.
"""
import asyncio
import json
import logging
from typing import Optional
logger = logging.getLogger("nexus.settings_broadcast")
REDIS_SETTINGS_CHANNEL = "nexus:settings"
_subscriber_task: Optional[asyncio.Task] = None
_redis_subscriber = None
def apply_setting_override(db_key: str, value: str) -> bool:
"""Apply a single DB settings key to the in-memory Settings singleton."""
from server.config import settings
return settings.apply_db_override(db_key, value)
async def publish_setting_change(db_key: str, value: str) -> bool:
"""Broadcast a settings change to all workers via Redis Pub/Sub."""
try:
from server.infrastructure.redis.client import get_redis
redis = get_redis()
payload = json.dumps({"key": db_key, "value": value})
await redis.publish(REDIS_SETTINGS_CHANNEL, payload)
return True
except Exception as exc:
logger.warning("Settings broadcast publish failed for %s: %s", db_key, exc)
return False
async def start_settings_subscriber() -> None:
"""Subscribe to nexus:settings — called during app startup (every worker)."""
global _subscriber_task, _redis_subscriber
try:
from server.infrastructure.redis.client import get_redis
redis = get_redis()
_redis_subscriber = redis.pubsub()
await _redis_subscriber.subscribe(REDIS_SETTINGS_CHANNEL)
_subscriber_task = asyncio.create_task(_listen_loop(), name="settings_redis_sub")
logger.info("Settings Pub/Sub subscriber started on channel: %s", REDIS_SETTINGS_CHANNEL)
except Exception as exc:
logger.error("Settings Pub/Sub subscriber failed to start: %s", exc)
async def stop_settings_subscriber() -> None:
"""Stop settings subscriber — called during app shutdown."""
global _subscriber_task, _redis_subscriber
if _subscriber_task:
_subscriber_task.cancel()
try:
await _subscriber_task
except asyncio.CancelledError:
pass
_subscriber_task = None
if _redis_subscriber:
try:
await _redis_subscriber.unsubscribe(REDIS_SETTINGS_CHANNEL)
await _redis_subscriber.aclose()
except Exception:
logger.debug("Settings Pub/Sub unsubscribe failed during shutdown", exc_info=True)
_redis_subscriber = None
logger.info("Settings Pub/Sub subscriber stopped")
async def _listen_loop() -> None:
while True:
try:
message = await _redis_subscriber.get_message(
ignore_subscribe_messages=True, timeout=1.0
)
if not message or message.get("type") != "message":
continue
data = message.get("data")
if isinstance(data, bytes):
data = data.decode()
if not isinstance(data, str):
continue
payload = json.loads(data)
db_key = payload.get("key")
value = payload.get("value")
if db_key is None or value is None:
continue
if apply_setting_override(str(db_key), str(value)):
logger.debug("Settings broadcast applied: %s", db_key)
except asyncio.CancelledError:
break
except Exception as exc:
logger.error("Settings Pub/Sub listen error: %s", exc)
await asyncio.sleep(1)
+9 -18
View File
@@ -10,6 +10,7 @@ import httpx
from datetime import datetime, timezone
from server.config import settings
from server.utils.notify_toggles import notify_attr_enabled, resource_alert_notify_enabled
logger = logging.getLogger("nexus.telegram")
@@ -106,10 +107,6 @@ async def send_telegram(message: str) -> bool:
return False
def _notify_enabled(setting_value: str) -> bool:
return setting_value.strip().lower() not in ("false", "0", "no", "off")
async def send_telegram_alert(
server_name: str,
alert_type: str,
@@ -117,14 +114,8 @@ async def send_telegram_alert(
server_id: int | None = None,
) -> bool:
"""Send server resource alert — respects per-type notify toggle."""
toggle_map = {
"cpu": "NOTIFY_ALERT_CPU",
"mem": "NOTIFY_ALERT_MEM",
"disk": "NOTIFY_ALERT_DISK",
}
toggle_attr = toggle_map.get(alert_type.lower(), "NOTIFY_ALERT_CPU")
if not _notify_enabled(getattr(settings, toggle_attr, "true")):
logger.debug("告警通知已关闭: %s", toggle_attr)
if not resource_alert_notify_enabled(alert_type):
logger.debug("告警通知已关闭: %s", alert_type)
return False
metric = _metric_cn(alert_type)
@@ -152,7 +143,7 @@ async def send_telegram_recovery(
server_id: int | None = None,
) -> bool:
"""Send server recovery notification — respects NOTIFY_RECOVERY toggle."""
if not _notify_enabled(settings.NOTIFY_RECOVERY):
if not notify_attr_enabled("NOTIFY_RECOVERY"):
logger.debug("恢复通知已关闭: NOTIFY_RECOVERY")
return False
@@ -182,7 +173,7 @@ async def send_telegram_system_alert(
icon: str = "⚠️",
) -> bool:
"""Send system-level alert with structured Chinese detail lines."""
if notify_key and not _notify_enabled(getattr(settings, notify_key, "true")):
if notify_key and not notify_attr_enabled(notify_key):
logger.debug("系统通知已关闭: %s", notify_key)
return False
@@ -202,7 +193,7 @@ async def send_telegram_system_alert(
async def send_telegram_restart_success() -> bool:
"""Notify that Python backend has successfully restarted."""
if not _notify_enabled(settings.NOTIFY_RESTART):
if not notify_attr_enabled("NOTIFY_RESTART"):
return False
return await send_telegram(
f"🟢 <b>【服务恢复】Nexus 后端进程已自动重启成功</b>\n"
@@ -216,7 +207,7 @@ async def send_telegram_restart_success() -> bool:
async def send_telegram_restart_failed() -> bool:
"""Notify that Python backend restart failed."""
if not _notify_enabled(settings.NOTIFY_RESTART):
if not notify_attr_enabled("NOTIFY_RESTART"):
return False
return await send_telegram(
f"🔴 <b>【服务故障】Nexus 后端自动重启失败</b>\n"
@@ -238,7 +229,7 @@ async def send_telegram_sync_complete(
duration_seconds: int | None = None,
) -> bool:
"""Send push/sync completion notification via Telegram."""
if not _notify_enabled(getattr(settings, "NOTIFY_SYNC_COMPLETE", "true")):
if not notify_attr_enabled("NOTIFY_SYNC_COMPLETE"):
return False
safe_source = html.escape(sanitize_external_message(source_path, max_len=80))
@@ -290,7 +281,7 @@ async def send_telegram_script_summary(
board_url: str,
) -> bool:
"""Send script execution summary (no per-server failure list) via Telegram."""
if not _notify_enabled(getattr(settings, "NOTIFY_SCRIPT_COMPLETE", "true")):
if not notify_attr_enabled("NOTIFY_SCRIPT_COMPLETE"):
return False
safe_label = html.escape(sanitize_external_message(script_label, max_len=80))
+8
View File
@@ -274,6 +274,13 @@ async def lifespan(app: FastAPI):
from server.api.websocket import start_redis_subscriber, stop_redis_subscriber
await start_redis_subscriber()
# 4a. Settings cross-worker sync (notify toggles, thresholds, etc.)
from server.infrastructure.settings_broadcast import (
start_settings_subscriber,
stop_settings_subscriber,
)
await start_settings_subscriber()
# 5. Launch background tasks (only on primary worker to avoid duplicate execution)
# When running with --workers N, each worker gets its own lifespan.
# Use Redis-based leader election to ensure only one worker runs background tasks.
@@ -332,6 +339,7 @@ async def lifespan(app: FastAPI):
# Stop Redis Pub/Sub subscriber
await stop_redis_subscriber()
await stop_settings_subscriber()
# Close Redis connection
await close_redis()
+36
View File
@@ -0,0 +1,36 @@
"""Notification toggle helpers — shared by Telegram and alert dispatch."""
from server.config import settings
_DISABLED = frozenset({"false", "0", "no", "off"})
# alert_type (cpu/mem/disk) → Settings attribute
_RESOURCE_ALERT_ATTR: dict[str, str] = {
"cpu": "NOTIFY_ALERT_CPU",
"mem": "NOTIFY_ALERT_MEM",
"disk": "NOTIFY_ALERT_DISK",
}
def notify_enabled(setting_value: str | bool | None) -> bool:
"""Return True when a notify_* setting is enabled."""
if setting_value is None:
return True
if isinstance(setting_value, bool):
return setting_value
return setting_value.strip().lower() not in _DISABLED
def resource_alert_notify_enabled(alert_type: str) -> bool:
"""Check whether Telegram should fire for a resource alert type."""
attr = _RESOURCE_ALERT_ATTR.get(alert_type.lower(), "NOTIFY_ALERT_CPU")
return notify_enabled(getattr(settings, attr, "true"))
def recovery_notify_enabled() -> bool:
return notify_enabled(settings.NOTIFY_RECOVERY)
def notify_attr_enabled(attr_name: str, default: str = "true") -> bool:
"""Check a named NOTIFY_* settings attribute."""
return notify_enabled(getattr(settings, attr_name, default))
+155
View File
@@ -0,0 +1,155 @@
"""Tests for notify toggle helpers and cross-worker settings broadcast."""
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from server.config import settings
from server.infrastructure.settings_broadcast import apply_setting_override, publish_setting_change
from server.infrastructure.telegram import send_telegram_alert, send_telegram_recovery, send_telegram_system_alert
from server.utils.notify_toggles import (
notify_attr_enabled,
notify_enabled,
resource_alert_notify_enabled,
)
@pytest.mark.parametrize(
("value", "expected"),
[
("true", True),
("false", False),
("0", False),
("off", False),
("no", False),
(False, False),
(True, True),
(None, True),
],
)
def test_notify_enabled(value, expected):
assert notify_enabled(value) is expected
def test_resource_alert_notify_enabled_respects_cpu_toggle():
settings.NOTIFY_ALERT_CPU = "false"
settings.NOTIFY_ALERT_MEM = "true"
assert resource_alert_notify_enabled("cpu") is False
assert resource_alert_notify_enabled("mem") is True
def test_apply_db_override_notify_toggle():
settings.NOTIFY_ALERT_CPU = "true"
assert apply_setting_override("notify_alert_cpu", "false") is True
assert settings.NOTIFY_ALERT_CPU == "false"
def test_apply_db_override_unknown_key():
assert apply_setting_override("nonexistent_key", "x") is False
@pytest.mark.asyncio
async def test_publish_setting_change():
mock_redis = AsyncMock()
mock_redis.publish = AsyncMock(return_value=1)
with patch("server.infrastructure.redis.client.get_redis", return_value=mock_redis):
ok = await publish_setting_change("notify_alert_cpu", "false")
assert ok is True
mock_redis.publish.assert_awaited_once()
channel, payload = mock_redis.publish.await_args.args
assert channel == "nexus:settings"
assert '"notify_alert_cpu"' in payload
@pytest.mark.asyncio
async def test_send_telegram_alert_skipped_when_cpu_disabled():
settings.NOTIFY_ALERT_CPU = "false"
settings.TELEGRAM_BOT_TOKEN = "123:ABC"
settings.TELEGRAM_CHAT_ID = "1"
with patch("server.infrastructure.telegram.send_telegram", new_callable=AsyncMock) as mock_send:
result = await send_telegram_alert("srv-1", "cpu", 95.0, 1)
assert result is False
mock_send.assert_not_awaited()
@pytest.mark.asyncio
async def test_send_telegram_recovery_skipped_when_disabled():
settings.NOTIFY_RECOVERY = "false"
with patch("server.infrastructure.telegram.send_telegram", new_callable=AsyncMock) as mock_send:
result = await send_telegram_recovery("srv-1", "cpu", 50.0, 1)
assert result is False
mock_send.assert_not_awaited()
@pytest.mark.asyncio
async def test_send_telegram_system_alert_skipped_when_disabled():
settings.NOTIFY_TIME_DRIFT = "false"
with patch("server.infrastructure.telegram.send_telegram", new_callable=AsyncMock) as mock_send:
result = await send_telegram_system_alert(
summary="test",
notify_key="NOTIFY_TIME_DRIFT",
)
assert result is False
mock_send.assert_not_awaited()
@pytest.mark.asyncio
async def test_set_setting_publishes_broadcast():
from server.api.schemas import SettingUpdatePayload
from server.api.settings import set_setting
from server.domain.models import Setting
settings.NOTIFY_ALERT_CPU = "true"
admin = MagicMock(username="admin")
request = MagicMock()
request.client.host = "127.0.0.1"
db = MagicMock()
mock_setting = Setting(key="notify_alert_cpu", value="false")
with patch("server.api.settings.SettingRepositoryImpl") as repo_cls, patch(
"server.api.settings.AuditLogRepositoryImpl"
) as audit_cls, patch(
"server.infrastructure.settings_broadcast.publish_setting_change",
new_callable=AsyncMock,
) as mock_publish:
repo = repo_cls.return_value
repo.set = AsyncMock(return_value=mock_setting)
audit_cls.return_value.create = AsyncMock()
await set_setting(
"notify_alert_cpu",
SettingUpdatePayload(value="false"),
request,
admin,
db,
)
assert settings.NOTIFY_ALERT_CPU == "false"
mock_publish.assert_awaited_once_with("notify_alert_cpu", "false")
@pytest.mark.parametrize(
"attr",
[
"NOTIFY_ALERT_CPU",
"NOTIFY_ALERT_MEM",
"NOTIFY_ALERT_DISK",
"NOTIFY_RECOVERY",
"NOTIFY_TIME_DRIFT",
"NOTIFY_SYSTEM_REDIS",
"NOTIFY_SYSTEM_MYSQL",
"NOTIFY_RESTART",
"NOTIFY_SCRIPT_COMPLETE",
],
)
def test_all_notify_attrs_disable(attr):
setattr(settings, attr, "false")
assert notify_attr_enabled(attr) is False
+1
View File
@@ -0,0 +1 @@
import{_ as e,t,v as n}from"./VSelect-DCVEXXlg.js";import{n as r,t as i}from"./VRow-D_fBpDV4.js";import{$r as a,Br as o,Jt as s,Nr as c,X as l,_ as u,_r as d,cr as f,fr as p,h as m,hr as h,jr as g,l as _,m as v,pr as y,qr as b,ri as x,vr as S,y as C,yr as w}from"./index-BDmfR_V6.js";import{t as T}from"./usePageActivateRefresh-BZD3eqy9.js";import{n as E}from"./dataTable-esDY4cOk.js";import{_ as D,y as O}from"./VTextField-20zRHFVo.js";import{t as k}from"./VDataTableServer-BeuFRVtC.js";var A={class:`font-weight-medium`},j={class:`text-body-2`},M={class:`text-caption text-medium-emphasis`},N=w({name:`AlertsPage`,__name:`AlertsPage`,setup(w){let N=e(),P=b(!1),F=b([]),I=b(0),L=b(1),R=b(null),z=b(null),B=b([{label:`今日告警`,value:`0`,color:`blue`,icon:`mdi-alert`},{label:`活跃告警`,value:`0`,color:`orange`,icon:`mdi-bell-ring`},{label:`已恢复`,value:`0`,color:`green`,icon:`mdi-check-circle`},{label:`Top 服务器`,value:``,color:`red`,icon:`mdi-server`}]),V=[{label:`CPU`,value:`cpu`},{label:`内存`,value:`memory`},{label:`磁盘`,value:`disk`},{label:`连接`,value:`connection`}],H=[{label:`活跃`,value:`active`},{label:`已恢复`,value:`recovered`}],U=E([{title:`类型`,key:`alert_type`,width:100},{title:`服务器`,key:`server_name`},{title:`详情`,key:`value`},{title:`状态`,key:`is_recovery`,width:100},{title:`时间`,key:`created_at`,width:160}]);async function W(){try{let e=await s.get(`/alert-history/stats`);B.value[0].value=String(e.today||0),B.value[1].value=String(e.active||0),B.value[2].value=String(e.recovered||0),B.value[3].value=e.top_server||``}catch{N(`加载统计失败`,`error`)}}async function G(e=!1){e||(P.value=!0);try{let e=await s.get(`/alert-history/`,{page:L.value,per_page:20,type:R.value||void 0,status:z.value||void 0});F.value=e.items||[],I.value=e.total||0}catch{F.value=[]}finally{e||(P.value=!1)}}function K(e){return e===`cpu`||e===`CPU`?`error`:e===`memory`||e===`内存`?`warning`:e===`disk`||e===`磁盘`?`info`:`primary`}function q(e){return e===`cpu`||e===`CPU`?`mdi-chip`:e===`memory`||e===`内存`?`mdi-memory`:e===`disk`||e===`磁盘`?`mdi-harddisk`:`mdi-lan-disconnect`}async function J(e=!1){await Promise.all([W(),G(e)])}return T(e=>J(e)),(e,s)=>(g(),y(n,{fluid:``,class:`pa-6`},{default:o(()=>[S(i,{class:`mb-4`},{default:o(()=>[(g(!0),h(f,null,c(B.value,e=>(g(),y(r,{cols:`12`,sm:`6`,lg:`3`,key:e.label},{default:o(()=>[S(_,{elevation:`0`,lines:`two`,rounded:`lg`,border:``},{default:o(()=>[S(v,null,{append:o(()=>[S(l,{color:e.color,size:`30`},{default:o(()=>[d(x(e.icon),1)]),_:2},1032,[`color`])]),default:o(()=>[S(m,{class:`text-body-small`},{default:o(()=>[d(x(e.label),1)]),_:2},1024),S(m,null,{default:o(()=>[d(x(e.value),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1}),S(D,{elevation:`0`,border:``,rounded:`lg`},{default:o(()=>[S(O,{class:`d-flex align-center`},{default:o(()=>[s[5]||=d(` 告警历史 `,-1),S(u),S(t,{modelValue:R.value,"onUpdate:modelValue":[s[0]||=e=>R.value=e,s[1]||=e=>{L.value=1,G()}],items:V,"item-title":`label`,"item-value":`value`,label:`类型`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`140px`},clearable:``},null,8,[`modelValue`]),S(t,{modelValue:z.value,"onUpdate:modelValue":[s[2]||=e=>z.value=e,s[3]||=e=>{L.value=1,G()}],items:H,"item-title":`label`,"item-value":`value`,label:`状态`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`140px`},class:`ml-3`,clearable:``},null,8,[`modelValue`])]),_:1}),S(k,{items:F.value,headers:a(U),"items-length":I.value,loading:P.value,page:L.value,"items-per-page":20,hover:``,density:`comfortable`,"onUpdate:page":s[4]||=e=>{L.value=e,G()}},{"item.alert_type":o(({item:e})=>[S(C,{color:K(e.alert_type),size:`small`,variant:`tonal`,label:``},{prepend:o(()=>[S(l,{size:`12`},{default:o(()=>[d(x(q(e.alert_type)),1)]),_:2},1024)]),default:o(()=>[d(` `+x(e.alert_type),1)]),_:2},1032,[`color`])]),"item.server_name":o(({item:e})=>[p(`span`,A,x(e.server_name),1)]),"item.value":o(({item:e})=>[p(`span`,j,x(e.value),1)]),"item.is_recovery":o(({item:e})=>[e.is_recovery?(g(),y(C,{key:0,color:`success`,size:`small`,variant:`tonal`,label:``},{default:o(()=>[...s[6]||=[d(`已恢复`,-1)]]),_:1})):(g(),y(C,{key:1,color:`error`,size:`small`,variant:`tonal`,label:``},{default:o(()=>[...s[7]||=[d(`告警中`,-1)]]),_:1}))]),"item.created_at":o(({item:e})=>[p(`span`,M,x(e.created_at),1)]),"no-data":o(()=>[...s[8]||=[p(`div`,{class:`text-center text-medium-emphasis py-6`},`暂无数据`,-1)]]),_:1},8,[`items`,`headers`,`items-length`,`loading`,`page`])]),_:1})]),_:1}))}});export{N as default};
+1
View File
@@ -0,0 +1 @@
import{_ as e,t,v as n}from"./VSelect-DTpWglKn.js";import{n as r,t as i}from"./VRow-BdcE65k-.js";import{$r as a,Br as o,Jt as s,Nr as c,X as l,_ as u,_r as d,cr as f,fr as p,h as m,hr as h,jr as g,l as _,m as v,pr as y,qr as b,ri as x,vr as S,y as C,yr as w}from"./index-BHUpfn3R.js";import{t as T}from"./usePageActivateRefresh-CiPhRV6i.js";import{n as E}from"./dataTable-esDY4cOk.js";import{_ as D,y as O}from"./VTextField-Dl1UyBCb.js";import{t as k}from"./VDataTableServer-DmLFtBc6.js";var A={class:`font-weight-medium`},j={class:`text-body-2`},M={class:`text-caption text-medium-emphasis`},N=w({name:`AlertsPage`,__name:`AlertsPage`,setup(w){let N=e(),P=b(!1),F=b([]),I=b(0),L=b(1),R=b(null),z=b(null),B=b([{label:`今日告警`,value:`0`,color:`blue`,icon:`mdi-alert`},{label:`活跃告警`,value:`0`,color:`orange`,icon:`mdi-bell-ring`},{label:`已恢复`,value:`0`,color:`green`,icon:`mdi-check-circle`},{label:`Top 服务器`,value:``,color:`red`,icon:`mdi-server`}]),V=[{label:`CPU`,value:`cpu`},{label:`内存`,value:`memory`},{label:`磁盘`,value:`disk`},{label:`连接`,value:`connection`}],H=[{label:`活跃`,value:`active`},{label:`已恢复`,value:`recovered`}],U=E([{title:`类型`,key:`alert_type`,width:100},{title:`服务器`,key:`server_name`},{title:`详情`,key:`value`},{title:`状态`,key:`is_recovery`,width:100},{title:`时间`,key:`created_at`,width:160}]);async function W(){try{let e=await s.get(`/alert-history/stats`);B.value[0].value=String(e.today||0),B.value[1].value=String(e.active||0),B.value[2].value=String(e.recovered||0),B.value[3].value=e.top_server||``}catch{N(`加载统计失败`,`error`)}}async function G(e=!1){e||(P.value=!0);try{let e=await s.get(`/alert-history/`,{page:L.value,per_page:20,type:R.value||void 0,status:z.value||void 0});F.value=e.items||[],I.value=e.total||0}catch{F.value=[]}finally{e||(P.value=!1)}}function K(e){return e===`cpu`||e===`CPU`?`error`:e===`memory`||e===`内存`?`warning`:e===`disk`||e===`磁盘`?`info`:`primary`}function q(e){return e===`cpu`||e===`CPU`?`mdi-chip`:e===`memory`||e===`内存`?`mdi-memory`:e===`disk`||e===`磁盘`?`mdi-harddisk`:`mdi-lan-disconnect`}async function J(e=!1){await Promise.all([W(),G(e)])}return T(e=>J(e)),(e,s)=>(g(),y(n,{fluid:``,class:`pa-6`},{default:o(()=>[S(i,{class:`mb-4`},{default:o(()=>[(g(!0),h(f,null,c(B.value,e=>(g(),y(r,{cols:`12`,sm:`6`,lg:`3`,key:e.label},{default:o(()=>[S(_,{elevation:`0`,lines:`two`,rounded:`lg`,border:``},{default:o(()=>[S(v,null,{append:o(()=>[S(l,{color:e.color,size:`30`},{default:o(()=>[d(x(e.icon),1)]),_:2},1032,[`color`])]),default:o(()=>[S(m,{class:`text-body-small`},{default:o(()=>[d(x(e.label),1)]),_:2},1024),S(m,null,{default:o(()=>[d(x(e.value),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1}),S(D,{elevation:`0`,border:``,rounded:`lg`},{default:o(()=>[S(O,{class:`d-flex align-center`},{default:o(()=>[s[5]||=d(` 告警历史 `,-1),S(u),S(t,{modelValue:R.value,"onUpdate:modelValue":[s[0]||=e=>R.value=e,s[1]||=e=>{L.value=1,G()}],items:V,"item-title":`label`,"item-value":`value`,label:`类型`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`140px`},clearable:``},null,8,[`modelValue`]),S(t,{modelValue:z.value,"onUpdate:modelValue":[s[2]||=e=>z.value=e,s[3]||=e=>{L.value=1,G()}],items:H,"item-title":`label`,"item-value":`value`,label:`状态`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`140px`},class:`ml-3`,clearable:``},null,8,[`modelValue`])]),_:1}),S(k,{items:F.value,headers:a(U),"items-length":I.value,loading:P.value,page:L.value,"items-per-page":20,hover:``,density:`comfortable`,"onUpdate:page":s[4]||=e=>{L.value=e,G()}},{"item.alert_type":o(({item:e})=>[S(C,{color:K(e.alert_type),size:`small`,variant:`tonal`,label:``},{prepend:o(()=>[S(l,{size:`12`},{default:o(()=>[d(x(q(e.alert_type)),1)]),_:2},1024)]),default:o(()=>[d(` `+x(e.alert_type),1)]),_:2},1032,[`color`])]),"item.server_name":o(({item:e})=>[p(`span`,A,x(e.server_name),1)]),"item.value":o(({item:e})=>[p(`span`,j,x(e.value),1)]),"item.is_recovery":o(({item:e})=>[e.is_recovery?(g(),y(C,{key:0,color:`success`,size:`small`,variant:`tonal`,label:``},{default:o(()=>[...s[6]||=[d(`已恢复`,-1)]]),_:1})):(g(),y(C,{key:1,color:`error`,size:`small`,variant:`tonal`,label:``},{default:o(()=>[...s[7]||=[d(`告警中`,-1)]]),_:1}))]),"item.created_at":o(({item:e})=>[p(`span`,M,x(e.created_at),1)]),"no-data":o(()=>[...s[8]||=[p(`div`,{class:`text-center text-medium-emphasis py-6`},`暂无数据`,-1)]]),_:1},8,[`items`,`headers`,`items-length`,`loading`,`page`])]),_:1})]),_:1}))}});export{N as default};
+1
View File
@@ -0,0 +1 @@
import{_ as e,t,v as n}from"./VSelect-Cx2P_6TS.js";import{n as r,t as i}from"./VRow-CvD6deCf.js";import{$r as a,Br as o,Jt as s,Nr as c,X as l,_ as u,_r as d,cr as f,fr as p,h as m,hr as h,jr as g,l as _,m as v,pr as y,qr as b,ri as x,vr as S,y as C,yr as w}from"./index-DBlT8p9k.js";import{t as T}from"./usePageActivateRefresh-CMCuCG89.js";import{n as E}from"./dataTable-esDY4cOk.js";import{_ as D,y as O}from"./VTextField-BK-1eNm9.js";import{t as k}from"./VDataTableServer-CuUcLbob.js";var A={class:`font-weight-medium`},j={class:`text-body-2`},M={class:`text-caption text-medium-emphasis`},N=w({name:`AlertsPage`,__name:`AlertsPage`,setup(w){let N=e(),P=b(!1),F=b([]),I=b(0),L=b(1),R=b(null),z=b(null),B=b([{label:`今日告警`,value:`0`,color:`blue`,icon:`mdi-alert`},{label:`活跃告警`,value:`0`,color:`orange`,icon:`mdi-bell-ring`},{label:`已恢复`,value:`0`,color:`green`,icon:`mdi-check-circle`},{label:`Top 服务器`,value:``,color:`red`,icon:`mdi-server`}]),V=[{label:`CPU`,value:`cpu`},{label:`内存`,value:`memory`},{label:`磁盘`,value:`disk`},{label:`连接`,value:`connection`}],H=[{label:`活跃`,value:`active`},{label:`已恢复`,value:`recovered`}],U=E([{title:`类型`,key:`alert_type`,width:100},{title:`服务器`,key:`server_name`},{title:`详情`,key:`value`},{title:`状态`,key:`is_recovery`,width:100},{title:`时间`,key:`created_at`,width:160}]);async function W(){try{let e=await s.get(`/alert-history/stats`);B.value[0].value=String(e.today||0),B.value[1].value=String(e.active||0),B.value[2].value=String(e.recovered||0),B.value[3].value=e.top_server||``}catch{N(`加载统计失败`,`error`)}}async function G(e=!1){e||(P.value=!0);try{let e=await s.get(`/alert-history/`,{page:L.value,per_page:20,type:R.value||void 0,status:z.value||void 0});F.value=e.items||[],I.value=e.total||0}catch{F.value=[]}finally{e||(P.value=!1)}}function K(e){return e===`cpu`||e===`CPU`?`error`:e===`memory`||e===`内存`?`warning`:e===`disk`||e===`磁盘`?`info`:`primary`}function q(e){return e===`cpu`||e===`CPU`?`mdi-chip`:e===`memory`||e===`内存`?`mdi-memory`:e===`disk`||e===`磁盘`?`mdi-harddisk`:`mdi-lan-disconnect`}async function J(e=!1){await Promise.all([W(),G(e)])}return T(e=>J(e)),(e,s)=>(g(),y(n,{fluid:``,class:`pa-6`},{default:o(()=>[S(i,{class:`mb-4`},{default:o(()=>[(g(!0),h(f,null,c(B.value,e=>(g(),y(r,{cols:`12`,sm:`6`,lg:`3`,key:e.label},{default:o(()=>[S(_,{elevation:`0`,lines:`two`,rounded:`lg`,border:``},{default:o(()=>[S(v,null,{append:o(()=>[S(l,{color:e.color,size:`30`},{default:o(()=>[d(x(e.icon),1)]),_:2},1032,[`color`])]),default:o(()=>[S(m,{class:`text-body-small`},{default:o(()=>[d(x(e.label),1)]),_:2},1024),S(m,null,{default:o(()=>[d(x(e.value),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1}),S(D,{elevation:`0`,border:``,rounded:`lg`},{default:o(()=>[S(O,{class:`d-flex align-center`},{default:o(()=>[s[5]||=d(` 告警历史 `,-1),S(u),S(t,{modelValue:R.value,"onUpdate:modelValue":[s[0]||=e=>R.value=e,s[1]||=e=>{L.value=1,G()}],items:V,"item-title":`label`,"item-value":`value`,label:`类型`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`140px`},clearable:``},null,8,[`modelValue`]),S(t,{modelValue:z.value,"onUpdate:modelValue":[s[2]||=e=>z.value=e,s[3]||=e=>{L.value=1,G()}],items:H,"item-title":`label`,"item-value":`value`,label:`状态`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`140px`},class:`ml-3`,clearable:``},null,8,[`modelValue`])]),_:1}),S(k,{items:F.value,headers:a(U),"items-length":I.value,loading:P.value,page:L.value,"items-per-page":20,hover:``,density:`comfortable`,"onUpdate:page":s[4]||=e=>{L.value=e,G()}},{"item.alert_type":o(({item:e})=>[S(C,{color:K(e.alert_type),size:`small`,variant:`tonal`,label:``},{prepend:o(()=>[S(l,{size:`12`},{default:o(()=>[d(x(q(e.alert_type)),1)]),_:2},1024)]),default:o(()=>[d(` `+x(e.alert_type),1)]),_:2},1032,[`color`])]),"item.server_name":o(({item:e})=>[p(`span`,A,x(e.server_name),1)]),"item.value":o(({item:e})=>[p(`span`,j,x(e.value),1)]),"item.is_recovery":o(({item:e})=>[e.is_recovery?(g(),y(C,{key:0,color:`success`,size:`small`,variant:`tonal`,label:``},{default:o(()=>[...s[6]||=[d(`已恢复`,-1)]]),_:1})):(g(),y(C,{key:1,color:`error`,size:`small`,variant:`tonal`,label:``},{default:o(()=>[...s[7]||=[d(`告警中`,-1)]]),_:1}))]),"item.created_at":o(({item:e})=>[p(`span`,M,x(e.created_at),1)]),"no-data":o(()=>[...s[8]||=[p(`div`,{class:`text-center text-medium-emphasis py-6`},`暂无数据`,-1)]]),_:1},8,[`items`,`headers`,`items-length`,`loading`,`page`])]),_:1})]),_:1}))}});export{N as default};
+1
View File
@@ -0,0 +1 @@
import{_ as e,t,v as n}from"./VSelect-DTpWglKn.js";import{$r as r,Br as i,Jt as a,P as o,Tt as s,_ as c,_r as l,fr as u,jr as d,mr as f,pr as p,qr as m,ri as h,sr as g,vr as _,y as v,yr as y}from"./index-BHUpfn3R.js";import{t as b}from"./usePageActivateRefresh-CiPhRV6i.js";import{n as x}from"./dataTable-esDY4cOk.js";import{_ as S,t as C,y as w}from"./VTextField-Dl1UyBCb.js";import{t as T}from"./VDataTableServer-DmLFtBc6.js";import{a as E,n as D,r as O,t as k}from"./auditNormalize-DWYIxo0q.js";var A=new Set([`batch_install_agent`,`batch_upgrade_agent`,`batch_uninstall_agent`,`batch_detect_path`,`batch_health_check`,`batch_update_category`,`batch_server_op`]);function j(e){return A.has(e)}function M(e){let t=(e||``).trim();if(!t.startsWith(`{`))return null;try{let e=JSON.parse(t);return typeof e.job_id!=`number`||!e.summary?null:e}catch{return null}}function N(e){let t=[e.summary],n=e.failures||[];if(n.length){let e=n.slice(0,3).map(e=>e.server_name).join(``);t.push(`失败: ${e}${n.length>3?``:``}`)}return t.join(` · `)}var P={class:`font-weight-medium`},F={class:`text-body-2`},I={class:`d-flex align-center ga-2 flex-wrap`},L={class:`text-body-2 text-medium-emphasis`,style:{"max-width":`360px`}},R={class:`text-caption text-medium-emphasis`},z={class:`text-caption text-medium-emphasis`},B=y({name:`AuditPage`,__name:`AuditPage`,setup(y){let A=e(),B=m(!1),V=m([]),H=m(0),U=m(1),W=m(null),G=m(``),K=m(``),q=D,J=x([{title:`操作`,key:`action`,width:100},{title:`用户`,key:`admin_username`,width:100},{title:`目标`,key:`target`,width:140},{title:`详情`,key:`detail`},{title:`IP`,key:`ip_address`,width:120},{title:`时间`,key:`created_at`,width:160}]);async function Y(e=!1){e||(B.value=!0);try{let e=(U.value-1)*50,t=await a.get(`/audit/`,{limit:50,offset:e,action:W.value||void 0,admin_username:G.value||void 0,date_from:K.value||void 0});V.value=k(t.items||[]),H.value=t.total||0}catch{V.value=[],e||A(`加载审计日志失败`,`error`)}finally{e||(B.value=!1)}}function X(e){return e.startsWith(`create`)||e===`login`?`success`:e.startsWith(`update`)?`info`:e.startsWith(`delete`)||e===`logout`?`error`:e.includes(`execute`)||e.includes(`push`)||e.includes(`retry`)?`warning`:`primary`}function Z(e){return j(e.action)?M(e.detail):null}function Q(e){let t=Z(e);return t?N(t):(e.detail||``).trim()||``}function $(e){s(e.job_id,e.summary)}return b(e=>Y(e)),(e,a)=>(d(),p(n,{fluid:``,class:`pa-6`},{default:i(()=>[_(S,{elevation:`0`,border:``,rounded:`lg`},{default:i(()=>[_(w,{class:`d-flex align-center`},{default:i(()=>[a[7]||=l(` 审计日志 `,-1),_(c),_(t,{modelValue:W.value,"onUpdate:modelValue":[a[0]||=e=>W.value=e,a[1]||=e=>{U.value=1,Y()}],items:r(q),"item-title":`label`,"item-value":`value`,label:`操作类型`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`200px`},clearable:``},null,8,[`modelValue`,`items`]),_(C,{modelValue:G.value,"onUpdate:modelValue":[a[2]||=e=>G.value=e,a[3]||=e=>{U.value=1,Y()}],"prepend-inner-icon":`mdi-account`,label:`用户`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`140px`},class:`ml-3`,clearable:``},null,8,[`modelValue`]),_(C,{modelValue:K.value,"onUpdate:modelValue":[a[4]||=e=>K.value=e,a[5]||=e=>{U.value=1,Y()}],"prepend-inner-icon":`mdi-calendar`,label:`日期`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`160px`},class:`ml-3`,type:`date`,clearable:``},null,8,[`modelValue`])]),_:1}),_(T,{items:V.value,headers:r(J),"items-length":H.value,loading:B.value,page:U.value,"items-per-page":50,hover:``,density:`compact`,"onUpdate:page":a[6]||=e=>{U.value=e,Y()}},{"item.action":i(({item:e})=>[_(v,{color:X(e.action),size:`small`,variant:`tonal`,label:``},{default:i(()=>[l(h(r(O)(e.action)),1)]),_:2},1032,[`color`])]),"item.admin_username":i(({item:e})=>[u(`span`,P,h(e.admin_username),1)]),"item.target":i(({item:e})=>[u(`span`,F,h(r(E)(e.resource_type))+h(e.resource_id?` #${e.resource_id}`:``),1)]),"item.detail":i(({item:e})=>[u(`div`,I,[u(`span`,L,h(Q(e)),1),Z(e)?(d(),p(o,{key:0,size:`x-small`,variant:`tonal`,color:`primary`,onClick:g(t=>$(Z(e)),[`stop`])},{default:i(()=>[...a[8]||=[l(` 查看结果 `,-1)]]),_:1},8,[`onClick`])):f(``,!0)])]),"item.ip_address":i(({item:e})=>[u(`span`,R,h(e.ip_address||``),1)]),"item.created_at":i(({item:e})=>[u(`span`,z,h(e.created_at),1)]),"no-data":i(()=>[...a[9]||=[u(`div`,{class:`text-center text-medium-emphasis py-6`},`暂无数据`,-1)]]),_:1},8,[`items`,`headers`,`items-length`,`loading`,`page`])]),_:1})]),_:1}))}});export{B as default};
+1
View File
@@ -0,0 +1 @@
import{_ as e,t,v as n}from"./VSelect-DCVEXXlg.js";import{$r as r,Br as i,Jt as a,P as o,Tt as s,_ as c,_r as l,fr as u,jr as d,mr as f,pr as p,qr as m,ri as h,sr as g,vr as _,y as v,yr as y}from"./index-BDmfR_V6.js";import{t as b}from"./usePageActivateRefresh-BZD3eqy9.js";import{n as x}from"./dataTable-esDY4cOk.js";import{_ as S,t as C,y as w}from"./VTextField-20zRHFVo.js";import{t as T}from"./VDataTableServer-BeuFRVtC.js";import{a as E,n as D,r as O,t as k}from"./auditNormalize-DWYIxo0q.js";var A=new Set([`batch_install_agent`,`batch_upgrade_agent`,`batch_uninstall_agent`,`batch_detect_path`,`batch_health_check`,`batch_update_category`,`batch_server_op`]);function j(e){return A.has(e)}function M(e){let t=(e||``).trim();if(!t.startsWith(`{`))return null;try{let e=JSON.parse(t);return typeof e.job_id!=`number`||!e.summary?null:e}catch{return null}}function N(e){let t=[e.summary],n=e.failures||[];if(n.length){let e=n.slice(0,3).map(e=>e.server_name).join(``);t.push(`失败: ${e}${n.length>3?``:``}`)}return t.join(` · `)}var P={class:`font-weight-medium`},F={class:`text-body-2`},I={class:`d-flex align-center ga-2 flex-wrap`},L={class:`text-body-2 text-medium-emphasis`,style:{"max-width":`360px`}},R={class:`text-caption text-medium-emphasis`},z={class:`text-caption text-medium-emphasis`},B=y({name:`AuditPage`,__name:`AuditPage`,setup(y){let A=e(),B=m(!1),V=m([]),H=m(0),U=m(1),W=m(null),G=m(``),K=m(``),q=D,J=x([{title:`操作`,key:`action`,width:100},{title:`用户`,key:`admin_username`,width:100},{title:`目标`,key:`target`,width:140},{title:`详情`,key:`detail`},{title:`IP`,key:`ip_address`,width:120},{title:`时间`,key:`created_at`,width:160}]);async function Y(e=!1){e||(B.value=!0);try{let e=(U.value-1)*50,t=await a.get(`/audit/`,{limit:50,offset:e,action:W.value||void 0,admin_username:G.value||void 0,date_from:K.value||void 0});V.value=k(t.items||[]),H.value=t.total||0}catch{V.value=[],e||A(`加载审计日志失败`,`error`)}finally{e||(B.value=!1)}}function X(e){return e.startsWith(`create`)||e===`login`?`success`:e.startsWith(`update`)?`info`:e.startsWith(`delete`)||e===`logout`?`error`:e.includes(`execute`)||e.includes(`push`)||e.includes(`retry`)?`warning`:`primary`}function Z(e){return j(e.action)?M(e.detail):null}function Q(e){let t=Z(e);return t?N(t):(e.detail||``).trim()||``}function $(e){s(e.job_id,e.summary)}return b(e=>Y(e)),(e,a)=>(d(),p(n,{fluid:``,class:`pa-6`},{default:i(()=>[_(S,{elevation:`0`,border:``,rounded:`lg`},{default:i(()=>[_(w,{class:`d-flex align-center`},{default:i(()=>[a[7]||=l(` 审计日志 `,-1),_(c),_(t,{modelValue:W.value,"onUpdate:modelValue":[a[0]||=e=>W.value=e,a[1]||=e=>{U.value=1,Y()}],items:r(q),"item-title":`label`,"item-value":`value`,label:`操作类型`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`200px`},clearable:``},null,8,[`modelValue`,`items`]),_(C,{modelValue:G.value,"onUpdate:modelValue":[a[2]||=e=>G.value=e,a[3]||=e=>{U.value=1,Y()}],"prepend-inner-icon":`mdi-account`,label:`用户`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`140px`},class:`ml-3`,clearable:``},null,8,[`modelValue`]),_(C,{modelValue:K.value,"onUpdate:modelValue":[a[4]||=e=>K.value=e,a[5]||=e=>{U.value=1,Y()}],"prepend-inner-icon":`mdi-calendar`,label:`日期`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`160px`},class:`ml-3`,type:`date`,clearable:``},null,8,[`modelValue`])]),_:1}),_(T,{items:V.value,headers:r(J),"items-length":H.value,loading:B.value,page:U.value,"items-per-page":50,hover:``,density:`compact`,"onUpdate:page":a[6]||=e=>{U.value=e,Y()}},{"item.action":i(({item:e})=>[_(v,{color:X(e.action),size:`small`,variant:`tonal`,label:``},{default:i(()=>[l(h(r(O)(e.action)),1)]),_:2},1032,[`color`])]),"item.admin_username":i(({item:e})=>[u(`span`,P,h(e.admin_username),1)]),"item.target":i(({item:e})=>[u(`span`,F,h(r(E)(e.resource_type))+h(e.resource_id?` #${e.resource_id}`:``),1)]),"item.detail":i(({item:e})=>[u(`div`,I,[u(`span`,L,h(Q(e)),1),Z(e)?(d(),p(o,{key:0,size:`x-small`,variant:`tonal`,color:`primary`,onClick:g(t=>$(Z(e)),[`stop`])},{default:i(()=>[...a[8]||=[l(` 查看结果 `,-1)]]),_:1},8,[`onClick`])):f(``,!0)])]),"item.ip_address":i(({item:e})=>[u(`span`,R,h(e.ip_address||``),1)]),"item.created_at":i(({item:e})=>[u(`span`,z,h(e.created_at),1)]),"no-data":i(()=>[...a[9]||=[u(`div`,{class:`text-center text-medium-emphasis py-6`},`暂无数据`,-1)]]),_:1},8,[`items`,`headers`,`items-length`,`loading`,`page`])]),_:1})]),_:1}))}});export{B as default};
+1
View File
@@ -0,0 +1 @@
import{_ as e,t,v as n}from"./VSelect-Cx2P_6TS.js";import{$r as r,Br as i,Jt as a,P as o,Tt as s,_ as c,_r as l,fr as u,jr as d,mr as f,pr as p,qr as m,ri as h,sr as g,vr as _,y as v,yr as y}from"./index-DBlT8p9k.js";import{t as b}from"./usePageActivateRefresh-CMCuCG89.js";import{n as x}from"./dataTable-esDY4cOk.js";import{_ as S,t as C,y as w}from"./VTextField-BK-1eNm9.js";import{t as T}from"./VDataTableServer-CuUcLbob.js";import{a as E,n as D,r as O,t as k}from"./auditNormalize-DWYIxo0q.js";var A=new Set([`batch_install_agent`,`batch_upgrade_agent`,`batch_uninstall_agent`,`batch_detect_path`,`batch_health_check`,`batch_update_category`,`batch_server_op`]);function j(e){return A.has(e)}function M(e){let t=(e||``).trim();if(!t.startsWith(`{`))return null;try{let e=JSON.parse(t);return typeof e.job_id!=`number`||!e.summary?null:e}catch{return null}}function N(e){let t=[e.summary],n=e.failures||[];if(n.length){let e=n.slice(0,3).map(e=>e.server_name).join(``);t.push(`失败: ${e}${n.length>3?``:``}`)}return t.join(` · `)}var P={class:`font-weight-medium`},F={class:`text-body-2`},I={class:`d-flex align-center ga-2 flex-wrap`},L={class:`text-body-2 text-medium-emphasis`,style:{"max-width":`360px`}},R={class:`text-caption text-medium-emphasis`},z={class:`text-caption text-medium-emphasis`},B=y({name:`AuditPage`,__name:`AuditPage`,setup(y){let A=e(),B=m(!1),V=m([]),H=m(0),U=m(1),W=m(null),G=m(``),K=m(``),q=D,J=x([{title:`操作`,key:`action`,width:100},{title:`用户`,key:`admin_username`,width:100},{title:`目标`,key:`target`,width:140},{title:`详情`,key:`detail`},{title:`IP`,key:`ip_address`,width:120},{title:`时间`,key:`created_at`,width:160}]);async function Y(e=!1){e||(B.value=!0);try{let e=(U.value-1)*50,t=await a.get(`/audit/`,{limit:50,offset:e,action:W.value||void 0,admin_username:G.value||void 0,date_from:K.value||void 0});V.value=k(t.items||[]),H.value=t.total||0}catch{V.value=[],e||A(`加载审计日志失败`,`error`)}finally{e||(B.value=!1)}}function X(e){return e.startsWith(`create`)||e===`login`?`success`:e.startsWith(`update`)?`info`:e.startsWith(`delete`)||e===`logout`?`error`:e.includes(`execute`)||e.includes(`push`)||e.includes(`retry`)?`warning`:`primary`}function Z(e){return j(e.action)?M(e.detail):null}function Q(e){let t=Z(e);return t?N(t):(e.detail||``).trim()||``}function $(e){s(e.job_id,e.summary)}return b(e=>Y(e)),(e,a)=>(d(),p(n,{fluid:``,class:`pa-6`},{default:i(()=>[_(S,{elevation:`0`,border:``,rounded:`lg`},{default:i(()=>[_(w,{class:`d-flex align-center`},{default:i(()=>[a[7]||=l(` 审计日志 `,-1),_(c),_(t,{modelValue:W.value,"onUpdate:modelValue":[a[0]||=e=>W.value=e,a[1]||=e=>{U.value=1,Y()}],items:r(q),"item-title":`label`,"item-value":`value`,label:`操作类型`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`200px`},clearable:``},null,8,[`modelValue`,`items`]),_(C,{modelValue:G.value,"onUpdate:modelValue":[a[2]||=e=>G.value=e,a[3]||=e=>{U.value=1,Y()}],"prepend-inner-icon":`mdi-account`,label:`用户`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`140px`},class:`ml-3`,clearable:``},null,8,[`modelValue`]),_(C,{modelValue:K.value,"onUpdate:modelValue":[a[4]||=e=>K.value=e,a[5]||=e=>{U.value=1,Y()}],"prepend-inner-icon":`mdi-calendar`,label:`日期`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`160px`},class:`ml-3`,type:`date`,clearable:``},null,8,[`modelValue`])]),_:1}),_(T,{items:V.value,headers:r(J),"items-length":H.value,loading:B.value,page:U.value,"items-per-page":50,hover:``,density:`compact`,"onUpdate:page":a[6]||=e=>{U.value=e,Y()}},{"item.action":i(({item:e})=>[_(v,{color:X(e.action),size:`small`,variant:`tonal`,label:``},{default:i(()=>[l(h(r(O)(e.action)),1)]),_:2},1032,[`color`])]),"item.admin_username":i(({item:e})=>[u(`span`,P,h(e.admin_username),1)]),"item.target":i(({item:e})=>[u(`span`,F,h(r(E)(e.resource_type))+h(e.resource_id?` #${e.resource_id}`:``),1)]),"item.detail":i(({item:e})=>[u(`div`,I,[u(`span`,L,h(Q(e)),1),Z(e)?(d(),p(o,{key:0,size:`x-small`,variant:`tonal`,color:`primary`,onClick:g(t=>$(Z(e)),[`stop`])},{default:i(()=>[...a[8]||=[l(` 查看结果 `,-1)]]),_:1},8,[`onClick`])):f(``,!0)])]),"item.ip_address":i(({item:e})=>[u(`span`,R,h(e.ip_address||``),1)]),"item.created_at":i(({item:e})=>[u(`span`,z,h(e.created_at),1)]),"no-data":i(()=>[...a[9]||=[u(`div`,{class:`text-center text-medium-emphasis py-6`},`暂无数据`,-1)]]),_:1},8,[`items`,`headers`,`items-length`,`loading`,`page`])]),_:1})]),_:1}))}});export{B as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
import{Qt as e,hr as t,jr as n,kr as r,yr as i}from"./index-DBlT8p9k.js";var a=i({name:`CredentialsPage`,__name:`CredentialsPage`,setup(i){let a=e();return r(()=>{a.replace({path:`/servers`,query:{credentials:`1`}})}),(e,r)=>(n(),t(`div`))}});export{a as default};
@@ -0,0 +1 @@
import{Qt as e,hr as t,jr as n,kr as r,yr as i}from"./index-BHUpfn3R.js";var a=i({name:`CredentialsPage`,__name:`CredentialsPage`,setup(i){let a=e();return r(()=>{a.replace({path:`/servers`,query:{credentials:`1`}})}),(e,r)=>(n(),t(`div`))}});export{a as default};
@@ -0,0 +1 @@
import{Qt as e,hr as t,jr as n,kr as r,yr as i}from"./index-BDmfR_V6.js";var a=i({name:`CredentialsPage`,__name:`CredentialsPage`,setup(i){let a=e();return r(()=>{a.replace({path:`/servers`,query:{credentials:`1`}})}),(e,r)=>(n(),t(`div`))}});export{a as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import{_ as e,t,v as n}from"./VSelect-DTpWglKn.js";import{$r as r,Br as i,Jt as a,P as o,_ as s,_r as c,fr as l,jr as u,mr as d,pr as f,qr as p,ri as m,vr as h,y as g,yr as _}from"./index-BHUpfn3R.js";import{t as v}from"./usePageActivateRefresh-CiPhRV6i.js";import{n as y}from"./dataTable-esDY4cOk.js";import{_ as b,v as x,x as S,y as C}from"./VTextField-Dl1UyBCb.js";import{t as w}from"./VDataTableServer-DmLFtBc6.js";import{t as T}from"./VDialog-DO-S1fJr.js";import{t as E}from"./usePageAutoRefresh-kX8TPdAQ.js";var D={class:`font-weight-medium text-truncate d-inline-block`,style:{"max-width":`240px`}},O={class:`text-medium-emphasis`},k={class:`text-medium-emphasis`},A={class:`text-caption text-medium-emphasis`},j={class:`text-caption text-medium-emphasis`},M=_({name:`RetriesPage`,__name:`RetriesPage`,setup(_){let M=e(),N=p(!1),P=p([]),F=p(0),I=p(1),L=p(null),R=p(!1),z=p(null),B=[{label:`待重试`,value:`pending`},{label:`重试中`,value:`retrying`},{label:`成功`,value:`success`},{label:`失败`,value:`failed`}],V=y([{title:`状态`,key:`status`,width:100},{title:`任务`,key:`operation`},{title:`服务器`,key:`server_name`},{title:`次数`,key:`retry_count`,width:100},{title:`下次重试`,key:`next_retry_at`,width:140},{title:`创建时间`,key:`created_at`,width:160},{title:``,key:`actions`,width:120,align:`end`}]);async function H(e=!1){e||(N.value=!0);try{let e=(await a.getList(`/retries/`,{limit:200})).items||[];L.value&&(e=e.filter(e=>e.status===L.value)),F.value=e.length;let t=(I.value-1)*20;P.value=e.slice(t,t+20)}catch(t){e||(P.value=[],F.value=0,M(t instanceof Error?t.message:`加载重试队列失败`,`error`))}finally{e||(N.value=!1)}}async function U(e){try{await a.post(`/retries/${e.id}/retry`),H(),M(`重试已触发`)}catch(e){M(e.message||`操作失败`,`error`)}}function W(e){z.value=e.id,R.value=!0}async function G(){if(z.value)try{await a.delete(`/retries/${z.value}`),R.value=!1,H(),M(`已删除`)}catch(e){M(e.message||`删除失败`,`error`)}}function K(e){return e===`success`?`success`:e===`failed`?`error`:e===`retrying`?`warning`:`info`}function q(e){return e===`pending`?`待重试`:e===`retrying`?`重试中`:e===`success`?`成功`:e===`failed`?`失败`:e}function J(e){return e.source_path&&e.target_path?`${e.source_path}${e.target_path}`:e.source_path||e.target_path||`文件推送`}return E(()=>H(!0),15e3),v(e=>H(e)),(e,a)=>(u(),f(n,{fluid:``,class:`pa-6`},{default:i(()=>[h(b,{elevation:`0`,border:``,rounded:`lg`},{default:i(()=>[h(C,{class:`d-flex align-center text-h6`},{default:i(()=>[a[5]||=c(` 重试队列 `,-1),h(s),h(t,{modelValue:L.value,"onUpdate:modelValue":[a[0]||=e=>L.value=e,a[1]||=e=>{I.value=1,H()}],items:B,"item-title":`label`,"item-value":`value`,label:`状态筛选`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`160px`},clearable:``},null,8,[`modelValue`])]),_:1}),h(w,{items:P.value,headers:r(V),"items-length":F.value,loading:N.value,page:I.value,"items-per-page":20,hover:``,density:`comfortable`,"onUpdate:page":a[2]||=e=>{I.value=e,H()}},{"item.status":i(({item:e})=>[h(g,{color:K(e.status),size:`x-small`,variant:`tonal`,label:``,border:`sm`},{default:i(()=>[c(m(q(e.status)),1)]),_:2},1032,[`color`])]),"item.operation":i(({item:e})=>[l(`span`,D,m(J(e)),1)]),"item.server_name":i(({item:e})=>[l(`span`,O,m(e.server_name||``),1)]),"item.retry_count":i(({item:e})=>[l(`span`,k,m(e.retry_count||0)+` / `+m(e.max_retries||3),1)]),"item.next_retry_at":i(({item:e})=>[l(`span`,A,m(e.next_retry_at||``),1)]),"item.created_at":i(({item:e})=>[l(`span`,j,m(e.created_at),1)]),"item.actions":i(({item:e})=>[e.status===`pending`||e.status===`failed`?(u(),f(o,{key:0,variant:`text`,size:`x-small`,color:`primary`,density:`compact`,onClick:t=>U(e)},{default:i(()=>[...a[6]||=[c(` 重试 `,-1)]]),_:1},8,[`onClick`])):d(``,!0),h(o,{variant:`text`,size:`x-small`,color:`error`,density:`compact`,onClick:t=>W(e)},{default:i(()=>[...a[7]||=[c(` 删除 `,-1)]]),_:1},8,[`onClick`])]),"no-data":i(()=>[...a[8]||=[l(`div`,{class:`text-center text-medium-emphasis py-6`},`暂无数据`,-1)]]),_:1},8,[`items`,`headers`,`items-length`,`loading`,`page`])]),_:1}),h(T,{modelValue:R.value,"onUpdate:modelValue":a[4]||=e=>R.value=e,"max-width":`400`},{default:i(()=>[h(b,{border:``},{default:i(()=>[h(C,null,{default:i(()=>[...a[9]||=[c(`确认删除`,-1)]]),_:1}),h(x,null,{default:i(()=>[...a[10]||=[c(`确定要删除此重试任务吗?`,-1)]]),_:1}),h(S,null,{default:i(()=>[h(s),h(o,{variant:`text`,onClick:a[3]||=e=>R.value=!1},{default:i(()=>[...a[11]||=[c(`取消`,-1)]]),_:1}),h(o,{color:`error`,variant:`flat`,onClick:G},{default:i(()=>[...a[12]||=[c(`删除`,-1)]]),_:1})]),_:1})]),_:1})]),_:1},8,[`modelValue`])]),_:1}))}});export{M as default};
+1
View File
@@ -0,0 +1 @@
import{_ as e,t,v as n}from"./VSelect-Cx2P_6TS.js";import{$r as r,Br as i,Jt as a,P as o,_ as s,_r as c,fr as l,jr as u,mr as d,pr as f,qr as p,ri as m,vr as h,y as g,yr as _}from"./index-DBlT8p9k.js";import{t as v}from"./usePageActivateRefresh-CMCuCG89.js";import{n as y}from"./dataTable-esDY4cOk.js";import{_ as b,v as x,x as S,y as C}from"./VTextField-BK-1eNm9.js";import{t as w}from"./VDataTableServer-CuUcLbob.js";import{t as T}from"./VDialog-DB1DDCjL.js";import{t as E}from"./usePageAutoRefresh-dPtlj8EO.js";var D={class:`font-weight-medium text-truncate d-inline-block`,style:{"max-width":`240px`}},O={class:`text-medium-emphasis`},k={class:`text-medium-emphasis`},A={class:`text-caption text-medium-emphasis`},j={class:`text-caption text-medium-emphasis`},M=_({name:`RetriesPage`,__name:`RetriesPage`,setup(_){let M=e(),N=p(!1),P=p([]),F=p(0),I=p(1),L=p(null),R=p(!1),z=p(null),B=[{label:`待重试`,value:`pending`},{label:`重试中`,value:`retrying`},{label:`成功`,value:`success`},{label:`失败`,value:`failed`}],V=y([{title:`状态`,key:`status`,width:100},{title:`任务`,key:`operation`},{title:`服务器`,key:`server_name`},{title:`次数`,key:`retry_count`,width:100},{title:`下次重试`,key:`next_retry_at`,width:140},{title:`创建时间`,key:`created_at`,width:160},{title:``,key:`actions`,width:120,align:`end`}]);async function H(e=!1){e||(N.value=!0);try{let e=(await a.getList(`/retries/`,{limit:200})).items||[];L.value&&(e=e.filter(e=>e.status===L.value)),F.value=e.length;let t=(I.value-1)*20;P.value=e.slice(t,t+20)}catch(t){e||(P.value=[],F.value=0,M(t instanceof Error?t.message:`加载重试队列失败`,`error`))}finally{e||(N.value=!1)}}async function U(e){try{await a.post(`/retries/${e.id}/retry`),H(),M(`重试已触发`)}catch(e){M(e.message||`操作失败`,`error`)}}function W(e){z.value=e.id,R.value=!0}async function G(){if(z.value)try{await a.delete(`/retries/${z.value}`),R.value=!1,H(),M(`已删除`)}catch(e){M(e.message||`删除失败`,`error`)}}function K(e){return e===`success`?`success`:e===`failed`?`error`:e===`retrying`?`warning`:`info`}function q(e){return e===`pending`?`待重试`:e===`retrying`?`重试中`:e===`success`?`成功`:e===`failed`?`失败`:e}function J(e){return e.source_path&&e.target_path?`${e.source_path}${e.target_path}`:e.source_path||e.target_path||`文件推送`}return E(()=>H(!0),15e3),v(e=>H(e)),(e,a)=>(u(),f(n,{fluid:``,class:`pa-6`},{default:i(()=>[h(b,{elevation:`0`,border:``,rounded:`lg`},{default:i(()=>[h(C,{class:`d-flex align-center text-h6`},{default:i(()=>[a[5]||=c(` 重试队列 `,-1),h(s),h(t,{modelValue:L.value,"onUpdate:modelValue":[a[0]||=e=>L.value=e,a[1]||=e=>{I.value=1,H()}],items:B,"item-title":`label`,"item-value":`value`,label:`状态筛选`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`160px`},clearable:``},null,8,[`modelValue`])]),_:1}),h(w,{items:P.value,headers:r(V),"items-length":F.value,loading:N.value,page:I.value,"items-per-page":20,hover:``,density:`comfortable`,"onUpdate:page":a[2]||=e=>{I.value=e,H()}},{"item.status":i(({item:e})=>[h(g,{color:K(e.status),size:`x-small`,variant:`tonal`,label:``,border:`sm`},{default:i(()=>[c(m(q(e.status)),1)]),_:2},1032,[`color`])]),"item.operation":i(({item:e})=>[l(`span`,D,m(J(e)),1)]),"item.server_name":i(({item:e})=>[l(`span`,O,m(e.server_name||``),1)]),"item.retry_count":i(({item:e})=>[l(`span`,k,m(e.retry_count||0)+` / `+m(e.max_retries||3),1)]),"item.next_retry_at":i(({item:e})=>[l(`span`,A,m(e.next_retry_at||``),1)]),"item.created_at":i(({item:e})=>[l(`span`,j,m(e.created_at),1)]),"item.actions":i(({item:e})=>[e.status===`pending`||e.status===`failed`?(u(),f(o,{key:0,variant:`text`,size:`x-small`,color:`primary`,density:`compact`,onClick:t=>U(e)},{default:i(()=>[...a[6]||=[c(` 重试 `,-1)]]),_:1},8,[`onClick`])):d(``,!0),h(o,{variant:`text`,size:`x-small`,color:`error`,density:`compact`,onClick:t=>W(e)},{default:i(()=>[...a[7]||=[c(` 删除 `,-1)]]),_:1},8,[`onClick`])]),"no-data":i(()=>[...a[8]||=[l(`div`,{class:`text-center text-medium-emphasis py-6`},`暂无数据`,-1)]]),_:1},8,[`items`,`headers`,`items-length`,`loading`,`page`])]),_:1}),h(T,{modelValue:R.value,"onUpdate:modelValue":a[4]||=e=>R.value=e,"max-width":`400`},{default:i(()=>[h(b,{border:``},{default:i(()=>[h(C,null,{default:i(()=>[...a[9]||=[c(`确认删除`,-1)]]),_:1}),h(x,null,{default:i(()=>[...a[10]||=[c(`确定要删除此重试任务吗?`,-1)]]),_:1}),h(S,null,{default:i(()=>[h(s),h(o,{variant:`text`,onClick:a[3]||=e=>R.value=!1},{default:i(()=>[...a[11]||=[c(`取消`,-1)]]),_:1}),h(o,{color:`error`,variant:`flat`,onClick:G},{default:i(()=>[...a[12]||=[c(`删除`,-1)]]),_:1})]),_:1})]),_:1})]),_:1},8,[`modelValue`])]),_:1}))}});export{M as default};
+1
View File
@@ -0,0 +1 @@
import{_ as e,t,v as n}from"./VSelect-DCVEXXlg.js";import{$r as r,Br as i,Jt as a,P as o,_ as s,_r as c,fr as l,jr as u,mr as d,pr as f,qr as p,ri as m,vr as h,y as g,yr as _}from"./index-BDmfR_V6.js";import{t as v}from"./usePageActivateRefresh-BZD3eqy9.js";import{n as y}from"./dataTable-esDY4cOk.js";import{_ as b,v as x,x as S,y as C}from"./VTextField-20zRHFVo.js";import{t as w}from"./VDataTableServer-BeuFRVtC.js";import{t as T}from"./VDialog-CedSVCX4.js";import{t as E}from"./usePageAutoRefresh-E6Ka_zhO.js";var D={class:`font-weight-medium text-truncate d-inline-block`,style:{"max-width":`240px`}},O={class:`text-medium-emphasis`},k={class:`text-medium-emphasis`},A={class:`text-caption text-medium-emphasis`},j={class:`text-caption text-medium-emphasis`},M=_({name:`RetriesPage`,__name:`RetriesPage`,setup(_){let M=e(),N=p(!1),P=p([]),F=p(0),I=p(1),L=p(null),R=p(!1),z=p(null),B=[{label:`待重试`,value:`pending`},{label:`重试中`,value:`retrying`},{label:`成功`,value:`success`},{label:`失败`,value:`failed`}],V=y([{title:`状态`,key:`status`,width:100},{title:`任务`,key:`operation`},{title:`服务器`,key:`server_name`},{title:`次数`,key:`retry_count`,width:100},{title:`下次重试`,key:`next_retry_at`,width:140},{title:`创建时间`,key:`created_at`,width:160},{title:``,key:`actions`,width:120,align:`end`}]);async function H(e=!1){e||(N.value=!0);try{let e=(await a.getList(`/retries/`,{limit:200})).items||[];L.value&&(e=e.filter(e=>e.status===L.value)),F.value=e.length;let t=(I.value-1)*20;P.value=e.slice(t,t+20)}catch(t){e||(P.value=[],F.value=0,M(t instanceof Error?t.message:`加载重试队列失败`,`error`))}finally{e||(N.value=!1)}}async function U(e){try{await a.post(`/retries/${e.id}/retry`),H(),M(`重试已触发`)}catch(e){M(e.message||`操作失败`,`error`)}}function W(e){z.value=e.id,R.value=!0}async function G(){if(z.value)try{await a.delete(`/retries/${z.value}`),R.value=!1,H(),M(`已删除`)}catch(e){M(e.message||`删除失败`,`error`)}}function K(e){return e===`success`?`success`:e===`failed`?`error`:e===`retrying`?`warning`:`info`}function q(e){return e===`pending`?`待重试`:e===`retrying`?`重试中`:e===`success`?`成功`:e===`failed`?`失败`:e}function J(e){return e.source_path&&e.target_path?`${e.source_path}${e.target_path}`:e.source_path||e.target_path||`文件推送`}return E(()=>H(!0),15e3),v(e=>H(e)),(e,a)=>(u(),f(n,{fluid:``,class:`pa-6`},{default:i(()=>[h(b,{elevation:`0`,border:``,rounded:`lg`},{default:i(()=>[h(C,{class:`d-flex align-center text-h6`},{default:i(()=>[a[5]||=c(` 重试队列 `,-1),h(s),h(t,{modelValue:L.value,"onUpdate:modelValue":[a[0]||=e=>L.value=e,a[1]||=e=>{I.value=1,H()}],items:B,"item-title":`label`,"item-value":`value`,label:`状态筛选`,variant:`outlined`,density:`compact`,"hide-details":``,style:{"max-width":`160px`},clearable:``},null,8,[`modelValue`])]),_:1}),h(w,{items:P.value,headers:r(V),"items-length":F.value,loading:N.value,page:I.value,"items-per-page":20,hover:``,density:`comfortable`,"onUpdate:page":a[2]||=e=>{I.value=e,H()}},{"item.status":i(({item:e})=>[h(g,{color:K(e.status),size:`x-small`,variant:`tonal`,label:``,border:`sm`},{default:i(()=>[c(m(q(e.status)),1)]),_:2},1032,[`color`])]),"item.operation":i(({item:e})=>[l(`span`,D,m(J(e)),1)]),"item.server_name":i(({item:e})=>[l(`span`,O,m(e.server_name||``),1)]),"item.retry_count":i(({item:e})=>[l(`span`,k,m(e.retry_count||0)+` / `+m(e.max_retries||3),1)]),"item.next_retry_at":i(({item:e})=>[l(`span`,A,m(e.next_retry_at||``),1)]),"item.created_at":i(({item:e})=>[l(`span`,j,m(e.created_at),1)]),"item.actions":i(({item:e})=>[e.status===`pending`||e.status===`failed`?(u(),f(o,{key:0,variant:`text`,size:`x-small`,color:`primary`,density:`compact`,onClick:t=>U(e)},{default:i(()=>[...a[6]||=[c(` 重试 `,-1)]]),_:1},8,[`onClick`])):d(``,!0),h(o,{variant:`text`,size:`x-small`,color:`error`,density:`compact`,onClick:t=>W(e)},{default:i(()=>[...a[7]||=[c(` 删除 `,-1)]]),_:1},8,[`onClick`])]),"no-data":i(()=>[...a[8]||=[l(`div`,{class:`text-center text-medium-emphasis py-6`},`暂无数据`,-1)]]),_:1},8,[`items`,`headers`,`items-length`,`loading`,`page`])]),_:1}),h(T,{modelValue:R.value,"onUpdate:modelValue":a[4]||=e=>R.value=e,"max-width":`400`},{default:i(()=>[h(b,{border:``},{default:i(()=>[h(C,null,{default:i(()=>[...a[9]||=[c(`确认删除`,-1)]]),_:1}),h(x,null,{default:i(()=>[...a[10]||=[c(`确定要删除此重试任务吗?`,-1)]]),_:1}),h(S,null,{default:i(()=>[h(s),h(o,{variant:`text`,onClick:a[3]||=e=>R.value=!1},{default:i(()=>[...a[11]||=[c(`取消`,-1)]]),_:1}),h(o,{color:`error`,variant:`flat`,onClick:G},{default:i(()=>[...a[12]||=[c(`删除`,-1)]]),_:1})]),_:1})]),_:1})]),_:1},8,[`modelValue`])]),_:1}))}});export{M as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
import{n as e,t}from"./VRow-BdcE65k-.js";import{$r as n,Br as r,Lr as i,Nr as a,P as o,Sr as s,X as c,Y as l,_r as u,cr as d,dr as f,fr as p,hr as m,jr as h,mr as g,ni as _,pr as v,qr as y,ri as b,vr as x,y as S,yr as C}from"./index-BHUpfn3R.js";import{_ as w,t as T}from"./VTextField-Dl1UyBCb.js";import{t as E}from"./VCheckbox-5z7284oE.js";import{s as D}from"./labels-CzOhyWto.js";import{t as O}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as k}from"./useServerCategories-B97TmnP8.js";var A={class:`server-category-picker`},j={class:`d-flex align-center flex-wrap ga-2 mb-2`},M={key:0,class:`text-center text-medium-emphasis py-4`},N={class:`d-flex align-center px-1 mb-1`},P={class:`text-caption text-medium-emphasis ml-1`},F={class:`d-flex align-center ga-2`},I={class:`text-body-2 font-weight-medium text-truncate`},L={class:`text-caption text-medium-emphasis text-truncate`},R=O(C({__name:`ServerCategoryPicker`,props:s({servers:{},loading:{type:Boolean,default:!1},maxHeight:{default:`280px`}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:[`update:modelValue`],setup(s){let C=i(s,`modelValue`),O=s,R=y(``),z=f(()=>new Set(C.value)),B=f(()=>{let e=R.value.trim().toLowerCase();return e?O.servers.filter(t=>t.name.toLowerCase().includes(e)||(t.domain||``).toLowerCase().includes(e)||(t.category||``).toLowerCase().includes(e)):O.servers}),V=f(()=>{let e={};for(let t of B.value){let n=t.category?.trim()||`uncategorized`;e[n]||(e[n]=[]),e[n].push(t)}return Object.entries(e).map(([e,t])=>({category:e,label:k(e),servers:[...t].sort((e,t)=>e.name.localeCompare(t.name,`zh`))})).sort((e,t)=>e.category===`uncategorized`?1:t.category===`uncategorized`?-1:e.label.localeCompare(t.label,`zh`))}),H=f(()=>{let e=B.value;return e.length>0&&e.every(e=>z.value.has(e.id))});function U(e){return e.servers.filter(e=>z.value.has(e.id)).length}function W(e){let t=V.value.find(t=>t.category===e);return!t||t.servers.length===0?!1:t.servers.every(e=>z.value.has(e.id))}function G(e){C.value=[...e]}function K(e){let t=new Set(C.value);t.has(e)?t.delete(e):t.add(e),G(t)}function q(e){let t=V.value.find(t=>t.category===e);if(!t)return;let n=new Set(C.value),r=t.servers.every(e=>n.has(e.id));for(let e of t.servers)r?n.delete(e.id):n.add(e.id);G(n)}function J(){let e=B.value,t=new Set(C.value),n=e.length>0&&e.every(e=>t.has(e.id));for(let r of e)n?t.delete(r.id):t.add(r.id);G(t)}return(i,f)=>(h(),m(`div`,A,[p(`div`,j,[x(E,{"model-value":H.value,label:`全选`,density:`compact`,"hide-details":``,"onUpdate:modelValue":J},null,8,[`model-value`]),x(T,{modelValue:R.value,"onUpdate:modelValue":f[0]||=e=>R.value=e,"prepend-inner-icon":`mdi-magnify`,label:`搜索服务器`,density:`compact`,"hide-details":``,variant:`outlined`,rounded:``,style:{"max-width":`220px`},clearable:``},null,8,[`modelValue`]),C.value.length>0?(h(),v(S,{key:0,size:`small`,color:`primary`,variant:`tonal`,label:``},{default:r(()=>[u(` 已选 `+b(C.value.length)+``,1)]),_:1})):g(``,!0),s.loading?(h(),v(l,{key:1,indeterminate:``,size:`18`,width:`2`})):g(``,!0)]),p(`div`,{class:`picker-scroll`,style:_({maxHeight:s.maxHeight})},[!s.loading&&V.value.length===0?(h(),m(`div`,M,` 暂无服务器 `)):g(``,!0),(h(!0),m(d,null,a(V.value,i=>(h(),m(`div`,{key:i.category,class:`mb-3`},[p(`div`,N,[x(o,{size:`x-small`,variant:`text`,color:W(i.category)?`primary`:`default`,onClick:e=>q(i.category)},{default:r(()=>[x(c,{size:`16`,class:`mr-1`},{default:r(()=>[u(b(W(i.category)?`mdi-checkbox-marked`:`mdi-checkbox-blank-outline`),1)]),_:2},1024),u(` `+b(i.label),1)]),_:2},1032,[`color`,`onClick`]),p(`span`,P,` (`+b(U(i))+`/`+b(i.servers.length)+`) `,1)]),x(t,{dense:``},{default:r(()=>[(h(!0),m(d,null,a(i.servers,t=>(h(),v(e,{key:t.id,cols:`12`,sm:`6`},{default:r(()=>[x(w,{color:z.value.has(t.id)?`primary`:void 0,variant:z.value.has(t.id)?`tonal`:`outlined`,rounded:`lg`,class:`pa-2 cursor-pointer`,onClick:e=>K(t.id)},{default:r(()=>[p(`div`,F,[x(c,{color:n(D)(t.is_online),size:`10`},{default:r(()=>[...f[1]||=[u(`mdi-circle`,-1)]]),_:1},8,[`color`]),p(`span`,I,b(t.name),1)]),p(`div`,L,b(t.domain),1)]),_:2},1032,[`color`,`variant`,`onClick`])]),_:2},1024))),128))]),_:2},1024)]))),128))],4)]))}}),[[`__scopeId`,`data-v-4d1df917`]]);export{R as t};
@@ -0,0 +1 @@
import{n as e,t}from"./VRow-CvD6deCf.js";import{$r as n,Br as r,Lr as i,Nr as a,P as o,Sr as s,X as c,Y as l,_r as u,cr as d,dr as f,fr as p,hr as m,jr as h,mr as g,ni as _,pr as v,qr as y,ri as b,vr as x,y as S,yr as C}from"./index-DBlT8p9k.js";import{_ as w,t as T}from"./VTextField-BK-1eNm9.js";import{t as E}from"./VCheckbox-D7oHU7Wg.js";import{s as D}from"./labels-CzOhyWto.js";import{t as O}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as k}from"./useServerCategories-B-xv-Al_.js";var A={class:`server-category-picker`},j={class:`d-flex align-center flex-wrap ga-2 mb-2`},M={key:0,class:`text-center text-medium-emphasis py-4`},N={class:`d-flex align-center px-1 mb-1`},P={class:`text-caption text-medium-emphasis ml-1`},F={class:`d-flex align-center ga-2`},I={class:`text-body-2 font-weight-medium text-truncate`},L={class:`text-caption text-medium-emphasis text-truncate`},R=O(C({__name:`ServerCategoryPicker`,props:s({servers:{},loading:{type:Boolean,default:!1},maxHeight:{default:`280px`}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:[`update:modelValue`],setup(s){let C=i(s,`modelValue`),O=s,R=y(``),z=f(()=>new Set(C.value)),B=f(()=>{let e=R.value.trim().toLowerCase();return e?O.servers.filter(t=>t.name.toLowerCase().includes(e)||(t.domain||``).toLowerCase().includes(e)||(t.category||``).toLowerCase().includes(e)):O.servers}),V=f(()=>{let e={};for(let t of B.value){let n=t.category?.trim()||`uncategorized`;e[n]||(e[n]=[]),e[n].push(t)}return Object.entries(e).map(([e,t])=>({category:e,label:k(e),servers:[...t].sort((e,t)=>e.name.localeCompare(t.name,`zh`))})).sort((e,t)=>e.category===`uncategorized`?1:t.category===`uncategorized`?-1:e.label.localeCompare(t.label,`zh`))}),H=f(()=>{let e=B.value;return e.length>0&&e.every(e=>z.value.has(e.id))});function U(e){return e.servers.filter(e=>z.value.has(e.id)).length}function W(e){let t=V.value.find(t=>t.category===e);return!t||t.servers.length===0?!1:t.servers.every(e=>z.value.has(e.id))}function G(e){C.value=[...e]}function K(e){let t=new Set(C.value);t.has(e)?t.delete(e):t.add(e),G(t)}function q(e){let t=V.value.find(t=>t.category===e);if(!t)return;let n=new Set(C.value),r=t.servers.every(e=>n.has(e.id));for(let e of t.servers)r?n.delete(e.id):n.add(e.id);G(n)}function J(){let e=B.value,t=new Set(C.value),n=e.length>0&&e.every(e=>t.has(e.id));for(let r of e)n?t.delete(r.id):t.add(r.id);G(t)}return(i,f)=>(h(),m(`div`,A,[p(`div`,j,[x(E,{"model-value":H.value,label:`全选`,density:`compact`,"hide-details":``,"onUpdate:modelValue":J},null,8,[`model-value`]),x(T,{modelValue:R.value,"onUpdate:modelValue":f[0]||=e=>R.value=e,"prepend-inner-icon":`mdi-magnify`,label:`搜索服务器`,density:`compact`,"hide-details":``,variant:`outlined`,rounded:``,style:{"max-width":`220px`},clearable:``},null,8,[`modelValue`]),C.value.length>0?(h(),v(S,{key:0,size:`small`,color:`primary`,variant:`tonal`,label:``},{default:r(()=>[u(` 已选 `+b(C.value.length)+``,1)]),_:1})):g(``,!0),s.loading?(h(),v(l,{key:1,indeterminate:``,size:`18`,width:`2`})):g(``,!0)]),p(`div`,{class:`picker-scroll`,style:_({maxHeight:s.maxHeight})},[!s.loading&&V.value.length===0?(h(),m(`div`,M,` 暂无服务器 `)):g(``,!0),(h(!0),m(d,null,a(V.value,i=>(h(),m(`div`,{key:i.category,class:`mb-3`},[p(`div`,N,[x(o,{size:`x-small`,variant:`text`,color:W(i.category)?`primary`:`default`,onClick:e=>q(i.category)},{default:r(()=>[x(c,{size:`16`,class:`mr-1`},{default:r(()=>[u(b(W(i.category)?`mdi-checkbox-marked`:`mdi-checkbox-blank-outline`),1)]),_:2},1024),u(` `+b(i.label),1)]),_:2},1032,[`color`,`onClick`]),p(`span`,P,` (`+b(U(i))+`/`+b(i.servers.length)+`) `,1)]),x(t,{dense:``},{default:r(()=>[(h(!0),m(d,null,a(i.servers,t=>(h(),v(e,{key:t.id,cols:`12`,sm:`6`},{default:r(()=>[x(w,{color:z.value.has(t.id)?`primary`:void 0,variant:z.value.has(t.id)?`tonal`:`outlined`,rounded:`lg`,class:`pa-2 cursor-pointer`,onClick:e=>K(t.id)},{default:r(()=>[p(`div`,F,[x(c,{color:n(D)(t.is_online),size:`10`},{default:r(()=>[...f[1]||=[u(`mdi-circle`,-1)]]),_:1},8,[`color`]),p(`span`,I,b(t.name),1)]),p(`div`,L,b(t.domain),1)]),_:2},1032,[`color`,`variant`,`onClick`])]),_:2},1024))),128))]),_:2},1024)]))),128))],4)]))}}),[[`__scopeId`,`data-v-4d1df917`]]);export{R as t};
@@ -0,0 +1 @@
import{n as e,t}from"./VRow-D_fBpDV4.js";import{$r as n,Br as r,Lr as i,Nr as a,P as o,Sr as s,X as c,Y as l,_r as u,cr as d,dr as f,fr as p,hr as m,jr as h,mr as g,ni as _,pr as v,qr as y,ri as b,vr as x,y as S,yr as C}from"./index-BDmfR_V6.js";import{_ as w,t as T}from"./VTextField-20zRHFVo.js";import{t as E}from"./VCheckbox-Bqg-cCKg.js";import{s as D}from"./labels-CzOhyWto.js";import{t as O}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as k}from"./useServerCategories-BSKOZmPv.js";var A={class:`server-category-picker`},j={class:`d-flex align-center flex-wrap ga-2 mb-2`},M={key:0,class:`text-center text-medium-emphasis py-4`},N={class:`d-flex align-center px-1 mb-1`},P={class:`text-caption text-medium-emphasis ml-1`},F={class:`d-flex align-center ga-2`},I={class:`text-body-2 font-weight-medium text-truncate`},L={class:`text-caption text-medium-emphasis text-truncate`},R=O(C({__name:`ServerCategoryPicker`,props:s({servers:{},loading:{type:Boolean,default:!1},maxHeight:{default:`280px`}},{modelValue:{default:()=>[]},modelModifiers:{}}),emits:[`update:modelValue`],setup(s){let C=i(s,`modelValue`),O=s,R=y(``),z=f(()=>new Set(C.value)),B=f(()=>{let e=R.value.trim().toLowerCase();return e?O.servers.filter(t=>t.name.toLowerCase().includes(e)||(t.domain||``).toLowerCase().includes(e)||(t.category||``).toLowerCase().includes(e)):O.servers}),V=f(()=>{let e={};for(let t of B.value){let n=t.category?.trim()||`uncategorized`;e[n]||(e[n]=[]),e[n].push(t)}return Object.entries(e).map(([e,t])=>({category:e,label:k(e),servers:[...t].sort((e,t)=>e.name.localeCompare(t.name,`zh`))})).sort((e,t)=>e.category===`uncategorized`?1:t.category===`uncategorized`?-1:e.label.localeCompare(t.label,`zh`))}),H=f(()=>{let e=B.value;return e.length>0&&e.every(e=>z.value.has(e.id))});function U(e){return e.servers.filter(e=>z.value.has(e.id)).length}function W(e){let t=V.value.find(t=>t.category===e);return!t||t.servers.length===0?!1:t.servers.every(e=>z.value.has(e.id))}function G(e){C.value=[...e]}function K(e){let t=new Set(C.value);t.has(e)?t.delete(e):t.add(e),G(t)}function q(e){let t=V.value.find(t=>t.category===e);if(!t)return;let n=new Set(C.value),r=t.servers.every(e=>n.has(e.id));for(let e of t.servers)r?n.delete(e.id):n.add(e.id);G(n)}function J(){let e=B.value,t=new Set(C.value),n=e.length>0&&e.every(e=>t.has(e.id));for(let r of e)n?t.delete(r.id):t.add(r.id);G(t)}return(i,f)=>(h(),m(`div`,A,[p(`div`,j,[x(E,{"model-value":H.value,label:`全选`,density:`compact`,"hide-details":``,"onUpdate:modelValue":J},null,8,[`model-value`]),x(T,{modelValue:R.value,"onUpdate:modelValue":f[0]||=e=>R.value=e,"prepend-inner-icon":`mdi-magnify`,label:`搜索服务器`,density:`compact`,"hide-details":``,variant:`outlined`,rounded:``,style:{"max-width":`220px`},clearable:``},null,8,[`modelValue`]),C.value.length>0?(h(),v(S,{key:0,size:`small`,color:`primary`,variant:`tonal`,label:``},{default:r(()=>[u(` 已选 `+b(C.value.length)+``,1)]),_:1})):g(``,!0),s.loading?(h(),v(l,{key:1,indeterminate:``,size:`18`,width:`2`})):g(``,!0)]),p(`div`,{class:`picker-scroll`,style:_({maxHeight:s.maxHeight})},[!s.loading&&V.value.length===0?(h(),m(`div`,M,` 暂无服务器 `)):g(``,!0),(h(!0),m(d,null,a(V.value,i=>(h(),m(`div`,{key:i.category,class:`mb-3`},[p(`div`,N,[x(o,{size:`x-small`,variant:`text`,color:W(i.category)?`primary`:`default`,onClick:e=>q(i.category)},{default:r(()=>[x(c,{size:`16`,class:`mr-1`},{default:r(()=>[u(b(W(i.category)?`mdi-checkbox-marked`:`mdi-checkbox-blank-outline`),1)]),_:2},1024),u(` `+b(i.label),1)]),_:2},1032,[`color`,`onClick`]),p(`span`,P,` (`+b(U(i))+`/`+b(i.servers.length)+`) `,1)]),x(t,{dense:``},{default:r(()=>[(h(!0),m(d,null,a(i.servers,t=>(h(),v(e,{key:t.id,cols:`12`,sm:`6`},{default:r(()=>[x(w,{color:z.value.has(t.id)?`primary`:void 0,variant:z.value.has(t.id)?`tonal`:`outlined`,rounded:`lg`,class:`pa-2 cursor-pointer`,onClick:e=>K(t.id)},{default:r(()=>[p(`div`,F,[x(c,{color:n(D)(t.is_online),size:`10`},{default:r(()=>[...f[1]||=[u(`mdi-circle`,-1)]]),_:1},8,[`color`]),p(`span`,I,b(t.name),1)]),p(`div`,L,b(t.domain),1)]),_:2},1032,[`color`,`variant`,`onClick`])]),_:2},1024))),128))]),_:2},1024)]))),128))],4)]))}}),[[`__scopeId`,`data-v-4d1df917`]]);export{R as t};
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
@layer vuetify-components{.v-combobox--chips.v-input--density-compact .v-field--variant-solo .v-label.v-field-label--floating,.v-combobox--chips.v-input--density-compact .v-field--variant-solo-inverted .v-label.v-field-label--floating,.v-combobox--chips.v-input--density-compact .v-field--variant-filled .v-label.v-field-label--floating,.v-combobox--chips.v-input--density-compact .v-field--variant-solo-filled .v-label.v-field-label--floating{top:0}.v-combobox .v-field .v-text-field__prefix,.v-combobox .v-field .v-text-field__suffix,.v-combobox .v-field .v-field__input,.v-combobox .v-field .v-field__input>input,.v-combobox .v-field.v-field{cursor:text}.v-combobox .v-field .v-field__input>input{flex:1}.v-combobox .v-field input{min-width:64px}.v-combobox .v-field:not(.v-field--focused) input{min-width:0}.v-combobox .v-field--dirty .v-combobox__selection{margin-inline-end:2px}.v-combobox .v-combobox__selection-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.v-combobox__content{box-shadow:0px 1px 2px 0px rgba(var(--v-shadow-color), var(--v-shadow-key-opacity,.3)), 0px 2px 6px 2px rgba(var(--v-shadow-color), var(--v-shadow-ambient-opacity,.15));--v-elevation-overlay:color-mix(in srgb, var(--v-elevation-overlay-color) 4%, transparent);overflow:hidden}.v-menu>.v-overlay__content.v-combobox__content{border-radius:4px}.v-combobox__content>.v-sheet{flex-direction:column;display:flex}.v-combobox__mask{background:rgb(var(--v-theme-surface-light))}.v-combobox__selection{height:1.5rem;letter-spacing:inherit;line-height:inherit;align-items:center;max-width:calc(100% - 4px);display:inline-flex}.v-combobox__selection:first-child{margin-inline-start:0}.v-combobox--selecting-index .v-combobox__selection{opacity:var(--v-medium-emphasis-opacity)}.v-combobox--selecting-index .v-combobox__selection--selected{opacity:1}.v-combobox--selecting-index .v-field__input>input{caret-color:#0000}.v-combobox--single:not(.v-combobox--selection-slot).v-text-field input{width:100%;padding-inline:inherit;flex:1;position:absolute;left:0;right:0}.v-combobox--single:not(.v-combobox--selection-slot) .v-field--active input{transition:none}.v-combobox--single:not(.v-combobox--selection-slot) .v-field--dirty:not(.v-field--focused) input,.v-combobox--single:not(.v-combobox--selection-slot) .v-field--focused .v-combobox__selection{opacity:0}.v-combobox__menu-icon{margin-inline-start:4px;transition:all .2s cubic-bezier(.4,0,.2,1)}.v-combobox--active-menu .v-combobox__menu-icon{transform:rotate(180deg)}}.server-unset-path-table[data-v-9119b349] .v-data-table__td--expand-column,.server-unset-path-table[data-v-9119b349] .v-data-table-column--expand,.server-unset-path-table[data-v-9119b349] th.v-data-table__th--expand,.server-main-table[data-v-2369cc20] .v-data-table__td--expand-column,.server-main-table[data-v-2369cc20] .v-data-table-column--expand,.server-main-table[data-v-2369cc20] th.v-data-table__th--expand{width:0!important;padding:0!important;display:none!important}
+1
View File
@@ -0,0 +1 @@
@layer vuetify-components{.v-combobox--chips.v-input--density-compact .v-field--variant-solo .v-label.v-field-label--floating,.v-combobox--chips.v-input--density-compact .v-field--variant-solo-inverted .v-label.v-field-label--floating,.v-combobox--chips.v-input--density-compact .v-field--variant-filled .v-label.v-field-label--floating,.v-combobox--chips.v-input--density-compact .v-field--variant-solo-filled .v-label.v-field-label--floating{top:0}.v-combobox .v-field .v-text-field__prefix,.v-combobox .v-field .v-text-field__suffix,.v-combobox .v-field .v-field__input,.v-combobox .v-field .v-field__input>input,.v-combobox .v-field.v-field{cursor:text}.v-combobox .v-field .v-field__input>input{flex:1}.v-combobox .v-field input{min-width:64px}.v-combobox .v-field:not(.v-field--focused) input{min-width:0}.v-combobox .v-field--dirty .v-combobox__selection{margin-inline-end:2px}.v-combobox .v-combobox__selection-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.v-combobox__content{box-shadow:0px 1px 2px 0px rgba(var(--v-shadow-color), var(--v-shadow-key-opacity,.3)), 0px 2px 6px 2px rgba(var(--v-shadow-color), var(--v-shadow-ambient-opacity,.15));--v-elevation-overlay:color-mix(in srgb, var(--v-elevation-overlay-color) 4%, transparent);overflow:hidden}.v-menu>.v-overlay__content.v-combobox__content{border-radius:4px}.v-combobox__content>.v-sheet{flex-direction:column;display:flex}.v-combobox__mask{background:rgb(var(--v-theme-surface-light))}.v-combobox__selection{height:1.5rem;letter-spacing:inherit;line-height:inherit;align-items:center;max-width:calc(100% - 4px);display:inline-flex}.v-combobox__selection:first-child{margin-inline-start:0}.v-combobox--selecting-index .v-combobox__selection{opacity:var(--v-medium-emphasis-opacity)}.v-combobox--selecting-index .v-combobox__selection--selected{opacity:1}.v-combobox--selecting-index .v-field__input>input{caret-color:#0000}.v-combobox--single:not(.v-combobox--selection-slot).v-text-field input{width:100%;padding-inline:inherit;flex:1;position:absolute;left:0;right:0}.v-combobox--single:not(.v-combobox--selection-slot) .v-field--active input{transition:none}.v-combobox--single:not(.v-combobox--selection-slot) .v-field--dirty:not(.v-field--focused) input,.v-combobox--single:not(.v-combobox--selection-slot) .v-field--focused .v-combobox__selection{opacity:0}.v-combobox__menu-icon{margin-inline-start:4px;transition:all .2s cubic-bezier(.4,0,.2,1)}.v-combobox--active-menu .v-combobox__menu-icon{transform:rotate(180deg)}}.server-unset-path-table[data-v-5f739064] .v-data-table__td--expand-column,.server-unset-path-table[data-v-5f739064] .v-data-table-column--expand,.server-unset-path-table[data-v-5f739064] th.v-data-table__th--expand,.server-main-table[data-v-b1cc8ff6] .v-data-table__td--expand-column,.server-main-table[data-v-b1cc8ff6] .v-data-table-column--expand,.server-main-table[data-v-b1cc8ff6] th.v-data-table__th--expand{width:0!important;padding:0!important;display:none!important}
+1
View File
@@ -0,0 +1 @@
@layer vuetify-components{.v-combobox--chips.v-input--density-compact .v-field--variant-solo .v-label.v-field-label--floating,.v-combobox--chips.v-input--density-compact .v-field--variant-solo-inverted .v-label.v-field-label--floating,.v-combobox--chips.v-input--density-compact .v-field--variant-filled .v-label.v-field-label--floating,.v-combobox--chips.v-input--density-compact .v-field--variant-solo-filled .v-label.v-field-label--floating{top:0}.v-combobox .v-field .v-text-field__prefix,.v-combobox .v-field .v-text-field__suffix,.v-combobox .v-field .v-field__input,.v-combobox .v-field .v-field__input>input,.v-combobox .v-field.v-field{cursor:text}.v-combobox .v-field .v-field__input>input{flex:1}.v-combobox .v-field input{min-width:64px}.v-combobox .v-field:not(.v-field--focused) input{min-width:0}.v-combobox .v-field--dirty .v-combobox__selection{margin-inline-end:2px}.v-combobox .v-combobox__selection-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.v-combobox__content{box-shadow:0px 1px 2px 0px rgba(var(--v-shadow-color), var(--v-shadow-key-opacity,.3)), 0px 2px 6px 2px rgba(var(--v-shadow-color), var(--v-shadow-ambient-opacity,.15));--v-elevation-overlay:color-mix(in srgb, var(--v-elevation-overlay-color) 4%, transparent);overflow:hidden}.v-menu>.v-overlay__content.v-combobox__content{border-radius:4px}.v-combobox__content>.v-sheet{flex-direction:column;display:flex}.v-combobox__mask{background:rgb(var(--v-theme-surface-light))}.v-combobox__selection{height:1.5rem;letter-spacing:inherit;line-height:inherit;align-items:center;max-width:calc(100% - 4px);display:inline-flex}.v-combobox__selection:first-child{margin-inline-start:0}.v-combobox--selecting-index .v-combobox__selection{opacity:var(--v-medium-emphasis-opacity)}.v-combobox--selecting-index .v-combobox__selection--selected{opacity:1}.v-combobox--selecting-index .v-field__input>input{caret-color:#0000}.v-combobox--single:not(.v-combobox--selection-slot).v-text-field input{width:100%;padding-inline:inherit;flex:1;position:absolute;left:0;right:0}.v-combobox--single:not(.v-combobox--selection-slot) .v-field--active input{transition:none}.v-combobox--single:not(.v-combobox--selection-slot) .v-field--dirty:not(.v-field--focused) input,.v-combobox--single:not(.v-combobox--selection-slot) .v-field--focused .v-combobox__selection{opacity:0}.v-combobox__menu-icon{margin-inline-start:4px;transition:all .2s cubic-bezier(.4,0,.2,1)}.v-combobox--active-menu .v-combobox__menu-icon{transform:rotate(180deg)}}.server-unset-path-table[data-v-5f739064] .v-data-table__td--expand-column,.server-unset-path-table[data-v-5f739064] .v-data-table-column--expand,.server-unset-path-table[data-v-5f739064] th.v-data-table__th--expand,.server-main-table[data-v-4aeb6903] .v-data-table__td--expand-column,.server-main-table[data-v-4aeb6903] .v-data-table-column--expand,.server-main-table[data-v-4aeb6903] th.v-data-table__th--expand{width:0!important;padding:0!important;display:none!important}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import{d as e,f as t}from"./VSelect-DTpWglKn.js";import{Cr as n,Fn as r,Ir as i,Yn as a,gn as o,qr as s,r as c,sn as l,un as u,vr as d,xn as f}from"./index-BHUpfn3R.js";import{l as p,m,u as h}from"./VTextField-Dl1UyBCb.js";var g=f({...a(h(),[`direction`]),...a(t(),[`inline`])},`VCheckbox`),_=o()({name:`VCheckbox`,inheritAttrs:!1,props:g(),emits:{"update:modelValue":e=>!0,"update:focused":e=>!0},setup(t,{attrs:a,slots:o}){let f=l(t,`modelValue`),{isFocused:h,focus:g,blur:_}=m(t),v=s(),y=i();return u(()=>{let[i,s]=r(a),c=p.filterProps(t),l=e.filterProps(t);return d(p,n({ref:v,class:[`v-checkbox`,t.class]},i,c,{modelValue:f.value,"onUpdate:modelValue":e=>f.value=e,id:t.id||`checkbox-${y}`,focused:h.value,style:t.style}),{...o,default:({id:t,messagesId:r,isDisabled:i,isReadonly:a,isValid:c})=>d(e,n(l,{id:t.value,"aria-describedby":r.value,disabled:i.value,readonly:a.value},s,{error:c.value===!1,modelValue:f.value,"onUpdate:modelValue":e=>f.value=e,onFocus:g,onBlur:_}),o)})}),c({},v)}});export{_ as t};
+1
View File
@@ -0,0 +1 @@
import{d as e,f as t}from"./VSelect-DCVEXXlg.js";import{Cr as n,Fn as r,Ir as i,Yn as a,gn as o,qr as s,r as c,sn as l,un as u,vr as d,xn as f}from"./index-BDmfR_V6.js";import{l as p,m,u as h}from"./VTextField-20zRHFVo.js";var g=f({...a(h(),[`direction`]),...a(t(),[`inline`])},`VCheckbox`),_=o()({name:`VCheckbox`,inheritAttrs:!1,props:g(),emits:{"update:modelValue":e=>!0,"update:focused":e=>!0},setup(t,{attrs:a,slots:o}){let f=l(t,`modelValue`),{isFocused:h,focus:g,blur:_}=m(t),v=s(),y=i();return u(()=>{let[i,s]=r(a),c=p.filterProps(t),l=e.filterProps(t);return d(p,n({ref:v,class:[`v-checkbox`,t.class]},i,c,{modelValue:f.value,"onUpdate:modelValue":e=>f.value=e,id:t.id||`checkbox-${y}`,focused:h.value,style:t.style}),{...o,default:({id:t,messagesId:r,isDisabled:i,isReadonly:a,isValid:c})=>d(e,n(l,{id:t.value,"aria-describedby":r.value,disabled:i.value,readonly:a.value},s,{error:c.value===!1,modelValue:f.value,"onUpdate:modelValue":e=>f.value=e,onFocus:g,onBlur:_}),o)})}),c({},v)}});export{_ as t};
+1
View File
@@ -0,0 +1 @@
import{d as e,f as t}from"./VSelect-Cx2P_6TS.js";import{Cr as n,Fn as r,Ir as i,Yn as a,gn as o,qr as s,r as c,sn as l,un as u,vr as d,xn as f}from"./index-DBlT8p9k.js";import{l as p,m,u as h}from"./VTextField-BK-1eNm9.js";var g=f({...a(h(),[`direction`]),...a(t(),[`inline`])},`VCheckbox`),_=o()({name:`VCheckbox`,inheritAttrs:!1,props:g(),emits:{"update:modelValue":e=>!0,"update:focused":e=>!0},setup(t,{attrs:a,slots:o}){let f=l(t,`modelValue`),{isFocused:h,focus:g,blur:_}=m(t),v=s(),y=i();return u(()=>{let[i,s]=r(a),c=p.filterProps(t),l=e.filterProps(t);return d(p,n({ref:v,class:[`v-checkbox`,t.class]},i,c,{modelValue:f.value,"onUpdate:modelValue":e=>f.value=e,id:t.id||`checkbox-${y}`,focused:h.value,style:t.style}),{...o,default:({id:t,messagesId:r,isDisabled:i,isReadonly:a,isValid:c})=>d(e,n(l,{id:t.value,"aria-describedby":r.value,disabled:i.value,readonly:a.value},s,{error:c.value===!1,modelValue:f.value,"onUpdate:modelValue":e=>f.value=e,onFocus:g,onBlur:_}),o)})}),c({},v)}});export{_ as t};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
import{_ as e,a as t,b as n,c as r,d as i,f as a,g as o,h as s,i as c,l,m as u,n as d,o as f,p,r as ee,s as m,u as h,v as g,y as _}from"./VDataTable-Ceh6gMgK.js";import{Cr as v,Mr as y,Xr as b,Yn as x,Zr as S,_n as C,cr as w,dr as T,fr as E,gn as D,un as te,v as ne,vr as O,xn as k}from"./index-BDmfR_V6.js";var A=k({itemsLength:{type:[Number,String],required:!0},..._(),...d(),...e()},`VDataTableServer`),j=D()({name:`VDataTableServer`,props:A(),emits:{"update:modelValue":e=>!0,"update:page":e=>!0,"update:itemsPerPage":e=>!0,"update:sortBy":e=>!0,"update:options":e=>!0,"update:expanded":e=>!0,"update:groupBy":e=>!0},setup(e,{attrs:d,slots:_}){let{groupBy:D}=r(e),{initialSortOrder:k,sortBy:A,multiSort:j,mustSort:M}=a(e),{page:N,itemsPerPage:P}=g(e),{disableSort:F}=S(e),I=T(()=>parseInt(e.itemsLength,10)),{columns:L,headers:R}=s(e,{groupBy:D,showSelect:b(()=>e.showSelect),showExpand:b(()=>e.showExpand)}),{items:z}=c(e,L),{toggleSort:B}=p({initialSortOrder:k,sortBy:A,multiSort:j,mustSort:M,page:N}),{opened:V,isGroupOpen:H,toggleGroup:re,extractRows:U}=l({groupBy:D,sortBy:A,disableSort:F}),{pageCount:W,setItemsPerPage:G,prevPage:K,nextPage:q,setPage:J}=n({page:N,itemsPerPage:P,itemsLength:I}),{flatItems:Y}=h(z,D,V,()=>!!_[`group-summary`]),{isSelected:X,select:ie,selectAll:Z,toggleSelect:ae,someSelected:oe,allSelected:se}=u(e,{allItems:z,currentPage:z}),{isExpanded:ce,toggleExpand:le}=m(e),Q=T(()=>U(z.value));ee({page:N,itemsPerPage:P,sortBy:A,groupBy:D,search:b(()=>e.search)}),y(`v-data-table`,{toggleSort:B,sortBy:A}),C({VDataTableRows:{hideNoData:b(()=>e.hideNoData),noDataText:b(()=>e.noDataText),loading:b(()=>e.loading),loadingText:b(()=>e.loadingText)}});let $=T(()=>({page:N.value,itemsPerPage:P.value,sortBy:A.value,pageCount:W.value,toggleSort:B,setItemsPerPage:G,prevPage:K,nextPage:q,setPage:J,someSelected:oe.value,allSelected:se.value,isSelected:X,select:ie,selectAll:Z,toggleSelect:ae,isExpanded:ce,toggleExpand:le,isGroupOpen:H,toggleGroup:re,items:Q.value.map(e=>e.raw),internalItems:Q.value,groupedItems:Y.value,columns:L.value,headers:R.value}));te(()=>{let n=o.filterProps(e),r=i.filterProps(x(e,[`multiSort`])),a=f.filterProps(e),s=t.filterProps(e);return O(t,v({class:[`v-data-table`,{"v-data-table--loading":e.loading},e.class],style:e.style},s,{fixedHeader:e.fixedHeader||e.sticky}),{top:()=>_.top?.($.value),default:()=>_.default?_.default($.value):E(w,null,[_.colgroup?.($.value),!e.hideDefaultHeader&&E(`thead`,{key:`thead`,class:`v-data-table__thead`,role:`rowgroup`},[O(i,v(r,{multiSort:!!e.multiSort}),_)]),_.thead?.($.value),!e.hideDefaultBody&&E(`tbody`,{class:`v-data-table__tbody`,role:`rowgroup`},[_[`body.prepend`]?.($.value),_.body?_.body($.value):O(f,v(d,a,{items:Y.value}),_),_[`body.append`]?.($.value)]),_.tbody?.($.value),_.tfoot?.($.value)]),bottom:()=>_.bottom?_.bottom($.value):!e.hideDefaultFooter&&E(w,null,[O(ne,null,null),O(o,n,{prepend:_[`footer.prepend`]})])})})}});export{j as t};
@@ -0,0 +1 @@
import{_ as e,a as t,b as n,c as r,d as i,f as a,g as o,h as s,i as c,l,m as u,n as d,o as f,p,r as ee,s as m,u as h,v as g,y as _}from"./VDataTable-Cl6WWSpT.js";import{Cr as v,Mr as y,Xr as b,Yn as x,Zr as S,_n as C,cr as w,dr as T,fr as E,gn as D,un as te,v as ne,vr as O,xn as k}from"./index-DBlT8p9k.js";var A=k({itemsLength:{type:[Number,String],required:!0},..._(),...d(),...e()},`VDataTableServer`),j=D()({name:`VDataTableServer`,props:A(),emits:{"update:modelValue":e=>!0,"update:page":e=>!0,"update:itemsPerPage":e=>!0,"update:sortBy":e=>!0,"update:options":e=>!0,"update:expanded":e=>!0,"update:groupBy":e=>!0},setup(e,{attrs:d,slots:_}){let{groupBy:D}=r(e),{initialSortOrder:k,sortBy:A,multiSort:j,mustSort:M}=a(e),{page:N,itemsPerPage:P}=g(e),{disableSort:F}=S(e),I=T(()=>parseInt(e.itemsLength,10)),{columns:L,headers:R}=s(e,{groupBy:D,showSelect:b(()=>e.showSelect),showExpand:b(()=>e.showExpand)}),{items:z}=c(e,L),{toggleSort:B}=p({initialSortOrder:k,sortBy:A,multiSort:j,mustSort:M,page:N}),{opened:V,isGroupOpen:H,toggleGroup:re,extractRows:U}=l({groupBy:D,sortBy:A,disableSort:F}),{pageCount:W,setItemsPerPage:G,prevPage:K,nextPage:q,setPage:J}=n({page:N,itemsPerPage:P,itemsLength:I}),{flatItems:Y}=h(z,D,V,()=>!!_[`group-summary`]),{isSelected:X,select:ie,selectAll:Z,toggleSelect:ae,someSelected:oe,allSelected:se}=u(e,{allItems:z,currentPage:z}),{isExpanded:ce,toggleExpand:le}=m(e),Q=T(()=>U(z.value));ee({page:N,itemsPerPage:P,sortBy:A,groupBy:D,search:b(()=>e.search)}),y(`v-data-table`,{toggleSort:B,sortBy:A}),C({VDataTableRows:{hideNoData:b(()=>e.hideNoData),noDataText:b(()=>e.noDataText),loading:b(()=>e.loading),loadingText:b(()=>e.loadingText)}});let $=T(()=>({page:N.value,itemsPerPage:P.value,sortBy:A.value,pageCount:W.value,toggleSort:B,setItemsPerPage:G,prevPage:K,nextPage:q,setPage:J,someSelected:oe.value,allSelected:se.value,isSelected:X,select:ie,selectAll:Z,toggleSelect:ae,isExpanded:ce,toggleExpand:le,isGroupOpen:H,toggleGroup:re,items:Q.value.map(e=>e.raw),internalItems:Q.value,groupedItems:Y.value,columns:L.value,headers:R.value}));te(()=>{let n=o.filterProps(e),r=i.filterProps(x(e,[`multiSort`])),a=f.filterProps(e),s=t.filterProps(e);return O(t,v({class:[`v-data-table`,{"v-data-table--loading":e.loading},e.class],style:e.style},s,{fixedHeader:e.fixedHeader||e.sticky}),{top:()=>_.top?.($.value),default:()=>_.default?_.default($.value):E(w,null,[_.colgroup?.($.value),!e.hideDefaultHeader&&E(`thead`,{key:`thead`,class:`v-data-table__thead`,role:`rowgroup`},[O(i,v(r,{multiSort:!!e.multiSort}),_)]),_.thead?.($.value),!e.hideDefaultBody&&E(`tbody`,{class:`v-data-table__tbody`,role:`rowgroup`},[_[`body.prepend`]?.($.value),_.body?_.body($.value):O(f,v(d,a,{items:Y.value}),_),_[`body.append`]?.($.value)]),_.tbody?.($.value),_.tfoot?.($.value)]),bottom:()=>_.bottom?_.bottom($.value):!e.hideDefaultFooter&&E(w,null,[O(ne,null,null),O(o,n,{prepend:_[`footer.prepend`]})])})})}});export{j as t};
@@ -0,0 +1 @@
import{_ as e,a as t,b as n,c as r,d as i,f as a,g as o,h as s,i as c,l,m as u,n as d,o as f,p,r as ee,s as m,u as h,v as g,y as _}from"./VDataTable-Ct3hXpBH.js";import{Cr as v,Mr as y,Xr as b,Yn as x,Zr as S,_n as C,cr as w,dr as T,fr as E,gn as D,un as te,v as ne,vr as O,xn as k}from"./index-BHUpfn3R.js";var A=k({itemsLength:{type:[Number,String],required:!0},..._(),...d(),...e()},`VDataTableServer`),j=D()({name:`VDataTableServer`,props:A(),emits:{"update:modelValue":e=>!0,"update:page":e=>!0,"update:itemsPerPage":e=>!0,"update:sortBy":e=>!0,"update:options":e=>!0,"update:expanded":e=>!0,"update:groupBy":e=>!0},setup(e,{attrs:d,slots:_}){let{groupBy:D}=r(e),{initialSortOrder:k,sortBy:A,multiSort:j,mustSort:M}=a(e),{page:N,itemsPerPage:P}=g(e),{disableSort:F}=S(e),I=T(()=>parseInt(e.itemsLength,10)),{columns:L,headers:R}=s(e,{groupBy:D,showSelect:b(()=>e.showSelect),showExpand:b(()=>e.showExpand)}),{items:z}=c(e,L),{toggleSort:B}=p({initialSortOrder:k,sortBy:A,multiSort:j,mustSort:M,page:N}),{opened:V,isGroupOpen:H,toggleGroup:re,extractRows:U}=l({groupBy:D,sortBy:A,disableSort:F}),{pageCount:W,setItemsPerPage:G,prevPage:K,nextPage:q,setPage:J}=n({page:N,itemsPerPage:P,itemsLength:I}),{flatItems:Y}=h(z,D,V,()=>!!_[`group-summary`]),{isSelected:X,select:ie,selectAll:Z,toggleSelect:ae,someSelected:oe,allSelected:se}=u(e,{allItems:z,currentPage:z}),{isExpanded:ce,toggleExpand:le}=m(e),Q=T(()=>U(z.value));ee({page:N,itemsPerPage:P,sortBy:A,groupBy:D,search:b(()=>e.search)}),y(`v-data-table`,{toggleSort:B,sortBy:A}),C({VDataTableRows:{hideNoData:b(()=>e.hideNoData),noDataText:b(()=>e.noDataText),loading:b(()=>e.loading),loadingText:b(()=>e.loadingText)}});let $=T(()=>({page:N.value,itemsPerPage:P.value,sortBy:A.value,pageCount:W.value,toggleSort:B,setItemsPerPage:G,prevPage:K,nextPage:q,setPage:J,someSelected:oe.value,allSelected:se.value,isSelected:X,select:ie,selectAll:Z,toggleSelect:ae,isExpanded:ce,toggleExpand:le,isGroupOpen:H,toggleGroup:re,items:Q.value.map(e=>e.raw),internalItems:Q.value,groupedItems:Y.value,columns:L.value,headers:R.value}));te(()=>{let n=o.filterProps(e),r=i.filterProps(x(e,[`multiSort`])),a=f.filterProps(e),s=t.filterProps(e);return O(t,v({class:[`v-data-table`,{"v-data-table--loading":e.loading},e.class],style:e.style},s,{fixedHeader:e.fixedHeader||e.sticky}),{top:()=>_.top?.($.value),default:()=>_.default?_.default($.value):E(w,null,[_.colgroup?.($.value),!e.hideDefaultHeader&&E(`thead`,{key:`thead`,class:`v-data-table__thead`,role:`rowgroup`},[O(i,v(r,{multiSort:!!e.multiSort}),_)]),_.thead?.($.value),!e.hideDefaultBody&&E(`tbody`,{class:`v-data-table__tbody`,role:`rowgroup`},[_[`body.prepend`]?.($.value),_.body?_.body($.value):O(f,v(d,a,{items:Y.value}),_),_[`body.append`]?.($.value)]),_.tbody?.($.value),_.tfoot?.($.value)]),bottom:()=>_.bottom?_.bottom($.value):!e.hideDefaultFooter&&E(w,null,[O(ne,null,null),O(o,n,{prepend:_[`footer.prepend`]})])})})}});export{j as t};
+1
View File
@@ -0,0 +1 @@
import{Cr as e,M as t,Q as n,Rr as r,Yn as i,a,gn as o,i as s,o as c,qr as l,r as u,sn as d,un as f,vr as p,wr as m,xn as h}from"./index-BDmfR_V6.js";var g=h({fullscreen:Boolean,scrollable:Boolean,...i(a({captureFocus:!0,origin:`center center`,scrollStrategy:`block`,transition:{component:t},zIndex:2400,retainFocus:!0}),[`disableInitialFocus`])},`VDialog`),_=o()({name:`VDialog`,props:g(),emits:{"update:modelValue":e=>!0,afterEnter:()=>!0,afterLeave:()=>!0},setup(t,{emit:i,slots:a}){let o=d(t,`modelValue`),{scopeId:h}=c(),g=l();function _(){i(`afterEnter`),(t.scrim||t.retainFocus)&&g.value?.contentEl&&!g.value.contentEl.contains(document.activeElement)&&g.value.contentEl.focus({preventScroll:!0})}function v(){i(`afterLeave`)}return r(o,async e=>{e||(await m(),g.value.activatorEl?.focus({preventScroll:!0}))}),f(()=>{let r=s.filterProps(t),i=e({"aria-haspopup":`dialog`},t.activatorProps),c=e({tabindex:-1},t.contentProps);return p(s,e({ref:g,class:[`v-dialog`,{"v-dialog--fullscreen":t.fullscreen,"v-dialog--scrollable":t.scrollable},t.class],style:t.style},r,{modelValue:o.value,"onUpdate:modelValue":e=>o.value=e,"aria-modal":`true`,activatorProps:i,contentProps:c,height:t.fullscreen?void 0:t.height,width:t.fullscreen?void 0:t.width,maxHeight:t.fullscreen?void 0:t.maxHeight,maxWidth:t.fullscreen?void 0:t.maxWidth,role:`dialog`,onAfterEnter:_,onAfterLeave:v},h),{activator:a.activator,default:(...e)=>p(n,{root:`VDialog`},{default:()=>[a.default?.(...e)]})})}),u({},g)}});export{_ as t};
+1
View File
@@ -0,0 +1 @@
import{Cr as e,M as t,Q as n,Rr as r,Yn as i,a,gn as o,i as s,o as c,qr as l,r as u,sn as d,un as f,vr as p,wr as m,xn as h}from"./index-DBlT8p9k.js";var g=h({fullscreen:Boolean,scrollable:Boolean,...i(a({captureFocus:!0,origin:`center center`,scrollStrategy:`block`,transition:{component:t},zIndex:2400,retainFocus:!0}),[`disableInitialFocus`])},`VDialog`),_=o()({name:`VDialog`,props:g(),emits:{"update:modelValue":e=>!0,afterEnter:()=>!0,afterLeave:()=>!0},setup(t,{emit:i,slots:a}){let o=d(t,`modelValue`),{scopeId:h}=c(),g=l();function _(){i(`afterEnter`),(t.scrim||t.retainFocus)&&g.value?.contentEl&&!g.value.contentEl.contains(document.activeElement)&&g.value.contentEl.focus({preventScroll:!0})}function v(){i(`afterLeave`)}return r(o,async e=>{e||(await m(),g.value.activatorEl?.focus({preventScroll:!0}))}),f(()=>{let r=s.filterProps(t),i=e({"aria-haspopup":`dialog`},t.activatorProps),c=e({tabindex:-1},t.contentProps);return p(s,e({ref:g,class:[`v-dialog`,{"v-dialog--fullscreen":t.fullscreen,"v-dialog--scrollable":t.scrollable},t.class],style:t.style},r,{modelValue:o.value,"onUpdate:modelValue":e=>o.value=e,"aria-modal":`true`,activatorProps:i,contentProps:c,height:t.fullscreen?void 0:t.height,width:t.fullscreen?void 0:t.width,maxHeight:t.fullscreen?void 0:t.maxHeight,maxWidth:t.fullscreen?void 0:t.maxWidth,role:`dialog`,onAfterEnter:_,onAfterLeave:v},h),{activator:a.activator,default:(...e)=>p(n,{root:`VDialog`},{default:()=>[a.default?.(...e)]})})}),u({},g)}});export{_ as t};
+1
View File
@@ -0,0 +1 @@
import{Cr as e,M as t,Q as n,Rr as r,Yn as i,a,gn as o,i as s,o as c,qr as l,r as u,sn as d,un as f,vr as p,wr as m,xn as h}from"./index-BHUpfn3R.js";var g=h({fullscreen:Boolean,scrollable:Boolean,...i(a({captureFocus:!0,origin:`center center`,scrollStrategy:`block`,transition:{component:t},zIndex:2400,retainFocus:!0}),[`disableInitialFocus`])},`VDialog`),_=o()({name:`VDialog`,props:g(),emits:{"update:modelValue":e=>!0,afterEnter:()=>!0,afterLeave:()=>!0},setup(t,{emit:i,slots:a}){let o=d(t,`modelValue`),{scopeId:h}=c(),g=l();function _(){i(`afterEnter`),(t.scrim||t.retainFocus)&&g.value?.contentEl&&!g.value.contentEl.contains(document.activeElement)&&g.value.contentEl.focus({preventScroll:!0})}function v(){i(`afterLeave`)}return r(o,async e=>{e||(await m(),g.value.activatorEl?.focus({preventScroll:!0}))}),f(()=>{let r=s.filterProps(t),i=e({"aria-haspopup":`dialog`},t.activatorProps),c=e({tabindex:-1},t.contentProps);return p(s,e({ref:g,class:[`v-dialog`,{"v-dialog--fullscreen":t.fullscreen,"v-dialog--scrollable":t.scrollable},t.class],style:t.style},r,{modelValue:o.value,"onUpdate:modelValue":e=>o.value=e,"aria-modal":`true`,activatorProps:i,contentProps:c,height:t.fullscreen?void 0:t.height,width:t.fullscreen?void 0:t.width,maxHeight:t.fullscreen?void 0:t.maxHeight,maxWidth:t.fullscreen?void 0:t.maxWidth,role:`dialog`,onAfterEnter:_,onAfterLeave:v},h),{activator:a.activator,default:(...e)=>p(n,{root:`VDialog`},{default:()=>[a.default?.(...e)]})})}),u({},g)}});export{_ as t};
@@ -0,0 +1 @@
import{I as e,J as t,Mr as n,O as r,Q as i,Vr as a,X as o,Xn as s,Xr as c,_n as l,ar as u,bn as d,c as f,dr as p,dt as m,en as h,et as g,fr as _,ft as v,gn as y,ln as b,lt as x,ni as S,nt as C,pt as w,q as T,rt as E,s as D,st as O,ti as k,tn as A,tt as j,un as M,ut as N,vr as P,xn as F,xr as I}from"./index-DBlT8p9k.js";var L=Symbol.for(`vuetify:v-expansion-panel`),R=F({...d(),...D()},`VExpansionPanelText`),z=y()({name:`VExpansionPanelText`,props:R(),setup(e,{slots:t}){let n=I(L);if(!n)throw Error(`[Vuetify] v-expansion-panel-text needs to be placed inside v-expansion-panel`);let{hasContent:i,onAfterLeave:o}=f(e,n.isSelected);return M(()=>P(r,{onAfterLeave:o},{default:()=>[a(_(`div`,{class:k([`v-expansion-panel-text`,e.class]),style:S(e.style)},[t.default&&i.value&&_(`div`,{class:`v-expansion-panel-text__wrapper`},[t.default?.()])]),[[u,n.isSelected.value]])]})),{}}}),B=F({color:String,expandIcon:{type:b,default:`$expand`},collapseIcon:{type:b,default:`$collapse`},hideActions:Boolean,focusable:Boolean,static:Boolean,ripple:{type:[Boolean,Object],default:!1},readonly:Boolean,...d(),...T()},`VExpansionPanelTitle`),V=y()({name:`VExpansionPanelTitle`,directives:{vRipple:e},props:B(),setup(n,{slots:r}){let s=I(L);if(!s)throw Error(`[Vuetify] v-expansion-panel-title needs to be placed inside v-expansion-panel`);let{backgroundColorClasses:l,backgroundColorStyles:u}=O(()=>n.color),{dimensionStyles:d}=t(n),f=p(()=>({collapseIcon:n.collapseIcon,disabled:s.disabled.value,expanded:s.isSelected.value,expandIcon:n.expandIcon,readonly:n.readonly})),m=c(()=>s.isSelected.value?n.collapseIcon:n.expandIcon);return M(()=>a(_(`button`,{class:k([`v-expansion-panel-title`,{"v-expansion-panel-title--active":s.isSelected.value,"v-expansion-panel-title--focusable":n.focusable,"v-expansion-panel-title--static":n.static},l.value,n.class]),style:S([u.value,d.value,n.style]),type:`button`,tabindex:s.disabled.value?-1:void 0,disabled:s.disabled.value,"aria-expanded":s.isSelected.value,onClick:n.readonly?void 0:s.toggle},[_(`span`,{class:`v-expansion-panel-title__overlay`},null),r.default?.(f.value),!n.hideActions&&P(i,{defaults:{VIcon:{icon:m.value}}},{default:()=>[_(`span`,{class:`v-expansion-panel-title__icon`},[r.actions?.(f.value)??P(o,null,null)])]})]),[[e,n.ripple]])),{}}}),H=F({title:String,text:String,bgColor:String,...v(),...g(),...N(),...x(),...B(),...R()},`VExpansionPanel`),U=y()({name:`VExpansionPanel`,props:H(),emits:{"group:selected":e=>!0},setup(e,{slots:t}){let r=E(e,L),{backgroundColorClasses:a,backgroundColorStyles:o}=O(()=>e.bgColor),{elevationClasses:s}=w(e),{roundedClasses:l}=m(e),u=c(()=>r?.disabled.value||e.disabled),d=p(()=>r.group.items.value.reduce((e,t,n)=>(r.group.selected.value.includes(t.id)&&e.push(n),e),[])),f=p(()=>{let e=r.group.items.value.findIndex(e=>e.id===r.id);return!r.isSelected.value&&d.value.some(t=>t-e===1)}),h=p(()=>{let e=r.group.items.value.findIndex(e=>e.id===r.id);return!r.isSelected.value&&d.value.some(t=>t-e===-1)});return n(L,r),M(()=>{let n=!!(t.text||e.text),c=!!(t.title||e.title),d=V.filterProps(e),p=z.filterProps(e);return P(e.tag,{class:k([`v-expansion-panel`,{"v-expansion-panel--active":r.isSelected.value,"v-expansion-panel--before-active":f.value,"v-expansion-panel--after-active":h.value,"v-expansion-panel--disabled":u.value},l.value,a.value,e.class]),style:S([o.value,e.style])},{default:()=>[_(`div`,{class:k([`v-expansion-panel__shadow`,...s.value])},null),P(i,{defaults:{VExpansionPanelTitle:{...d},VExpansionPanelText:{...p}}},{default:()=>[c&&P(V,{key:`title`},{default:()=>[t.title?t.title():e.title]}),n&&P(z,{key:`text`},{default:()=>[t.text?t.text():e.text]}),t.default?.()]})]})}),{groupItem:r}}}),W=[`default`,`accordion`,`inset`,`popout`],G=F({flat:Boolean,...j(),...s(H(),[`bgColor`,`collapseIcon`,`color`,`eager`,`elevation`,`expandIcon`,`focusable`,`hideActions`,`readonly`,`ripple`,`static`]),...N(),...h(),...d(),...x(),variant:{type:String,default:`default`,validator:e=>W.includes(e)}},`VExpansionPanels`),K=y()({name:`VExpansionPanels`,props:G(),emits:{"update:modelValue":e=>!0},setup(e,{slots:t}){let{next:n,prev:r}=C(e,L),{themeClasses:i}=A(e),{roundedClasses:a}=m(e),o=c(()=>e.variant&&`v-expansion-panels--variant-${e.variant}`);return l({VExpansionPanel:{bgColor:c(()=>e.bgColor),collapseIcon:c(()=>e.collapseIcon),color:c(()=>e.color),eager:c(()=>e.eager),elevation:c(()=>e.elevation),expandIcon:c(()=>e.expandIcon),focusable:c(()=>e.focusable),hideActions:c(()=>e.hideActions),readonly:c(()=>e.readonly),ripple:c(()=>e.ripple),static:c(()=>e.static)}}),M(()=>P(e.tag,{class:k([`v-expansion-panels`,{"v-expansion-panels--flat":e.flat,"v-expansion-panels--tile":e.tile},i.value,a.value,o.value,e.class]),style:S(e.style)},{default:()=>[t.default?.({prev:r,next:n})]})),{next:n,prev:r}}});export{z as i,U as n,V as r,K as t};
@@ -0,0 +1 @@
import{I as e,J as t,Mr as n,O as r,Q as i,Vr as a,X as o,Xn as s,Xr as c,_n as l,ar as u,bn as d,c as f,dr as p,dt as m,en as h,et as g,fr as _,ft as v,gn as y,ln as b,lt as x,ni as S,nt as C,pt as w,q as T,rt as E,s as D,st as O,ti as k,tn as A,tt as j,un as M,ut as N,vr as P,xn as F,xr as I}from"./index-BDmfR_V6.js";var L=Symbol.for(`vuetify:v-expansion-panel`),R=F({...d(),...D()},`VExpansionPanelText`),z=y()({name:`VExpansionPanelText`,props:R(),setup(e,{slots:t}){let n=I(L);if(!n)throw Error(`[Vuetify] v-expansion-panel-text needs to be placed inside v-expansion-panel`);let{hasContent:i,onAfterLeave:o}=f(e,n.isSelected);return M(()=>P(r,{onAfterLeave:o},{default:()=>[a(_(`div`,{class:k([`v-expansion-panel-text`,e.class]),style:S(e.style)},[t.default&&i.value&&_(`div`,{class:`v-expansion-panel-text__wrapper`},[t.default?.()])]),[[u,n.isSelected.value]])]})),{}}}),B=F({color:String,expandIcon:{type:b,default:`$expand`},collapseIcon:{type:b,default:`$collapse`},hideActions:Boolean,focusable:Boolean,static:Boolean,ripple:{type:[Boolean,Object],default:!1},readonly:Boolean,...d(),...T()},`VExpansionPanelTitle`),V=y()({name:`VExpansionPanelTitle`,directives:{vRipple:e},props:B(),setup(n,{slots:r}){let s=I(L);if(!s)throw Error(`[Vuetify] v-expansion-panel-title needs to be placed inside v-expansion-panel`);let{backgroundColorClasses:l,backgroundColorStyles:u}=O(()=>n.color),{dimensionStyles:d}=t(n),f=p(()=>({collapseIcon:n.collapseIcon,disabled:s.disabled.value,expanded:s.isSelected.value,expandIcon:n.expandIcon,readonly:n.readonly})),m=c(()=>s.isSelected.value?n.collapseIcon:n.expandIcon);return M(()=>a(_(`button`,{class:k([`v-expansion-panel-title`,{"v-expansion-panel-title--active":s.isSelected.value,"v-expansion-panel-title--focusable":n.focusable,"v-expansion-panel-title--static":n.static},l.value,n.class]),style:S([u.value,d.value,n.style]),type:`button`,tabindex:s.disabled.value?-1:void 0,disabled:s.disabled.value,"aria-expanded":s.isSelected.value,onClick:n.readonly?void 0:s.toggle},[_(`span`,{class:`v-expansion-panel-title__overlay`},null),r.default?.(f.value),!n.hideActions&&P(i,{defaults:{VIcon:{icon:m.value}}},{default:()=>[_(`span`,{class:`v-expansion-panel-title__icon`},[r.actions?.(f.value)??P(o,null,null)])]})]),[[e,n.ripple]])),{}}}),H=F({title:String,text:String,bgColor:String,...v(),...g(),...N(),...x(),...B(),...R()},`VExpansionPanel`),U=y()({name:`VExpansionPanel`,props:H(),emits:{"group:selected":e=>!0},setup(e,{slots:t}){let r=E(e,L),{backgroundColorClasses:a,backgroundColorStyles:o}=O(()=>e.bgColor),{elevationClasses:s}=w(e),{roundedClasses:l}=m(e),u=c(()=>r?.disabled.value||e.disabled),d=p(()=>r.group.items.value.reduce((e,t,n)=>(r.group.selected.value.includes(t.id)&&e.push(n),e),[])),f=p(()=>{let e=r.group.items.value.findIndex(e=>e.id===r.id);return!r.isSelected.value&&d.value.some(t=>t-e===1)}),h=p(()=>{let e=r.group.items.value.findIndex(e=>e.id===r.id);return!r.isSelected.value&&d.value.some(t=>t-e===-1)});return n(L,r),M(()=>{let n=!!(t.text||e.text),c=!!(t.title||e.title),d=V.filterProps(e),p=z.filterProps(e);return P(e.tag,{class:k([`v-expansion-panel`,{"v-expansion-panel--active":r.isSelected.value,"v-expansion-panel--before-active":f.value,"v-expansion-panel--after-active":h.value,"v-expansion-panel--disabled":u.value},l.value,a.value,e.class]),style:S([o.value,e.style])},{default:()=>[_(`div`,{class:k([`v-expansion-panel__shadow`,...s.value])},null),P(i,{defaults:{VExpansionPanelTitle:{...d},VExpansionPanelText:{...p}}},{default:()=>[c&&P(V,{key:`title`},{default:()=>[t.title?t.title():e.title]}),n&&P(z,{key:`text`},{default:()=>[t.text?t.text():e.text]}),t.default?.()]})]})}),{groupItem:r}}}),W=[`default`,`accordion`,`inset`,`popout`],G=F({flat:Boolean,...j(),...s(H(),[`bgColor`,`collapseIcon`,`color`,`eager`,`elevation`,`expandIcon`,`focusable`,`hideActions`,`readonly`,`ripple`,`static`]),...N(),...h(),...d(),...x(),variant:{type:String,default:`default`,validator:e=>W.includes(e)}},`VExpansionPanels`),K=y()({name:`VExpansionPanels`,props:G(),emits:{"update:modelValue":e=>!0},setup(e,{slots:t}){let{next:n,prev:r}=C(e,L),{themeClasses:i}=A(e),{roundedClasses:a}=m(e),o=c(()=>e.variant&&`v-expansion-panels--variant-${e.variant}`);return l({VExpansionPanel:{bgColor:c(()=>e.bgColor),collapseIcon:c(()=>e.collapseIcon),color:c(()=>e.color),eager:c(()=>e.eager),elevation:c(()=>e.elevation),expandIcon:c(()=>e.expandIcon),focusable:c(()=>e.focusable),hideActions:c(()=>e.hideActions),readonly:c(()=>e.readonly),ripple:c(()=>e.ripple),static:c(()=>e.static)}}),M(()=>P(e.tag,{class:k([`v-expansion-panels`,{"v-expansion-panels--flat":e.flat,"v-expansion-panels--tile":e.tile},i.value,a.value,o.value,e.class]),style:S(e.style)},{default:()=>[t.default?.({prev:r,next:n})]})),{next:n,prev:r}}});export{z as i,U as n,V as r,K as t};
@@ -0,0 +1 @@
import{I as e,J as t,Mr as n,O as r,Q as i,Vr as a,X as o,Xn as s,Xr as c,_n as l,ar as u,bn as d,c as f,dr as p,dt as m,en as h,et as g,fr as _,ft as v,gn as y,ln as b,lt as x,ni as S,nt as C,pt as w,q as T,rt as E,s as D,st as O,ti as k,tn as A,tt as j,un as M,ut as N,vr as P,xn as F,xr as I}from"./index-BHUpfn3R.js";var L=Symbol.for(`vuetify:v-expansion-panel`),R=F({...d(),...D()},`VExpansionPanelText`),z=y()({name:`VExpansionPanelText`,props:R(),setup(e,{slots:t}){let n=I(L);if(!n)throw Error(`[Vuetify] v-expansion-panel-text needs to be placed inside v-expansion-panel`);let{hasContent:i,onAfterLeave:o}=f(e,n.isSelected);return M(()=>P(r,{onAfterLeave:o},{default:()=>[a(_(`div`,{class:k([`v-expansion-panel-text`,e.class]),style:S(e.style)},[t.default&&i.value&&_(`div`,{class:`v-expansion-panel-text__wrapper`},[t.default?.()])]),[[u,n.isSelected.value]])]})),{}}}),B=F({color:String,expandIcon:{type:b,default:`$expand`},collapseIcon:{type:b,default:`$collapse`},hideActions:Boolean,focusable:Boolean,static:Boolean,ripple:{type:[Boolean,Object],default:!1},readonly:Boolean,...d(),...T()},`VExpansionPanelTitle`),V=y()({name:`VExpansionPanelTitle`,directives:{vRipple:e},props:B(),setup(n,{slots:r}){let s=I(L);if(!s)throw Error(`[Vuetify] v-expansion-panel-title needs to be placed inside v-expansion-panel`);let{backgroundColorClasses:l,backgroundColorStyles:u}=O(()=>n.color),{dimensionStyles:d}=t(n),f=p(()=>({collapseIcon:n.collapseIcon,disabled:s.disabled.value,expanded:s.isSelected.value,expandIcon:n.expandIcon,readonly:n.readonly})),m=c(()=>s.isSelected.value?n.collapseIcon:n.expandIcon);return M(()=>a(_(`button`,{class:k([`v-expansion-panel-title`,{"v-expansion-panel-title--active":s.isSelected.value,"v-expansion-panel-title--focusable":n.focusable,"v-expansion-panel-title--static":n.static},l.value,n.class]),style:S([u.value,d.value,n.style]),type:`button`,tabindex:s.disabled.value?-1:void 0,disabled:s.disabled.value,"aria-expanded":s.isSelected.value,onClick:n.readonly?void 0:s.toggle},[_(`span`,{class:`v-expansion-panel-title__overlay`},null),r.default?.(f.value),!n.hideActions&&P(i,{defaults:{VIcon:{icon:m.value}}},{default:()=>[_(`span`,{class:`v-expansion-panel-title__icon`},[r.actions?.(f.value)??P(o,null,null)])]})]),[[e,n.ripple]])),{}}}),H=F({title:String,text:String,bgColor:String,...v(),...g(),...N(),...x(),...B(),...R()},`VExpansionPanel`),U=y()({name:`VExpansionPanel`,props:H(),emits:{"group:selected":e=>!0},setup(e,{slots:t}){let r=E(e,L),{backgroundColorClasses:a,backgroundColorStyles:o}=O(()=>e.bgColor),{elevationClasses:s}=w(e),{roundedClasses:l}=m(e),u=c(()=>r?.disabled.value||e.disabled),d=p(()=>r.group.items.value.reduce((e,t,n)=>(r.group.selected.value.includes(t.id)&&e.push(n),e),[])),f=p(()=>{let e=r.group.items.value.findIndex(e=>e.id===r.id);return!r.isSelected.value&&d.value.some(t=>t-e===1)}),h=p(()=>{let e=r.group.items.value.findIndex(e=>e.id===r.id);return!r.isSelected.value&&d.value.some(t=>t-e===-1)});return n(L,r),M(()=>{let n=!!(t.text||e.text),c=!!(t.title||e.title),d=V.filterProps(e),p=z.filterProps(e);return P(e.tag,{class:k([`v-expansion-panel`,{"v-expansion-panel--active":r.isSelected.value,"v-expansion-panel--before-active":f.value,"v-expansion-panel--after-active":h.value,"v-expansion-panel--disabled":u.value},l.value,a.value,e.class]),style:S([o.value,e.style])},{default:()=>[_(`div`,{class:k([`v-expansion-panel__shadow`,...s.value])},null),P(i,{defaults:{VExpansionPanelTitle:{...d},VExpansionPanelText:{...p}}},{default:()=>[c&&P(V,{key:`title`},{default:()=>[t.title?t.title():e.title]}),n&&P(z,{key:`text`},{default:()=>[t.text?t.text():e.text]}),t.default?.()]})]})}),{groupItem:r}}}),W=[`default`,`accordion`,`inset`,`popout`],G=F({flat:Boolean,...j(),...s(H(),[`bgColor`,`collapseIcon`,`color`,`eager`,`elevation`,`expandIcon`,`focusable`,`hideActions`,`readonly`,`ripple`,`static`]),...N(),...h(),...d(),...x(),variant:{type:String,default:`default`,validator:e=>W.includes(e)}},`VExpansionPanels`),K=y()({name:`VExpansionPanels`,props:G(),emits:{"update:modelValue":e=>!0},setup(e,{slots:t}){let{next:n,prev:r}=C(e,L),{themeClasses:i}=A(e),{roundedClasses:a}=m(e),o=c(()=>e.variant&&`v-expansion-panels--variant-${e.variant}`);return l({VExpansionPanel:{bgColor:c(()=>e.bgColor),collapseIcon:c(()=>e.collapseIcon),color:c(()=>e.color),eager:c(()=>e.eager),elevation:c(()=>e.elevation),expandIcon:c(()=>e.expandIcon),focusable:c(()=>e.focusable),hideActions:c(()=>e.hideActions),readonly:c(()=>e.readonly),ripple:c(()=>e.ripple),static:c(()=>e.static)}}),M(()=>P(e.tag,{class:k([`v-expansion-panels`,{"v-expansion-panels--flat":e.flat,"v-expansion-panels--tile":e.tile},i.value,a.value,o.value,e.class]),style:S(e.style)},{default:()=>[t.default?.({prev:r,next:n})]})),{next:n,prev:r}}});export{z as i,U as n,V as r,K as t};
+1
View File
@@ -0,0 +1 @@
import{An as e,Kn as t,bn as n,br as r,dr as i,ei as a,gn as o,lt as s,mt as c,nn as l,rr as u,xn as d}from"./index-BHUpfn3R.js";var f=l.reduce((e,t)=>(e[t]={type:[Boolean,String,Number],default:!1},e),{}),p=l.reduce((e,t)=>{let n=`offset`+a(t);return e[n]={type:[String,Number],default:null},e},{}),m={col:t(f),offset:t(p),order:[`order`,`orderSm`,`orderMd`,`orderLg`,`orderXl`,`orderXxl`]};function h(e){if(typeof e==`string`&&e.includes(`/`)){let[t,n]=e.split(`/`);return{cols:Number(t),size:Number(n)}}return{cols:e}}function g(e,t,n){if(n==null||n===!1)return{};let{cols:r,size:i}=h(n),a=t.replace(e,``).toLowerCase();return e===`offset`?{className:`v-col--offset-${a}-${r}`,variables:[{[`--v-col-offset-base-${a}`]:i}]}:e===`order`?{className:`order-${a}-${r}`}:{className:r===``||r===!0?`v-col--${a}`:`v-col--cols-${a}-${r}`,variables:[{[`--v-col-size-base-${a}`]:i}]}}var _=[`auto`,`start`,`end`,`center`,`baseline`,`stretch`],v=e=>_.includes(e),y=d({cols:{type:[Boolean,String,Number],default:!1},...f,offset:{type:[String,Number],default:null},...p,order:{type:[String,Number],default:null},orderSm:{type:[String,Number],default:null},orderMd:{type:[String,Number],default:null},orderLg:{type:[String,Number],default:null},orderXl:{type:[String,Number],default:null},orderXxl:{type:[String,Number],default:null},alignSelf:{type:String,default:null,validator:v},...n(),...s()},`VCol`),b=o()({name:`VCol`,props:y(),setup(e,{slots:t}){let n=i(()=>h(e.cols).size),a=i(()=>h(e.offset).size),o=i(()=>{let t=[`v-col`],n=[],r;for(r in m)m[r].forEach(i=>{let a=e[i],{className:o,variables:s}=g(r,i,a);o&&t.push(o),s&&n.push(...s)});let{cols:i}=h(e.cols),{cols:a}=h(e.offset);return t.push({[`v-col--cols-${i}`]:i,[`v-col--offset-${a}`]:a,[`order-${e.order}`]:e.order,[`align-self-${e.alignSelf}`]:e.alignSelf}),{classes:t,variables:n}});return()=>r(e.tag,{class:[o.value.classes,e.class],style:[{"--v-col-size-base":n.value},{"--v-col-offset-base":a.value},o.value.variables,e.style]},t.default?.())}}),x=[`start`,`end`,`center`],S=[`space-between`,`space-around`,`space-evenly`],C=[...x,`baseline`,`stretch`],w=e=>C.includes(e),T=[...x,...S],E=e=>T.includes(e),D=[...x,...S,`stretch`],O=e=>D.includes(e),k={align:[`align`,`alignSm`,`alignMd`,`alignLg`,`alignXl`,`alignXxl`],justify:[`justify`,`justifySm`,`justifyMd`,`justifyLg`,`justifyXl`,`justifyXxl`],alignContent:[`alignContent`,`alignContentSm`,`alignContentMd`,`alignContentLg`,`alignContentXl`,`alignContentXxl`]},A={align:`align`,justify:`justify`,alignContent:`align-content`};function j(e,t,n){let r=A[e];if(n!=null){if(t){let n=t.replace(e,``);r+=`-${n}`}return r+=`-${n}`,r.toLowerCase()}}var M=d({dense:Boolean,align:{type:String,default:null,validator:w},alignSm:{type:String,default:null,validator:w},alignMd:{type:String,default:null,validator:w},alignLg:{type:String,default:null,validator:w},alignXl:{type:String,default:null,validator:w},alignXxl:{type:String,default:null,validator:w},justify:{type:String,default:null,validator:E},justifySm:{type:String,default:null,validator:E},justifyMd:{type:String,default:null,validator:E},justifyLg:{type:String,default:null,validator:E},justifyXl:{type:String,default:null,validator:E},justifyXxl:{type:String,default:null,validator:E},alignContent:{type:String,default:null,validator:O},alignContentSm:{type:String,default:null,validator:O},alignContentMd:{type:String,default:null,validator:O},alignContentLg:{type:String,default:null,validator:O},alignContentXl:{type:String,default:null,validator:O},alignContentXxl:{type:String,default:null,validator:O},noGutters:Boolean,gap:[Number,String,Array],size:[Number,String],...n(),...c(),...s()},`VRow`),N=o()({name:`VRow`,props:M(),setup(t,{slots:n}){t.dense&&u(`dense`,`density="comfortable"`);let a=i(()=>{let e=[],n;for(n in k)k[n].forEach(r=>{let i=t[r],a=j(n,r,i);a&&e.push(a)});return e.push({"v-row--no-gutters":t.noGutters,"v-row--density-default":t.density===`default`&&!t.noGutters&&!t.dense,"v-row--density-compact":t.density===`compact`,"v-row--density-comfortable":t.density===`comfortable`||t.dense,[`align-${t.align}`]:t.align,[`justify-${t.justify}`]:t.justify,[`align-content-${t.alignContent}`]:t.alignContent}),e}),o=i(()=>Array.isArray(t.gap)?e(t.gap[0]||0):e(t.gap)),s=i(()=>Array.isArray(t.gap)?e(t.gap[1]||0):o.value);return()=>r(t.tag,{class:[`v-row`,a.value,t.class],style:[{"--v-col-gap-x":o.value,"--v-col-gap-y":s.value,"--v-row-columns":t.size},t.style]},n.default?.())}});export{b as n,N as t};
+1
View File
@@ -0,0 +1 @@
import{An as e,Kn as t,bn as n,br as r,dr as i,ei as a,gn as o,lt as s,mt as c,nn as l,rr as u,xn as d}from"./index-DBlT8p9k.js";var f=l.reduce((e,t)=>(e[t]={type:[Boolean,String,Number],default:!1},e),{}),p=l.reduce((e,t)=>{let n=`offset`+a(t);return e[n]={type:[String,Number],default:null},e},{}),m={col:t(f),offset:t(p),order:[`order`,`orderSm`,`orderMd`,`orderLg`,`orderXl`,`orderXxl`]};function h(e){if(typeof e==`string`&&e.includes(`/`)){let[t,n]=e.split(`/`);return{cols:Number(t),size:Number(n)}}return{cols:e}}function g(e,t,n){if(n==null||n===!1)return{};let{cols:r,size:i}=h(n),a=t.replace(e,``).toLowerCase();return e===`offset`?{className:`v-col--offset-${a}-${r}`,variables:[{[`--v-col-offset-base-${a}`]:i}]}:e===`order`?{className:`order-${a}-${r}`}:{className:r===``||r===!0?`v-col--${a}`:`v-col--cols-${a}-${r}`,variables:[{[`--v-col-size-base-${a}`]:i}]}}var _=[`auto`,`start`,`end`,`center`,`baseline`,`stretch`],v=e=>_.includes(e),y=d({cols:{type:[Boolean,String,Number],default:!1},...f,offset:{type:[String,Number],default:null},...p,order:{type:[String,Number],default:null},orderSm:{type:[String,Number],default:null},orderMd:{type:[String,Number],default:null},orderLg:{type:[String,Number],default:null},orderXl:{type:[String,Number],default:null},orderXxl:{type:[String,Number],default:null},alignSelf:{type:String,default:null,validator:v},...n(),...s()},`VCol`),b=o()({name:`VCol`,props:y(),setup(e,{slots:t}){let n=i(()=>h(e.cols).size),a=i(()=>h(e.offset).size),o=i(()=>{let t=[`v-col`],n=[],r;for(r in m)m[r].forEach(i=>{let a=e[i],{className:o,variables:s}=g(r,i,a);o&&t.push(o),s&&n.push(...s)});let{cols:i}=h(e.cols),{cols:a}=h(e.offset);return t.push({[`v-col--cols-${i}`]:i,[`v-col--offset-${a}`]:a,[`order-${e.order}`]:e.order,[`align-self-${e.alignSelf}`]:e.alignSelf}),{classes:t,variables:n}});return()=>r(e.tag,{class:[o.value.classes,e.class],style:[{"--v-col-size-base":n.value},{"--v-col-offset-base":a.value},o.value.variables,e.style]},t.default?.())}}),x=[`start`,`end`,`center`],S=[`space-between`,`space-around`,`space-evenly`],C=[...x,`baseline`,`stretch`],w=e=>C.includes(e),T=[...x,...S],E=e=>T.includes(e),D=[...x,...S,`stretch`],O=e=>D.includes(e),k={align:[`align`,`alignSm`,`alignMd`,`alignLg`,`alignXl`,`alignXxl`],justify:[`justify`,`justifySm`,`justifyMd`,`justifyLg`,`justifyXl`,`justifyXxl`],alignContent:[`alignContent`,`alignContentSm`,`alignContentMd`,`alignContentLg`,`alignContentXl`,`alignContentXxl`]},A={align:`align`,justify:`justify`,alignContent:`align-content`};function j(e,t,n){let r=A[e];if(n!=null){if(t){let n=t.replace(e,``);r+=`-${n}`}return r+=`-${n}`,r.toLowerCase()}}var M=d({dense:Boolean,align:{type:String,default:null,validator:w},alignSm:{type:String,default:null,validator:w},alignMd:{type:String,default:null,validator:w},alignLg:{type:String,default:null,validator:w},alignXl:{type:String,default:null,validator:w},alignXxl:{type:String,default:null,validator:w},justify:{type:String,default:null,validator:E},justifySm:{type:String,default:null,validator:E},justifyMd:{type:String,default:null,validator:E},justifyLg:{type:String,default:null,validator:E},justifyXl:{type:String,default:null,validator:E},justifyXxl:{type:String,default:null,validator:E},alignContent:{type:String,default:null,validator:O},alignContentSm:{type:String,default:null,validator:O},alignContentMd:{type:String,default:null,validator:O},alignContentLg:{type:String,default:null,validator:O},alignContentXl:{type:String,default:null,validator:O},alignContentXxl:{type:String,default:null,validator:O},noGutters:Boolean,gap:[Number,String,Array],size:[Number,String],...n(),...c(),...s()},`VRow`),N=o()({name:`VRow`,props:M(),setup(t,{slots:n}){t.dense&&u(`dense`,`density="comfortable"`);let a=i(()=>{let e=[],n;for(n in k)k[n].forEach(r=>{let i=t[r],a=j(n,r,i);a&&e.push(a)});return e.push({"v-row--no-gutters":t.noGutters,"v-row--density-default":t.density===`default`&&!t.noGutters&&!t.dense,"v-row--density-compact":t.density===`compact`,"v-row--density-comfortable":t.density===`comfortable`||t.dense,[`align-${t.align}`]:t.align,[`justify-${t.justify}`]:t.justify,[`align-content-${t.alignContent}`]:t.alignContent}),e}),o=i(()=>Array.isArray(t.gap)?e(t.gap[0]||0):e(t.gap)),s=i(()=>Array.isArray(t.gap)?e(t.gap[1]||0):o.value);return()=>r(t.tag,{class:[`v-row`,a.value,t.class],style:[{"--v-col-gap-x":o.value,"--v-col-gap-y":s.value,"--v-row-columns":t.size},t.style]},n.default?.())}});export{b as n,N as t};
+1
View File
@@ -0,0 +1 @@
import{An as e,Kn as t,bn as n,br as r,dr as i,ei as a,gn as o,lt as s,mt as c,nn as l,rr as u,xn as d}from"./index-BDmfR_V6.js";var f=l.reduce((e,t)=>(e[t]={type:[Boolean,String,Number],default:!1},e),{}),p=l.reduce((e,t)=>{let n=`offset`+a(t);return e[n]={type:[String,Number],default:null},e},{}),m={col:t(f),offset:t(p),order:[`order`,`orderSm`,`orderMd`,`orderLg`,`orderXl`,`orderXxl`]};function h(e){if(typeof e==`string`&&e.includes(`/`)){let[t,n]=e.split(`/`);return{cols:Number(t),size:Number(n)}}return{cols:e}}function g(e,t,n){if(n==null||n===!1)return{};let{cols:r,size:i}=h(n),a=t.replace(e,``).toLowerCase();return e===`offset`?{className:`v-col--offset-${a}-${r}`,variables:[{[`--v-col-offset-base-${a}`]:i}]}:e===`order`?{className:`order-${a}-${r}`}:{className:r===``||r===!0?`v-col--${a}`:`v-col--cols-${a}-${r}`,variables:[{[`--v-col-size-base-${a}`]:i}]}}var _=[`auto`,`start`,`end`,`center`,`baseline`,`stretch`],v=e=>_.includes(e),y=d({cols:{type:[Boolean,String,Number],default:!1},...f,offset:{type:[String,Number],default:null},...p,order:{type:[String,Number],default:null},orderSm:{type:[String,Number],default:null},orderMd:{type:[String,Number],default:null},orderLg:{type:[String,Number],default:null},orderXl:{type:[String,Number],default:null},orderXxl:{type:[String,Number],default:null},alignSelf:{type:String,default:null,validator:v},...n(),...s()},`VCol`),b=o()({name:`VCol`,props:y(),setup(e,{slots:t}){let n=i(()=>h(e.cols).size),a=i(()=>h(e.offset).size),o=i(()=>{let t=[`v-col`],n=[],r;for(r in m)m[r].forEach(i=>{let a=e[i],{className:o,variables:s}=g(r,i,a);o&&t.push(o),s&&n.push(...s)});let{cols:i}=h(e.cols),{cols:a}=h(e.offset);return t.push({[`v-col--cols-${i}`]:i,[`v-col--offset-${a}`]:a,[`order-${e.order}`]:e.order,[`align-self-${e.alignSelf}`]:e.alignSelf}),{classes:t,variables:n}});return()=>r(e.tag,{class:[o.value.classes,e.class],style:[{"--v-col-size-base":n.value},{"--v-col-offset-base":a.value},o.value.variables,e.style]},t.default?.())}}),x=[`start`,`end`,`center`],S=[`space-between`,`space-around`,`space-evenly`],C=[...x,`baseline`,`stretch`],w=e=>C.includes(e),T=[...x,...S],E=e=>T.includes(e),D=[...x,...S,`stretch`],O=e=>D.includes(e),k={align:[`align`,`alignSm`,`alignMd`,`alignLg`,`alignXl`,`alignXxl`],justify:[`justify`,`justifySm`,`justifyMd`,`justifyLg`,`justifyXl`,`justifyXxl`],alignContent:[`alignContent`,`alignContentSm`,`alignContentMd`,`alignContentLg`,`alignContentXl`,`alignContentXxl`]},A={align:`align`,justify:`justify`,alignContent:`align-content`};function j(e,t,n){let r=A[e];if(n!=null){if(t){let n=t.replace(e,``);r+=`-${n}`}return r+=`-${n}`,r.toLowerCase()}}var M=d({dense:Boolean,align:{type:String,default:null,validator:w},alignSm:{type:String,default:null,validator:w},alignMd:{type:String,default:null,validator:w},alignLg:{type:String,default:null,validator:w},alignXl:{type:String,default:null,validator:w},alignXxl:{type:String,default:null,validator:w},justify:{type:String,default:null,validator:E},justifySm:{type:String,default:null,validator:E},justifyMd:{type:String,default:null,validator:E},justifyLg:{type:String,default:null,validator:E},justifyXl:{type:String,default:null,validator:E},justifyXxl:{type:String,default:null,validator:E},alignContent:{type:String,default:null,validator:O},alignContentSm:{type:String,default:null,validator:O},alignContentMd:{type:String,default:null,validator:O},alignContentLg:{type:String,default:null,validator:O},alignContentXl:{type:String,default:null,validator:O},alignContentXxl:{type:String,default:null,validator:O},noGutters:Boolean,gap:[Number,String,Array],size:[Number,String],...n(),...c(),...s()},`VRow`),N=o()({name:`VRow`,props:M(),setup(t,{slots:n}){t.dense&&u(`dense`,`density="comfortable"`);let a=i(()=>{let e=[],n;for(n in k)k[n].forEach(r=>{let i=t[r],a=j(n,r,i);a&&e.push(a)});return e.push({"v-row--no-gutters":t.noGutters,"v-row--density-default":t.density===`default`&&!t.noGutters&&!t.dense,"v-row--density-compact":t.density===`compact`,"v-row--density-comfortable":t.density===`comfortable`||t.dense,[`align-${t.align}`]:t.align,[`justify-${t.justify}`]:t.justify,[`align-content-${t.alignContent}`]:t.alignContent}),e}),o=i(()=>Array.isArray(t.gap)?e(t.gap[0]||0):e(t.gap)),s=i(()=>Array.isArray(t.gap)?e(t.gap[1]||0):o.value);return()=>r(t.tag,{class:[`v-row`,a.value,t.class],style:[{"--v-col-gap-x":o.value,"--v-col-gap-y":s.value,"--v-row-columns":t.size},t.style]},n.default?.())}});export{b as n,N as t};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import{m as e,p as t}from"./VSelect-DTpWglKn.js";import{A as n,Cr as r,Fn as i,Ir as a,Q as o,U as s,V as c,X as l,Xr as u,Y as d,cr as f,er as p,fr as m,gn as h,ni as g,qr as _,r as v,sn as y,ti as b,un as x,vr as S,xn as C}from"./index-BHUpfn3R.js";import{l as w,m as T,u as E}from"./VTextField-Dl1UyBCb.js";var D=C({indeterminate:Boolean,inset:Boolean,flat:Boolean,loading:{type:[Boolean,String],default:!1},...E(),...e()},`VSwitch`),O=h()({name:`VSwitch`,inheritAttrs:!1,props:D(),emits:{"update:focused":e=>!0,"update:modelValue":e=>!0,"update:indeterminate":e=>!0},setup(e,{attrs:h,slots:C}){let E=y(e,`indeterminate`),D=y(e,`modelValue`),{loaderClasses:O}=s(e),{isFocused:k,focus:A,blur:j}=T(e),M=_(),N=_(),P=p&&window.matchMedia(`(forced-colors: active)`).matches,F=u(()=>typeof e.loading==`string`&&e.loading!==``?e.loading:e.color),I=a(),L=u(()=>e.id||`switch-${I}`);function R(){E.value&&=!1}function z(e){e.stopPropagation(),e.preventDefault(),M.value?.input?.click()}return x(()=>{let[a,s]=i(h),u=w.filterProps(e),p=t.filterProps(e);return S(w,r({ref:N,class:[`v-switch`,{"v-switch--flat":e.flat},{"v-switch--inset":e.inset},{"v-switch--indeterminate":E.value},O.value,e.class]},a,u,{modelValue:D.value,"onUpdate:modelValue":e=>D.value=e,id:L.value,focused:k.value,style:e.style}),{...C,default:({id:i,messagesId:a,isDisabled:u,isReadonly:h,isValid:_})=>{let v={model:D,isValid:_};return S(t,r({ref:M},p,{modelValue:D.value,"onUpdate:modelValue":[e=>D.value=e,R],id:i.value,"aria-describedby":a.value,type:`checkbox`,"aria-checked":E.value?`mixed`:void 0,disabled:u.value,readonly:h.value,onFocus:A,onBlur:j},s),{...C,default:({backgroundColorClasses:e,backgroundColorStyles:t})=>m(`div`,{class:b([`v-switch__track`,P?void 0:e.value]),style:g(t.value),onClick:z},[C[`track-true`]&&m(`div`,{key:`prepend`,class:`v-switch__track-true`},[C[`track-true`](v)]),C[`track-false`]&&m(`div`,{key:`append`,class:`v-switch__track-false`},[C[`track-false`](v)])]),input:({inputNode:t,icon:r,backgroundColorClasses:i,backgroundColorStyles:a})=>m(f,null,[t,m(`div`,{class:b([`v-switch__thumb`,{"v-switch__thumb--filled":r||e.loading},e.inset||P?void 0:i.value]),style:g(e.inset?void 0:a.value)},[C.thumb?S(o,{defaults:{VIcon:{icon:r,size:`x-small`}}},{default:()=>[C.thumb({...v,icon:r})]}):S(n,null,{default:()=>[e.loading?S(c,{name:`v-switch`,active:!0,color:_.value===!1?void 0:F.value},{default:e=>C.loader?C.loader(e):S(d,{active:e.isActive,color:e.color,indeterminate:!0,size:`16`,width:`2`},null)}):r&&S(l,{key:String(r),icon:r,size:`x-small`},null)]})])])})}})}),v({},N)}});export{O as t};
+1
View File
@@ -0,0 +1 @@
import{m as e,p as t}from"./VSelect-Cx2P_6TS.js";import{A as n,Cr as r,Fn as i,Ir as a,Q as o,U as s,V as c,X as l,Xr as u,Y as d,cr as f,er as p,fr as m,gn as h,ni as g,qr as _,r as v,sn as y,ti as b,un as x,vr as S,xn as C}from"./index-DBlT8p9k.js";import{l as w,m as T,u as E}from"./VTextField-BK-1eNm9.js";var D=C({indeterminate:Boolean,inset:Boolean,flat:Boolean,loading:{type:[Boolean,String],default:!1},...E(),...e()},`VSwitch`),O=h()({name:`VSwitch`,inheritAttrs:!1,props:D(),emits:{"update:focused":e=>!0,"update:modelValue":e=>!0,"update:indeterminate":e=>!0},setup(e,{attrs:h,slots:C}){let E=y(e,`indeterminate`),D=y(e,`modelValue`),{loaderClasses:O}=s(e),{isFocused:k,focus:A,blur:j}=T(e),M=_(),N=_(),P=p&&window.matchMedia(`(forced-colors: active)`).matches,F=u(()=>typeof e.loading==`string`&&e.loading!==``?e.loading:e.color),I=a(),L=u(()=>e.id||`switch-${I}`);function R(){E.value&&=!1}function z(e){e.stopPropagation(),e.preventDefault(),M.value?.input?.click()}return x(()=>{let[a,s]=i(h),u=w.filterProps(e),p=t.filterProps(e);return S(w,r({ref:N,class:[`v-switch`,{"v-switch--flat":e.flat},{"v-switch--inset":e.inset},{"v-switch--indeterminate":E.value},O.value,e.class]},a,u,{modelValue:D.value,"onUpdate:modelValue":e=>D.value=e,id:L.value,focused:k.value,style:e.style}),{...C,default:({id:i,messagesId:a,isDisabled:u,isReadonly:h,isValid:_})=>{let v={model:D,isValid:_};return S(t,r({ref:M},p,{modelValue:D.value,"onUpdate:modelValue":[e=>D.value=e,R],id:i.value,"aria-describedby":a.value,type:`checkbox`,"aria-checked":E.value?`mixed`:void 0,disabled:u.value,readonly:h.value,onFocus:A,onBlur:j},s),{...C,default:({backgroundColorClasses:e,backgroundColorStyles:t})=>m(`div`,{class:b([`v-switch__track`,P?void 0:e.value]),style:g(t.value),onClick:z},[C[`track-true`]&&m(`div`,{key:`prepend`,class:`v-switch__track-true`},[C[`track-true`](v)]),C[`track-false`]&&m(`div`,{key:`append`,class:`v-switch__track-false`},[C[`track-false`](v)])]),input:({inputNode:t,icon:r,backgroundColorClasses:i,backgroundColorStyles:a})=>m(f,null,[t,m(`div`,{class:b([`v-switch__thumb`,{"v-switch__thumb--filled":r||e.loading},e.inset||P?void 0:i.value]),style:g(e.inset?void 0:a.value)},[C.thumb?S(o,{defaults:{VIcon:{icon:r,size:`x-small`}}},{default:()=>[C.thumb({...v,icon:r})]}):S(n,null,{default:()=>[e.loading?S(c,{name:`v-switch`,active:!0,color:_.value===!1?void 0:F.value},{default:e=>C.loader?C.loader(e):S(d,{active:e.isActive,color:e.color,indeterminate:!0,size:`16`,width:`2`},null)}):r&&S(l,{key:String(r),icon:r,size:`x-small`},null)]})])])})}})}),v({},N)}});export{O as t};
+1
View File
@@ -0,0 +1 @@
import{m as e,p as t}from"./VSelect-DCVEXXlg.js";import{A as n,Cr as r,Fn as i,Ir as a,Q as o,U as s,V as c,X as l,Xr as u,Y as d,cr as f,er as p,fr as m,gn as h,ni as g,qr as _,r as v,sn as y,ti as b,un as x,vr as S,xn as C}from"./index-BDmfR_V6.js";import{l as w,m as T,u as E}from"./VTextField-20zRHFVo.js";var D=C({indeterminate:Boolean,inset:Boolean,flat:Boolean,loading:{type:[Boolean,String],default:!1},...E(),...e()},`VSwitch`),O=h()({name:`VSwitch`,inheritAttrs:!1,props:D(),emits:{"update:focused":e=>!0,"update:modelValue":e=>!0,"update:indeterminate":e=>!0},setup(e,{attrs:h,slots:C}){let E=y(e,`indeterminate`),D=y(e,`modelValue`),{loaderClasses:O}=s(e),{isFocused:k,focus:A,blur:j}=T(e),M=_(),N=_(),P=p&&window.matchMedia(`(forced-colors: active)`).matches,F=u(()=>typeof e.loading==`string`&&e.loading!==``?e.loading:e.color),I=a(),L=u(()=>e.id||`switch-${I}`);function R(){E.value&&=!1}function z(e){e.stopPropagation(),e.preventDefault(),M.value?.input?.click()}return x(()=>{let[a,s]=i(h),u=w.filterProps(e),p=t.filterProps(e);return S(w,r({ref:N,class:[`v-switch`,{"v-switch--flat":e.flat},{"v-switch--inset":e.inset},{"v-switch--indeterminate":E.value},O.value,e.class]},a,u,{modelValue:D.value,"onUpdate:modelValue":e=>D.value=e,id:L.value,focused:k.value,style:e.style}),{...C,default:({id:i,messagesId:a,isDisabled:u,isReadonly:h,isValid:_})=>{let v={model:D,isValid:_};return S(t,r({ref:M},p,{modelValue:D.value,"onUpdate:modelValue":[e=>D.value=e,R],id:i.value,"aria-describedby":a.value,type:`checkbox`,"aria-checked":E.value?`mixed`:void 0,disabled:u.value,readonly:h.value,onFocus:A,onBlur:j},s),{...C,default:({backgroundColorClasses:e,backgroundColorStyles:t})=>m(`div`,{class:b([`v-switch__track`,P?void 0:e.value]),style:g(t.value),onClick:z},[C[`track-true`]&&m(`div`,{key:`prepend`,class:`v-switch__track-true`},[C[`track-true`](v)]),C[`track-false`]&&m(`div`,{key:`append`,class:`v-switch__track-false`},[C[`track-false`](v)])]),input:({inputNode:t,icon:r,backgroundColorClasses:i,backgroundColorStyles:a})=>m(f,null,[t,m(`div`,{class:b([`v-switch__thumb`,{"v-switch__thumb--filled":r||e.loading},e.inset||P?void 0:i.value]),style:g(e.inset?void 0:a.value)},[C.thumb?S(o,{defaults:{VIcon:{icon:r,size:`x-small`}}},{default:()=>[C.thumb({...v,icon:r})]}):S(n,null,{default:()=>[e.loading?S(c,{name:`v-switch`,active:!0,color:_.value===!1?void 0:F.value},{default:e=>C.loader?C.loader(e):S(d,{active:e.isActive,color:e.color,indeterminate:!0,size:`16`,width:`2`},null)}):r&&S(l,{key:String(r),icon:r,size:`x-small`},null)]})])])})}})}),v({},N)}});export{O as t};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import{Gt as e}from"./index-BDmfR_V6.js";function t(t,n){let r=n;if(t instanceof e){let e=t.detail??t.message;r=typeof e==`string`?e:Array.isArray(e)?e.map(e=>{let t=e?.msg||JSON.stringify(e),n=Array.isArray(e.loc)?e.loc.filter(e=>e!==`body`).join(`.`):``;return n?`${n}: ${t}`:t}).join(`; `):e&&typeof e==`object`?JSON.stringify(e):t.message||n}else t instanceof Error&&(r=t.message||n);return r=r.trim(),r||n}export{t};
+1
View File
@@ -0,0 +1 @@
import{Gt as e}from"./index-BHUpfn3R.js";function t(t,n){let r=n;if(t instanceof e){let e=t.detail??t.message;r=typeof e==`string`?e:Array.isArray(e)?e.map(e=>{let t=e?.msg||JSON.stringify(e),n=Array.isArray(e.loc)?e.loc.filter(e=>e!==`body`).join(`.`):``;return n?`${n}: ${t}`:t}).join(`; `):e&&typeof e==`object`?JSON.stringify(e):t.message||n}else t instanceof Error&&(r=t.message||n);return r=r.trim(),r||n}export{t};
+1
View File
@@ -0,0 +1 @@
import{Gt as e}from"./index-DBlT8p9k.js";function t(t,n){let r=n;if(t instanceof e){let e=t.detail??t.message;r=typeof e==`string`?e:Array.isArray(e)?e.map(e=>{let t=e?.msg||JSON.stringify(e),n=Array.isArray(e.loc)?e.loc.filter(e=>e!==`body`).join(`.`):``;return n?`${n}: ${t}`:t}).join(`; `):e&&typeof e==`object`?JSON.stringify(e):t.message||n}else t instanceof Error&&(r=t.message||n);return r=r.trim(),r||n}export{t};

Some files were not shown because too many files have changed in this diff Show More