summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgigagamerchaddhruv-spec <gigagamerchaddhruv@gmail.com>2026-05-02 20:58:09 +0530
committerGitHub <noreply@github.com>2026-05-02 20:58:09 +0530
commit2beb8e3a2d89080ef230b73852e9198a6b158ab8 (patch)
tree3e1fc5401a0e0c229310eed4e0dac27b244554a8
parent2e54a1525ba484df6be0dbcf176c4f09f07b491c (diff)
Implement basic UI with Tkinter for NetForge
-rw-r--r--ui.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/ui.py b/ui.py
new file mode 100644
index 0000000..b9530ec
--- /dev/null
+++ b/ui.py
@@ -0,0 +1,33 @@
+import tkinter as tk
+from tkinter import ttk
+
+
+class UI:
+ def __init__(self, root):
+ self.root = root
+ self.tree = None
+
+ self.setup()
+
+ def setup(self):
+ self.root.title("NetForge - Ping Mode")
+ self.root.geometry("600x400")
+
+ label = tk.Label(self.root, text="NETFORGE", font=("Arial", 18))
+ label.pack(pady=10)
+
+ cols = ("IP", "Latency (ms)")
+
+ self.tree = ttk.Treeview(self.root, columns=cols, show="headings")
+
+ for c in cols:
+ self.tree.heading(c, text=c)
+
+ self.tree.pack(fill="both", expand=True)
+
+ def update(self, devices):
+
+ self.tree.delete(*self.tree.get_children())
+
+ for d in devices:
+ self.tree.insert("", "end", values=(d["ip"], d["latency"]))