yarn-app-attempt.js 894 B

1234567891011121314151617181920212223242526272829303132
  1. import DS from 'ember-data';
  2. import Converter from 'yarn-ui/utils/converter';
  3. import Config from 'yarn-ui/config';
  4. export default DS.JSONAPIAdapter.extend({
  5. headers: {
  6. Accept: 'application/json'
  7. },
  8. host: 'http://localhost:1337/' + Config.RM_HOST + ':' + Config.RM_PORT, // configurable
  9. namespace: 'ws/v1/cluster', // common const
  10. urlForQuery(query, modelName) {
  11. var url = this._buildURL();
  12. return url + '/apps/' + query.appId + "/appattempts";
  13. },
  14. urlForFindRecord(id, modelName, snapshot) {
  15. var url = this._buildURL();
  16. var url = url + '/apps/' +
  17. Converter.attemptIdToAppId(id) + "/appattempts/" + id;
  18. console.log(url);
  19. return url;
  20. },
  21. ajax(url, method, hash) {
  22. hash = {};
  23. hash.crossDomain = true;
  24. hash.xhrFields = {withCredentials: true};
  25. hash.targetServer = "RM";
  26. return this._super(url, method, hash);
  27. }
  28. });