mirror of
https://github.com/status-im/consul.git
synced 2025-01-11 14:24:39 +00:00
7d89e519a2
UI to accompany the new ACLs APIs
17 lines
497 B
JavaScript
17 lines
497 B
JavaScript
import { helper } from '@ember/component/helper';
|
|
import { get } from '@ember/object';
|
|
|
|
/**
|
|
* Datacenters can be an array of datacenters.
|
|
* Anything that isn't an array means 'All', even an empty array.
|
|
*/
|
|
export function datacenters(params, hash = {}) {
|
|
const datacenters = get(params[0], 'Datacenters');
|
|
if (!Array.isArray(datacenters) || datacenters.length === 0) {
|
|
return [hash['global'] || 'All'];
|
|
}
|
|
return get(params[0], 'Datacenters');
|
|
}
|
|
|
|
export default helper(datacenters);
|