Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

Refactor version fetch to use getVersion API method

Juan Denis52a6b2aa6b1b
diff --git a/frontend/src/pages/Settings.jsx b/frontend/src/pages/Settings.jsx
index 4cf1fc42..534d2da1 100644
--- a/frontend/src/pages/Settings.jsx
+++ b/frontend/src/pages/Settings.jsx
@@ -1652,8 +1652,8 @@ const AboutSection = () => {
useEffect(() => {
const fetchVersion = async () => {
try {
- const response = await api.get('/system/version');
- setVersion(response.data.version);
+ const data = await api.getVersion();
+ setVersion(data.version || '1.0.0');
} catch (error) {
setVersion('1.0.0');
}
diff --git a/frontend/src/services/api.js b/frontend/src/services/api.js
index 5a5cef9d..396dd64f 100644
--- a/frontend/src/services/api.js
+++ b/frontend/src/services/api.js
@@ -310,6 +310,10 @@ class ApiService {
return this.request('/system/metrics');
}
+ async getVersion() {
+ return this.request('/system/version');
+ }
+
async getProcesses() {
return this.request('/system/processes');
}