Skip to content

Commit

Permalink
Add in light mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tsadpbb committed Dec 13, 2024
1 parent 252ef02 commit 974cbc4
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 7 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------------
Expand Down
29 changes: 28 additions & 1 deletion contrib/exfoliation/stylesheets/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions html/config.inc.php.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions html/images/logos/horizontal-nagios-full-logo-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions html/images/logos/nagios-n-logo-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
14 changes: 13 additions & 1 deletion html/index.php.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
require_once(dirname(__FILE__).'/config.inc.php');

// Allow specifying main window URL for permalinks, etc.
$url = 'main.php';

Expand Down Expand Up @@ -27,6 +29,16 @@ if ("@COREWINDOW@" == "yes" && isset($_GET['corewindow'])) {
}

$this_year = '2024';
$theme = $cfg['theme'] ?? 'dark';
if ($theme != 'dark' && $theme != 'light') {
$theme = 'dark';
}

$border = "#D6D6D6";
if($theme == 'dark') {
$border = "#28303E";
}

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

Expand All @@ -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 <?= $border ?>;
}

iframe[name="main"] {
Expand Down
16 changes: 13 additions & 3 deletions html/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html id="main">
<html id="main" class="<?= $theme ?>">

<head>

Expand Down Expand Up @@ -85,7 +95,7 @@ function setCoreStatusHTML(image, text) {
<div class="submessage">Disabling update checks presents a possible security risk. Visit <a href="https://www.nagios.org/" target="_blank">nagios.org</a> to check for updates manually or enable update checks in your Nagios config file.</a></div>
</div>
<?php
} else if ($updateinfo['update_available'] && $this_version < $updateinfo['update_version']) {
} else if (true || $updateinfo['update_available'] && $this_version < $updateinfo['update_version']) {
?>
<div class="updateavailable">
<div class="updatemessage">A new version of Nagios Core is available!</div>
Expand Down Expand Up @@ -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 <A href="https://www.nagios.com/legal/trademarks/">trademark use restrictions</a>.
</div>
<div class="logos">
<a href="https://www.nagios.org/" target="_blank"><img src="images/logos/nagios-n-logo.svg" title="Nagios.org" /></a>
<a href="https://www.nagios.org/" target="_blank"><img src="<?= $logo ?>" title="Nagios.org" /></a>
</div>
</div>

Expand Down
14 changes: 12 additions & 2 deletions html/side.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html id="side">
<html id="side" class="<?= $theme ?>">

<head>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
Expand All @@ -18,7 +28,7 @@
<body class='navbar'>

<div class="navbarlogo">
<a href="https://www.nagios.org" target="_blank"><img src="images/logos/horizontal-nagios-full-logo.svg" height="39" width="140" border="0" alt="Nagios" /></a>
<a href="https://www.nagios.org" target="_blank"><img src="<?= $logo ?>" height="39" width="140" border="0" alt="Nagios" /></a>
</div>

<div class="navsection">
Expand Down

0 comments on commit 974cbc4

Please sign in to comment.