2015-12-09 00:37:50 +00:00
|
|
|
import DS from 'ember-data';
|
2016-03-21 20:13:02 +00:00
|
|
|
import Config from 'yarn-ui/config';
|
2015-12-09 00:37:50 +00:00
|
|
|
|
|
|
|
export default DS.JSONAPIAdapter.extend({
|
|
|
|
headers: {
|
|
|
|
Accept: 'application/json'
|
|
|
|
},
|
2016-03-21 20:13:02 +00:00
|
|
|
host: 'http://localhost:1337/' + Config.RM_HOST + ':' + Config.RM_PORT, // configurable
|
2015-12-09 00:37:50 +00:00
|
|
|
namespace: 'ws/v1/cluster', // common const
|
|
|
|
pathForType(modelName) {
|
|
|
|
return 'scheduler'; // move to some common place, return path by modelname.
|
|
|
|
},
|
|
|
|
ajax(url, method, hash) {
|
|
|
|
hash = hash || {};
|
|
|
|
hash.crossDomain = true;
|
|
|
|
hash.xhrFields = {withCredentials: true};
|
|
|
|
hash.targetServer = "RM";
|
|
|
|
return this._super(url, method, hash);
|
|
|
|
}
|
|
|
|
});
|