ui: Adds easily accessible `env` for user settable 'debug' settings (#5668)
This is a synchronous only 'debug' setting accessor, uses localStorage first and falls back to ember config.
This commit is contained in:
parent
d18ef6fa02
commit
839e79d16e
|
@ -0,0 +1,5 @@
|
||||||
|
import config from './config/environment';
|
||||||
|
export default function(str) {
|
||||||
|
const user = window.localStorage.getItem(str);
|
||||||
|
return user !== null ? user : config[str];
|
||||||
|
}
|
|
@ -1,8 +1,7 @@
|
||||||
import config from '../config/environment';
|
import env from 'consul-ui/env';
|
||||||
|
|
||||||
const enabled = 'CONSUL_UI_DISABLE_REALTIME';
|
|
||||||
export function initialize(container) {
|
export function initialize(container) {
|
||||||
if (config[enabled] || window.localStorage.getItem(enabled) !== null) {
|
if (env('CONSUL_UI_DISABLE_REALTIME')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
['node', 'coordinate', 'session', 'service', 'proxy']
|
['node', 'coordinate', 'session', 'service', 'proxy']
|
||||||
|
|
Loading…
Reference in New Issue