mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-24 06:28:27 +01:00
Added scheduling for speedtest
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use App\Helpers\SpeedtestHelper;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
@@ -24,7 +25,9 @@ class Kernel extends ConsoleKernel
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
// $schedule->command('inspire')->hourly();
|
||||
$schedule->call(function() {
|
||||
SpeedtestHelper::runSpeedtest();
|
||||
})->hourly();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
4
public/css/main.css
vendored
4
public/css/main.css
vendored
@@ -39,3 +39,7 @@
|
||||
.form-control:focus {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.Toastify__toast--info {
|
||||
background: #1f5a81 !important;
|
||||
}
|
||||
|
||||
19
public/js/app.js
vendored
19
public/js/app.js
vendored
@@ -126781,8 +126781,8 @@ var HistoryGraph = /*#__PURE__*/function (_Component) {
|
||||
duData.datasets[0].data.push(download);
|
||||
duData.datasets[1].data.push(upload);
|
||||
pingData.datasets[0].data.push(ping);
|
||||
duData.labels.push(new Date(e.created_at).toLocaleDateString());
|
||||
pingData.labels.push(new Date(e.created_at).toLocaleDateString());
|
||||
duData.labels.push(new Date(e.created_at).toLocaleString());
|
||||
pingData.labels.push(new Date(e.created_at).toLocaleString());
|
||||
});
|
||||
|
||||
_this.setState({
|
||||
@@ -126853,16 +126853,18 @@ var HistoryGraph = /*#__PURE__*/function (_Component) {
|
||||
}
|
||||
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
|
||||
className: "text-center"
|
||||
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
|
||||
className: "d-inline-flex align-items-center mb-2"
|
||||
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h4", {
|
||||
className: "d-inline"
|
||||
className: "d-inline mb-0"
|
||||
}, "Show results for the last"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_3__["Form"].Control, {
|
||||
id: "duDaysInput",
|
||||
className: "d-inline mx-2",
|
||||
className: "d-inline-block mx-2",
|
||||
defaultValue: days,
|
||||
onInput: this.updateDays
|
||||
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h4", {
|
||||
className: "d-inline"
|
||||
}, "days"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p", {
|
||||
className: "d-inline mb-0"
|
||||
}, "days")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("p", {
|
||||
className: "text-muted"
|
||||
}, "This data refreshes every 10 seconds")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_3__["Row"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_3__["Col"], {
|
||||
lg: {
|
||||
@@ -127030,6 +127032,11 @@ var LatestResults = /*#__PURE__*/function (_Component) {
|
||||
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_4__["Container"], {
|
||||
fluid: true
|
||||
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_4__["Row"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_4__["Col"], {
|
||||
sm: {
|
||||
span: 12
|
||||
},
|
||||
className: "text-center"
|
||||
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h4", null, "Latest test results:"))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_4__["Row"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_4__["Col"], {
|
||||
lg: {
|
||||
span: 2,
|
||||
offset: 3
|
||||
|
||||
12
resources/js/components/Graphics/HistoryGraph.js
vendored
12
resources/js/components/Graphics/HistoryGraph.js
vendored
@@ -103,8 +103,8 @@ export default class HistoryGraph extends Component {
|
||||
duData.datasets[0].data.push(download);
|
||||
duData.datasets[1].data.push(upload);
|
||||
pingData.datasets[0].data.push(ping);
|
||||
duData.labels.push(new Date(e.created_at).toLocaleDateString());
|
||||
pingData.labels.push(new Date(e.created_at).toLocaleDateString());
|
||||
duData.labels.push(new Date(e.created_at).toLocaleString());
|
||||
pingData.labels.push(new Date(e.created_at).toLocaleString());
|
||||
});
|
||||
|
||||
this.setState({
|
||||
@@ -154,9 +154,11 @@ export default class HistoryGraph extends Component {
|
||||
<Row>
|
||||
<Col sm={{ span: 12 }}>
|
||||
<div className="text-center">
|
||||
<h4 className="d-inline">Show results for the last</h4>
|
||||
<Form.Control id="duDaysInput" className="d-inline mx-2" defaultValue={days} onInput={this.updateDays}></Form.Control>
|
||||
<h4 className="d-inline">days</h4>
|
||||
<div className="d-inline-flex align-items-center mb-2">
|
||||
<h4 className="d-inline mb-0">Show results for the last</h4>
|
||||
<Form.Control id="duDaysInput" className="d-inline-block mx-2" defaultValue={days} onInput={this.updateDays}></Form.Control>
|
||||
<h4 className="d-inline mb-0">days</h4>
|
||||
</div>
|
||||
<p className="text-muted">This data refreshes every 10 seconds</p>
|
||||
</div>
|
||||
</Col>
|
||||
|
||||
@@ -57,6 +57,11 @@ export default class LatestResults extends Component {
|
||||
} else {
|
||||
return (
|
||||
<Container fluid>
|
||||
<Row>
|
||||
<Col sm={{ span: 12 }} className="text-center">
|
||||
<h4>Latest test results:</h4>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row>
|
||||
<Col
|
||||
lg={{ span: 2, offset: 3 }}
|
||||
|
||||
Reference in New Issue
Block a user