diff --git a/src/UI/UIWindowLogin.js b/src/UI/UIWindowLogin.js index 6cbb97337..ea3b1e606 100644 --- a/src/UI/UIWindowLogin.js +++ b/src/UI/UIWindowLogin.js @@ -20,6 +20,7 @@ import UIWindow from './UIWindow.js' import UIWindowSignup from './UIWindowSignup.js' import UIWindowRecoverPassword from './UIWindowRecoverPassword.js' +import { fetchServerInfo } from '../services/VersionService.js'; async function UIWindowLogin(options){ options = options ?? {}; @@ -59,6 +60,8 @@ async function UIWindowLogin(options){ h += ``; // password recovery h += `
${i18n('forgot_pass_c2a')}
`; + // server and version info + h += ``; h += ``; h += ``; // create account link @@ -68,6 +71,16 @@ async function UIWindowLogin(options){ h += ``; } h += ``; + + // server and version infomration + fetchServerInfo(api_origin, auth_token) + .then(res => { + const deployed_date = new Date(res.deployTimestamp).toLocaleString(); + $("#version-placeholder").html(`Version: ${res.version} • Server: ${res.location} • Deployed: ${deployed_date}`); + }) + .catch(() => { + $("#version-placeholder").html("Failed to load version or server information."); + }); const el_window = await UIWindow({ title: null, diff --git a/src/css/style.css b/src/css/style.css index cabcd58a5..f466d84b4 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -3601,6 +3601,11 @@ label { height: 12px; } +.version#version-placeholder { + margin-top: 10px; + margin-bottom: 0; +} + .version:hover { opacity: 1; }