From cb5668b8c7d932f58216c4428cce10081069ce40 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 24 Oct 2016 23:43:14 +0200 Subject: [PATCH] [DEV] update display --- bdd.sql | 1 + build_thumb.php | 6 +++--- coverage_thumb.php | 40 +++++++++++++++++++++------------------- test_thumb.php | 40 +++++++++++++++++++++------------------- warning_thumb.php | 28 ++++++++++++++-------------- 5 files changed, 60 insertions(+), 55 deletions(-) diff --git a/bdd.sql b/bdd.sql index 20d4295..e0accbe 100644 --- a/bdd.sql +++ b/bdd.sql @@ -34,6 +34,7 @@ CREATE TABLE IF NOT EXISTS `BUILD_snapshot` ( `id-group` int(11) NOT NULL DEFAULT '0', `Linux` enum('UNKNOW','START','ERROR','OK') NOT NULL DEFAULT 'UNKNOW', `Windows` enum('UNKNOW','START','ERROR','OK') NOT NULL DEFAULT 'UNKNOW', + `Mingw` enum('UNKNOW','START','ERROR','OK') NOT NULL DEFAULT 'UNKNOW', `MacOs` enum('UNKNOW','START','ERROR','OK') NOT NULL DEFAULT 'UNKNOW', `IOs` enum('UNKNOW','START','ERROR','OK') NOT NULL DEFAULT 'UNKNOW', `Android` enum('UNKNOW','START','ERROR','OK') NOT NULL DEFAULT 'UNKNOW' diff --git a/build_thumb.php b/build_thumb.php index 7cf8be5..4c437c6 100644 --- a/build_thumb.php +++ b/build_thumb.php @@ -77,12 +77,12 @@ if ($result->num_rows > 0) { errorSVG("To much value"); } $row = $result->fetch_assoc(); + $status = $row[$tag]; } else { - errorSVG("No Value"); + $status = "---"; + //errorSVG("No Value"); } -$status = $row[$tag]; - //some coverage value : if ($status == "UNKNOW") { diff --git a/coverage_thumb.php b/coverage_thumb.php index 2fcd5e5..bb5e84d 100644 --- a/coverage_thumb.php +++ b/coverage_thumb.php @@ -92,26 +92,28 @@ if ($result->num_rows > 0) { errorSVG("To much value"); } $row = $result->fetch_assoc(); + if ($row['executable'] == 0) { + $coverage = 100; + } else { + $coverage = intval(100 * $row['executed'] / $row['executable']); + } + //some coverage value : + if ($coverage < 25 ) { + $color = "c11"; + } else if ($coverage < 50 ) { + $color = "c1c"; + } else if ($coverage < 75 ) { + $color = "c71"; + } else { + $color = "4c1"; + } + $coverage = ''.$coverage.'%'; } else { - errorSVG("No Value"); + //errorSVG("No Value"); + $coverage = "---"; + $color = "FF0"; } -if ($row['executable'] == 0) { - $coverage = 100; -} else { - $coverage = intval(100 * $row['executed'] / $row['executable']); -} - -//some coverage value : -if ($coverage < 25 ) { - $color = "c11"; -} else if ($coverage < 50 ) { - $color = "c1c"; -} else if ($coverage < 75 ) { - $color = "c71"; -} else { - $color = "4c1"; -} echo(''); echo(' '); @@ -125,8 +127,8 @@ echo(' '); echo(' '); echo(' coverage'); echo(' coverage'); -echo(' '.$coverage.'%'); -echo(' '.$coverage.'%'); +echo(' '.$coverage.''); +echo(' '.$coverage.''); echo(' '); echo(''); diff --git a/test_thumb.php b/test_thumb.php index 6e85cc9..2e84d57 100644 --- a/test_thumb.php +++ b/test_thumb.php @@ -92,26 +92,28 @@ if ($result->num_rows > 0) { errorSVG("To much value"); } $row = $result->fetch_assoc(); + if ($row['total'] == 0) { + $testRatio = 0; + } else { + $testRatio = intval(100 * $row['passed'] / $row['total']); + } + //some testRatio value : + if ($testRatio < 25 ) { + $color = "c11"; + } else if ($testRatio < 50 ) { + $color = "c1c"; + } else if ($testRatio < 100 ) { + $color = "c71"; + } else { + $color = "4c1"; + } + $testRatio = ''.$testRatio.'%'; } else { - errorSVG("No Value"); + //errorSVG("No Value"); + $testRatio = "---"; + $color = "FF0"; } -if ($row['total'] == 0) { - $testRatio = 0; -} else { - $testRatio = intval(100 * $row['passed'] / $row['total']); -} - -//some testRatio value : -if ($testRatio < 25 ) { - $color = "c11"; -} else if ($testRatio < 50 ) { - $color = "c1c"; -} else if ($testRatio < 100 ) { - $color = "c71"; -} else { - $color = "4c1"; -} echo(''); echo(' '); @@ -125,8 +127,8 @@ echo(' '); echo(' '); echo(' test'); echo(' test'); -echo(' '.$testRatio.'%'); -echo(' '.$testRatio.'%'); +echo(' '.$testRatio.''); +echo(' '.$testRatio.''); echo(' '); echo(''); diff --git a/warning_thumb.php b/warning_thumb.php index 9f4155b..88b6469 100644 --- a/warning_thumb.php +++ b/warning_thumb.php @@ -92,21 +92,21 @@ if ($result->num_rows > 0) { errorSVG("To much value"); } $row = $result->fetch_assoc(); + $warningCount = $row['warning'] + $row['error']; + //some warningCount value : + if ($warningCount < 5 ) { + $color = "4c1"; + } else if ($warningCount < 20 ) { + $color = "c71"; + } else if ($warningCount < 50 ) { + $color = "c1c"; + } else { + $color = "c11"; + } } else { - errorSVG("No Value"); -} - -$warningCount = $row['warning'] + $row['error']; - -//some warningCount value : -if ($warningCount < 5 ) { - $color = "4c1"; -} else if ($warningCount < 20 ) { - $color = "c71"; -} else if ($warningCount < 50 ) { - $color = "c1c"; -} else { - $color = "c11"; + //errorSVG("No Value"); + $warningCount = "---"; + $color = "FF0"; } echo('');