mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 06:35:24 +00:00
feat: move session sharing and collab rooms into a plugin (B12)
This commit is contained in:
1 parent
791d8656a1
commit
a276f6898c
207 files changed
+35771
-11072
No files matched your search
@@ -350,6 +350,26 @@ async function fetchGuestPlugins(): Promise<PluginSummary[]> {
|
||||
return Array.isArray(body) ? (body as PluginSummary[]) : [];
|
||||
}
|
||||
|
||||
let guestViewsRequest: Promise<string[]> | null = null;
|
||||
|
||||
/**
|
||||
* The `?view=` names enabled guest plugins serve to anonymous pages, so the
|
||||
* entry point can tell a guest link from a signed-in full-screen view
|
||||
* without knowing any plugin.
|
||||
*/
|
||||
export function fetchGuestViews(): Promise<string[]> {
|
||||
guestViewsRequest ??= fetchGuestPlugins()
|
||||
.then((plugins) =>
|
||||
plugins.flatMap(
|
||||
(plugin) =>
|
||||
(plugin.contributes as { guestViews?: string[] } | undefined)
|
||||
?.guestViews ?? [],
|
||||
),
|
||||
)
|
||||
.catch(() => []);
|
||||
return guestViewsRequest;
|
||||
}
|
||||
|
||||
async function fetchPreLoginPlugins(): Promise<PluginSummary[]> {
|
||||
const response = await fetch(getBackendUrl("/plugins/public-manifest"));
|
||||
if (!response.ok) return [];
|
||||
|
||||
Reference in new issue
Block a user