Skip to content

Commit 9c09a79

Browse files
chore: about page updated
1 parent 8092574 commit 9c09a79

3 files changed

Lines changed: 65 additions & 44 deletions

File tree

src/static/js/update.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
document.getElementById('updateButton').addEventListener('click', function (event) {
2+
event.preventDefault(); // Prevent the default link behavior
3+
4+
fetch('{{ url_for("update_git_version") }}', {
5+
method: 'POST',
6+
headers: {
7+
'Content-Type': 'application/json',
8+
// Add any additional headers if needed
9+
},
10+
})
11+
.then(response => response.json())
12+
.then(data => {
13+
if (data.status === 'success') {
14+
alert('Update successful: ' + data.message);
15+
} else {
16+
alert('Update failed: ' + data.message);
17+
}
18+
})
19+
.catch(error => {
20+
console.error('Error:', error);
21+
alert('An error occurred while updating.');
22+
});
23+
});

src/templates/other/about.html

Lines changed: 19 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,24 @@ <h5 class="card-title">Year</h5>
3232
<div class="info-section">
3333
<h5 class="card-title">Installation Method</h5>
3434
{% if installation_info["sg_installation_method"] == "git" %}
35-
<p class="card-text mb-0">Git Repository</p>
36-
<h5 class="card-title mt-3">Git Branch</h5>
37-
<p class="card-text mb-0">{{ installation_info["git_branch"] }}</p>
38-
<!-- update_available -->
39-
{% if installation_info["update_available"] %}
40-
<h5 class="card-title mt-3">Update Available</h5>
41-
<p class="card-text mb-0">A new version is available. Please update to the latest version.</p>
42-
<a href="#" class="btn btn-primary btn-lg hover-raise" id="updateButton">
43-
<i class="fas fa-download"></i> Update Now
44-
</a>
45-
{% else %}
46-
<h5 class="card-title mt-3">Update Status</h5>
47-
<p class="card-text mb-0">You are up-to-date with the latest version.</p>
48-
{% endif %}
35+
<p class="card-text mb-0">Git Repository</p>
36+
<h5 class="card-title mt-3">Git Branch</h5>
37+
<p class="card-text mb-0">{{ installation_info["git_branch"] }}</p>
38+
<!-- update_available -->
39+
{% if installation_info["update_available"] %}
40+
<h5 class="card-title mt-3">Update Available</h5>
41+
<p class="card-text mb-0">A new version is available. Please update to the latest version.</p>
42+
<a href="#" class="btn btn-primary btn-lg hover-raise" id="updateButton">
43+
<i class="fas fa-download"></i> Update Now
44+
</a>
45+
{% else %}
46+
<h5 class="card-title mt-3">Update Status</h5>
47+
<p class="card-text mb-0">You are up-to-date with the latest version.</p>
48+
{% endif %}
4949
{% elif installation_info["sg_installation_method"] == "release" %}
50-
<p class="card-text">Installed via Release</p>
50+
<p class="card-text">Installed via Release</p>
5151
{% elif installation_info["sg_installation_method"] == "source" %}
52-
<p class="card-text">Installed via Source Code</p>
52+
<p class="card-text">Installed via Source Code</p>
5353
{% endif %}
5454
</div>
5555
<hr>
@@ -69,31 +69,7 @@ <h5 class="card-title">Contact</h5>
6969
</div>
7070
</div>
7171
</div>
72-
73-
<script>
74-
document.getElementById('updateButton').addEventListener('click', function (event) {
75-
event.preventDefault(); // Prevent the default link behavior
76-
77-
fetch('{{ url_for("update_git_version") }}', {
78-
method: 'POST',
79-
headers: {
80-
'Content-Type': 'application/json',
81-
// Add any additional headers if needed
82-
},
83-
})
84-
.then(response => response.json())
85-
.then(data => {
86-
if (data.status === 'success') {
87-
alert('Update successful: ' + data.message);
88-
} else {
89-
alert('Update failed: ' + data.message);
90-
}
91-
})
92-
.catch(error => {
93-
console.error('Error:', error);
94-
alert('An error occurred while updating.');
95-
});
96-
});
97-
</script>
98-
72+
{% endblock %}
73+
{% block extra_scripts %}
74+
<script src="{{ url_for('static', filename='js/update.js') }}"></script>
9975
{% endblock %}

src/templates/settings/control_panel.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ <h1 class="settings-title text-center my-4"><span class="text-danger">{{ title }
1919
<i class="fas fa-users"></i> Users
2020
</a>
2121
</li>
22+
<!-- systemguard central -->
23+
<li class="nav-item">
24+
<a class="nav-link" id="systemguard-central-tab" data-bs-toggle="tab" href="#systemguard-central" role="tab"
25+
aria-controls="systemguard-central" aria-selected="false">
26+
<i class="fas fa-users"></i> SystemGuard Central
27+
</a>
28+
</li>
2229
<li class="nav-item">
2330
<a class="nav-link" id="utilities-tab" data-bs-toggle="tab" href="#utilities" role="tab"
2431
aria-controls="utilities" aria-selected="false">
@@ -88,6 +95,22 @@ <h5 class="card-title mb-4 d-flex justify-content-center align-items-center">
8895
</div>
8996
</div>
9097
</div>
98+
<!-- SystemGuard Central Section -->
99+
<div class="tab-pane fade" id="systemguard-central" role="tabpanel" aria-labelledby="systemguard-central-tab">
100+
<div class="row justify-content-center">
101+
<div class="col-lg-6 col-md-6 mb-4">
102+
<div class="card h-100 shadow-sm rounded-lg text-center">
103+
<div class="card-body">
104+
<!-- central dashboard for systemguard use dashboard icon -->
105+
<h5 class="card-title"><i class="fa-brands fa-centercode"></i> SystemGuard Central</h5>
106+
<a href="{{ url_for('configure_targets') }}" class="btn btn-primary btn-block">
107+
<i class="fas fa-cogs"></i> Configure Targets for SystemGuard
108+
</a>
109+
</div>
110+
</div>
111+
</div>
112+
</div>
113+
</div>
91114

92115
<!-- Settings Section -->
93116
<div class="tab-pane fade" id="settings" role="tabpanel" aria-labelledby="settings-tab">
@@ -137,7 +160,6 @@ <h5 class="card-title"><i class="fas fa-tools"></i> More Utilities</h5>
137160
<a href="{{ url_for('monitor_websites') }}" class="btn btn-primary btn-block">
138161
<i class="fas fa-globe"></i> Ping Website
139162
</a>
140-
<!-- external_monitoring -->
141163
<a href="{{ url_for('external_monitoring') }}" class="btn btn-primary btn-block">
142164
<i class="fas fa-globe"></i> External API Monitoring
143165
</a>

0 commit comments

Comments
 (0)