Merge branch 'alpha' into dev

This commit is contained in:
Henry Whitaker
2021-04-10 16:35:20 +01:00
5 changed files with 43 additions and 89 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Exceptions\SpeedtestFailureException;
use App\Helpers\SpeedtestHelper; use App\Helpers\SpeedtestHelper;
use App\Interfaces\SpeedtestProvider; use App\Interfaces\SpeedtestProvider;
use Illuminate\Console\Command; use Illuminate\Console\Command;
@@ -45,9 +46,9 @@ class SpeedtestCommand extends Command
{ {
$this->info('Running speedtest, this might take a while...'); $this->info('Running speedtest, this might take a while...');
$results = $this->speedtestProvider->run(false, false); try {
$results = $this->speedtestProvider->run(false, false);
if (!is_object($results)) { } catch (SpeedtestFailureException $e) {
$this->error('Something went wrong running the speedtest.'); $this->error('Something went wrong running the speedtest.');
exit(); exit();
} }

View File

@@ -28,7 +28,6 @@
"brianium/paratest": "^6.2", "brianium/paratest": "^6.2",
"facade/ignition": "^2.3.6", "facade/ignition": "^2.3.6",
"fzaninotto/faker": "^1.9.1", "fzaninotto/faker": "^1.9.1",
"itsgoingd/clockwork": "^5.0",
"mockery/mockery": "^1.3.1", "mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^5.3", "nunomaduro/collision": "^5.3",
"nunomaduro/larastan": "^0.7.0", "nunomaduro/larastan": "^0.7.0",

71
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "102adc5121f97ad3ad15009f410fb8fa", "content-hash": "2c905613bf401a9978baa23d1a80b710",
"packages": [ "packages": [
{ {
"name": "asm89/stack-cors", "name": "asm89/stack-cors",
@@ -6850,75 +6850,6 @@
}, },
"time": "2020-07-09T08:09:16+00:00" "time": "2020-07-09T08:09:16+00:00"
}, },
{
"name": "itsgoingd/clockwork",
"version": "v5.0.6",
"source": {
"type": "git",
"url": "https://github.com/itsgoingd/clockwork.git",
"reference": "1de3f9f9fc22217aa024f79ecbdf0fde418fc0a1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/itsgoingd/clockwork/zipball/1de3f9f9fc22217aa024f79ecbdf0fde418fc0a1",
"reference": "1de3f9f9fc22217aa024f79ecbdf0fde418fc0a1",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": ">=5.6",
"psr/log": "1.*"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Clockwork\\Support\\Laravel\\ClockworkServiceProvider"
],
"aliases": {
"Clockwork": "Clockwork\\Support\\Laravel\\Facade"
}
}
},
"autoload": {
"psr-4": {
"Clockwork\\": "Clockwork/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "itsgoingd",
"email": "itsgoingd@luzer.sk",
"homepage": "https://twitter.com/itsgoingd"
}
],
"description": "php dev tools in your browser",
"homepage": "https://underground.works/clockwork",
"keywords": [
"Devtools",
"debugging",
"laravel",
"logging",
"lumen",
"profiling",
"slim"
],
"support": {
"issues": "https://github.com/itsgoingd/clockwork/issues",
"source": "https://github.com/itsgoingd/clockwork/tree/v5.0.6"
},
"funding": [
{
"url": "https://github.com/itsgoingd",
"type": "github"
}
],
"time": "2020-12-27T00:18:25+00:00"
},
{ {
"name": "justinrainbow/json-schema", "name": "justinrainbow/json-schema",
"version": "5.2.10", "version": "5.2.10",

28
public/js/app.js vendored
View File

@@ -146804,18 +146804,30 @@ var TableRow = /*#__PURE__*/function (_Component) {
} }
}, "Delete")))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null)); }, "Delete")))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null));
} else { } else {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, e.id), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, new Date(e.created_at).toLocaleString()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, fields.visible.map(function (e, i) {
className: "ti-close text-danger" console.log(e);
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", {
className: "ti-close text-danger" if (e.name === 'created_at') {
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", {
className: "ti-close text-danger" key: i
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_2__["Button"], { }, new Date(e.value).toLocaleString());
} else if (e.name === 'id') {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", {
key: i
}, e.value);
}
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", {
key: i
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", {
className: "ti-close text-danger"
}));
}), window.config.auth && window.authenticated || !window.config.auth ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_2__["Button"], {
variant: "danger", variant: "danger",
onClick: function onClick() { onClick: function onClick() {
_this2["delete"](e.id); _this2["delete"](e.id);
} }
}, "Delete"))); }, "Delete")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null));
} }
} }
}]); }]);

View File

@@ -28,7 +28,7 @@ export default class TableRow extends Component {
} }
delete = (id) => { delete = (id) => {
var url = 'api/speedtest/delete/' + id; var url = 'api/speedtest/delete/' + id + '?token=' + window.token;
Axios.delete(url) Axios.delete(url)
.then((resp) => { .then((resp) => {
@@ -134,12 +134,23 @@ export default class TableRow extends Component {
} else { } else {
return ( return (
<tr> <tr>
<td>{e.id}</td> {fields.visible.map((e, i) => {
<td>{new Date(e.created_at).toLocaleString()}</td> console.log(e);
<td><span className="ti-close text-danger"></span></td> if(e.name === 'created_at') {
<td><span className="ti-close text-danger"></span></td> return <td key={i}>{new Date(e.value).toLocaleString()}</td>
<td><span className="ti-close text-danger"></span></td> } else if (e.name === 'id') {
<td><Button variant="danger" onClick={() => { this.delete(e.id) }}>Delete</Button></td> return <td key={i}>{e.value}</td>
}
return (
<td key={i}><span className="ti-close text-danger"></span></td>
);
})}
{(window.config.auth && window.authenticated) || !window.config.auth ?
<td><Button variant="danger" onClick={() => { this.delete(e.id) }}>Delete</Button></td>
:
<td></td>
}
</tr> </tr>
); );
} }