Skip to content

Commit 91d5625

Browse files
committed
Fix lint issues
1 parent 4cbbc1c commit 91d5625

14 files changed

Lines changed: 97 additions & 155 deletions

File tree

‎webui/src/app/globals.css‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@
4646
--lin-warning: #f2c94c;
4747

4848
--lin-shadow-card: 0 1px 2px 0 rgba(15, 17, 22, 0.04);
49-
--lin-shadow-popover:
50-
0 4px 12px -2px rgba(15, 17, 22, 0.08), 0 0 0 1px rgba(15, 17, 22, 0.06);
51-
--lin-shadow-overlay:
52-
0 8px 32px -8px rgba(15, 17, 22, 0.16), 0 0 0 1px rgba(15, 17, 22, 0.08);
49+
--lin-shadow-popover: 0 4px 12px -2px rgba(15, 17, 22, 0.08), 0 0 0 1px rgba(15, 17, 22, 0.06);
50+
--lin-shadow-overlay: 0 8px 32px -8px rgba(15, 17, 22, 0.16), 0 0 0 1px rgba(15, 17, 22, 0.08);
5351

5452
--lin-topbar-height: 56px;
5553
--lin-sidebar-width: 260px;
@@ -78,10 +76,8 @@
7876
--lin-accent-muted: rgba(112, 121, 224, 0.18);
7977

8078
--lin-shadow-card: 0 1px 2px 0 rgba(0, 0, 0, 0.35);
81-
--lin-shadow-popover:
82-
0 4px 12px -2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
83-
--lin-shadow-overlay:
84-
0 8px 32px -8px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
79+
--lin-shadow-popover: 0 4px 12px -2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
80+
--lin-shadow-overlay: 0 8px 32px -8px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
8581
}
8682

8783
html {

‎webui/src/app/namespaces/[namespace]/clusters/[cluster]/page.tsx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@ interface ShardData {
6161
}
6262

6363
type FilterOption =
64-
| "all"
65-
| "with-migration"
66-
| "no-migration"
67-
| "with-slots"
68-
| "no-slots"
69-
| "with-importing";
64+
"all" | "with-migration" | "no-migration" | "with-slots" | "no-slots" | "with-importing";
7065
type SortOption = "index-asc" | "index-desc" | "nodes-desc" | "nodes-asc";
7166

7267
const isActive = (value: string | null | undefined) =>
7368
value !== null && value !== undefined && value !== "" && value !== "-1";
7469

75-
function summarise(shards: any[]): { data: ShardData[]; nodes: number; withSlots: number; migrating: number } {
70+
function summarise(shards: any[]): {
71+
data: ShardData[];
72+
nodes: number;
73+
withSlots: number;
74+
migrating: number;
75+
} {
7676
let nodes = 0;
7777
let withSlots = 0;
7878
let migrating = 0;

‎webui/src/app/namespaces/[namespace]/clusters/[cluster]/shards/[shard]/nodes/[node]/page.tsx‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,7 @@ import { NodeSidebar } from "@/app/ui/sidebar";
3131
import { LoadingSpinner } from "@/app/ui/loadingSpinner";
3232
import { PageHeader, PageShell } from "@/app/ui/pageChrome";
3333

34-
function CopyableField({
35-
label,
36-
value,
37-
mono,
38-
}: {
39-
label: string;
40-
value: string;
41-
mono?: boolean;
42-
}) {
34+
function CopyableField({ label, value, mono }: { label: string; value: string; mono?: boolean }) {
4335
const [copied, setCopied] = useState(false);
4436
const copy = () => {
4537
navigator.clipboard.writeText(value);
@@ -121,7 +113,9 @@ export default function NodePage(props: {
121113
const current = nodes[parseInt(node)];
122114
if (!current) {
123115
return (
124-
<PageShell sidebar={<NodeSidebar namespace={namespace} cluster={cluster} shard={shard} />}>
116+
<PageShell
117+
sidebar={<NodeSidebar namespace={namespace} cluster={cluster} shard={shard} />}
118+
>
125119
<div className="p-8">
126120
<Alert severity="error" variant="outlined">
127121
Node not found.

‎webui/src/app/namespaces/[namespace]/page.tsx‎

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,7 @@ const isActiveSlot = (value: unknown): value is string =>
7575
typeof value === "string" && value.length > 0 && value !== "-1";
7676

7777
type FilterOption =
78-
| "all"
79-
| "with-migration"
80-
| "no-migration"
81-
| "with-slots"
82-
| "no-slots"
83-
| "with-importing";
78+
"all" | "with-migration" | "no-migration" | "with-slots" | "no-slots" | "with-importing";
8479
type SortOption =
8580
| "name-asc"
8681
| "name-desc"
@@ -127,16 +122,16 @@ async function buildClusterData(namespace: string): Promise<{
127122

128123
const shards = ((clusterInfo as any).shards as any[]) || [];
129124
const nodeLists = await Promise.all(
130-
shards.map((_, i) => listNodes(namespace, cluster, i.toString())),
125+
shards.map((_, i) => listNodes(namespace, cluster, i.toString()))
131126
);
132127
const nodeCount = nodeLists.reduce(
133128
(acc, nodes) => acc + (Array.isArray(nodes) ? nodes.length : 0),
134-
0,
129+
0
135130
);
136131

137132
const slotCount = shards.reduce(
138133
(acc: number, s: any) => acc + parseSlotCount(s?.slot_ranges),
139-
0,
134+
0
140135
);
141136
const slotRanges: string[] = shards
142137
.flatMap((s: any) => (Array.isArray(s?.slot_ranges) ? s.slot_ranges : []))
@@ -164,7 +159,7 @@ async function buildClusterData(namespace: string): Promise<{
164159
console.error(`Failed to load cluster ${cluster}:`, error);
165160
return null;
166161
}
167-
}),
162+
})
168163
);
169164

170165
return {
@@ -183,9 +178,7 @@ function formatSummary(clusters: number, shards: number, nodes: number, coverage
183178
return parts.join(" · ");
184179
}
185180

186-
export default function NamespacePage(props: {
187-
params: Promise<{ namespace: string }>;
188-
}) {
181+
export default function NamespacePage(props: { params: Promise<{ namespace: string }> }) {
189182
const params = use(props.params);
190183
const [rows, setRows] = useState<ClusterData[]>([]);
191184
const [totals, setTotals] = useState({ shards: 0, nodes: 0, slots: 0 });
@@ -485,11 +478,11 @@ function ActivityStrip({
485478
const bits: string[] = [];
486479
if (migrating.length > 0)
487480
bits.push(
488-
`${migrating.length} ${migrating.length === 1 ? "cluster" : "clusters"} migrating`,
481+
`${migrating.length} ${migrating.length === 1 ? "cluster" : "clusters"} migrating`
489482
);
490483
if (importing.length > 0)
491484
bits.push(
492-
`${importing.length} ${importing.length === 1 ? "cluster" : "clusters"} importing`,
485+
`${importing.length} ${importing.length === 1 ? "cluster" : "clusters"} importing`
493486
);
494487

495488
const active = [
@@ -586,10 +579,7 @@ function ClusterRow({
586579
className="group grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-4 px-6 py-4 transition-colors hover:bg-surface-hover dark:hover:bg-surface-dark-hover md:grid-cols-[auto_minmax(0,1fr)_auto_auto]"
587580
aria-label={`${cluster.name}, ${stateLabel.toLowerCase()}`}
588581
>
589-
<span
590-
className={`h-2 w-2 shrink-0 rounded-full ${dotClass}`}
591-
aria-hidden
592-
/>
582+
<span className={`h-2 w-2 shrink-0 rounded-full ${dotClass}`} aria-hidden />
593583

594584
<div className="min-w-0">
595585
<div className="flex items-center gap-2">
@@ -654,7 +644,7 @@ function ClusterRow({
654644
</div>
655645
<div className="mt-1 flex items-center justify-between text-2xs text-text-muted dark:text-text-dark-muted">
656646
<span>{stateLabel}</span>
657-
<span className="font-medium text-text-secondary tabular-nums dark:text-text-dark-secondary">
647+
<span className="font-medium tabular-nums text-text-secondary dark:text-text-dark-secondary">
658648
{coverage}%
659649
</span>
660650
</div>

‎webui/src/app/namespaces/page.tsx‎

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@ import DnsIcon from "@mui/icons-material/Dns";
2929
import DeviceHubIcon from "@mui/icons-material/DeviceHub";
3030

3131
import { NamespaceSidebar } from "../ui/sidebar";
32-
import {
33-
deleteNamespace,
34-
fetchClusters,
35-
fetchNamespaces,
36-
listNodes,
37-
listShards,
38-
} from "../lib/api";
32+
import { deleteNamespace, fetchClusters, fetchNamespaces, listNodes, listShards } from "../lib/api";
3933
import { LoadingSpinner } from "../ui/loadingSpinner";
4034
import EmptyState from "../ui/emptyState";
4135
import {
@@ -59,12 +53,7 @@ interface NamespaceData {
5953

6054
type FilterOption = "all" | "with-clusters" | "no-clusters";
6155
type SortOption =
62-
| "name-asc"
63-
| "name-desc"
64-
| "clusters-desc"
65-
| "clusters-asc"
66-
| "nodes-desc"
67-
| "nodes-asc";
56+
"name-asc" | "name-desc" | "clusters-desc" | "clusters-asc" | "nodes-desc" | "nodes-asc";
6857

6958
export default function Namespaces() {
7059
const [rows, setRows] = useState<NamespaceData[]>([]);
@@ -93,7 +82,7 @@ export default function Namespaces() {
9382
shardCount: 0,
9483
nodeCount: 0,
9584
loading: true,
96-
})),
85+
}))
9786
);
9887
setTotals({ namespaces: namespaces.length, clusters: 0, shards: 0, nodes: 0 });
9988
setLoading(false);
@@ -103,7 +92,7 @@ export default function Namespaces() {
10392
try {
10493
const clusters = await fetchClusters(namespace);
10594
const shardLists = await Promise.all(
106-
clusters.map((cluster) => listShards(namespace, cluster)),
95+
clusters.map((cluster) => listShards(namespace, cluster))
10796
);
10897

10998
let shardCount = 0;
@@ -114,16 +103,16 @@ export default function Namespaces() {
114103
shardCount += shards.length;
115104
shards.forEach((_, i) =>
116105
nodePromises.push(
117-
listNodes(namespace, cluster, i.toString()),
118-
),
106+
listNodes(namespace, cluster, i.toString())
107+
)
119108
);
120109
}
121110
});
122111

123112
const nodeLists = await Promise.all(nodePromises);
124113
const nodeCount = nodeLists.reduce(
125114
(acc, nodes) => acc + (Array.isArray(nodes) ? nodes.length : 0),
126-
0,
115+
0
127116
);
128117

129118
if (cancelled) return;
@@ -138,8 +127,8 @@ export default function Namespaces() {
138127
nodeCount,
139128
loading: false,
140129
}
141-
: n,
142-
),
130+
: n
131+
)
143132
);
144133
setTotals((prev) => ({
145134
namespaces: prev.namespaces,
@@ -152,12 +141,12 @@ export default function Namespaces() {
152141
if (!cancelled) {
153142
setRows((prev) =>
154143
prev.map((n) =>
155-
n.name === namespace ? { ...n, loading: false } : n,
156-
),
144+
n.name === namespace ? { ...n, loading: false } : n
145+
)
157146
);
158147
}
159148
}
160-
}),
149+
})
161150
);
162151
} catch (error) {
163152
console.error("Error fetching namespaces data:", error);

‎webui/src/app/page.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export default function Home() {
109109
const router = useRouter();
110110

111111
return (
112-
<div className="mx-auto flex w-full max-w-[1200px] flex-col gap-16 px-6 py-16 lin-fade-in">
112+
<div className="lin-fade-in mx-auto flex w-full max-w-[1200px] flex-col gap-16 px-6 py-16">
113113
<section className="grid grid-cols-1 items-center gap-10 md:grid-cols-2">
114114
<div className="space-y-5">
115115
<span className="lin-eyebrow inline-flex items-center gap-2">

‎webui/src/app/ui/failoverDialog.tsx‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,7 @@ export const FailoverDialog: React.FC<FailoverDialogProps> = ({
152152
<div className="mb-4">
153153
<div className="lin-eyebrow mb-1.5">Current master</div>
154154
<div className="flex items-center gap-3 rounded-md border border-success/30 bg-success/5 px-3 py-2">
155-
<CheckCircleIcon
156-
sx={{ fontSize: 14 }}
157-
className="text-success"
158-
/>
155+
<CheckCircleIcon sx={{ fontSize: 14 }} className="text-success" />
159156
<div className="min-w-0 flex-1">
160157
<div className="truncate text-sm font-medium text-text-primary dark:text-text-dark-primary">
161158
{masterNode.addr}

‎webui/src/app/ui/footer.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ import { footerConfig } from "../../../config";
2929
import { footerColumn, footerColumnItem } from "../lib/definitions";
3030

3131
const socials = [
32-
{ icon: <GitHubIcon sx={{ fontSize: 15 }} />, href: "https://github.com/apache", label: "GitHub" },
32+
{
33+
icon: <GitHubIcon sx={{ fontSize: 15 }} />,
34+
href: "https://github.com/apache",
35+
label: "GitHub",
36+
},
3337
{ icon: <TwitterIcon sx={{ fontSize: 15 }} />, href: "https://x.com/TheASF", label: "Twitter" },
3438
{
3539
icon: <LinkedInIcon sx={{ fontSize: 15 }} />,

‎webui/src/app/ui/formDialog.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,7 @@ const FormDialog: React.FC<FormDialogProps> = ({
253253
size="small"
254254
disabled={submitting}
255255
startIcon={
256-
submitting ? (
257-
<CircularProgress size={12} color="inherit" />
258-
) : null
256+
submitting ? <CircularProgress size={12} color="inherit" /> : null
259257
}
260258
>
261259
{submitting ? "Working…" : submitButtonLabel}

‎webui/src/app/ui/pageChrome.tsx‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function PageShell({ sidebar, children }: PageShellProps) {
3636
return (
3737
<div className="mx-auto flex w-full max-w-[1440px] items-stretch">
3838
{sidebar}
39-
<div className="min-w-0 flex-1 lin-fade-in">{children}</div>
39+
<div className="lin-fade-in min-w-0 flex-1">{children}</div>
4040
</div>
4141
);
4242
}
@@ -204,11 +204,7 @@ export function FilterSortMenu<T extends string>({
204204
>
205205
{groups.map((group, gi) => [
206206
group.title ? (
207-
<li
208-
key={`g-${gi}`}
209-
className="lin-eyebrow px-3 pb-1 pt-2"
210-
aria-hidden
211-
>
207+
<li key={`g-${gi}`} className="lin-eyebrow px-3 pb-1 pt-2" aria-hidden>
212208
{group.title}
213209
</li>
214210
) : null,
@@ -223,10 +219,7 @@ export function FilterSortMenu<T extends string>({
223219
>
224220
<span className="flex-1">{opt.label}</span>
225221
{opt.value === value && (
226-
<CheckIcon
227-
sx={{ fontSize: 13, ml: 1 }}
228-
className="text-primary"
229-
/>
222+
<CheckIcon sx={{ fontSize: 13, ml: 1 }} className="text-primary" />
230223
)}
231224
</MenuItem>
232225
)),

0 commit comments

Comments
 (0)