components.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. import Ember from 'ember';
  19. import ColumnDef from 'em-table/utils/column-definition';
  20. export default Ember.Controller.extend({
  21. queryParams: ["service"],
  22. service: undefined,
  23. tableColumns: Ember.computed('model.appId', 'model.serviceName', function() {
  24. var cols = [];
  25. var service = this.get('model.serviceName');
  26. var appId = this.get('model.appId');
  27. cols.push({
  28. id: 'name',
  29. headerTitle: 'Component',
  30. contentPath: 'name',
  31. cellComponentName: 'em-table-linked-cell',
  32. getCellContent: function(row) {
  33. return {
  34. displayText: row.get('name'),
  35. href: `#/yarn-component-instances/${row.get('name')}/info?service=${service}&&appid=${appId}`
  36. };
  37. }
  38. }, {
  39. id: 'vcores',
  40. headerTitle: 'VCores',
  41. contentPath: 'vcores'
  42. }, {
  43. id: 'memory',
  44. headerTitle: 'Memory (MB)',
  45. contentPath: 'memory'
  46. }, {
  47. id: 'instances',
  48. headerTitle: 'Number Of Instances',
  49. contentPath: 'instances',
  50. observePath: true
  51. });
  52. return ColumnDef.make(cols);
  53. })
  54. });