Skip to content

Commit

Permalink
ui: Adds easily accessible env for user settable 'debug' settings (#…
Browse files Browse the repository at this point in the history
…5668)

This is a synchronous only 'debug' setting accessor, uses localStorage
first and falls back to ember config.
  • Loading branch information
johncowen authored Apr 17, 2019
1 parent ffcf32e commit 4cc119e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ui-v2/app/env.js
Original file line number Diff line number Diff line change
@@ -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];
}
5 changes: 2 additions & 3 deletions ui-v2/app/instance-initializers/event-source.js
Original file line number Diff line number Diff line change
@@ -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) {
if (config[enabled] || window.localStorage.getItem(enabled) !== null) {
if (env('CONSUL_UI_DISABLE_REALTIME')) {
return;
}
['node', 'coordinate', 'session', 'service', 'proxy']
Expand Down

0 comments on commit 4cc119e

Please sign in to comment.