diff --git a/ui/app/components/agent-monitor.js b/ui/app/components/agent-monitor.js new file mode 100644 index 000000000..69acceda7 --- /dev/null +++ b/ui/app/components/agent-monitor.js @@ -0,0 +1,35 @@ +import Component from '@ember/component'; +import { tagName } from '@ember-decorators/component'; + +const LEVELS = ['error', 'warn', 'info', 'debug', 'trace'].map(level => ({ + value: level, + label: level.capitalize(), +})); + +@tagName('') +export default class AgentMonitor extends Component { + levels = LEVELS; + client = null; + server = null; + onLevelChange() {} + + // Public string interface + level = null; + + // Private object interface (value, label) + _level = null; + + init() { + super.init(...arguments); + this.set('_level', LEVELS.findBy('value', 'info')); + } + + didReceiveAttrs() { + this.set('_level', LEVELS.findBy('value', this.level)); + } + + setLevel(level) { + this.set('_level', level); + this.onLevelChange(level); + } +} diff --git a/ui/app/controllers/clients/client/monitor.js b/ui/app/controllers/clients/client/monitor.js new file mode 100644 index 000000000..2e0505c7b --- /dev/null +++ b/ui/app/controllers/clients/client/monitor.js @@ -0,0 +1,9 @@ +import Controller from '@ember/controller'; +import classic from 'ember-classic-decorator'; + +@classic +export default class ClientMonitorController extends Controller { + queryParams = [{ level: 'level' }]; + + level = 'info'; +} diff --git a/ui/app/styles/components/dropdown.scss b/ui/app/styles/components/dropdown.scss index 15682f0df..cfe613109 100644 --- a/ui/app/styles/components/dropdown.scss +++ b/ui/app/styles/components/dropdown.scss @@ -32,6 +32,18 @@ color: rgba($white, 0.75); } } + + &.is-compact { + margin: -0.25em 0; + + &.pull-right { + margin-right: -1em; + } + + &.pull-left { + margin-left: -1em; + } + } } .button-bar { diff --git a/ui/app/templates/clients/client/monitor.hbs b/ui/app/templates/clients/client/monitor.hbs index b43640d02..f82f8779d 100644 --- a/ui/app/templates/clients/client/monitor.hbs +++ b/ui/app/templates/clients/client/monitor.hbs @@ -1,4 +1,8 @@ {{title "Client " (or model.name model.shortId)}}
+
diff --git a/ui/app/templates/components/agent-monitor.hbs b/ui/app/templates/components/agent-monitor.hbs new file mode 100644 index 000000000..e38a17c7e --- /dev/null +++ b/ui/app/templates/components/agent-monitor.hbs @@ -0,0 +1,20 @@ +
+
+ + Level: {{level.label}} + + +
+
+
Monitor goes here
+
+