chore: refresh gramsrv public release
This commit is contained in:
parent
75cebe8dbf
commit
70b6820474
1274 changed files with 378751 additions and 59919 deletions
29
cmd/telesrv-admin/web/src/routing.ts
Normal file
29
cmd/telesrv-admin/web/src/routing.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
export type Navigate = (href: string) => void;
|
||||
|
||||
export type RouteState = {
|
||||
href: string;
|
||||
path: string;
|
||||
search: URLSearchParams;
|
||||
};
|
||||
|
||||
export function currentRoute(): RouteState {
|
||||
return {
|
||||
href: `${window.location.pathname}${window.location.search}`,
|
||||
path: window.location.pathname,
|
||||
search: new URLSearchParams(window.location.search)
|
||||
};
|
||||
}
|
||||
|
||||
export function routeTitle(pathname: string): string {
|
||||
if (pathname.startsWith("/accounts")) return "账号管理";
|
||||
if (pathname.startsWith("/channels")) return "超级群与频道";
|
||||
if (pathname.startsWith("/messages")) return "消息审计";
|
||||
return "运维控制台";
|
||||
}
|
||||
|
||||
export function routeSubtitle(pathname: string): string {
|
||||
if (pathname.startsWith("/accounts")) return "控制台 / 账号";
|
||||
if (pathname.startsWith("/channels")) return "控制台 / 频道";
|
||||
if (pathname.startsWith("/messages")) return "控制台 / 消息";
|
||||
return "控制台 / 总览";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue