net/vnstat: make plugin compatible to new v2 version (#1656)

This commit is contained in:
Michael
2020-01-10 12:22:43 +01:00
committed by Franco Fichtner
parent 6f68d0e293
commit 53d58be125
5 changed files with 6 additions and 29 deletions
+1 -2
View File
@@ -1,6 +1,5 @@
PLUGIN_NAME= vnstat
PLUGIN_VERSION= 1.1
PLUGIN_REVISION= 1
PLUGIN_VERSION= 1.2
PLUGIN_COMMENT= vnStat is a console-based network traffic monitor
PLUGIN_DEPENDS= vnstat
PLUGIN_MAINTAINER= m.muenz@gmail.com
+5
View File
@@ -9,6 +9,11 @@ ensures light use of system resources.
Plugin Changelog
================
1.2
* Remove Weekly statistics, unsupported since vnStat v2
* Reset of DB is required due to SQLite migration
1.1
* Add button to remove database
@@ -67,17 +67,6 @@ class ServiceController extends ApiMutableServiceControllerBase
return array("response" => $response);
}
/**
* list weekly statistics
* @return array
*/
public function weeklyAction()
{
$backend = new Backend();
$response = $backend->configdRun("vnstat weekly");
return array("response" => $response);
}
/**
* list monthly statistics
* @return array
@@ -30,7 +30,6 @@
<li class="active"><a data-toggle="tab" href="#general">{{ lang._('General') }}</a></li>
<li><a data-toggle="tab" href="#hourly">{{ lang._('Hourly Statistics') }}</a></li>
<li><a data-toggle="tab" href="#daily">{{ lang._('Daily Statistics') }}</a></li>
<li><a data-toggle="tab" href="#weekly">{{ lang._('Weekly Statistics') }}</a></li>
<li><a data-toggle="tab" href="#monthly">{{ lang._('Monthly Statistics') }}</a></li>
</ul>
@@ -51,9 +50,6 @@
<div id="daily" class="tab-pane fade in">
<pre id="listdaily"></pre>
</div>
<div id="weekly" class="tab-pane fade in">
<pre id="listweekly"></pre>
</div>
<div id="monthly" class="tab-pane fade in">
<pre id="listmonthly"></pre>
</div>
@@ -72,11 +68,6 @@ function update_daily() {
$("#listdaily").text(data['response']);
});
}
function update_weekly() {
ajaxCall(url="/api/vnstat/service/weekly", sendData={}, callback=function(data,status) {
$("#listweekly").text(data['response']);
});
}
function update_monthly() {
ajaxCall(url="/api/vnstat/service/monthly", sendData={}, callback=function(data,status) {
$("#listmonthly").text(data['response']);
@@ -95,7 +86,6 @@ $( document ).ready(function() {
// Call function update_neighbor with a auto-refresh of 3 seconds
setInterval(update_hourly, 3000);
setInterval(update_daily, 3000);
setInterval(update_weekly, 3000);
setInterval(update_monthly, 3000);
$("#saveAct").click(function(){
@@ -34,12 +34,6 @@ parameters:
type:script_output
message:request Vnstat daily status
[weekly]
command:/usr/local/bin/vnstat -w
parameters:
type:script_output
message:request Vnstat weekly status
[monthly]
command:/usr/local/bin/vnstat -m
parameters: