This commit is contained in:
lingdocs 2022-09-08 11:36:36 +04:00
parent c328e69476
commit 4fda7475f4
3 changed files with 11 additions and 2 deletions

View File

@ -17,7 +17,6 @@ import {
} from "../lib/user-utils";
import env from "../lib/env-vars";
import * as T from "../../../website/src/types/account-types";
import { getTimestamp } from "../lib/time-utils";
export const outsideProviders: ("github" | "google" | "twitter")[] = ["github", "google", "twitter"];

View File

@ -154,7 +154,11 @@ const authRouter = (passport: PassportStatic) => {
const users = (await getAllLingdocsUsers()).sort((a, b) => (
(a.accountCreated || 0) - (b.accountCreated || 0)
));
res.render("admin", { users });
const tests = new Set<string>();
users.forEach(u => u.tests.forEach(t => (
tests.add(t.id)
)));
res.render("admin", { users, tests: Array.from(tests) });
} catch (e) {
next(e);
}

View File

@ -100,6 +100,12 @@
<% } %>
</tbody>
</table>
<div>
<h5>Tests Completed</h5>
<% for(var i=0; i < tests.length; i++) { %>
<div><%= tests[i] %></div>
<% } %>
</div>
</div>
</body>
</html>