mirror of
				https://github.com/KevinMidboe/infra-map.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	linting
This commit is contained in:
		| @@ -1,6 +1,6 @@ | ||||
| <script lang="ts"> | ||||
| 	import { formatBytes } from "$lib/utils/conversion"; | ||||
| 	import type { Node } from "$lib/interfaces/proxmox"; | ||||
| 	import { formatBytes } from '$lib/utils/conversion'; | ||||
| 	import type { Node } from '$lib/interfaces/proxmox'; | ||||
|  | ||||
| 	export let nodes: Node[]; | ||||
|  | ||||
| @@ -19,8 +19,6 @@ | ||||
| 			.map((n) => n.lxcs.filter((l) => l?.template !== 1 && l.status === 'running')) | ||||
| 			.flat(2).length | ||||
| 	}; | ||||
|  | ||||
|  | ||||
| </script> | ||||
|  | ||||
| <div class="main-container"> | ||||
|   | ||||
| @@ -4,13 +4,13 @@ | ||||
| 	import { allRoutes } from '$lib/remote/filesystem.remote.ts'; | ||||
|  | ||||
| 	let mobileNavOpen = $state(false); | ||||
| 	let pages = $state([]) | ||||
| 	let pages = $state([]); | ||||
|  | ||||
| 	async function resolvePages() { | ||||
| 		pages = await allRoutes() | ||||
| 		pages = await allRoutes(); | ||||
| 	} | ||||
|  | ||||
| 	resolvePages() | ||||
| 	resolvePages(); | ||||
|  | ||||
| 	const activePage = derived(page, ($page) => $page.url.pathname); | ||||
| 	const toggle = () => { | ||||
|   | ||||
| @@ -3,7 +3,6 @@ import { prerender } from '$app/server'; | ||||
| export const allRoutes = prerender(() => { | ||||
| 	const modules = import.meta.glob('/src/routes/**/+page.svelte'); | ||||
| 	const routes = Object.keys(modules).map((path) => { | ||||
| 		console.log(path); | ||||
| 		// Remove '/src/routes' prefix and '+page.svelte' suffix | ||||
| 		let route = path.replace('/src/routes', '').replace('/+page.svelte', ''); | ||||
| 		// Handle the root route | ||||
| @@ -19,5 +18,5 @@ export const allRoutes = prerender(() => { | ||||
| 		}; | ||||
| 	}); | ||||
|  | ||||
| 	return [{name: 'Home', path: '/'}, ...allRoute].filter(r => r.name); | ||||
| 	return [{ name: 'Home', path: '/' }, ...allRoute].filter((r) => r.name); | ||||
| }); | ||||
|   | ||||
| @@ -4,7 +4,10 @@ export function hexToRgba(hex: string, alpha = 1) { | ||||
|  | ||||
| 	// Handle shorthand (#fff → #ffffff) | ||||
| 	if (hex.length === 3) { | ||||
|     hex = hex.split('').map(c => c + c).join(''); | ||||
| 		hex = hex | ||||
| 			.split('') | ||||
| 			.map((c) => c + c) | ||||
| 			.join(''); | ||||
| 	} | ||||
|  | ||||
| 	if (hex.length !== 6) { | ||||
|   | ||||
| @@ -8556,7 +8556,6 @@ const hassData = [ | ||||
| 	} | ||||
| ]; | ||||
|  | ||||
|  | ||||
| function getNeighbors(data) { | ||||
| 	return ( | ||||
| 		data.routes | ||||
| @@ -8582,10 +8581,10 @@ function getNeighbors(data) { | ||||
| } | ||||
|  | ||||
| function getCoordinatorNeighbors(coordinatorId) { | ||||
|   return hassData.filter(d => { | ||||
|     const exists = d.neighbors.findIndex(n => n.ieee === coordinatorId) | ||||
| 	return hassData.filter((d) => { | ||||
| 		const exists = d.neighbors.findIndex((n) => n.ieee === coordinatorId); | ||||
| 		return exists; | ||||
|   }) | ||||
| 	}); | ||||
| } | ||||
|  | ||||
| let firstNode = [ | ||||
| @@ -8604,7 +8603,7 @@ let firstNode = [ | ||||
| const moreNodes = hassData | ||||
| 	.filter((d) => d?.user_given_name && d.user_given_name !== '') | ||||
| 	.map((d) => { | ||||
|     const group = d.device_type === 'EndDevice' ? 2 : 1  | ||||
| 		const group = d.device_type === 'EndDevice' ? 2 : 1; | ||||
|  | ||||
| 		return { | ||||
| 			name: d.user_given_name, | ||||
| @@ -8631,11 +8630,11 @@ const link = firstNode | ||||
| 		return ( | ||||
| 			d?.neighbors?.map((n) => { | ||||
| 				const matching = nodes.findIndex((node) => node.ieee === n.ieee); | ||||
|         if (matching === -1) return | ||||
| 				if (matching === -1) return; | ||||
|  | ||||
| 				return { | ||||
| 					source, | ||||
| 					target: matching, | ||||
| 					target: matching | ||||
| 				}; | ||||
| 			}) || [] | ||||
| 		); | ||||
| @@ -8647,10 +8646,10 @@ const moreLinks = nodes | ||||
| 	.map((d, source) => { | ||||
| 		return ( | ||||
| 			d?.neighbors?.map((n) => { | ||||
|         if (n.ieee === '00:21:2e:ff:ff:09:44:73') return | ||||
| 				if (n.ieee === '00:21:2e:ff:ff:09:44:73') return; | ||||
|  | ||||
| 				const matching = nodes.findIndex((node) => node.ieee === n.ieee); | ||||
|         if (matching === -1) return | ||||
| 				if (matching === -1) return; | ||||
|  | ||||
| 				return { | ||||
| 					target: matching, | ||||
| @@ -8662,6 +8661,6 @@ const moreLinks = nodes | ||||
| 	.flat() | ||||
| 	.filter((el) => el !== undefined); | ||||
|  | ||||
| const links = link.concat(moreLinks) | ||||
| const links = link.concat(moreLinks); | ||||
|  | ||||
| export const data = { nodes, links }; | ||||
|   | ||||
| @@ -50,7 +50,7 @@ | ||||
| 			case 3: | ||||
| 				return '#DB4537'; | ||||
| 			default: | ||||
| 				return 'blue' | ||||
| 				return 'blue'; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user