]> git.mxchange.org Git - fba.git/blob - index.html
Add numeration to highscores
[fba.git] / index.html
1 <!DOCTYPE html>
2 <head>
3     <title>fedi-block-api{% if domain %} {{domain}}{% endif %}</title>
4     <style>
5         body {
6             background-color: #000022;
7             color: #ffffff;
8             text-align: center;
9             font-family: "Open Sans", "Roboto", sans-serif;
10         }
11         .block_level {
12             background-color: #1c1c3c;
13             width: 80em;
14             padding: 5px;
15             margin: auto;
16             margin-top: 10px;
17         }
18         .scoreboard {
19             background-color: #1c1c3c;
20             width: 40em;
21             padding: 5px;
22             margin: auto;
23             margin-top: 10px;
24         }
25         table {
26             width: 100%;
27             background-color: #2d2d4d;
28             border-spacing: 0px;
29         }
30         table tr:nth-of-type(2n) {
31             background-color: #1c1c3c;
32         }
33         table td {
34             padding: 4px;
35         }
36         .block_level table td:nth-of-type(1), .block_level table td:nth-of-type(2),
37         .block_level table td:nth-of-type(4), .block_level table td:nth-of-type(5) {
38             white-space: nowrap;
39         }
40         .block {
41             background-color: #2d2d4d;
42             padding: 5px;
43             margin: 5px;
44         }
45         a {
46             color: #ffffff;
47         }
48         .info {
49             margin-top: 25px;
50         }
51         input[type="text"], input[type="submit"] {
52             padding: 5px;
53             border-radius: 5px;
54             color: white;
55             background: #445;
56             font-size: 16px;
57         }
58
59         input[type="text"]:hover {
60             border-color: #f08;
61         }
62
63         input[type="submit"] {
64             cursor: pointer;
65         }
66
67         input[type="submit"]:hover {
68             border-color: #f08;
69         }
70
71         span[title] {
72             text-decoration: underline dotted;
73         }
74     </style>
75 </head>
76 <body>
77     {% if scoreboard %}
78         {% if blockers %}
79             <h1>Top {{blockers}} defederating instances</h1>
80         {% elif blocked %}
81             <h1>Top {{blocked}} defederated instances</h1>
82         {% endif %}
83         <div class="scoreboard">
84             <table>
85                 <th>№</th>
86                 <th>Instance</th>
87                 <th>Defederations</th>
88                 {% for entry in scores %}
89                     <tr>
90                         <td>{{loop.index}}</td>
91                         <td>
92                             <img src="https://proxy.duckduckgo.com/ip3/{{entry['domain']}}.ico" width=16/>
93                             <b><a href="https://{{entry['domain']}}" rel="nofollow noopener noreferrer">{{entry['domain']}}</a></b>
94                         </td>
95                         <td>{{entry['highscore']}}</td>
96                     </tr>
97                 {% endfor %}
98             </table>
99         </div>
100     {% elif reason or blocks or reverse %}
101         {% if reason %}
102             <h1>Instances that use "{{reason}}" in their reason</h1>
103         {% elif reverse %}
104             <h1>Instances that are blocked by {{reverse}}</h1>
105         {% elif blocks %}
106             <h1>Instances that block {{domain}}</h1>
107         {% endif %}
108         {% for block_level in blocks %}
109             <div class="block_level" id="{{block_level}}">
110                 <h2>{{block_level}} ({{blocks[block_level]|length}})</h2>
111                 <table>
112                     <th>Blocker</th>
113                     <th>{% if block_level == 'accept' %}Accepted{% else %}Blocked{% endif %}</th>
114                     <th>Reason</th>
115                     <th>First added</th>
116                     <th>Last seen</th>
117                     {% for block in blocks[block_level] %}
118                         <tr>
119                             <td>
120                                 <img src="https://proxy.duckduckgo.com/ip3/{{block['blocker']}}.ico" width=16/>
121                                 <b><a href="https://{{block['blocker']}}" rel="nofollow noopener noreferrer">{{block['blocker']}}</a></b>
122                             </td>
123                             <td>
124                                 <img src="https://proxy.duckduckgo.com/ip3/{{domain or block['blocked']}}.ico" width=16/>
125                                 <b><a href="https://{{domain or block['blocked']}}" rel="nofollow noopener noreferrer">{{block['blocked']}}</a></b>
126                             </td>
127                             <td>{{block['reason']}}</td>
128                             <td>{{block['first_added']}}</td>
129                             <td>{{block['last_seen']}}</td>
130                         </tr>
131                     {% endfor %}
132                 </table>
133             </div>
134         {% endfor %}
135     {% else %}
136         <h1>Enter a Domain</h1>
137         <form>
138             <input type="text" name="domain" placeholder="example.com" />
139             <input type="submit" value="Submit" />
140         </form>
141         <h1>Enter a Reason</h1>
142         <form>
143             <input type="text" name="reason" placeholder="free speech" />
144             <input type="submit" value="Submit" />
145         </form>
146         <h1>Reverse search</h1>
147         <form>
148             <input type="text" name="reverse" placeholder="example.com" />
149             <input type="submit" value="Submit" />
150         </form>
151         <p>
152             <a href="./scoreboard?blockers=50">top 50 defederating</a> / <a href="./scoreboard?blocked=50">defederated instances</a>
153         </p>
154         <div class="info">
155             known instances: {{info.known_instances}}<br/>
156             indexed instances: {{info.indexed_instances}}<br/>
157             blocks recorded: {{info.blocks_recorded}}<br/>
158             source code: <a href="https://git.kiwifarms.net/mint/fedi-block-api">git.kiwifarms.net/mint/fedi-block-api</a> (<a href="https://gitgud.io/mintplg/fedi-block-api">mirror</a>)<br/>
159             fuck jannies
160         </div>
161     {% endif %}
162 </body>
163 </html>