feat(nix-monitor): update version 1.3.0 (#144)
* feat(nix-monitor): add system stats check mode * fix(nix-monitor): prevent terminal closing on non-zero exit * fix(nix-monitor): force system stats check when clicking the Check button (if not off)
This commit is contained in:
@@ -68,6 +68,7 @@ setState("isRemoteCheckRunning", false)
|
||||
setState("isUpdateAvailable", false)
|
||||
setState("lastGenerationsCheckTime", 0)
|
||||
setState("isSystemStatsCheckRunning", false)
|
||||
setState("systemStatsCheckHasBeenPerformed", false)
|
||||
setState("lastSystemStatsCheckTime", os.time())
|
||||
setState("lastSystemStatsCheckRunTime", os.time())
|
||||
setState("hasHomeManager", noctalia.commandExists("home-manager"))
|
||||
@@ -167,11 +168,22 @@ function checkGenerations()
|
||||
end
|
||||
|
||||
-- System stats check
|
||||
function checkSystemStats()
|
||||
function checkSystemStats(force)
|
||||
if getState("isSystemStatsCheckRunning") then
|
||||
return
|
||||
end
|
||||
|
||||
if cfg("system_stats_check_mode") == "off" then
|
||||
return
|
||||
end
|
||||
|
||||
if cfg("system_stats_check_mode") == "on_start" and getState("systemStatsCheckHasBeenPerformed") and not force then
|
||||
return
|
||||
end
|
||||
|
||||
setState("storeSize", "•••")
|
||||
setState("closureSize", "•••")
|
||||
setState("systemStatsCheckHasBeenPerformed", true)
|
||||
setState("isSystemStatsCheckRunning", true)
|
||||
setState("lastSystemStatsCheckRunTime", os.time())
|
||||
|
||||
@@ -216,7 +228,12 @@ end
|
||||
-- Init
|
||||
checkLocalHash()
|
||||
checkRemoteHash(10)
|
||||
checkSystemStats()
|
||||
if cfg("system_stats_check_mode") ~= "off" then
|
||||
checkSystemStats()
|
||||
else
|
||||
setState("storeSize", "n/a")
|
||||
setState("closureSize", "n/a")
|
||||
end
|
||||
|
||||
-- Command watcher
|
||||
watchState("command", function(command)
|
||||
@@ -225,7 +242,7 @@ watchState("command", function(command)
|
||||
cancelRemoteCheck()
|
||||
checkRemoteHash()
|
||||
checkGenerations()
|
||||
checkSystemStats()
|
||||
checkSystemStats(true)
|
||||
end
|
||||
|
||||
if command == "cancel" then
|
||||
|
||||
Reference in New Issue
Block a user