diff --git a/src/installer/index.php b/src/installer/index.php index 47cfaa1..449c719 100644 --- a/src/installer/index.php +++ b/src/installer/index.php @@ -36,9 +36,10 @@ $pageContent = ob_get_clean(); Step <?= $stepNumber ?> | TS-website 2.0 Installer - - + + - - - - - + + diff --git a/src/installer/pages/4.php b/src/installer/pages/4.php index 84c4f20..71cd6ac 100644 --- a/src/installer/pages/4.php +++ b/src/installer/pages/4.php @@ -2,6 +2,8 @@ if(!defined("__TSWEBSITE_VERSION")) die("Direct access not allowed"); use Wruczek\TSWebsite\Config; +use Wruczek\TSWebsite\ServerIconCache; +use Wruczek\TSWebsite\Utils\ApiUtils; if (!empty($_POST)) { $queryhostname = trim($_POST["queryhostname"]); @@ -35,12 +37,14 @@ if (!empty($_POST)) { ]; foreach ($configdata as $key => $value) { - if(!$utils->setValue($key, $value)) { - die("Error while inserting query data to database, at " . htmlspecialchars($key) . " => " . htmlspecialchars($value)); + try { + $utils->setValue($key, $value); + } catch (\Exception $e) { + die("Error while updating config in database, at " . htmlspecialchars($key) . " => " . htmlspecialchars($value)); } } - header("Location: ?step=" . ($stepNumber + 1)); + $cacheIcons = true; } else { $errormessage .= '
Cannot retrieve server information'; } @@ -58,6 +62,21 @@ if (!empty($_POST)) { } } } + +if (isset($_GET["syncicons"])) { + require_once __PRIVATE_DIR . "/vendor/autoload.php"; + + set_time_limit(0); // this might take a while + + try { + ServerIconCache::syncIcons(); + ApiUtils::jsonSuccess(); + } catch (\Exception $e) { + ApiUtils::jsonError($e->getMessage(), $e->getCode()); + } + + exit; +} ?> @@ -95,96 +114,131 @@ if (!empty($_POST)) { -
+ -
-

Query details

- -
-
"> - -
-
- -
- -
- - - -
+
+
+
+
+ Loading...
- -
-
-
- -
- -
- -
-
- -
- -
-
- -

- Default query port: 10011, default server port: 9987. -

- -
-
- -
- -
- - - -
-
- -
-
- -
- -
- -
-
- -
- -
- - - -
-
- - -

Query permissions required by TS-website

-
- - - + Caching icons from the TS3 server, please wait... +
- + + + + + +