Fine tuning the design pattern
[citadel] / webcit / static / t / aide / siteconfig / tab_aliases.html
index 02ed6b9..5058d05 100644 (file)
@@ -7,23 +7,19 @@
 
 <script type="text/javascript">
 
 
 <script type="text/javascript">
 
-
-function load_aliases() {
-       var request77 = new XMLHttpRequest();
-       request77.open("GET", "ajax_servcmd?g_cmd=LIST", true);
-       request77.onreadystatechange = function() {
-               populate_aliases(this.responseText);
-       };
-       request77.send();
-       request77 = null;
-}
+load_aliases = async() => {
+       response = await fetch("ajax_servcmd?g_cmd=LIST");
+       data = await(response.text());
+       populate_aliases(data);
+};
 
 function populate_aliases(data) {
 
 function populate_aliases(data) {
-       document.getElementById("wc_easterbunny77").innerHTML = data;
+       lines = data.split("\n");
+       for (var i=1; i<lines.length && lines[i] != "000"; ++i) {
+               document.getElementById("wc_easterbunny77").innerHTML += i + " " + lines[i] + "<br>";
+       }
 }
 
 }
 
-
-document.getElementById("wc_easterbunny77").innerHTML = "die easterbunny die easterbunny still fool";
 load_aliases();
 
 </script>
 load_aliases();
 
 </script>