mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 14:15:24 +00:00
feat: restore the alert feed homepage widget
This commit is contained in:
1 parent
0d94ad5e5f
commit
e1f2cc975d
11 files changed
+319
-5
No files matched your search
@@ -71,6 +71,7 @@ import {
|
||||
} from "./shell-bridge";
|
||||
import { PluginViewPlaceholder } from "./PluginViewPlaceholder";
|
||||
import { resolveLayoutTabTarget } from "@/shell/shell-layout";
|
||||
import { getExtension, listExtensions } from "./extension-registry";
|
||||
import type { WorkspaceTabSnapshot } from "@/types/ui-types";
|
||||
|
||||
function recordingShell(calls: ShellCall[]): TabShellCallbacks {
|
||||
@@ -236,6 +237,8 @@ export async function renderPlugin(
|
||||
mine(hostEditorSectionList()).map((section) => section.id),
|
||||
dashboardCards: () =>
|
||||
mine(registeredDashboardCardList()).map((card) => card.id),
|
||||
extensions: (pointId) =>
|
||||
mine(listExtensions(pointId)).map((extension) => extension.id),
|
||||
settingsComponents: () =>
|
||||
listSettingsComponents()
|
||||
.filter((key) => key.startsWith(`${pluginId}:`))
|
||||
@@ -318,6 +321,16 @@ export async function renderPlugin(
|
||||
);
|
||||
},
|
||||
|
||||
renderExtension(pointId, id, component = "view", props = {}) {
|
||||
const extension = getExtension(pointId, id);
|
||||
const Component =
|
||||
extension?.pluginId === pluginId
|
||||
? extension.components?.[component]
|
||||
: undefined;
|
||||
if (!Component) missing(`an extension "${component}" component`, id);
|
||||
return wrap(<Component {...props} />);
|
||||
},
|
||||
|
||||
renderDashboardCard(id) {
|
||||
const card = getRegisteredDashboardCard(id) ?? missing("a card", id);
|
||||
const Component = card.component;
|
||||
|
||||
Reference in new issue
Block a user