A self hosted chat application with end-to-end encrypted messaging.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
984 B

4 years ago
4 years ago
4 years ago
4 years ago
  1. import { changePassphrase } from "./pages/user/ChangePassphrase";
  2. import { EncryptionServiceFactory } from "../common/service/EncryptionServiceFactory";
  3. import log from "loglevel";
  4. import { AlertifyNotificationService } from "../common/service/AlertifyNotificationService";
  5. import { stats } from "./pages/Home";
  6. import { Credentials } from "../common/global/Credentials";
  7. import { getOtherUsers } from "../common/ajax/Users";
  8. import { viewUsers } from "./pages/user/ViewUsers";
  9. log.setLevel("TRACE");
  10. const es = EncryptionServiceFactory.getEncryptionService();
  11. const ns = new AlertifyNotificationService();
  12. const authToken = Credentials.authToken;
  13. $("#changePassphraseForm").on("submit", (event) => {
  14. event.preventDefault();
  15. changePassphrase(es, ns, authToken);
  16. });
  17. const pathMatcher = (path: string) => window.location.pathname == path;
  18. if (pathMatcher("/admin")) {
  19. stats();
  20. }
  21. if (pathMatcher("/admin/users")) {
  22. // $("#usersTableBody").html("");
  23. viewUsers(authToken);
  24. }