]> git.mxchange.org Git - fba.git/blob - index.html
Fix bug with homepage showing up instead of empty result
[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         a.listlink {
49             text-decoration: none;
50             font-size: 0.8em;
51         }
52         .info {
53             margin-top: 25px;
54         }
55         input[type="text"], input[type="submit"] {
56             padding: 5px;
57             border-radius: 5px;
58             color: white;
59             background: #445;
60             font-size: 16px;
61         }
62
63         input[type="text"]:hover {
64             border-color: #f08;
65         }
66
67         input[type="submit"] {
68             cursor: pointer;
69         }
70
71         input[type="submit"]:hover {
72             border-color: #f08;
73         }
74
75         span[title] {
76             text-decoration: underline dotted;
77         }
78     </style>
79 </head>
80 <body>
81     {% if scoreboard %}
82         {% if blockers %}
83             <h1>Top {{blockers}} defederating instances</h1>
84         {% elif blocked %}
85             <h1>Top {{blocked}} defederated instances</h1>
86         {% endif %}
87         <div class="scoreboard">
88             <table>
89                 <th>№</th>
90                 <th>Instance</th>
91                 <th>Defederations</th>
92                 {% for entry in scores %}
93                     <tr>
94                         <td>{{loop.index}}</td>
95                         <td>
96                             <img src="https://proxy.duckduckgo.com/ip3/{{entry['domain']}}.ico" width=16/>
97                             <b><a href="/?{% if blockers %}reverse{% elif blocked %}domain{% endif %}={{entry['domain']}}" rel="nofollow noopener noreferrer">{{entry['domain']}}</a></b>&nbsp;
98                             <a class="listlink" href="https://{{entry['domain']}}">↗</a>
99                         </td>
100                         <td>{{entry['highscore']}}</td>
101                     </tr>
102                 {% endfor %}
103             </table>
104         </div>
105     {% elif reason or domain or reverse %}
106         {% if reason %}
107             <h1>Instances that use "{{reason}}" in their reason</h1>
108         {% elif reverse %}
109             <h1>Instances that are blocked by {{reverse}}</h1>
110         {% elif domain %}
111             <h1>Instances that block {{domain}}</h1>
112         {% endif %}
113         {% for block_level in blocks %}
114             <div class="block_level" id="{{block_level}}">
115                 <h2>{{block_level}} ({{blocks[block_level]|length}})</h2>
116                 <table>
117                     <th>Blocker</th>
118                     <th>{% if block_level == 'accept' %}Accepted{% else %}Blocked{% endif %}</th>
119                     <th>Reason</th>
120                     <th>First added</th>
121                     <th>Last seen</th>
122                     {% for block in blocks[block_level] %}
123                         <tr>
124                             <td>
125                                 <img src="https://proxy.duckduckgo.com/ip3/{{block['blocker']}}.ico" width=16/>
126                                 <b><a href="https://{{block['blocker']}}" rel="nofollow noopener noreferrer">{{block['blocker']}}</a></b>
127                             </td>
128                             <td>
129                                 <img src="https://proxy.duckduckgo.com/ip3/{{domain or block['blocked']}}.ico" width=16/>
130                                 <b><a href="https://{{domain or block['blocked']}}" rel="nofollow noopener noreferrer">{{block['blocked']}}</a></b>
131                             </td>
132                             <td>{{block['reason']}}</td>
133                             <td>{{block['first_added']}}</td>
134                             <td>{{block['last_seen']}}</td>
135                         </tr>
136                     {% endfor %}
137                 </table>
138             </div>
139         {% endfor %}
140     {% else %}
141         <h1>Enter a Domain</h1>
142         <form>
143             <input type="text" name="domain" placeholder="example.com" />
144             <input type="submit" value="Submit" />
145         </form>
146         <h1>Enter a Reason</h1>
147         <form>
148             <input type="text" name="reason" placeholder="free speech" />
149             <input type="submit" value="Submit" />
150         </form>
151         <h1>Reverse search</h1>
152         <form>
153             <input type="text" name="reverse" placeholder="example.com" />
154             <input type="submit" value="Submit" />
155         </form>
156         <p>
157             <a href="./scoreboard?blockers=50">top 50 defederating</a> / <a href="./scoreboard?blocked=50">defederated instances</a>
158         </p>
159         <div class="info">
160             known instances: {{info.known_instances}}<br/>
161             indexed instances: {{info.indexed_instances}}<br/>
162             blocks recorded: {{info.blocks_recorded}}<br/>
163             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/><br/>
164             fuck jannies<br/>
165             #FreeMyNigga
166         </div>
167     {% endif %}
168 </body>
169 </html>