mirror of
https://gitea.invidious.io/iv-org/instances-api.git
synced 2024-08-15 00:53:15 +00:00
Merge f9a6931b15
into bd6bfce1c3
This commit is contained in:
commit
a73b9886c5
4 changed files with 24 additions and 27 deletions
8
assets/css/base-min.css
vendored
8
assets/css/base-min.css
vendored
File diff suppressed because one or more lines are too long
6
assets/css/tables-min.css
vendored
6
assets/css/tables-min.css
vendored
File diff suppressed because one or more lines are too long
|
@ -160,6 +160,7 @@ SORT_PROCS = {
|
|||
"api" => ->(name : String, instance : Instance) { instance[:api] == nil ? 2 : instance[:api] ? 0 : 1 },
|
||||
"users" => ->(name : String, instance : Instance) { -(instance[:stats]?.try &.["usage"]?.try &.["users"]["total"].as_i || 0) },
|
||||
"version" => ->(name : String, instance : Instance) { instance[:stats]?.try &.["software"]?.try &.["version"].as_s.try &.split("-", 2)[0].split(".").map { |a| -a.to_i } || [0, 0, 0] },
|
||||
"playback" => ->(name : String, instance : Instance) { -(instance[:stats]?.try &.["playback"]?.try &.["ratio"]?.try { |ratio| ratio.as_f } || 0.0) },
|
||||
}
|
||||
|
||||
def sort_instances(instances, sort_by)
|
||||
|
|
|
@ -61,23 +61,13 @@
|
|||
padding: 5px 0;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
bottom: 125%;
|
||||
left: 0%;
|
||||
margin-left: -60px;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
transform: translate(-50%, calc(100% + 5px)) rotate(0deg);
|
||||
}
|
||||
|
||||
.tooltip .tooltiptext::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
border-width: 5px;
|
||||
border-style: solid;
|
||||
border-color: #555 transparent transparent transparent;
|
||||
}
|
||||
.tooltip:hover .tooltiptext {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
|
@ -99,15 +89,18 @@
|
|||
<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" %>">
|
||||
<div class="tooltip">health<span class="tooltiptext">Uptime / Downtime displayed in percentage</span></div></a>
|
||||
</th>
|
||||
<th><a href="/?sort_by=<%= sort_by == "cors" ? "cors-reverse" : "cors" %>">cors</a></th>
|
||||
<th><a href="/?sort_by=<%= sort_by == "playback" ? "playback-reverse" : "playback" %>">
|
||||
<div class="tooltip">playback<span class="tooltiptext">Proxy playback success displayed in percentage,<br>0 means local proxy and DASH doesn't work.<br>"-" doesn't mean not working.</span></div>
|
||||
</th>
|
||||
<th><a href="/?sort_by=<%= sort_by == "location" ? "location-reverse" : "location" %>">location</a></th>
|
||||
<th><a href="/?sort_by=<%= sort_by == "type" ? "type-reverse" : "type" %>">type</a></th>
|
||||
<th><a href="/?sort_by=<%= sort_by == "api" ? "api-reverse" : "api" %>">api</a></th>
|
||||
<th><a href="/?sort_by=<%= sort_by == "cors" ? "cors-reverse" : "cors" %>">cors</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
@ -117,13 +110,14 @@
|
|||
<tr<% if index % 2 == 1 %> class="pure-table-odd" <% end %>>
|
||||
<td><a href="<%= instance[:uri] %>"><%= name.size > 24 ? "#{name[0, 12]}...#{name[-9, 9]}" : 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><%= instance[:flag]? ? "#{instance[:flag]} #{instance[:region]}" : "-" %></td>
|
||||
<td><%= instance[:monitor]?.try &.["30dRatio"]["ratio"] || "-" %></td>
|
||||
<td><%= instance[:cors] == nil ? "-" : instance[:cors] ? "✔" : "❌" %></td>
|
||||
<td><%= instance[:stats]?.try &.["playback"]?.try &.["ratio"]?.try { |ratio| ratio.as_f.to_i * 100 } || "-" %></td>
|
||||
<td><%= instance[:flag]? ? "#{instance[:flag]} #{instance[:region]}" : "-" %></td>
|
||||
<td><%= instance[:type] %></td>
|
||||
<td><%= instance[:api] == nil ? "-" : instance[:api] ? "✔" : "❌" %></td>
|
||||
<td><%= instance[:cors] == nil ? "-" : instance[:cors] ? "✔" : "❌" %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
@ -132,11 +126,13 @@
|
|||
|
||||
<div class="footer">
|
||||
<p>
|
||||
Proxy playback success displayed in percentage, 0 means local proxy and DASH doesn't work. But "-" doesn't mean not working.
|
||||
<br>
|
||||
Health is Uptime / Downtime displayed in percentage.
|
||||
<br>
|
||||
Released under the AGPLv3. Source available <a href="https://github.com/iv-org/instances.invidio.us">here</a>.
|
||||
<br>
|
||||
This site is built with ❤️ using <a href="https://purecss.io/">Pure v1.0.1</a>.
|
||||
This site is built with ❤️ using <a href="https://purecss.io/">Pure v3.0.0</a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
|
|
Loading…
Reference in a new issue