From 046d0c65cfddcda960e7da0989d26507223b24f2 Mon Sep 17 00:00:00 2001 From: Thomas Durieux Date: Thu, 23 Sep 2021 18:33:21 +0200 Subject: [PATCH] feat: add basic admin dashboard (#90) --- public/index.html | 1 + public/partials/admin/conferences.htm | 290 +++++++++++++++++++ public/partials/admin/queues.htm | 86 ++++++ public/partials/admin/repositories.htm | 367 +++++++++++++++++++++++++ public/partials/admin/users.htm | 213 ++++++++++++++ public/partials/header.htm | 23 ++ public/script/admin.js | 206 ++++++++++++++ public/script/app.js | 21 ++ src/routes/admin.ts | 165 +++++++++++ src/routes/index.ts | 4 +- src/routes/user.ts | 6 +- src/server.ts | 1 + 12 files changed, 1381 insertions(+), 2 deletions(-) create mode 100644 public/partials/admin/conferences.htm create mode 100644 public/partials/admin/queues.htm create mode 100644 public/partials/admin/repositories.htm create mode 100644 public/partials/admin/users.htm create mode 100644 public/script/admin.js create mode 100644 src/routes/admin.ts diff --git a/public/index.html b/public/index.html index 0ad01da..b467ec5 100644 --- a/public/index.html +++ b/public/index.html @@ -74,6 +74,7 @@ + diff --git a/public/partials/admin/conferences.htm b/public/partials/admin/conferences.htm new file mode 100644 index 0000000..171f797 --- /dev/null +++ b/public/partials/admin/conferences.htm @@ -0,0 +1,290 @@ +
+
+
+
+
+
+
+ +
+ +
+ +
+ /{{totalPage}} +
+
+ +
+ + + +
+
+
+
+
+
    +
  • +
    +
    +

    + + +

    + + Conference ID: '{{conference.conferenceID}}' + +
    +
    + + + {{::conference.repositories.length || 0 | number}} + + + Total: {{conference.price || 0 | number}} € + + + + From {{conference.startDate | date}} to {{conference.endDate | + date}} +
    +
    + +
  • +
  • + There is no conference to display. +
  • +
+
+
diff --git a/public/partials/admin/queues.htm b/public/partials/admin/queues.htm new file mode 100644 index 0000000..3006c4b --- /dev/null +++ b/public/partials/admin/queues.htm @@ -0,0 +1,86 @@ +
+
+

Download jobs

+
    +
  • +
    + {{job}} +
    +
    + +
    +
  • +
  • + There is no job to display. +
  • +
+

Remove jobs

+
    +
  • +
    + {{job}} +
    +
    + +
    +
  • +
  • + There is no job to display. +
  • +
+
+
diff --git a/public/partials/admin/repositories.htm b/public/partials/admin/repositories.htm new file mode 100644 index 0000000..8874a6f --- /dev/null +++ b/public/partials/admin/repositories.htm @@ -0,0 +1,367 @@ +
+
+
+
+
+
+
+ +
+ +
+ +
+ /{{totalPage}} +
+
+ +
+ + + +
+
+
+
+
+
    +
  • +
    +
    +

    + + + +

    + + + + + + + + + + + @ + + anonymized {{repo.anonymizeDate | humanTime}} + +
    +
    + + + {{repo.conference}} + + + + {{::repo.options.terms.length | number}} + + + {{::repo.size.storage | + humanFileSize}} + + + {{::repo.pageView || 0 | number}} + + + + Last view: {{::repo.lastView | humanTime}} + + + Expire: {{repo.options.expirationDate | humanTime}} +
    +
    + +
  • +
  • + There is no repository to display. +
  • +
+
+
diff --git a/public/partials/admin/users.htm b/public/partials/admin/users.htm new file mode 100644 index 0000000..1edb6b5 --- /dev/null +++ b/public/partials/admin/users.htm @@ -0,0 +1,213 @@ +
+
+
+
+
+
+
+ +
+ +
+ +
+ /{{totalPage}} +
+
+ +
+ + + +
+
+
+
+
+ +
+
diff --git a/public/partials/header.htm b/public/partials/header.htm index 14cc323..f5fc973 100644 --- a/public/partials/header.htm +++ b/public/partials/header.htm @@ -47,6 +47,29 @@ >Anonymize +