diff --git a/ui/console-src/modules/dashboard/widgets/index.ts b/ui/console-src/modules/dashboard/widgets/index.ts index f6f83d80f..f23db03bd 100644 --- a/ui/console-src/modules/dashboard/widgets/index.ts +++ b/ui/console-src/modules/dashboard/widgets/index.ts @@ -3,6 +3,7 @@ import type { DashboardWidgetDefinition } from "@halo-dev/console-shared"; import { markRaw } from "vue"; import CommentStatsWidget from "./presets/comments/CommentStatsWidget.vue"; import PendingCommentsWidget from "./presets/comments/PendingCommentsWidget.vue"; +import IframeWidget from "./presets/core/iframe/IframeWidget.vue"; import QuickActionWidget from "./presets/core/quick-action/QuickActionWidget.vue"; import StackWidget from "./presets/core/stack/StackWidget.vue"; import ViewsStatsWidget from "./presets/core/view-stats/ViewsStatsWidget.vue"; @@ -204,4 +205,31 @@ export const internalWidgetDefinitions: DashboardWidgetDefinition[] = [ minW: 1, }, }, + { + id: "core:iframe", + component: markRaw(IframeWidget), + group: "core.dashboard.widgets.groups.other", + configFormKitSchema: () => [ + { + $formkit: "text", + label: i18n.global.t( + "core.dashboard.widgets.presets.iframe.config.fields.title.label" + ), + name: "title", + }, + { + $formkit: "url", + label: "URL", + name: "url", + validation: "required|url", + }, + ], + defaultConfig: {}, + defaultSize: { + w: 6, + h: 12, + minH: 2, + minW: 2, + }, + }, ]; diff --git a/ui/console-src/modules/dashboard/widgets/presets/core/iframe/IframeWidget.vue b/ui/console-src/modules/dashboard/widgets/presets/core/iframe/IframeWidget.vue new file mode 100644 index 000000000..037d870e8 --- /dev/null +++ b/ui/console-src/modules/dashboard/widgets/presets/core/iframe/IframeWidget.vue @@ -0,0 +1,41 @@ + + + + + + {{ $t("core.dashboard.widgets.presets.iframe.empty.title") }} + + + + + diff --git a/ui/src/locales/_missing_translations_es.yaml b/ui/src/locales/_missing_translations_es.yaml index 573085b30..1be31b092 100644 --- a/ui/src/locales/_missing_translations_es.yaml +++ b/ui/src/locales/_missing_translations_es.yaml @@ -46,6 +46,14 @@ core: title: Pending Comments empty: title: No pending comments + iframe: + title: Iframe + empty: + title: Please enter the URL in the configuration + config: + fields: + title: + label: Title stack: title: Widget Stack operations: diff --git a/ui/src/locales/en.yaml b/ui/src/locales/en.yaml index e10e229ec..8aec99116 100644 --- a/ui/src/locales/en.yaml +++ b/ui/src/locales/en.yaml @@ -116,6 +116,14 @@ core: title: No pending comments views_stats: title: Visits + iframe: + title: Iframe + empty: + title: Please enter the URL in the configuration + config: + fields: + title: + label: Title stack: title: Widget Stack operations: diff --git a/ui/src/locales/zh-CN.yaml b/ui/src/locales/zh-CN.yaml index 848c216a0..7c55fc34a 100644 --- a/ui/src/locales/zh-CN.yaml +++ b/ui/src/locales/zh-CN.yaml @@ -108,6 +108,14 @@ core: title: 新评论 empty: title: 暂无待审核评论 + iframe: + title: 网页嵌入 + empty: + title: 请在配置中输入 URL + config: + fields: + title: + label: 标题 stack: title: 堆叠部件 operations: diff --git a/ui/src/locales/zh-TW.yaml b/ui/src/locales/zh-TW.yaml index 868f94e92..7be903509 100644 --- a/ui/src/locales/zh-TW.yaml +++ b/ui/src/locales/zh-TW.yaml @@ -108,6 +108,14 @@ core: title: 新評論 empty: title: 沒有待審核評論 + iframe: + title: 網頁嵌入 + empty: + title: 請在配置中輸入 URL + config: + fields: + title: + label: 標題 stack: title: 堆疊部件 operations: