You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/ui/packages/consul-ui/app/adapters/application.js

23 lines
532 B

import Adapter from './http';
import { inject as service } from '@ember/service';
export const DATACENTER_QUERY_PARAM = 'dc';
export const NSPACE_QUERY_PARAM = 'ns';
export default class ApplicationAdapter extends Adapter {
@service('client/http') client;
@service('env') env;
formatNspace(nspace) {
if (this.env.var('CONSUL_NSPACES_ENABLED')) {
return nspace !== '' ? { [NSPACE_QUERY_PARAM]: nspace } : undefined;
}
}
formatDatacenter(dc) {
return {
[DATACENTER_QUERY_PARAM]: dc,
};
}
}