From 1b7fe0bb7f4f5ad2b2d3bdeb4ade3a682d9cb7ea Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 7 Jul 2020 16:39:42 +0200 Subject: [statistics] Keep track of client runmode --- modules-available/statistics/api.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'modules-available/statistics/api.inc.php') diff --git a/modules-available/statistics/api.inc.php b/modules-available/statistics/api.inc.php index 2b878680..f7c0ac32 100644 --- a/modules-available/statistics/api.inc.php +++ b/modules-available/statistics/api.inc.php @@ -98,6 +98,10 @@ if ($type{0} === '~') { $new['hostname'] = $hostname; $moresql .= ' hostname = :hostname,'; } + if (($runmode = Request::post('runmode', false, 'string')) !== false) { + $new['currentrunmode'] = $runmode; + $moresql .= ' currentrunmode = :currentrunmode,'; + } $new['oldstate'] = $old['state']; $new['oldlastseen'] = $old['lastseen']; $res = Database::exec('UPDATE machine SET ' @@ -203,6 +207,10 @@ if ($type{0} === '~') { $params['_' . $item] = $liveVal; } } + if (($runmode = Request::post('runmode', false, 'string')) !== false) { + $params['currentrunmode'] = $runmode; + $strUpdateBoottime .= ' currentrunmode = :currentrunmode, '; + } // Figure out what's happening - state changes if ($used === 0 && $old['state'] !== 'IDLE') { if ($old['state'] === 'OCCUPIED' && $sessionLength === 0) { -- cgit v1.2.3-55-g7522