-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathPatchViewer.php
executable file
·169 lines (149 loc) · 6.63 KB
/
PatchViewer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#!/usr/bin/php
<?php
require('PatchObject.php');
require('Database.php');
date_default_timezone_set('UTC');
$db = new Database(__DIR__ . '/db.json');
if (!$db->load()) {
exit(1);
}
$db->sort();
?>
<!doctype html>
<html lang="en" data-bs-theme="auto">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="title" content="PatchBot">
<meta name="author" content="Steffen Lange">
<meta name="date" content="<?php echo date(DATE_W3C); ?>">
<meta name="description" content="Patch Notification Robot provides you the latest update notifications.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://www.patchbot.de/">
<meta property="og:title" content="PatchBot">
<meta property="og:description" content="Patch Notification Robot provides you the latest update notifications.">
<meta property="og:image" content="https://www.patchbot.de/assets/patchbot.jpg">
<meta property="twitter:card" content="summary">
<meta property="twitter:url" content="https://www.patchbot.de/">
<meta property="twitter:title" content="PatchBot">
<meta property="twitter:description" content="Patch Notification Robot provides you the latest update notifications.">
<meta property="twitter:image" content="https://www.patchbot.de/assets/patchbot.jpg">
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="assets/font/bootstrap-icons.min.css">
<link rel="stylesheet" type="text/css" href="assets/css/datatables.min.css">
<script src="assets/js/jquery-3.7.1.slim.min.js"></script>
<script src="assets/js/datatables.min.js"></script>
<script src="assets/js/bootstrap.bundle.min.js"></script>
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
$('#patches').DataTable( {
stateSave: true
} );
});
</script>
<title>PatchBot</title>
</head>
<body>
<div class="container p-5">
<h2 class="mb-4">Patch Notification Robot</h2>
<p class="text-center"><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WYQZCVJPVSS5L&source=url"><img src="assets/btn_donateCC_LG.gif" alt="Donate" width="147" height="47" /></a></p>
<p><a href="https://www.patchbot.de/rss.xml"><i class="bi-rss"></i><span class="visually-hidden">Subscribe</span></a> <a rel="me" href="https://mastodon.social/@Patchbot_de"><i class="bi-mastodon"></i><span class="visually-hidden">Follow me</span></a> <a href="https://github.com/stelas/PatchBot"><i class="bi-github"></i><span class="visually-hidden">Fork me</span></a> Providing you the latest update notifications.</p>
<table id="patches" class="table table-bordered table-striped table-sm" data-order='[[ 4, "desc" ]]' data-page-length='25'>
<thead class="table-primary">
<tr>
<th>Vendor</th>
<th>Product</th>
<th>Branch</th>
<th>Version</th>
<th data-toggle="tooltip" title="*) or first discovery time">Release Date<sup>*</sup></th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $i < $db->count(); $i++) {
$patch = $db->get($i);
echo ' <tr>';
echo '<td>' . htmlentities($patch->getVendor()) . '</td>';
echo '<td><a href="' . htmlspecialchars($patch->getURL()) . '">' . htmlentities($patch->getProduct()) . '</a></td>';
echo '<td>' . htmlentities($patch->getBranch()) . '</td>';
echo '<td>' . htmlentities($patch->getVersion()) . '</td>';
echo '<td>' . date('Y-m-d', $patch->getTimestamp()) . '</td>';
echo '</tr>' . "\n";
}
?>
</tbody>
</table>
<hr>
<p class="text-end">Information are provided without any warranty. Trademarks are property of their respective owners.<br>
© 2019-<?php echo date('y'); ?> <a href="https://steffen.lange.tel/">Steffen Lange</a> | <a href="https://www.dateihal.de/cms/imprint">Imprint</a> | <a href="https://www.dateihal.de/cms/privacy">Privacy</a></p>
</div>
<script>
/*!
* Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors
* Licensed under the Creative Commons Attribution 3.0 Unported License.
*/
(() => {
'use strict'
const getStoredTheme = () => localStorage.getItem('theme')
const setStoredTheme = theme => localStorage.setItem('theme', theme)
const getPreferredTheme = () => {
const storedTheme = getStoredTheme()
if (storedTheme) {
return storedTheme
}
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
}
const setTheme = theme => {
if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'dark')
} else {
document.documentElement.setAttribute('data-bs-theme', theme)
}
}
setTheme(getPreferredTheme())
const showActiveTheme = (theme, focus = false) => {
const themeSwitcher = document.querySelector('#bd-theme')
if (!themeSwitcher) {
return
}
const themeSwitcherText = document.querySelector('#bd-theme-text')
const activeThemeIcon = document.querySelector('.theme-icon-active use')
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`)
const svgOfActiveBtn = btnToActive.querySelector('svg use').getAttribute('href')
document.querySelectorAll('[data-bs-theme-value]').forEach(element => {
element.classList.remove('active')
element.setAttribute('aria-pressed', 'false')
})
btnToActive.classList.add('active')
btnToActive.setAttribute('aria-pressed', 'true')
activeThemeIcon.setAttribute('href', svgOfActiveBtn)
const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})`
themeSwitcher.setAttribute('aria-label', themeSwitcherLabel)
if (focus) {
themeSwitcher.focus()
}
}
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
const storedTheme = getStoredTheme()
if (storedTheme !== 'light' && storedTheme !== 'dark') {
setTheme(getPreferredTheme())
}
})
window.addEventListener('DOMContentLoaded', () => {
showActiveTheme(getPreferredTheme())
document.querySelectorAll('[data-bs-theme-value]')
.forEach(toggle => {
toggle.addEventListener('click', () => {
const theme = toggle.getAttribute('data-bs-theme-value')
setStoredTheme(theme)
setTheme(theme)
showActiveTheme(theme, true)
})
})
})
})()
</script>
</body>
</html>