mirror of
https://github.com/iv-org/instances-api.git
synced 2025-08-05 21:04:11 -04:00
Initial commit
This commit is contained in:
commit
b25cb3cbc0
11 changed files with 966 additions and 0 deletions
98
src/instances/views/index.ecr
Normal file
98
src/instances/views/index.ecr
Normal file
|
@ -0,0 +1,98 @@
|
|||
<!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>
|
Loading…
Add table
Add a link
Reference in a new issue