Update API endpoint URL and refactor self-update modal handling with extension hooks
- Change update check API endpoint from api.agent-zero.ai to tapi.agent-zero.ai - Move self-update modal opening logic from inline handler to store method - Add openModal method to self-update store for centralized modal management - Import self-update store in backup settings component - Replace closeModal window method call with imported closeModal function - Add SELF_UPDATE_MODAL_PATH constant for consistent
frdel committed
Mar 25, 2026 at 18:39 UTC
c4e2d9c5d5ba29234a2b3b560ef8e8c9e77f9cad
6 files changed
+25
-5
extensions/webui/initFw_end/.gitkeep
extensions/webui/initFw_end/selfUpdateGlobal.js
new
+5
@@ -0,0 +1,5 @@
1
+import { store } from "/components/settings/external/self-update-store.js";
2
+
3
+export default async function selfUpdateGlobal(ctx) {
4
+ // do nothing, the import is enough
5
+}
helpers/update_check.py
+1
-1
@@ -11,7 +11,7 @@ async def check_version():
11
12
anonymized_id = hashlib.sha256(runtime.get_persistent_id().encode()).hexdigest()[:20]
13
14
- url = "https://api.agent-zero.ai/a0-update-check"
14
+ url = "https://tapi.agent-zero.ai/a0-update-check"
15
payload = {"current_version": current_version, "anonymized_id": anonymized_id}
16
async with httpx.AsyncClient() as client:
17
response = await client.post(url, json=payload)
webui/components/settings/backup/self-update.html
+4
-1
@@ -1,6 +1,9 @@
1
<html>
2
<head>
3
<title>Self Update</title>
4
+ <script type="module">
5
+ import { store } from "/components/settings/external/self-update-store.js";
6
+ </script>
7
</head>
8
9
<body>
@@ -24,7 +27,7 @@
27
<div class="field-control">
28
<button
29
class="btn btn-field"
27
- @click="openModal('settings/external/self-update-modal.html')"
30
+ @click="$store.selfUpdateStore.openModal()"
31
:disabled="!$store.settings.additional?.is_dockerized"
32
>
33
Open Self Update
webui/components/settings/external/self-update-store.js
+7
-1
@@ -1,11 +1,13 @@
1
import { createStore } from "/js/AlpineStore.js";
2
import * as API from "/js/api.js";
3
import { store as notificationStore } from "/components/notifications/notification-store.js";
4
+import { openModal, closeModal } from "/js/modals.js";
5
6
const HEALTH_POLL_INTERVAL_MS = 2000;
7
const HEALTH_WAIT_BUFFER_MS = 30000;
8
const SELF_UPDATE_RETURN_URL_KEY = "a0:self-update:return-url";
9
const SELF_UPDATE_OVERLAY_ID = "self-update-progress-overlay";
10
+const SELF_UPDATE_MODAL_PATH = "settings/external/self-update-modal.html";
11
const MIN_SELECTOR_VERSION = [1, 0];
12
13
const model = {
@@ -329,6 +331,10 @@ const model = {
331
this.tagDropdownOpen = false;
332
},
333
334
+ async openModal() {
335
+ await openModal(SELF_UPDATE_MODAL_PATH);
336
+ },
337
+
338
openTagDropdown() {
339
this.tagDropdownOpen = true;
340
},
@@ -585,7 +591,7 @@ const model = {
591
},
592
593
close() {
588
- window.closeModal("settings/external/self-update-modal.html");
594
+ closeModal(SELF_UPDATE_MODAL_PATH);
595
},
596
};
597
webui/js/initFw.js
+8
-2
@@ -1,9 +1,12 @@
1
import * as initializer from "./initializer.js";
2
import * as _modals from "./modals.js";
3
import * as _components from "./components.js";
4
-import * as _extensions from "./extensions.js";
4
+import * as extensions from "./extensions.js";
5
import { registerAlpineMagic } from "./confirmClick.js";
6
7
+// process extensions
8
+await extensions.callJsExtensions("initFw_start")
9
+
10
// initialize required elements
11
await initializer.initialize();
12
@@ -176,4 +179,7 @@ Alpine.directive(
179
}
180
181
return out;
179
-});
\ No newline at end of file
182
+});
183
+
184
+// process extensions
185
+await extensions.callJsExtensions("initFw_end")
\ No newline at end of file