yarn-queue.js 614 B

1234567891011121314151617181920
  1. import DS from 'ember-data';
  2. import Config from 'yarn-ui/config';
  3. export default DS.JSONAPIAdapter.extend({
  4. headers: {
  5. Accept: 'application/json'
  6. },
  7. host: 'http://localhost:1337/' + Config.RM_HOST + ':' + Config.RM_PORT, // configurable
  8. namespace: 'ws/v1/cluster', // common const
  9. pathForType(modelName) {
  10. return 'scheduler'; // move to some common place, return path by modelname.
  11. },
  12. ajax(url, method, hash) {
  13. hash = hash || {};
  14. hash.crossDomain = true;
  15. hash.xhrFields = {withCredentials: true};
  16. hash.targetServer = "RM";
  17. return this._super(url, method, hash);
  18. }
  19. });