mapreduce_links.js 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. var App = require('app');
  19. App.MapReduceLinksView = App.DashboardWidgetView.extend({
  20. title: Em.I18n.t('dashboard.widgets.MapReduceLinks'),
  21. id: '18',
  22. isPieChart: false,
  23. isText: false,
  24. isProgressBar: false,
  25. isLinks: true,
  26. model_type: 'mapreduce',
  27. template: Ember.Handlebars.compile([
  28. '<div class="links">',
  29. '<li class="thumbnail row">',
  30. '<a class="corner-icon" href="#" {{action deleteWidget target="view"}}>','<i class="icon-remove-sign icon-large"></i>','</a>',
  31. '<div class="caption span8">', '{{view.title}}','</div>',
  32. '<div class="span3 link-button">',
  33. '{{#if view.model.quickLinks.length}}',
  34. '{{#view App.QuickViewLinks contentBinding="view.model"}}',
  35. '<div class="btn-group">',
  36. '<a class="btn btn-mini dropdown-toggle" data-toggle="dropdown" href="#">',
  37. '{{t common.more}}',
  38. '<span class="caret"></span>',
  39. '</a>',
  40. '<ul class="dropdown-menu">',
  41. '{{#each view.quickLinks}}',
  42. '<li><a {{bindAttr href="url"}} target="_blank">{{label}}</a></li>',
  43. '{{/each}}',
  44. '</ul>',
  45. '</div>',
  46. '{{/view}}',
  47. '{{/if}}',
  48. '</div>',
  49. '<div class="widget-content" >',
  50. '<table>',
  51. //jobTracker
  52. '<tr>',
  53. '<td>{{t services.service.summary.jobTracker}}</td>',
  54. '<td><a href="#" {{action showDetails view.model.jobTracker}}>{{view.model.jobTracker.publicHostName}}</a></td>',
  55. '</tr>',
  56. //taskTrackers
  57. '<tr>',
  58. '<td>{{t dashboard.services.mapreduce.taskTrackers}}</td>',
  59. '<td><a href="#" {{action filterHosts view.taskTrackerComponent}}>{{view.model.taskTrackers.length}} {{t dashboard.services.mapreduce.taskTrackers}}</a></td>',
  60. '</tr>',
  61. // jobTracker Web UI
  62. '<tr>',
  63. '<td>{{t services.service.summary.jobTrackerWebUI}}</td>',
  64. '<td><a {{bindAttr href="view.jobTrackerWebUrl"}} target="_blank">{{view.model.jobTracker.publicHostName}}:50030</a>','</td>',
  65. '</tr>',
  66. '</table>',
  67. '</div>',
  68. '</li>',
  69. '</div>'
  70. ].join('\n')),
  71. taskTrackerComponent: function () {
  72. return App.HostComponent.find().findProperty('componentName', 'TASKTRACKER');
  73. }.property(),
  74. jobTrackerWebUrl: function () {
  75. return "http://" + this.get('model').get('jobTracker').get('publicHostName') + ":50030";
  76. }.property('model.nameNode')
  77. })
  78. App.MapReduceLinksView. reopenClass({
  79. isLinks: true
  80. })