history.push('/')}>\n 返回首页\n \n }\n />\n )) ||\n // normal render\n props.children\n);\n\nexport default Exception;\n","// @ts-nocheck\n// This file is generated by Umi automatically\n// DO NOT CHANGE IT MANUALLY!\nimport React from 'react';\nimport { Avatar, version, Dropdown, Menu, Spin } from 'antd';\nimport { LogoutOutlined } from '/home/runner/work/rustdesk-server-pro/rustdesk-server-pro/web_hbbs/node_modules/@umijs/plugins/node_modules/@ant-design/icons';\nimport { SelectLang } from '@@/plugin-locale';\n\nexport function getRightRenderContent (opts: {\n runtimeConfig: any,\n loading: boolean,\n initialState: any,\n setInitialState: any,\n }) {\n if (opts.runtimeConfig.rightRender) {\n return opts.runtimeConfig.rightRender(\n opts.initialState,\n opts.setInitialState,\n opts.runtimeConfig,\n );\n }\n\n const showAvatar = opts.initialState?.avatar || opts.initialState?.name || opts.runtimeConfig.logout;\n const disableAvatarImg = opts.initialState?.avatar === false;\n const nameClassName = disableAvatarImg ? 'umi-plugin-layout-name umi-plugin-layout-hide-avatar-img' : 'umi-plugin-layout-name';\n const avatar =\n showAvatar ? (\n \n {!disableAvatarImg ?\n (\n \n ) : null}\n {opts.initialState?.name}\n \n ) : null;\n\n\n if (opts.loading) {\n return (\n \n \n
\n );\n }\n\n // 如果没有打开Locale,并且头像为空就取消掉这个返回的内容\n\n const langMenu = {\n className: \"umi-plugin-layout-menu\",\n selectedKeys: [],\n items: [\n {\n key: \"logout\",\n label: (\n <>\n \n 退出登录\n >\n ),\n onClick: () => {\n opts?.runtimeConfig?.logout?.(opts.initialState);\n },\n },\n ],\n };\n // antd@5 和 4.24 之后推荐使用 menu,性能更好\n let dropdownProps;\n if (version.startsWith(\"5.\") || version.startsWith(\"4.24.\")) {\n dropdownProps = { menu: langMenu };\n } else if (version.startsWith(\"3.\")) {\n dropdownProps = {\n overlay: (\n \n ),\n };\n } else { // 需要 antd 4.20.0 以上版本\n dropdownProps = { overlay: };\n }\n\n\n\n return (\n \n {opts.runtimeConfig.logout ? (\n \n {avatar}\n \n ) : (\n avatar\n )}\n \n
\n );\n}\n","// @ts-nocheck\n// This file is generated by Umi automatically\n// DO NOT CHANGE IT MANUALLY!\n/// \n/// \n\nimport {\n Link, useLocation, useNavigate, Outlet, useAppData, matchRoutes,\n type IRoute\n} from '@umijs/max';\nimport React, { useMemo } from 'react';\nimport {\n ProLayout,\n} from \"/home/runner/work/rustdesk-server-pro/rustdesk-server-pro/web_hbbs/node_modules/@ant-design/pro-layout\";\nimport './Layout.css';\nimport Logo from './Logo';\nimport Exception from './Exception';\nimport { getRightRenderContent } from './rightRender';\nimport { useModel } from '@@/plugin-model';\nimport { useAccessMarkedRoutes } from '@@/plugin-access';\nimport { useIntl } from '@@/plugin-locale';\n\n// 过滤出需要显示的路由, 这里的filterFn 指 不希望显示的层级\nconst filterRoutes = (routes: IRoute[], filterFn: (route: IRoute) => boolean) => {\n if (routes.length === 0) {\n return []\n }\n\n let newRoutes = []\n for (const route of routes) {\n const newRoute = {...route };\n if (filterFn(route)) {\n if (Array.isArray(newRoute.routes)) {\n newRoutes.push(...filterRoutes(newRoute.routes, filterFn))\n }\n } else {\n if (Array.isArray(newRoute.children)) {\n newRoute.children = filterRoutes(newRoute.children, filterFn);\n newRoute.routes = newRoute.children;\n }\n newRoutes.push(newRoute);\n }\n }\n\n return newRoutes;\n}\n\n// 格式化路由 处理因 wrapper 导致的 菜单 path 不一致\nconst mapRoutes = (routes: IRoute[]) => {\n if (routes.length === 0) {\n return []\n }\n return routes.map(route => {\n // 需要 copy 一份, 否则会污染原始数据\n const newRoute = {...route}\n if (route.originPath) {\n newRoute.path = route.originPath\n }\n\n if (Array.isArray(route.routes)) {\n newRoute.routes = mapRoutes(route.routes);\n }\n\n if (Array.isArray(route.children)) {\n newRoute.children = mapRoutes(route.children);\n }\n\n return newRoute\n })\n}\n\nexport default (props: any) => {\n const location = useLocation();\n const navigate = useNavigate();\n const { clientRoutes, pluginManager } = useAppData();\n const initialInfo = (useModel && useModel('@@initialState')) || {\n initialState: undefined,\n loading: false,\n setInitialState: null,\n };\n const { initialState, loading, setInitialState } = initialInfo;\n const userConfig = {\n \"locale\": true,\n \"navTheme\": \"light\",\n \"colorPrimary\": \"#1890ff\",\n \"layout\": \"mix\",\n \"contentWidth\": \"Fluid\",\n \"fixedHeader\": false,\n \"fixSiderbar\": true,\n \"colorWeak\": false,\n \"title\": \"RustDesk Console\",\n \"pwa\": false,\n \"logo\": \"./logo.svg\",\n \"iconfontUrl\": \"\"\n};\nconst { formatMessage } = useIntl();\n const runtimeConfig = pluginManager.applyPlugins({\n key: 'layout',\n type: 'modify',\n initialValue: {\n ...initialInfo\n },\n });\n\n\n // 现在的 layout 及 wrapper 实现是通过父路由的形式实现的, 会导致路由数据多了冗余层级, proLayout 消费时, 无法正确展示菜单, 这里对冗余数据进行过滤操作\n const newRoutes = filterRoutes(clientRoutes.filter(route => route.id === 'ant-design-pro-layout'), (route) => {\n return (!!route.isLayout && route.id !== 'ant-design-pro-layout') || !!route.isWrapper;\n })\n const [route] = useAccessMarkedRoutes(mapRoutes(newRoutes));\n\n const matchedRoute = useMemo(() => matchRoutes(route.children, location.pathname)?.pop?.()?.route, [location.pathname]);\n\n return (\n {\n e.stopPropagation();\n e.preventDefault();\n navigate('/');\n }}\n formatMessage={userConfig.formatMessage || formatMessage}\n menu={{ locale: userConfig.locale }}\n logo={Logo}\n menuItemRender={(menuItemProps, defaultDom) => {\n if (menuItemProps.isUrl || menuItemProps.children) {\n return defaultDom;\n }\n if (menuItemProps.path && location.pathname !== menuItemProps.path) {\n return (\n // handle wildcard route path, for example /slave/* from qiankun\n \n {defaultDom}\n \n );\n }\n return defaultDom;\n }}\n itemRender={(route, _, routes) => {\n const { breadcrumbName, title, path } = route;\n const label = title || breadcrumbName\n const last = routes[routes.length - 1]\n if (last) {\n if (last.path === path || last.linkPath === path) {\n return {label};\n }\n }\n return {label};\n }}\n disableContentMargin\n fixSiderbar\n fixedHeader\n {...runtimeConfig}\n rightContentRender={\n runtimeConfig.rightContentRender !== false &&\n ((layoutProps) => {\n const dom = getRightRenderContent({\n runtimeConfig,\n loading,\n initialState,\n setInitialState,\n });\n if (runtimeConfig.rightContentRender) {\n return runtimeConfig.rightContentRender(layoutProps, dom, {\n // BREAK CHANGE userConfig > runtimeConfig\n userConfig,\n runtimeConfig,\n loading,\n initialState,\n setInitialState,\n });\n }\n return dom;\n })\n }\n >\n \n {runtimeConfig.childrenRender\n ? runtimeConfig.childrenRender(, props)\n : \n }\n \n \n );\n}\n"],"names":["LogoIcon","_jsxs","xmlns","width","height","viewBox","children","id","x1","x2","y1","y2","_jsx","offset","stopColor","fill","fillRule","stroke","strokeWidth","transform","d","cx","cy","rx","ry","Exception","props","_props$route","_props$route2","route","noFound","notFound","unaccessible","unAccessible","noAccessible","Result","status","title","subTitle","extra","Button","type","onClick","history","push","getRightRenderContent","opts","_opts$initialState","_opts$initialState2","_opts$initialState3","_opts$initialState4","_opts$initialState5","runtimeConfig","rightRender","initialState","setInitialState","showAvatar","avatar","name","logout","disableAvatarImg","nameClassName","className","Avatar","size","src","alt","loading","Spin","style","marginLeft","marginRight","langMenu","selectedKeys","items","key","label","_Fragment","LogoutOutlined","_opts$runtimeConfig","_opts$runtimeConfig$l","call","dropdownProps","version","startsWith","menu","overlay","Menu","map","item","Item","_objectSpread","Dropdown","overlayClassName","SelectLang","filterRoutes","routes","filterFn","length","newRoutes","_iterator","_createForOfIteratorHelper","_step","s","n","done","value","newRoute","Array","isArray","apply","_toConsumableArray","err","e","f","mapRoutes","originPath","path","location","useLocation","navigate","useNavigate","_useAppData","useAppData","clientRoutes","pluginManager","initialInfo","useModel","undefined","userConfig","_useIntl","useIntl","formatMessage","applyPlugins","initialValue","filter","isLayout","isWrapper","_useAccessMarkedRoute","useAccessMarkedRoutes","_useAccessMarkedRoute2","_slicedToArray","matchedRoute","useMemo","_matchRoutes","_matchRoutes$pop","matchRoutes","pathname","pop","ProLayout","navTheme","siderWidth","onMenuHeaderClick","stopPropagation","preventDefault","locale","logo","Logo","menuItemRender","menuItemProps","defaultDom","isUrl","Link","to","replace","target","itemRender","_","breadcrumbName","last","linkPath","disableContentMargin","fixSiderbar","fixedHeader","rightContentRender","layoutProps","dom","childrenRender","Outlet"],"sourceRoot":""}