open-consul/ui/packages/consul-ui/app/controllers/settings.js
John Cowen 32a0b757d0
ui: Controller dead code removal (#9367)
* ui: Controller dead code removal

This commit removes a little code that became 'dead' as a result of
previous PRs/commits

* Remove a little more from the settings Controller

* Remove CSS related to being able to set the dashboard_url in settings
2020-12-11 11:43:13 +00:00

26 lines
855 B
JavaScript

import Controller from '@ember/controller';
import { get, set } from '@ember/object';
import { inject as service } from '@ember/service';
export default Controller.extend({
dom: service('dom'),
actions: {
change: function(e, value, item) {
const event = this.dom.normalizeEvent(e, value);
// TODO: Switch to using forms like the rest of the app
// setting utils/form/builder for things to be done before we
// can do that. For the moment just do things normally its a simple
// enough form at the moment
const target = event.target;
const blocking = get(this, 'item.client.blocking');
switch (target.name) {
case 'client[blocking]':
set(this, 'item.client.blocking', !blocking);
this.send('update', 'client', this.item.client);
break;
}
},
},
});