-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsystem_settings.html
More file actions
164 lines (159 loc) · 6.15 KB
/
Copy pathsystem_settings.html
File metadata and controls
164 lines (159 loc) · 6.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>System Settings</title>
<link rel="stylesheet" href="style.css">
<style>
body {
font-family: var(--font-body);
background-color: var(--color-bg-parchment);
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
min-height: 100vh;
}
header {
background-color: var(--color-text-brown);
color: var(--color-accent-gold);
padding: 15px 20px;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
header h1 {
margin: 0;
font-size: 1.8em;
font-family: var(--font-heading);
color: var(--color-accent-gold);
}
nav ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
}
nav ul li {
margin-left: 20px;
}
nav ul li a {
color: var(--color-accent-gold);
text-decoration: none;
font-weight: bold;
transition: color var(--transition-speed);
}
nav ul li a:hover {
color: var(--color-accent-blue);
}
.container {
flex-grow: 1;
padding: 20px;
max-width: 1200px;
margin: 20px auto;
background-color: var(--color-bg-off-white);
border-radius: var(--border-radius-lg);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
h2 {
color: var(--color-text-charcoal);
margin-bottom: 25px;
border-bottom: 2px solid var(--color-highlight-orange);
padding-bottom: 10px;
}
footer {
margin-top: auto;
background-color: var(--color-text-brown);
color: var(--color-bg-off-white);
text-align: center;
padding: 15px 0;
font-size: 0.9em;
}
</style>
</head>
<body>
<header>
<h1>Admin Dashboard</h1>
<nav>
<ul>
<li><a href="/admin_dashboard.html">Dashboard</a></li>
<li><a href="/manage_users.html">Manage Users</a></li>
<li><a href="/manage_schools.html">Manage Schools</a></li>
<li><a href="/manage_curriculum.html">Manage Curriculum</a></li>
<li><a href="#" id="logout-button">Logout</a></li>
</ul>
</nav>
</header>
<main class="container">
<h2>System Settings</h2>
<h2>System Settings</h2>
<div id="settings-content">
<p>System settings configuration and monitoring will be displayed here.</p>
<p><em>(API endpoint for system settings not yet implemented)</em></p>
</div>
</main>
<footer>
© 2023 StudyQuest. All rights reserved.
</footer>
<script src="script.js"></script>
<script>
document.addEventListener('DOMContentLoaded', async () => {
const logoutButton = document.getElementById('logout-button');
if (logoutButton) {
logoutButton.addEventListener('click', async (event) => {
event.preventDefault();
try {
const response = await fetch('/logout', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
});
const data = await response.json();
if (response.ok) {
console.log(data.message);
localStorage.removeItem('currentUser');
localStorage.removeItem('currentSchool');
window.location.href = '/login.html';
} else {
alert(data.message || 'Logout failed.');
}
} catch (error) {
console.error('Error during logout:', error);
alert('An error occurred during logout.');
}
});
}
const settingsContentDiv = document.getElementById('settings-content');
// In a real application, you would fetch system settings here.
// For now, we'll just display a placeholder message.
// try {
// const response = await fetch('/api/admin/system-settings');
// if (!response.ok) {
// if (response.status === 403) {
// settingsContentDiv.innerHTML = '<p>Access Denied: You do not have administrative privileges.</p>';
// } else {
// throw new Error(`HTTP error! status: ${response.status}`);
// }
// return;
// }
// const settings = await response.json();
// // Render settings data
// settingsContentDiv.innerHTML = `
// <h3>General Settings</h3>
// <p>Platform Name: ${settings.platformName}</p>
// <p>Maintenance Mode: ${settings.maintenanceMode ? 'Enabled' : 'Disabled'}</p>
// <h3>Monitoring</h3>
// <p>Server Status: ${settings.serverStatus}</p>
// <p>Database Connection: ${settings.dbConnectionStatus}</p>
// `;
// } catch (error) {
// console.error('Error fetching system settings:', error);
// settingsContentDiv.innerHTML = `<p>Error loading system settings: ${error.message}</p>`;
// }
});
</script>
</body>
</html>