diff options
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/system.ts')
-rw-r--r-- | server/sonar-web/src/main/js/helpers/system.ts | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/helpers/system.ts b/server/sonar-web/src/main/js/helpers/system.ts index a702f347dad..ca070226262 100644 --- a/server/sonar-web/src/main/js/helpers/system.ts +++ b/server/sonar-web/src/main/js/helpers/system.ts @@ -17,14 +17,26 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -export function getSystemStatus(): T.SysStatus { - return (window as any).serverStatus; + +import { InstanceType } from '../types/system'; +import { getEnhancedWindow } from './browser'; + +export function getBaseUrl() { + return getEnhancedWindow().baseUrl; +} + +export function getSystemStatus() { + return getEnhancedWindow().serverStatus; +} + +export function getInstance() { + return getEnhancedWindow().instance; } -export function getInstance(): 'SonarQube' | 'SonarCloud' { - return (window as any).instance; +export function isOfficial() { + return getEnhancedWindow().official; } export function isSonarCloud() { - return getInstance() === 'SonarCloud'; + return getInstance() === InstanceType.SonarCloud; } |