From: Marcin Haba Date: Tue, 3 Oct 2023 06:36:31 +0000 (+0200) Subject: baculum: Add filename and path properties to fileevent endpoints X-Git-Tag: Beta-15.0.0~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c05d73b06e501a844fdfa84a3b5dbf49ecb5ca85;p=thirdparty%2Fbacula.git baculum: Add filename and path properties to fileevent endpoints --- diff --git a/gui/baculum/protected/API/Modules/FileEventManager.php b/gui/baculum/protected/API/Modules/FileEventManager.php index be9652bb3..c1dc82940 100644 --- a/gui/baculum/protected/API/Modules/FileEventManager.php +++ b/gui/baculum/protected/API/Modules/FileEventManager.php @@ -56,7 +56,14 @@ class FileEventManager extends APIModule { $where = Database::getWhere($criteria); - $sql = 'SELECT FileEvents.* FROM FileEvents ' . $where['where'] . $order . $limit . $offset; + $sql = 'SELECT + FileEvents.*, + Path.Path, + File.Filename + FROM FileEvents + LEFT JOIN File ON (FileEvents.JobId = File.JobId AND FileEvents.FileIndex = File.FileIndex) + LEFT JOIN Path USING (PathId) + ' . $where['where'] . $order . $limit . $offset; return FileEventRecord::finder()->findAllBySql($sql, $where['params']); } diff --git a/gui/baculum/protected/API/Modules/FileEventRecord.php b/gui/baculum/protected/API/Modules/FileEventRecord.php index 9b85c92ce..c4f19620d 100644 --- a/gui/baculum/protected/API/Modules/FileEventRecord.php +++ b/gui/baculum/protected/API/Modules/FileEventRecord.php @@ -43,6 +43,10 @@ class FileEventRecord extends APIDbModule { public $severity; public $source; + // Extra properties + public $filename; + public $path; + public static function finder($className = __CLASS__) { return parent::finder($className); } diff --git a/gui/baculum/protected/API/openapi_baculum.json b/gui/baculum/protected/API/openapi_baculum.json index 1843948e2..65de4994d 100644 --- a/gui/baculum/protected/API/openapi_baculum.json +++ b/gui/baculum/protected/API/openapi_baculum.json @@ -12108,6 +12108,14 @@ "source": { "description": "From where file event comes", "type": "string" + }, + "filename": { + "description": "File name", + "type": "string" + }, + "path": { + "description": "File directory path", + "type": "string" } } },