[improvement][headless-fe] Revised the interaction for semantic modeling routing and implemented the initial version of metric management switching.

This commit is contained in:
tristanliu
2024-11-26 20:28:24 +08:00
parent 0edadd01eb
commit 2eca2d1c14
23 changed files with 571 additions and 895 deletions

View File

@@ -502,3 +502,10 @@ export function decryptPassword(encryptPassword: string) {
export function uniqueArray(arr: any[]) {
return Array.from(new Set(arr));
}
// 替换以:开头标记的变量
export const replaceRouteParams = (template: string, values: Record<string, string>): string => {
return template.replace(/:([a-zA-Z0-9_]+)/g, (match, key) => {
return values[key] !== undefined ? values[key] : match;
});
};