iwinfo.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* Licensed to the public under the Apache License 2.0. */
  2. 'use strict';
  3. 'require baseclass';
  4. return baseclass.extend({
  5. title: _('Wireless'),
  6. rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
  7. /*
  8. * signal/noise diagram
  9. */
  10. var snr = {
  11. title: "%H: Signal and noise on %pi",
  12. detail: true,
  13. vlabel: "dBm",
  14. number_format: "%5.1lf dBm",
  15. data: {
  16. types: [ "signal_noise", "signal_power" ],
  17. options: {
  18. signal_power: {
  19. title : "Signal",
  20. overlay: true,
  21. color : "0000ff"
  22. },
  23. signal_noise: {
  24. title : "Noise",
  25. overlay: true,
  26. color : "ff0000"
  27. }
  28. }
  29. }
  30. };
  31. /*
  32. * signal quality diagram
  33. */
  34. var quality = {
  35. title: "%H: Signal quality on %pi",
  36. vlabel: "Quality",
  37. number_format: "%3.0lf",
  38. data: {
  39. types: [ "signal_quality" ],
  40. options: {
  41. signal_quality: {
  42. title : "Quality",
  43. noarea: true,
  44. color : "0000ff"
  45. }
  46. }
  47. }
  48. };
  49. /*
  50. * phy rate diagram
  51. */
  52. var bitrate = {
  53. title: "%H: Average phy rate on %pi",
  54. detail: true,
  55. vlabel: "Mbit/s",
  56. number_format: "%5.1lf%sbit/s",
  57. data: {
  58. types: [ "bitrate" ],
  59. options: {
  60. bitrate: {
  61. title: "Rate",
  62. color: "00ff00"
  63. }
  64. }
  65. }
  66. };
  67. /*
  68. * associated stations
  69. */
  70. var stations = {
  71. title: "%H: Associated stations on %pi",
  72. detail: true,
  73. vlabel: "Stations",
  74. y_min: "0",
  75. alt_autoscale_max: true,
  76. number_format: "%3.0lf",
  77. data: {
  78. types: [ "stations" ],
  79. options: {
  80. stations: {
  81. title: "Stations",
  82. color: "0000ff"
  83. }
  84. }
  85. }
  86. };
  87. return [ quality, snr, bitrate, stations ];
  88. }
  89. });