open-nomad/ui/app/controllers/variables/new.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
596 B
JavaScript
Raw Normal View History

// @ts-check
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
import { tracked } from '@glimmer/tracking';
export default class VariablesNewController extends Controller {
@service store;
queryParams = ['path', 'view'];
get existingVariables() {
return this.store.peekAll('variable');
}
//#region Code View
/**
* @type {"table" | "json"}
*/
@tracked
view = 'table';
toggleView() {
if (this.view === 'table') {
this.view = 'json';
} else {
this.view = 'table';
}
}
//#endregion Code View
}