forked from AkkomaGang/akkoma
Merge branch 'develop' into refactor/notification_settings
This commit is contained in:
commit
b950fb01db
98 changed files with 669 additions and 212 deletions
|
@ -434,6 +434,14 @@
|
||||||
],
|
],
|
||||||
unfurl_nsfw: false
|
unfurl_nsfw: false
|
||||||
|
|
||||||
|
config :pleroma, Pleroma.Web.Preload,
|
||||||
|
providers: [
|
||||||
|
Pleroma.Web.Preload.Providers.Instance,
|
||||||
|
Pleroma.Web.Preload.Providers.User,
|
||||||
|
Pleroma.Web.Preload.Providers.Timelines,
|
||||||
|
Pleroma.Web.Preload.Providers.StatusNet
|
||||||
|
]
|
||||||
|
|
||||||
config :pleroma, :http_security,
|
config :pleroma, :http_security,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
sts: false,
|
sts: false,
|
||||||
|
|
|
@ -234,3 +234,43 @@ Has these additional fields under the `pleroma` object:
|
||||||
## Streaming
|
## Streaming
|
||||||
|
|
||||||
There is an additional `user:pleroma_chat` stream. Incoming chat messages will make the current chat be sent to this `user` stream. The `event` of an incoming chat message is `pleroma:chat_update`. The payload is the updated chat with the incoming chat message in the `last_message` field.
|
There is an additional `user:pleroma_chat` stream. Incoming chat messages will make the current chat be sent to this `user` stream. The `event` of an incoming chat message is `pleroma:chat_update`. The payload is the updated chat with the incoming chat message in the `last_message` field.
|
||||||
|
|
||||||
|
## Not implemented
|
||||||
|
|
||||||
|
Pleroma is generally compatible with the Mastodon 2.7.2 API, but some newer features and non-essential features are omitted. These features usually return an HTTP 200 status code, but with an empty response. While they may be added in the future, they are considered low priority.
|
||||||
|
|
||||||
|
### Suggestions
|
||||||
|
|
||||||
|
*Added in Mastodon 2.4.3*
|
||||||
|
|
||||||
|
- `GET /api/v1/suggestions`: Returns an empty array, `[]`
|
||||||
|
|
||||||
|
### Trends
|
||||||
|
|
||||||
|
*Added in Mastodon 3.0.0*
|
||||||
|
|
||||||
|
- `GET /api/v1/trends`: Returns an empty array, `[]`
|
||||||
|
|
||||||
|
### Identity proofs
|
||||||
|
|
||||||
|
*Added in Mastodon 2.8.0*
|
||||||
|
|
||||||
|
- `GET /api/v1/identity_proofs`: Returns an empty array, `[]`
|
||||||
|
|
||||||
|
### Endorsements
|
||||||
|
|
||||||
|
*Added in Mastodon 2.5.0*
|
||||||
|
|
||||||
|
- `GET /api/v1/endorsements`: Returns an empty array, `[]`
|
||||||
|
|
||||||
|
### Profile directory
|
||||||
|
|
||||||
|
*Added in Mastodon 3.0.0*
|
||||||
|
|
||||||
|
- `GET /api/v1/directory`: Returns HTTP 404
|
||||||
|
|
||||||
|
### Featured tags
|
||||||
|
|
||||||
|
*Added in Mastodon 3.0.0*
|
||||||
|
|
||||||
|
- `GET /api/v1/featured_tags`: Returns HTTP 404
|
||||||
|
|
|
@ -9,6 +9,7 @@ defmodule Fallback.RedirectController do
|
||||||
|
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
alias Pleroma.Web.Metadata
|
alias Pleroma.Web.Metadata
|
||||||
|
alias Pleroma.Web.Preload
|
||||||
|
|
||||||
def api_not_implemented(conn, _params) do
|
def api_not_implemented(conn, _params) do
|
||||||
conn
|
conn
|
||||||
|
@ -16,16 +17,7 @@ def api_not_implemented(conn, _params) do
|
||||||
|> json(%{error: "Not implemented"})
|
|> json(%{error: "Not implemented"})
|
||||||
end
|
end
|
||||||
|
|
||||||
def redirector(conn, _params, code \\ 200)
|
def redirector(conn, _params, code \\ 200) do
|
||||||
|
|
||||||
# redirect to admin section
|
|
||||||
# /pleroma/admin -> /pleroma/admin/
|
|
||||||
#
|
|
||||||
def redirector(conn, %{"path" => ["pleroma", "admin"]} = _, _code) do
|
|
||||||
redirect(conn, to: "/pleroma/admin/")
|
|
||||||
end
|
|
||||||
|
|
||||||
def redirector(conn, _params, code) do
|
|
||||||
conn
|
conn
|
||||||
|> put_resp_content_type("text/html")
|
|> put_resp_content_type("text/html")
|
||||||
|> send_file(code, index_file_path())
|
|> send_file(code, index_file_path())
|
||||||
|
@ -43,28 +35,33 @@ def redirector_with_meta(conn, %{"maybe_nickname_or_id" => maybe_nickname_or_id}
|
||||||
def redirector_with_meta(conn, params) do
|
def redirector_with_meta(conn, params) do
|
||||||
{:ok, index_content} = File.read(index_file_path())
|
{:ok, index_content} = File.read(index_file_path())
|
||||||
|
|
||||||
tags =
|
tags = build_tags(conn, params)
|
||||||
try do
|
preloads = preload_data(conn, params)
|
||||||
Metadata.build_tags(params)
|
|
||||||
rescue
|
|
||||||
e ->
|
|
||||||
Logger.error(
|
|
||||||
"Metadata rendering for #{conn.request_path} failed.\n" <>
|
|
||||||
Exception.format(:error, e, __STACKTRACE__)
|
|
||||||
)
|
|
||||||
|
|
||||||
""
|
response =
|
||||||
end
|
index_content
|
||||||
|
|> String.replace("<!--server-generated-meta-->", tags <> preloads)
|
||||||
response = String.replace(index_content, "<!--server-generated-meta-->", tags)
|
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|> put_resp_content_type("text/html")
|
|> put_resp_content_type("text/html")
|
||||||
|> send_resp(200, response)
|
|> send_resp(200, response)
|
||||||
end
|
end
|
||||||
|
|
||||||
def index_file_path do
|
def redirector_with_preload(conn, %{"path" => ["pleroma", "admin"]}) do
|
||||||
Pleroma.Plugs.InstanceStatic.file_path("index.html")
|
redirect(conn, to: "/pleroma/admin/")
|
||||||
|
end
|
||||||
|
|
||||||
|
def redirector_with_preload(conn, params) do
|
||||||
|
{:ok, index_content} = File.read(index_file_path())
|
||||||
|
preloads = preload_data(conn, params)
|
||||||
|
|
||||||
|
response =
|
||||||
|
index_content
|
||||||
|
|> String.replace("<!--server-generated-meta-->", preloads)
|
||||||
|
|
||||||
|
conn
|
||||||
|
|> put_resp_content_type("text/html")
|
||||||
|
|> send_resp(200, response)
|
||||||
end
|
end
|
||||||
|
|
||||||
def registration_page(conn, params) do
|
def registration_page(conn, params) do
|
||||||
|
@ -76,4 +73,36 @@ def empty(conn, _params) do
|
||||||
|> put_status(204)
|
|> put_status(204)
|
||||||
|> text("")
|
|> text("")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp index_file_path do
|
||||||
|
Pleroma.Plugs.InstanceStatic.file_path("index.html")
|
||||||
|
end
|
||||||
|
|
||||||
|
defp build_tags(conn, params) do
|
||||||
|
try do
|
||||||
|
Metadata.build_tags(params)
|
||||||
|
rescue
|
||||||
|
e ->
|
||||||
|
Logger.error(
|
||||||
|
"Metadata rendering for #{conn.request_path} failed.\n" <>
|
||||||
|
Exception.format(:error, e, __STACKTRACE__)
|
||||||
|
)
|
||||||
|
|
||||||
|
""
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defp preload_data(conn, params) do
|
||||||
|
try do
|
||||||
|
Preload.build_tags(conn, params)
|
||||||
|
rescue
|
||||||
|
e ->
|
||||||
|
Logger.error(
|
||||||
|
"Preloading for #{conn.request_path} failed.\n" <>
|
||||||
|
Exception.format(:error, e, __STACKTRACE__)
|
||||||
|
)
|
||||||
|
|
||||||
|
""
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
91
lib/pleroma/web/nodeinfo/nodeinfo.ex
Normal file
91
lib/pleroma/web/nodeinfo/nodeinfo.ex
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Web.Nodeinfo.Nodeinfo do
|
||||||
|
alias Pleroma.Config
|
||||||
|
alias Pleroma.Stats
|
||||||
|
alias Pleroma.User
|
||||||
|
alias Pleroma.Web.Federator.Publisher
|
||||||
|
alias Pleroma.Web.MastodonAPI.InstanceView
|
||||||
|
|
||||||
|
# returns a nodeinfo 2.0 map, since 2.1 just adds a repository field
|
||||||
|
# under software.
|
||||||
|
def get_nodeinfo("2.0") do
|
||||||
|
stats = Stats.get_stats()
|
||||||
|
|
||||||
|
staff_accounts =
|
||||||
|
User.all_superusers()
|
||||||
|
|> Enum.map(fn u -> u.ap_id end)
|
||||||
|
|
||||||
|
federation = InstanceView.federation()
|
||||||
|
features = InstanceView.features()
|
||||||
|
|
||||||
|
%{
|
||||||
|
version: "2.0",
|
||||||
|
software: %{
|
||||||
|
name: Pleroma.Application.name() |> String.downcase(),
|
||||||
|
version: Pleroma.Application.version()
|
||||||
|
},
|
||||||
|
protocols: Publisher.gather_nodeinfo_protocol_names(),
|
||||||
|
services: %{
|
||||||
|
inbound: [],
|
||||||
|
outbound: []
|
||||||
|
},
|
||||||
|
openRegistrations: Config.get([:instance, :registrations_open]),
|
||||||
|
usage: %{
|
||||||
|
users: %{
|
||||||
|
total: Map.get(stats, :user_count, 0)
|
||||||
|
},
|
||||||
|
localPosts: Map.get(stats, :status_count, 0)
|
||||||
|
},
|
||||||
|
metadata: %{
|
||||||
|
nodeName: Config.get([:instance, :name]),
|
||||||
|
nodeDescription: Config.get([:instance, :description]),
|
||||||
|
private: !Config.get([:instance, :public], true),
|
||||||
|
suggestions: %{
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
staffAccounts: staff_accounts,
|
||||||
|
federation: federation,
|
||||||
|
pollLimits: Config.get([:instance, :poll_limits]),
|
||||||
|
postFormats: Config.get([:instance, :allowed_post_formats]),
|
||||||
|
uploadLimits: %{
|
||||||
|
general: Config.get([:instance, :upload_limit]),
|
||||||
|
avatar: Config.get([:instance, :avatar_upload_limit]),
|
||||||
|
banner: Config.get([:instance, :banner_upload_limit]),
|
||||||
|
background: Config.get([:instance, :background_upload_limit])
|
||||||
|
},
|
||||||
|
fieldsLimits: %{
|
||||||
|
maxFields: Config.get([:instance, :max_account_fields]),
|
||||||
|
maxRemoteFields: Config.get([:instance, :max_remote_account_fields]),
|
||||||
|
nameLength: Config.get([:instance, :account_field_name_length]),
|
||||||
|
valueLength: Config.get([:instance, :account_field_value_length])
|
||||||
|
},
|
||||||
|
accountActivationRequired: Config.get([:instance, :account_activation_required], false),
|
||||||
|
invitesEnabled: Config.get([:instance, :invites_enabled], false),
|
||||||
|
mailerEnabled: Config.get([Pleroma.Emails.Mailer, :enabled], false),
|
||||||
|
features: features,
|
||||||
|
restrictedNicknames: Config.get([Pleroma.User, :restricted_nicknames]),
|
||||||
|
skipThreadContainment: Config.get([:instance, :skip_thread_containment], false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_nodeinfo("2.1") do
|
||||||
|
raw_response = get_nodeinfo("2.0")
|
||||||
|
|
||||||
|
updated_software =
|
||||||
|
raw_response
|
||||||
|
|> Map.get(:software)
|
||||||
|
|> Map.put(:repository, Pleroma.Application.repository())
|
||||||
|
|
||||||
|
raw_response
|
||||||
|
|> Map.put(:software, updated_software)
|
||||||
|
|> Map.put(:version, "2.1")
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_nodeinfo(_version) do
|
||||||
|
{:error, :missing}
|
||||||
|
end
|
||||||
|
end
|
|
@ -5,12 +5,8 @@
|
||||||
defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
|
defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
|
||||||
use Pleroma.Web, :controller
|
use Pleroma.Web, :controller
|
||||||
|
|
||||||
alias Pleroma.Config
|
|
||||||
alias Pleroma.Stats
|
|
||||||
alias Pleroma.User
|
|
||||||
alias Pleroma.Web
|
alias Pleroma.Web
|
||||||
alias Pleroma.Web.Federator.Publisher
|
alias Pleroma.Web.Nodeinfo.Nodeinfo
|
||||||
alias Pleroma.Web.MastodonAPI.InstanceView
|
|
||||||
|
|
||||||
def schemas(conn, _params) do
|
def schemas(conn, _params) do
|
||||||
response = %{
|
response = %{
|
||||||
|
@ -29,102 +25,20 @@ def schemas(conn, _params) do
|
||||||
json(conn, response)
|
json(conn, response)
|
||||||
end
|
end
|
||||||
|
|
||||||
# returns a nodeinfo 2.0 map, since 2.1 just adds a repository field
|
|
||||||
# under software.
|
|
||||||
def raw_nodeinfo do
|
|
||||||
stats = Stats.get_stats()
|
|
||||||
|
|
||||||
staff_accounts =
|
|
||||||
User.all_superusers()
|
|
||||||
|> Enum.map(fn u -> u.ap_id end)
|
|
||||||
|
|
||||||
features = InstanceView.features()
|
|
||||||
federation = InstanceView.federation()
|
|
||||||
|
|
||||||
%{
|
|
||||||
version: "2.0",
|
|
||||||
software: %{
|
|
||||||
name: Pleroma.Application.name() |> String.downcase(),
|
|
||||||
version: Pleroma.Application.version()
|
|
||||||
},
|
|
||||||
protocols: Publisher.gather_nodeinfo_protocol_names(),
|
|
||||||
services: %{
|
|
||||||
inbound: [],
|
|
||||||
outbound: []
|
|
||||||
},
|
|
||||||
openRegistrations: Config.get([:instance, :registrations_open]),
|
|
||||||
usage: %{
|
|
||||||
users: %{
|
|
||||||
total: Map.get(stats, :user_count, 0)
|
|
||||||
},
|
|
||||||
localPosts: Map.get(stats, :status_count, 0)
|
|
||||||
},
|
|
||||||
metadata: %{
|
|
||||||
nodeName: Config.get([:instance, :name]),
|
|
||||||
nodeDescription: Config.get([:instance, :description]),
|
|
||||||
private: !Config.get([:instance, :public], true),
|
|
||||||
suggestions: %{
|
|
||||||
enabled: false
|
|
||||||
},
|
|
||||||
staffAccounts: staff_accounts,
|
|
||||||
federation: federation,
|
|
||||||
pollLimits: Config.get([:instance, :poll_limits]),
|
|
||||||
postFormats: Config.get([:instance, :allowed_post_formats]),
|
|
||||||
uploadLimits: %{
|
|
||||||
general: Config.get([:instance, :upload_limit]),
|
|
||||||
avatar: Config.get([:instance, :avatar_upload_limit]),
|
|
||||||
banner: Config.get([:instance, :banner_upload_limit]),
|
|
||||||
background: Config.get([:instance, :background_upload_limit])
|
|
||||||
},
|
|
||||||
fieldsLimits: %{
|
|
||||||
maxFields: Config.get([:instance, :max_account_fields]),
|
|
||||||
maxRemoteFields: Config.get([:instance, :max_remote_account_fields]),
|
|
||||||
nameLength: Config.get([:instance, :account_field_name_length]),
|
|
||||||
valueLength: Config.get([:instance, :account_field_value_length])
|
|
||||||
},
|
|
||||||
accountActivationRequired: Config.get([:instance, :account_activation_required], false),
|
|
||||||
invitesEnabled: Config.get([:instance, :invites_enabled], false),
|
|
||||||
mailerEnabled: Config.get([Pleroma.Emails.Mailer, :enabled], false),
|
|
||||||
features: features,
|
|
||||||
restrictedNicknames: Config.get([Pleroma.User, :restricted_nicknames]),
|
|
||||||
skipThreadContainment: Config.get([:instance, :skip_thread_containment], false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Schema definition: https://github.com/jhass/nodeinfo/blob/master/schemas/2.0/schema.json
|
# Schema definition: https://github.com/jhass/nodeinfo/blob/master/schemas/2.0/schema.json
|
||||||
# and https://github.com/jhass/nodeinfo/blob/master/schemas/2.1/schema.json
|
# and https://github.com/jhass/nodeinfo/blob/master/schemas/2.1/schema.json
|
||||||
def nodeinfo(conn, %{"version" => "2.0"}) do
|
def nodeinfo(conn, %{"version" => version}) do
|
||||||
conn
|
case Nodeinfo.get_nodeinfo(version) do
|
||||||
|> put_resp_header(
|
{:error, :missing} ->
|
||||||
"content-type",
|
render_error(conn, :not_found, "Nodeinfo schema version not handled")
|
||||||
"application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0#; charset=utf-8"
|
|
||||||
)
|
|
||||||
|> json(raw_nodeinfo())
|
|
||||||
end
|
|
||||||
|
|
||||||
def nodeinfo(conn, %{"version" => "2.1"}) do
|
node_info ->
|
||||||
raw_response = raw_nodeinfo()
|
conn
|
||||||
|
|> put_resp_header(
|
||||||
updated_software =
|
"content-type",
|
||||||
raw_response
|
"application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0#; charset=utf-8"
|
||||||
|> Map.get(:software)
|
)
|
||||||
|> Map.put(:repository, Pleroma.Application.repository())
|
|> json(node_info)
|
||||||
|
end
|
||||||
response =
|
|
||||||
raw_response
|
|
||||||
|> Map.put(:software, updated_software)
|
|
||||||
|> Map.put(:version, "2.1")
|
|
||||||
|
|
||||||
conn
|
|
||||||
|> put_resp_header(
|
|
||||||
"content-type",
|
|
||||||
"application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.1#; charset=utf-8"
|
|
||||||
)
|
|
||||||
|> json(response)
|
|
||||||
end
|
|
||||||
|
|
||||||
def nodeinfo(conn, _) do
|
|
||||||
render_error(conn, :not_found, "Nodeinfo schema version not handled")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
36
lib/pleroma/web/preload.ex
Normal file
36
lib/pleroma/web/preload.ex
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Web.Preload do
|
||||||
|
alias Phoenix.HTML
|
||||||
|
require Logger
|
||||||
|
|
||||||
|
def build_tags(_conn, params) do
|
||||||
|
preload_data =
|
||||||
|
Enum.reduce(Pleroma.Config.get([__MODULE__, :providers], []), %{}, fn parser, acc ->
|
||||||
|
terms =
|
||||||
|
params
|
||||||
|
|> parser.generate_terms()
|
||||||
|
|> Enum.map(fn {k, v} -> {k, Base.encode64(Jason.encode!(v))} end)
|
||||||
|
|> Enum.into(%{})
|
||||||
|
|
||||||
|
Map.merge(acc, terms)
|
||||||
|
end)
|
||||||
|
|
||||||
|
rendered_html =
|
||||||
|
preload_data
|
||||||
|
|> Jason.encode!()
|
||||||
|
|> build_script_tag()
|
||||||
|
|> HTML.safe_to_string()
|
||||||
|
|
||||||
|
rendered_html
|
||||||
|
end
|
||||||
|
|
||||||
|
def build_script_tag(content) do
|
||||||
|
HTML.Tag.content_tag(:script, HTML.raw(content),
|
||||||
|
id: "initial-results",
|
||||||
|
type: "application/json"
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
49
lib/pleroma/web/preload/instance.ex
Normal file
49
lib/pleroma/web/preload/instance.ex
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Web.Preload.Providers.Instance do
|
||||||
|
alias Pleroma.Web.MastodonAPI.InstanceView
|
||||||
|
alias Pleroma.Web.Nodeinfo.Nodeinfo
|
||||||
|
alias Pleroma.Web.Preload.Providers.Provider
|
||||||
|
|
||||||
|
@behaviour Provider
|
||||||
|
@instance_url :"/api/v1/instance"
|
||||||
|
@panel_url :"/instance/panel.html"
|
||||||
|
@nodeinfo_url :"/nodeinfo/2.0"
|
||||||
|
|
||||||
|
@impl Provider
|
||||||
|
def generate_terms(_params) do
|
||||||
|
%{}
|
||||||
|
|> build_info_tag()
|
||||||
|
|> build_panel_tag()
|
||||||
|
|> build_nodeinfo_tag()
|
||||||
|
end
|
||||||
|
|
||||||
|
defp build_info_tag(acc) do
|
||||||
|
info_data = InstanceView.render("show.json", %{})
|
||||||
|
|
||||||
|
Map.put(acc, @instance_url, info_data)
|
||||||
|
end
|
||||||
|
|
||||||
|
defp build_panel_tag(acc) do
|
||||||
|
instance_path = Path.join(:code.priv_dir(:pleroma), "static/instance/panel.html")
|
||||||
|
|
||||||
|
if File.exists?(instance_path) do
|
||||||
|
panel_data = File.read!(instance_path)
|
||||||
|
Map.put(acc, @panel_url, panel_data)
|
||||||
|
else
|
||||||
|
acc
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defp build_nodeinfo_tag(acc) do
|
||||||
|
case Nodeinfo.get_nodeinfo("2.0") do
|
||||||
|
{:error, _} ->
|
||||||
|
acc
|
||||||
|
|
||||||
|
nodeinfo_data ->
|
||||||
|
Map.put(acc, @nodeinfo_url, nodeinfo_data)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
7
lib/pleroma/web/preload/provider.ex
Normal file
7
lib/pleroma/web/preload/provider.ex
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Web.Preload.Providers.Provider do
|
||||||
|
@callback generate_terms(map()) :: map()
|
||||||
|
end
|
24
lib/pleroma/web/preload/status_net.ex
Normal file
24
lib/pleroma/web/preload/status_net.ex
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Web.Preload.Providers.StatusNet do
|
||||||
|
alias Pleroma.Web.Preload.Providers.Provider
|
||||||
|
alias Pleroma.Web.TwitterAPI.UtilView
|
||||||
|
|
||||||
|
@behaviour Provider
|
||||||
|
@config_url :"/api/statusnet/config.json"
|
||||||
|
|
||||||
|
@impl Provider
|
||||||
|
def generate_terms(_params) do
|
||||||
|
%{}
|
||||||
|
|> build_config_tag()
|
||||||
|
end
|
||||||
|
|
||||||
|
defp build_config_tag(acc) do
|
||||||
|
instance = Pleroma.Config.get(:instance)
|
||||||
|
info_data = UtilView.status_net_config(instance)
|
||||||
|
|
||||||
|
Map.put(acc, @config_url, info_data)
|
||||||
|
end
|
||||||
|
end
|
39
lib/pleroma/web/preload/timelines.ex
Normal file
39
lib/pleroma/web/preload/timelines.ex
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Web.Preload.Providers.Timelines do
|
||||||
|
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||||
|
alias Pleroma.Web.MastodonAPI.StatusView
|
||||||
|
alias Pleroma.Web.Preload.Providers.Provider
|
||||||
|
|
||||||
|
@behaviour Provider
|
||||||
|
@public_url :"/api/v1/timelines/public"
|
||||||
|
|
||||||
|
@impl Provider
|
||||||
|
def generate_terms(params) do
|
||||||
|
build_public_tag(%{}, params)
|
||||||
|
end
|
||||||
|
|
||||||
|
def build_public_tag(acc, params) do
|
||||||
|
if Pleroma.Config.get([:restrict_unauthenticated, :timelines, :federated], true) do
|
||||||
|
acc
|
||||||
|
else
|
||||||
|
Map.put(acc, @public_url, public_timeline(params))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defp public_timeline(%{"path" => ["main", "all"]}), do: get_public_timeline(false)
|
||||||
|
|
||||||
|
defp public_timeline(_params), do: get_public_timeline(true)
|
||||||
|
|
||||||
|
defp get_public_timeline(local_only) do
|
||||||
|
activities =
|
||||||
|
ActivityPub.fetch_public_activities(%{
|
||||||
|
type: ["Create"],
|
||||||
|
local_only: local_only
|
||||||
|
})
|
||||||
|
|
||||||
|
StatusView.render("index.json", activities: activities, for: nil, as: :activity)
|
||||||
|
end
|
||||||
|
end
|
25
lib/pleroma/web/preload/user.ex
Normal file
25
lib/pleroma/web/preload/user.ex
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Web.Preload.Providers.User do
|
||||||
|
alias Pleroma.Web.MastodonAPI.AccountView
|
||||||
|
alias Pleroma.Web.Preload.Providers.Provider
|
||||||
|
|
||||||
|
@behaviour Provider
|
||||||
|
@account_url :"/api/v1/accounts"
|
||||||
|
|
||||||
|
@impl Provider
|
||||||
|
def generate_terms(%{user: user}) do
|
||||||
|
build_accounts_tag(%{}, user)
|
||||||
|
end
|
||||||
|
|
||||||
|
def generate_terms(_params), do: %{}
|
||||||
|
|
||||||
|
def build_accounts_tag(acc, nil), do: acc
|
||||||
|
|
||||||
|
def build_accounts_tag(acc, user) do
|
||||||
|
account_data = AccountView.render("show.json", %{user: user, for: user})
|
||||||
|
Map.put(acc, @account_url, account_data)
|
||||||
|
end
|
||||||
|
end
|
|
@ -726,7 +726,7 @@ defmodule Pleroma.Web.Router do
|
||||||
get("/registration/:token", RedirectController, :registration_page)
|
get("/registration/:token", RedirectController, :registration_page)
|
||||||
get("/:maybe_nickname_or_id", RedirectController, :redirector_with_meta)
|
get("/:maybe_nickname_or_id", RedirectController, :redirector_with_meta)
|
||||||
get("/api*path", RedirectController, :api_not_implemented)
|
get("/api*path", RedirectController, :api_not_implemented)
|
||||||
get("/*path", RedirectController, :redirector)
|
get("/*path", RedirectController, :redirector_with_preload)
|
||||||
|
|
||||||
options("/*path", RedirectController, :empty)
|
options("/*path", RedirectController, :empty)
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,6 +15,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
alias Pleroma.Web
|
alias Pleroma.Web
|
||||||
alias Pleroma.Web.CommonAPI
|
alias Pleroma.Web.CommonAPI
|
||||||
|
alias Pleroma.Web.TwitterAPI.UtilView
|
||||||
alias Pleroma.Web.WebFinger
|
alias Pleroma.Web.WebFinger
|
||||||
|
|
||||||
plug(Pleroma.Web.FederatingPlug when action == :remote_subscribe)
|
plug(Pleroma.Web.FederatingPlug when action == :remote_subscribe)
|
||||||
|
@ -90,17 +91,7 @@ def notifications_read(%{assigns: %{user: user}} = conn, %{"id" => notification_
|
||||||
|
|
||||||
def config(%{assigns: %{format: "xml"}} = conn, _params) do
|
def config(%{assigns: %{format: "xml"}} = conn, _params) do
|
||||||
instance = Pleroma.Config.get(:instance)
|
instance = Pleroma.Config.get(:instance)
|
||||||
|
response = UtilView.status_net_config(instance)
|
||||||
response = """
|
|
||||||
<config>
|
|
||||||
<site>
|
|
||||||
<name>#{Keyword.get(instance, :name)}</name>
|
|
||||||
<site>#{Web.base_url()}</site>
|
|
||||||
<textlimit>#{Keyword.get(instance, :limit)}</textlimit>
|
|
||||||
<closed>#{!Keyword.get(instance, :registrations_open)}</closed>
|
|
||||||
</site>
|
|
||||||
</config>
|
|
||||||
"""
|
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|> put_resp_content_type("application/xml")
|
|> put_resp_content_type("application/xml")
|
||||||
|
|
|
@ -5,4 +5,18 @@
|
||||||
defmodule Pleroma.Web.TwitterAPI.UtilView do
|
defmodule Pleroma.Web.TwitterAPI.UtilView do
|
||||||
use Pleroma.Web, :view
|
use Pleroma.Web, :view
|
||||||
import Phoenix.HTML.Form
|
import Phoenix.HTML.Form
|
||||||
|
alias Pleroma.Web
|
||||||
|
|
||||||
|
def status_net_config(instance) do
|
||||||
|
"""
|
||||||
|
<config>
|
||||||
|
<site>
|
||||||
|
<name>#{Keyword.get(instance, :name)}</name>
|
||||||
|
<site>#{Web.base_url()}</site>
|
||||||
|
<textlimit>#{Keyword.get(instance, :limit)}</textlimit>
|
||||||
|
<closed>#{!Keyword.get(instance, :registrations_open)}</closed>
|
||||||
|
</site>
|
||||||
|
</config>
|
||||||
|
"""
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
1
priv/static/adminfe/chunk-0cbc.60bba79b.css
Normal file
1
priv/static/adminfe/chunk-0cbc.60bba79b.css
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.select-field[data-v-78fa3c24]{width:350px}@media only screen and (max-width:480px){.select-field[data-v-78fa3c24]{width:100%;margin-bottom:5px}}.el-dialog__body{padding:20px}.create-account-form-item{margin-bottom:20px}.create-account-form-item-without-margin{margin-bottom:0}@media only screen and (max-width:480px){.create-user-dialog{width:85%}.create-account-form-item{margin-bottom:20px}.el-dialog__body{padding:20px}}.moderate-user-button{text-align:left;width:350px;padding:10px}.moderate-user-button-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}@media only screen and (max-width:480px){.moderate-user-button{width:100%}}.actions-button{text-align:left;width:350px;padding:10px}.actions-container{display:-webkit-box;display:-ms-flexbox;display:flex;height:36px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0 15px 10px}.actions-container .el-dropdown{margin-left:10px}.active-tag{color:#409eff;font-weight:700}.active-tag .el-icon-check{color:#409eff;float:right;margin:7px 0 0 15px}.el-dropdown-link:hover{cursor:pointer;color:#409eff}.create-account>.el-icon-plus{margin-right:5px}.password-reset-token{margin:0 0 14px}.password-reset-token-dialog{width:50%}.reset-password-link{text-decoration:underline}.users-header-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.users-container h1{margin:10px 0 0 15px;height:40px}.users-container .el-table__row:hover{cursor:pointer}.users-container .pagination{margin:25px 0;text-align:center}.users-container .reboot-button{margin:0 15px 0 0;padding:10px;width:145px}.users-container .search{width:350px;float:right;margin-left:10px}.users-container .filter-container{display:-webkit-box;display:-ms-flexbox;display:flex;height:36px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:15px}.users-container .user-count{color:grey;font-size:28px}@media only screen and (max-width:480px){.password-reset-token-dialog{width:85%}.users-container h1{margin:0}.users-container .actions-button{width:100%}.users-container .actions-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:0 10px 7px}.users-container .el-icon-arrow-down{font-size:12px}.users-container .search{width:100%;margin-left:0}.users-container .filter-container{display:-webkit-box;display:-ms-flexbox;display:flex;height:82px;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:0 10px}.users-container .el-tag{width:30px;display:inline-block;margin-bottom:4px;font-weight:700}.users-container .el-tag.el-tag--danger,.users-container .el-tag.el-tag--success{padding-left:8px}.users-container .reboot-button{margin:0}.users-container .users-header-container{margin:7px 10px 12px}.users-container .user-count{color:grey;font-size:22px}}@media only screen and (max-width:801px) and (min-width:481px){.actions-button,.search{width:49%}}
|
1
priv/static/adminfe/chunk-143c.43ada4fc.css
Normal file
1
priv/static/adminfe/chunk-143c.43ada4fc.css
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.actions-button[data-v-2d9f3c5e]{text-align:left;width:350px;padding:10px}.actions-button-container[data-v-2d9f3c5e]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.el-dropdown[data-v-2d9f3c5e]{float:right}.el-icon-edit[data-v-2d9f3c5e]{margin-right:5px}.tag-container[data-v-2d9f3c5e]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.tag-text[data-v-2d9f3c5e]{padding-right:20px}.no-hover[data-v-2d9f3c5e]:hover{color:#606266;background-color:#fff;cursor:auto}
|
1
priv/static/adminfe/chunk-1609.408dae86.css
Normal file
1
priv/static/adminfe/chunk-1609.408dae86.css
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.router-link{text-decoration:none}.moderation-log-container[data-v-60b585cf]{margin:0 15px}h1[data-v-60b585cf]{margin:0}.el-timeline[data-v-60b585cf]{margin:25px 45px 0 0;padding:0}.moderation-log-date-panel[data-v-60b585cf]{width:350px}.moderation-log-header-container[data-v-60b585cf]{-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:10px 0 15px}.moderation-log-header-container[data-v-60b585cf],.moderation-log-nav-container[data-v-60b585cf]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.moderation-log-search[data-v-60b585cf]{width:350px}.moderation-log-user-select[data-v-60b585cf]{margin:0 0 20px;width:350px}.reboot-button[data-v-60b585cf]{padding:10px;margin:0;width:145px}.search-container[data-v-60b585cf]{text-align:right}.pagination[data-v-60b585cf]{text-align:center}@media only screen and (max-width:480px){h1[data-v-60b585cf]{font-size:24px}.moderation-log-date-panel[data-v-60b585cf]{width:100%}.moderation-log-user-select[data-v-60b585cf]{margin:0 0 10px;width:55%}.moderation-log-search[data-v-60b585cf]{width:40%}}@media only screen and (max-width:801px) and (min-width:481px){.moderation-log-date-panel[data-v-60b585cf]{width:55%}.moderation-log-user-select[data-v-60b585cf]{margin:0 0 10px;width:55%}.moderation-log-search[data-v-60b585cf]{width:40%}}
|
1
priv/static/adminfe/chunk-176e.5d7d957b.css
Normal file
1
priv/static/adminfe/chunk-176e.5d7d957b.css
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.statuses-container{padding:0 15px}.statuses-container h1{margin:10px 0 15px}.statuses-container .status-container{margin:0 0 10px}.statuses-header-container .el-button.is-plain:focus,.statuses-header-container .el-button.is-plain:hover{border-color:#dcdfe6;color:#606266;cursor:default}.checkbox-container{margin-bottom:15px}.filter-container{display:-webkit-box;display:-ms-flexbox;display:flex;height:36px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:22px 0 15px}.reboot-button{padding:10px;margin:0;width:145px}.select-instance{width:396px}.statuses-header,.statuses-header-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.statuses-pagination{padding:15px 0;text-align:center}@media only screen and (max-width:480px){.checkbox-container{margin-bottom:10px}.filter-container{display:-webkit-box;display:-ms-flexbox;display:flex;height:36px;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:10px 0}.select-field{width:100%;margin-bottom:5px}.select-instance{width:100%}.statuses-header-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.statuses-header-container .el-button-group{width:100%}.statuses-header-container .el-button{padding:10px 6.5px;width:50%}.statuses-header-container .el-button-group>.el-button:first-child{border-bottom-left-radius:0}.statuses-header-container .el-button-group>.el-button:not(:first-child):not(:last-child).private-button{border-top-right-radius:4px}.statuses-header-container .el-button-group>.el-button:not(:first-child):not(:last-child).public-button{border-bottom-left-radius:4px;border-top:#fff}.statuses-header-container .el-button-group>.el-button:last-child{border-top-right-radius:0;border-top:#fff}.statuses-header-container .reboot-button{margin:10px 0 0}}
|
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/chunk-43ca.0de86b6d.css
Normal file
1
priv/static/adminfe/chunk-43ca.0de86b6d.css
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/chunk-5882.f65db7f2.css
Normal file
1
priv/static/adminfe/chunk-5882.f65db7f2.css
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.moderate-user-button{text-align:left;width:350px;padding:10px}.moderate-user-button-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}@media only screen and (max-width:480px){.moderate-user-button{width:100%}}.security-settings-container{display:-webkit-box;display:-ms-flexbox;display:flex}.security-settings-container label{width:15%;height:36px}.security-settings-modal .el-dialog__body{padding-top:10px}.security-settings-modal .el-form-item,.security-settings-modal .password-alert{margin-bottom:15px}.security-settings-modal .password-input{margin-bottom:0}.security-settings-submit-button{float:right}@media (max-width:800px){.security-settings-modal .el-dialog{width:90%}}.security-settings-modal .el-alert .el-alert__description{word-break:break-word;font-size:1em}.security-settings-modal .form-text{display:block;margin-top:.25rem;color:#909399}header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;margin:22px 0;padding-left:15px}header h1{margin:0 0 0 10px}table{margin:10px 0 0 15px}table .name-col{width:150px}.avatar-name-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.avatar-name-container .el-icon-top-right{font-size:2em;line-height:36px;color:#606266}.invalid{color:grey}.el-table--border:after,.el-table--group:after,.el-table:before{background-color:transparent}.image{width:20%}.image img{width:100%}.invalid-user-tag{font-size:14px;width:inherit;height:auto;text-align:center;word-wrap:break-word;white-space:normal}.left-header-container{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.no-statuses{margin-left:28px;color:#606266}.password-reset-token{margin:0 0 14px}.password-reset-token-dialog{width:50%}.poll ul{list-style-type:none;padding:0;width:30%}.reboot-button{padding:10px;margin-left:10px}.recent-statuses-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;width:67%}.recent-statuses-header{margin-top:10px}.reset-password-link{text-decoration:underline}.security-setting-button{margin-top:20px;width:100%}.statuses{padding:0 20px 0 0}.show-private{width:200px;text-align:left;line-height:67px;margin-right:20px}.show-private-statuses{margin-left:28px;margin-bottom:20px}.recent-statuses{margin-left:28px}.user-page-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin:22px 15px 22px 20px;padding:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.user-page-header h1{display:inline}.user-profile-card{margin:0 20px;width:30%;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.user-profile-container{display:-webkit-box;display:-ms-flexbox;display:flex}.user-profile-table{margin:0;width:inherit}.user-profile-tag{margin:0 4px 4px 0}@media only screen and (max-width:480px){.avatar-name-container{margin-bottom:10px}.el-timeline-item__wrapper{padding-left:18px}.password-reset-token-dialog{width:85%}.recent-statuses{margin:20px 10px 15px}.recent-statuses-container{width:100%;margin:0}.show-private-statuses{margin:0 10px 20px}.status-container{margin:0 10px}.statuses{padding-right:10px;margin-left:8px}.user-page-header{padding:0;margin:7px 15px 15px 10px}.user-page-header-container .el-dropdown{width:95%;margin:0 15px 15px 10px}.user-profile-card{margin:0 10px;width:95%}.user-profile-card td{width:80px}.user-profile-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}}@media only screen and (max-width:801px) and (min-width:481px){.recent-statuses{margin:20px 10px 15px 0}.recent-statuses-container{width:97%;margin:0 20px}.show-private-statuses{margin:0 10px 20px 0}.user-page-header{padding:0;margin:7px 15px 20px 20px}.user-profile-card{margin:0 20px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.user-profile-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}}
|
|
@ -1 +0,0 @@
|
||||||
.actions-button[data-v-3850612b]{text-align:left;width:350px;padding:10px}.actions-button-container[data-v-3850612b]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.el-dropdown[data-v-3850612b]{float:right}.el-icon-edit[data-v-3850612b]{margin-right:5px}.tag-container[data-v-3850612b]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.tag-text[data-v-3850612b]{padding-right:20px}.no-hover[data-v-3850612b]:hover{color:#606266;background-color:#fff;cursor:auto}
|
|
1
priv/static/adminfe/chunk-7506.f01f6c2a.css
Normal file
1
priv/static/adminfe/chunk-7506.f01f6c2a.css
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.moderate-user-button{text-align:left;width:350px;padding:10px}.moderate-user-button-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}@media only screen and (max-width:480px){.moderate-user-button{width:100%}}.avatar-name-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.avatar-name-container .el-icon-top-right{font-size:2em;line-height:36px;color:#606266}.avatar-name-header{display:-webkit-box;display:-ms-flexbox;display:flex;height:40px;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.invalid{color:grey}.no-statuses{margin-left:28px;color:#606266}.password-reset-token{margin:0 0 14px}.password-reset-token-dialog{width:50%}.reboot-button{padding:10px;margin-left:6px}.recent-statuses-container-show{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.recent-statuses-container-show .el-timeline-item,.recent-statuses-container-show .recent-statuses{margin-left:20px}.recent-statuses-container-show .show-private-statuses{margin-left:20px;margin-bottom:20px}.reset-password-link{text-decoration:underline}.router-link{text-decoration:none}.status-container{margin:0 15px 0 20px}.statuses{padding:0 20px 0 0}.user-page-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin:22px 15px 22px 20px;padding:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.user-page-header h1{display:inline;margin:0 0 0 10px}@media only screen and (min-width:1824px){.status-show-container{max-width:1824px;margin:auto}}@media only screen and (max-width:480px){.avatar-name-container{margin-bottom:10px}.el-timeline-item__wrapper{padding-left:18px}.left-header-container{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.password-reset-token-dialog{width:85%}.recent-statuses{margin:20px 10px 15px}.recent-statuses-container-show{width:100%;margin:0 0 0 10px}.recent-statuses-container-show .el-timeline-item,.recent-statuses-container-show .recent-statuses{margin-left:0}.recent-statuses-container-show .show-private-statuses{margin:0 10px 20px 0}.status-card .el-card__body{padding:15px}.status-container{margin:0 10px}.statuses{padding-right:10px;margin-left:0}.statuses .el-timeline-item__wrapper{margin-right:10px}.user-page-header{padding:0;margin:7px 15px 5px 10px}.status-page-header-container{width:100%}.status-page-header-container .el-dropdown{width:-webkit-fill-available;width:-moz-available;width:stretch;margin:0 10px 15px}}@media only screen and (max-width:801px) and (min-width:481px){.recent-statuses-container-show{width:97%;margin:0 20px}.recent-statuses-container-show .el-timeline-item{margin-left:2px}.recent-statuses-container-show .recent-statuses{margin:20px 10px 15px 0}.recent-statuses-container-show .show-private-statuses,.show-private-statuses{margin:0 10px 20px 0}.user-page-header{padding:0;margin:7px 15px 20px 20px}}
|
|
@ -1 +0,0 @@
|
||||||
.moderation-log-container[data-v-103bba83]{margin:0 15px}h1[data-v-103bba83]{margin:0}.el-timeline[data-v-103bba83]{margin:25px 45px 0 0;padding:0}.moderation-log-date-panel[data-v-103bba83]{width:350px}.moderation-log-header-container[data-v-103bba83]{-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:10px 0 15px}.moderation-log-header-container[data-v-103bba83],.moderation-log-nav-container[data-v-103bba83]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.moderation-log-search[data-v-103bba83]{width:350px}.moderation-log-user-select[data-v-103bba83]{margin:0 0 20px;width:350px}.reboot-button[data-v-103bba83]{padding:10px;margin:0;width:145px}.search-container[data-v-103bba83]{text-align:right}.pagination[data-v-103bba83]{text-align:center}@media only screen and (max-width:480px){h1[data-v-103bba83]{font-size:24px}.moderation-log-date-panel[data-v-103bba83]{width:100%}.moderation-log-user-select[data-v-103bba83]{margin:0 0 10px;width:55%}.moderation-log-search[data-v-103bba83]{width:40%}}@media only screen and (max-width:801px) and (min-width:481px){.moderation-log-date-panel[data-v-103bba83]{width:55%}.moderation-log-user-select[data-v-103bba83]{margin:0 0 10px;width:55%}.moderation-log-search[data-v-103bba83]{width:40%}}
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/chunk-commons.7f6d2d11.css
Normal file
1
priv/static/adminfe/chunk-commons.7f6d2d11.css
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.status-card{margin-bottom:10px;cursor:pointer}.status-card .account{line-height:26px;font-size:13px;color:#606266}.status-card .account:hover{text-decoration:underline}.status-card .deactivated{color:grey;line-height:28px;vertical-align:middle}.status-card .image{width:20%}.status-card .image img{width:100%}.status-card .router-link{text-decoration:none}.status-card .show-more-button{margin-left:5px}.status-card .status-account{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.status-card .status-avatar-img{display:inline-block;width:15px;height:15px;margin-right:5px}.status-card .status-account-name{display:inline-block;margin:0;font-size:15px;font-weight:500}.status-card .status-body{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.status-card .status-card-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.status-card .status-checkbox{margin-right:7px}.status-card .status-content{font-size:15px;line-height:26px}.status-card .status-created-at{font-size:13px;color:#606266}.status-card .status-deleted{font-style:italic;margin-top:3px}.status-card .status-footer,.status-card .status-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.status-card .status-tags{display:inline}.status-card .status-without-content{font-style:italic}@media only screen and (max-width:480px){.el-message{min-width:80%}.el-message-box{width:80%}.status-card .el-card__header{padding:10px 17px}.status-card .el-tag{margin:3px 0}.status-card .status-account-container{margin-bottom:5px}.status-card .status-actions-button{margin:3px 0}.status-card .status-actions{width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.status-card .status-footer{margin-top:10px}.status-card .status-footer,.status-card .status-header{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.status-card .status-header{display:-webkit-box;display:-ms-flexbox;display:flex}}
|
|
@ -1 +0,0 @@
|
||||||
.select-field[data-v-4bc96860]{width:350px}@media only screen and (max-width:480px){.select-field[data-v-4bc96860]{width:100%;margin-bottom:5px}}.el-dialog__body{padding:20px}.create-account-form-item{margin-bottom:20px}.create-account-form-item-without-margin{margin-bottom:0}@media only screen and (max-width:480px){.create-user-dialog{width:85%}.create-account-form-item{margin-bottom:20px}.el-dialog__body{padding:20px}}.moderate-user-button{text-align:left;width:350px;padding:10px}.moderate-user-button-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}@media only screen and (max-width:480px){.moderate-user-button{width:100%}}.actions-button{text-align:left;width:350px;padding:10px}.actions-container{display:-webkit-box;display:-ms-flexbox;display:flex;height:36px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0 15px 10px}.actions-container .el-dropdown{margin-left:10px}.active-tag{color:#409eff;font-weight:700}.active-tag .el-icon-check{color:#409eff;float:right;margin:7px 0 0 15px}.el-dropdown-link:hover{cursor:pointer;color:#409eff}.create-account>.el-icon-plus{margin-right:5px}.users-header-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.password-reset-token{margin:0 0 14px}.password-reset-token-dialog{width:50%}.reset-password-link{text-decoration:underline}.users-container h1{margin:10px 0 0 15px;height:40px}.users-container .pagination{margin:25px 0;text-align:center}.users-container .reboot-button{margin:0 15px 0 0;padding:10px;width:145px}.users-container .search{width:350px;float:right;margin-left:10px}.users-container .filter-container{display:-webkit-box;display:-ms-flexbox;display:flex;height:36px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:15px}.users-container .user-count{color:grey;font-size:28px}@media only screen and (max-width:480px){.password-reset-token-dialog{width:85%}.users-container h1{margin:0}.users-container .actions-button{width:100%}.users-container .actions-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:0 10px 7px}.users-container .el-icon-arrow-down{font-size:12px}.users-container .search{width:100%;margin-left:0}.users-container .filter-container{display:-webkit-box;display:-ms-flexbox;display:flex;height:82px;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:0 10px}.users-container .el-tag{width:30px;display:inline-block;margin-bottom:4px;font-weight:700}.users-container .el-tag.el-tag--danger,.users-container .el-tag.el-tag--success{padding-left:8px}.users-container .reboot-button{margin:0}.users-container .users-header-container{margin:7px 10px 12px}.users-container .user-count{color:grey;font-size:22px}}@media only screen and (max-width:801px) and (min-width:481px){.actions-button,.search{width:49%}}
|
|
1
priv/static/adminfe/chunk-e404.a56021ae.css
Normal file
1
priv/static/adminfe/chunk-e404.a56021ae.css
Normal file
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
||||||
.status-card{margin-bottom:10px}.status-card .account{text-decoration:underline;line-height:26px;font-size:13px}.status-card .image{width:20%}.status-card .image img{width:100%}.status-card .show-more-button{margin-left:5px}.status-card .status-account{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.status-card .status-avatar-img{display:inline-block;width:15px;height:15px;margin-right:5px}.status-card .status-account-name{display:inline-block;margin:0;height:22px}.status-card .status-body{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.status-card .status-checkbox{margin-right:7px}.status-card .status-content{font-size:15px;line-height:26px}.status-card .status-deleted{font-style:italic;margin-top:3px}.status-card .status-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.status-card .status-without-content{font-style:italic}@media only screen and (max-width:480px){.el-message{min-width:80%}.el-message-box{width:80%}.status-card .el-card__header{padding:10px 17px}.status-card .el-tag{margin:3px 4px 3px 0}.status-card .status-account-container{margin-bottom:5px}.status-card .status-actions-button{margin:3px 0}.status-card .status-actions{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.status-card .status-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}}.statuses-container{padding:0 15px}.statuses-container h1{margin:10px 0 15px}.statuses-container .status-container{margin:0 0 10px}.statuses-header-container .el-button.is-plain:focus,.statuses-header-container .el-button.is-plain:hover{border-color:#dcdfe6;color:#606266;cursor:default}.checkbox-container{margin-bottom:15px}.filter-container{display:-webkit-box;display:-ms-flexbox;display:flex;height:36px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:22px 0 15px}.reboot-button{padding:10px;margin:0;width:145px}.select-instance{width:396px}.statuses-header,.statuses-header-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.statuses-pagination{padding:15px 0;text-align:center}@media only screen and (max-width:480px){.checkbox-container{margin-bottom:10px}.filter-container{display:-webkit-box;display:-ms-flexbox;display:flex;height:36px;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:10px 0}.select-field{width:100%;margin-bottom:5px}.select-instance{width:100%}.statuses-header-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.statuses-header-container .el-button-group{width:100%}.statuses-header-container .el-button{padding:10px 6.5px;width:50%}.statuses-header-container .el-button-group>.el-button:first-child{border-bottom-left-radius:0}.statuses-header-container .el-button-group>.el-button:not(:first-child):not(:last-child).private-button{border-top-right-radius:4px}.statuses-header-container .el-button-group>.el-button:not(:first-child):not(:last-child).public-button{border-bottom-left-radius:4px;border-top:#fff}.statuses-header-container .el-button-group>.el-button:last-child{border-top-right-radius:0;border-top:#fff}.statuses-header-container .reboot-button{margin:10px 0 0}}
|
|
|
@ -1 +1 @@
|
||||||
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><title>Admin FE</title><link rel="shortcut icon" href=favicon.ico><link href=chunk-elementUI.1abbc9b8.css rel=stylesheet><link href=chunk-libs.686b5876.css rel=stylesheet><link href=app.796ca6d4.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=static/js/runtime.b08eb412.js></script><script type=text/javascript src=static/js/chunk-elementUI.fba0efec.js></script><script type=text/javascript src=static/js/chunk-libs.b8c453ab.js></script><script type=text/javascript src=static/js/app.0146039c.js></script></body></html>
|
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><title>Admin FE</title><link rel="shortcut icon" href=favicon.ico><link href=chunk-elementUI.1abbc9b8.css rel=stylesheet><link href=chunk-libs.686b5876.css rel=stylesheet><link href=app.6684eb28.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=static/js/runtime.5bae86dc.js></script><script type=text/javascript src=static/js/chunk-elementUI.fba0efec.js></script><script type=text/javascript src=static/js/chunk-libs.b8c453ab.js></script><script type=text/javascript src=static/js/app.3fcec8f6.js></script></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/app.3fcec8f6.js
Normal file
2
priv/static/adminfe/static/js/app.3fcec8f6.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/app.3fcec8f6.js.map
Normal file
1
priv/static/adminfe/static/js/app.3fcec8f6.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-0cbc.43ff796f.js
Normal file
2
priv/static/adminfe/static/js/chunk-0cbc.43ff796f.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-0cbc.43ff796f.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-0cbc.43ff796f.js.map
Normal file
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-143c.fc1825bf.js
Normal file
2
priv/static/adminfe/static/js/chunk-143c.fc1825bf.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-143c.fc1825bf.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-143c.fc1825bf.js.map
Normal file
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-1609.98da6b01.js
Normal file
2
priv/static/adminfe/static/js/chunk-1609.98da6b01.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-1609.98da6b01.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-1609.98da6b01.js.map
Normal file
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-176e.c4995511.js
Normal file
2
priv/static/adminfe/static/js/chunk-176e.c4995511.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-176e.c4995511.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-176e.c4995511.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-43ca.3debeff7.js
Normal file
2
priv/static/adminfe/static/js/chunk-43ca.3debeff7.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-43ca.3debeff7.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-43ca.3debeff7.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-5882.7cbc4c1b.js
Normal file
2
priv/static/adminfe/static/js/chunk-5882.7cbc4c1b.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-5882.7cbc4c1b.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-5882.7cbc4c1b.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,2 +1,2 @@
|
||||||
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6e81"],{BF41:function(t,a,i){},"UUO+":function(t,a,i){"use strict";i.r(a);var e=i("zGwZ"),s=i.n(e),r={name:"Page401",data:function(){return{errGif:s.a+"?"+ +new Date,ewizardClap:"https://wpimg.wallstcn.com/007ef517-bafd-4066-aae4-6883632d9646",dialogVisible:!1}},methods:{back:function(){this.$route.query.noGoBack?this.$router.push({path:"/dashboard"}):this.$router.go(-1)}}},n=(i("UrVv"),i("KHd+")),l=Object(n.a)(r,function(){var t=this,a=t.$createElement,i=t._self._c||a;return i("div",{staticClass:"errPage-container"},[i("el-button",{staticClass:"pan-back-btn",attrs:{icon:"arrow-left"},on:{click:t.back}},[t._v("返回")]),t._v(" "),i("el-row",[i("el-col",{attrs:{span:12}},[i("h1",{staticClass:"text-jumbo text-ginormous"},[t._v("Oops!")]),t._v("\n gif来源"),i("a",{attrs:{href:"https://zh.airbnb.com/",target:"_blank"}},[t._v("airbnb")]),t._v(" 页面\n "),i("h2",[t._v("你没有权限去该页面")]),t._v(" "),i("h6",[t._v("如有不满请联系你领导")]),t._v(" "),i("ul",{staticClass:"list-unstyled"},[i("li",[t._v("或者你可以去:")]),t._v(" "),i("li",{staticClass:"link-type"},[i("router-link",{attrs:{to:"/dashboard"}},[t._v("回首页")])],1),t._v(" "),i("li",{staticClass:"link-type"},[i("a",{attrs:{href:"https://www.taobao.com/"}},[t._v("随便看看")])]),t._v(" "),i("li",[i("a",{attrs:{href:"#"},on:{click:function(a){a.preventDefault(),t.dialogVisible=!0}}},[t._v("点我看图")])])])]),t._v(" "),i("el-col",{attrs:{span:12}},[i("img",{attrs:{src:t.errGif,width:"313",height:"428",alt:"Girl has dropped her ice cream."}})])],1),t._v(" "),i("el-dialog",{attrs:{visible:t.dialogVisible,title:"随便看"},on:{"update:visible":function(a){t.dialogVisible=a}}},[i("img",{staticClass:"pan-img",attrs:{src:t.ewizardClap}})])],1)},[],!1,null,"ab9be52c",null);l.options.__file="401.vue";a.default=l.exports},UrVv:function(t,a,i){"use strict";var e=i("BF41");i.n(e).a},zGwZ:function(t,a,i){t.exports=i.p+"static/img/401.089007e.gif"}}]);
|
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6e81"],{BF41:function(t,a,i){},"UUO+":function(t,a,i){"use strict";i.r(a);var e=i("zGwZ"),s=i.n(e),r={name:"Page401",data:function(){return{errGif:s.a+"?"+ +new Date,ewizardClap:"https://wpimg.wallstcn.com/007ef517-bafd-4066-aae4-6883632d9646",dialogVisible:!1}},methods:{back:function(){this.$route.query.noGoBack?this.$router.push({path:"/dashboard"}):this.$router.go(-1)}}},n=(i("UrVv"),i("KHd+")),l=Object(n.a)(r,function(){var t=this,a=t.$createElement,i=t._self._c||a;return i("div",{staticClass:"errPage-container"},[i("el-button",{staticClass:"pan-back-btn",attrs:{icon:"arrow-left"},on:{click:t.back}},[t._v("返回")]),t._v(" "),i("el-row",[i("el-col",{attrs:{span:12}},[i("h1",{staticClass:"text-jumbo text-ginormous"},[t._v("Oops!")]),t._v("\n gif来源"),i("a",{attrs:{href:"https://zh.airbnb.com/",target:"_blank"}},[t._v("airbnb")]),t._v(" 页面\n "),i("h2",[t._v("你没有权限去该页面")]),t._v(" "),i("h6",[t._v("如有不满请联系你领导")]),t._v(" "),i("ul",{staticClass:"list-unstyled"},[i("li",[t._v("或者你可以去:")]),t._v(" "),i("li",{staticClass:"link-type"},[i("router-link",{attrs:{to:"/dashboard"}},[t._v("回首页")])],1),t._v(" "),i("li",{staticClass:"link-type"},[i("a",{attrs:{href:"https://www.taobao.com/"}},[t._v("随便看看")])]),t._v(" "),i("li",[i("a",{attrs:{href:"#"},on:{click:function(a){a.preventDefault(),t.dialogVisible=!0}}},[t._v("点我看图")])])])]),t._v(" "),i("el-col",{attrs:{span:12}},[i("img",{attrs:{src:t.errGif,width:"313",height:"428",alt:"Girl has dropped her ice cream."}})])],1),t._v(" "),i("el-dialog",{attrs:{visible:t.dialogVisible,title:"随便看"},on:{"update:visible":function(a){t.dialogVisible=a}}},[i("img",{staticClass:"pan-img",attrs:{src:t.ewizardClap}})])],1)},[],!1,null,"ab9be52c",null);l.options.__file="401.vue";a.default=l.exports},UrVv:function(t,a,i){"use strict";var e=i("BF41");i.n(e).a},zGwZ:function(t,a,i){t.exports=i.p+"static/img/401.089007e.gif"}}]);
|
||||||
//# sourceMappingURL=chunk-6e81.3733ace2.js.map
|
//# sourceMappingURL=chunk-6e81.6efb01f4.js.map
|
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-7506.a3364e53.js
Normal file
2
priv/static/adminfe/static/js/chunk-7506.a3364e53.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-7506.a3364e53.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-7506.a3364e53.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-7c6b.e63ae1da.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-7c6b.e63ae1da.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-c5f4.304479e7.js
Normal file
2
priv/static/adminfe/static/js/chunk-c5f4.304479e7.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-c5f4.304479e7.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-c5f4.304479e7.js.map
Normal file
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-commons.5a106955.js
Normal file
2
priv/static/adminfe/static/js/chunk-commons.5a106955.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-e404.554bc2e3.js
Normal file
2
priv/static/adminfe/static/js/chunk-e404.554bc2e3.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-e404.554bc2e3.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-e404.554bc2e3.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/runtime.5bae86dc.js
Normal file
2
priv/static/adminfe/static/js/runtime.5bae86dc.js
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
!function(e){function n(n){for(var t,r,a=n[0],f=n[1],h=n[2],i=0,l=[];i<a.length;i++)r=a[i],u[r]&&l.push(u[r][0]),u[r]=0;for(t in f)Object.prototype.hasOwnProperty.call(f,t)&&(e[t]=f[t]);for(d&&d(n);l.length;)l.shift()();return o.push.apply(o,h||[]),c()}function c(){for(var e,n=0;n<o.length;n++){for(var c=o[n],t=!0,r=1;r<c.length;r++){var f=c[r];0!==u[f]&&(t=!1)}t&&(o.splice(n--,1),e=a(a.s=c[0]))}return e}var t={},r={runtime:0},u={runtime:0},o=[];function a(n){if(t[n])return t[n].exports;var c=t[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,a),c.l=!0,c.exports}a.e=function(e){var n=[];r[e]?n.push(r[e]):0!==r[e]&&{"chunk-070d":1,"chunk-6e81":1,"chunk-commons":1,"chunk-143c":1,"chunk-0cbc":1,"chunk-43ca":1,"chunk-7c6b":1,"chunk-c5f4":1,"chunk-176e":1,"chunk-e404":1,"chunk-1609":1,"chunk-5882":1,"chunk-7506":1,"chunk-4e7e":1}[e]&&n.push(r[e]=new Promise(function(n,c){for(var t=({"chunk-commons":"chunk-commons"}[e]||e)+"."+{"7zzA":"31d6cfe0",JEtC:"31d6cfe0","chunk-070d":"d2dd6533","chunk-6e81":"ca3b222f","chunk-commons":"7f6d2d11",ZhIB:"31d6cfe0","chunk-143c":"43ada4fc","chunk-0cbc":"60bba79b","chunk-5118":"31d6cfe0","chunk-43ca":"0de86b6d","chunk-7c6b":"d9e7180a","chunk-c5f4":"0827b1ce","chunk-df62":"31d6cfe0","chunk-176e":"5d7d957b","chunk-e404":"a56021ae","chunk-1609":"408dae86","chunk-5882":"f65db7f2","chunk-7506":"f01f6c2a",oAJy:"31d6cfe0","chunk-16d0":"31d6cfe0","chunk-4e7e":"5afe1978"}[e]+".css",r=a.p+t,u=document.getElementsByTagName("link"),o=0;o<u.length;o++){var f=(i=u[o]).getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(f===t||f===r))return n()}var h=document.getElementsByTagName("style");for(o=0;o<h.length;o++){var i;if((f=(i=h[o]).getAttribute("data-href"))===t||f===r)return n()}var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.onload=n,d.onerror=function(n){var t=n&&n.target&&n.target.src||r,u=new Error("Loading CSS chunk "+e+" failed.\n("+t+")");u.request=t,c(u)},d.href=r,document.getElementsByTagName("head")[0].appendChild(d)}).then(function(){r[e]=0}));var c=u[e];if(0!==c)if(c)n.push(c[2]);else{var t=new Promise(function(n,t){c=u[e]=[n,t]});n.push(c[2]=t);var o,f=document.createElement("script");f.charset="utf-8",f.timeout=120,a.nc&&f.setAttribute("nonce",a.nc),f.src=function(e){return a.p+"static/js/"+({"chunk-commons":"chunk-commons"}[e]||e)+"."+{"7zzA":"e1ae1c94",JEtC:"f9ba4594","chunk-070d":"7e10a520","chunk-6e81":"6efb01f4","chunk-commons":"5a106955",ZhIB:"861df339","chunk-143c":"fc1825bf","chunk-0cbc":"43ff796f","chunk-5118":"7c48ad58","chunk-43ca":"3debeff7","chunk-7c6b":"e63ae1da","chunk-c5f4":"304479e7","chunk-df62":"6c5105a6","chunk-176e":"c4995511","chunk-e404":"554bc2e3","chunk-1609":"98da6b01","chunk-5882":"7cbc4c1b","chunk-7506":"a3364e53",oAJy:"840fb1c2","chunk-16d0":"6ce78978","chunk-4e7e":"91b5e73a"}[e]+".js"}(e),o=function(n){f.onerror=f.onload=null,clearTimeout(h);var c=u[e];if(0!==c){if(c){var t=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.src,o=new Error("Loading chunk "+e+" failed.\n("+t+": "+r+")");o.type=t,o.request=r,c[1](o)}u[e]=void 0}};var h=setTimeout(function(){o({type:"timeout",target:f})},12e4);f.onerror=f.onload=o,document.head.appendChild(f)}return Promise.all(n)},a.m=e,a.c=t,a.d=function(e,n,c){a.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:c})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,n){if(1&n&&(e=a(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(a.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var t in e)a.d(c,t,function(n){return e[n]}.bind(null,t));return c},a.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(n,"a",n),n},a.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},a.p="",a.oe=function(e){throw console.error(e),e};var f=window.webpackJsonp=window.webpackJsonp||[],h=f.push.bind(f);f.push=n,f=f.slice();for(var i=0;i<f.length;i++)n(f[i]);var d=h;c()}([]);
|
||||||
|
//# sourceMappingURL=runtime.5bae86dc.js.map
|
1
priv/static/adminfe/static/js/runtime.5bae86dc.js.map
Normal file
1
priv/static/adminfe/static/js/runtime.5bae86dc.js.map
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,2 +0,0 @@
|
||||||
!function(e){function n(n){for(var r,c,a=n[0],f=n[1],h=n[2],i=0,l=[];i<a.length;i++)c=a[i],u[c]&&l.push(u[c][0]),u[c]=0;for(r in f)Object.prototype.hasOwnProperty.call(f,r)&&(e[r]=f[r]);for(d&&d(n);l.length;)l.shift()();return o.push.apply(o,h||[]),t()}function t(){for(var e,n=0;n<o.length;n++){for(var t=o[n],r=!0,c=1;c<t.length;c++){var f=t[c];0!==u[f]&&(r=!1)}r&&(o.splice(n--,1),e=a(a.s=t[0]))}return e}var r={},c={runtime:0},u={runtime:0},o=[];function a(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var n=[];c[e]?n.push(c[e]):0!==c[e]&&{"chunk-6b68":1,"chunk-d38a":1,"chunk-0558":1,"chunk-0778":1,"chunk-3384":1,"chunk-6e81":1,"chunk-7e30":1,"chunk-e458":1,"chunk-970d":1,"chunk-22d2":1,"chunk-7637":1,"chunk-0961":1}[e]&&n.push(c[e]=new Promise(function(n,t){for(var r=({}[e]||e)+"."+{"7zzA":"31d6cfe0",JEtC:"31d6cfe0",ZhIB:"31d6cfe0","chunk-6b68":"0cc00484","chunk-d38a":"cabdc22e","chunk-0558":"af0d89cd","chunk-0778":"d9e7180a","chunk-3384":"d50ed383","chunk-6e81":"0e80d020","chunk-7f9e":"31d6cfe0","chunk-7e30":"f2b9674a","chunk-df62":"31d6cfe0","chunk-e458":"6c0703cb","chunk-970d":"f59cca8c","chunk-22d2":"813009b9","chunk-7637":"941c4edb",oAJy:"31d6cfe0","chunk-0961":"d3692214","chunk-16d0":"31d6cfe0"}[e]+".css",c=a.p+r,u=document.getElementsByTagName("link"),o=0;o<u.length;o++){var f=(i=u[o]).getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(f===r||f===c))return n()}var h=document.getElementsByTagName("style");for(o=0;o<h.length;o++){var i;if((f=(i=h[o]).getAttribute("data-href"))===r||f===c)return n()}var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.onload=n,d.onerror=function(n){var r=n&&n.target&&n.target.src||c,u=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");u.request=r,t(u)},d.href=c,document.getElementsByTagName("head")[0].appendChild(d)}).then(function(){c[e]=0}));var t=u[e];if(0!==t)if(t)n.push(t[2]);else{var r=new Promise(function(n,r){t=u[e]=[n,r]});n.push(t[2]=r);var o,f=document.createElement("script");f.charset="utf-8",f.timeout=120,a.nc&&f.setAttribute("nonce",a.nc),f.src=function(e){return a.p+"static/js/"+({}[e]||e)+"."+{"7zzA":"e1ae1c94",JEtC:"f9ba4594",ZhIB:"861df339","chunk-6b68":"fbc0f684","chunk-d38a":"a851004a","chunk-0558":"75954137","chunk-0778":"b17650df","chunk-3384":"b2ebeeca","chunk-6e81":"3733ace2","chunk-7f9e":"c49aa694","chunk-7e30":"ec42e302","chunk-df62":"6c5105a6","chunk-e458":"bb460d81","chunk-970d":"2457e066","chunk-22d2":"a0cf7976","chunk-7637":"8f5fb36e",oAJy:"840fb1c2","chunk-0961":"ef33e81b","chunk-16d0":"6ce78978"}[e]+".js"}(e),o=function(n){f.onerror=f.onload=null,clearTimeout(h);var t=u[e];if(0!==t){if(t){var r=n&&("load"===n.type?"missing":n.type),c=n&&n.target&&n.target.src,o=new Error("Loading chunk "+e+" failed.\n("+r+": "+c+")");o.type=r,o.request=c,t[1](o)}u[e]=void 0}};var h=setTimeout(function(){o({type:"timeout",target:f})},12e4);f.onerror=f.onload=o,document.head.appendChild(f)}return Promise.all(n)},a.m=e,a.c=r,a.d=function(e,n,t){a.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,n){if(1&n&&(e=a(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)a.d(t,r,function(n){return e[n]}.bind(null,r));return t},a.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(n,"a",n),n},a.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},a.p="",a.oe=function(e){throw console.error(e),e};var f=window.webpackJsonp=window.webpackJsonp||[],h=f.push.bind(f);f.push=n,f=f.slice();for(var i=0;i<f.length;i++)n(f[i]);var d=h;t()}([]);
|
|
||||||
//# sourceMappingURL=runtime.b08eb412.js.map
|
|
File diff suppressed because one or more lines are too long
|
@ -16,7 +16,7 @@ defmodule Pleroma.Web.RuntimeStaticPlugTest do
|
||||||
|
|
||||||
test "overrides index" do
|
test "overrides index" do
|
||||||
bundled_index = get(build_conn(), "/")
|
bundled_index = get(build_conn(), "/")
|
||||||
assert html_response(bundled_index, 200) == File.read!("priv/static/index.html")
|
refute html_response(bundled_index, 200) == "hello world"
|
||||||
|
|
||||||
File.write!(@dir <> "/index.html", "hello world")
|
File.write!(@dir <> "/index.html", "hello world")
|
||||||
|
|
||||||
|
|
|
@ -6,22 +6,56 @@ defmodule Pleroma.Web.FallbackTest do
|
||||||
use Pleroma.Web.ConnCase
|
use Pleroma.Web.ConnCase
|
||||||
import Pleroma.Factory
|
import Pleroma.Factory
|
||||||
|
|
||||||
test "GET /registration/:token", %{conn: conn} do
|
describe "neither preloaded data nor metadata attached to" do
|
||||||
assert conn
|
test "GET /registration/:token", %{conn: conn} do
|
||||||
|> get("/registration/foo")
|
response = get(conn, "/registration/foo")
|
||||||
|> html_response(200) =~ "<!--server-generated-meta-->"
|
|
||||||
|
assert html_response(response, 200) =~ "<!--server-generated-meta-->"
|
||||||
|
end
|
||||||
|
|
||||||
|
test "GET /*path", %{conn: conn} do
|
||||||
|
assert conn
|
||||||
|
|> get("/foo")
|
||||||
|
|> html_response(200) =~ "<!--server-generated-meta-->"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
test "GET /:maybe_nickname_or_id", %{conn: conn} do
|
describe "preloaded data and metadata attached to" do
|
||||||
user = insert(:user)
|
test "GET /:maybe_nickname_or_id", %{conn: conn} do
|
||||||
|
user = insert(:user)
|
||||||
|
user_missing = get(conn, "/foo")
|
||||||
|
user_present = get(conn, "/#{user.nickname}")
|
||||||
|
|
||||||
assert conn
|
assert(html_response(user_missing, 200) =~ "<!--server-generated-meta-->")
|
||||||
|> get("/foo")
|
refute html_response(user_present, 200) =~ "<!--server-generated-meta-->"
|
||||||
|> html_response(200) =~ "<!--server-generated-meta-->"
|
assert html_response(user_present, 200) =~ "initial-results"
|
||||||
|
end
|
||||||
|
|
||||||
refute conn
|
test "GET /*path", %{conn: conn} do
|
||||||
|> get("/" <> user.nickname)
|
assert conn
|
||||||
|> html_response(200) =~ "<!--server-generated-meta-->"
|
|> get("/foo")
|
||||||
|
|> html_response(200) =~ "<!--server-generated-meta-->"
|
||||||
|
|
||||||
|
refute conn
|
||||||
|
|> get("/foo/bar")
|
||||||
|
|> html_response(200) =~ "<!--server-generated-meta-->"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "preloaded data is attached to" do
|
||||||
|
test "GET /main/public", %{conn: conn} do
|
||||||
|
public_page = get(conn, "/main/public")
|
||||||
|
|
||||||
|
refute html_response(public_page, 200) =~ "<!--server-generated-meta-->"
|
||||||
|
assert html_response(public_page, 200) =~ "initial-results"
|
||||||
|
end
|
||||||
|
|
||||||
|
test "GET /main/all", %{conn: conn} do
|
||||||
|
public_page = get(conn, "/main/all")
|
||||||
|
|
||||||
|
refute html_response(public_page, 200) =~ "<!--server-generated-meta-->"
|
||||||
|
assert html_response(public_page, 200) =~ "initial-results"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
test "GET /api*path", %{conn: conn} do
|
test "GET /api*path", %{conn: conn} do
|
||||||
|
@ -34,16 +68,6 @@ test "GET /pleroma/admin -> /pleroma/admin/", %{conn: conn} do
|
||||||
assert redirected_to(get(conn, "/pleroma/admin")) =~ "/pleroma/admin/"
|
assert redirected_to(get(conn, "/pleroma/admin")) =~ "/pleroma/admin/"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "GET /*path", %{conn: conn} do
|
|
||||||
assert conn
|
|
||||||
|> get("/foo")
|
|
||||||
|> html_response(200) =~ "<!--server-generated-meta-->"
|
|
||||||
|
|
||||||
assert conn
|
|
||||||
|> get("/foo/bar")
|
|
||||||
|> html_response(200) =~ "<!--server-generated-meta-->"
|
|
||||||
end
|
|
||||||
|
|
||||||
test "OPTIONS /*path", %{conn: conn} do
|
test "OPTIONS /*path", %{conn: conn} do
|
||||||
assert conn
|
assert conn
|
||||||
|> options("/foo")
|
|> options("/foo")
|
||||||
|
|
37
test/web/preload/instance_test.exs
Normal file
37
test/web/preload/instance_test.exs
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Web.Preload.Providers.InstanceTest do
|
||||||
|
use Pleroma.DataCase
|
||||||
|
alias Pleroma.Web.Preload.Providers.Instance
|
||||||
|
|
||||||
|
setup do: {:ok, Instance.generate_terms(nil)}
|
||||||
|
|
||||||
|
test "it renders the info", %{"/api/v1/instance": info} do
|
||||||
|
assert %{
|
||||||
|
description: description,
|
||||||
|
email: "admin@example.com",
|
||||||
|
registrations: true
|
||||||
|
} = info
|
||||||
|
|
||||||
|
assert String.equivalent?(description, "Pleroma: An efficient and flexible fediverse server")
|
||||||
|
end
|
||||||
|
|
||||||
|
test "it renders the panel", %{"/instance/panel.html": panel} do
|
||||||
|
assert String.contains?(
|
||||||
|
panel,
|
||||||
|
"<p>Welcome to <a href=\"https://pleroma.social\" target=\"_blank\">Pleroma!</a></p>"
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
test "it renders the node_info", %{"/nodeinfo/2.0": nodeinfo} do
|
||||||
|
%{
|
||||||
|
metadata: metadata,
|
||||||
|
version: "2.0"
|
||||||
|
} = nodeinfo
|
||||||
|
|
||||||
|
assert metadata.private == false
|
||||||
|
assert metadata.suggestions == %{enabled: false}
|
||||||
|
end
|
||||||
|
end
|
14
test/web/preload/status_net_test.exs
Normal file
14
test/web/preload/status_net_test.exs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Web.Preload.Providers.StatusNetTest do
|
||||||
|
use Pleroma.DataCase
|
||||||
|
alias Pleroma.Web.Preload.Providers.StatusNet
|
||||||
|
|
||||||
|
setup do: {:ok, StatusNet.generate_terms(nil)}
|
||||||
|
|
||||||
|
test "it renders the info", %{"/api/statusnet/config.json": info} do
|
||||||
|
assert info =~ "<name>Pleroma</name>"
|
||||||
|
end
|
||||||
|
end
|
74
test/web/preload/timeline_test.exs
Normal file
74
test/web/preload/timeline_test.exs
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Web.Preload.Providers.TimelineTest do
|
||||||
|
use Pleroma.DataCase
|
||||||
|
import Pleroma.Factory
|
||||||
|
|
||||||
|
alias Pleroma.Web.CommonAPI
|
||||||
|
alias Pleroma.Web.Preload.Providers.Timelines
|
||||||
|
|
||||||
|
@public_url :"/api/v1/timelines/public"
|
||||||
|
|
||||||
|
describe "unauthenticated timeliness when restricted" do
|
||||||
|
setup do
|
||||||
|
svd_config = Pleroma.Config.get([:restrict_unauthenticated, :timelines])
|
||||||
|
Pleroma.Config.put([:restrict_unauthenticated, :timelines], %{local: true, federated: true})
|
||||||
|
|
||||||
|
on_exit(fn ->
|
||||||
|
Pleroma.Config.put([:restrict_unauthenticated, :timelines], svd_config)
|
||||||
|
end)
|
||||||
|
|
||||||
|
:ok
|
||||||
|
end
|
||||||
|
|
||||||
|
test "return nothing" do
|
||||||
|
tl_data = Timelines.generate_terms(%{})
|
||||||
|
|
||||||
|
refute Map.has_key?(tl_data, "/api/v1/timelines/public")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "unauthenticated timeliness when unrestricted" do
|
||||||
|
setup do
|
||||||
|
svd_config = Pleroma.Config.get([:restrict_unauthenticated, :timelines])
|
||||||
|
|
||||||
|
Pleroma.Config.put([:restrict_unauthenticated, :timelines], %{
|
||||||
|
local: false,
|
||||||
|
federated: false
|
||||||
|
})
|
||||||
|
|
||||||
|
on_exit(fn ->
|
||||||
|
Pleroma.Config.put([:restrict_unauthenticated, :timelines], svd_config)
|
||||||
|
end)
|
||||||
|
|
||||||
|
{:ok, user: insert(:user)}
|
||||||
|
end
|
||||||
|
|
||||||
|
test "returns the timeline when not restricted" do
|
||||||
|
assert Timelines.generate_terms(%{})
|
||||||
|
|> Map.has_key?(@public_url)
|
||||||
|
end
|
||||||
|
|
||||||
|
test "returns public items", %{user: user} do
|
||||||
|
{:ok, _} = CommonAPI.post(user, %{status: "it's post 1!"})
|
||||||
|
{:ok, _} = CommonAPI.post(user, %{status: "it's post 2!"})
|
||||||
|
{:ok, _} = CommonAPI.post(user, %{status: "it's post 3!"})
|
||||||
|
|
||||||
|
assert Timelines.generate_terms(%{})
|
||||||
|
|> Map.fetch!(@public_url)
|
||||||
|
|> Enum.count() == 3
|
||||||
|
end
|
||||||
|
|
||||||
|
test "does not return non-public items", %{user: user} do
|
||||||
|
{:ok, _} = CommonAPI.post(user, %{status: "it's post 1!", visibility: "unlisted"})
|
||||||
|
{:ok, _} = CommonAPI.post(user, %{status: "it's post 2!", visibility: "direct"})
|
||||||
|
{:ok, _} = CommonAPI.post(user, %{status: "it's post 3!"})
|
||||||
|
|
||||||
|
assert Timelines.generate_terms(%{})
|
||||||
|
|> Map.fetch!(@public_url)
|
||||||
|
|> Enum.count() == 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
33
test/web/preload/user_test.exs
Normal file
33
test/web/preload/user_test.exs
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Web.Preload.Providers.UserTest do
|
||||||
|
use Pleroma.DataCase
|
||||||
|
import Pleroma.Factory
|
||||||
|
alias Pleroma.Web.Preload.Providers.User
|
||||||
|
|
||||||
|
describe "returns empty when user doesn't exist" do
|
||||||
|
test "nil user specified" do
|
||||||
|
refute User.generate_terms(%{user: nil})
|
||||||
|
|> Map.has_key?("/api/v1/accounts")
|
||||||
|
end
|
||||||
|
|
||||||
|
test "missing user specified" do
|
||||||
|
refute User.generate_terms(%{user: :not_a_user})
|
||||||
|
|> Map.has_key?("/api/v1/accounts")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "specified user exists" do
|
||||||
|
setup do
|
||||||
|
user = insert(:user)
|
||||||
|
|
||||||
|
{:ok, User.generate_terms(%{user: user})}
|
||||||
|
end
|
||||||
|
|
||||||
|
test "account is rendered", %{"/api/v1/accounts": accounts} do
|
||||||
|
assert %{acct: user, username: user} = accounts
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue