fix editor disappearing in mcp/a2a examples
3clyp50 committed
Jan 2, 2026 at 12:11 UTC
c3c8d125739b49bba93169a17c91054ac1a40a0b
3 files changed
+9
-12
webui/components/settings/a2a/a2a-connection.html
+4
-5
@@ -34,10 +34,9 @@
34
35
<div id="a2a-connection-example"></div>
36
37
- <script type="module">
38
- import * as API from "/js/api.js";
39
-
40
- setTimeout(async () => {
37
+ <script>
38
+ (async () => {
39
+ const API = await import("/js/api.js");
40
const url = window.location.origin;
41
42
// Fetch token from settings API - try a2a_token first, fallback to mcp_server_token
@@ -91,7 +90,7 @@
90
91
// Update URL when project selection changes
92
projectSelect.addEventListener('change', updateConnectionUrl);
94
- }, 0);
93
+ })();
94
</script>
95
</div>
96
webui/components/settings/mcp/client/mcp-servers-store.js
+1
-2
@@ -24,8 +24,7 @@ const model = {
24
}
25
26
editor.session.setMode("ace/mode/json");
27
- const field = this.getSettingsFieldConfigJson();
28
- const json = field ? field.value : "{}";
27
+ const json = this.getSettingsFieldConfigJson();
28
editor.setValue(json);
29
editor.clearSelection();
30
this.editor = editor;
webui/components/settings/mcp/server/example.html
+4
-5
@@ -33,10 +33,9 @@
33
34
<div id="mcp-server-example"></div>
35
36
- <script type="module">
37
- import * as API from "/js/api.js";
38
-
39
- setTimeout(async () => {
36
+ <script>
37
+ (async () => {
38
+ const API = await import("/js/api.js");
39
const url = window.location.origin;
40
41
// Fetch token from settings API
@@ -102,7 +101,7 @@
101
102
// Update JSON when project selection changes
103
projectSelect.addEventListener('change', updateMcpConfig);
105
- }, 0);
104
+ })();
105
</script>
106
<!-- </template> -->
107
</div>