Dynamic labels & Changed color to light green
- Filesystem size - Flexi version - Flexi Revision - MAC - Timestamp - Temperature - ZoomLock - Serial and model Number - Licenses - CPU usage
This commit is contained in:
@@ -40,6 +40,13 @@ namespace AiQ_GUI
|
||||
{
|
||||
SshClient client = SshConnect(IPAddress);
|
||||
|
||||
// CRITICAL: Check if connection actually succeeded
|
||||
if (client == null)
|
||||
{
|
||||
MainForm.Instance.AddToActionsList($"SSH connection failed for {IPAddress}", Level.ERROR);
|
||||
return Data; // Return empty data
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Data.packages = GetVaxtorPackages(client);
|
||||
@@ -78,9 +85,6 @@ namespace AiQ_GUI
|
||||
MainForm.Instance.AddToActionsList($"SSH connection failed: {ex.Message}. Check password or network. ", Level.WARNING);
|
||||
}
|
||||
|
||||
string LogMssg = string.Join(" | ", typeof(SSHData).GetProperties().Select(p => $"{p.Name}: {p.GetValue(Data)}"));
|
||||
Logging.LogMessage(LogMssg); // Log all of Data
|
||||
|
||||
return Data;
|
||||
}
|
||||
|
||||
@@ -234,6 +238,14 @@ namespace AiQ_GUI
|
||||
const double Deviation = 20.0; // ±20GB
|
||||
|
||||
double currentSize = NormaliseFSSize(sshData.FilesystemSize);
|
||||
|
||||
// Create label dynamically if not provided
|
||||
if (LblFSSize == null)
|
||||
{
|
||||
MainForm.Instance.AddLabelToPanel($"Filesystem Size = {currentSize}GB", currentSize < (GoodSize - Deviation) || currentSize > (GoodSize + Deviation));
|
||||
return sshData;
|
||||
}
|
||||
|
||||
LblFSSize.Text = $"Filesystem Size = {currentSize}GB";
|
||||
|
||||
if (Math.Abs(GoodSize - currentSize) < Deviation)
|
||||
@@ -280,7 +292,8 @@ namespace AiQ_GUI
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(rootSize)) return 0;
|
||||
if (string.IsNullOrWhiteSpace(rootSize))
|
||||
return 0;
|
||||
|
||||
// Extract value & unit
|
||||
System.Text.RegularExpressions.Match match = RegexCache.FileSizeRegex().Match(rootSize.Trim());
|
||||
|
||||
Reference in New Issue
Block a user