local-flights #5
@@ -37,9 +37,14 @@ http {
|
|||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Serve HTML files without .html extension (e.g., /admin -> admin.html)
|
||||||
|
location ~ ^/([a-zA-Z0-9_-]+)$ {
|
||||||
|
try_files /$1.html =404;
|
||||||
|
}
|
||||||
|
|
||||||
# Serve static files
|
# Serve static files
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ =404;
|
||||||
# Apply X-Frame-Options to other files
|
# Apply X-Frame-Options to other files
|
||||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<button class="btn btn-info" onclick="openBookInModal()">
|
<button class="btn btn-info" onclick="openBookInModal()">
|
||||||
🛬 Book In
|
🛬 Book In
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-primary" onclick="window.open('reports.html', '_blank')">
|
<button class="btn btn-primary" onclick="window.location.href = '/reports'">
|
||||||
📊 Reports
|
📊 Reports
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-warning" onclick="openUserManagementModal()" id="user-management-btn" style="display: none;">
|
<button class="btn btn-warning" onclick="openUserManagementModal()" id="user-management-btn" style="display: none;">
|
||||||
|
|||||||
@@ -317,7 +317,7 @@
|
|||||||
<h1>📊 PPR Reports</h1>
|
<h1>📊 PPR Reports</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-buttons">
|
<div class="menu-buttons">
|
||||||
<button class="btn btn-secondary" onclick="window.location.href='admin.html'">
|
<button class="btn btn-secondary" onclick="window.location.href='admin'">
|
||||||
← Back to Admin
|
← Back to Admin
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -466,7 +466,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// No valid cached token, redirect to admin
|
// No valid cached token, redirect to admin
|
||||||
window.location.href = 'admin.html';
|
window.location.href = 'admin';
|
||||||
}
|
}
|
||||||
|
|
||||||
function logout() {
|
function logout() {
|
||||||
@@ -475,13 +475,13 @@
|
|||||||
localStorage.removeItem('ppr_token_expiry');
|
localStorage.removeItem('ppr_token_expiry');
|
||||||
accessToken = null;
|
accessToken = null;
|
||||||
currentUser = null;
|
currentUser = null;
|
||||||
window.location.href = 'admin.html';
|
window.location.href = 'admin';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enhanced fetch wrapper with token expiry handling
|
// Enhanced fetch wrapper with token expiry handling
|
||||||
async function authenticatedFetch(url, options = {}) {
|
async function authenticatedFetch(url, options = {}) {
|
||||||
if (!accessToken) {
|
if (!accessToken) {
|
||||||
window.location.href = 'admin.html';
|
window.location.href = 'admin';
|
||||||
throw new Error('No access token available');
|
throw new Error('No access token available');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user