From b99668f4f2e4b410a8e18528fa7cecdd5f3a0cb8 Mon Sep 17 00:00:00 2001 From: DanyLE Date: Mon, 18 Mar 2024 17:06:53 +0100 Subject: [PATCH] feat: Setting displays versions info --- d.ts/antos.d.ts | 7 +++++++ src/core/handles/RemoteHandle.ts | 11 +++++++++++ src/packages/Setting/Makefile | 2 +- src/packages/Setting/main.css | 5 +++++ src/packages/Setting/main.ts | 2 ++ src/packages/Setting/package.json | 2 +- src/packages/Setting/scheme.html | 27 ++++++++++++--------------- 7 files changed, 39 insertions(+), 17 deletions(-) diff --git a/d.ts/antos.d.ts b/d.ts/antos.d.ts index 1164651..ade00cf 100644 --- a/d.ts/antos.d.ts +++ b/d.ts/antos.d.ts @@ -284,6 +284,13 @@ declare namespace OS { * @returns {Promise} a promise on a {@link RequestResult} */ function setting(): Promise; + /** + * Query the current versions of all system components + * + * @export + * @returns {Promise} a promise on a {@link RequestResult} + */ + function versions(): Promise; } } } diff --git a/src/core/handles/RemoteHandle.ts b/src/core/handles/RemoteHandle.ts index 0457869..e704e68 100644 --- a/src/core/handles/RemoteHandle.ts +++ b/src/core/handles/RemoteHandle.ts @@ -413,6 +413,17 @@ namespace OS { const p = `${API.REST}/system/settings`; return API.post(p, OS.setting); } + + /** + * Query the current versions of all system components + * + * @export + * @returns {Promise} a promise on a {@link RequestResult} + */ + export function versions(): Promise { + const p = `${API.REST}/system/version`; + return API.get(p); + } } } } diff --git a/src/packages/Setting/Makefile b/src/packages/Setting/Makefile index eb403ca..49907ed 100644 --- a/src/packages/Setting/Makefile +++ b/src/packages/Setting/Makefile @@ -1,4 +1,4 @@ -module_files = main.js AppearanceHandle.js AppAndServiceHandle.js VFSHandle.js LocaleHandle.js StartupHandle.js +module_files = main.js AppearanceHandle.js AppAndServiceHandle.js VFSHandle.js LocaleHandle.js StartupHandle.js VersionsHandle.js libfiles = diff --git a/src/packages/Setting/main.css b/src/packages/Setting/main.css index abeace3..8418f29 100644 --- a/src/packages/Setting/main.css +++ b/src/packages/Setting/main.css @@ -40,6 +40,11 @@ afx-app-window[data-id = "setting-window"] afx-hbox[data-id="startup"] afx-list- } afx-app-window[data-id = "setting-window"] afx-hbox[data-id="app-services"] afx-list-view +{ + border: 1px solid var(--border-quaternary); +} + +afx-app-window[data-id = "setting-window"] afx-hbox[data-id="app-about"] afx-grid-view { border: 1px solid var(--border-quaternary); } \ No newline at end of file diff --git a/src/packages/Setting/main.ts b/src/packages/Setting/main.ts index 1967b6d..b95a21e 100644 --- a/src/packages/Setting/main.ts +++ b/src/packages/Setting/main.ts @@ -82,6 +82,7 @@ namespace OS { static StartupHandle: typeof SettingHandle; static SettingHandle: typeof SettingHandle; static AppAndServiceHandle: typeof SettingHandle; + static VersionsHandle: typeof SettingHandle; /** *Creates an instance of Setting. @@ -105,6 +106,7 @@ namespace OS { new Setting.LocaleHandle(this.find("locale"), this); new Setting.StartupHandle(this.find("startup"), this); new Setting.AppAndServiceHandle(this.find("app-services"), this); + new Setting.VersionsHandle(this.find("app-about"), this); containter.selectedIndex = 0; (this.find("btnsave") as GUI.tag.ButtonTag ).onbtclick = (e) => { this._api diff --git a/src/packages/Setting/package.json b/src/packages/Setting/package.json index b026ef8..df23ef0 100644 --- a/src/packages/Setting/package.json +++ b/src/packages/Setting/package.json @@ -6,7 +6,7 @@ "author": "Xuan Sang LE", "email": "xsang.le@gmail.com" }, - "version":"0.1.5-b", + "version":"0.2.0-b", "category":"System", "iconclass":"fa fa-wrench", "mimes":["none"] diff --git a/src/packages/Setting/scheme.html b/src/packages/Setting/scheme.html index d681ad4..938a786 100644 --- a/src/packages/Setting/scheme.html +++ b/src/packages/Setting/scheme.html @@ -2,8 +2,7 @@ - -
+ @@ -21,11 +20,9 @@
-
- -
+ @@ -43,21 +40,17 @@
-
- -
+
-
- -
+ @@ -66,11 +59,9 @@
-
- -
+ @@ -79,7 +70,13 @@
-
+
+ + + + + +