✨feature: Use single file for global navigation, include on other pages
This commit is contained in:
11
config.php
11
config.php
@@ -35,6 +35,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' ) {
|
||||
|
||||
if (! is_string( $token ) || trim( $token ) === '') {
|
||||
$envToken = getenv( 'SPACETRADERS_TOKEN' );
|
||||
|
||||
if (is_string( $envToken ) && trim( $envToken ) !== '' ) {
|
||||
$token = trim( $envToken );
|
||||
$storage->setAgentToken( $token );
|
||||
@@ -56,7 +57,9 @@ $hasToken = is_string( $token ) && trim( $token ) !== '';
|
||||
</head>
|
||||
|
||||
<body class="container mx-auto px-4 py-8 bg-stone-800 text-gray-200">
|
||||
<h1 class="text-3xl font-bold mb-6 underline decoration-gray-300 w-full">Spacetraders Configuration</h1>
|
||||
<?php require __DIR__ . '/main-menu.php'; ?>
|
||||
|
||||
<h1 class="text-3xl font-bold mb-6 underline decoration-gray-300 w-full"><a href="config.php">Spacetraders - Configuration</a></h1>
|
||||
|
||||
<div class="mb-6 border border-gray-600 p-4 rounded">
|
||||
<p class="mb-2 text-sm text-gray-300">
|
||||
@@ -89,11 +92,5 @@ $hasToken = is_string( $token ) && trim( $token ) !== '';
|
||||
<button type="submit" name="clear_cache" value="1" class="px-4 py-2 bg-gray-600 rounded hover:bg-gray-500">Clear Cache</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-4">
|
||||
<a href="index.php" class="text-blue-400 hover:underline">Agent Info</a>
|
||||
<a href="buy-ships.php" class="text-blue-400 hover:underline">Buy Ships</a>
|
||||
<a href="mining-fleet.php" class="text-blue-400 hover:underline">Mining Fleet</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user