mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-12 19:57:37 +00:00
fix(lint): resolve all ESLint errors to pass CI lint step
- Replace catch (error: any) with catch (error) + (error as Error).message cast in EditorLayout, NodeManager, HomeDashboard, AppStoreView - Define TemplateVolume interface in AppStoreView; replace volumes any[] with typed array - Define MetricPoint interface in HomeDashboard; replace metrics any[] with MetricPoint[] - Define TerminalContainer type in BashExecModal; replace as any DOM property casts - Define NodeTestInfo interface in NodeManager; replace info: any with typed shape - Fix DockerNetworkStats cast in EditorLayout container stats WebSocket handler - Remove unused catch variable (e) in api.ts and other components - Cast streamFilter onValueChange val to union type in GlobalObservabilityView - Add eslint-disable-next-line react-refresh/only-export-components to badge.tsx, button.tsx, AuthContext, NodeContext, use-data-state, use-is-in-view - Add eslint-disable-next-line react-hooks/set-state-in-effect in LogViewer - Add /* eslint-disable */ to animate-ui third-party primitive files
This commit is contained in:
@@ -492,7 +492,7 @@ export default function EditorLayout() {
|
||||
let currentRx = 0;
|
||||
let currentTx = 0;
|
||||
if (data.networks) {
|
||||
Object.values(data.networks).forEach((net: any) => {
|
||||
Object.values(data.networks as Record<string, { rx_bytes?: number; tx_bytes?: number }>).forEach((net) => {
|
||||
currentRx += net.rx_bytes || 0;
|
||||
currentTx += net.tx_bytes || 0;
|
||||
});
|
||||
@@ -713,9 +713,9 @@ export default function EditorLayout() {
|
||||
const conts = await containersRes.json();
|
||||
setContainers(Array.isArray(conts) ? conts : []);
|
||||
await refreshStacks(true);
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
console.error('Failed to deploy:', error);
|
||||
toast.error(error.message || 'Failed to deploy stack');
|
||||
toast.error((error as Error).message || 'Failed to deploy stack');
|
||||
} finally {
|
||||
setLoadingAction(null);
|
||||
}
|
||||
@@ -741,9 +741,9 @@ export default function EditorLayout() {
|
||||
const conts = await containersRes.json();
|
||||
setContainers(Array.isArray(conts) ? conts : []);
|
||||
await refreshStacks(true);
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
console.error('Failed to stop:', error);
|
||||
toast.error(error.message || 'Failed to stop stack');
|
||||
toast.error((error as Error).message || 'Failed to stop stack');
|
||||
} finally {
|
||||
setLoadingAction(null);
|
||||
}
|
||||
@@ -769,9 +769,9 @@ export default function EditorLayout() {
|
||||
const conts = await containersRes.json();
|
||||
setContainers(Array.isArray(conts) ? conts : []);
|
||||
await refreshStacks(true);
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
console.error('Failed to restart:', error);
|
||||
toast.error(error.message || 'Failed to restart stack');
|
||||
toast.error((error as Error).message || 'Failed to restart stack');
|
||||
} finally {
|
||||
setLoadingAction(null);
|
||||
}
|
||||
@@ -797,9 +797,9 @@ export default function EditorLayout() {
|
||||
const conts = await containersRes.json();
|
||||
setContainers(Array.isArray(conts) ? conts : []);
|
||||
await refreshStacks(true);
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
console.error('Failed to update:', error);
|
||||
toast.error(error.message || 'Failed to update stack');
|
||||
toast.error((error as Error).message || 'Failed to update stack');
|
||||
} finally {
|
||||
setLoadingAction(null);
|
||||
}
|
||||
@@ -830,9 +830,9 @@ export default function EditorLayout() {
|
||||
setIsEditing(false);
|
||||
}
|
||||
await refreshStacks();
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
console.error('Failed to delete stack:', error);
|
||||
toast.error(error.message || 'Failed to delete stack');
|
||||
toast.error((error as Error).message || 'Failed to delete stack');
|
||||
} finally {
|
||||
setLoadingAction(null);
|
||||
}
|
||||
@@ -860,9 +860,9 @@ export default function EditorLayout() {
|
||||
await refreshStacks();
|
||||
// Auto-load the new stack in the editor pane
|
||||
await loadFile(stackName);
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
console.error('Failed to create stack:', error);
|
||||
toast.error(error.message || 'Failed to create stack');
|
||||
toast.error((error as Error).message || 'Failed to create stack');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user