mirror of
https://github.com/HeyPuter/puter
synced 2024-11-15 06:15:47 +00:00
Add server/version info on login page
The server/version info is under the forgot password section of the login page
This commit is contained in:
parent
9822be5df4
commit
7e2c4a0a1c
@ -20,6 +20,7 @@
|
|||||||
import UIWindow from './UIWindow.js'
|
import UIWindow from './UIWindow.js'
|
||||||
import UIWindowSignup from './UIWindowSignup.js'
|
import UIWindowSignup from './UIWindowSignup.js'
|
||||||
import UIWindowRecoverPassword from './UIWindowRecoverPassword.js'
|
import UIWindowRecoverPassword from './UIWindowRecoverPassword.js'
|
||||||
|
import { fetchServerInfo } from '../services/VersionService.js';
|
||||||
|
|
||||||
async function UIWindowLogin(options){
|
async function UIWindowLogin(options){
|
||||||
options = options ?? {};
|
options = options ?? {};
|
||||||
@ -59,6 +60,8 @@ async function UIWindowLogin(options){
|
|||||||
h += `<button class="login-btn button button-primary button-block button-normal">${i18n('log_in')}</button>`;
|
h += `<button class="login-btn button button-primary button-block button-normal">${i18n('log_in')}</button>`;
|
||||||
// password recovery
|
// password recovery
|
||||||
h += `<p style="text-align:center; margin-bottom: 0;"><span class="forgot-password-link">${i18n('forgot_pass_c2a')}</span></p>`;
|
h += `<p style="text-align:center; margin-bottom: 0;"><span class="forgot-password-link">${i18n('forgot_pass_c2a')}</span></p>`;
|
||||||
|
// server and version info
|
||||||
|
h += `<div id="version-placeholder" class="version" style="text-align:center;"></div>`;
|
||||||
h += `</form>`;
|
h += `</form>`;
|
||||||
h += `</div>`;
|
h += `</div>`;
|
||||||
// create account link
|
// create account link
|
||||||
@ -69,6 +72,16 @@ async function UIWindowLogin(options){
|
|||||||
}
|
}
|
||||||
h += `</div>`;
|
h += `</div>`;
|
||||||
|
|
||||||
|
// 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({
|
const el_window = await UIWindow({
|
||||||
title: null,
|
title: null,
|
||||||
app: 'login',
|
app: 'login',
|
||||||
|
@ -3601,6 +3601,11 @@ label {
|
|||||||
height: 12px;
|
height: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.version#version-placeholder {
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.version:hover {
|
.version:hover {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user