From 974cbc4521854408fd4598029133dc75f0e9f9d0 Mon Sep 17 00:00:00 2001 From: Dylan Anderson Date: Fri, 13 Dec 2024 16:38:16 -0600 Subject: [PATCH] Add in light mode --- Changelog | 1 + contrib/exfoliation/stylesheets/common.css | 29 ++++++++++++++++++- html/config.inc.php.in | 1 + .../horizontal-nagios-full-logo-black.svg | 16 ++++++++++ ... => horizontal-nagios-full-logo-white.svg} | 0 html/images/logos/nagios-n-logo-black.svg | 6 ++++ ...ios-n-logo.svg => nagios-n-logo-white.svg} | 0 html/index.php.in | 14 ++++++++- html/main.php | 16 ++++++++-- html/side.php | 14 +++++++-- 10 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 html/images/logos/horizontal-nagios-full-logo-black.svg rename html/images/logos/{horizontal-nagios-full-logo.svg => horizontal-nagios-full-logo-white.svg} (100%) create mode 100644 html/images/logos/nagios-n-logo-black.svg rename html/images/logos/{nagios-n-logo.svg => nagios-n-logo-white.svg} (100%) diff --git a/Changelog b/Changelog index 8449f3ee9..5c01824bd 100644 --- a/Changelog +++ b/Changelog @@ -5,6 +5,7 @@ Nagios Core 4 Change Log 4.5.9 - 2024-XX-XX ------------------ * Fix unreachable notifications (Dylan Anderson) +* Add light option in new exfoliation theme (Dylan Anderson) 4.5.8 - 2024-11-19 ------------------ diff --git a/contrib/exfoliation/stylesheets/common.css b/contrib/exfoliation/stylesheets/common.css index d04d9ee76..c4b84a2ad 100644 --- a/contrib/exfoliation/stylesheets/common.css +++ b/contrib/exfoliation/stylesheets/common.css @@ -91,6 +91,7 @@ not important: blue aaccff 777777 --background: #000000; --foreground: #FFFFFF; --primary: #4D89F9; + --primary-foreground: #FAFAFA; --secondary-foreground: #D3DAE5; --muted-foreground: #8A92A1; --border: #28303E; @@ -114,6 +115,32 @@ not important: blue aaccff 777777 --error-msg-bg: #1C0202; } +.light { + --background: #FFFFFF; + --foreground: #000000; + --primary: #4D89F9; + --secondary-foreground: #1A1A1A; + --muted-foreground: #3D3D3D; + --border: #D6D6D6; + --input: #FCFCFC; + + --info-msg-text: #033281; + --info-msg-border: #0860F7; + --info-msg-bg: #DCE8FE; + + --success-msg-text: #005C2E; + --success-msg-border: #47B880; + --success-msg-bg: #DBFFED; + + --warning-msg-text: #5C5900; + --warning-msg-border: #E0D900; + --warning-msg-bg: #FFFEE5; + + --error-msg-text: #710B09; + --error-msg-border: #DB2424; + --error-msg-bg: #FCD9D9; +} + #side { border: none; height: 100vh; @@ -401,7 +428,7 @@ ul.navsectionlinks li ul li a:hover { #splashlearnmore { background-color: var(--primary); - color: var(--foreground); + color: var(--primary-foreground); padding: 16px; border-radius: var(--radius); } diff --git a/html/config.inc.php.in b/html/config.inc.php.in index 77a64d0aa..eed492ae0 100644 --- a/html/config.inc.php.in +++ b/html/config.inc.php.in @@ -6,6 +6,7 @@ $cfg['cgi_config_file']='@sysconfdir@/cgi.cfg'; // location of the CGI config f $cfg['cgi_base_url']='@cgiurl@'; +$cfg['theme']='dark'; // Valid themes are "dark" or "light". Defaults to dark if something else or not set // FILE LOCATION DEFAULTS $cfg['main_config_file']='@sysconfdir@/nagios.cfg'; // default location of the main Nagios config file diff --git a/html/images/logos/horizontal-nagios-full-logo-black.svg b/html/images/logos/horizontal-nagios-full-logo-black.svg new file mode 100644 index 000000000..c883e1638 --- /dev/null +++ b/html/images/logos/horizontal-nagios-full-logo-black.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/html/images/logos/horizontal-nagios-full-logo.svg b/html/images/logos/horizontal-nagios-full-logo-white.svg similarity index 100% rename from html/images/logos/horizontal-nagios-full-logo.svg rename to html/images/logos/horizontal-nagios-full-logo-white.svg diff --git a/html/images/logos/nagios-n-logo-black.svg b/html/images/logos/nagios-n-logo-black.svg new file mode 100644 index 000000000..2a8bd813c --- /dev/null +++ b/html/images/logos/nagios-n-logo-black.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/html/images/logos/nagios-n-logo.svg b/html/images/logos/nagios-n-logo-white.svg similarity index 100% rename from html/images/logos/nagios-n-logo.svg rename to html/images/logos/nagios-n-logo-white.svg diff --git a/html/index.php.in b/html/index.php.in index e6a2528af..543737725 100644 --- a/html/index.php.in +++ b/html/index.php.in @@ -1,4 +1,6 @@ @@ -52,7 +64,7 @@ $this_year = '2024'; width: 200px; border: none; /* I don't like doing this but not sure of a better way */ - border-right: 1px solid #28303E; + border-right: 1px solid ; } iframe[name="main"] { diff --git a/html/main.php b/html/main.php index df3df3f77..1072085a2 100644 --- a/html/main.php +++ b/html/main.php @@ -3,10 +3,20 @@ $this_version = '4.5.8'; $this_year = '2024'; +$theme = $cfg['theme'] ?? 'dark'; +if ($theme != 'dark' && $theme != 'light') { + $theme = 'dark'; +} + +$logo = "images/logos/nagios-n-logo-black.svg"; +if($theme == 'dark') { + $logo = "images/logos/nagios-n-logo-white.svg"; +} + ?> - + @@ -85,7 +95,7 @@ function setCoreStatusHTML(image, text) {
Disabling update checks presents a possible security risk. Visit nagios.org to check for updates manually or enable update checks in your Nagios config file.
A new version of Nagios Core is available!
@@ -116,7 +126,7 @@ function setCoreStatusHTML(image, text) { Nagios Core is licensed under the GNU General Public License and is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. Nagios, Nagios Core and the Nagios logo are trademarks, servicemarks, registered trademarks or registered servicemarks owned by Nagios Enterprises, LLC. Use of the Nagios marks is governed by the trademark use restrictions.
- +
diff --git a/html/side.php b/html/side.php index c8ea61bbc..c445e3c2d 100644 --- a/html/side.php +++ b/html/side.php @@ -3,10 +3,20 @@ $this_version = '4.5.8'; $link_target = 'main'; +$theme = $cfg['theme'] ?? 'dark'; +if ($theme != 'dark' && $theme != 'light') { + $theme = 'dark'; +} + +$logo = "images/logos/horizontal-nagios-full-logo-black.svg"; +if($theme == 'dark') { + $logo = "images/logos/horizontal-nagios-full-logo-white.svg"; +} + ?> - + @@ -18,7 +28,7 @@