status.patch 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. --- a/package/feeds/luci/luci-mod-status/htdocs/luci-static/resources/view/status/include/20_memory.js
  2. +++ b/package/feeds/luci/luci-mod-status/htdocs/luci-static/resources/view/status/include/20_memory.js
  3. @@ -32,8 +32,7 @@ return baseclass.extend({
  4. swap = L.isObject(systeminfo.swap) ? systeminfo.swap : {};
  5. var fields = [
  6. - _('Total Available'), (mem.available) ? mem.available : (mem.total && mem.free && mem.buffered) ? mem.free + mem.buffered : null, mem.total,
  7. - _('Used'), (mem.total && mem.free) ? (mem.total - mem.free) : null, mem.total,
  8. + _('Used'), (mem.total && mem.available) ? (mem.total - mem.free - mem.buffered - mem.cached) : null, mem.total,
  9. ];
  10. if (mem.buffered)
  11. @@ -43,9 +42,9 @@ return baseclass.extend({
  12. fields.push(_('Cached'), mem.cached, mem.total);
  13. if (swap.total > 0)
  14. - fields.push(_('Swap free'), swap.free, swap.total);
  15. + fields.push(_('Swap used'), swap.total - swap.free, swap.total);
  16. - var table = E('table', { 'class': 'table' });
  17. + var table = E('table', { 'class': 'table memory' });
  18. for (var i = 0; i < fields.length; i += 3) {
  19. table.appendChild(E('tr', { 'class': 'tr' }, [
  20. --- a/package/feeds/luci/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json
  21. +++ b/package/feeds/luci/luci-mod-status/root/usr/share/rpcd/acl.d/luci-mod-status.json
  22. @@ -3,7 +3,7 @@
  23. "description": "Grant access to realtime statistics",
  24. "read": {
  25. "ubus": {
  26. - "luci": [ "getConntrackList", "getRealtimeStats" ],
  27. + "luci": [ "getConntrackList", "getRealtimeStats", "getCPUBench", "getCPUUsage", "getOnlineUsers" ],
  28. "network.rrdns": [ "lookup" ]
  29. }
  30. }
  31. --- a/package/feeds/luci/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js
  32. +++ b/package/feeds/luci/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js
  33. @@ -18,6 +18,21 @@ var callSystemInfo = rpc.declare({
  34. method: 'info'
  35. });
  36. +var callCPUBench = rpc.declare({
  37. + object: 'luci',
  38. + method: 'getCPUBench'
  39. +});
  40. +
  41. +var callCPUInfo = rpc.declare({
  42. + object: 'luci',
  43. + method: 'getCPUInfo'
  44. +});
  45. +
  46. +var callTempInfo = rpc.declare({
  47. + object: 'luci',
  48. + method: 'getTempInfo'
  49. +});
  50. +
  51. return baseclass.extend({
  52. title: _('System'),
  53. @@ -25,6 +45,9 @@ return baseclass.extend({
  54. return Promise.all([
  55. L.resolveDefault(callSystemBoard(), {}),
  56. L.resolveDefault(callSystemInfo(), {}),
  57. + L.resolveDefault(callCPUBench(), {}),
  58. + L.resolveDefault(callCPUInfo(), {}),
  59. + L.resolveDefault(callTempInfo(), {}),
  60. L.resolveDefault(callLuciVersion(), { revision: _('unknown version'), branch: 'LuCI' })
  61. ]);
  62. },
  63. @@ -32,7 +56,10 @@ return baseclass.extend({
  64. render: function(data) {
  65. var boardinfo = data[0],
  66. systeminfo = data[1],
  67. - luciversion = data[2];
  68. + cpubench = data[2],
  69. + cpuinfo = data[3],
  70. + tempinfo = data[4],
  71. + luciversion = data[5];
  72. luciversion = luciversion.branch + ' ' + luciversion.revision;
  73. @@ -53,8 +81,6 @@ return baseclass.extend({
  74. var fields = [
  75. _('Hostname'), boardinfo.hostname,
  76. - _('Model'), boardinfo.model,
  77. - _('Architecture'), boardinfo.system,
  78. _('Target Platform'), (L.isObject(boardinfo.release) ? boardinfo.release.target : ''),
  79. _('Firmware Version'), (L.isObject(boardinfo.release) ? boardinfo.release.description + ' / ' : '') + (luciversion || ''),
  80. _('Kernel Version'), boardinfo.kernel,
  81. @@ -67,6 +93,24 @@ return baseclass.extend({
  82. ) : null
  83. ];
  84. + if (tempinfo.tempinfo) {
  85. + fields.splice(6, 0, _('Temperature'));
  86. + fields.splice(7, 0, tempinfo.tempinfo);
  87. + }
  88. + if (boardinfo.model == "Default string Default string") {
  89. + if (cpuinfo.cpuinfo) {
  90. + fields.splice(2, 0, _('Architecture'));
  91. + fields.splice(3, 0, cpuinfo.cpuinfo + cpubench.cpubench);
  92. + }
  93. + } else {
  94. + fields.splice(2, 0, _('Model'));
  95. + fields.splice(3, 0, boardinfo.model + cpubench.cpubench);
  96. + if (cpuinfo.cpuinfo) {
  97. + fields.splice(4, 0, _('Architecture'));
  98. + fields.splice(5, 0, cpuinfo.cpuinfo);
  99. + }
  100. + }
  101. +
  102. var table = E('table', { 'class': 'table' });
  103. for (var i = 0; i < fields.length; i += 2) {
  104. --- a/package/feeds/luci/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js
  105. +++ b/package/feeds/luci/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js
  106. @@ -675,7 +675,6 @@ return view.extend({
  107. checkLegacyRules: function(ipt4save, ipt6save) {
  108. if (ipt4save.match(/\n-A /) || ipt6save.match(/\n-A /)) {
  109. ui.addNotification(_('Legacy rules detected'), [
  110. - E('p', _('There are legacy iptables rules present on the system. Mixing iptables and nftables rules is discouraged and may lead to incomplete traffic filtering.')),
  111. E('button', {
  112. 'class': 'btn cbi-button',
  113. 'click': function() { location.href = 'nftables/iptables' }
  114. --- a/package/feeds/luci/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js
  115. +++ b/package/feeds/luci/luci-mod-status/htdocs/luci-static/resources/view/status/include/29_ports.js
  116. @@ -309,8 +309,6 @@ return baseclass.extend({
  117. },
  118. render: function(data) {
  119. - if (L.hasSystemFeature('swconfig'))
  120. - return null;
  121. var board = JSON.parse(data[1]),
  122. known_ports = [],