From d2aaa50311ab6fd1e96da00f33b7d829f6263063 Mon Sep 17 00:00:00 2001 From: master3395 Date: Sun, 4 Jan 2026 03:57:53 +0100 Subject: [PATCH] Fix session status logic: Add IDLE state for logged-in users without processes, improve process detection with TTY filtering, enhance status messages with clearer explanations --- .../templates/baseTemplate/homePage.html | 54 +++++++++++++++++-- baseTemplate/views.py | 40 +++++++++++--- 2 files changed, 83 insertions(+), 11 deletions(-) diff --git a/baseTemplate/templates/baseTemplate/homePage.html b/baseTemplate/templates/baseTemplate/homePage.html index 341c24112..c09e43619 100644 --- a/baseTemplate/templates/baseTemplate/homePage.html +++ b/baseTemplate/templates/baseTemplate/homePage.html @@ -839,7 +839,12 @@ {$ login.user $} {$ login.ip $} - {$ login.country $} + +
+ {$ login.country $} + {$ login.country $} +
+ {$ login.date $} @@ -1103,6 +1108,43 @@
+ +
+
+ + Session Status: + + ACTIVE - User is logged in with running processes + + + IDLE - User is logged in but no processes running (shell waiting) + + + INCONSISTENT - Marked as active but no processes or sessions found + + + INACTIVE - Session has ended + +
+
+
+ Login Status: {$ sshActivityStatus $} +
+
+ Running Processes: {$ sshActivity.processes.length $} process(es) found +
+
+ Active Sessions (w command): {$ sshActivity.w.length $} session(s) detected +
+
+ ⚠️ User is logged in (detected by 'w' command) but no processes found. This usually means the shell is idle, waiting for input. +
+
+ ⚠️ No processes or active sessions found. The session may have just ended or the user logged out. +
+
+
+

@@ -1166,17 +1208,19 @@ -
+
- Session is not active (no processes running) + Session is inactive - cannot kill an ended session + User is logged in but idle (no processes to kill) - shell is waiting for input + No processes or sessions found - session may have just ended