app-table-columns.js 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. columns: function() {
  22. var colums = [];
  23. colums.push({
  24. id: 'appId',
  25. headerTitle: 'Application ID',
  26. contentPath: 'id',
  27. cellComponentName: 'em-table-linked-cell',
  28. getCellContent: function(row) {
  29.    return {
  30.      displayText: row.id,
  31.      routeName: 'yarn-app',
  32.      id: row.id
  33. };
  34. },
  35. minWidth: "250px"
  36. }, {
  37. id: 'appType',
  38. headerTitle: 'Application Type',
  39. contentPath: 'applicationType',
  40. }, {
  41. id: 'appName',
  42. headerTitle: 'Application Name',
  43. contentPath: 'appName',
  44. }, {
  45. id: 'appUsr',
  46. headerTitle: 'User',
  47. contentPath: 'user',
  48. minWidth: "50px"
  49. }, {
  50. id: 'queue',
  51. headerTitle: 'Queue',
  52. contentPath: 'queue',
  53. }, {
  54. id: 'state',
  55. headerTitle: 'State',
  56. contentPath: 'state',
  57. cellComponentName: 'em-table-status-cell',
  58. minWidth: "50px"
  59. }, {
  60. id: 'progress',
  61. headerTitle: 'Progress',
  62. contentPath: 'progress',
  63. cellComponentName: 'em-table-progress-cell',
  64. cellDefinition: {
  65.        valueMax: 100
  66.      },
  67. }, {
  68. id: 'stTime',
  69. headerTitle: 'Start Time',
  70. contentPath: 'startTime',
  71. }, {
  72. id: 'elTime',
  73. headerTitle: 'Elapsed Time',
  74. contentPath: 'elapsedTime',
  75. cellDefinition: {
  76. type: "duration"
  77. }
  78. }, {
  79. id: 'finishTime',
  80. headerTitle: 'Finished Time',
  81. contentPath: 'validatedFinishedTs',
  82. observePath: true
  83. }, {
  84. id: 'priority',
  85. headerTitle: 'Priority',
  86. contentPath: 'priority',
  87. }, {
  88. id: 'cluster',
  89. headerTitle: '%Cluster',
  90. contentPath: 'clusterUsagePercentage',
  91. observePath: true
  92. });
  93. return ColumnDef.make(colums);
  94. }.property()
  95. });