diff --git a/src/main.py b/src/main.py
index 8f5cdd4..c1f2177 100644
--- a/src/main.py
+++ b/src/main.py
@@ -97,13 +97,14 @@ class Updater:
def update_domain(self, domain: str, update_info: dict):
modes = update_info.get("modes", [Mode.IPv4])
update_required = False
+ resolved_addrs = {}
for mode in modes:
log.debug(f"Resolving {domain} ({mode})")
resolved = resolve(domain, mode)
+ resolved_addrs[mode] = resolved
log.debug(f"Resolved to {resolved}")
if resolved != self.addrs[mode]:
update_required = True
- break
if not update_required:
return
log.info(f"Updating {domain}")
@@ -121,9 +122,8 @@ class Updater:
response = requests.request(method, url, params=params, headers=headers, timeout=10)
success = response.status_code == 200
response_text = response.text
- print(response_text)
log.info(f"Updated {domain}")
- self.add_to_history(domain, self.addrs, success, response_text)
+ self.add_to_history(domain, self.addrs if success else resolved_addrs, success, response_text)
def update_domains(self):
for domain, update_info in self.config["domains"].items():
diff --git a/web/index.html b/web/index.html
index 12e2ec5..3a7ba45 100644
--- a/web/index.html
+++ b/web/index.html
@@ -1,133 +1,163 @@
-
-
- DynDns Updater
-
-
-
+
+
+ DynDns Updater
+
+
+
-
- DynDns Updater
+
+ DynDns Updater
+
+
+
+
+ | IPv4
+ | |
+
+
+ | IPv6
+ | |
+
+
+ | Last Update
+ | |
+
+
+
+
+
+
+
+ check_circle
+
+
+ error
+
+
+
-
-
- | IPv4
- | |
-
-
- | IPv6
- | |
-
-
- | Last Update
- | |
-
-
+
+
+ | IPv4
+ | |
+
+
+ | IPv6
+ | |
+
+
+ | Last Update
+ | |
+
+
-
-
-
-
-
-
-
-
-
-
- | IPv4
- | |
-
-
- | IPv6
- | |
-
-
- | Last Update
- | |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ }));
+ },
+ async init() {
+ await this.update();
+ window.setInterval(() => {
+ this.update();
+ }, 10000);
+ },
+ }))
+ });
+
+
\ No newline at end of file