-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhtml.h
More file actions
95 lines (87 loc) · 3.36 KB
/
Copy pathhtml.h
File metadata and controls
95 lines (87 loc) · 3.36 KB
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
/*
* (C) 2013-2026 by Christian Hesse <mail@eworm.de>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#ifndef _HTML_H
#define _HTML_H
/* This is used for default documents. Usually you will not see this anyway. */
#define PAGE307 \
"<html><head><title>307 temporary redirect</title>" \
"</head><body>307 temporary redirect: " \
"<a href=\"%s\">%s</a></body></html>"
#define PAGE404 \
"<html><head><title>404 Not Found</title>" \
"</head><body>404 Not Found: %s</body></html>"
/* status page */
#define CIRCLE_GREEN "🟢"
#define CIRCLE_YELLOW "🟡"
#define CIRCLE_ORANGE "🟠"
#define CIRCLE_RED "🔴"
#define CIRCLE_BLUE "🔵"
#define STATUS_HEAD \
"<!DOCTYPE html><html lang=\"en\">" \
"<head><title>pacredir status</title>" \
"<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">" \
"<meta http-equiv=\"refresh\" content=\"30\">" \
"<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"style.css\">" \
"<link rel=\"icon\" href=\"favicon.png\" type=\"image/png\">" \
"</head><body><h1>pacredir status</h1>" \
"<p>This is <code>pacredir</code> version <i>" VERSION "</i> running on <i>%s</i>.</p>" \
"<p>ℹ️ Visit <a href=\"" WEBURL "\">" WEBSITE " ↗️</a> for documentation.</p>" \
"<table>" \
"<tr><td>Distribution:</td><td><b>" ID "</b></td></tr>" \
"<tr><td>Architecture:</td><td><b>" ARCH "</b></td></tr>" \
"<tr><td>Redirects:</td><td><b>%d</b></td></tr>" \
"<tr><td>Not found:</td><td><b>%d</b></td></tr>" \
"<tr><td>Over all:</td><td>%s</td></tr>" \
"</table>"
#define STATUS_INT_HEAD \
"<h2 id=\"ignored-interfaces\"><a href=\"#ignored-interfaces\">Ignored interfaces</a></h2>" \
"<table><tr><th>interface</th><th>link</th></tr>"
#define STATUS_INT_ONE \
"<tr class=\"online\"><td>%s</td><td>%d</td></tr>"
#define STATUS_INT_ONE_NA \
"<tr class=\"offline\"><td>%s</td><td>-</td></tr>"
#define STATUS_INT_NONE \
"<tr class=\"none\"><td colspan=2>(none)</td></tr>"
#define STATUS_INT_FOOT \
"</table>"
#define STATUS_HOST_HEAD \
"<h2 id=\"hosts\"><a href=\"#hosts\">Hosts</a></h2>" \
"<table><tr>" \
"<th>host</th>" \
"<th>port</th>" \
"<th colspan=2>state</th>" \
"<th colspan=2>redir</th>" \
"<th colspan=2>finds</th>" \
"<th colspan=2>bad</th></tr>"
#define STATUS_HOST_ONE \
"<tr class=\"%s\">" \
"<td>%s</td>" \
"<td>%d</td>" \
"<td>%s</td><td>%s</td>" \
"<td>%s</td><td>%d</td>" \
"<td>%s</td><td>%d</td>" \
"<td>%s</td><td>%d</td></tr>"
#define STATUS_HOST_NONE \
"<tr class=\"none\"><td colspan=10>(none)</td></tr>"
#define STATUS_HOST_FOOT \
"</table>"
#define STATUS_FOOT \
"<p class=\"foot\">" PROGNAME " v" VERSION " (built: " __DATE__ ", " __TIME__ ")<br>" \
"Copyright © 2013-2026 Christian Hesse <mail@eworm.de></p>" \
"</body></html>"
#endif /* _HTML_H */