spectrum.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. 'use strict';
  2. 'require view';
  3. 'require fs';
  4. 'require ui';
  5. 'require rpc';
  6. var callDSLStatistics = rpc.declare({
  7. object: 'dsl',
  8. method: 'statistics',
  9. expect: { '': {} }
  10. });
  11. return view.extend({
  12. load: function() {
  13. return Promise.all([
  14. callDSLStatistics()
  15. ]);
  16. },
  17. render: function(data) {
  18. window.json = data[0];
  19. var v = E([], [
  20. E('h2', {'style': "height: 40px"}, [ _('DSL line spectrum') ]),
  21. E('p', {}, _('Graphs below show Signal-to-noise ratio, Bit allocation, Quiet line noise and Channel characteristics function (HLOG) per sub-carrier.')),
  22. E('div', {'style': "height: 360px; width: 1024px"},
  23. E('canvas', {
  24. 'id': 'dbChart',
  25. 'height': 360,
  26. 'width': 1024},
  27. ["chart"])
  28. ),
  29. E('div', {'style': "height: 360px; width:1024px"},
  30. E('canvas', {
  31. 'id': 'bitsChart',
  32. 'height': 360,
  33. 'width': 1024},
  34. ["chart2"])
  35. ),
  36. E('div', {'style': "height: 360px; width:1024px"},
  37. E('canvas', {
  38. 'id': 'qlnChart',
  39. 'height': 360,
  40. 'width': 1024},
  41. ["chart2"])
  42. ),
  43. E('div', {'style': "height: 360px; width:1024px"},
  44. E('canvas', {
  45. 'id': 'hlogChart',
  46. 'height': 360,
  47. 'width': 1024},
  48. ["chart2"])
  49. ),
  50. E('script', {'src':'/luci-static/resources/view/status/dsl/graph.js'}, {})
  51. ]);
  52. return v;
  53. },
  54. handleSaveApply: null,
  55. handleSave: null,
  56. handleReset: null
  57. });