mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-11-09 13:35:12 +09:00
fix(frontend): move non-component exports out of component files
Clears the new react-refresh/only-export-components warnings so the frontend dependency group bump passes lint.
This commit is contained in:
1 parent
7f77b1c239
commit
53639f7eae
6 files changed
+31
-39
No files matched your search
@@ -332,6 +332,4 @@ export function PageSkeleton({ variant = 'panel', rows, className = '' }) {
|
||||
);
|
||||
}
|
||||
|
||||
export const PAGE_SKELETON_VARIANTS = Object.keys(VARIANTS);
|
||||
|
||||
export default PageSkeleton;
|
||||
@@ -15,7 +15,8 @@ import {
|
||||
// Single source of truth for shortcut targets: what a user can pick here is
|
||||
// exactly what the renderer can draw. WidgetBody is what the board itself
|
||||
// draws with, so the preview cannot drift from the real thing.
|
||||
import { QUICK_ACTION_OPTIONS, WidgetBody } from '../widgets/renderers';
|
||||
import { WidgetBody } from '../widgets/renderers';
|
||||
import { QUICK_ACTION_OPTIONS } from '../widgets/quickActions';
|
||||
import { deriveWidgetTitle } from '../widgets/registry';
|
||||
import { GRID_COLS, GRID_GAP, GRID_ROW } from './layout';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import { Archive, Boxes, Container, Database, FolderOpen, Globe, ListChecks, Activity, Rocket, Server, ShieldCheck, Terminal } from 'lucide-react';
|
||||
|
||||
// Every destination is a real route registered in App.jsx.
|
||||
export const ACTIONS = {
|
||||
servers: ['Manage servers', Server, '/servers'],
|
||||
services: ['Services', Boxes, '/services'],
|
||||
docker: ['Docker containers', Container, '/docker'],
|
||||
terminal: ['Open terminal', Terminal, '/terminal'],
|
||||
deploys: ['Deploy activity', Rocket, '/deployments'],
|
||||
databases: ['Databases', Database, '/databases'],
|
||||
backups: ['Backups', Archive, '/backups'],
|
||||
monitoring: ['Monitoring', Activity, '/monitoring'],
|
||||
domains: ['Domains', Globe, '/domains'],
|
||||
files: ['File manager', FolderOpen, '/files'],
|
||||
security: ['Security', ShieldCheck, '/security'],
|
||||
jobs: ['Jobs', ListChecks, '/monitoring/jobs'],
|
||||
};
|
||||
|
||||
export const QUICK_ACTION_KEYS = Object.keys(ACTIONS);
|
||||
|
||||
// [key, label] pairs for the inspector's shortcut picker. Derived from ACTIONS
|
||||
// so the list of shortcuts a user can *choose* can never drift from the list
|
||||
// this widget can actually *render* — they did drift once already.
|
||||
export const QUICK_ACTION_OPTIONS = Object.entries(ACTIONS).map(([key, [label]]) => [key, label]);
|
||||
@@ -11,23 +11,12 @@ import { formatRelativeTime } from '@/utils/time';
|
||||
*/
|
||||
import { Component, useEffect, useId, useMemo, useRef, useState } from 'react';
|
||||
import {
|
||||
Activity,
|
||||
Archive,
|
||||
ArrowDown,
|
||||
ArrowUp,
|
||||
Boxes,
|
||||
Container,
|
||||
Database,
|
||||
FolderOpen,
|
||||
Globe,
|
||||
ListChecks,
|
||||
Rocket,
|
||||
Server,
|
||||
ShieldCheck,
|
||||
Terminal,
|
||||
} from 'lucide-react';
|
||||
import { Gauge, Pill, serviceStatusKind, statusKind, alertStatusKind } from '@/components/ds';
|
||||
import { getWidgetType } from './registry';
|
||||
import { ACTIONS } from './quickActions';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { t } from '../../../i18n/t';
|
||||
import { formatTime } from '@/utils/intl';
|
||||
@@ -753,29 +742,6 @@ function WFeed({ cfg, ctx }) {
|
||||
|
||||
/* ----------------------------------------------------------------- actions */
|
||||
|
||||
// Every destination is a real route registered in App.jsx.
|
||||
const ACTIONS = {
|
||||
servers: ['Manage servers', Server, '/servers'],
|
||||
services: ['Services', Boxes, '/services'],
|
||||
docker: ['Docker containers', Container, '/docker'],
|
||||
terminal: ['Open terminal', Terminal, '/terminal'],
|
||||
deploys: ['Deploy activity', Rocket, '/deployments'],
|
||||
databases: ['Databases', Database, '/databases'],
|
||||
backups: ['Backups', Archive, '/backups'],
|
||||
monitoring: ['Monitoring', Activity, '/monitoring'],
|
||||
domains: ['Domains', Globe, '/domains'],
|
||||
files: ['File manager', FolderOpen, '/files'],
|
||||
security: ['Security', ShieldCheck, '/security'],
|
||||
jobs: ['Jobs', ListChecks, '/monitoring/jobs'],
|
||||
};
|
||||
|
||||
export const QUICK_ACTION_KEYS = Object.keys(ACTIONS);
|
||||
|
||||
// [key, label] pairs for the inspector's shortcut picker. Derived from ACTIONS
|
||||
// so the list of shortcuts a user can *choose* can never drift from the list
|
||||
// this widget can actually *render* — they did drift once already.
|
||||
export const QUICK_ACTION_OPTIONS = Object.entries(ACTIONS).map(([key, [label]]) => [key, label]);
|
||||
|
||||
function WActions({ cfg, ctx }) {
|
||||
const { t } = useTranslation();
|
||||
const items = (Array.isArray(cfg.items) ? cfg.items : []).filter((key) => ACTIONS[key]);
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
// Keep in sync with VARIANTS in PageSkeleton.jsx.
|
||||
export const PAGE_SKELETON_VARIANTS = ['panel', 'table', 'feed', 'cards', 'detail', 'console', 'form', 'chart', 'tree', 'split'];
|
||||
@@ -20,7 +20,8 @@ import Modal from '../components/Modal';
|
||||
import { ConfirmDialog } from '../components/ConfirmDialog';
|
||||
import StatusBadge from '../components/StatusBadge';
|
||||
import EmptyState from '../components/EmptyState';
|
||||
import { PageSkeleton, PAGE_SKELETON_VARIANTS } from '../components/PageSkeleton';
|
||||
import { PageSkeleton } from '../components/PageSkeleton';
|
||||
import { PAGE_SKELETON_VARIANTS } from '../components/pageSkeletonVariants';
|
||||
import { Spinner } from '../components/Spinner';
|
||||
import { StatCard, StatsGrid } from '../components/StatCard';
|
||||
import { DangerZone } from '../components/DangerZone';
|
||||
|
||||
Reference in new issue
Block a user