From b2cb0c4bf3a290f3b700c12a1c6150c40b6bd1c1 Mon Sep 17 00:00:00 2001 From: Roman Hergenreder Date: Sat, 20 Jun 2020 15:49:53 +0200 Subject: [PATCH] .htaccess + more pages & routes --- .htaccess | 10 ++-- .idea/.htaccess | 1 - core/Api/Stats.class.php | 1 + core/Configuration/CreateDatabase.class.php | 8 ++- core/Documents/Account.class.php | 60 +++++++++++++++++++++ core/Documents/Welcome.class.php | 55 +++++++++++++++++++ core/Driver/SQL/MySQL.class.php | 13 +++++ core/Driver/SQL/PostgreSQL.class.php | 13 +++++ core/Driver/SQL/SQL.class.php | 6 --- core/Elements/Document.class.php | 16 +++--- core/Elements/SimpleBody.class.php | 16 ++++++ core/Elements/View.class.php | 2 +- core/Views/Account/AcceptInvite.class.php | 21 ++++++++ core/Views/Account/ConfirmEmail.class.php | 21 ++++++++ core/Views/Account/Register.class.php | 21 ++++++++ core/core.php | 2 + js/admin.min.js | 2 +- src/src/views/overview.js | 1 + 18 files changed, 244 insertions(+), 25 deletions(-) delete mode 100644 .idea/.htaccess create mode 100644 core/Documents/Account.class.php create mode 100644 core/Documents/Welcome.class.php create mode 100644 core/Elements/SimpleBody.class.php create mode 100644 core/Views/Account/AcceptInvite.class.php create mode 100644 core/Views/Account/ConfirmEmail.class.php create mode 100644 core/Views/Account/Register.class.php diff --git a/.htaccess b/.htaccess index de6d1b9..ac1bc2f 100644 --- a/.htaccess +++ b/.htaccess @@ -1,18 +1,14 @@ php_flag display_errors on Options -Indexes -RedirectMatch 404 /\.idea -RedirectMatch 404 /\.git -RedirectMatch 404 /src -RedirectMatch 404 /test -RedirectMatch 404 /core - RewriteEngine On RewriteRule ^api(/.*)?$ /index.php?api=$1 [L,QSA] RewriteEngine On + DirectorySlash Off RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-d [OR] + RewriteCond %{REQUEST_URI} "(\.idea|\.git|src|test|core)(/.*)?" RewriteRule ^(.*)$ /index.php?site=$1 [L,QSA] \ No newline at end of file diff --git a/.idea/.htaccess b/.idea/.htaccess deleted file mode 100644 index 3bc3c22..0000000 --- a/.idea/.htaccess +++ /dev/null @@ -1 +0,0 @@ -DENY FROM ALL; \ No newline at end of file diff --git a/core/Api/Stats.class.php b/core/Api/Stats.class.php index f243ada..5cdb938 100644 --- a/core/Api/Stats.class.php +++ b/core/Api/Stats.class.php @@ -81,6 +81,7 @@ class Stats extends Request { $this->result["pageCount"] = $pageCount; $this->result["visitors"] = $visitorStatistics; $this->result["server"] = array( + "version" => WEBBASE_VERSION, "server" => $_SERVER["SERVER_SOFTWARE"] ?? "Unknown", "memory_usage" => memory_get_usage(), "load_avg" => sys_getloadavg(), diff --git a/core/Configuration/CreateDatabase.class.php b/core/Configuration/CreateDatabase.class.php index d3f2d2f..6eeb3df 100755 --- a/core/Configuration/CreateDatabase.class.php +++ b/core/Configuration/CreateDatabase.class.php @@ -128,8 +128,12 @@ class CreateDatabase { ->addBool("active", true) ->primaryKey("uid"); - $queries[] = $sql->insert("Route", array("request", "action", "target")) - ->addRow("^/admin(/.*)?$", "dynamic", "\\Documents\\AdminDashboard"); + $queries[] = $sql->insert("Route", array("request", "action", "target", "extra")) + ->addRow("^/admin(/.*)?$", "dynamic", "\\Documents\\AdminDashboard", NULL) + ->addRow("^/register(/)?$", "dynamic", "\\Documents\\Account", "\\Views\\Account\\Register") + ->addRow("^/confirmEmail(/)?$", "dynamic", "\\Documents\\Account", "\\Views\\Account\\ConfirmEmail") + ->addRow("^/acceptInvite(/)?$", "dynamic", "\\Documents\\Account", "\\Views\\Account\\AcceptInvite") + ->addRow("^/$", "dynamic", "\\Documents\\Welcome", NULL); return $queries; } diff --git a/core/Documents/Account.class.php b/core/Documents/Account.class.php new file mode 100644 index 0000000..3e729bd --- /dev/null +++ b/core/Documents/Account.class.php @@ -0,0 +1,60 @@ +getDocument()->getView(); + if ($view === null) { + return "The page you does not exist or is no longer valid. Return to start page"; + } + + return $view->getCode(); + } + } +} \ No newline at end of file diff --git a/core/Documents/Welcome.class.php b/core/Documents/Welcome.class.php new file mode 100644 index 0000000..687abaa --- /dev/null +++ b/core/Documents/Welcome.class.php @@ -0,0 +1,55 @@ +connection); } + + protected function buildCondition($condition, &$params) { + if($condition instanceof Regex) { + $left = $condition->getLeftExp(); + $right = $condition->getRightExp(); + $left = ($left instanceof Column) ? $this->columnName($left->getName()) : $this->addValue($left, $params); + $right = ($right instanceof Column) ? $this->columnName($right->getName()) : $this->addValue($right, $params); + return $left . " REGEXP " . $right; + } else { + return parent::buildCondition($condition, $params); + } + } } diff --git a/core/Driver/SQL/PostgreSQL.class.php b/core/Driver/SQL/PostgreSQL.class.php index edee896..9b5e988 100644 --- a/core/Driver/SQL/PostgreSQL.class.php +++ b/core/Driver/SQL/PostgreSQL.class.php @@ -13,6 +13,7 @@ use \Driver\SQL\Column\DateTimeColumn; use Driver\SQL\Column\BoolColumn; use Driver\SQL\Column\JsonColumn; +use Driver\SQL\Condition\Regex; use Driver\SQL\Expression\Add; use Driver\SQL\Strategy\Strategy; use Driver\SQL\Strategy\UpdateStrategy; @@ -301,4 +302,16 @@ class PostgreSQL extends SQL { return ($statusTexts[$status] ?? "Unknown") . " (v$version)"; } + + protected function buildCondition($condition, &$params) { + if($condition instanceof Regex) { + $left = $condition->getLeftExp(); + $right = $condition->getRightExp(); + $left = ($left instanceof Column) ? $this->columnName($left->getName()) : $this->addValue($left, $params); + $right = ($right instanceof Column) ? $this->columnName($right->getName()) : $this->addValue($right, $params); + return $left . " ~ " . $right; + } else { + return parent::buildCondition($condition, $params); + } + } } \ No newline at end of file diff --git a/core/Driver/SQL/SQL.class.php b/core/Driver/SQL/SQL.class.php index 341ba2c..b439ccd 100644 --- a/core/Driver/SQL/SQL.class.php +++ b/core/Driver/SQL/SQL.class.php @@ -332,12 +332,6 @@ abstract class SQL { } return implode(" AND ", $conditions); } - } else if ($condition instanceof Regex) { - $left = $condition->getLeftExp(); - $right = $condition->getRightExp(); - $left = ($left instanceof Column) ? $this->columnName($left->getName()) : $this->addValue($left, $params); - $right = ($right instanceof Column) ? $this->columnName($right->getName()) : $this->addValue($right, $params); - return $left . " REGEXP " . $right; } else { $this->lastError = "Unsupported condition type: " . get_class($condition); return false; diff --git a/core/Elements/Document.class.php b/core/Elements/Document.class.php index 41346bc..d0cc9a9 100644 --- a/core/Elements/Document.class.php +++ b/core/Elements/Document.class.php @@ -24,14 +24,15 @@ abstract class Document { public function getBody() { return $this->body; } public function getSQL() { return $this->user->getSQL(); } public function getUser() { return $this->user; } - public function getView() { return $this->activeView; } - protected function sendHeaders() { - header("X-Frame-Options: DENY"); - } + public function getView() : ?View { - public static function createSearchableDocument($documentClass, $user) { - return new $documentClass($user); + $file = getClassPath($this->activeView); + if(!file_exists($file) || !is_subclass_of($this->activeView, View::class)) { + return null; + } + + return new $this->activeView($this); } function getCode() { @@ -47,9 +48,10 @@ abstract class Document { $body = $this->body->getCode(); $head = $this->head->getCode(); + $lang = $this->user->getLanguage()->getShortCode(); $html = ""; - $html .= ""; + $html .= ""; $html .= $head; $html .= $body; $html .= ""; diff --git a/core/Elements/SimpleBody.class.php b/core/Elements/SimpleBody.class.php new file mode 100644 index 0000000..87f8712 --- /dev/null +++ b/core/Elements/SimpleBody.class.php @@ -0,0 +1,16 @@ +getContent(); + return parent::getCode() . "$content"; + } + + protected abstract function getContent(); +} \ No newline at end of file diff --git a/core/Elements/View.class.php b/core/Elements/View.class.php index 45b2c90..23e8841 100644 --- a/core/Elements/View.class.php +++ b/core/Elements/View.class.php @@ -83,7 +83,7 @@ abstract class View extends StaticView { if($classes) $iconClass .= " $classes"; - return ""; + return ""; } protected function createErrorText($text, $id="", $hidden=false) { diff --git a/core/Views/Account/AcceptInvite.class.php b/core/Views/Account/AcceptInvite.class.php new file mode 100644 index 0000000..83c1a96 --- /dev/null +++ b/core/Views/Account/AcceptInvite.class.php @@ -0,0 +1,21 @@ += 0 && i < this.state.errors.length) {\n var errors = this.state.errors.slice();\n errors.splice(i, 1);\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n errors: errors\n }));\n }\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n this.parent.api.getStats().then(function (res) {\n if (!res.success) {\n var errors = _this2.state.errors.slice();\n\n errors.push({\n message: res.msg,\n title: \"Error fetching Stats\"\n });\n\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n errors: errors\n }));\n } else {\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n userCount: res.userCount,\n pageCount: res.pageCount,\n visitors: res.visitors,\n server: res.server\n }));\n }\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n var colors = ['#ff4444', '#ffbb33', '#00C851', '#33b5e5', '#ff4444', '#ffbb33', '#00C851', '#33b5e5', '#ff4444', '#ffbb33', '#00C851', '#33b5e5'];\n var data = new Array(12).fill(0);\n var visitorCount = 0;\n\n for (var date in this.state.visitors) {\n var month = parseInt(date) % 100 - 1;\n\n if (month >= 0 && month < 12) {\n var count = parseInt(this.state.visitors[date]);\n data[month] = count;\n visitorCount += count;\n }\n }\n\n var chartOptions = {};\n var chartData = {\n labels: moment__WEBPACK_IMPORTED_MODULE_5___default.a.monthsShort(),\n datasets: [{\n label: 'Unique Visitors ' + moment__WEBPACK_IMPORTED_MODULE_5___default()().year(),\n borderWidth: 1,\n data: data,\n backgroundColor: colors\n }]\n };\n var errors = [];\n\n var _loop = function _loop(i) {\n errors.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_alert__WEBPACK_IMPORTED_MODULE_6__[\"default\"], _extends({\n key: \"error-\" + i,\n onClose: function onClose() {\n return _this3.removeError(i);\n }\n }, _this3.state.errors[i])));\n };\n\n for (var i = 0; i < this.state.errors.length; i++) {\n _loop(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"container-fluid\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row mb-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h1\", {\n className: \"m-0 text-dark\"\n }, \"Dashboard\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ol\", {\n className: \"breadcrumb float-sm-right\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/dashboard\"\n }, \"Home\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item active\"\n }, \"Dashboard\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"section\", {\n className: \"content\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"container-fluid\"\n }, errors, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-3 col-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"small-box bg-info\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"inner\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, this.state.userCount), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"p\", null, \"Users registered\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"icon\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"users\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/users\",\n className: \"small-box-footer\"\n }, \"More info \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"arrow-circle-right\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-3 col-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"small-box bg-success\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"inner\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, this.state.pageCount), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"p\", null, \"Routes & Pages\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"icon\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"copy\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/pages\",\n className: \"small-box-footer\"\n }, \"More info \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"arrow-circle-right\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-3 col-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"small-box bg-warning\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"inner\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, this.props.notifications.length), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"p\", null, \"new Notifications\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"icon\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"bell\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/logs\",\n className: \"small-box-footer\"\n }, \"More info \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"arrow-circle-right\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-3 col-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"small-box bg-danger\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"inner\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, visitorCount), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"p\", null, \"Unique Visitors\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"icon\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"chart-line\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/statistics\",\n className: \"small-box-footer\"\n }, \"More info \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"arrow-circle-right\"\n })))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-6 col-12\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card card-info\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", {\n className: \"card-title\"\n }, \"Unique Visitors this year\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-tools\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"button\", {\n type: \"button\",\n className: \"btn btn-tool\",\n onClick: function onClick(e) {\n e.preventDefault();\n\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n chartVisible: !_this3.state.chartVisible\n }));\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"minus\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_collapse__WEBPACK_IMPORTED_MODULE_4__[\"Collapse\"], {\n isOpened: this.state.chartVisible\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-body\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"chart\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_chartjs_2__WEBPACK_IMPORTED_MODULE_3__[\"Bar\"], {\n data: chartData,\n options: chartOptions\n })))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-6 col-12\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card card-warning\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", {\n className: \"card-title\"\n }, \"Server Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-tools\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"button\", {\n type: \"button\",\n className: \"btn btn-tool\",\n onClick: function onClick(e) {\n e.preventDefault();\n\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n statusVisible: !_this3.state.statusVisible\n }));\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"minus\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_collapse__WEBPACK_IMPORTED_MODULE_4__[\"Collapse\"], {\n isOpened: this.state.statusVisible\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-body\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ul\", {\n className: \"list-unstyled\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"b\", null, \"Server\"), \": \", this.state.server.server), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"b\", null, \"Memory Usage\"), \": \", Object(_global__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.state.server.memory_usage)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"b\", null, \"Load Average\"), \": \", this.state.server.load_avg.join(\" \")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"b\", null, \"Database\"), \": \", this.state.server.database), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"b\", null, \"Mail\"), \": \", this.state.server.mail === true ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"span\", null, \"OK\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"\",\n className: \"ml-2\"\n })) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/settings\"\n }, \"Not configured\"))))))))));\n }\n }]);\n\n return Overview;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]);\n\n\n\n//# sourceURL=webpack:///./src/views/overview.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Overview; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var _elements_icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../elements/icon */ \"./src/elements/icon.js\");\n/* harmony import */ var react_chartjs_2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-chartjs-2 */ \"./node_modules/react-chartjs-2/es/index.js\");\n/* harmony import */ var react_collapse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-collapse */ \"./node_modules/react-collapse/lib/index.js\");\n/* harmony import */ var react_collapse__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_collapse__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _elements_alert__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../elements/alert */ \"./src/elements/alert.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../global */ \"./src/global.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n\n\n\n\nvar Overview = /*#__PURE__*/function (_React$Component) {\n _inherits(Overview, _React$Component);\n\n var _super = _createSuper(Overview);\n\n function Overview(props) {\n var _this;\n\n _classCallCheck(this, Overview);\n\n _this = _super.call(this, props);\n _this.parent = {\n showDialog: props.showDialog,\n api: props.api\n };\n _this.state = {\n chartVisible: true,\n statusVisible: true,\n userCount: 0,\n notificationCount: 0,\n visitors: {},\n server: {\n load_avg: [\"Unknown\"]\n },\n errors: []\n };\n return _this;\n }\n\n _createClass(Overview, [{\n key: \"removeError\",\n value: function removeError(i) {\n if (i >= 0 && i < this.state.errors.length) {\n var errors = this.state.errors.slice();\n errors.splice(i, 1);\n this.setState(_objectSpread(_objectSpread({}, this.state), {}, {\n errors: errors\n }));\n }\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n this.parent.api.getStats().then(function (res) {\n if (!res.success) {\n var errors = _this2.state.errors.slice();\n\n errors.push({\n message: res.msg,\n title: \"Error fetching Stats\"\n });\n\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n errors: errors\n }));\n } else {\n _this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {\n userCount: res.userCount,\n pageCount: res.pageCount,\n visitors: res.visitors,\n server: res.server\n }));\n }\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n var colors = ['#ff4444', '#ffbb33', '#00C851', '#33b5e5', '#ff4444', '#ffbb33', '#00C851', '#33b5e5', '#ff4444', '#ffbb33', '#00C851', '#33b5e5'];\n var data = new Array(12).fill(0);\n var visitorCount = 0;\n\n for (var date in this.state.visitors) {\n var month = parseInt(date) % 100 - 1;\n\n if (month >= 0 && month < 12) {\n var count = parseInt(this.state.visitors[date]);\n data[month] = count;\n visitorCount += count;\n }\n }\n\n var chartOptions = {};\n var chartData = {\n labels: moment__WEBPACK_IMPORTED_MODULE_5___default.a.monthsShort(),\n datasets: [{\n label: 'Unique Visitors ' + moment__WEBPACK_IMPORTED_MODULE_5___default()().year(),\n borderWidth: 1,\n data: data,\n backgroundColor: colors\n }]\n };\n var errors = [];\n\n var _loop = function _loop(i) {\n errors.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_alert__WEBPACK_IMPORTED_MODULE_6__[\"default\"], _extends({\n key: \"error-\" + i,\n onClose: function onClose() {\n return _this3.removeError(i);\n }\n }, _this3.state.errors[i])));\n };\n\n for (var i = 0; i < this.state.errors.length; i++) {\n _loop(i);\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"content-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"container-fluid\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row mb-2\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h1\", {\n className: \"m-0 text-dark\"\n }, \"Dashboard\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-sm-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ol\", {\n className: \"breadcrumb float-sm-right\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/dashboard\"\n }, \"Home\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", {\n className: \"breadcrumb-item active\"\n }, \"Dashboard\")))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"section\", {\n className: \"content\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"container-fluid\"\n }, errors, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-3 col-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"small-box bg-info\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"inner\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, this.state.userCount), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"p\", null, \"Users registered\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"icon\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"users\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/users\",\n className: \"small-box-footer\"\n }, \"More info \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"arrow-circle-right\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-3 col-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"small-box bg-success\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"inner\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, this.state.pageCount), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"p\", null, \"Routes & Pages\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"icon\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"copy\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/pages\",\n className: \"small-box-footer\"\n }, \"More info \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"arrow-circle-right\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-3 col-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"small-box bg-warning\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"inner\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, this.props.notifications.length), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"p\", null, \"new Notifications\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"icon\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"bell\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/logs\",\n className: \"small-box-footer\"\n }, \"More info \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"arrow-circle-right\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-3 col-6\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"small-box bg-danger\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"inner\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", null, visitorCount), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"p\", null, \"Unique Visitors\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"icon\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"chart-line\"\n })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/statistics\",\n className: \"small-box-footer\"\n }, \"More info \", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"arrow-circle-right\"\n })))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"row\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-6 col-12\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card card-info\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", {\n className: \"card-title\"\n }, \"Unique Visitors this year\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-tools\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"button\", {\n type: \"button\",\n className: \"btn btn-tool\",\n onClick: function onClick(e) {\n e.preventDefault();\n\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n chartVisible: !_this3.state.chartVisible\n }));\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"minus\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_collapse__WEBPACK_IMPORTED_MODULE_4__[\"Collapse\"], {\n isOpened: this.state.chartVisible\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-body\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"chart\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_chartjs_2__WEBPACK_IMPORTED_MODULE_3__[\"Bar\"], {\n data: chartData,\n options: chartOptions\n })))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"col-lg-6 col-12\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card card-warning\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-header\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"h3\", {\n className: \"card-title\"\n }, \"Server Status\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-tools\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"button\", {\n type: \"button\",\n className: \"btn btn-tool\",\n onClick: function onClick(e) {\n e.preventDefault();\n\n _this3.setState(_objectSpread(_objectSpread({}, _this3.state), {}, {\n statusVisible: !_this3.state.statusVisible\n }));\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"minus\"\n })))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_collapse__WEBPACK_IMPORTED_MODULE_4__[\"Collapse\"], {\n isOpened: this.state.statusVisible\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"div\", {\n className: \"card-body\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"ul\", {\n className: \"list-unstyled\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"b\", null, \"Version\"), \": \", this.state.server.version), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"b\", null, \"Server\"), \": \", this.state.server.server), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"b\", null, \"Memory Usage\"), \": \", Object(_global__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.state.server.memory_usage)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"b\", null, \"Load Average\"), \": \", this.state.server.load_avg.join(\" \")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"b\", null, \"Database\"), \": \", this.state.server.database), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"li\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"b\", null, \"Mail\"), \": \", this.state.server.mail === true ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](\"span\", null, \"OK\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](_elements_icon__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n icon: \"\",\n className: \"ml-2\"\n })) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__[\"createElement\"](react_router_dom__WEBPACK_IMPORTED_MODULE_1__[\"Link\"], {\n to: \"/admin/settings\"\n }, \"Not configured\"))))))))));\n }\n }]);\n\n return Overview;\n}(react__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]);\n\n\n\n//# sourceURL=webpack:///./src/views/overview.js?"); /***/ }), diff --git a/src/src/views/overview.js b/src/src/views/overview.js index 94c0458..df0942d 100644 --- a/src/src/views/overview.js +++ b/src/src/views/overview.js @@ -198,6 +198,7 @@ export default class Overview extends React.Component {
    +
  • Version: {this.state.server.version}
  • Server: {this.state.server.server}
  • Memory Usage: {humanReadableSize(this.state.server.memory_usage)}
  • Load Average: { this.state.server.load_avg.join(" ") }