diff --git a/InternetSpeedTest/api/module.php b/InternetSpeedTest/api/module.php index f4f1984..65d74e6 100644 --- a/InternetSpeedTest/api/module.php +++ b/InternetSpeedTest/api/module.php @@ -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 diff --git a/InternetSpeedTest/js/module.js b/InternetSpeedTest/js/module.js index 23ee0b6..28c09c1 100644 --- a/InternetSpeedTest/js/module.js +++ b/InternetSpeedTest/js/module.js @@ -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", diff --git a/InternetSpeedTest/module.html b/InternetSpeedTest/module.html index 5d0a578..bb55322 100644 --- a/InternetSpeedTest/module.html +++ b/InternetSpeedTest/module.html @@ -26,10 +26,18 @@ +
| History | @@ -46,6 +54,15 @@
|---|