Fix itny bugs

This commit is contained in:
Henry Whitaker
2021-04-10 13:48:03 +01:00
parent b82b7c6307
commit f92c040f63
3 changed files with 41 additions and 17 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();
} }

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

@@ -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>
); );
} }