diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-10-02 11:14:49 +0200 |
---|---|---|
committer | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-10-04 11:19:53 +0200 |
commit | e3b180065bd5985f7b2addc341a4def75936899e (patch) | |
tree | ce9b96c1df32a1e329af7db5ba896c67bfe55aff /server | |
parent | a142eeed9d3b002718c48a719bb7ee009e398b89 (diff) | |
download | sonarqube-e3b180065bd5985f7b2addc341a4def75936899e.tar.gz sonarqube-e3b180065bd5985f7b2addc341a4def75936899e.zip |
SONAR-9808 Add ncloc to system info page
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-web/src/main/js/apps/system/utils.ts | 14 |
1 files changed, 12 insertions, 2 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 5514ae4e705..33b18d63120 100644 --- a/server/sonar-web/src/main/js/apps/system/utils.ts +++ b/server/sonar-web/src/main/js/apps/system/utils.ts @@ -33,6 +33,7 @@ import { SysInfoSection, SysValueObject } from '../../api/system'; +import { formatMeasure } from '../../helpers/measures'; export interface Query { expandedCards: string[]; @@ -110,9 +111,18 @@ export function getNodeName(nodeInfo: NodeInfo): string { return nodeInfo['Name']; } +function getSystemData(sysInfoData: SysInfo): SysValueObject { + const statData: SysValueObject = {}; + const statistics = sysInfoData['Statistics'] as SysValueObject; + if (statistics) { + statData['Lines of Code'] = formatMeasure(statistics['ncloc'] as number, 'INT'); + } + return { ...sysInfoData['System'], ...statData }; +} + export function getClusterMainCardSection(sysInfoData: ClusterSysInfo): SysValueObject { return { - ...sysInfoData['System'], + ...getSystemData(sysInfoData), ...omit(sysInfoData, [ 'Application Nodes', PLUGINS_FIELD, @@ -126,7 +136,7 @@ export function getClusterMainCardSection(sysInfoData: ClusterSysInfo): SysValue export function getStandaloneMainSections(sysInfoData: SysInfo): SysValueObject { return { - ...sysInfoData['System'], + ...getSystemData(sysInfoData), ...omitBy( sysInfoData, (value, key) => |