diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/system/utils.ts')
-rw-r--r-- | server/sonar-web/src/main/js/apps/system/utils.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/apps/system/utils.ts b/server/sonar-web/src/main/js/apps/system/utils.ts index 503084200e4..e24f796cd60 100644 --- a/server/sonar-web/src/main/js/apps/system/utils.ts +++ b/server/sonar-web/src/main/js/apps/system/utils.ts @@ -98,6 +98,10 @@ export function isCluster(sysInfoData?: SysInfo): boolean { ); } +export function getServerId(sysInfoData?: SysInfo): string | undefined { + return sysInfoData && sysInfoData['System']['Server ID']; +} + export function getSystemLogsLevel(sysInfoData?: SysInfo): string { const defaultLevel = LOGS_LEVELS[0]; if (!sysInfoData) { @@ -166,6 +170,15 @@ export function getStandaloneSecondarySections(sysInfoData: SysInfo): SysInfoSec }; } +export function getFileNameSuffix(suffix?: string) { + const now = new Date(); + return ( + `${suffix ? suffix + '-' : ''}` + + `${now.getFullYear()}-${now.getMonth() + 1}-` + + `${now.getDate()}-${now.getHours()}-${now.getMinutes()}` + ); +} + export function groupSections(sysInfoData: SysValueObject) { const mainSection: SysValueObject = {}; const sections: SysInfoSection = {}; |