Commit 40a193ef authored by remy's avatar remy
Browse files

updating base sql files and borgbackup headers

parent eb70a00a
......@@ -101,10 +101,10 @@ function parseBorgStatusJson($name, $val, $reader) {
if($name == "borg_status") {
foreach($val as $minionid => $subval) {
foreach($subval as $jsonfilename => $subsubval) {
$first_td_displayed = "";
$second_td_displayed = "";
$third_td_displayed = "";
isset($jsonfilename) ? $first_td_displayed = remove_quotes_and_new_line(stripcslashes($jsonfilename)) : $first_td_displayed = "key not found";
if(!is_array($subsubval)) {
$first_td_displayed = remove_quotes_and_new_line(stripcslashes($jsonfilename));
$second_td_displayed = remove_quotes_and_new_line(stripcslashes($subsubval));
if($second_td_displayed == $reader->BORG_BACKUP_NOT_FOUND) {
$second_td_displayed = '<span class="label" style="background-color: '.$reader->COLOR_BORG_BACKUP_NOT_FOUND.'" >'.$second_td_displayed.'</span>';
......@@ -127,17 +127,16 @@ function parseBorgStatusJson($name, $val, $reader) {
$end_timestamp = strtotime($end);
$duration = $end_timestamp - $start_timestamp;
$minutes = $duration / 60;
$hours = $minutes / 60;
$duration_str = "duration : ".$hours."h:".$minutes."m";
$first_td_displayed = '<span class="label" style="background-color: '.$reader->COLOR_DEFAULT_SUCCESS.'">'.$start.'</span>';
$second_td_displayed = '<span class="label" style="background-color: '.$reader->COLOR_DEFAULT_SUCCESS.'">'.$duration_str.'</span>';
$duration_str = $minutes;
$second_td_displayed = '<span class="label" style="background-color: '.$reader->COLOR_DEFAULT_SUCCESS.'">'.$start.'</span>';
$third_td_displayed = '<span class="label" style="background-color: '.$reader->COLOR_DEFAULT_SUCCESS.'">'.$duration_str.'</span>';
} else {
$first_td_displayed = '<span class="label" style="background-color: '.$reader->COLOR_DEFAULT_ERROR.'">Unable to parse archive results...</span>';
$second_td_displayed = '<span class="label" style="background-color: '.$reader->COLOR_DEFAULT_ERROR.'">Unable to parse archive results...</span>';
}
}
}
}
printArray([$minionid,$first_td_displayed,$second_td_displayed]);
printArray([$minionid,$first_td_displayed,$second_td_displayed,$third_td_displayed]);
}
}
}
......
......@@ -44,7 +44,7 @@ echo '<!-- Page Content -->
echo '<input type="text" class="form-control" id="ReaderTableID" placeholder="ReaderTableID" name="ReaderTableID" value="'.$rt->ID.'">';
drawInputFormField("name", "Filename suffix [1]", $rt->name, true, false);
drawInputFormField("title", "Title", $rt->title, true, false);
drawTextareaFormField("head", "Head", $rt->head, false, false);
drawTextareaFormField("head", "Header for table (&lt;th&gt;)", $rt->head, false, false);
drawInputNumberFormField("pos", "Position", $rt->pos, false, false);
drawTextareaFormField("jssort", "JS Sort", $rt->jssort, false, false);
......
......@@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost:3306
-- Généré le : lun. 30 août 2021 à 10:33
-- Généré le : jeu. 16 sep. 2021 à 14:19
-- Version du serveur : 10.3.31-MariaDB-0ubuntu0.20.04.1
-- Version de PHP : 7.4.3
......@@ -19,7 +19,7 @@ SET time_zone = "+00:00";
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `yii`
-- Base de données : `jsonreader2`
--
-- --------------------------------------------------------
......@@ -32,9 +32,9 @@ CREATE TABLE `CReader` (
`ID` int(11) NOT NULL,
`ckey` varchar(255) NOT NULL,
`cvalue` varchar(255) NOT NULL,
`FieldType` varchar(15) NOT NULL DEFAULT 'text',
`FieldType` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'text',
`color` varchar(7) DEFAULT '#FFFFFF'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Déchargement des données de la table `CReader`
......@@ -50,14 +50,18 @@ INSERT INTO `CReader` (`ID`, `ckey`, `cvalue`, `FieldType`, `color`) VALUES
(7, 'ZPOOL_STATUS_PRIMARY', 'ZFS modules', 'text', '#e67e22'),
(8, 'ZPOOL_STATUS_WARNING', 'ONLINE', 'text', '#f1c40f'),
(9, 'SALTVERSION_INFO', '2019;3002', 'textarea', '#3498db'),
(11, 'OSVERSION_SUCCESS', 'Ubuntu-18.04;Debian-10;CentOS Linux-7;Raspbian-10;Ubuntu-20.04', 'textarea', '#5cb85c'),
(15, 'WEBSITE_CHECKSUMS_AND_STATUS_SUCCESS', 'OK', 'text', '#5cb85c'),
(16, 'WEBSITE_CHECKSUMS_AND_STATUS_WARNING', 'Found;Permanently', 'textarea', '#f1c40f'),
(18, 'WEBSITES_CERTS_SUCCESS', '5', 'text', '#5cb85c'),
(19, 'WEBSITES_CERTS_WARNING', '1', 'text', '#f1c40f'),
(20, 'WEBSITES_CERTS_STATUS_OK', 'Ok', 'text', '#5cb85c'),
(21, 'SALTVERSION_SUCCESS', '3003.3;3003.2;3003.1;3003', 'textarea', '#5cb85c'),
(22, 'SALTVERSION_WARNING', '3000;3001', 'textarea', '#e67e22');
(10, 'OSVERSION_SUCCESS', 'Ubuntu-18.04;Debian-10;CentOS Linux-7;Raspbian-10;Ubuntu-20.04', 'textarea', '#5cb85c'),
(11, 'WEBSITE_CHECKSUMS_AND_STATUS_SUCCESS', 'OK', 'text', '#5cb85c'),
(12, 'WEBSITE_CHECKSUMS_AND_STATUS_WARNING', 'Found;Permanently', 'textarea', '#f1c40f'),
(13, 'WEBSITES_CERTS_SUCCESS', '5', 'text', '#5cb85c'),
(14, 'WEBSITES_CERTS_WARNING', '1', 'text', '#f1c40f'),
(15, 'WEBSITES_CERTS_STATUS_OK', 'Ok', 'text', '#5cb85c'),
(16, 'SALTVERSION_SUCCESS', '3003.3;3003.2;3003.1;3003', 'textarea', '#5cb85c'),
(17, 'SALTVERSION_WARNING', '3000;3001', 'textarea', '#e67e22'),
(18, 'SERVICE_STATE_FALSE', 'False', 'text', '#e74c3c'),
(19, 'SERVICE_STATE_TRUE', 'True', 'text', '#5cb85c'),
(20, 'BORG_BACKUP_NOT_FOUND', 'No borgbackup report file found!', 'text', '#e74c3c'),
(21, 'BORG_BACKUP_FILE_EMPTY', 'borgbackup report file found but is empty!', 'text', '#e67e22');
--
-- Index pour les tables déchargées
......@@ -77,7 +81,7 @@ ALTER TABLE `CReader`
-- AUTO_INCREMENT pour la table `CReader`
--
ALTER TABLE `CReader`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
......
......@@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost:3306
-- Généré le : lun. 06 sep. 2021 à 11:56
-- Généré le : jeu. 16 sep. 2021 à 14:20
-- Version du serveur : 10.3.31-MariaDB-0ubuntu0.20.04.1
-- Version de PHP : 7.4.3
......@@ -19,7 +19,7 @@ SET time_zone = "+00:00";
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `yii`
-- Base de données : `jsonreader2`
--
-- --------------------------------------------------------
......@@ -42,26 +42,29 @@ CREATE TABLE `CReaderPanel` (
INSERT INTO `CReaderPanel` (`ID`, `CReaderID`, `PanelTitle`, `PanelPosition`) VALUES
(1, 1, 'Global', 1),
(2, NULL, 'Hosts status', 2),
(3, NULL, 'Service', 3),
(3, 18, 'Service', 3),
(4, 2, 'Volume usage', 4),
(5, 3, 'Volume usage', 4),
(7, 4, 'Disks status', 5),
(8, 5, 'Zpool', 6),
(9, 6, 'Zpool', 6),
(10, 7, 'Zpool', 6),
(11, 8, 'Zpool', 6),
(12, NULL, 'D State Processes', 7),
(13, NULL, 'Bios date', 8),
(14, 9, 'Salt Version', 9),
(15, 21, 'Salt Version', 9),
(16, 22, 'Salt Version', 9),
(17, NULL, 'Kernel version', 10),
(18, 11, 'OS version', 11),
(19, 15, 'Websites checksums & status', 12),
(20, 16, 'Websites checksums & status', 12),
(21, 18, 'Website certs', 13),
(22, 19, 'Website certs', 13),
(23, 20, 'Website certs', 13);
(6, 4, 'Disks status', 5),
(7, 5, 'Zpool', 6),
(8, 6, 'Zpool', 6),
(9, 7, 'Zpool', 6),
(10, 8, 'Zpool', 6),
(11, NULL, 'D State Processes', 7),
(12, NULL, 'Bios date', 8),
(13, 9, 'Salt Version', 9),
(14, 16, 'Salt Version', 9),
(15, 17, 'Salt Version', 9),
(16, NULL, 'Kernel version', 10),
(17, 10, 'OS version', 11),
(18, 11, 'Websites checksums & status', 12),
(19, 12, 'Websites checksums & status', 12),
(20, 13, 'Website certs', 13),
(21, 14, 'Website certs', 13),
(22, 15, 'Website certs', 13),
(23, 19, 'Service', 3),
(24, 20, 'BorgBackup', 14),
(25, 21, 'BorgBackup', 14);
--
-- Index pour les tables déchargées
......@@ -81,7 +84,7 @@ ALTER TABLE `CReaderPanel`
-- AUTO_INCREMENT pour la table `CReaderPanel`
--
ALTER TABLE `CReaderPanel`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
......
......@@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost:3306
-- Généré le : lun. 30 août 2021 à 10:33
-- Généré le : jeu. 16 sep. 2021 à 14:20
-- Version du serveur : 10.3.31-MariaDB-0ubuntu0.20.04.1
-- Version de PHP : 7.4.3
......@@ -19,7 +19,7 @@ SET time_zone = "+00:00";
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `yii`
-- Base de données : `jsonreader2`
--
-- --------------------------------------------------------
......@@ -35,7 +35,7 @@ CREATE TABLE `ReaderTable` (
`head` text NOT NULL,
`pos` int(11) NOT NULL DEFAULT 9999,
`jssort` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--
-- Déchargement des données de la table `ReaderTable`
......@@ -54,7 +54,8 @@ INSERT INTO `ReaderTable` (`ID`, `name`, `title`, `head`, `pos`, `jssort`) VALUE
(10, '_osversion', 'OS version', 'Server;Versions', 10, ''),
(11, '_websites_checksums', 'Website checksums', 'Website;Checksums', 12, ''),
(12, '_websites_status', 'Website status', 'Website;Status', 13, ''),
(13, '_websites_certs', 'Website certs', 'Website;End date;Days before expiration;Status', 11, '');
(13, '_websites_certs', 'Website certs', 'Website;End date;Days before expiration;Status', 11, ''),
(14, '_borg_status', 'Borg', 'Server;Borg File;last backup;duration (mn)', 14, '');
--
-- Index pour les tables déchargées
......@@ -74,7 +75,7 @@ ALTER TABLE `ReaderTable`
-- AUTO_INCREMENT pour la table `ReaderTable`
--
ALTER TABLE `ReaderTable`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment