Merge pull request #2473 from deepanshu2711/fix/floating-strings-2470

fix(ui): shorten URL label and resize notification button (#2470)
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-06-19 07:23:25 +08:00
commit 28718680fa
3 files changed
+13 -3

No files matched your search

+8
View File
@@ -5,3 +5,11 @@ export const safelyParseFloat = (value) => {
}
return parsedValue;
};
export const formatMonitorUrl = (url, maxLength = 55) => {
if (!url) return "";
const strippedUrl = url.replace(/^https?:\/\//, "");
return strippedUrl.length > maxLength
? `${strippedUrl.slice(0, maxLength)}…`
: strippedUrl;
};