+96
-39
@@ -1,66 +1,123 @@
|
||||
import { useEffect, useState } from "preact/hooks";
|
||||
import { createClient } from "@connectrpc/connect";
|
||||
import { createConnectTransport } from "@connectrpc/connect-web";
|
||||
import { Gauge, FlaskConical } from "lucide-preact";
|
||||
import type { Section } from "./gen/homelab/v1/homelab_pb";
|
||||
import { BookOpen, Gauge, Link as LinkIcon, Menu, Play } from "lucide-preact";
|
||||
import type { Item, Link } from "./gen/homelab/v1/homelab_pb";
|
||||
import { HomelabService } from "./gen/homelab/v1/homelab_pb";
|
||||
import { ScriptCard } from "./components/ScriptCard";
|
||||
import { MonitorCard } from "./components/MonitorCard";
|
||||
import { ScriptCard } from "./components/ScriptCard";
|
||||
import { DocsView, DocView, localDocs } from "./components/Docs";
|
||||
import { syncDocs } from "./docsStore";
|
||||
|
||||
const client = createClient(HomelabService, createConnectTransport({ baseUrl: "" }));
|
||||
|
||||
// Иконки секций: строка из конфига → компонент. Новый icon в yaml = добавить сюда.
|
||||
const ICONS: Record<string, preact.JSX.ElementType> = { gauge: Gauge, "flask-conical": FlaskConical };
|
||||
const CATEGORIES = [
|
||||
{ id: "links", label: "Links", icon: LinkIcon },
|
||||
{ id: "monitor", label: "Monitor", icon: Gauge },
|
||||
{ id: "exec", label: "Exec", icon: Play },
|
||||
{ id: "docs", label: "Docs", icon: BookOpen },
|
||||
] as const;
|
||||
|
||||
function DynIcon({ name, size = 20 }: { name: string; size?: number }) {
|
||||
const Cmp = ICONS[name] ?? Gauge;
|
||||
return <Cmp size={size} />;
|
||||
type Category = (typeof CATEGORIES)[number]["id"];
|
||||
|
||||
function LinkList({ links }: { links: Link[] }) {
|
||||
if (links.length === 0) return <div class="alert mt-4">No links in config</div>;
|
||||
return (
|
||||
<div class="flex flex-col gap-2 mt-4">
|
||||
{links.map((l) => (
|
||||
<a href={l.url} target="_blank" rel="noreferrer" class="card bg-base-200 shadow">
|
||||
<div class="card-body p-4 py-3 flex-row items-center gap-2">
|
||||
<LinkIcon size={14} class="text-primary" />
|
||||
<span class="flex-1 truncate">{l.name}</span>
|
||||
<span class="text-xs text-base-content/40 truncate max-w-40">{l.url}</span>
|
||||
</div>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function App() {
|
||||
const [sections, setSections] = useState<Section[]>([]);
|
||||
const [active, setActive] = useState(0);
|
||||
const [content, setContent] = useState<{ links: Link[]; monitors: Item[]; exec: Item[] }>({
|
||||
links: [],
|
||||
monitors: [],
|
||||
exec: [],
|
||||
});
|
||||
const [category, setCategory] = useState<Category>("monitor");
|
||||
const [drawerOpen, setDrawerOpen] = useState(false);
|
||||
const [docs, setDocs] = useState(localDocs());
|
||||
const [openDoc, setOpenDoc] = useState<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const poll = () => client.listSections({}).then((r) => setSections(r.sections));
|
||||
const poll = () =>
|
||||
client
|
||||
.listContent({})
|
||||
.then((r) => setContent({ links: r.links, monitors: r.monitors, exec: r.exec }))
|
||||
.catch(() => {}); // offline: keep last state
|
||||
poll();
|
||||
const id = setInterval(poll, 3000);
|
||||
return () => clearInterval(id);
|
||||
}, []);
|
||||
|
||||
const sec = sections[active];
|
||||
// Docs sync + offline dirty flush, every 5s.
|
||||
useEffect(() => {
|
||||
const tick = () => syncDocs().then(() => setDocs(localDocs())).catch(() => {});
|
||||
tick();
|
||||
const id = setInterval(tick, 5000);
|
||||
return () => clearInterval(id);
|
||||
}, []);
|
||||
|
||||
const cat = CATEGORIES.find((c) => c.id === category)!;
|
||||
const open = docs.find((d) => d.name === openDoc);
|
||||
|
||||
return (
|
||||
<div class="flex min-h-screen">
|
||||
{/* Sidebar */}
|
||||
<nav class="bg-base-200 w-20 flex flex-col items-center gap-1 py-4 pt-[calc(env(safe-area-inset-top)+1rem)]">
|
||||
{sections.map((s, i) => (
|
||||
<button
|
||||
class={`btn btn-square btn-ghost ${i === active ? "btn-primary" : ""}`}
|
||||
title={s.name}
|
||||
onClick={() => setActive(i)}
|
||||
>
|
||||
<DynIcon name={s.icon} />
|
||||
</button>
|
||||
))}
|
||||
</nav>
|
||||
<div class="drawer min-h-screen">
|
||||
<input id="nav-drawer" type="checkbox" class="drawer-toggle" checked={drawerOpen} onChange={() => setDrawerOpen((v) => !v)} />
|
||||
|
||||
{/* Active section view */}
|
||||
<div class="flex-1 max-w-md mx-auto px-4 pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)]">
|
||||
<div class="navbar px-0">
|
||||
<div class="navbar-start" />
|
||||
<div class="navbar-center">
|
||||
<span class="text-lg font-bold">{sec?.name ?? "Homelab"}</span>
|
||||
</div>
|
||||
<div class="navbar-end" />
|
||||
<div class="drawer-content flex flex-col">
|
||||
{/* Top bar */}
|
||||
<div class="navbar bg-base-200 px-2 pt-[env(safe-area-inset-top)]">
|
||||
<label class="btn btn-square btn-ghost" onClick={() => setDrawerOpen(true)}>
|
||||
<Menu size={22} />
|
||||
</label>
|
||||
<span class="text-lg font-bold mx-auto">{open && category === "docs" ? open.name.replace(/\.md$/, "") : cat.label}</span>
|
||||
<span class="w-11" />
|
||||
</div>
|
||||
|
||||
{sec && (
|
||||
<div class="flex flex-col gap-4 pb-6">
|
||||
{sec.items.filter((it) => it.type === "monitor").map((it) => <MonitorCard s={it} />)}
|
||||
{sec.items.filter((it) => it.type === "response").map((it) => <ScriptCard s={it} />)}
|
||||
</div>
|
||||
)}
|
||||
<div class="max-w-md w-full mx-auto px-4 pb-[env(safe-area-inset-bottom)]">
|
||||
{category === "links" && <LinkList links={content.links} />}
|
||||
{category === "monitor" && (
|
||||
<div class="flex flex-col gap-3 mt-4">
|
||||
{content.monitors.map((it) => <MonitorCard s={it} />)}
|
||||
</div>
|
||||
)}
|
||||
{category === "exec" && content.exec.map((it) => <ScriptCard s={it} />)}
|
||||
{category === "docs" &&
|
||||
(open ? (
|
||||
<DocView doc={open} onBack={() => setOpenDoc(null)} />
|
||||
) : (
|
||||
<DocsView docs={docs} onOpen={(d) => setOpenDoc(d.name)} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Sidebar */}
|
||||
<div class="drawer-side z-20">
|
||||
<label class="drawer-overlay" onClick={() => setDrawerOpen(false)} />
|
||||
<nav class="bg-base-200 min-h-full w-56 p-3 pt-[calc(env(safe-area-inset-top)+1rem)] flex flex-col gap-1">
|
||||
{CATEGORIES.map((c) => (
|
||||
<button
|
||||
class={`btn btn-ghost justify-start ${c.id === category ? "btn-primary" : ""}`}
|
||||
onClick={() => {
|
||||
setCategory(c.id);
|
||||
setOpenDoc(null);
|
||||
setDrawerOpen(false);
|
||||
}}
|
||||
>
|
||||
<c.icon size={18} /> {c.label}
|
||||
</button>
|
||||
))}
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
import { useState } from "preact/hooks";
|
||||
import { marked } from "marked";
|
||||
import { ArrowLeft, Pencil } from "lucide-preact";
|
||||
import { editDoc, localDocs, type StoredDoc } from "../docsStore";
|
||||
|
||||
// ponytail: no sanitizer — docs come from our own server; add DOMPurify if foreign content ever lands here
|
||||
const render = (md: string) => marked.parse(md, { async: false });
|
||||
|
||||
/** Просмотр одного дока: рендер сверху, textarea-редактор ниже. Правки — в localStorage (client authority). */
|
||||
export function DocView({ doc, onBack }: { doc: StoredDoc; onBack: () => void }) {
|
||||
const [content, setContent] = useState(doc.content);
|
||||
const [dirty, setDirty] = useState(doc.dirty);
|
||||
|
||||
return (
|
||||
<div class="flex flex-col gap-3">
|
||||
<div class="flex items-center gap-2">
|
||||
<button class="btn btn-sm btn-ghost" onClick={onBack}>
|
||||
<ArrowLeft size={16} /> Docs
|
||||
</button>
|
||||
<span class="font-semibold flex-1 truncate">{doc.name}</span>
|
||||
{dirty && <span class="badge badge-warning badge-sm">изменён</span>}
|
||||
</div>
|
||||
|
||||
<div class="card bg-base-200 shadow">
|
||||
<div
|
||||
class="prose prose-sm p-4 max-w-none break-words"
|
||||
dangerouslySetInnerHTML={{ __html: render(content) }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="card bg-base-200 shadow">
|
||||
<div class="card-body p-4 gap-2">
|
||||
<h2 class="card-title text-sm font-medium text-base-content/60">
|
||||
<Pencil size={14} /> Edit
|
||||
</h2>
|
||||
<textarea
|
||||
class="textarea textarea-bordered w-full font-mono text-sm h-64"
|
||||
value={content}
|
||||
onInput={(e) => {
|
||||
const v = (e.target as HTMLTextAreaElement).value;
|
||||
setContent(v);
|
||||
editDoc(doc.name, v);
|
||||
setDirty(true);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** Список доков из localStorage (offline-first), обновляется через App-поллинг. */
|
||||
export function DocsView({ docs, onOpen }: { docs: StoredDoc[]; onOpen: (d: StoredDoc) => void }) {
|
||||
if (docs.length === 0) {
|
||||
return <div class="alert mt-4">No docs yet (offline without cache, or empty docs dir)</div>;
|
||||
}
|
||||
return (
|
||||
<div class="flex flex-col gap-2 mt-4">
|
||||
{docs.map((d) => (
|
||||
<button class="card bg-base-200 shadow text-left" onClick={() => onOpen(d)}>
|
||||
<div class="card-body p-4 py-3 flex-row items-center gap-2">
|
||||
<span class="flex-1 truncate">{d.name.replace(/\.md$/, "")}</span>
|
||||
{d.dirty && <span class="badge badge-warning badge-sm">*</span>}
|
||||
</div>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export { localDocs };
|
||||
@@ -0,0 +1,67 @@
|
||||
import { createClient } from "@connectrpc/connect";
|
||||
import { createConnectTransport } from "@connectrpc/connect-web";
|
||||
import { HomelabService } from "./gen/homelab/v1/homelab_pb";
|
||||
|
||||
const client = createClient(HomelabService, createConnectTransport({ baseUrl: "" }));
|
||||
|
||||
// localStorage: hub:doc:<name> = {hash, content}, hub:doc-dirty:<name> = "1"
|
||||
|
||||
export type StoredDoc = { name: string; hash: string; content: string; dirty: boolean };
|
||||
|
||||
const key = (name: string) => `hub:doc:${name}`;
|
||||
const dirtyKey = (name: string) => `hub:doc-dirty:${name}`;
|
||||
|
||||
function get(name: string): StoredDoc | null {
|
||||
const raw = localStorage.getItem(key(name));
|
||||
if (!raw) return null;
|
||||
const { hash, content } = JSON.parse(raw);
|
||||
return { name, hash, content, dirty: localStorage.getItem(dirtyKey(name)) === "1" };
|
||||
}
|
||||
|
||||
function put(name: string, hash: string, content: string, dirty: boolean) {
|
||||
localStorage.setItem(key(name), JSON.stringify({ hash, content }));
|
||||
if (dirty) localStorage.setItem(dirtyKey(name), "1");
|
||||
else localStorage.removeItem(dirtyKey(name));
|
||||
}
|
||||
|
||||
/** All locally known docs (the offline source of truth). */
|
||||
export function localDocs(): StoredDoc[] {
|
||||
const out: StoredDoc[] = [];
|
||||
for (let i = 0; i < localStorage.length; i++) {
|
||||
const k = localStorage.key(i)!;
|
||||
if (k.startsWith("hub:doc:")) {
|
||||
const d = get(k.slice(8));
|
||||
if (d) out.push(d);
|
||||
}
|
||||
}
|
||||
return out.sort((a, b) => a.name.localeCompare(b.name));
|
||||
}
|
||||
|
||||
export function editDoc(name: string, content: string) {
|
||||
const d = get(name);
|
||||
if (d) put(name, d.hash, content, true);
|
||||
}
|
||||
|
||||
export async function syncDocs(): Promise<void> {
|
||||
// Pull: download new/changed docs (unless we have local edits — client authority).
|
||||
const metas = await client.listDocs({});
|
||||
for (const m of metas.docs) {
|
||||
const local = get(m.name);
|
||||
if (local && !local.dirty && local.hash !== m.hash) {
|
||||
const { content } = await client.getDoc({ name: m.name });
|
||||
put(m.name, m.hash, content, false);
|
||||
} else if (!local) {
|
||||
const { content } = await client.getDoc({ name: m.name });
|
||||
put(m.name, m.hash, content, false);
|
||||
}
|
||||
}
|
||||
// Push: flush dirty docs, every tick until server accepts.
|
||||
for (const d of localDocs().filter((d) => d.dirty)) {
|
||||
try {
|
||||
const { hash } = await client.saveDoc({ name: d.name, content: d.content });
|
||||
put(d.name, hash, d.content, false);
|
||||
} catch {
|
||||
// offline or server error — stays dirty, retried next tick
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import type { Message } from "@bufbuild/protobuf";
|
||||
* Describes the file homelab/v1/homelab.proto.
|
||||
*/
|
||||
export const file_homelab_v1_homelab: GenFile = /*@__PURE__*/
|
||||
fileDesc("Chhob21lbGFiL3YxL2hvbWVsYWIucHJvdG8SCmhvbWVsYWIudjEiYAoESXRlbRIMCgRuYW1lGAEgASgJEgwKBHR5cGUYAiABKAkSDAoEZGF0YRgDIAEoCRINCgV2YWx1ZRgEIAEoCRIMCgRhcmdzGAUgASgFEhEKCWFyZ190eXBlcxgGIAMoCSJGCgdTZWN0aW9uEgwKBG5hbWUYASABKAkSDAoEaWNvbhgCIAEoCRIfCgVpdGVtcxgDIAMoCzIQLmhvbWVsYWIudjEuSXRlbSIVChNMaXN0U2VjdGlvbnNSZXF1ZXN0Ij0KFExpc3RTZWN0aW9uc1Jlc3BvbnNlEiUKCHNlY3Rpb25zGAEgAygLMhMuaG9tZWxhYi52MS5TZWN0aW9uIi4KEFJ1blNjcmlwdFJlcXVlc3QSDAoEbmFtZRgBIAEoCRIMCgRhcmdzGAIgAygJIiMKEVJ1blNjcmlwdFJlc3BvbnNlEg4KBm91dHB1dBgBIAEoCTKtAQoOSG9tZWxhYlNlcnZpY2USUQoMTGlzdFNlY3Rpb25zEh8uaG9tZWxhYi52MS5MaXN0U2VjdGlvbnNSZXF1ZXN0GiAuaG9tZWxhYi52MS5MaXN0U2VjdGlvbnNSZXNwb25zZRJICglSdW5TY3JpcHQSHC5ob21lbGFiLnYxLlJ1blNjcmlwdFJlcXVlc3QaHS5ob21lbGFiLnYxLlJ1blNjcmlwdFJlc3BvbnNlQipaKHB3YS1ob21lbGFiLW1vbi9nZW4vaG9tZWxhYi92MTtob21lbGFidjFiBnByb3RvMw");
|
||||
fileDesc("Chhob21lbGFiL3YxL2hvbWVsYWIucHJvdG8SCmhvbWVsYWIudjEiUgoESXRlbRIMCgRuYW1lGAEgASgJEgwKBGRhdGEYAiABKAkSDQoFdmFsdWUYAyABKAkSDAoEYXJncxgEIAEoBRIRCglhcmdfdHlwZXMYBSADKAkiIQoETGluaxIMCgRuYW1lGAEgASgJEgsKA3VybBgCIAEoCSIUChJMaXN0Q29udGVudFJlcXVlc3QiegoTTGlzdENvbnRlbnRSZXNwb25zZRIfCgVsaW5rcxgBIAMoCzIQLmhvbWVsYWIudjEuTGluaxIiCghtb25pdG9ycxgCIAMoCzIQLmhvbWVsYWIudjEuSXRlbRIeCgRleGVjGAMgAygLMhAuaG9tZWxhYi52MS5JdGVtIiUKB0RvY01ldGESDAoEbmFtZRgBIAEoCRIMCgRoYXNoGAIgASgJIhEKD0xpc3REb2NzUmVxdWVzdCI1ChBMaXN0RG9jc1Jlc3BvbnNlEiEKBGRvY3MYASADKAsyEy5ob21lbGFiLnYxLkRvY01ldGEiHQoNR2V0RG9jUmVxdWVzdBIMCgRuYW1lGAEgASgJIiEKDkdldERvY1Jlc3BvbnNlEg8KB2NvbnRlbnQYASABKAkiLwoOU2F2ZURvY1JlcXVlc3QSDAoEbmFtZRgBIAEoCRIPCgdjb250ZW50GAIgASgJIh8KD1NhdmVEb2NSZXNwb25zZRIMCgRoYXNoGAEgASgJIi4KEFJ1blNjcmlwdFJlcXVlc3QSDAoEbmFtZRgBIAEoCRIMCgRhcmdzGAIgAygJIiMKEVJ1blNjcmlwdFJlc3BvbnNlEg4KBm91dHB1dBgBIAEoCTL2AgoOSG9tZWxhYlNlcnZpY2USTgoLTGlzdENvbnRlbnQSHi5ob21lbGFiLnYxLkxpc3RDb250ZW50UmVxdWVzdBofLmhvbWVsYWIudjEuTGlzdENvbnRlbnRSZXNwb25zZRJFCghMaXN0RG9jcxIbLmhvbWVsYWIudjEuTGlzdERvY3NSZXF1ZXN0GhwuaG9tZWxhYi52MS5MaXN0RG9jc1Jlc3BvbnNlEj8KBkdldERvYxIZLmhvbWVsYWIudjEuR2V0RG9jUmVxdWVzdBoaLmhvbWVsYWIudjEuR2V0RG9jUmVzcG9uc2USQgoHU2F2ZURvYxIaLmhvbWVsYWIudjEuU2F2ZURvY1JlcXVlc3QaGy5ob21lbGFiLnYxLlNhdmVEb2NSZXNwb25zZRJICglSdW5TY3JpcHQSHC5ob21lbGFiLnYxLlJ1blNjcmlwdFJlcXVlc3QaHS5ob21lbGFiLnYxLlJ1blNjcmlwdFJlc3BvbnNlQipaKHB3YS1ob21lbGFiLW1vbi9nZW4vaG9tZWxhYi92MTtob21lbGFidjFiBnByb3RvMw");
|
||||
|
||||
/**
|
||||
* @generated from message homelab.v1.Item
|
||||
@@ -21,38 +21,31 @@ export type Item = Message<"homelab.v1.Item"> & {
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* monitor | response
|
||||
*
|
||||
* @generated from field: string type = 2;
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* monitor: text | percentage
|
||||
*
|
||||
* @generated from field: string data = 3;
|
||||
* @generated from field: string data = 2;
|
||||
*/
|
||||
data: string;
|
||||
|
||||
/**
|
||||
* monitor: last output
|
||||
*
|
||||
* @generated from field: string value = 4;
|
||||
* @generated from field: string value = 3;
|
||||
*/
|
||||
value: string;
|
||||
|
||||
/**
|
||||
* response: arg count
|
||||
* exec: arg count
|
||||
*
|
||||
* @generated from field: int32 args = 5;
|
||||
* @generated from field: int32 args = 4;
|
||||
*/
|
||||
args: number;
|
||||
|
||||
/**
|
||||
* response: text | number per arg
|
||||
* exec: text | number per arg
|
||||
*
|
||||
* @generated from field: repeated string arg_types = 6;
|
||||
* @generated from field: repeated string arg_types = 5;
|
||||
*/
|
||||
argTypes: string[];
|
||||
};
|
||||
@@ -65,62 +58,194 @@ export const ItemSchema: GenMessage<Item> = /*@__PURE__*/
|
||||
messageDesc(file_homelab_v1_homelab, 0);
|
||||
|
||||
/**
|
||||
* @generated from message homelab.v1.Section
|
||||
* @generated from message homelab.v1.Link
|
||||
*/
|
||||
export type Section = Message<"homelab.v1.Section"> & {
|
||||
export type Link = Message<"homelab.v1.Link"> & {
|
||||
/**
|
||||
* @generated from field: string name = 1;
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* @generated from field: string icon = 2;
|
||||
* @generated from field: string url = 2;
|
||||
*/
|
||||
icon: string;
|
||||
|
||||
/**
|
||||
* @generated from field: repeated homelab.v1.Item items = 3;
|
||||
*/
|
||||
items: Item[];
|
||||
url: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message homelab.v1.Section.
|
||||
* Use `create(SectionSchema)` to create a new message.
|
||||
* Describes the message homelab.v1.Link.
|
||||
* Use `create(LinkSchema)` to create a new message.
|
||||
*/
|
||||
export const SectionSchema: GenMessage<Section> = /*@__PURE__*/
|
||||
export const LinkSchema: GenMessage<Link> = /*@__PURE__*/
|
||||
messageDesc(file_homelab_v1_homelab, 1);
|
||||
|
||||
/**
|
||||
* @generated from message homelab.v1.ListSectionsRequest
|
||||
* @generated from message homelab.v1.ListContentRequest
|
||||
*/
|
||||
export type ListSectionsRequest = Message<"homelab.v1.ListSectionsRequest"> & {
|
||||
export type ListContentRequest = Message<"homelab.v1.ListContentRequest"> & {
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message homelab.v1.ListSectionsRequest.
|
||||
* Use `create(ListSectionsRequestSchema)` to create a new message.
|
||||
* Describes the message homelab.v1.ListContentRequest.
|
||||
* Use `create(ListContentRequestSchema)` to create a new message.
|
||||
*/
|
||||
export const ListSectionsRequestSchema: GenMessage<ListSectionsRequest> = /*@__PURE__*/
|
||||
export const ListContentRequestSchema: GenMessage<ListContentRequest> = /*@__PURE__*/
|
||||
messageDesc(file_homelab_v1_homelab, 2);
|
||||
|
||||
/**
|
||||
* @generated from message homelab.v1.ListSectionsResponse
|
||||
* @generated from message homelab.v1.ListContentResponse
|
||||
*/
|
||||
export type ListSectionsResponse = Message<"homelab.v1.ListSectionsResponse"> & {
|
||||
export type ListContentResponse = Message<"homelab.v1.ListContentResponse"> & {
|
||||
/**
|
||||
* @generated from field: repeated homelab.v1.Section sections = 1;
|
||||
* @generated from field: repeated homelab.v1.Link links = 1;
|
||||
*/
|
||||
sections: Section[];
|
||||
links: Link[];
|
||||
|
||||
/**
|
||||
* @generated from field: repeated homelab.v1.Item monitors = 2;
|
||||
*/
|
||||
monitors: Item[];
|
||||
|
||||
/**
|
||||
* @generated from field: repeated homelab.v1.Item exec = 3;
|
||||
*/
|
||||
exec: Item[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message homelab.v1.ListSectionsResponse.
|
||||
* Use `create(ListSectionsResponseSchema)` to create a new message.
|
||||
* Describes the message homelab.v1.ListContentResponse.
|
||||
* Use `create(ListContentResponseSchema)` to create a new message.
|
||||
*/
|
||||
export const ListSectionsResponseSchema: GenMessage<ListSectionsResponse> = /*@__PURE__*/
|
||||
export const ListContentResponseSchema: GenMessage<ListContentResponse> = /*@__PURE__*/
|
||||
messageDesc(file_homelab_v1_homelab, 3);
|
||||
|
||||
/**
|
||||
* @generated from message homelab.v1.DocMeta
|
||||
*/
|
||||
export type DocMeta = Message<"homelab.v1.DocMeta"> & {
|
||||
/**
|
||||
* @generated from field: string name = 1;
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* sha256 hex of content
|
||||
*
|
||||
* @generated from field: string hash = 2;
|
||||
*/
|
||||
hash: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message homelab.v1.DocMeta.
|
||||
* Use `create(DocMetaSchema)` to create a new message.
|
||||
*/
|
||||
export const DocMetaSchema: GenMessage<DocMeta> = /*@__PURE__*/
|
||||
messageDesc(file_homelab_v1_homelab, 4);
|
||||
|
||||
/**
|
||||
* @generated from message homelab.v1.ListDocsRequest
|
||||
*/
|
||||
export type ListDocsRequest = Message<"homelab.v1.ListDocsRequest"> & {
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message homelab.v1.ListDocsRequest.
|
||||
* Use `create(ListDocsRequestSchema)` to create a new message.
|
||||
*/
|
||||
export const ListDocsRequestSchema: GenMessage<ListDocsRequest> = /*@__PURE__*/
|
||||
messageDesc(file_homelab_v1_homelab, 5);
|
||||
|
||||
/**
|
||||
* @generated from message homelab.v1.ListDocsResponse
|
||||
*/
|
||||
export type ListDocsResponse = Message<"homelab.v1.ListDocsResponse"> & {
|
||||
/**
|
||||
* @generated from field: repeated homelab.v1.DocMeta docs = 1;
|
||||
*/
|
||||
docs: DocMeta[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message homelab.v1.ListDocsResponse.
|
||||
* Use `create(ListDocsResponseSchema)` to create a new message.
|
||||
*/
|
||||
export const ListDocsResponseSchema: GenMessage<ListDocsResponse> = /*@__PURE__*/
|
||||
messageDesc(file_homelab_v1_homelab, 6);
|
||||
|
||||
/**
|
||||
* @generated from message homelab.v1.GetDocRequest
|
||||
*/
|
||||
export type GetDocRequest = Message<"homelab.v1.GetDocRequest"> & {
|
||||
/**
|
||||
* @generated from field: string name = 1;
|
||||
*/
|
||||
name: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message homelab.v1.GetDocRequest.
|
||||
* Use `create(GetDocRequestSchema)` to create a new message.
|
||||
*/
|
||||
export const GetDocRequestSchema: GenMessage<GetDocRequest> = /*@__PURE__*/
|
||||
messageDesc(file_homelab_v1_homelab, 7);
|
||||
|
||||
/**
|
||||
* @generated from message homelab.v1.GetDocResponse
|
||||
*/
|
||||
export type GetDocResponse = Message<"homelab.v1.GetDocResponse"> & {
|
||||
/**
|
||||
* @generated from field: string content = 1;
|
||||
*/
|
||||
content: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message homelab.v1.GetDocResponse.
|
||||
* Use `create(GetDocResponseSchema)` to create a new message.
|
||||
*/
|
||||
export const GetDocResponseSchema: GenMessage<GetDocResponse> = /*@__PURE__*/
|
||||
messageDesc(file_homelab_v1_homelab, 8);
|
||||
|
||||
/**
|
||||
* @generated from message homelab.v1.SaveDocRequest
|
||||
*/
|
||||
export type SaveDocRequest = Message<"homelab.v1.SaveDocRequest"> & {
|
||||
/**
|
||||
* @generated from field: string name = 1;
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* @generated from field: string content = 2;
|
||||
*/
|
||||
content: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message homelab.v1.SaveDocRequest.
|
||||
* Use `create(SaveDocRequestSchema)` to create a new message.
|
||||
*/
|
||||
export const SaveDocRequestSchema: GenMessage<SaveDocRequest> = /*@__PURE__*/
|
||||
messageDesc(file_homelab_v1_homelab, 9);
|
||||
|
||||
/**
|
||||
* @generated from message homelab.v1.SaveDocResponse
|
||||
*/
|
||||
export type SaveDocResponse = Message<"homelab.v1.SaveDocResponse"> & {
|
||||
/**
|
||||
* @generated from field: string hash = 1;
|
||||
*/
|
||||
hash: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes the message homelab.v1.SaveDocResponse.
|
||||
* Use `create(SaveDocResponseSchema)` to create a new message.
|
||||
*/
|
||||
export const SaveDocResponseSchema: GenMessage<SaveDocResponse> = /*@__PURE__*/
|
||||
messageDesc(file_homelab_v1_homelab, 10);
|
||||
|
||||
/**
|
||||
* @generated from message homelab.v1.RunScriptRequest
|
||||
*/
|
||||
@@ -141,7 +266,7 @@ export type RunScriptRequest = Message<"homelab.v1.RunScriptRequest"> & {
|
||||
* Use `create(RunScriptRequestSchema)` to create a new message.
|
||||
*/
|
||||
export const RunScriptRequestSchema: GenMessage<RunScriptRequest> = /*@__PURE__*/
|
||||
messageDesc(file_homelab_v1_homelab, 4);
|
||||
messageDesc(file_homelab_v1_homelab, 11);
|
||||
|
||||
/**
|
||||
* @generated from message homelab.v1.RunScriptResponse
|
||||
@@ -158,19 +283,43 @@ export type RunScriptResponse = Message<"homelab.v1.RunScriptResponse"> & {
|
||||
* Use `create(RunScriptResponseSchema)` to create a new message.
|
||||
*/
|
||||
export const RunScriptResponseSchema: GenMessage<RunScriptResponse> = /*@__PURE__*/
|
||||
messageDesc(file_homelab_v1_homelab, 5);
|
||||
messageDesc(file_homelab_v1_homelab, 12);
|
||||
|
||||
/**
|
||||
* @generated from service homelab.v1.HomelabService
|
||||
*/
|
||||
export const HomelabService: GenService<{
|
||||
/**
|
||||
* @generated from rpc homelab.v1.HomelabService.ListSections
|
||||
* @generated from rpc homelab.v1.HomelabService.ListContent
|
||||
*/
|
||||
listSections: {
|
||||
listContent: {
|
||||
methodKind: "unary";
|
||||
input: typeof ListSectionsRequestSchema;
|
||||
output: typeof ListSectionsResponseSchema;
|
||||
input: typeof ListContentRequestSchema;
|
||||
output: typeof ListContentResponseSchema;
|
||||
},
|
||||
/**
|
||||
* @generated from rpc homelab.v1.HomelabService.ListDocs
|
||||
*/
|
||||
listDocs: {
|
||||
methodKind: "unary";
|
||||
input: typeof ListDocsRequestSchema;
|
||||
output: typeof ListDocsResponseSchema;
|
||||
},
|
||||
/**
|
||||
* @generated from rpc homelab.v1.HomelabService.GetDoc
|
||||
*/
|
||||
getDoc: {
|
||||
methodKind: "unary";
|
||||
input: typeof GetDocRequestSchema;
|
||||
output: typeof GetDocResponseSchema;
|
||||
},
|
||||
/**
|
||||
* @generated from rpc homelab.v1.HomelabService.SaveDoc
|
||||
*/
|
||||
saveDoc: {
|
||||
methodKind: "unary";
|
||||
input: typeof SaveDocRequestSchema;
|
||||
output: typeof SaveDocResponseSchema;
|
||||
},
|
||||
/**
|
||||
* @generated from rpc homelab.v1.HomelabService.RunScript
|
||||
|
||||
Reference in New Issue
Block a user