@oinone/kunlun-vue-admin-layout 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/oinone-kunlun-vue-admin-layout.css +1 -0
- package/dist/oinone-kunlun-vue-admin-layout.esm.js +12049 -0
- package/dist/oinone-kunlun-vue-admin-layout.scss +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/src/basic/MaskWidget.d.ts +17 -0
- package/dist/types/src/basic/index.d.ts +2 -0
- package/dist/types/src/basic/register/index.d.ts +1 -0
- package/dist/types/src/basic/register/manager.d.ts +7 -0
- package/dist/types/src/basic/token/BaseMaskWidget.d.ts +55 -0
- package/dist/types/src/basic/token/index.d.ts +1 -0
- package/dist/types/src/component/app-switcher/AppSwitcher.vue.d.ts +84 -0
- package/dist/types/src/component/app-switcher/AppSwitcherMask.vue.d.ts +61 -0
- package/dist/types/src/component/app-switcher/AppSwitcherWidget.d.ts +33 -0
- package/dist/types/src/component/app-switcher/index.d.ts +3 -0
- package/dist/types/src/component/breadcrumb/BreadcrumbWidget.d.ts +33 -0
- package/dist/types/src/component/breadcrumb/DefaultBreadcrumb.vue.d.ts +58 -0
- package/dist/types/src/component/breadcrumb/index.d.ts +2 -0
- package/dist/types/src/component/debug/Debug.vue.d.ts +11 -0
- package/dist/types/src/component/debug/DebugWidget.d.ts +8 -0
- package/dist/types/src/component/debug/constants.d.ts +2 -0
- package/dist/types/src/component/debug/index.d.ts +6 -0
- package/dist/types/src/component/debug/spi/DebugMaskEditor.d.ts +6 -0
- package/dist/types/src/component/debug/spi/DebugRouterInitializeService.d.ts +4 -0
- package/dist/types/src/component/debug/spi/index.d.ts +1 -0
- package/dist/types/src/component/debug/typing.d.ts +159 -0
- package/dist/types/src/component/debug/view/DebugMainView.vue.d.ts +28 -0
- package/dist/types/src/component/debug/view/DebugMainViewWidget.d.ts +9 -0
- package/dist/types/src/component/debug/view/components/DebugDefaultInfo.vue.d.ts +22 -0
- package/dist/types/src/component/debug/view/components/DebugJsonView.vue.d.ts +26 -0
- package/dist/types/src/component/debug/view/components/DebugRequestInfoPanel.vue.d.ts +22 -0
- package/dist/types/src/component/debug/view/components/DebugResponsePanel.vue.d.ts +12 -0
- package/dist/types/src/component/debug/view/debug-api/DebugApi.vue.d.ts +52 -0
- package/dist/types/src/component/debug/view/debug-api/DebugApiWidget.d.ts +32 -0
- package/dist/types/src/component/debug/view/debug-utils.d.ts +44 -0
- package/dist/types/src/component/debug/view/debug-view/DebugView.vue.d.ts +78 -0
- package/dist/types/src/component/debug/view/debug-view/DebugViewWidget.d.ts +26 -0
- package/dist/types/src/component/debug/view/index.d.ts +5 -0
- package/dist/types/src/component/debug/view/service/DebugRuntimeContextService.d.ts +18 -0
- package/dist/types/src/component/debug/view/service/DebugStackInfoService.d.ts +27 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugDefaultRuntimeContextService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugRuntimeActionService.d.ts +7 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugRuntimeDslService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugRuntimeFieldService.d.ts +7 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugRuntimeLayoutService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugRuntimeMaskService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugRuntimeTemplateService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugRuntimeViewService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugBizStackService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugConfigureService.d.ts +4 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugDefaultStackInfoService.d.ts +8 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugExceptionStackService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugFunctionService.d.ts +4 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugHalfBizStackService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugModelService.d.ts +4 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugPureBizStackService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugStacktraceGqlRequestContextService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugStacktraceSceneAnalysisService.d.ts +7 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugStacktraceSessionService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/index.d.ts +20 -0
- package/dist/types/src/component/debug/view/storage.d.ts +19 -0
- package/dist/types/src/component/debug/view/useDebugRequestInfo.d.ts +7 -0
- package/dist/types/src/component/divider/Divider.vue.d.ts +2 -0
- package/dist/types/src/component/divider/DividerWidget.d.ts +4 -0
- package/dist/types/src/component/divider/index.d.ts +1 -0
- package/dist/types/src/component/index.d.ts +14 -0
- package/dist/types/src/component/language/DefaultLanguage.vue.d.ts +34 -0
- package/dist/types/src/component/language/LanguageWidget.d.ts +16 -0
- package/dist/types/src/component/language/index.d.ts +1 -0
- package/dist/types/src/component/layout/BaseMaskLayoutWidget.d.ts +4 -0
- package/dist/types/src/component/layout/MaskBlock.vue.d.ts +24 -0
- package/dist/types/src/component/layout/block/MaskBlockWidget.d.ts +4 -0
- package/dist/types/src/component/layout/block/index.d.ts +1 -0
- package/dist/types/src/component/layout/container/MaskContainerWidget.d.ts +4 -0
- package/dist/types/src/component/layout/container/index.d.ts +1 -0
- package/dist/types/src/component/layout/content/MaskContentWidget.d.ts +7 -0
- package/dist/types/src/component/layout/content/index.d.ts +1 -0
- package/dist/types/src/component/layout/grid/Grid.vue.d.ts +2 -0
- package/dist/types/src/component/layout/grid/GridWidget.d.ts +9 -0
- package/dist/types/src/component/layout/grid/index.d.ts +1 -0
- package/dist/types/src/component/layout/header/MaskHeaderWidget.d.ts +4 -0
- package/dist/types/src/component/layout/header/index.d.ts +1 -0
- package/dist/types/src/component/layout/index.d.ts +9 -0
- package/dist/types/src/component/layout/mask/MaskRootWidget.d.ts +4 -0
- package/dist/types/src/component/layout/mask/index.d.ts +1 -0
- package/dist/types/src/component/layout/sidebar/MaskSidebarWidget.d.ts +10 -0
- package/dist/types/src/component/layout/sidebar/index.d.ts +1 -0
- package/dist/types/src/component/layout/widget/MaskCommonWidget.d.ts +14 -0
- package/dist/types/src/component/layout/widget/index.d.ts +1 -0
- package/dist/types/src/component/menu/DefaultMenu.vue.d.ts +115 -0
- package/dist/types/src/component/menu/DefaultSubMenu.vue.d.ts +17 -0
- package/dist/types/src/component/menu/MenuWidget.d.ts +71 -0
- package/dist/types/src/component/menu/index.d.ts +3 -0
- package/dist/types/src/component/multi-tabs/MultiTabs.vue.d.ts +151 -0
- package/dist/types/src/component/multi-tabs/MultiTabsWidget.d.ts +60 -0
- package/dist/types/src/component/multi-tabs/index.d.ts +2 -0
- package/dist/types/src/component/multi-tabs/typing.d.ts +6 -0
- package/dist/types/src/component/notification/DefaultNotification.vue.d.ts +61 -0
- package/dist/types/src/component/notification/NotificationWidget.d.ts +139 -0
- package/dist/types/src/component/notification/index.d.ts +2 -0
- package/dist/types/src/component/order-statistic/OrderStatistic.vue.d.ts +8 -0
- package/dist/types/src/component/order-statistic/index.d.ts +14 -0
- package/dist/types/src/component/partner-switcher/PartnerSwitcher.vue.d.ts +28 -0
- package/dist/types/src/component/partner-switcher/PartnerSwitcherWidget.d.ts +15 -0
- package/dist/types/src/component/partner-switcher/index.d.ts +6 -0
- package/dist/types/src/component/partner-switcher/service/PartnerSwitcherService.d.ts +17 -0
- package/dist/types/src/component/partner-switcher/service/impl/PartnerSwitcherServiceImpl.d.ts +17 -0
- package/dist/types/src/component/partner-switcher/service/index.d.ts +2 -0
- package/dist/types/src/component/partner-switcher/session/PartnerInfoSession.d.ts +26 -0
- package/dist/types/src/component/partner-switcher/session/impl/DefaultPartnerInfoSession.d.ts +15 -0
- package/dist/types/src/component/partner-switcher/session/index.d.ts +2 -0
- package/dist/types/src/component/partner-switcher/spi/PartnerSwitcherMaskEditor.d.ts +6 -0
- package/dist/types/src/component/partner-switcher/spi/index.d.ts +1 -0
- package/dist/types/src/component/partner-switcher/typing/index.d.ts +1 -0
- package/dist/types/src/component/partner-switcher/typing/partner.d.ts +20 -0
- package/dist/types/src/component/quick-search/QuickSearch.vue.d.ts +29 -0
- package/dist/types/src/component/quick-search/index.d.ts +24 -0
- package/dist/types/src/component/user/DefaultUser.vue.d.ts +39 -0
- package/dist/types/src/component/user/UserWidget.d.ts +16 -0
- package/dist/types/src/component/user/index.d.ts +1 -0
- package/dist/types/src/config/DebugConfig.d.ts +16 -0
- package/dist/types/src/config/PartnerSwitcherConfig.d.ts +16 -0
- package/dist/types/src/config/index.d.ts +2 -0
- package/dist/types/src/index.d.ts +10 -0
- package/dist/types/src/service/index.d.ts +5 -0
- package/dist/types/src/service/menu-service.d.ts +12 -0
- package/dist/types/src/service/message-service.d.ts +16 -0
- package/dist/types/src/service/module-service.d.ts +7 -0
- package/dist/types/src/service/top-bar-service.d.ts +10 -0
- package/dist/types/src/service/user-service.d.ts +4 -0
- package/dist/types/src/spi/index.d.ts +1 -0
- package/dist/types/src/spi/mask-editor.d.ts +54 -0
- package/dist/types/src/tags/Block.vue.d.ts +5 -0
- package/dist/types/src/tags/Breadcrumb.vue.d.ts +5 -0
- package/dist/types/src/tags/Container.vue.d.ts +5 -0
- package/dist/types/src/tags/Content.vue.d.ts +5 -0
- package/dist/types/src/tags/Header.vue.d.ts +5 -0
- package/dist/types/src/tags/Mask.vue.d.ts +5 -0
- package/dist/types/src/tags/MultiTabs.vue.d.ts +5 -0
- package/dist/types/src/tags/Sidebar.vue.d.ts +5 -0
- package/dist/types/src/tags/Widget.vue.d.ts +5 -0
- package/dist/types/src/tags/context/context.d.ts +8 -0
- package/dist/types/src/tags/context/index.d.ts +1 -0
- package/dist/types/src/tags/index.d.ts +6 -0
- package/dist/types/src/tags/mixin/MaskWidgetTagMixin.d.ts +2 -0
- package/dist/types/src/tags/mixin/index.d.ts +3 -0
- package/dist/types/src/tags/mixin/typing.d.ts +6 -0
- package/dist/types/src/tags/mixin/use-mask-widget-tag.d.ts +38 -0
- package/dist/types/src/tags/register/index.d.ts +1 -0
- package/dist/types/src/tags/register/manager.d.ts +9 -0
- package/dist/types/src/tags/resolve/index.d.ts +2 -0
- package/dist/types/src/tags/resolve/internal/index.d.ts +2 -0
- package/dist/types/src/tags/resolve/internal/typing.d.ts +5 -0
- package/dist/types/src/tags/resolve/internal/widget-resolve.d.ts +3 -0
- package/dist/types/src/tags/resolve/typing.d.ts +26 -0
- package/dist/types/src/tags/resolve/widget-resolve.d.ts +5 -0
- package/dist/types/src/template/default-mask.d.ts +2 -0
- package/dist/types/src/template/index.d.ts +6 -0
- package/dist/types/src/theme/index.d.ts +1 -0
- package/dist/types/src/typing/constant.d.ts +1 -0
- package/dist/types/src/typing/index.d.ts +3 -0
- package/dist/types/src/typing/menu.d.ts +12 -0
- package/dist/types/src/typing/stream-symble.d.ts +12 -0
- package/dist/types/src/util/HomepageUtils.d.ts +3 -0
- package/dist/types/src/util/MenuUtil.d.ts +5 -0
- package/dist/types/src/util/index.d.ts +3 -0
- package/dist/types/src/util/unauthorized-action.d.ts +14 -0
- package/dist/types/src/utils.d.ts +86 -0
- package/index.ts +1 -0
- package/package.json +47 -0
- package/rollup.config.js +33 -0
- package/src/basic/MaskWidget.ts +74 -0
- package/src/basic/index.ts +2 -0
- package/src/basic/register/index.ts +1 -0
- package/src/basic/register/manager.ts +17 -0
- package/src/basic/token/BaseMaskWidget.ts +187 -0
- package/src/basic/token/index.ts +1 -0
- package/src/component/app-switcher/AppSwitcher.vue +133 -0
- package/src/component/app-switcher/AppSwitcherMask.vue +237 -0
- package/src/component/app-switcher/AppSwitcherWidget.ts +152 -0
- package/src/component/app-switcher/index.ts +3 -0
- package/src/component/breadcrumb/BreadcrumbWidget.ts +167 -0
- package/src/component/breadcrumb/DefaultBreadcrumb.vue +95 -0
- package/src/component/breadcrumb/index.ts +2 -0
- package/src/component/debug/Debug.vue +28 -0
- package/src/component/debug/DebugWidget.ts +38 -0
- package/src/component/debug/constants.ts +3 -0
- package/src/component/debug/index.ts +6 -0
- package/src/component/debug/spi/DebugMaskEditor.ts +19 -0
- package/src/component/debug/spi/DebugRouterInitializeService.ts +21 -0
- package/src/component/debug/spi/index.ts +1 -0
- package/src/component/debug/typing.ts +191 -0
- package/src/component/debug/view/DebugMainView.vue +206 -0
- package/src/component/debug/view/DebugMainViewWidget.ts +42 -0
- package/src/component/debug/view/components/DebugDefaultInfo.vue +31 -0
- package/src/component/debug/view/components/DebugJsonView.vue +107 -0
- package/src/component/debug/view/components/DebugRequestInfoPanel.vue +129 -0
- package/src/component/debug/view/components/DebugResponsePanel.vue +66 -0
- package/src/component/debug/view/components/runtime-context/DebugRuntimeFieldComponent.vue +29 -0
- package/src/component/debug/view/debug-api/DebugApi.vue +225 -0
- package/src/component/debug/view/debug-api/DebugApiWidget.ts +400 -0
- package/src/component/debug/view/debug-utils.ts +114 -0
- package/src/component/debug/view/debug-view/DebugView.vue +331 -0
- package/src/component/debug/view/debug-view/DebugViewWidget.ts +181 -0
- package/src/component/debug/view/index.ts +6 -0
- package/src/component/debug/view/service/DebugRuntimeContextService.ts +21 -0
- package/src/component/debug/view/service/DebugStackInfoService.ts +33 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugDefaultRuntimeContextService.ts +16 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugRuntimeActionService.ts +28 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugRuntimeDslService.ts +16 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugRuntimeFieldService.ts +33 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugRuntimeLayoutService.ts +16 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugRuntimeMaskService.ts +30 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugRuntimeTemplateService.ts +16 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugRuntimeViewService.ts +16 -0
- package/src/component/debug/view/service/impl/stack-info/DebugBizStackService.ts +19 -0
- package/src/component/debug/view/service/impl/stack-info/DebugConfigureService.ts +6 -0
- package/src/component/debug/view/service/impl/stack-info/DebugDefaultStackInfoService.ts +62 -0
- package/src/component/debug/view/service/impl/stack-info/DebugExceptionStackService.ts +19 -0
- package/src/component/debug/view/service/impl/stack-info/DebugFunctionService.ts +6 -0
- package/src/component/debug/view/service/impl/stack-info/DebugHalfBizStackService.ts +19 -0
- package/src/component/debug/view/service/impl/stack-info/DebugModelService.ts +6 -0
- package/src/component/debug/view/service/impl/stack-info/DebugPureBizStackService.ts +19 -0
- package/src/component/debug/view/service/impl/stack-info/DebugStacktraceGqlRequestContextService.ts +22 -0
- package/src/component/debug/view/service/impl/stack-info/DebugStacktraceSceneAnalysisService.ts +35 -0
- package/src/component/debug/view/service/impl/stack-info/DebugStacktraceSessionService.ts +19 -0
- package/src/component/debug/view/service/index.ts +22 -0
- package/src/component/debug/view/storage.ts +35 -0
- package/src/component/debug/view/useDebugRequestInfo.ts +17 -0
- package/src/component/divider/Divider.vue +15 -0
- package/src/component/divider/DividerWidget.ts +12 -0
- package/src/component/divider/index.ts +1 -0
- package/src/component/index.ts +15 -0
- package/src/component/language/DefaultLanguage.vue +111 -0
- package/src/component/language/LanguageWidget.ts +72 -0
- package/src/component/language/index.ts +1 -0
- package/src/component/layout/BaseMaskLayoutWidget.ts +12 -0
- package/src/component/layout/MaskBlock.vue +31 -0
- package/src/component/layout/block/MaskBlockWidget.ts +17 -0
- package/src/component/layout/block/index.ts +1 -0
- package/src/component/layout/container/MaskContainerWidget.ts +13 -0
- package/src/component/layout/container/index.ts +1 -0
- package/src/component/layout/content/MaskContentWidget.ts +41 -0
- package/src/component/layout/content/index.ts +1 -0
- package/src/component/layout/grid/Grid.vue +10 -0
- package/src/component/layout/grid/GridWidget.ts +62 -0
- package/src/component/layout/grid/index.ts +1 -0
- package/src/component/layout/header/MaskHeaderWidget.ts +13 -0
- package/src/component/layout/header/index.ts +1 -0
- package/src/component/layout/index.ts +9 -0
- package/src/component/layout/mask/MaskRootWidget.ts +13 -0
- package/src/component/layout/mask/index.ts +1 -0
- package/src/component/layout/sidebar/MaskSidebarWidget.ts +31 -0
- package/src/component/layout/sidebar/index.ts +1 -0
- package/src/component/layout/widget/MaskCommonWidget.ts +95 -0
- package/src/component/layout/widget/index.ts +1 -0
- package/src/component/menu/DefaultMenu.vue +252 -0
- package/src/component/menu/DefaultSubMenu.vue +68 -0
- package/src/component/menu/MenuWidget.ts +349 -0
- package/src/component/menu/index.ts +3 -0
- package/src/component/menu/style/common.scss +411 -0
- package/src/component/menu/style/index.scss +2 -0
- package/src/component/menu/style/menu-theme/index.scss +5 -0
- package/src/component/menu/style/menu-theme/theme2.scss +37 -0
- package/src/component/menu/style/menu-theme/theme3.scss +59 -0
- package/src/component/menu/style/menu-theme/theme4.scss +56 -0
- package/src/component/menu/style/menu-theme/theme5.scss +45 -0
- package/src/component/menu/style/menu-theme/theme6.scss +45 -0
- package/src/component/menu/style/mixin.scss +23 -0
- package/src/component/multi-tabs/MultiTabs.vue +475 -0
- package/src/component/multi-tabs/MultiTabsWidget.ts +450 -0
- package/src/component/multi-tabs/index.ts +2 -0
- package/src/component/multi-tabs/style/index.scss +217 -0
- package/src/component/multi-tabs/style/mixin.scss +13 -0
- package/src/component/multi-tabs/style/parameters.scss +2 -0
- package/src/component/multi-tabs/style/theme1.scss +92 -0
- package/src/component/multi-tabs/style/theme2.scss +89 -0
- package/src/component/multi-tabs/style/theme3.scss +60 -0
- package/src/component/multi-tabs/style/theme4.scss +85 -0
- package/src/component/multi-tabs/typing.ts +7 -0
- package/src/component/notification/DefaultNotification.vue +455 -0
- package/src/component/notification/NotificationWidget.ts +332 -0
- package/src/component/notification/index.ts +2 -0
- package/src/component/order-statistic/OrderStatistic.vue +12 -0
- package/src/component/order-statistic/index.ts +146 -0
- package/src/component/partner-switcher/PartnerSwitcher.vue +75 -0
- package/src/component/partner-switcher/PartnerSwitcherWidget.ts +70 -0
- package/src/component/partner-switcher/index.ts +6 -0
- package/src/component/partner-switcher/service/PartnerSwitcherService.ts +20 -0
- package/src/component/partner-switcher/service/impl/PartnerSwitcherServiceImpl.ts +48 -0
- package/src/component/partner-switcher/service/index.ts +2 -0
- package/src/component/partner-switcher/session/PartnerInfoSession.ts +32 -0
- package/src/component/partner-switcher/session/impl/DefaultPartnerInfoSession.ts +46 -0
- package/src/component/partner-switcher/session/index.ts +2 -0
- package/src/component/partner-switcher/spi/PartnerSwitcherMaskEditor.ts +24 -0
- package/src/component/partner-switcher/spi/index.ts +1 -0
- package/src/component/partner-switcher/typing/index.ts +1 -0
- package/src/component/partner-switcher/typing/partner.ts +22 -0
- package/src/component/quick-search/QuickSearch.vue +34 -0
- package/src/component/quick-search/index.ts +237 -0
- package/src/component/style/index.scss +4 -0
- package/src/component/style/layout.scss +229 -0
- package/src/component/user/DefaultUser.vue +92 -0
- package/src/component/user/UserWidget.ts +129 -0
- package/src/component/user/index.ts +1 -0
- package/src/config/DebugConfig.ts +30 -0
- package/src/config/PartnerSwitcherConfig.ts +30 -0
- package/src/config/index.ts +2 -0
- package/src/index.ts +11 -0
- package/src/service/index.ts +5 -0
- package/src/service/menu-service.ts +105 -0
- package/src/service/message-service.ts +65 -0
- package/src/service/module-service.ts +69 -0
- package/src/service/top-bar-service.ts +144 -0
- package/src/service/user-service.ts +10 -0
- package/src/shim-translate.d.ts +7 -0
- package/src/shim-vue.d.ts +6 -0
- package/src/spi/index.ts +1 -0
- package/src/spi/mask-editor.ts +102 -0
- package/src/tags/Block.vue +16 -0
- package/src/tags/Breadcrumb.vue +16 -0
- package/src/tags/Container.vue +16 -0
- package/src/tags/Content.vue +16 -0
- package/src/tags/Header.vue +16 -0
- package/src/tags/Mask.vue +16 -0
- package/src/tags/MultiTabs.vue +16 -0
- package/src/tags/Sidebar.vue +16 -0
- package/src/tags/Widget.vue +16 -0
- package/src/tags/context/context.ts +24 -0
- package/src/tags/context/index.ts +1 -0
- package/src/tags/index.ts +48 -0
- package/src/tags/mixin/MaskWidgetTagMixin.ts +79 -0
- package/src/tags/mixin/index.ts +3 -0
- package/src/tags/mixin/typing.ts +8 -0
- package/src/tags/mixin/use-mask-widget-tag.ts +172 -0
- package/src/tags/register/index.ts +1 -0
- package/src/tags/register/manager.ts +43 -0
- package/src/tags/resolve/index.ts +2 -0
- package/src/tags/resolve/internal/index.ts +2 -0
- package/src/tags/resolve/internal/typing.ts +6 -0
- package/src/tags/resolve/internal/widget-resolve.ts +57 -0
- package/src/tags/resolve/typing.ts +39 -0
- package/src/tags/resolve/widget-resolve.ts +64 -0
- package/src/template/default-mask.ts +51 -0
- package/src/template/index.ts +26 -0
- package/src/theme/index.ts +1 -0
- package/src/typing/constant.ts +3 -0
- package/src/typing/index.ts +3 -0
- package/src/typing/menu.ts +15 -0
- package/src/typing/stream-symble.ts +14 -0
- package/src/util/HomepageUtils.ts +41 -0
- package/src/util/MenuUtil.ts +18 -0
- package/src/util/index.ts +3 -0
- package/src/util/unauthorized-action.ts +98 -0
- package/src/utils.ts +716 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { RedirectTargetEnum } from '@oinone/kunlun-engine';
|
|
2
|
+
import { Router } from '@oinone/kunlun-router';
|
|
3
|
+
import { SPI } from '@oinone/kunlun-spi';
|
|
4
|
+
import { useRouter } from '@oinone/kunlun-vue-router';
|
|
5
|
+
import { Widget } from '@oinone/kunlun-vue-widget';
|
|
6
|
+
import { MaskWidget } from '../../basic';
|
|
7
|
+
import { DEBUG_ROUTER } from './constants';
|
|
8
|
+
import Debug from './Debug.vue';
|
|
9
|
+
|
|
10
|
+
@SPI.ClassFactory(MaskWidget.Token({ widget: 'debug' }))
|
|
11
|
+
export class DebugWidget extends MaskWidget {
|
|
12
|
+
protected router!: Router;
|
|
13
|
+
|
|
14
|
+
public initialize(props) {
|
|
15
|
+
super.initialize(props);
|
|
16
|
+
this.setComponent(Debug);
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Widget.Method()
|
|
21
|
+
public onClick() {
|
|
22
|
+
this.router.push(
|
|
23
|
+
{
|
|
24
|
+
segments: [
|
|
25
|
+
{
|
|
26
|
+
path: DEBUG_ROUTER,
|
|
27
|
+
extra: { preserveParameter: true }
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
RedirectTargetEnum.BLANK
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
protected beforeCreated() {
|
|
36
|
+
this.router = useRouter().router;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DslDefinition } from '@oinone/kunlun-dsl';
|
|
2
|
+
import { SPI } from '@oinone/kunlun-spi';
|
|
3
|
+
import { DebugConfigManager } from '../../../config';
|
|
4
|
+
import { MaskEditor, MaskEditorContext, MaskEditorToken, MaskEditService, MaskEditServiceToken } from '../../../spi';
|
|
5
|
+
|
|
6
|
+
@SPI.Service(MaskEditorToken, { priority: 1000 })
|
|
7
|
+
export class DebugMaskEditor implements MaskEditor {
|
|
8
|
+
@SPI.Autowired(MaskEditServiceToken)
|
|
9
|
+
private maskEditService!: MaskEditService;
|
|
10
|
+
|
|
11
|
+
public edit(context: Readonly<MaskEditorContext>, dsl: DslDefinition): DslDefinition {
|
|
12
|
+
if (DebugConfigManager.isEnabled()) {
|
|
13
|
+
this.maskEditService
|
|
14
|
+
.findTopBarWidgets(dsl)
|
|
15
|
+
?.splice(0, 0, this.maskEditService.generatorWidget('debug'), this.maskEditService.generatorDivider());
|
|
16
|
+
}
|
|
17
|
+
return dsl;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FrameworkInitializeService, FrameworkInitializeSPI, OioProviderProps } from '@oinone/kunlun-engine';
|
|
2
|
+
import { SPIFactory } from '@oinone/kunlun-spi';
|
|
3
|
+
import { DebugConfigManager } from '../../../config';
|
|
4
|
+
import { DEBUG_ROUTER, DEBUG_VIEW_WIDGET } from '../constants';
|
|
5
|
+
|
|
6
|
+
@SPIFactory.Register(FrameworkInitializeSPI.Token({ framework: 'vue', isMobile: false, priority: 200 }))
|
|
7
|
+
export class DebugRouterInitializeService implements FrameworkInitializeService {
|
|
8
|
+
public before(props: OioProviderProps) {
|
|
9
|
+
if (DebugConfigManager.isEnabled()) {
|
|
10
|
+
let { router } = props;
|
|
11
|
+
if (!router) {
|
|
12
|
+
router = [];
|
|
13
|
+
props.router = router;
|
|
14
|
+
}
|
|
15
|
+
router.push({
|
|
16
|
+
path: `/${DEBUG_ROUTER}`,
|
|
17
|
+
widget: DEBUG_VIEW_WIDGET
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DebugRouterInitializeService';
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { ILevel } from '@oinone/kunlun-request';
|
|
2
|
+
import { OperationTypeNode } from 'graphql';
|
|
3
|
+
import { Component } from 'vue';
|
|
4
|
+
|
|
5
|
+
export interface DebugFetchRequest {
|
|
6
|
+
url: string;
|
|
7
|
+
body: RequestInit;
|
|
8
|
+
level: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type RequestResolveResult = Omit<DebugFetchRequest, 'level'>;
|
|
12
|
+
|
|
13
|
+
export interface DebugErrorPanel {
|
|
14
|
+
key: string;
|
|
15
|
+
title: string;
|
|
16
|
+
message?: string;
|
|
17
|
+
stackInfo?: string;
|
|
18
|
+
component?: Component;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type DebugErrorAnalysisResult = Omit<DebugErrorPanel, 'key'> & Record<string, unknown>;
|
|
22
|
+
|
|
23
|
+
export interface DebugRequestFunction {
|
|
24
|
+
key: string;
|
|
25
|
+
gqlIndex: number;
|
|
26
|
+
method: OperationTypeNode;
|
|
27
|
+
namespace: string;
|
|
28
|
+
name: string;
|
|
29
|
+
args?: string[];
|
|
30
|
+
responseData?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface DebugRequestGraphQLInfo {
|
|
34
|
+
/**
|
|
35
|
+
* key
|
|
36
|
+
*/
|
|
37
|
+
key: string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* tab title
|
|
41
|
+
*/
|
|
42
|
+
title: string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* gql
|
|
46
|
+
*/
|
|
47
|
+
gql: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* variables
|
|
51
|
+
*/
|
|
52
|
+
variables?: string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 已处理异常
|
|
56
|
+
*/
|
|
57
|
+
handledExceptions?: DebugErrorPanel[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface DebugRequestGQLBody {
|
|
61
|
+
operationName?: string;
|
|
62
|
+
|
|
63
|
+
query?: string;
|
|
64
|
+
|
|
65
|
+
variables?: Record<string, unknown>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface DebugRequestInfo {
|
|
69
|
+
/**
|
|
70
|
+
* 请求URL
|
|
71
|
+
*/
|
|
72
|
+
url?: string;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* debug请求URL
|
|
76
|
+
*/
|
|
77
|
+
debugUrl?: string;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 请求方式
|
|
81
|
+
*/
|
|
82
|
+
method?: string;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 请求函数
|
|
86
|
+
*/
|
|
87
|
+
functions?: DebugRequestFunction[];
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 完整请求时间
|
|
91
|
+
*/
|
|
92
|
+
allDuration?: number;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 连接时间
|
|
96
|
+
*/
|
|
97
|
+
connectDuration?: number;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* 请求时间
|
|
101
|
+
*/
|
|
102
|
+
requestDuration?: number;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 响应时间
|
|
106
|
+
*/
|
|
107
|
+
responseDuration?: number;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* 异常编码
|
|
111
|
+
*/
|
|
112
|
+
errorCode?: string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* 异常信息
|
|
116
|
+
*/
|
|
117
|
+
errorMessage?: string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* 请求头
|
|
121
|
+
*/
|
|
122
|
+
header?: string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* GraphQL信息
|
|
126
|
+
*/
|
|
127
|
+
gqlInfos?: DebugRequestGraphQLInfo[];
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* 已处理异常
|
|
131
|
+
*/
|
|
132
|
+
handledExceptions?: DebugErrorPanel[];
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface DebugFetchResponse {
|
|
136
|
+
data?: string | null;
|
|
137
|
+
hint?: string | null;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface DebugResponseData {
|
|
141
|
+
data: {
|
|
142
|
+
[namespace: string]: {
|
|
143
|
+
[name: string]: unknown;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
errors?: DebugResponseError[];
|
|
147
|
+
extensions?: {
|
|
148
|
+
debug?: DebugResponseError[];
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface DebugResponseError {
|
|
153
|
+
message?: string;
|
|
154
|
+
extensions?: {
|
|
155
|
+
errorCode?: string;
|
|
156
|
+
errorType?: string;
|
|
157
|
+
extra?: string;
|
|
158
|
+
level?: ILevel;
|
|
159
|
+
messages?: {
|
|
160
|
+
level?: ILevel;
|
|
161
|
+
errorType?: string;
|
|
162
|
+
errorCode?: string;
|
|
163
|
+
message?: string;
|
|
164
|
+
}[];
|
|
165
|
+
extend?: string;
|
|
166
|
+
stackTraceKey?: string;
|
|
167
|
+
stackTraceMsg?: string;
|
|
168
|
+
classification?: string;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface DebugFieldWidgetGroup {
|
|
173
|
+
model: string;
|
|
174
|
+
fields: DebugFieldWidget[];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface DebugFieldWidget {
|
|
178
|
+
dsl: string;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export const DebugInfoProps = {
|
|
182
|
+
title: {
|
|
183
|
+
type: String
|
|
184
|
+
},
|
|
185
|
+
message: {
|
|
186
|
+
type: String
|
|
187
|
+
},
|
|
188
|
+
stackInfo: {
|
|
189
|
+
type: String
|
|
190
|
+
}
|
|
191
|
+
};
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="oio-debug-main-view">
|
|
3
|
+
<div class="oio-debug-main-view-toolbar">
|
|
4
|
+
<a-tooltip title="包含页面调试数据和接口调试数据">
|
|
5
|
+
<oio-button type="primary" @click="onDownload">下载全部调试数据</oio-button>
|
|
6
|
+
</a-tooltip>
|
|
7
|
+
<oio-button type="primary" @click="onImport">导入调试数据</oio-button>
|
|
8
|
+
<input id="import-debug-info" type="file" style="display: none" accept=".json,application/json" />
|
|
9
|
+
</div>
|
|
10
|
+
<oio-tabs :activeKey="activeDebugTab" @update:active-key="changeActiveDebugTab">
|
|
11
|
+
<oio-tab tab="页面调试" key="debugView" force-render>
|
|
12
|
+
<slot name="debugView" />
|
|
13
|
+
</oio-tab>
|
|
14
|
+
<oio-tab tab="接口调试" key="debugApi" force-render>
|
|
15
|
+
<slot name="debugApi" />
|
|
16
|
+
</oio-tab>
|
|
17
|
+
</oio-tabs>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import { RuntimeContext } from '@oinone/kunlun-engine';
|
|
22
|
+
import {
|
|
23
|
+
CleanableEvent,
|
|
24
|
+
OioButton,
|
|
25
|
+
OioTab,
|
|
26
|
+
OioTabs,
|
|
27
|
+
Optional,
|
|
28
|
+
uniqueKeyGenerator,
|
|
29
|
+
useCleanableEvent
|
|
30
|
+
} from '@oinone/kunlun-vue-ui-antd';
|
|
31
|
+
import { defineComponent, onMounted, onUnmounted, PropType } from 'vue';
|
|
32
|
+
import 'vue-json-pretty/lib/styles.css';
|
|
33
|
+
import { DebugResponseData } from '../typing';
|
|
34
|
+
import { DebugUtils } from './debug-utils';
|
|
35
|
+
|
|
36
|
+
export default defineComponent({
|
|
37
|
+
name: 'DebugMainView',
|
|
38
|
+
components: {
|
|
39
|
+
OioButton,
|
|
40
|
+
OioTabs,
|
|
41
|
+
OioTab
|
|
42
|
+
},
|
|
43
|
+
inheritAttrs: false,
|
|
44
|
+
props: {
|
|
45
|
+
activeDebugTab: {
|
|
46
|
+
type: String
|
|
47
|
+
},
|
|
48
|
+
changeActiveDebugTab: {
|
|
49
|
+
type: Function
|
|
50
|
+
},
|
|
51
|
+
responseAnalysis: {
|
|
52
|
+
type: Function as PropType<(responseBody: DebugResponseData | DebugResponseData[]) => Promise<string>>
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
setup(props) {
|
|
56
|
+
let importChangeEvent: CleanableEvent | undefined;
|
|
57
|
+
|
|
58
|
+
const getDownloadResponseData = () => {
|
|
59
|
+
const { pageParameters, viewAction, requestInfo, responseData, runtimeContext } = DebugUtils.getDebugStorage();
|
|
60
|
+
try {
|
|
61
|
+
return DebugUtils.toJSONString({
|
|
62
|
+
...DebugUtils.generatorDownloadRequestInfo(requestInfo, responseData),
|
|
63
|
+
pageParameters,
|
|
64
|
+
viewAction,
|
|
65
|
+
runtimeContext: Optional.ofNullable(runtimeContext)
|
|
66
|
+
.map<RuntimeContext | string>((v) => DebugUtils.simplifyRuntimeContext(v))
|
|
67
|
+
.orElse('no runtime context')
|
|
68
|
+
});
|
|
69
|
+
} catch (e) {
|
|
70
|
+
return DebugUtils.toJSONString({
|
|
71
|
+
...requestInfo,
|
|
72
|
+
responseData,
|
|
73
|
+
pageParameters,
|
|
74
|
+
viewAction,
|
|
75
|
+
runtimeContext: Optional.ofNullable(runtimeContext)
|
|
76
|
+
.map<RuntimeContext | string>((v) => DebugUtils.simplifyRuntimeContext(v))
|
|
77
|
+
.orElse('no runtime context')
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const getDownloadFilename = () => {
|
|
83
|
+
return `oinone_all_debug_${uniqueKeyGenerator()}.json`;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const onDownload = () => {
|
|
87
|
+
DebugUtils.downloadJSON(getDownloadResponseData(), getDownloadFilename());
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const onImport = () => {
|
|
91
|
+
importChangeEvent?.el?.click();
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
onMounted(() => {
|
|
95
|
+
const reader = new FileReader();
|
|
96
|
+
|
|
97
|
+
const fileInput = document.getElementById('import-debug-info');
|
|
98
|
+
if (!fileInput) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
importChangeEvent = useCleanableEvent(fileInput, 'change', (e: any) => {
|
|
103
|
+
const file = e.target?.files[0];
|
|
104
|
+
if (!file) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
e.target.value = null;
|
|
108
|
+
|
|
109
|
+
reader.onload = async (e) => {
|
|
110
|
+
const content = e.target?.result;
|
|
111
|
+
if (!content) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
try {
|
|
115
|
+
const storage = DebugUtils.getDebugStorage();
|
|
116
|
+
const data = JSON.parse(content as string);
|
|
117
|
+
const { responseData, pageParameters, viewAction, runtimeContext, errors } = data;
|
|
118
|
+
if (!responseData && !pageParameters && !viewAction && !runtimeContext && errors) {
|
|
119
|
+
await props.responseAnalysis?.(data);
|
|
120
|
+
storage.forceUpdate();
|
|
121
|
+
} else {
|
|
122
|
+
storage.requestInfo = data;
|
|
123
|
+
if (responseData && typeof responseData === 'string') {
|
|
124
|
+
storage.responseData = responseData;
|
|
125
|
+
}
|
|
126
|
+
if (pageParameters && typeof pageParameters !== 'string') {
|
|
127
|
+
storage.pageParameters = pageParameters;
|
|
128
|
+
}
|
|
129
|
+
if (viewAction && typeof viewAction !== 'string') {
|
|
130
|
+
storage.viewAction = viewAction;
|
|
131
|
+
}
|
|
132
|
+
if (runtimeContext && typeof runtimeContext !== 'string') {
|
|
133
|
+
storage.runtimeContext = runtimeContext;
|
|
134
|
+
}
|
|
135
|
+
storage.forceUpdate();
|
|
136
|
+
}
|
|
137
|
+
} catch (e) {
|
|
138
|
+
console.error('Error parse JSON.', e);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
reader.readAsText(file);
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
onUnmounted(() => {
|
|
147
|
+
importChangeEvent?.remove();
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
onDownload,
|
|
152
|
+
onImport
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
</script>
|
|
157
|
+
<style lang="scss">
|
|
158
|
+
$textareaMinHeight: 300px;
|
|
159
|
+
$responseDataMinHeight: 372px;
|
|
160
|
+
$tabMinHeight: 404px;
|
|
161
|
+
$errorTabMinHeight: 404px;
|
|
162
|
+
|
|
163
|
+
.oio-debug-main-view {
|
|
164
|
+
padding: 24px;
|
|
165
|
+
min-width: 1280px;
|
|
166
|
+
min-height: 100vh;
|
|
167
|
+
background-color: #f3f7fa;
|
|
168
|
+
display: flex;
|
|
169
|
+
flex-direction: column;
|
|
170
|
+
row-gap: 24px;
|
|
171
|
+
|
|
172
|
+
&-toolbar {
|
|
173
|
+
text-align: right;
|
|
174
|
+
|
|
175
|
+
.oio-button:not(:last-child) {
|
|
176
|
+
margin-right: var(--oio-margin);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.oio-debug-error-text {
|
|
181
|
+
color: red;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.oio-debug-textarea {
|
|
185
|
+
min-height: $textareaMinHeight;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.oio-debug-tabs {
|
|
189
|
+
.oio-tab-content {
|
|
190
|
+
min-height: $tabMinHeight;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.vjs-tree {
|
|
195
|
+
max-height: 500px;
|
|
196
|
+
overflow-y: auto;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.oio-debug-error-tabs {
|
|
200
|
+
.oio-tab-content {
|
|
201
|
+
height: $tabMinHeight;
|
|
202
|
+
overflow-y: auto;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
</style>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { SPI } from '@oinone/kunlun-spi';
|
|
2
|
+
import { RouterWidget } from '@oinone/kunlun-vue-router';
|
|
3
|
+
import { Widget } from '@oinone/kunlun-vue-widget';
|
|
4
|
+
import { DEBUG_VIEW_WIDGET } from '../constants';
|
|
5
|
+
import { DebugResponseData } from '../typing';
|
|
6
|
+
import { DebugApiWidget } from './debug-api/DebugApiWidget';
|
|
7
|
+
import { DebugUtils } from './debug-utils';
|
|
8
|
+
import { DebugViewWidget } from './debug-view/DebugViewWidget';
|
|
9
|
+
import DebugMainView from './DebugMainView.vue';
|
|
10
|
+
|
|
11
|
+
@SPI.ClassFactory(RouterWidget.Token({ widget: DEBUG_VIEW_WIDGET }))
|
|
12
|
+
export class DebugMainViewWidget extends RouterWidget {
|
|
13
|
+
public initialize(props) {
|
|
14
|
+
super.initialize(props);
|
|
15
|
+
this.setComponent(DebugMainView);
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@Widget.Provide()
|
|
20
|
+
@Widget.Reactive()
|
|
21
|
+
protected activeDebugTab = 'debugView';
|
|
22
|
+
|
|
23
|
+
@Widget.Method()
|
|
24
|
+
protected changeActiveDebugTab(activeDebugTab: string) {
|
|
25
|
+
this.activeDebugTab = activeDebugTab;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@Widget.Method()
|
|
29
|
+
protected async responseAnalysis(responseBody: DebugResponseData | DebugResponseData[]) {
|
|
30
|
+
const debugApiWidget = this.getChildrenInstance().find((v) => v instanceof DebugApiWidget) as DebugApiWidget;
|
|
31
|
+
if (debugApiWidget) {
|
|
32
|
+
await debugApiWidget.resetInfo();
|
|
33
|
+
DebugUtils.getDebugStorage().responseData = await debugApiWidget.responseAnalysis(responseBody);
|
|
34
|
+
DebugUtils.getDebugStorage().forceUpdate();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
protected created() {
|
|
39
|
+
this.createWidget(DebugViewWidget, 'debugView');
|
|
40
|
+
this.createWidget(DebugApiWidget, 'debugApi');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<oio-form>
|
|
3
|
+
<oio-form-item label="诊断内容">
|
|
4
|
+
<span>{{ message }}</span>
|
|
5
|
+
</oio-form-item>
|
|
6
|
+
<oio-form-item label="诊断信息">
|
|
7
|
+
<debug-json-view v-if="stackInfo" :text="stackInfo" text-class="oio-debug-textarea" />
|
|
8
|
+
<span v-else>未返回诊断信息</span>
|
|
9
|
+
</oio-form-item>
|
|
10
|
+
</oio-form>
|
|
11
|
+
</template>
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { OioForm, OioFormItem, OioTextarea } from '@oinone/kunlun-vue-ui-antd';
|
|
14
|
+
import { defineComponent } from 'vue';
|
|
15
|
+
import { DebugInfoProps } from '../../typing';
|
|
16
|
+
import DebugJsonView from '../components/DebugJsonView.vue';
|
|
17
|
+
|
|
18
|
+
export default defineComponent({
|
|
19
|
+
name: 'DebugDefaultInfo',
|
|
20
|
+
components: {
|
|
21
|
+
OioForm,
|
|
22
|
+
OioFormItem,
|
|
23
|
+
OioTextarea,
|
|
24
|
+
DebugJsonView
|
|
25
|
+
},
|
|
26
|
+
inheritAttrs: false,
|
|
27
|
+
props: {
|
|
28
|
+
...DebugInfoProps
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="debug-json-view">
|
|
3
|
+
<oio-button
|
|
4
|
+
class="debug-json-view-btn"
|
|
5
|
+
type="primary"
|
|
6
|
+
size="small"
|
|
7
|
+
icon="oinone-code-mode"
|
|
8
|
+
@click="onShowJSONDialog"
|
|
9
|
+
>JSON视图
|
|
10
|
+
</oio-button>
|
|
11
|
+
<oio-textarea :class="textClass" :value="text" />
|
|
12
|
+
<a-modal
|
|
13
|
+
v-if="showJSONDialog"
|
|
14
|
+
v-model:visible="showJSONDialog"
|
|
15
|
+
width="100%"
|
|
16
|
+
wrap-class-name="full-modal"
|
|
17
|
+
:title="null"
|
|
18
|
+
:footer="null"
|
|
19
|
+
@cancel="onCancel"
|
|
20
|
+
>
|
|
21
|
+
<vue-json-pretty :data="debugJSONObject" v-bind="vueJsonPrettyConfig" />
|
|
22
|
+
</a-modal>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
<script lang="ts">
|
|
26
|
+
import { OioButton, OioTextarea } from '@oinone/kunlun-vue-ui-antd';
|
|
27
|
+
import { isArrayLikeObject, isObject, isString } from 'lodash-es';
|
|
28
|
+
import { defineComponent, ref } from 'vue';
|
|
29
|
+
import VueJsonPretty from 'vue-json-pretty';
|
|
30
|
+
import { DebugUtils } from '../debug-utils';
|
|
31
|
+
|
|
32
|
+
export default defineComponent({
|
|
33
|
+
components: {
|
|
34
|
+
OioButton,
|
|
35
|
+
OioTextarea,
|
|
36
|
+
VueJsonPretty
|
|
37
|
+
},
|
|
38
|
+
inheritAttrs: false,
|
|
39
|
+
props: {
|
|
40
|
+
text: {
|
|
41
|
+
type: [String, Object, Array]
|
|
42
|
+
},
|
|
43
|
+
textClass: {
|
|
44
|
+
type: String
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
setup(props) {
|
|
48
|
+
const showJSONDialog = ref(false);
|
|
49
|
+
const debugJSONObject = ref({});
|
|
50
|
+
const buildDebugJSONObject = () => {
|
|
51
|
+
if (isString(props.text) && (props.text.startsWith('{') || props.text.startsWith('['))) {
|
|
52
|
+
return DebugUtils.toJSONObject(props.text);
|
|
53
|
+
}
|
|
54
|
+
if (isObject(props.text) || isArrayLikeObject(props.text)) {
|
|
55
|
+
return props.text;
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const vueJsonPrettyConfig = { showIcon: true, showLength: true, showLineNumber: true };
|
|
61
|
+
|
|
62
|
+
function onShowJSONDialog() {
|
|
63
|
+
debugJSONObject.value = buildDebugJSONObject();
|
|
64
|
+
showJSONDialog.value = true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function onCancel() {
|
|
68
|
+
debugJSONObject.value = {};
|
|
69
|
+
showJSONDialog.value = false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return { showJSONDialog, vueJsonPrettyConfig, debugJSONObject, onShowJSONDialog, onCancel };
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
</script>
|
|
76
|
+
<style lang="scss">
|
|
77
|
+
.debug-json-view {
|
|
78
|
+
position: relative;
|
|
79
|
+
|
|
80
|
+
&-btn {
|
|
81
|
+
position: absolute;
|
|
82
|
+
right: 10px;
|
|
83
|
+
top: 10px;
|
|
84
|
+
z-index: 99;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.full-modal {
|
|
89
|
+
.ant-modal {
|
|
90
|
+
max-width: 100%;
|
|
91
|
+
top: 0;
|
|
92
|
+
padding-bottom: 0;
|
|
93
|
+
margin: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.ant-modal-content {
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
height: calc(100vh);
|
|
100
|
+
overflow: auto;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.ant-modal-body {
|
|
104
|
+
flex: 1;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
</style>
|