Allow to set version number and build ID to the current Antos build

This commit is contained in:
DanyLE
2022-07-22 20:13:08 +02:00
parent 699c697344
commit da5bbdab60
5 changed files with 101 additions and 15 deletions

View File

@ -926,7 +926,11 @@ namespace OS {
* @export
*/
export function login(): void {
const scheme = $.parseHTML(schemes.login);
const scheme = $.parseHTML(
schemes.login
.replace("[ANTOS_BUILD_ID]", OS.VERSION.build_id)
.replace("[ANTOS_VERSION]", OS.VERSION.version_string)
);
$("#wrapper").append(scheme);
$("#btlogin").on("click", async function () {
const data: API.UserLoginType = {
@ -1060,12 +1064,13 @@ namespace OS {
schemes.login = `\
<div id = "login_form">
<p>Welcome to AntOS v${OS.VERSION.toString()}, please login</p>
<p>Welcome to AntOS, please login</p>
<input id = "txtuser" type = "text" value = "demo" ></input>
<input id = "txtpass" type = "password" value = "demo" ></input>
<button id = "btlogin">Login</button>
<div id = "login_error"></div>
</div>\
</div>
<div id = "antos_build_id"><a href="${OS.REPOSITORY}/tree/[ANTOS_BUILD_ID]">AntOS v[ANTOS_VERSION]</div>\
`;
}
}