sysview-py 0.2.1__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sysview_py-0.2.1 → sysview_py-0.3.1}/PKG-INFO +1 -1
- {sysview_py-0.2.1 → sysview_py-0.3.1}/pyproject.toml +1 -1
- {sysview_py-0.2.1 → sysview_py-0.3.1}/src/sysview_py/main.py +0 -1
- {sysview_py-0.2.1 → sysview_py-0.3.1}/src/sysview_py/report.py +17 -0
- sysview_py-0.3.1/src/sysview_py/static/sysview.css +67 -0
- {sysview_py-0.2.1 → sysview_py-0.3.1}/src/sysview_py/sysview.py +4 -4
- sysview_py-0.3.1/src/sysview_py/templates/card_view.html +25 -0
- {sysview_py-0.2.1 → sysview_py-0.3.1}/src/sysview_py/templates/header.html +3 -1
- {sysview_py-0.2.1 → sysview_py-0.3.1}/src/sysview_py/templates/services.html +1 -1
- sysview_py-0.2.1/src/sysview_py/static/sysview.css +0 -38
- {sysview_py-0.2.1 → sysview_py-0.3.1}/README.md +0 -0
- {sysview_py-0.2.1 → sysview_py-0.3.1}/src/sysview_py/__init__.py +0 -0
- {sysview_py-0.2.1 → sysview_py-0.3.1}/src/sysview_py/db.py +0 -0
- {sysview_py-0.2.1 → sysview_py-0.3.1}/src/sysview_py/flock.py +0 -0
- {sysview_py-0.2.1 → sysview_py-0.3.1}/src/sysview_py/static/simple.css +0 -0
- {sysview_py-0.2.1 → sysview_py-0.3.1}/src/sysview_py/templates/footer.html +0 -0
- {sysview_py-0.2.1 → sysview_py-0.3.1}/src/sysview_py/templates/host.html +0 -0
- {sysview_py-0.2.1 → sysview_py-0.3.1}/src/sysview_py/templates/index.html +0 -0
- {sysview_py-0.2.1 → sysview_py-0.3.1}/src/sysview_py/templates/index.html.table +0 -0
- {sysview_py-0.2.1 → sysview_py-0.3.1}/src/sysview_py/templates/service.html +0 -0
|
@@ -14,6 +14,11 @@ class Host:
|
|
|
14
14
|
self.name = name
|
|
15
15
|
self.report_types = report_types
|
|
16
16
|
self.reports = reports
|
|
17
|
+
self.url_path = f"hosts/{self.name}/host.html"
|
|
18
|
+
|
|
19
|
+
@property
|
|
20
|
+
def description(self):
|
|
21
|
+
return f"Last updated {self.last_updated}"
|
|
17
22
|
|
|
18
23
|
@property
|
|
19
24
|
def last_updated(self):
|
|
@@ -87,6 +92,18 @@ class ReportItem:
|
|
|
87
92
|
def __repr__(self):
|
|
88
93
|
return f"ReportItem(command={self.command}, status={self.status})"
|
|
89
94
|
|
|
95
|
+
@property
|
|
96
|
+
def description(self):
|
|
97
|
+
return f"{self.status_text}\nUpdated: {self.date}"
|
|
98
|
+
|
|
99
|
+
@property
|
|
100
|
+
def name(self):
|
|
101
|
+
return self.command
|
|
102
|
+
|
|
103
|
+
@property
|
|
104
|
+
def url_path(self):
|
|
105
|
+
return f"{self.report_type}_{self.id}.html"
|
|
106
|
+
|
|
90
107
|
@property
|
|
91
108
|
def status(self):
|
|
92
109
|
age = datetime.now() - self.date
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#OK {
|
|
2
|
+
background-color: #C1E1C1;
|
|
3
|
+
text-align: center;
|
|
4
|
+
color: black;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
#WARNING {
|
|
8
|
+
background-color: #FAC898;
|
|
9
|
+
text-align: center;
|
|
10
|
+
color: black;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
#CRITICAL {
|
|
14
|
+
background-color: #FAA0A0;
|
|
15
|
+
text-align: center;
|
|
16
|
+
color: black;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
#UNKNOWN {
|
|
20
|
+
background-color: #A7C7E7;
|
|
21
|
+
text-align: center;
|
|
22
|
+
color: black;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.active {
|
|
26
|
+
background-color: dimgrey;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:root {
|
|
30
|
+
width: 100%;
|
|
31
|
+
color-scheme: dark;
|
|
32
|
+
--bg: #212121;
|
|
33
|
+
--accent-bg: #2b2b2b;
|
|
34
|
+
--text: #dcdcdc;
|
|
35
|
+
--text-light: #ababab;
|
|
36
|
+
--accent: #ffb300;
|
|
37
|
+
--accent-hover: #ffe099;
|
|
38
|
+
--accent-text: var(--bg);
|
|
39
|
+
--code: #f06292;
|
|
40
|
+
--preformatted: #ccc;
|
|
41
|
+
--disabled: #111;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.card-container {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-wrap: wrap;
|
|
47
|
+
gap: 1rem;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
padding: 1rem;
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
.card {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
gap: 1rem;
|
|
56
|
+
width: 300px;
|
|
57
|
+
border: 1px solid #ddd;
|
|
58
|
+
border-radius: 8px;
|
|
59
|
+
padding: 1rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media (max-width: 768px) {
|
|
63
|
+
.card-container {
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
align-items: center;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -53,26 +53,26 @@ class Sysview:
|
|
|
53
53
|
loader=PackageLoader("sysview_py"),
|
|
54
54
|
autoescape=select_autoescape()
|
|
55
55
|
)
|
|
56
|
-
html = env.get_template("
|
|
56
|
+
html = env.get_template("card_view.html").render(items=self.hosts, title="Hosts", active="Hosts", path="", auto_refresh=True)
|
|
57
57
|
html_path = self.html_root / "index.html"
|
|
58
58
|
with open(html_path, 'w') as f:
|
|
59
59
|
f.write(html)
|
|
60
60
|
for host in self.hosts:
|
|
61
|
-
html = env.get_template("
|
|
61
|
+
html = env.get_template("card_view.html").render(items=host.all_items, title=host.name, active="Hosts", path="../../", auto_refresh=True)
|
|
62
62
|
host_dir = self.html_hosts / host.name
|
|
63
63
|
host_dir.mkdir()
|
|
64
64
|
html_path = host_dir / "host.html"
|
|
65
65
|
with open(html_path, 'w') as f:
|
|
66
66
|
f.write(html)
|
|
67
67
|
for item in host.all_items:
|
|
68
|
-
html = env.get_template("service.html").render(item=item, title=host.name, active="Services", path="../../")
|
|
68
|
+
html = env.get_template("service.html").render(item=item, title=host.name, active="Services", path="../../", auto_refresh=False)
|
|
69
69
|
html_path = host_dir / f"{item.report_type}_{item.id}.html"
|
|
70
70
|
raw_path = host_dir / f"{item.report_type}_{item.id}.txt"
|
|
71
71
|
with open(html_path, 'w') as f:
|
|
72
72
|
f.write(html)
|
|
73
73
|
with open(raw_path, 'w') as f:
|
|
74
74
|
f.write(item.raw_item)
|
|
75
|
-
html = env.get_template("
|
|
75
|
+
html = env.get_template("card_view.html").render(items=self.all_services, title="Services", active="Services", path="", auto_refresh=True)
|
|
76
76
|
html_path = self.html_root / f"services.html"
|
|
77
77
|
with open(html_path, 'w') as f:
|
|
78
78
|
f.write(html)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
{% include 'header.html' %}
|
|
3
|
+
{% if items[0].report_id is defined and active == 'Hosts' %}
|
|
4
|
+
<h2>{{ items[0].host }}</h2>
|
|
5
|
+
<p>Updated: {{ items[0].date }}</p>
|
|
6
|
+
{% endif %}
|
|
7
|
+
<section class="card-container">
|
|
8
|
+
{% for item in items %}
|
|
9
|
+
<article id="{{item.status }}" class="card">
|
|
10
|
+
{% if active == 'Hosts' %}
|
|
11
|
+
<a id="{{ item.status }}" href="{{ item.url_path }}">{{ item.name }}</a>
|
|
12
|
+
{% else %}
|
|
13
|
+
<a id="{{ item.status }}" href="hosts/{{ item.host }}/{{ item.url_path }}">{{ item.name }}</a>
|
|
14
|
+
{{ item.host }}
|
|
15
|
+
{% endif %}
|
|
16
|
+
{% if item.last_updated is defined %}
|
|
17
|
+
{{ item.last_updated }}
|
|
18
|
+
{% elif item.date is defined %}
|
|
19
|
+
{{ item.date }}
|
|
20
|
+
{% endif %}
|
|
21
|
+
</article>
|
|
22
|
+
{% endfor %}
|
|
23
|
+
</section>
|
|
24
|
+
{% include 'footer.html' %}
|
|
25
|
+
</html>
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
<title>sysview::{{ title }}</title>
|
|
7
7
|
<link rel="stylesheet" href="{{ path }}static/simple.css">
|
|
8
8
|
<link rel="stylesheet" href="{{ path }}static/sysview.css">
|
|
9
|
+
{% if auto_refresh == True %}
|
|
10
|
+
<meta http-equiv="refresh" content="10">
|
|
11
|
+
{% endif %}
|
|
9
12
|
</head>
|
|
10
13
|
<body><header>
|
|
11
14
|
<nav>
|
|
@@ -21,6 +24,5 @@
|
|
|
21
24
|
<a href="{{ path }}services.html">Services</a>
|
|
22
25
|
{% endif %}
|
|
23
26
|
</nav>
|
|
24
|
-
<h1>{{ title }}</h1>
|
|
25
27
|
</header>
|
|
26
28
|
<main>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<td><a href="hosts/{{ item.host }}/{{ item.report_type}}_{{ item.id }}.html">{{ item.command }}</a></td>
|
|
15
15
|
<td>{{ item.status_text }}</td>
|
|
16
16
|
<td>{{ item.date }}</td>
|
|
17
|
-
<td
|
|
17
|
+
<td id="{{ item.status }}"></td>
|
|
18
18
|
</tr>
|
|
19
19
|
{% endfor %}
|
|
20
20
|
</table>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
.OK {
|
|
2
|
-
color: black;
|
|
3
|
-
background-color: green;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.WARNING {
|
|
7
|
-
color: black;
|
|
8
|
-
background-color: gold;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.CRITICAL {
|
|
12
|
-
color: black;
|
|
13
|
-
background-color: crimson;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.UNKNOWN {
|
|
17
|
-
color: black;
|
|
18
|
-
background-color: purple;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.active {
|
|
22
|
-
background-color: dimgrey;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
:root {
|
|
26
|
-
width: 100%;
|
|
27
|
-
color-scheme: dark;
|
|
28
|
-
--bg: #212121;
|
|
29
|
-
--accent-bg: #2b2b2b;
|
|
30
|
-
--text: #dcdcdc;
|
|
31
|
-
--text-light: #ababab;
|
|
32
|
-
--accent: #ffb300;
|
|
33
|
-
--accent-hover: #ffe099;
|
|
34
|
-
--accent-text: var(--bg);
|
|
35
|
-
--code: #f06292;
|
|
36
|
-
--preformatted: #ccc;
|
|
37
|
-
--disabled: #111;
|
|
38
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|