diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index a9534d53f..3f3889b27 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -644,11 +644,11 @@ CREATE INDEX `Monitors_ServerId_idx` ON `Monitors` (`ServerId`); DROP TABLE IF EXISTS `Monitor_Status`; CREATE TABLE `Monitor_Status` ( - `Id` int(10) unsigned NOT NULL, + `MonitorId` int(10) unsigned NOT NULL, `Status` enum('Unknown','NotRunning','Running','NoSignal','Signal') NOT NULL default 'Unknown', `CaptureFPS` DECIMAL(10,2) NOT NULL default 0, `AnalysisFPS` DECIMAL(5,2) NOT NULL default 0, - PRIMARY KEY (`Id`) + PRIMARY KEY (`MonitorId`) ) ENGINE=MEMORY; -- -- Table structure for table `States` diff --git a/db/zm_update-1.31.29.sql b/db/zm_update-1.31.29.sql new file mode 100644 index 000000000..7cb7769f4 --- /dev/null +++ b/db/zm_update-1.31.29.sql @@ -0,0 +1,8 @@ +DROP TABLE IF EXISTS `Monitor_Status`; +CREATE TABLE `Monitor_Status` ( + `MonitorId` int(10) unsigned NOT NULL, + `Status` enum('Unknown','NotRunning','Running','NoSignal','Signal') NOT NULL default 'Unknown', + `CaptureFPS` DECIMAL(10,2) NOT NULL default 0, + `AnalysisFPS` DECIMAL(5,2) NOT NULL default 0, + PRIMARY KEY (`MonitorId`) +) ENGINE=MEMORY; diff --git a/web/api/app/Plugin/CakePHP-Enum-Behavior b/web/api/app/Plugin/CakePHP-Enum-Behavior index ca91b87fd..7108489f2 160000 --- a/web/api/app/Plugin/CakePHP-Enum-Behavior +++ b/web/api/app/Plugin/CakePHP-Enum-Behavior @@ -1 +1 @@ -Subproject commit ca91b87fda8e006e4fca2ed870f24f9a29c2905d +Subproject commit 7108489f218c54d36d235d3af91d6da2f8311237 diff --git a/web/skins/classic/views/_monitor_filters.php b/web/skins/classic/views/_monitor_filters.php index 9d3a12ad6..6c9e3f799 100644 --- a/web/skins/classic/views/_monitor_filters.php +++ b/web/skins/classic/views/_monitor_filters.php @@ -89,7 +89,7 @@ if ( ! is_array( $selected_monitor_ids ) ) { $values += $ids; } - $sql = 'SELECT *,S.Status AS Status, S.CaptureFPS AS CaptureFPS FROM Monitors AS M LEFT JOIN Monitor_Status AS S ON S.Id=M.Id ' . ( count($conditions) ? ' WHERE ' . implode(' AND ', $conditions ) : '' ).' ORDER BY Sequence ASC'; + $sql = 'SELECT *,S.Status AS Status, S.CaptureFPS AS CaptureFPS FROM Monitors AS M LEFT JOIN Monitor_Status AS S ON MonitorId=Id ' . ( count($conditions) ? ' WHERE ' . implode(' AND ', $conditions ) : '' ).' ORDER BY Sequence ASC'; $monitors = dbFetchAll( $sql, null, $values ); $displayMonitors = array(); $monitors_dropdown = array();