feat: Setting displays versions info
gitea-sync/antos-frontend/pipeline/head This commit looks good Details

This commit is contained in:
DanyLE 2024-03-18 17:06:53 +01:00
parent 04da2a9d39
commit b99668f4f2
7 changed files with 39 additions and 17 deletions

7
d.ts/antos.d.ts vendored
View File

@ -284,6 +284,13 @@ declare namespace OS {
* @returns {Promise<RequestResult>} a promise on a {@link RequestResult}
*/
function setting(): Promise<RequestResult>;
/**
* Query the current versions of all system components
*
* @export
* @returns {Promise<RequestResult>} a promise on a {@link RequestResult}
*/
function versions(): Promise<RequestResult>;
}
}
}

View File

@ -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<RequestResult>} a promise on a {@link RequestResult}
*/
export function versions(): Promise<RequestResult> {
const p = `${API.REST}/system/version`;
return API.get(p);
}
}
}
}

View File

@ -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 =

View File

@ -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);
}

View File

@ -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

View File

@ -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"]

View File

@ -2,8 +2,7 @@
<afx-vbox>
<afx-tab-container data-id = "container" dir = "column" tabbarheight= "40" tabbarwidth="160">
<afx-hbox tabname="__(Appearance)" data-id="appearance" iconclass = "fa fa-paint-brush">
<div data-width="10"></div>
<afx-hbox tabname="__(Appearance)" data-id="appearance" iconclass = "fa fa-paint-brush" padding="10">
<afx-vbox>
<afx-label text = "__(Wallpaper)" iconclass = "fa fa-image" class = "header" data-height="30"></afx-label>
<afx-hbox>
@ -21,11 +20,9 @@
<afx-list-view data-height="35" data-id="theme-list" dropdown="true"></afx-list-view>
<div data-height="5"></div>
</afx-vbox>
<div data-width="10"></div>
</afx-hbox>
<afx-hbox data-id="vfs" tabname = "__(VFS)" iconclass = "fa fa-inbox">
<div data-width="10"></div>
<afx-hbox data-id="vfs" tabname = "__(VFS)" iconclass = "fa fa-inbox" padding="10">
<afx-vbox>
<afx-label text = "__(Mount points)" iconclass = "fa fa-folder" class = "header" data-height="30"></afx-label>
<afx-list-view data-id="mplist"></afx-list-view>
@ -43,21 +40,17 @@
</afx-hbox>
<div data-height="10"></div>
</afx-vbox>
<div data-width="10"></div>
</afx-hbox>
<afx-hbox data-id="locale" tabname = "__(Languages)"iconclass = "fa fa-globe">
<div data-width="10"></div>
<afx-hbox data-id="locale" tabname = "__(Languages)"iconclass = "fa fa-globe" padding="10">
<afx-vbox>
<afx-label text = "__(System locale)" iconclass = "fa fa-globe" class = "header" data-height="30"></afx-label>
<afx-list-view data-id="lglist"></afx-list-view>
<div data-height="10"></div>
</afx-vbox>
<div data-width="10"></div>
</afx-hbox>
<afx-hbox data-id="startup" tabname = "__(Startup)" iconclass = "fa fa-cog">
<div data-width="10"></div>
<afx-hbox data-id="startup" tabname = "__(Startup)" iconclass = "fa fa-cog" padding="10">
<afx-vbox>
<afx-label text = "__(Startup services)" iconclass = "fa fa-tasks" class = "header" data-height="30"></afx-label>
<afx-list-view data-id="srvlist"></afx-list-view>
@ -66,11 +59,9 @@
<afx-list-view data-id="applist"></afx-list-view>
<div data-height="10"></div>
</afx-vbox>
<div data-width="10"></div>
</afx-hbox>
<afx-hbox data-id="app-services" tabname = "__(Apps. and Services)" iconclass = "fa fa-adn">
<div data-width="10"></div>
<afx-hbox data-id="app-services" tabname = "__(Apps. and Services)" iconclass = "fa fa-adn" padding="10">
<afx-vbox>
<afx-label text = "__(Services)" iconclass = "fa fa-tasks" class = "header" data-height="30"></afx-label>
<afx-list-view data-id="sys-srvlist"></afx-list-view>
@ -79,7 +70,13 @@
<afx-list-view data-id="sys-applist"></afx-list-view>
<div data-height="10"></div>
</afx-vbox>
<div data-width="10"></div>
</afx-hbox>
<afx-hbox data-id="app-about" tabname = "__(Versions)" iconclass = "bi bi-info-square" padding="10">
<afx-vbox>
<afx-label text = "__(System versions)" iconclass = "bi bi-gear-wide-connected" class = "header" data-height="30"></afx-label>
<afx-grid-view data-id="grid-version"></afx-grid-view>
</afx-vbox>
</afx-hbox>
</afx-tab-container>