A focused Docker Compose management web application.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: server info on server page

Brooke a6b8fd26 5d49f29f

+32 -4
+8 -1
packages/panel/plugin.ts
··· 1 1 import openapiTS, { astToString } from "openapi-typescript"; 2 - import { writeFileSync } from "node:fs"; 2 + import { readFileSync, writeFileSync } from "node:fs"; 3 3 import { existsSync } from "node:fs"; 4 4 import type { Plugin } from "vite"; 5 5 6 6 const OPENAPI_PATH = new URL("../node/openapi.json", import.meta.url); 7 + const CARGO_TOML_PATH = new URL("../../Cargo.toml", import.meta.url); 8 + 9 + export function getVersion() { 10 + const cargo = readFileSync(CARGO_TOML_PATH, "utf8"); 11 + const version = cargo.match(/\[workspace\.package\][\s\S]*?\nversion\s*=\s*(.+)/)?.[1]; 12 + return version ?? "unknown"; 13 + } 7 14 8 15 async function generateTypes() { 9 16 if (!existsSync(OPENAPI_PATH)) return;
+2
packages/panel/src/ambient.d.ts
··· 1 1 declare module "roving-ux" { 2 2 export declare function rovingIndex({ element, target }: { element: HTMLElement; target: string }): void; 3 3 } 4 + 5 + declare const __LUMINARY_VERSION__: string;
+2
packages/panel/src/app.d.ts
··· 1 1 // See https://svelte.dev/docs/kit/types#app.d.ts 2 2 // for information about these interfaces 3 3 declare global { 4 + const __LUMINARY_VERSION__: string; 5 + 4 6 namespace App { 5 7 // interface Error {} 6 8 // interface Locals {}
+1
packages/panel/src/lib/version.ts
··· 1 + export const version = "0.1.0" as const;
+15 -2
packages/panel/src/routes/(authenticated)/server/+page.svelte
··· 1 1 <script lang="ts"> 2 - import { faUsers } from "@fortawesome/free-solid-svg-icons"; 2 + import { faServer, faUsers } from "@fortawesome/free-solid-svg-icons"; 3 3 import Tabs from "$lib/component/Tabs.svelte"; 4 4 import UserList from "./UserList.svelte"; 5 + import { page } from "$app/state"; 6 + import Fa from "svelte-fa"; 5 7 </script> 6 8 7 9 <svelte:head> 8 10 <title>Server - Luminary</title> 9 11 </svelte:head> 10 12 11 - <Tabs tabs={[{ icon: faUsers, label: "users", content: users }]} /> 13 + <div class="flexc gap-10"> 14 + <!-- Title Bar --> 15 + <h1 class="flexr gap-10 center fit"> 16 + <Fa icon={faServer} size="lg" /> 17 + <div style="display: inline-block;"> 18 + <div style="font-size: 22px;">{page.url.host}</div> 19 + <div class="subtext">Luminary v{__LUMINARY_VERSION__}</div> 20 + </div> 21 + </h1> 22 + 23 + <Tabs tabs={[{ icon: faUsers, label: "users", content: users }]} /> 24 + </div> 12 25 13 26 {#snippet users()} 14 27 <UserList />
+4 -1
packages/panel/vite.config.ts
··· 1 + import { custom, getVersion } from "./plugin"; 1 2 import { sveltekit } from "@sveltejs/kit/vite"; 2 3 import { defineConfig } from "vite"; 3 - import { custom } from "./plugin"; 4 4 5 5 export default defineConfig({ 6 6 plugins: [sveltekit(), custom()], 7 + define: { 8 + __LUMINARY_VERSION__: getVersion(), 9 + }, 7 10 server: { 8 11 proxy: { 9 12 "^/(api)/?.*": {