instances-api/src/instances/views/index.ecr

99 lines
3.5 KiB
Plaintext

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="referrer" content="no-referrer" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<meta name="msapplication-TileColor" content="#575757" />
<meta name="theme-color" content="#575757" />
<link rel="stylesheet" href="/css/pure-min.css" />
<link rel="stylesheet" href="/css/tables-min.css" />
<style>
body {
margin: 40px auto;
max-width: 1200px;
padding: 0 10px;
font-family: Open Sans, Arial;
color: #454545;
line-height: 1.2;
}
code {
background: #f8f8f8;
}
a {
color: #0366d6;
text-decoration: none;
}
pre code {
overflow: auto;
tab-size: 4;
display: block;
padding: 0.5em;
}
.pure-table {
width: 100%;
}
.right {
float: right;
text-align: right;
}
</style>
</head>
<body>
<div class="header">
<p>
<span>Instances sourced from <a href="https://github.com/omarroth/invidious/wiki/Invidious-Instances">here</a>.</span>
<span class="right"><a href="/instances.json?pretty=1">JSON</a></span>
</p>
</div>
<div class="content">
<table class="pure-table">
<thead>
<tr>
<th><a href="/?sort_by=<%= sort_by == "name" ? "name-reverse" : "name" %>">name</a></th>
<th><a href="/?sort_by=<%= sort_by == "version" ? "version-reverse" : "version" %>">version</a></th>
<th><a href="/?sort_by=<%= sort_by == "type" ? "type-reverse" : "type" %>">type</a></th>
<th><a href="/?sort_by=<%= sort_by == "users" ? "users-reverse" : "users" %>">users</a></th>
<th><a href="/?sort_by=<%= sort_by == "signup" ? "signup-reverse" : "signup" %>">signup</a></th>
<th><a href="/?sort_by=<%= sort_by == "location" ? "location-reverse" : "location" %>">location</a></th>
<th><a href="/?sort_by=<%= sort_by == "health" ? "health-reverse" : "health" %>">health</a></th>
</tr>
</thead>
<tbody>
<% instances.each_with_index do |tuple, index| %>
<% name, instance = tuple %>
<tr<% if index % 2 == 1 %> class="pure-table-odd" <% end %>>
<td><a href="<%= instance[:uri] %>"><%= name %></a></td>
<td><%= instance[:stats]?.try &.["software"]?.try &.["version"] || "-" %></td>
<td><%= instance[:type] %></td>
<td><%= instance[:stats]?.try &.["usage"]?.try &.["users"]["total"] || "-" %></td>
<td><%= instance[:stats]?.try &.["openRegistrations"]?.try { |bool| bool.as_bool ? "✔" : "❌" } || "-" %></td>
<td title="<%= instance[:region]? %>"><%= instance[:flag]? || "-" %></td>
<td><%= instance[:monitor]?.try &.["weeklyRatio"]["ratio"] || "-" %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="footer">
<p>
Released under the AGPLv3. Source available <a href="https://github.com/omarroth/instances.invidio.us">here</a>.
<br>
This site is built with ❤️ using <a href="https://purecss.io/">Pure v1.0.1</a>.
</p>
</div>
</body>
</html>