open-nomad/ui/app/services/watch-list.js
Michael Lange 1bd6a69067
UI: Support for CSI (#7446)
Closes #7197 #7199

Note: Test coverage is limited to adapter and serializer unit tests. All
acceptance tests have been stubbed and all features have been manually
tested end-to-end.

This represents Phase 1 of #6993 which is the core workflow of CSI in
the UI. It includes a couple new pages for viewing all external volumes
as well as the allocations associated with each. It also updates
existing volume related views on job and allocation pages to handle both
Host Volumes and CSI Volumes.
2020-03-25 07:51:26 -05:00

26 lines
465 B
JavaScript

import { computed } from '@ember/object';
import { readOnly } from '@ember/object/computed';
import { copy } from 'ember-copy';
import Service from '@ember/service';
let list = {};
export default Service.extend({
_list: computed(() => copy(list, true)),
list: readOnly('_list'),
init() {
this._super(...arguments);
list = {};
},
getIndexFor(url) {
return list[url] || 1;
},
setIndexFor(url, value) {
list[url] = +value;
},
});