File size: 4,817 Bytes
81f3119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
165
166
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard</title>
<link rel="stylesheet" href="css/styles.css">
</head>

<body class="dashboard-page">

<div class="dashboard-shell admin-layout">
	<aside class="sidebar glass-panel">
		<div class="sidebar-top">
			<div>
				<div class="brand-badge">Admin Hub</div>
				<h1 class="sidebar-title">Document Control Center</h1>
			</div>
			<button class="ghost-btn small" type="button" onclick="window.location='search.html'">Assistant</button>
		</div>

		<div class="sidebar-section">
			<div class="section-heading-row">
				<h3>Uploaded Documents</h3>
				<span class="pill" id="adminDocumentsCount">0</span>
			</div>
			<div id="adminSidebarDocuments" class="stack-list"></div>
		</div>

		<div class="sidebar-section">
			<div class="section-heading-row">
				<h3>Recent History</h3>
				<span class="pill" id="adminHistoryCount">0</span>
			</div>
			<div id="adminHistoryList" class="stack-list"></div>
		</div>

		<div class="sidebar-section">
			<div class="section-heading-row">
				<h3>Most Searched Docs</h3>
				<span class="pill accent">Insights</span>
			</div>
			<div id="adminTopDocsList" class="stack-list"></div>
		</div>
	</aside>

	<main class="workspace-main">
		<header class="topbar glass-panel">
			<div>
				<p class="eyebrow">Admin dashboard</p>
				<h2>Manage documents, users, and analytics</h2>
			</div>

			<div class="topbar-actions">
				<button class="ghost-btn" id="adminLogoutButton" type="button">Logout</button>
				<button class="profile-button" id="adminProfileButton" type="button">
					<span class="profile-avatar" id="adminProfileAvatar">A</span>
					<span>
						<strong id="adminProfileName">Admin</strong>
						<small id="adminProfileRole">Administrator</small>
					</span>
				</button>
			</div>
		</header>

		<section class="hero-banner glass-panel compact-hero">
			<div>
				<p class="eyebrow">Operations overview</p>
				<h3>Keep the knowledge base current and measurable.</h3>
				<p class="hero-copy">
					Upload new files, review usage trends, track active users, and manage the document set
					without changing the backend.
				</p>
			</div>

			<div class="hero-stats stats-grid-4" id="statsCards">
				<div class="stat-card">
					<span class="stat-label">Documents</span>
					<strong id="statDocuments">0</strong>
				</div>
				<div class="stat-card">
					<span class="stat-label">Chunks</span>
					<strong id="statChunks">0</strong>
				</div>
				<div class="stat-card">
					<span class="stat-label">Users</span>
					<strong id="statUsers">0</strong>
				</div>
				<div class="stat-card">
					<span class="stat-label">Queries</span>
					<strong id="statQueries">0</strong>
				</div>
			</div>
		</section>

		<section class="admin-grid">
			<article class="glass-panel card-section upload-card">
				<div class="section-heading-row">
					<div>
						<p class="eyebrow">Upload</p>
						<h3>Add a new document</h3>
					</div>
				</div>

				<div class="upload-box">
					<input type="file" id="fileInput">
					<button class="primary-btn" onclick="uploadFile()">Upload Document</button>
				</div>
				<p id="uploadStatus" class="muted-text">PDF and DOCX files are supported.</p>
			</article>

			<article class="glass-panel card-section">
				<div class="section-heading-row">
					<div>
						<p class="eyebrow">Documents</p>
						<h3>Uploaded files</h3>
					</div>
					<button class="ghost-btn small" onclick="loadDocuments()">Refresh</button>
				</div>
				<div id="documents" class="table-list"></div>
			</article>

			<article class="glass-panel card-section">
				<div class="section-heading-row">
					<div>
						<p class="eyebrow">Analytics</p>
						<h3>Usage insights</h3>
					</div>
					<button class="ghost-btn small" onclick="loadAnalytics()">Refresh</button>
				</div>
				<div id="analytics" class="analytics-panel"></div>
			</article>

			<article class="glass-panel card-section">
				<div class="section-heading-row">
					<div>
						<p class="eyebrow">Users</p>
						<h3>Workspace members</h3>
					</div>
					<button class="ghost-btn small" onclick="loadUsers()">Refresh</button>
				</div>
				<div id="usersPanel" class="table-list"></div>
			</article>
		</section>
	</main>
</div>

<div id="adminProfileOverlay" class="drawer-overlay"></div>
<aside id="adminProfileDrawer" class="profile-drawer glass-panel">
	<div class="drawer-header">
		<div>
			<p class="eyebrow">Administrator</p>
			<h3>Profile and controls</h3>
		</div>
		<button class="ghost-btn small" id="closeAdminProfile" type="button">Close</button>
	</div>

	<div id="adminProfileDetails" class="profile-content"></div>
</aside>

<script src="js/api.js"></script>

</body>

</html>