Merge branch 'develop' into 'master'
update prod to 2.8.2 See merge request fediverse.space/fediverse.space!93
This commit is contained in:
commit
bef3aad08c
14
CHANGELOG.md
14
CHANGELOG.md
|
@ -19,6 +19,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Security
|
||||
|
||||
## [2.8.2 - 2019-08-31]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix insularity score only working for > 0
|
||||
|
||||
## [2.8.1 - 2019-08-31]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed error when viewing some uncrawlable instances
|
||||
- Fix navbar z-index
|
||||
- Optimize query used for generating status rate
|
||||
|
||||
## [2.8.0 - 2019-08-29]
|
||||
|
||||
### Added
|
||||
|
|
|
@ -44,28 +44,51 @@ defmodule Backend.Scheduler do
|
|||
Crawl
|
||||
|> select([c], %{
|
||||
instance_domain: c.instance_domain,
|
||||
statuses_seen: sum(c.statuses_seen),
|
||||
interactions_seen: sum(c.interactions_seen)
|
||||
})
|
||||
|> group_by([c], c.instance_domain)
|
||||
|
||||
scores =
|
||||
self_mentions_subquery =
|
||||
CrawlInteraction
|
||||
|> join(:left, [ci], c in subquery(crawls_subquery),
|
||||
on: ci.source_domain == c.instance_domain
|
||||
)
|
||||
|> where([ci], ci.source_domain == ci.target_domain)
|
||||
|> group_by([ci], ci.source_domain)
|
||||
|> select([ci, c], %{
|
||||
|> select([ci], %{
|
||||
domain: ci.source_domain,
|
||||
mentions: sum(ci.mentions),
|
||||
# we can take min() because every row is the same
|
||||
interactions: min(c.interactions_seen)
|
||||
self_mentions: sum(ci.mentions)
|
||||
})
|
||||
|> group_by([ci], ci.source_domain)
|
||||
|
||||
scores =
|
||||
Instance
|
||||
|> join(:inner, [i], c in subquery(crawls_subquery), on: i.domain == c.instance_domain)
|
||||
|> join(:left, [i, c], ci in subquery(self_mentions_subquery), on: i.domain == ci.domain)
|
||||
# don't generate insularity scores for instances where we haven't seen any activity
|
||||
# (e.g. server types where the timeline isn't crawled)
|
||||
|> where([i, c, ci], c.statuses_seen > 0)
|
||||
|> select([i, c, ci], %{
|
||||
domain: i.domain,
|
||||
mentions: ci.self_mentions,
|
||||
interactions: c.interactions_seen
|
||||
})
|
||||
|> Repo.all(timeout: :infinity)
|
||||
|> Enum.map(fn %{domain: domain, mentions: mentions, interactions: interactions} ->
|
||||
insularity =
|
||||
cond do
|
||||
# if we haven't seen any self mentions, but there are interactions, it means that users on the instance
|
||||
# only mentions others, i.e. insularity is 0
|
||||
mentions == nil and interactions != 0 ->
|
||||
0.0
|
||||
|
||||
interactions > 0 ->
|
||||
mentions / interactions
|
||||
|
||||
true ->
|
||||
nil
|
||||
end
|
||||
|
||||
%{
|
||||
domain: domain,
|
||||
insularity: mentions / interactions,
|
||||
insularity: insularity,
|
||||
inserted_at: now,
|
||||
updated_at: now
|
||||
}
|
||||
|
@ -96,23 +119,24 @@ defmodule Backend.Scheduler do
|
|||
})
|
||||
|
||||
instances =
|
||||
Crawl
|
||||
|> join(:inner, [c], c2 in subquery(earliest_crawl_subquery),
|
||||
on: c.instance_domain == c2.instance_domain
|
||||
Instance
|
||||
|> join(:inner, [i], c in Crawl, on: i.domain == c.instance_domain)
|
||||
|> join(:inner, [i], c2 in subquery(earliest_crawl_subquery),
|
||||
on: i.domain == c2.instance_domain
|
||||
)
|
||||
|> where(
|
||||
[c, c2],
|
||||
c.inserted_at > c2.earliest_crawl and not is_nil(c.statuses_seen)
|
||||
[i, c, c2],
|
||||
c.inserted_at > c2.earliest_crawl and c.statuses_seen > 0
|
||||
)
|
||||
|> select([c], %{
|
||||
instance_domain: c.instance_domain,
|
||||
|> select([i, c], %{
|
||||
domain: i.domain,
|
||||
status_count: sum(c.statuses_seen),
|
||||
second_earliest_crawl: min(c.inserted_at)
|
||||
})
|
||||
|> group_by([c], c.instance_domain)
|
||||
|> group_by([i], i.domain)
|
||||
|> Repo.all(timeout: :infinity)
|
||||
|> Enum.map(fn %{
|
||||
instance_domain: domain,
|
||||
domain: domain,
|
||||
status_count: status_count,
|
||||
second_earliest_crawl: oldest_timestamp
|
||||
} ->
|
||||
|
|
|
@ -54,6 +54,9 @@ defmodule BackendWeb.InstanceView do
|
|||
instance.crawl_error != nil and instance.type == nil ->
|
||||
render_domain_and_error(instance)
|
||||
|
||||
crawl == nil ->
|
||||
render_domain_and_error(instance)
|
||||
|
||||
true ->
|
||||
render_instance(instance, crawl, federation_restrictions)
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ defmodule Backend.MixProject do
|
|||
def project do
|
||||
[
|
||||
app: :backend,
|
||||
version: "2.8.0",
|
||||
version: "2.8.2",
|
||||
elixir: "~> 1.5",
|
||||
elixirc_paths: elixirc_paths(Mix.env()),
|
||||
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "frontend",
|
||||
"version": "2.8.0",
|
||||
"version": "2.8.2",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "NODE_ENV=development react-scripts start",
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generator: Adobe Illustrator 18.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 603.8 104.9" enable-background="new 0 0 603.8 104.9" xml:space="preserve">
|
||||
<g>
|
||||
<polygon fill="#4988A2" points="481.8,16.9 481.8,80.7 561.3,80.7 "/>
|
||||
<polygon fill="#7A4198" points="538.3,80.7 602.1,7.4 602.1,80.7 "/>
|
||||
<polygon fill="#478B60" points="481.9,80.7 513.5,1.1 561,80.7 "/>
|
||||
<polygon fill="#135F66" points="488.3,80.7 515.3,43.9 547.7,69.9 538.3,80.7 "/>
|
||||
<polygon fill="#2B7B82" points="488.3,80.7 481.9,80.7 501.1,32.4 515.3,43.9 "/>
|
||||
<polygon fill="#194A7F" points="547.7,69.9 538.3,80.7 561.1,80.7 "/>
|
||||
<polyline fill="#5E2B7C" points="551.7,65.3 547.7,69.9 561.1,80.7 551.7,65.3 "/>
|
||||
<polygon fill="#7A2980" points="602.1,80.7 561.1,80.7 551.7,65.3 575.6,37.8 "/>
|
||||
<polygon fill="#456630" points="515.3,43.9 528.6,26.4 551.7,65.3 547.7,69.9 "/>
|
||||
<polygon fill="#E77A45" points="528.6,26.4 535.4,16.9 551.3,39.2 566.9,23.9 575.6,37.8 551.7,65.3 "/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#6F8087" d="M61.7,80.7H49.5l-6.9-22.6H19.1l-6.6,22.6H0.5L24,4h14.2L61.7,80.7z M40.6,49.2l-6-20 c-1.4-5-2.7-10.4-3.8-15.1h-0.2c-1.1,4.7-2.3,10.3-3.6,15l-6.1,20.1H40.6z"/>
|
||||
<path fill="#6F8087" d="M82.3,33.9c3.8-6.2,9.8-9.6,17.5-9.6c12.4,0,21.8,11,21.8,28.2c0,20.3-11.7,29.4-23.4,29.4 c-6.6,0-12-3.1-14.7-7.6h-0.2v28.9H71.7V43.3c0-7.2-0.2-12.9-0.4-17.8h10.2l0.6,8.4H82.3z M83.3,58.4c0,9.9,6.8,14.1,12.5,14.1 c9,0,13.9-8.3,13.9-19.8c0-10.5-4.7-19.2-13.6-19.2c-6.9,0-12.8,6.5-12.8,14.6V58.4z"/>
|
||||
<path fill="#6F8087" d="M143.7,33.9c3.8-6.2,9.8-9.6,17.5-9.6c12.4,0,21.8,11,21.8,28.2c0,20.3-11.7,29.4-23.4,29.4 c-6.6,0-12-3.1-14.7-7.6h-0.2v28.9h-11.6V43.3c0-7.2-0.2-12.9-0.4-17.8h10.2l0.6,8.4H143.7z M144.7,58.4c0,9.9,6.8,14.1,12.5,14.1 c9,0,13.9-8.3,13.9-19.8c0-10.5-4.7-19.2-13.6-19.2c-6.9,0-12.8,6.5-12.8,14.6V58.4z"/>
|
||||
<g>
|
||||
<path fill="#404D5C" d="M230.9,15.9c-2.5-1.4-7.3-3.4-13.6-3.4c-9.1,0-12.9,5.3-12.9,10.2c0,6.5,4.3,9.7,14,13.9 c12.3,5.4,18.2,12.1,18.2,22.7c0,12.8-9.5,22.5-26.8,22.5c-7.2,0-14.8-2.1-18.5-4.6l2.6-9.7C198,70,204.3,72,210.6,72 c9.1,0,14.2-4.7,14.2-11.6c0-6.5-3.9-10.5-13-14.3c-11.4-4.6-19.1-11.5-19.1-22c0-12.1,9.7-21.3,25-21.3c7.3,0,12.8,1.8,16.1,3.5 L230.9,15.9z"/>
|
||||
<path fill="#404D5C" d="M254.3,17.7c-4,0-6.7-3-6.7-6.7c0-3.9,2.8-6.8,6.8-6.8c4,0,6.7,2.9,6.7,6.8 C261.1,14.7,258.5,17.7,254.3,17.7z M260.1,80.7h-11.6V25.4h11.6V80.7z"/>
|
||||
<path fill="#404D5C" d="M320.4,25.5c-0.3,3.9-0.5,8.5-0.5,15.9v31.5c0,11-0.9,31.4-27.1,31.4c-6.4,0-13.1-1.4-17.4-4l2.6-9 c3.4,2,8.7,3.9,14.9,3.9c9,0,15.4-5,15.4-17.5v-5.3h-0.2c-2.8,4.7-8.2,8.1-15.3,8.1c-13,0-22-11.5-22-27 c0-18.7,11.3-29.2,23.4-29.2c8.2,0,12.8,4.2,15.1,8.6h0.2l0.5-7.4H320.4z M308.2,46.8c0-7.3-4.8-13.3-11.9-13.3 c-8,0-13.6,7.6-13.6,19.4c0,10.8,4.9,18.5,13.5,18.5c6,0,12-4.6,12-13.8V46.8z"/>
|
||||
<path fill="#404D5C" d="M379.5,80.7h-11.6V48.3c0-7.8-2.6-14.4-10.5-14.4c-5.7,0-11.8,4.7-11.8,13.5v33.3h-11.6V41 c0-6.1-0.2-10.8-0.4-15.5h10.1l0.6,8.2h0.3c2.6-4.7,8.4-9.4,16.7-9.4c8.6,0,18.2,5.6,18.2,22.7V80.7z"/>
|
||||
<path fill="#404D5C" d="M432,67.6c0,4.7,0.1,9.5,0.8,13.1h-10.5l-0.8-6.4h-0.3c-3.1,4.3-8.5,7.5-15.4,7.5 c-10.3,0-16.2-7.6-16.2-16.1c0-13.7,11.9-20.6,30.9-20.6c0-4.1,0-12.3-11.1-12.3c-4.9,0-9.9,1.5-13.4,3.8l-2.4-7.7 c3.9-2.5,10.4-4.6,17.8-4.6c16.2,0,20.8,10.7,20.8,22.5V67.6z M420.7,52.9c-9.1,0-19.6,1.7-19.6,11.5c0,6.1,3.8,8.8,8.1,8.8 c6.3,0,11.5-4.8,11.5-11.2V52.9z"/>
|
||||
<path fill="#404D5C" d="M457.8,80.7h-11.1V7.4l11.1-6.3V80.7z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 11 KiB |
|
@ -8,7 +8,7 @@ const FloatingCardRow = styled.div`
|
|||
`;
|
||||
const FloatingCardElement = styled(Card)`
|
||||
margin: 0 0 10px 10px;
|
||||
z-index: 20;
|
||||
z-index: 2;
|
||||
`;
|
||||
|
||||
const FloatingCard: React.FC<ICardProps> = props => (
|
||||
|
|
|
@ -8,7 +8,7 @@ const Backdrop = styled.div`
|
|||
left: 0;
|
||||
right: 0;
|
||||
background-color: #293742;
|
||||
z-index: 100;
|
||||
z-index: 3;
|
||||
`;
|
||||
|
||||
interface IContainerProps {
|
||||
|
|
|
@ -1,8 +1,19 @@
|
|||
import { Classes, Code, H1, H2, H4 } from "@blueprintjs/core";
|
||||
import * as React from "react";
|
||||
import styled from "styled-components";
|
||||
// import appsignalLogo from "../../assets/appsignal.svg";
|
||||
import gitlabLogo from "../../assets/gitlab.png";
|
||||
import nlnetLogo from "../../assets/nlnet.png";
|
||||
import { Page } from "../atoms/";
|
||||
|
||||
const SponsorContainer = styled.div`
|
||||
margin-bottom: 20px;
|
||||
`;
|
||||
const Sponsor = styled.div`
|
||||
margin: 10px;
|
||||
display: inline-block;
|
||||
`;
|
||||
|
||||
const AboutScreen: React.FC = () => (
|
||||
<Page>
|
||||
<H1>About</H1>
|
||||
|
@ -54,20 +65,26 @@ const AboutScreen: React.FC = () => (
|
|||
</p>
|
||||
|
||||
<br />
|
||||
<H2>Credits</H2>
|
||||
<H2>Special thanks</H2>
|
||||
|
||||
<a href="https://nlnet.nl/project/fediverse_space/" target="_blank" rel="noopener noreferrer">
|
||||
<img src={nlnetLogo} alt="NLnet logo" width={160} height={60} />
|
||||
</a>
|
||||
<br />
|
||||
<br />
|
||||
<p className={Classes.RUNNING_TEXT}>
|
||||
This project is proudly supported by{" "}
|
||||
<a href="https://nlnet.nl/project/fediverse_space/" target="_blank" rel="noopener noreferrer">
|
||||
NLnet
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
<SponsorContainer>
|
||||
<Sponsor>
|
||||
<a href="https://nlnet.nl/project/fediverse_space/" target="_blank" rel="noopener noreferrer">
|
||||
<img src={nlnetLogo} alt="NLnet logo" height={80} />
|
||||
</a>
|
||||
</Sponsor>
|
||||
<br />
|
||||
{/* <Sponsor>
|
||||
<a href="https://appsignal.com" target="_blank" rel="noopener noreferrer">
|
||||
<img src={appsignalLogo} alt="Appsignal logo" height={40} />
|
||||
</a>
|
||||
</Sponsor> */}
|
||||
<Sponsor>
|
||||
<a href="https://gitlab.com" target="_blank" rel="noopener noreferrer">
|
||||
<img src={gitlabLogo} alt="GitLab logo" height={40} />
|
||||
</a>
|
||||
</Sponsor>
|
||||
</SponsorContainer>
|
||||
|
||||
<p className={Classes.RUNNING_TEXT}>Inspiration for this site comes from several places:</p>
|
||||
<ul className={Classes.LIST}>
|
||||
|
|
|
@ -109,7 +109,12 @@ class InstanceScreenImpl extends React.PureComponent<IInstanceScreenProps, IInst
|
|||
let content;
|
||||
if (this.props.isLoadingInstanceDetails || this.state.isProcessingNeighbors || this.state.isLoadingLocalGraph) {
|
||||
content = this.renderLoadingState();
|
||||
} else if (this.props.instanceLoadError || this.state.localGraphLoadError || !this.props.instanceDetails) {
|
||||
} else if (
|
||||
this.props.instanceLoadError ||
|
||||
this.state.localGraphLoadError ||
|
||||
!this.props.instanceDetails ||
|
||||
!this.props.instanceDetails.status
|
||||
) {
|
||||
content = <ErrorState />;
|
||||
} else if (this.props.instanceDetails.status.toLowerCase().indexOf("personal instance") > -1) {
|
||||
content = this.renderPersonalInstanceErrorState();
|
||||
|
|
Loading…
Reference in New Issue