feat: add slug-only dashboard profile filter and unify backend imports
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
@UX_REATIVITY: State: $state, Derived: $derived.
|
||||
-->
|
||||
<script>
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
/** @type {{
|
||||
* pass_count: number,
|
||||
* warn_count: number,
|
||||
@@ -39,35 +41,35 @@
|
||||
</div>
|
||||
{:else if error}
|
||||
<div class="p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg text-red-700 dark:text-red-400">
|
||||
<p class="font-medium">Failed to load health summary</p>
|
||||
<p class="font-medium">{$t.health?.load_failed}</p>
|
||||
<p class="text-sm">{error}</p>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||
<div class="p-4 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg text-center">
|
||||
<div class="text-2xl font-bold text-green-700 dark:text-green-400">🟢 {pass_count}</div>
|
||||
<div class="text-xs text-green-600 dark:text-green-500 uppercase tracking-wider font-semibold">Pass</div>
|
||||
<div class="text-xs text-green-600 dark:text-green-500 uppercase tracking-wider font-semibold">{$t.health?.status_pass}</div>
|
||||
</div>
|
||||
|
||||
<div class="p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg text-center">
|
||||
<div class="text-2xl font-bold text-yellow-700 dark:text-yellow-400">🟡 {warn_count}</div>
|
||||
<div class="text-xs text-yellow-600 dark:text-yellow-500 uppercase tracking-wider font-semibold">Warn</div>
|
||||
<div class="text-xs text-yellow-600 dark:text-yellow-500 uppercase tracking-wider font-semibold">{$t.health?.status_warn}</div>
|
||||
</div>
|
||||
|
||||
<div class="p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg text-center">
|
||||
<div class="text-2xl font-bold text-red-700 dark:text-red-400">🔴 {fail_count}</div>
|
||||
<div class="text-xs text-red-600 dark:text-red-500 uppercase tracking-wider font-semibold">Fail</div>
|
||||
<div class="text-xs text-red-600 dark:text-red-500 uppercase tracking-wider font-semibold">{$t.health?.status_fail}</div>
|
||||
</div>
|
||||
|
||||
<div class="p-4 bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg text-center">
|
||||
<div class="text-2xl font-bold text-gray-700 dark:text-gray-300">⚪ {unknown_count}</div>
|
||||
<div class="text-xs text-gray-600 dark:text-gray-500 uppercase tracking-wider font-semibold">Unknown</div>
|
||||
<div class="text-xs text-gray-600 dark:text-gray-500 uppercase tracking-wider font-semibold">{$t.health?.status_unknown}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if total === 0}
|
||||
<div class="mt-4 p-8 text-center border-2 border-dashed border-gray-200 dark:border-gray-700 rounded-xl text-gray-500 dark:text-gray-400">
|
||||
No validation records found for this environment.
|
||||
{$t.health?.no_records_for_environment}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -76,4 +78,4 @@
|
||||
<style>
|
||||
/* Tailwind handles most styling, custom tweaks here if needed */
|
||||
</style>
|
||||
<!-- [/DEF:HealthMatrix:Component] -->
|
||||
<!-- [/DEF:HealthMatrix:Component] -->
|
||||
|
||||
@@ -65,6 +65,22 @@
|
||||
let failingDashboardCount = $derived(failingCountState.current || 0);
|
||||
let expandedCategories = $state(new Set(["dashboards"]));
|
||||
|
||||
function withExpandedCategory(categoryId) {
|
||||
const next = new Set(expandedCategories);
|
||||
next.add(categoryId);
|
||||
expandedCategories = next;
|
||||
}
|
||||
|
||||
function toggleExpandedCategory(categoryId) {
|
||||
const next = new Set(expandedCategories);
|
||||
if (next.has(categoryId)) {
|
||||
next.delete(categoryId);
|
||||
} else {
|
||||
next.add(categoryId);
|
||||
}
|
||||
expandedCategories = next;
|
||||
}
|
||||
|
||||
// Keep active category valid after RBAC filtering.
|
||||
$effect(() => {
|
||||
if (
|
||||
@@ -81,8 +97,7 @@
|
||||
// Keep active category expanded after route/user change.
|
||||
$effect(() => {
|
||||
if (activeCategory && !expandedCategories.has(activeCategory)) {
|
||||
expandedCategories.add(activeCategory);
|
||||
expandedCategories = expandedCategories;
|
||||
withExpandedCategory(activeCategory);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -118,18 +133,12 @@
|
||||
`[Sidebar][Action] Expand sidebar and category ${categoryId}`,
|
||||
);
|
||||
toggleSidebar();
|
||||
expandedCategories.add(categoryId);
|
||||
expandedCategories = expandedCategories;
|
||||
withExpandedCategory(categoryId);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`[Sidebar][Action] Toggle category ${categoryId}`);
|
||||
if (expandedCategories.has(categoryId)) {
|
||||
expandedCategories.delete(categoryId);
|
||||
} else {
|
||||
expandedCategories.add(categoryId);
|
||||
}
|
||||
expandedCategories = expandedCategories;
|
||||
toggleExpandedCategory(categoryId);
|
||||
}
|
||||
|
||||
function handleSubItemClick(categoryId, path) {
|
||||
|
||||
@@ -73,6 +73,26 @@
|
||||
"admin_llm": "LLM Providers",
|
||||
"profile": "Profile"
|
||||
},
|
||||
"health": {
|
||||
"title": "Dashboard Health Center",
|
||||
"subtitle": "Monitor the latest validation status across your environments.",
|
||||
"environment_label": "Environment:",
|
||||
"all_environments": "All Environments",
|
||||
"validation_details": "Validation Details",
|
||||
"table_dashboard": "Dashboard",
|
||||
"table_environment": "Environment",
|
||||
"table_status": "Status",
|
||||
"table_last_check": "Last Check",
|
||||
"table_summary": "Summary",
|
||||
"no_records": "No validation records found.",
|
||||
"no_records_for_environment": "No validation records found for this environment.",
|
||||
"view_report": "View Report",
|
||||
"load_failed": "Failed to load health summary",
|
||||
"status_pass": "Pass",
|
||||
"status_warn": "Warn",
|
||||
"status_fail": "Fail",
|
||||
"status_unknown": "Unknown"
|
||||
},
|
||||
"llm": {
|
||||
"providers_title": "LLM Providers",
|
||||
"add_provider": "Add Provider",
|
||||
@@ -428,6 +448,7 @@
|
||||
"superset_account": "Your Apache Superset Account",
|
||||
"superset_account_placeholder": "Enter your Apache Superset username",
|
||||
"show_only_my_dashboards": "Show only my dashboards by default",
|
||||
"show_only_slug_dashboards": "Show only dashboards with slug by default",
|
||||
"save_preferences": "Save Preferences",
|
||||
"lookup_loading": "Loading Superset accounts...",
|
||||
"lookup_error": "Cannot load Superset accounts for this environment right now. You can enter username manually.",
|
||||
@@ -456,9 +477,9 @@
|
||||
"table_density_compact": "Compact",
|
||||
"table_density_comfortable": "Comfortable",
|
||||
"auto_open_task_drawer": "Automatically open task drawer for long-running tasks",
|
||||
"filter_badge_active": "My Dashboards Only",
|
||||
"filter_badge_active": "Profile filters active",
|
||||
"filter_badge_override": "Showing all dashboards temporarily",
|
||||
"filter_empty_state": "No dashboards found for your account. Try adjusting your filter settings.",
|
||||
"filter_empty_state": "No dashboards found for active profile filters. Try adjusting your filter settings.",
|
||||
"filter_show_all_temporarily": "Show all dashboards temporarily",
|
||||
"filter_restore_default": "Restore default filter",
|
||||
"saving": "Saving...",
|
||||
|
||||
@@ -73,6 +73,26 @@
|
||||
"admin_llm": "Провайдеры LLM",
|
||||
"profile": "Профиль"
|
||||
},
|
||||
"health": {
|
||||
"title": "Центр здоровья дашбордов",
|
||||
"subtitle": "Отслеживайте последние результаты валидации по всем окружениям.",
|
||||
"environment_label": "Окружение:",
|
||||
"all_environments": "Все окружения",
|
||||
"validation_details": "Детали валидации",
|
||||
"table_dashboard": "Дашборд",
|
||||
"table_environment": "Окружение",
|
||||
"table_status": "Статус",
|
||||
"table_last_check": "Последняя проверка",
|
||||
"table_summary": "Сводка",
|
||||
"no_records": "Записи валидации не найдены.",
|
||||
"no_records_for_environment": "Для этого окружения записи валидации не найдены.",
|
||||
"view_report": "Открыть отчет",
|
||||
"load_failed": "Не удалось загрузить сводку здоровья",
|
||||
"status_pass": "Успех",
|
||||
"status_warn": "Предупреждение",
|
||||
"status_fail": "Ошибка",
|
||||
"status_unknown": "Неизвестно"
|
||||
},
|
||||
"llm": {
|
||||
"providers_title": "Провайдеры LLM",
|
||||
"add_provider": "Добавить провайдера",
|
||||
@@ -426,6 +446,7 @@
|
||||
"superset_account": "Ваш аккаунт Apache Superset",
|
||||
"superset_account_placeholder": "Введите имя пользователя Apache Superset",
|
||||
"show_only_my_dashboards": "Показывать только мои дашборды по умолчанию",
|
||||
"show_only_slug_dashboards": "Показывать только дашборды со slug по умолчанию",
|
||||
"save_preferences": "Сохранить настройки",
|
||||
"lookup_loading": "Загрузка аккаунтов Superset...",
|
||||
"lookup_error": "Сейчас не удается загрузить аккаунты Superset для этого окружения. Вы можете ввести имя пользователя вручную.",
|
||||
@@ -454,9 +475,9 @@
|
||||
"table_density_compact": "Компактная",
|
||||
"table_density_comfortable": "Комфортная",
|
||||
"auto_open_task_drawer": "Автоматически открывать Task Drawer для долгих задач",
|
||||
"filter_badge_active": "Только мои дашборды",
|
||||
"filter_badge_active": "Активны фильтры профиля",
|
||||
"filter_badge_override": "Временно показаны все дашборды",
|
||||
"filter_empty_state": "Для вашего аккаунта дашборды не найдены. Попробуйте изменить настройки фильтра.",
|
||||
"filter_empty_state": "По активным фильтрам профиля дашборды не найдены. Попробуйте изменить настройки фильтра.",
|
||||
"filter_show_all_temporarily": "Временно показать все дашборды",
|
||||
"filter_restore_default": "Вернуть фильтр по умолчанию",
|
||||
"saving": "Сохранение...",
|
||||
|
||||
Reference in New Issue
Block a user