Skip to content

Commit 04f4316

Browse files
committed
add theme support
1 parent 3e41aed commit 04f4316

7 files changed

Lines changed: 84 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ If you find a problem, let me know via github or https://forums.cacti.net/viewto
2828

2929

3030
## Changelog
31+
--- 0.5
32+
Add theme support
3133
--- 0.4
3234
Add chartJS graphs
3335
Add human readable values

themes/classic.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
.topx_table th {
3+
background-color: #cccccc;
4+
}

themes/common.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44

55
.topx_table td {
66
padding-right: 10px;
7+
padding-left: 3px;
78
}
89

910

10-
.topx_table th {
11-
background-color: #cccccc;
11+
.topx_table th {
12+
padding-right: 10px;
13+
padding-left: 3px;
1214
}
15+

themes/dark.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.navigate_form {
2+
background-color: #161616;
3+
4+
}
5+
6+
7+
.topx_table th {
8+
background-color: #363636;
9+
}
10+
11+
.topx_table td {
12+
background-color: #262626;
13+
}
14+
15+
.topx_graph {
16+
background-color: #262626;
17+
18+
}
19+

themes/paper-plane.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
.navigate_form {
3+
background-color: #262626;
4+
5+
}
6+
7+
8+
.topx_table th {
9+
background-color: #464646;
10+
color: #cccccc;
11+
}
12+
13+
.topx_table td {
14+
background-color: #363636;
15+
color: #cccccc;
16+
17+
}
18+
19+
.topx_graph {
20+
background-color: #363636;
21+
22+
}
23+
24+
25+
.topx_h3 {
26+
color: #cccccc;
27+
}

themes/sunrise.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.navigate_form {
2+
background-color: #000000;
3+
}
4+
5+
6+
.topx_table th {
7+
color: #cccccc;
8+
background-color: #121212;
9+
}
10+
11+
.topx_table td {
12+
color: #cccccc;
13+
}
14+
15+
.topx_graph {
16+
17+
}
18+
19+
20+
.topx_h3 {
21+
color: #cccccc;
22+
}
23+

topx.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,14 @@ function applyViewAgeFilterChange(objForm) {
6464

6565
html_start_box("<strong>TopX</strong>", "100%", $colors["header"], "3", "center", "");
6666

67+
6768
?>
6869

6970
<tr bgcolor="#<?php print $colors["panel"];?>">
7071
<td>
7172
<form name="form_topx" action="topx.php">
7273
<table width="100%" cellpadding="0" cellspacing="0">
73-
<tr>
74+
<tr class="navigate_form">
7475
<td nowrap style='white-space: nowrap;' width="50">
7576
Age:&nbsp;
7677
</td>
@@ -153,7 +154,7 @@ function applyViewAgeFilterChange(objForm) {
153154
$number_of_ds = db_fetch_cell ("select count(id) from data_template_data where local_data_template_data_id !=0 and data_template_id = " . $row['data_template_id']);
154155

155156

156-
echo "<h3>" . $row['name'] . " (total " . $number_of_ds . "):</h3>\n";
157+
echo "<h3 class=\"topx_h3\">" . $row['name'] . " (total " . $number_of_ds . "):</h3>\n";
157158

158159
// zjistime z tabulky, jak to mam sortovat
159160
$hash = db_fetch_cell ("SELECT hash from data_template where id=" . $row['data_template_id'] );
@@ -279,7 +280,7 @@ function applyViewAgeFilterChange(objForm) {
279280
$xid = "x" . uniqid();
280281

281282

282-
print "<div><br/><br/><canvas id=\"pie_$xid\" width=\"500\" height=\"" . (20+$_SESSION['topx']*25 ). "\"></canvas>\n";
283+
print "<div class=\"topx_graph\"><br/><br/><canvas id=\"pie_$xid\" width=\"500\" height=\"" . (20+$_SESSION['topx']*25 ). "\"></canvas>\n";
283284
print "<script type='text/javascript'>\n";
284285

285286
$pie_labels = implode('","',$label);

0 commit comments

Comments
 (0)