dsl.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. /* Licensed to the public under the Apache License 2.0. */
  2. 'use strict';
  3. return L.Class.extend({
  4. title: _('DSL'),
  5. rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
  6. var g = [];
  7. var dtypes = graph.dataTypes(host, plugin, plugin_instance);
  8. const d_snr = {
  9. title: _("DSL Signal"),
  10. vlabel: "dB",
  11. data: {
  12. types: ["snr"],
  13. options: {
  14. snr_latn_up: {
  15. title: _("Line Attenuation Up (LATN)"),
  16. noarea: true,
  17. overlay: true
  18. },
  19. snr_latn_down: {
  20. title: _("Line Attenuation Down (LATN)"),
  21. noarea: true,
  22. overlay: true
  23. },
  24. snr_satn_up: {
  25. title: _("Signal Attenuation Up (SATN)"),
  26. noarea: true,
  27. overlay: true
  28. },
  29. snr_satn_down: {
  30. title: _("Signal Attenuation Down (SATN)"),
  31. noarea: true,
  32. overlay: true
  33. },
  34. snr_snr_up: {
  35. title: _("Noise Margin Up (SNR)"),
  36. noarea: true,
  37. overlay: true
  38. },
  39. snr_snr_down: {
  40. title: _("Noise Margin Down (SNR)"),
  41. noarea: true,
  42. overlay: true
  43. },
  44. }
  45. }
  46. };
  47. const d_uptime = {
  48. title: _("DSL Line Uptime"),
  49. vlabel: "seconds",
  50. data: {
  51. types: ["uptime"],
  52. options: {
  53. uptime: {
  54. title: _("Uptime"),
  55. noarea: true
  56. }
  57. }
  58. }
  59. };
  60. const d_flags = {
  61. title: _("DSL Flags"),
  62. data: {
  63. instances: {
  64. bool: [
  65. "bitswap_up",
  66. "bitswap_down",
  67. "vector_up",
  68. "vector_down"
  69. ]
  70. },
  71. options: {
  72. bool_bitswap_up: {
  73. title: _("Bitswap Up"),
  74. noarea: true,
  75. overlay: true
  76. },
  77. bool_bitswap_down: {
  78. title: _("Bitswap Down"),
  79. noarea: true,
  80. overlay: true
  81. },
  82. bool_vector_up: {
  83. title: _("Vectoring Up"),
  84. noarea: true,
  85. overlay: true
  86. },
  87. bool_vector_down: {
  88. title: _("Vectoring Down"),
  89. noarea: true,
  90. overlay: true
  91. },
  92. }
  93. }
  94. };
  95. const d_bitrate = {
  96. title: _("Bitrate"),
  97. vlabel: "b/s",
  98. data: {
  99. instances: {
  100. bitrate: [
  101. "attndr_up",
  102. "attndr_down",
  103. "data_rate_up",
  104. "data_rate_down"
  105. ]
  106. },
  107. options: {
  108. bitrate_attndr_up: {
  109. title: _("Max. Attainable Data Rate (ATTNDR) Up"),
  110. noarea: true,
  111. overlay: true
  112. },
  113. bitrate_attndr_down: {
  114. title: _("Max. Attainable Data Rate (ATTNDR) Down"),
  115. noarea: true,
  116. overlay: true
  117. },
  118. bitrate_data_rate_up: {
  119. title: _("Data Rate Up"),
  120. noarea: true,
  121. overlay: true
  122. },
  123. bitrate_data_rate_down: {
  124. title: _("Data Rate Down"),
  125. noarea: true,
  126. overlay: true
  127. }
  128. }
  129. }
  130. };
  131. const d_count = {
  132. title: _("Errors"),
  133. vlabel: "count",
  134. data: {
  135. types: ["errors"],
  136. options: {
  137. errors_rx_corrupted_far: {
  138. title: _("Rx Corrupted Far"),
  139. noarea: true,
  140. overlay: true
  141. },
  142. errors_rx_corrupted_near: {
  143. title: _("Rx Corrupted Near"),
  144. noarea: true,
  145. overlay: true
  146. },
  147. errors_rx_retransmitted_far: {
  148. title: _("Rx Retransmitted Far"),
  149. noarea: true,
  150. overlay: true
  151. },
  152. errors_tx_retransmitted_far: {
  153. title: _("Tx Retransmitted Far"),
  154. noarea: true,
  155. overlay: true
  156. },
  157. errors_rx_retransmitted_near: {
  158. title: _("Rx Retransmitted Near"),
  159. noarea: true,
  160. overlay: true
  161. },
  162. errors_tx_retransmitted_near: {
  163. title: _("Tx Retransmitted Near"),
  164. noarea: true,
  165. overlay: true
  166. },
  167. }
  168. }
  169. };
  170. if (dtypes.includes("snr")) {
  171. g.push(d_snr);
  172. }
  173. if (dtypes.includes("uptime")) {
  174. g.push(d_uptime);
  175. }
  176. if (dtypes.includes("bool")) {
  177. g.push(d_flags);
  178. }
  179. if (dtypes.includes("bitrate")) {
  180. g.push(d_bitrate);
  181. }
  182. if (dtypes.includes("count")) {
  183. g.push(d_count);
  184. }
  185. return g;
  186. }
  187. });