added ability to clear history
parent
f12bcf4989
commit
bcd558283d
|
@ -14,6 +14,9 @@ class InternetSpeedTest extends Module
|
|||
public function route()
|
||||
{
|
||||
switch ($this->request->action) {
|
||||
case 'clearTests':
|
||||
$this->clearTests();
|
||||
break;
|
||||
case 'clearLogFile':
|
||||
$this->clearLogFile();
|
||||
break;
|
||||
|
@ -73,6 +76,17 @@ class InternetSpeedTest extends Module
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// clearTests
|
||||
// this function will wipe all of the tests and test file inside the IST directory
|
||||
//
|
||||
private function clearTests()
|
||||
{
|
||||
exec("rm {$this->ALL_TESTS_FILE}");
|
||||
exec("rm -rf {$this->SPEED_TEST_DIR}");
|
||||
$this->makeSpeedTestsDir();
|
||||
}
|
||||
|
||||
//
|
||||
// runSpeedTest
|
||||
// this function will execute a wget command and download 50 MB worth of data
|
||||
|
|
|
@ -38,6 +38,17 @@ registerController("InternetSpeedTestController", ['$api', '$scope','$window','$
|
|||
});
|
||||
};
|
||||
|
||||
$scope.clearTests = function () {
|
||||
|
||||
$api.request({
|
||||
module: "InternetSpeedTest",
|
||||
action: "clearTests",
|
||||
}, function (response) {
|
||||
});
|
||||
|
||||
$window.location.reload()
|
||||
};
|
||||
|
||||
$scope.reloadPage = function () {
|
||||
$api.request({
|
||||
module: "InternetSpeedTest",
|
||||
|
|
|
@ -26,10 +26,18 @@
|
|||
</span>
|
||||
</div>
|
||||
|
||||
<div id="collapseLibrary" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<div class="input-group" ng-show="currentSpeedTest == false">
|
||||
</div>
|
||||
|
||||
|
||||
<hr ng-show="currentSpeedTest == false"/>
|
||||
|
||||
<div ng-show="previous.length > 0 && currentSpeedTest == false">
|
||||
<div class="table-responsive">
|
||||
|
||||
|
||||
<table class="table table-striped" align="center">
|
||||
<thead>
|
||||
<th>History</th>
|
||||
|
@ -46,6 +54,15 @@
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<span class="input-group-btn">
|
||||
<button ng-disabled="fileToLookup != ''"
|
||||
data-toggle="modal"
|
||||
data-target="#loadingModal"
|
||||
class="btn btn-default"
|
||||
type="button"
|
||||
ng-click="clearTests()">Clear History
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div ng-hide="previous.length != 0">
|
||||
|
|
Loading…
Reference in New Issue