feat: expand advanced widget experiences
This commit is contained in:
1 parent
9437d211c8
commit
c099a8eef6
119 files changed
+3624
-844
No files matched your search
@@ -110,3 +110,26 @@ export function createStorageKey(widgetKey: string, integrationId: string, type:
|
||||
const cardKey = widgetKey.includes("-") ? `${widgetKey}-${integrationId}` : widgetKey;
|
||||
return `coolify-${type}-${cardKey}`;
|
||||
}
|
||||
|
||||
interface CoolifySectionOptions {
|
||||
showServers: boolean;
|
||||
showApplications: boolean;
|
||||
showServices: boolean;
|
||||
}
|
||||
|
||||
export function getCoolifySectionVisibility(
|
||||
options: CoolifySectionOptions,
|
||||
displayMode?: "compact" | "advanced",
|
||||
): CoolifySectionOptions {
|
||||
if (displayMode === "advanced") {
|
||||
return { showServers: true, showApplications: true, showServices: true };
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
export function getCoolifyServerState(server: CoolifyServer, field: "is_reachable" | "is_usable"): boolean | undefined {
|
||||
return server[field] ?? server.settings?.[field] ?? undefined;
|
||||
}
|
||||
|
||||
export const isCoolifyServerOnline = (server: CoolifyServer): boolean =>
|
||||
getCoolifyServerState(server, "is_reachable") === true;
|
||||
Reference in new issue
Block a user