From 9822be5df416795e4490a425958073fba41b9ff9 Mon Sep 17 00:00:00 2001
From: Eric Lighthall <55029902+Eric-Lighthall@users.noreply.github.com>
Date: Sat, 20 Apr 2024 01:06:53 -0700
Subject: [PATCH 1/3] Add version service module for fetching server
information
this centralizes the handling of requests to get the server information
---
src/services/VersionService.js | 49 ++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100644 src/services/VersionService.js
diff --git a/src/services/VersionService.js b/src/services/VersionService.js
new file mode 100644
index 000000000..2aadf3bc5
--- /dev/null
+++ b/src/services/VersionService.js
@@ -0,0 +1,49 @@
+/**
+ * Copyright (C) 2024 Puter Technologies Inc.
+ *
+ * This file is part of Puter.
+ *
+ * Puter is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see
${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; } From 338d925bcc93c3959809b4389548cc39a21d2ff0 Mon Sep 17 00:00:00 2001 From: Eric Lighthall <55029902+Eric-Lighthall@users.noreply.github.com> Date: Sat, 20 Apr 2024 02:24:33 -0700 Subject: [PATCH 3/3] Fetch server info from versionservice.js module Instead of directly fetching for the version info in UITabAbout.js, the module is now used for it --- src/UI/Settings/UITabAbout.js | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/src/UI/Settings/UITabAbout.js b/src/UI/Settings/UITabAbout.js index 8a6631b67..f53a587b9 100644 --- a/src/UI/Settings/UITabAbout.js +++ b/src/UI/Settings/UITabAbout.js @@ -17,6 +17,8 @@ * along with this program. If not, see