forked from AkkomaGang/admin-fe
Compare commits
26 commits
Author | SHA1 | Date | |
---|---|---|---|
0802dc5777 | |||
e018d26a5b | |||
6b131e0779 | |||
6880744463 | |||
2e86ce673b | |||
acf4065a75 | |||
0bdd146319 | |||
a13ec695f7 | |||
2c868a42c6 | |||
fc98eea515 | |||
713a833b00 | |||
4c6d67dde7 | |||
c727ba8b18 | |||
8a555bce21 | |||
e037713fa3 | |||
b3ee5a18d1 | |||
e84e6ce40d | |||
7a815f233d | |||
c4e16b1e15 | |||
eed89a24ad | |||
adf60bdeb1 | |||
f8ce0dee55 | |||
c8b39ed1ef | |||
9a8b3b0c13 | |||
9baa356f56 | |||
|
4406dce589 |
44 changed files with 3610 additions and 4111 deletions
58
.woodpecker.yml
Normal file
58
.woodpecker.yml
Normal file
|
@ -0,0 +1,58 @@
|
|||
pipeline:
|
||||
lint:
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
image: node:14
|
||||
commands:
|
||||
- git config --global url."https://github.com/".insteadOf git://github.com/
|
||||
- yarn
|
||||
- yarn lint
|
||||
|
||||
test:
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
image: node:14
|
||||
commands:
|
||||
- apt update
|
||||
- apt install firefox-esr -y --no-install-recommends
|
||||
- git config --global url."https://github.com/".insteadOf git://github.com/
|
||||
- yarn
|
||||
- yarn test
|
||||
|
||||
build:
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
branch:
|
||||
- develop
|
||||
- stable
|
||||
image: node:14
|
||||
commands:
|
||||
- git config --global url."https://github.com/".insteadOf git://github.com/
|
||||
- yarn
|
||||
- yarn build:prod
|
||||
|
||||
release:
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
branch:
|
||||
- develop
|
||||
- stable
|
||||
image: node:16
|
||||
secrets:
|
||||
- SCW_ACCESS_KEY
|
||||
- SCW_SECRET_KEY
|
||||
- SCW_DEFAULT_ORGANIZATION_ID
|
||||
commands:
|
||||
- apt-get update && apt-get install -y rclone wget zip
|
||||
- wget https://github.com/scaleway/scaleway-cli/releases/download/v2.5.1/scaleway-cli_2.5.1_linux_amd64
|
||||
- mv scaleway-cli_2.5.1_linux_amd64 scaleway-cli
|
||||
- chmod +x scaleway-cli
|
||||
- ./scaleway-cli object config install type=rclone
|
||||
- zip admin-fe.zip -r dist
|
||||
- rclone copyto admin-fe.zip scaleway:akkoma-updates/frontend/$CI_COMMIT_BRANCH/admin-fe.zip
|
|
@ -8,6 +8,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
|
||||
### Added
|
||||
|
||||
### Changed
|
||||
|
||||
### Fixed
|
||||
|
||||
## [2.4.0] - 2021-08-01
|
||||
|
||||
### Added
|
||||
|
||||
- Evicting and banning objects from the MediaProxy cache is disabled if MediaProxy is disabled on the Settings tab. Add ability to enable MediaProxy and Invalidation from MediaProxy tab.
|
||||
- Allow to upload the custom Terms of Service and Instance Panel HTML pages via Admin API
|
||||
- Add Report show page and link Moderation log references to the respective reports
|
||||
|
|
9
admin-fe.iml
Normal file
9
admin-fe.iml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "vue-element-admin",
|
||||
"version": "3.10.0",
|
||||
"version": "3.11.0",
|
||||
"description": "A magical vue admin. Typical templates for enterprise applications. Newest development stack of vue. Lots of awesome features",
|
||||
"author": "Pan <panfree23@gmail.com>",
|
||||
"license": "MIT",
|
||||
|
@ -29,13 +29,13 @@
|
|||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/PanJiaChen/vue-element-admin.git"
|
||||
"url": "git+https://akkoma.dev/AkkomaGang/admin-fe.git"
|
||||
},
|
||||
"resolutions": {
|
||||
"prosemirror-model": "1.9.1"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/PanJiaChen/vue-element-admin/issues"
|
||||
"url": "https://akkoma.dev/AkkomaGang/admin-fe/-/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.3.4",
|
||||
|
@ -111,7 +111,7 @@
|
|||
"lint-staged": "7.2.2",
|
||||
"mini-css-extract-plugin": "0.4.1",
|
||||
"node-notifier": "5.2.1",
|
||||
"node-sass": "^4.12.0",
|
||||
"node-sass": "^7.0.1",
|
||||
"optimize-css-assets-webpack-plugin": "5.0.0",
|
||||
"ora": "3.0.0",
|
||||
"path-to-regexp": "2.4.0",
|
||||
|
|
|
@ -1,617 +0,0 @@
|
|||
export async function fetchChat(id, authHost, token) {
|
||||
return Promise.resolve({ data: userChats[0] })
|
||||
}
|
||||
|
||||
export async function fetchChatMessages(id, max_id, authHost, token) {
|
||||
return Promise.resolve({ data: chatMessages })
|
||||
}
|
||||
|
||||
export async function deleteChat(chat_id, message_id, authHost, token) {
|
||||
return Promise.resolve({ data: userChats[0] })
|
||||
}
|
||||
|
||||
export const userChats = [
|
||||
{
|
||||
id: '9y8e7ESoVUiKVMAoCW',
|
||||
last_message: {
|
||||
account_id: '9xUIiQfGrdPJDZe39s',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'heyy',
|
||||
created_at: '2020-09-11T00:07:13.000Z',
|
||||
emojis: [],
|
||||
id: '9z22Q9MzWiAk7GZnNY',
|
||||
unread: false
|
||||
},
|
||||
receiver: {
|
||||
acct: 'test10',
|
||||
avatar: 'http://localhost:4000/images/avi.png',
|
||||
avatar_static: 'http://localhost:4000/images/avi.png',
|
||||
bot: false,
|
||||
created_at: '2020-07-27T00:33:02.000Z',
|
||||
display_name: 'test10',
|
||||
emojis: [],
|
||||
fields: [],
|
||||
followers_count: 2,
|
||||
following_count: 1,
|
||||
header: 'http://localhost:4000/images/banner.png',
|
||||
header_static: 'http://localhost:4000/images/banner.png',
|
||||
id: '9xUj5WTmzSlFPN6OLg',
|
||||
locked: false,
|
||||
note: '',
|
||||
pleroma: {
|
||||
accepts_chat_messages: true,
|
||||
ap_id: 'http://localhost:4000/users/test10',
|
||||
background_image: null,
|
||||
is_confirmed: true,
|
||||
favicon: null,
|
||||
hide_favorites: true,
|
||||
hide_followers: false,
|
||||
hide_followers_count: false,
|
||||
hide_follows: false,
|
||||
hide_follows_count: false,
|
||||
is_admin: false,
|
||||
is_moderator: true,
|
||||
relationship: {},
|
||||
skip_thread_containment: false,
|
||||
tags: [
|
||||
'mrf_tag:media-force-nsfw',
|
||||
'mrf_tag:media-strip',
|
||||
'mrf_tag:force-unlisted'
|
||||
]
|
||||
},
|
||||
source: {
|
||||
fields: [],
|
||||
note: '',
|
||||
pleroma: {
|
||||
actor_type: 'Person',
|
||||
discoverable: false
|
||||
},
|
||||
sensitive: false
|
||||
},
|
||||
statuses_count: 20,
|
||||
url: 'http://localhost:4000/users/test10',
|
||||
username: 'test10'
|
||||
},
|
||||
sender: {
|
||||
acct: 'mk',
|
||||
avatar: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
|
||||
avatar_static: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
|
||||
bot: false,
|
||||
created_at: '2020-07-26T19:37:31.000Z',
|
||||
display_name: 'mk',
|
||||
emojis: [],
|
||||
fields: [
|
||||
{
|
||||
name: 'website',
|
||||
value: '<a href="http://marykatefain.com" rel="ugc">marykatefain.com</a>'
|
||||
}
|
||||
],
|
||||
followers_count: 2,
|
||||
following_count: 1,
|
||||
header: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
|
||||
header_static: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
|
||||
id: '9xUIiQfGrdPJDZe39s',
|
||||
locked: false,
|
||||
note: 'a bio about me',
|
||||
pleroma: {
|
||||
accepts_chat_messages: true,
|
||||
ap_id: 'https://localhost/users/mk',
|
||||
background_image: null,
|
||||
is_confirmed: true,
|
||||
favicon: null,
|
||||
hide_favorites: true,
|
||||
hide_followers: false,
|
||||
hide_followers_count: false,
|
||||
hide_follows: false,
|
||||
hide_follows_count: false,
|
||||
is_admin: true,
|
||||
is_moderator: false,
|
||||
relationship: {},
|
||||
skip_thread_containment: false,
|
||||
tags: [
|
||||
'verified'
|
||||
]
|
||||
},
|
||||
source: {
|
||||
fields: [
|
||||
{
|
||||
name: 'website',
|
||||
value: 'marykatefain.com'
|
||||
}
|
||||
],
|
||||
note: 'a bio about me',
|
||||
pleroma: {
|
||||
actor_type: 'Person',
|
||||
discoverable: false
|
||||
},
|
||||
sensitive: false
|
||||
},
|
||||
statuses_count: 77,
|
||||
url: 'https://localhost/users/mk',
|
||||
username: 'mk'
|
||||
},
|
||||
unread: 0,
|
||||
updated_at: '2020-09-11T00:07:13.000Z'
|
||||
},
|
||||
{
|
||||
id: '9y8dwDAQzFBZIZJzEG',
|
||||
last_message: {
|
||||
account_id: '9xUIiQfGrdPJDZe39s',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8dwDAQzFBZIZJzEG',
|
||||
content: 'hiiiiiiiiiiiiiiiiiii',
|
||||
created_at: '2020-08-15T06:45:13.000Z',
|
||||
emojis: [],
|
||||
id: '9y8e4EZndDmfzA0lGa',
|
||||
unread: false
|
||||
},
|
||||
receiver: {
|
||||
acct: 'user2',
|
||||
avatar: 'http://localhost:4000/media/5a702176cd5181f81532a42fafa87953db1586ca39a3c83cd3df1bc9b5cb7d07.png',
|
||||
avatar_static: 'http://localhost:4000/media/5a702176cd5181f81532a42fafa87953db1586ca39a3c83cd3df1bc9b5cb7d07.png',
|
||||
bot: false,
|
||||
created_at: '2020-08-01T19:23:57.000Z',
|
||||
display_name: 'User2',
|
||||
emojis: [],
|
||||
fields: [],
|
||||
followers_count: 0,
|
||||
following_count: 2,
|
||||
header: 'http://localhost:4000/media/1b1fc87d56e4f94b0ca8eb23100c92f67371bfa37b2898cd804341ed1a2d5c84.jpg',
|
||||
header_static: 'http://localhost:4000/media/1b1fc87d56e4f94b0ca8eb23100c92f67371bfa37b2898cd804341ed1a2d5c84.jpg',
|
||||
id: '9xfhRuCIyydruc0Sh6',
|
||||
locked: false,
|
||||
note: 'Just me!',
|
||||
pleroma: {
|
||||
accepts_chat_messages: true,
|
||||
ap_id: 'http://localhost:4000/users/user2',
|
||||
background_image: null,
|
||||
is_confirmed: false,
|
||||
favicon: null,
|
||||
hide_favorites: true,
|
||||
hide_followers: false,
|
||||
hide_followers_count: false,
|
||||
hide_follows: false,
|
||||
hide_follows_count: false,
|
||||
is_admin: false,
|
||||
is_moderator: false,
|
||||
relationship: {},
|
||||
skip_thread_containment: false,
|
||||
tags: [
|
||||
'mrf_tag:force-unlisted',
|
||||
'mrf_tag:media-strip'
|
||||
]
|
||||
},
|
||||
source: {
|
||||
fields: [],
|
||||
note: 'Just me!',
|
||||
pleroma: {
|
||||
actor_type: 'Person',
|
||||
discoverable: false
|
||||
},
|
||||
sensitive: false
|
||||
},
|
||||
statuses_count: 69,
|
||||
url: 'http://localhost:4000/users/user2',
|
||||
username: 'user2'
|
||||
},
|
||||
sender: {
|
||||
acct: 'mk',
|
||||
avatar: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
|
||||
avatar_static: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
|
||||
bot: false,
|
||||
created_at: '2020-07-26T19:37:31.000Z',
|
||||
display_name: 'mk',
|
||||
emojis: [],
|
||||
fields: [
|
||||
{
|
||||
name: 'website',
|
||||
value: '<a href="http://marykatefain.com" rel="ugc">marykatefain.com</a>'
|
||||
}
|
||||
],
|
||||
followers_count: 2,
|
||||
following_count: 1,
|
||||
header: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
|
||||
header_static: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
|
||||
id: '9xUIiQfGrdPJDZe39s',
|
||||
locked: false,
|
||||
note: 'a bio about me',
|
||||
pleroma: {
|
||||
accepts_chat_messages: true,
|
||||
ap_id: 'https://localhost/users/mk',
|
||||
background_image: null,
|
||||
is_confirmed: true,
|
||||
favicon: null,
|
||||
hide_favorites: true,
|
||||
hide_followers: false,
|
||||
hide_followers_count: false,
|
||||
hide_follows: false,
|
||||
hide_follows_count: false,
|
||||
is_admin: true,
|
||||
is_moderator: false,
|
||||
relationship: {},
|
||||
skip_thread_containment: false,
|
||||
tags: [
|
||||
'verified'
|
||||
]
|
||||
},
|
||||
source: {
|
||||
fields: [
|
||||
{
|
||||
name: 'website',
|
||||
value: 'marykatefain.com'
|
||||
}
|
||||
],
|
||||
note: 'a bio about me',
|
||||
pleroma: {
|
||||
actor_type: 'Person',
|
||||
discoverable: false
|
||||
},
|
||||
sensitive: false
|
||||
},
|
||||
statuses_count: 77,
|
||||
url: 'https://localhost/users/mk',
|
||||
username: 'mk'
|
||||
},
|
||||
unread: 0,
|
||||
updated_at: '2020-08-15T06:45:13.000Z'
|
||||
},
|
||||
{
|
||||
id: '9y8dubemxq32fkkoeu',
|
||||
last_message: null,
|
||||
receiver: {
|
||||
acct: 'mk',
|
||||
avatar: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
|
||||
avatar_static: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
|
||||
bot: false,
|
||||
created_at: '2020-07-26T19:37:31.000Z',
|
||||
display_name: 'mk',
|
||||
emojis: [],
|
||||
fields: [
|
||||
{
|
||||
name: 'website',
|
||||
value: '<a href="http://marykatefain.com" rel="ugc">marykatefain.com</a>'
|
||||
}
|
||||
],
|
||||
followers_count: 2,
|
||||
following_count: 1,
|
||||
header: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
|
||||
header_static: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
|
||||
id: '9xUIiQfGrdPJDZe39s',
|
||||
locked: false,
|
||||
note: 'a bio about me',
|
||||
pleroma: {
|
||||
accepts_chat_messages: true,
|
||||
ap_id: 'https://localhost/users/mk',
|
||||
background_image: null,
|
||||
is_confirmed: true,
|
||||
favicon: null,
|
||||
hide_favorites: true,
|
||||
hide_followers: false,
|
||||
hide_followers_count: false,
|
||||
hide_follows: false,
|
||||
hide_follows_count: false,
|
||||
is_admin: true,
|
||||
is_moderator: false,
|
||||
relationship: {},
|
||||
skip_thread_containment: false,
|
||||
tags: [
|
||||
'verified'
|
||||
]
|
||||
},
|
||||
source: {
|
||||
fields: [
|
||||
{
|
||||
name: 'website',
|
||||
value: 'marykatefain.com'
|
||||
}
|
||||
],
|
||||
note: 'a bio about me',
|
||||
pleroma: {
|
||||
actor_type: 'Person',
|
||||
discoverable: false
|
||||
},
|
||||
sensitive: false
|
||||
},
|
||||
statuses_count: 77,
|
||||
url: 'https://localhost/users/mk',
|
||||
username: 'mk'
|
||||
},
|
||||
sender: {
|
||||
acct: 'mk',
|
||||
avatar: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
|
||||
avatar_static: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
|
||||
bot: false,
|
||||
created_at: '2020-07-26T19:37:31.000Z',
|
||||
display_name: 'mk',
|
||||
emojis: [],
|
||||
fields: [
|
||||
{
|
||||
name: 'website',
|
||||
value: '<a href="http://marykatefain.com" rel="ugc">marykatefain.com</a>'
|
||||
}
|
||||
],
|
||||
followers_count: 2,
|
||||
following_count: 1,
|
||||
header: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
|
||||
header_static: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
|
||||
id: '9xUIiQfGrdPJDZe39s',
|
||||
locked: false,
|
||||
note: 'a bio about me',
|
||||
pleroma: {
|
||||
accepts_chat_messages: true,
|
||||
ap_id: 'https://localhost/users/mk',
|
||||
background_image: null,
|
||||
is_confirmed: true,
|
||||
favicon: null,
|
||||
hide_favorites: true,
|
||||
hide_followers: false,
|
||||
hide_followers_count: false,
|
||||
hide_follows: false,
|
||||
hide_follows_count: false,
|
||||
is_admin: true,
|
||||
is_moderator: false,
|
||||
relationship: {},
|
||||
skip_thread_containment: false,
|
||||
tags: [
|
||||
'verified'
|
||||
]
|
||||
},
|
||||
source: {
|
||||
fields: [
|
||||
{
|
||||
name: 'website',
|
||||
value: 'marykatefain.com'
|
||||
}
|
||||
],
|
||||
note: 'a bio about me',
|
||||
pleroma: {
|
||||
actor_type: 'Person',
|
||||
discoverable: false
|
||||
},
|
||||
sensitive: false
|
||||
},
|
||||
statuses_count: 77,
|
||||
url: 'https://localhost/users/mk',
|
||||
username: 'mk'
|
||||
},
|
||||
unread: 0,
|
||||
updated_at: '2020-08-15T06:43:29.000Z'
|
||||
}
|
||||
]
|
||||
|
||||
export const chatMessages = [
|
||||
{
|
||||
account_id: '9xUIiQfGrdPJDZe39s',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'heyy',
|
||||
created_at: '2020-09-11T00:07:13.000Z',
|
||||
emojis: [],
|
||||
id: '9z22Q9MzWiAk7GZnNY',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUIiQfGrdPJDZe39s',
|
||||
attachment: {
|
||||
description: null,
|
||||
id: '-1990764178',
|
||||
pleroma: {
|
||||
mime_type: 'image/png'
|
||||
},
|
||||
preview_url: 'http://localhost:4000/media/b087b890b39aa8301f736e8b45c02213183986c8a994c2c99e921ae85afa17e4.png',
|
||||
remote_url: 'http://localhost:4000/media/b087b890b39aa8301f736e8b45c02213183986c8a994c2c99e921ae85afa17e4.png',
|
||||
text_url: 'http://localhost:4000/media/b087b890b39aa8301f736e8b45c02213183986c8a994c2c99e921ae85afa17e4.png',
|
||||
type: 'image',
|
||||
url: 'http://localhost:4000/media/b087b890b39aa8301f736e8b45c02213183986c8a994c2c99e921ae85afa17e4.png'
|
||||
},
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: null,
|
||||
created_at: '2020-09-10T20:35:33.000Z',
|
||||
emojis: [],
|
||||
id: '9z1jWuQNaq8Ef6fdOS',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUIiQfGrdPJDZe39s',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'probably',
|
||||
created_at: '2020-09-10T16:57:33.000Z',
|
||||
emojis: [],
|
||||
id: '9z1Q4eXb9kBYA8rNT6',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUj5WTmzSlFPN6OLg',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'That has got to be 20 by now',
|
||||
created_at: '2020-09-10T16:57:29.000Z',
|
||||
emojis: [],
|
||||
id: '9z1Q4LQAF9wuraEfk8',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUIiQfGrdPJDZe39s',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'I miss bars :(',
|
||||
created_at: '2020-09-10T16:57:22.000Z',
|
||||
emojis: [],
|
||||
id: '9z1Q3gmlKEfEpnUdm4',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUIiQfGrdPJDZe39s',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'Yeah tying to!',
|
||||
created_at: '2020-09-10T16:57:15.000Z',
|
||||
emojis: [],
|
||||
id: '9z1Q307VxCiKVhs6eO',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUj5WTmzSlFPN6OLg',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'staying safe with covid and such?',
|
||||
created_at: '2020-09-10T16:57:10.000Z',
|
||||
emojis: [],
|
||||
id: '9z1Q2Z56U3k6ePXIe1',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUj5WTmzSlFPN6OLg',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'how have you been?',
|
||||
created_at: '2020-09-10T16:57:06.000Z',
|
||||
emojis: [],
|
||||
id: '9z1Q29XvQHLfSGowxU',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUj5WTmzSlFPN6OLg',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'so what are you doing?',
|
||||
created_at: '2020-09-10T16:57:02.000Z',
|
||||
emojis: [],
|
||||
id: '9z1Q1lPb9aQYbUjxeD',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUIiQfGrdPJDZe39s',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'crazy',
|
||||
created_at: '2020-09-10T16:56:55.000Z',
|
||||
emojis: [],
|
||||
id: '9z1Q19zQHwVMXbD2DA',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUIiQfGrdPJDZe39s',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'omg yeah same',
|
||||
created_at: '2020-09-10T16:56:54.000Z',
|
||||
emojis: [],
|
||||
id: '9z1Q12zWJBQIpsCVtI',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUIiQfGrdPJDZe39s',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'hahahaha',
|
||||
created_at: '2020-09-10T16:56:51.000Z',
|
||||
emojis: [],
|
||||
id: '9z1Q0pyKiHkWSQXsjg',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUj5WTmzSlFPN6OLg',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'I think this is 13',
|
||||
created_at: '2020-09-10T16:56:45.000Z',
|
||||
emojis: [],
|
||||
id: '9z1Q0Ft6sEBGXnpCb3',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUj5WTmzSlFPN6OLg',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'We need to keep typing until we hit 20',
|
||||
created_at: '2020-09-10T16:56:42.000Z',
|
||||
emojis: [],
|
||||
id: '9z1PzywjrTyy08OMOO',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUIiQfGrdPJDZe39s',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'That's nice',
|
||||
created_at: '2020-09-10T16:56:03.000Z',
|
||||
emojis: [],
|
||||
id: '9z1PwOkJzs8orKsJDU',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUj5WTmzSlFPN6OLg',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'I've been good! Keeping busy',
|
||||
created_at: '2020-09-10T16:56:00.000Z',
|
||||
emojis: [],
|
||||
id: '9z1Pw7qmoaDASSljQv',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUIiQfGrdPJDZe39s',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: '*been',
|
||||
created_at: '2020-09-10T16:55:55.000Z',
|
||||
emojis: [],
|
||||
id: '9z1PvcWVHwZFIa2b0y',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUIiQfGrdPJDZe39s',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'How have you ben?',
|
||||
created_at: '2020-09-10T16:55:52.000Z',
|
||||
emojis: [],
|
||||
id: '9z1PvK4BuTE03YejNw',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUIiQfGrdPJDZe39s',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'Oh it's okay! No worries!',
|
||||
created_at: '2020-09-10T16:55:44.000Z',
|
||||
emojis: [],
|
||||
id: '9z1Puc4hTDUJcOYW4O',
|
||||
unread: false
|
||||
},
|
||||
{
|
||||
account_id: '9xUj5WTmzSlFPN6OLg',
|
||||
attachment: null,
|
||||
card: null,
|
||||
chat_id: '9y8e7ESoVUiKVMAoCW',
|
||||
content: 'didn't mean to ignore you',
|
||||
created_at: '2020-09-10T16:55:32.000Z',
|
||||
emojis: [],
|
||||
id: '9z1PtWGNamQTIvUspk',
|
||||
unread: false
|
||||
}
|
||||
]
|
|
@ -1,5 +1,3 @@
|
|||
import userChats from './chat'
|
||||
|
||||
export let users = [
|
||||
{ is_confirmed: true, is_approved: true, is_active: true, id: '2', nickname: 'allis', local: true, external: false, roles: { admin: true, moderator: false }, tags: [], actor_type: 'Person' },
|
||||
{ is_confirmed: true, is_approved: true, is_active: true, id: '10', nickname: 'bob', local: true, external: false, roles: { admin: false, moderator: false }, tags: ['mrf_tag:sandbox'], actor_type: 'Person' },
|
||||
|
@ -34,15 +32,11 @@ export async function fetchUsers(filters, actorTypeFilters, authHost, token, pag
|
|||
}
|
||||
|
||||
export async function fetchUserStatuses(id, authHost, godmode, token) {
|
||||
return Promise.resolve({ data: userStatuses })
|
||||
}
|
||||
|
||||
export async function fetchUserChats(id, authHost, godmode, token) {
|
||||
return Promise.resolve({ data: userChats })
|
||||
return Promise.resolve({ data: { activities: userStatuses }})
|
||||
}
|
||||
|
||||
export async function getPasswordResetToken(nickname, authHost, token) {
|
||||
return Promise.resolve({ data: { token: 'g05lxnBJQnL', link: 'http://url/api/pleroma/password_reset/g05lxnBJQnL' }})
|
||||
return Promise.resolve({ data: { token: 'g05lxnBJQnL', link: 'http://url/api/v1/pleroma/password_reset/g05lxnBJQnL' }})
|
||||
}
|
||||
|
||||
export async function searchUsers(query, filters, actorTypeFilters, authHost, token, page = 1) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import { baseName } from './utils'
|
|||
export async function needReboot(authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/need_reboot`,
|
||||
url: `/api/v1/pleroma/admin/need_reboot`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -14,7 +14,7 @@ export async function needReboot(authHost, token) {
|
|||
export async function restartApp(authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/restart`,
|
||||
url: `/api/v1/pleroma/admin/restart`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
import request from '@/utils/request'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { baseName } from './utils'
|
||||
|
||||
export async function deleteChatMessage(chat_id, message_id, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/chats/${chat_id}/messages/${message_id}`,
|
||||
method: 'delete',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
}
|
||||
|
||||
export async function fetchChat(id, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/chats/${id}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
}
|
||||
|
||||
export async function fetchChatMessages(id, maxId, authHost, token) {
|
||||
const url = maxId
|
||||
? `/api/pleroma/admin/chats/${id}/messages?max_id=${maxId}`
|
||||
: `/api/pleroma/admin/chats/${id}/messages`
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
}
|
||||
|
||||
const authHeaders = (token) => token ? { 'Authorization': `Bearer ${getToken()}` } : {}
|
|
@ -14,7 +14,7 @@ export async function addNewEmojiFile(packName, file, shortcode, filename, host,
|
|||
|
||||
return await request({
|
||||
baseURL: baseName(host),
|
||||
url: `/api/pleroma/emoji/packs/files?name=${packName}`,
|
||||
url: `/api/v1/pleroma/emoji/packs/files?name=${packName}`,
|
||||
method: 'post',
|
||||
headers: authHeaders(token),
|
||||
data
|
||||
|
@ -28,7 +28,7 @@ export function addressOfEmojiInPack(host, packName, name) {
|
|||
export async function createPack(host, token, packName) {
|
||||
return await request({
|
||||
baseURL: baseName(host),
|
||||
url: `/api/pleroma/emoji/pack?name=${packName}`,
|
||||
url: `/api/v1/pleroma/emoji/pack?name=${packName}`,
|
||||
method: 'post',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -37,7 +37,7 @@ export async function createPack(host, token, packName) {
|
|||
export async function deleteEmojiFile(packName, shortcode, host, token) {
|
||||
return await request({
|
||||
baseURL: baseName(host),
|
||||
url: `/api/pleroma/emoji/packs/files?name=${packName}&shortcode=${shortcode}`,
|
||||
url: `/api/v1/pleroma/emoji/packs/files?name=${packName}&shortcode=${shortcode}`,
|
||||
method: 'delete',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -46,7 +46,7 @@ export async function deleteEmojiFile(packName, shortcode, host, token) {
|
|||
export async function deletePack(host, token, packName) {
|
||||
return await request({
|
||||
baseURL: baseName(host),
|
||||
url: `/api/pleroma/emoji/pack?name=${packName}`,
|
||||
url: `/api/v1/pleroma/emoji/pack?name=${packName}`,
|
||||
method: 'delete',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -55,7 +55,7 @@ export async function deletePack(host, token, packName) {
|
|||
export async function downloadFrom(instanceAddress, packName, as, host, token) {
|
||||
return await request({
|
||||
baseURL: baseName(host),
|
||||
url: '/api/pleroma/emoji/packs/download',
|
||||
url: '/api/v1/pleroma/emoji/packs/download',
|
||||
method: 'post',
|
||||
headers: authHeaders(token),
|
||||
data: as.trim() === ''
|
||||
|
@ -68,7 +68,7 @@ export async function downloadFrom(instanceAddress, packName, as, host, token) {
|
|||
export async function fetchPack(packName, page, pageSize, host, token) {
|
||||
return await request({
|
||||
baseURL: baseName(host),
|
||||
url: `/api/pleroma/emoji/pack?name=${packName}&page=${page}&page_size=${pageSize}`,
|
||||
url: `/api/v1/pleroma/emoji/pack?name=${packName}&page=${page}&page_size=${pageSize}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -77,7 +77,7 @@ export async function fetchPack(packName, page, pageSize, host, token) {
|
|||
export async function importFromFS(host, token) {
|
||||
return await request({
|
||||
baseURL: baseName(host),
|
||||
url: '/api/pleroma/emoji/packs/import',
|
||||
url: '/api/v1/pleroma/emoji/packs/import',
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -86,7 +86,7 @@ export async function importFromFS(host, token) {
|
|||
export async function listPacks(page, pageSize, host, token) {
|
||||
return await request({
|
||||
baseURL: baseName(host),
|
||||
url: `/api/pleroma/emoji/packs?page=${page}&page_size=${pageSize}`,
|
||||
url: `/api/v1/pleroma/emoji/packs?page=${page}&page_size=${pageSize}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -95,7 +95,7 @@ export async function listPacks(page, pageSize, host, token) {
|
|||
export async function listRemotePacks(instance, page, pageSize, host, token) {
|
||||
return await request({
|
||||
baseURL: baseName(host),
|
||||
url: `/api/pleroma/emoji/packs/remote?url=${baseName(instance)}&page=${page}&page_size=${pageSize}`,
|
||||
url: `/api/v1/pleroma/emoji/packs/remote?url=${baseName(instance)}&page=${page}&page_size=${pageSize}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -104,7 +104,7 @@ export async function listRemotePacks(instance, page, pageSize, host, token) {
|
|||
export async function reloadEmoji(host, token) {
|
||||
return await request({
|
||||
baseURL: baseName(host),
|
||||
url: '/api/pleroma/admin/reload_emoji',
|
||||
url: '/api/v1/pleroma/admin/reload_emoji',
|
||||
method: 'post',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -113,7 +113,7 @@ export async function reloadEmoji(host, token) {
|
|||
export async function savePackMetadata(host, token, packName, metadata) {
|
||||
return await request({
|
||||
baseURL: baseName(host),
|
||||
url: `/api/pleroma/emoji/pack?name=${packName}`,
|
||||
url: `/api/v1/pleroma/emoji/pack?name=${packName}`,
|
||||
method: 'patch',
|
||||
headers: authHeaders(token),
|
||||
data: { metadata },
|
||||
|
@ -124,7 +124,7 @@ export async function savePackMetadata(host, token, packName, metadata) {
|
|||
export async function updateEmojiFile(packName, shortcode, newShortcode, newFilename, force, host, token) {
|
||||
return await request({
|
||||
baseURL: baseName(host),
|
||||
url: `/api/pleroma/emoji/packs/files?name=${packName}`,
|
||||
url: `/api/v1/pleroma/emoji/packs/files?name=${packName}`,
|
||||
method: 'patch',
|
||||
headers: authHeaders(token),
|
||||
data: { shortcode, new_shortcode: newShortcode, new_filename: newFilename, force }
|
||||
|
|
|
@ -5,7 +5,7 @@ import { baseName } from './utils'
|
|||
export async function generateInviteToken(max_use, expires_at, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/invite_token`,
|
||||
url: `/api/v1/pleroma/admin/users/invite_token`,
|
||||
method: 'post',
|
||||
headers: authHeaders(token),
|
||||
data: expires_at && expires_at.length > 0 ? { max_use, expires_at } : { max_use }
|
||||
|
@ -16,7 +16,7 @@ export async function inviteViaEmail(email, name, authHost, token) {
|
|||
const data = name.length > 0 ? { email, name } : { email }
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: '/api/pleroma/admin/users/email_invite',
|
||||
url: '/api/v1/pleroma/admin/users/email_invite',
|
||||
method: 'post',
|
||||
headers: authHeaders(token),
|
||||
data
|
||||
|
@ -26,7 +26,7 @@ export async function inviteViaEmail(email, name, authHost, token) {
|
|||
export async function listInviteTokens(authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/invites`,
|
||||
url: `/api/v1/pleroma/admin/users/invites`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -35,7 +35,7 @@ export async function listInviteTokens(authHost, token) {
|
|||
export async function revokeToken(tokenToRevoke, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/revoke_invite`,
|
||||
url: `/api/v1/pleroma/admin/users/revoke_invite`,
|
||||
method: 'post',
|
||||
headers: authHeaders(token),
|
||||
data: { token: tokenToRevoke }
|
||||
|
|
|
@ -5,7 +5,7 @@ import { baseName } from './utils'
|
|||
export async function listBannedUrls(page, pageSize, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/media_proxy_caches?page=${page}&page_size=${pageSize}`,
|
||||
url: `/api/v1/pleroma/admin/media_proxy_caches?page=${page}&page_size=${pageSize}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -14,7 +14,7 @@ export async function listBannedUrls(page, pageSize, authHost, token) {
|
|||
export async function purgeUrls(urls, ban, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/media_proxy_caches/purge`,
|
||||
url: `/api/v1/pleroma/admin/media_proxy_caches/purge`,
|
||||
method: 'post',
|
||||
headers: authHeaders(token),
|
||||
data: { urls, ban }
|
||||
|
@ -24,7 +24,7 @@ export async function purgeUrls(urls, ban, authHost, token) {
|
|||
export async function removeBannedUrls(urls, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/media_proxy_caches/delete`,
|
||||
url: `/api/v1/pleroma/admin/media_proxy_caches/delete`,
|
||||
method: 'post',
|
||||
headers: authHeaders(token),
|
||||
data: { urls }
|
||||
|
@ -34,7 +34,7 @@ export async function removeBannedUrls(urls, authHost, token) {
|
|||
export async function searchBannedUrls(query, page, pageSize, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/media_proxy_caches?query=${query}&page=${page}&page_size=${pageSize}`,
|
||||
url: `/api/v1/pleroma/admin/media_proxy_caches?query=${query}&page=${page}&page_size=${pageSize}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
|
|
@ -11,7 +11,7 @@ export async function fetchLog(authHost, token, params, page = 1) {
|
|||
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/moderation_log?${normalizedParams}`,
|
||||
url: `/api/v1/pleroma/admin/moderation_log?${normalizedParams}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -20,7 +20,7 @@ export async function fetchLog(authHost, token, params, page = 1) {
|
|||
export async function fetchAdmins(authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users?filters=is_admin`,
|
||||
url: `/api/v1/pleroma/admin/users?filters=is_admin`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -29,7 +29,7 @@ export async function fetchAdmins(authHost, token) {
|
|||
export async function fetchModerators(authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users?filters=is_moderator`,
|
||||
url: `/api/v1/pleroma/admin/users?filters=is_moderator`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
|
|
@ -5,7 +5,7 @@ import { baseName } from './utils'
|
|||
export async function fetchRelays(authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: '/api/pleroma/admin/relay',
|
||||
url: '/api/v1/pleroma/admin/relay',
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -14,7 +14,7 @@ export async function fetchRelays(authHost, token) {
|
|||
export async function addRelay(relay_url, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: '/api/pleroma/admin/relay',
|
||||
url: '/api/v1/pleroma/admin/relay',
|
||||
method: 'post',
|
||||
headers: authHeaders(token),
|
||||
data: { relay_url }
|
||||
|
@ -24,7 +24,7 @@ export async function addRelay(relay_url, authHost, token) {
|
|||
export async function deleteRelay(relay_url, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: '/api/pleroma/admin/relay',
|
||||
url: '/api/v1/pleroma/admin/relay',
|
||||
method: 'delete',
|
||||
headers: authHeaders(token),
|
||||
data: { relay_url }
|
||||
|
|
|
@ -5,7 +5,7 @@ import { baseName } from './utils'
|
|||
export async function changeState(reports, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/reports`,
|
||||
url: `/api/v1/pleroma/admin/reports`,
|
||||
method: 'patch',
|
||||
headers: authHeaders(token),
|
||||
data: { reports }
|
||||
|
@ -14,8 +14,8 @@ export async function changeState(reports, authHost, token) {
|
|||
|
||||
export async function fetchReports(filter, page, pageSize, authHost, token) {
|
||||
const url = filter.length > 0
|
||||
? `/api/pleroma/admin/reports?state=${filter}&page=${page}&page_size=${pageSize}`
|
||||
: `/api/pleroma/admin/reports?page=${page}&page_size=${pageSize}`
|
||||
? `/api/v1/pleroma/admin/reports?state=${filter}&page=${page}&page_size=${pageSize}`
|
||||
: `/api/v1/pleroma/admin/reports?page=${page}&page_size=${pageSize}`
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url,
|
||||
|
@ -27,7 +27,7 @@ export async function fetchReports(filter, page, pageSize, authHost, token) {
|
|||
export async function fetchSingleReport(id, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/reports/${id}`,
|
||||
url: `/api/v1/pleroma/admin/reports/${id}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -36,7 +36,7 @@ export async function fetchSingleReport(id, authHost, token) {
|
|||
export async function createNote(content, reportID, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/reports/${reportID}/notes`,
|
||||
url: `/api/v1/pleroma/admin/reports/${reportID}/notes`,
|
||||
method: `post`,
|
||||
headers: authHeaders(token),
|
||||
data: { content }
|
||||
|
@ -46,7 +46,7 @@ export async function createNote(content, reportID, authHost, token) {
|
|||
export async function deleteNote(noteID, reportID, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/reports/${reportID}/notes/${noteID}`,
|
||||
url: `/api/v1/pleroma/admin/reports/${reportID}/notes/${noteID}`,
|
||||
method: `delete`,
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
|
|
@ -6,7 +6,7 @@ import _ from 'lodash'
|
|||
export async function deleteInstanceDocument(name, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/instance_document/${name}`,
|
||||
url: `/api/v1/pleroma/admin/instance_document/${name}`,
|
||||
method: 'delete',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -33,7 +33,7 @@ export async function fetchDescription2(authHost, token) {
|
|||
export async function fetchSettings(authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/config`,
|
||||
url: `/api/v1/pleroma/admin/config`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -42,7 +42,7 @@ export async function fetchSettings(authHost, token) {
|
|||
export async function getInstanceDocument(name, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/instance_document/${name}`,
|
||||
url: `/api/v1/pleroma/admin/instance_document/${name}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -51,7 +51,7 @@ export async function getInstanceDocument(name, authHost, token) {
|
|||
export async function updateInstanceDocument(name, formData, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/instance_document/${name}`,
|
||||
url: `/api/v1/pleroma/admin/instance_document/${name}`,
|
||||
method: 'patch',
|
||||
data: formData,
|
||||
headers: { ...authHeaders(token), 'Content-Type': 'multipart/form-data' }
|
||||
|
@ -61,7 +61,7 @@ export async function updateInstanceDocument(name, formData, authHost, token) {
|
|||
export async function updateSettings(configs, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/config`,
|
||||
url: `/api/v1/pleroma/admin/config`,
|
||||
method: 'post',
|
||||
headers: authHeaders(token),
|
||||
data: { configs }
|
||||
|
@ -71,7 +71,7 @@ export async function updateSettings(configs, authHost, token) {
|
|||
export async function removeSettings(configs, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/config`,
|
||||
url: `/api/v1/pleroma/admin/config`,
|
||||
method: 'post',
|
||||
headers: authHeaders(token),
|
||||
data: { configs }
|
||||
|
@ -81,7 +81,7 @@ export async function removeSettings(configs, authHost, token) {
|
|||
export async function fetchFrontends(authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/frontends`,
|
||||
url: `/api/v1/pleroma/admin/frontends`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -91,7 +91,7 @@ export async function installFrontend(data, authHost, token) {
|
|||
const filteredData = _.pickBy(data)
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/frontends/install`,
|
||||
url: `/api/v1/pleroma/admin/frontends/install`,
|
||||
method: 'post',
|
||||
headers: authHeaders(token),
|
||||
data: filteredData
|
||||
|
|
|
@ -5,7 +5,7 @@ import { baseName } from './utils'
|
|||
export async function changeStatusScope(id, sensitive, visibility, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/statuses/${id}`,
|
||||
url: `/api/v1/pleroma/admin/statuses/${id}`,
|
||||
method: 'put',
|
||||
headers: authHeaders(token),
|
||||
data: { sensitive, visibility }
|
||||
|
@ -15,7 +15,7 @@ export async function changeStatusScope(id, sensitive, visibility, authHost, tok
|
|||
export async function deleteStatus(id, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/statuses/${id}`,
|
||||
url: `/api/v1/pleroma/admin/statuses/${id}`,
|
||||
method: 'delete',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -24,7 +24,7 @@ export async function deleteStatus(id, authHost, token) {
|
|||
export async function fetchStatus(id, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/statuses/${id}`,
|
||||
url: `/api/v1/pleroma/admin/statuses/${id}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -33,7 +33,7 @@ export async function fetchStatus(id, authHost, token) {
|
|||
export async function fetchStatuses({ godmode, localOnly, authHost, token, pageSize, page }) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/statuses?godmode=${godmode}&local_only=${localOnly}&page=${page}&page_size=${pageSize}`,
|
||||
url: `/api/v1/pleroma/admin/statuses?godmode=${godmode}&local_only=${localOnly}&page=${page}&page_size=${pageSize}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -42,7 +42,7 @@ export async function fetchStatuses({ godmode, localOnly, authHost, token, pageS
|
|||
export async function fetchStatusesCount(instance, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: instance ? `/api/pleroma/admin/stats?instance=${instance}` : `/api/pleroma/admin/stats`,
|
||||
url: instance ? `/api/v1/pleroma/admin/stats?instance=${instance}` : `/api/v1/pleroma/admin/stats`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -51,7 +51,7 @@ export async function fetchStatusesCount(instance, authHost, token) {
|
|||
export async function fetchStatusesByInstance({ instance, authHost, token, pageSize, page }) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/instances/${instance}/statuses?page=${page}&page_size=${pageSize}`,
|
||||
url: `/api/v1/pleroma/admin/instances/${instance}/statuses?page=${page}&page_size=${pageSize}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
|
|
@ -5,7 +5,7 @@ import { baseName } from './utils'
|
|||
export async function activateUsers(nicknames, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/activate`,
|
||||
url: `/api/v1/pleroma/admin/users/activate`,
|
||||
method: 'patch',
|
||||
headers: authHeaders(token),
|
||||
data: { nicknames }
|
||||
|
@ -15,7 +15,7 @@ export async function activateUsers(nicknames, authHost, token) {
|
|||
export async function addRight(nicknames, right, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/permission_group/${right}`,
|
||||
url: `/api/v1/pleroma/admin/users/permission_group/${right}`,
|
||||
method: 'post',
|
||||
headers: authHeaders(token),
|
||||
data: { nicknames }
|
||||
|
@ -25,7 +25,7 @@ export async function addRight(nicknames, right, authHost, token) {
|
|||
export async function createNewAccount(nickname, email, password, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: '/api/pleroma/admin/users',
|
||||
url: '/api/v1/pleroma/admin/users',
|
||||
method: 'post',
|
||||
headers: authHeaders(token),
|
||||
data: { users: [{ nickname, email, password }] }
|
||||
|
@ -35,7 +35,7 @@ export async function createNewAccount(nickname, email, password, authHost, toke
|
|||
export async function deactivateUsers(nicknames, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/deactivate`,
|
||||
url: `/api/v1/pleroma/admin/users/deactivate`,
|
||||
method: 'patch',
|
||||
headers: authHeaders(token),
|
||||
data: { nicknames }
|
||||
|
@ -45,7 +45,7 @@ export async function deactivateUsers(nicknames, authHost, token) {
|
|||
export async function deleteRight(nicknames, right, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/permission_group/${right}`,
|
||||
url: `/api/v1/pleroma/admin/users/permission_group/${right}`,
|
||||
method: 'delete',
|
||||
headers: authHeaders(token),
|
||||
data: { nicknames }
|
||||
|
@ -55,7 +55,7 @@ export async function deleteRight(nicknames, right, authHost, token) {
|
|||
export async function deleteUsers(nicknames, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users`,
|
||||
url: `/api/v1/pleroma/admin/users`,
|
||||
method: 'delete',
|
||||
headers: authHeaders(token),
|
||||
data: { nicknames }
|
||||
|
@ -65,7 +65,7 @@ export async function deleteUsers(nicknames, authHost, token) {
|
|||
export async function disableMfa(nickname, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/disable_mfa`,
|
||||
url: `/api/v1/pleroma/admin/users/disable_mfa`,
|
||||
method: 'put',
|
||||
headers: authHeaders(token),
|
||||
data: { nickname }
|
||||
|
@ -75,7 +75,7 @@ export async function disableMfa(nickname, authHost, token) {
|
|||
export async function fetchUser(id, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/${id}`,
|
||||
url: `/api/v1/pleroma/admin/users/${id}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -84,7 +84,7 @@ export async function fetchUser(id, authHost, token) {
|
|||
export async function fetchUserCredentials(nickname, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/${nickname}/credentials`,
|
||||
url: `/api/v1/pleroma/admin/users/${nickname}/credentials`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -93,7 +93,7 @@ export async function fetchUserCredentials(nickname, authHost, token) {
|
|||
export async function updateUserCredentials(nickname, credentials, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/${nickname}/credentials`,
|
||||
url: `/api/v1/pleroma/admin/users/${nickname}/credentials`,
|
||||
method: 'patch',
|
||||
headers: authHeaders(token),
|
||||
data: credentials
|
||||
|
@ -102,11 +102,11 @@ export async function updateUserCredentials(nickname, credentials, authHost, tok
|
|||
|
||||
export async function fetchUsers(filters, actorTypeFilters, authHost, token, page = 1) {
|
||||
const url = actorTypeFilters.length === 0
|
||||
? `/api/pleroma/admin/users?page=${page}&filters=${filters}`
|
||||
? `/api/v1/pleroma/admin/users?page=${page}&filters=${filters}`
|
||||
: actorTypeFilters.reduce((acc, filter) => {
|
||||
const newAcc = acc.concat(`&actor_types[]=${filter}`)
|
||||
return newAcc
|
||||
}, `/api/pleroma/admin/users?page=${page}&filters=${filters}`)
|
||||
}, `/api/v1/pleroma/admin/users?page=${page}&filters=${filters}`)
|
||||
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
|
@ -119,7 +119,7 @@ export async function fetchUsers(filters, actorTypeFilters, authHost, token, pag
|
|||
export async function getPasswordResetToken(nickname, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/${nickname}/password_reset`,
|
||||
url: `/api/v1/pleroma/admin/users/${nickname}/password_reset`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -128,7 +128,7 @@ export async function getPasswordResetToken(nickname, authHost, token) {
|
|||
export async function forcePasswordReset(nicknames, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/force_password_reset`,
|
||||
url: `/api/v1/pleroma/admin/users/force_password_reset`,
|
||||
method: 'patch',
|
||||
headers: authHeaders(token),
|
||||
data: { nicknames }
|
||||
|
@ -137,11 +137,11 @@ export async function forcePasswordReset(nicknames, authHost, token) {
|
|||
|
||||
export async function searchUsers(query, filters, actorTypeFilters, authHost, token, page = 1) {
|
||||
const url = actorTypeFilters.length === 0
|
||||
? `/api/pleroma/admin/users?query=${query}&page=${page}&filters=${filters}`
|
||||
? `/api/v1/pleroma/admin/users?query=${query}&page=${page}&filters=${filters}`
|
||||
: actorTypeFilters.reduce((acc, filter) => {
|
||||
const newAcc = acc.concat(`&actor_types[]=${filter}`)
|
||||
return newAcc
|
||||
}, `/api/pleroma/admin/users?query=${query}&page=${page}&filters=${filters}`)
|
||||
}, `/api/v1/pleroma/admin/users?query=${query}&page=${page}&filters=${filters}`)
|
||||
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
|
@ -154,7 +154,7 @@ export async function searchUsers(query, filters, actorTypeFilters, authHost, to
|
|||
export async function tagUser(nicknames, tags, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: '/api/pleroma/admin/users/tag',
|
||||
url: '/api/v1/pleroma/admin/users/tag',
|
||||
method: 'put',
|
||||
headers: authHeaders(token),
|
||||
data: { nicknames, tags }
|
||||
|
@ -164,7 +164,7 @@ export async function tagUser(nicknames, tags, authHost, token) {
|
|||
export async function untagUser(nicknames, tags, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: '/api/pleroma/admin/users/tag',
|
||||
url: '/api/v1/pleroma/admin/users/tag',
|
||||
method: 'delete',
|
||||
headers: authHeaders(token),
|
||||
data: { nicknames, tags }
|
||||
|
@ -174,16 +174,7 @@ export async function untagUser(nicknames, tags, authHost, token) {
|
|||
export async function fetchUserStatuses(id, authHost, godmode, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/${id}/statuses?godmode=${godmode}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
}
|
||||
|
||||
export async function fetchUserChats(id, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/${id}/chats`,
|
||||
url: `/api/v1/pleroma/admin/users/${id}/statuses?godmode=${godmode}`,
|
||||
method: 'get',
|
||||
headers: authHeaders(token)
|
||||
})
|
||||
|
@ -192,7 +183,7 @@ export async function fetchUserChats(id, authHost, token) {
|
|||
export async function approveUserAccount(nicknames, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: '/api/pleroma/admin/users/approve',
|
||||
url: '/api/v1/pleroma/admin/users/approve',
|
||||
method: 'patch',
|
||||
headers: authHeaders(token),
|
||||
data: { nicknames }
|
||||
|
@ -202,7 +193,7 @@ export async function approveUserAccount(nicknames, authHost, token) {
|
|||
export async function confirmUserEmail(nicknames, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: '/api/pleroma/admin/users/confirm_email',
|
||||
url: '/api/v1/pleroma/admin/users/confirm_email',
|
||||
method: 'patch',
|
||||
headers: authHeaders(token),
|
||||
data: { nicknames }
|
||||
|
@ -212,7 +203,7 @@ export async function confirmUserEmail(nicknames, authHost, token) {
|
|||
export async function resendConfirmationEmail(nicknames, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: '/api/pleroma/admin/users/resend_confirmation_email',
|
||||
url: '/api/v1/pleroma/admin/users/resend_confirmation_email',
|
||||
method: 'patch',
|
||||
headers: authHeaders(token),
|
||||
data: { nicknames }
|
||||
|
|
|
@ -1,233 +0,0 @@
|
|||
<template>
|
||||
<el-card v-if="!message.deleted" class="message-card">
|
||||
<div slot="header">
|
||||
<div class="message-header">
|
||||
<div class="message-meta">
|
||||
<router-link
|
||||
v-if="propertyExists(author, 'id')"
|
||||
:to="{ name: 'UsersShow', params: { id: author.id }}"
|
||||
class="router-link"
|
||||
@click.native.stop>
|
||||
<div class="message-author">
|
||||
<img v-if="propertyExists(author, 'avatar')" :src="author.avatar" class="message-author-avatar-img">
|
||||
<span v-if="propertyExists(author, 'username')" class="message-author-name">{{ author.username }}</span>
|
||||
<span v-else>
|
||||
<span v-if="propertyExists(author, 'username')" class="message-author-name">
|
||||
{{ author.username }}
|
||||
</span>
|
||||
<span v-else class="message-author-name deactivated">({{ $t('users.invalidNickname') }})</span>
|
||||
</span>
|
||||
</div>
|
||||
</router-link>
|
||||
<span class="message-timestamp">{{ parseTimestamp(message.created_at) }}</span>
|
||||
</div>
|
||||
<div class="message-actions">
|
||||
<el-dropdown trigger="click" @click.native.stop>
|
||||
<el-button plain size="small" icon="el-icon-edit" class="status-actions-button">
|
||||
{{ $t('reports.messageModeration') }}<i class="el-icon-arrow-down el-icon--right"/>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item
|
||||
@click.native="deleteMessage()">
|
||||
{{ $t('reports.deleteMessage') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
@click.native="handleRouteChange()">
|
||||
{{ $t('users.moderateUser') }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="message-body">
|
||||
<span class="message-content" v-html="message.content"/>
|
||||
<div v-if="message.attachment" class="image">
|
||||
<img :src="message.attachment.preview_url">
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment'
|
||||
|
||||
export default {
|
||||
name: 'ChatMessage',
|
||||
props: {
|
||||
message: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
author: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
page: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
propertyExists(account, property) {
|
||||
return account[property]
|
||||
},
|
||||
parseTimestamp(timestamp) {
|
||||
return moment(timestamp).format('YYYY-MM-DD HH:mm')
|
||||
},
|
||||
deleteMessage() {
|
||||
this.$confirm('Are you sure you want to delete this message?', 'Warning', {
|
||||
confirmButtonText: 'OK',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$store.dispatch('DeleteMessage', {
|
||||
chat_id: this.message.chat_id,
|
||||
message_id: this.message.id
|
||||
})
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: 'Delete completed'
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: 'Delete canceled'
|
||||
})
|
||||
})
|
||||
},
|
||||
handleRouteChange() {
|
||||
this.$router.push({ name: 'UsersShow', params: { id: this.author.id }})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel='stylesheet/scss' lang='scss'>
|
||||
.message-card {
|
||||
margin-bottom: 10px;
|
||||
.account {
|
||||
line-height: 26px;
|
||||
font-size: 13px;
|
||||
color: #606266;
|
||||
}
|
||||
.account:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.deactivated {
|
||||
color: gray;
|
||||
line-height: 28px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.image {
|
||||
width: 20%;
|
||||
img {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.router-link {
|
||||
text-decoration: none;
|
||||
}
|
||||
.show-more-button {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.message-author {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.message-author-avatar-img {
|
||||
display: inline-block;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.message-author-name {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.message-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.message-card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.chat-content {
|
||||
font-size: 15px;
|
||||
line-height: 26px;
|
||||
}
|
||||
.message-timestamp {
|
||||
font-size: 13px;
|
||||
color: #606266;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.message-deleted {
|
||||
font-style: italic;
|
||||
margin-top: 3px;
|
||||
}
|
||||
.message-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.message-meta {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media only screen and (max-width:480px) {
|
||||
.el-message {
|
||||
min-width: 80%;
|
||||
}
|
||||
.el-message-box {
|
||||
width: 80%;
|
||||
}
|
||||
.message-card {
|
||||
.el-card__header {
|
||||
padding: 10px 17px;
|
||||
}
|
||||
.el-tag {
|
||||
margin: 3px 0;
|
||||
}
|
||||
.message-author-container {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.message-action-buttons {
|
||||
margin: 3px 0 3px;
|
||||
}
|
||||
.message-actions {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.message-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
.message-actions-button {
|
||||
margin: 3px 0 3px;
|
||||
}
|
||||
.message-actions {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -182,6 +182,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
capitalizeFirstLetter(str) {
|
||||
if (!str) return ''
|
||||
return str.charAt(0).toUpperCase() + str.slice(1)
|
||||
},
|
||||
changeStatus(statusId, isSensitive, visibility) {
|
||||
|
|
|
@ -67,7 +67,6 @@ export default {
|
|||
reports: 'Reports',
|
||||
invites: 'Invites',
|
||||
statuses: 'Statuses',
|
||||
chats: 'Chats',
|
||||
settings: 'Settings',
|
||||
moderationLog: 'Moderation Log',
|
||||
relays: 'Relays',
|
||||
|
@ -302,11 +301,6 @@ export default {
|
|||
unlisted: 'Unlisted',
|
||||
openStatusInInstance: 'Open status in instance'
|
||||
},
|
||||
chats: {
|
||||
chats: 'Chats',
|
||||
loadMore: 'Load more',
|
||||
chatHistory: 'Chat History'
|
||||
},
|
||||
userProfile: {
|
||||
tags: 'Tags',
|
||||
moderator: 'Moderator',
|
||||
|
@ -317,7 +311,6 @@ export default {
|
|||
actorType: 'Actor Type',
|
||||
nickname: 'Nickname',
|
||||
recentStatuses: 'Recent Statuses',
|
||||
chats: 'Chats',
|
||||
roles: 'Roles',
|
||||
active: 'Active',
|
||||
status: 'Status',
|
||||
|
@ -325,7 +318,6 @@ export default {
|
|||
deactivated: 'Deactivated',
|
||||
pending: 'Pending',
|
||||
noStatuses: 'No statuses to show',
|
||||
noChats: 'No chats to show',
|
||||
noMessages: 'No messages to show',
|
||||
openAccountInInstance: 'Open account in instance',
|
||||
securitySettings: {
|
||||
|
@ -420,6 +412,7 @@ export default {
|
|||
submit: 'Submit',
|
||||
settings: 'Settings',
|
||||
instance: 'Instance',
|
||||
search: 'Search',
|
||||
upload: 'Upload',
|
||||
mailer: 'Mailer',
|
||||
linkFormatter: 'Link Formatter',
|
||||
|
@ -433,10 +426,8 @@ export default {
|
|||
mrf: 'MRF',
|
||||
mediaProxy: 'Media Proxy',
|
||||
metadata: 'Metadata',
|
||||
gopher: 'Gopher',
|
||||
jobQueue: 'Job queue',
|
||||
webPush: 'Web push encryption',
|
||||
esshd: 'BBS / SSH access',
|
||||
rateLimiters: 'Rate limiters',
|
||||
other: 'Other',
|
||||
success: 'Settings changed successfully!',
|
||||
|
@ -471,6 +462,8 @@ export default {
|
|||
setLimits: 'Set different limits for unauthenticated and authenticated users',
|
||||
unauthenticatedUsers: 'Unauthenticated users',
|
||||
authenticatedUsers: 'Authenticated users',
|
||||
scale: 'Timespan (ms)',
|
||||
limit: 'Requests',
|
||||
setLimitsForAll: 'Set limit for all users',
|
||||
ref: 'Ref',
|
||||
file: 'File',
|
||||
|
|
|
@ -232,17 +232,5 @@ export const asyncRouterMap = [
|
|||
],
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/chats/:id',
|
||||
component: Layout,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'ChatsShow',
|
||||
component: () => import('@/views/chats/show')
|
||||
}
|
||||
],
|
||||
hidden: true
|
||||
},
|
||||
{ path: '*', redirect: '/404', hidden: true }
|
||||
]
|
||||
|
|
|
@ -13,7 +13,6 @@ import relays from './modules/relays'
|
|||
import reports from './modules/reports'
|
||||
import settings from './modules/settings'
|
||||
import status from './modules/status'
|
||||
import chat from './modules/chat'
|
||||
import tagsView from './modules/tagsView'
|
||||
import user from './modules/user'
|
||||
import userProfile from './modules/userProfile'
|
||||
|
@ -35,7 +34,6 @@ const store = new Vuex.Store({
|
|||
reports,
|
||||
settings,
|
||||
status,
|
||||
chat,
|
||||
tagsView,
|
||||
user,
|
||||
userProfile,
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
import { fetchChat, fetchChatMessages, deleteChatMessage } from '@/api/chat'
|
||||
|
||||
const chat = {
|
||||
state: {
|
||||
fetchedChat: {},
|
||||
fetchedChatMessages: {},
|
||||
loading: false,
|
||||
buttonLoading: false,
|
||||
allLoaded: false,
|
||||
maxId: null
|
||||
},
|
||||
mutations: {
|
||||
SET_LOADING: (state, chat) => {
|
||||
state.loading = chat
|
||||
},
|
||||
SET_ALL_LOADED: (state, chat) => {
|
||||
state.allLoaded = chat
|
||||
},
|
||||
SET_BUTTON_LOADING: (state, chat) => {
|
||||
state.buttonLoading = chat
|
||||
},
|
||||
SET_CHAT: (state, chat) => {
|
||||
state.fetchedChat = chat
|
||||
},
|
||||
SET_CHAT_MESSAGES: (state, chatMessages) => {
|
||||
state.fetchedChatMessages = chatMessages
|
||||
},
|
||||
CHANGE_MAX_ID: (state, max_id) => {
|
||||
state.maxId = max_id
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async FetchChat({ commit, dispatch, getters, state }, id) {
|
||||
commit('SET_LOADING', true)
|
||||
const chat = await fetchChat(id, getters.authHost, getters.token)
|
||||
|
||||
commit('SET_CHAT', chat.data)
|
||||
commit('SET_LOADING', false)
|
||||
},
|
||||
async FetchChatMessages({ commit, dispatch, getters, state }, id, max_id) {
|
||||
commit('SET_LOADING', true)
|
||||
const chat = await fetchChatMessages(id, state.maxId, getters.authHost, getters.token)
|
||||
commit('SET_CHAT_MESSAGES', chat.data)
|
||||
commit('SET_LOADING', false)
|
||||
},
|
||||
async DeleteMessage({ commit, dispatch, getters, state }, params) {
|
||||
await deleteChatMessage(params.chat_id, params.message_id, getters.authHost, getters.token)
|
||||
dispatch('FetchChatMessages', params.chat_id)
|
||||
},
|
||||
HandlePageChange({ commit }, max_id) {
|
||||
commit('CHANGE_MAX_ID', max_id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default chat
|
|
@ -28,7 +28,7 @@ const getCurrentValue = (type, value, path) => {
|
|||
}
|
||||
|
||||
const getValueWithoutKey = (key, [type, value]) => {
|
||||
if (prependWithСolon(type, value)) {
|
||||
if (prependWithColon(type, value)) {
|
||||
return `:${value}`
|
||||
} else if (key === ':backends') {
|
||||
const index = value.findIndex(el => el === ':ex_syslogger')
|
||||
|
@ -77,6 +77,7 @@ export const parseTuples = (tuples, key) => {
|
|||
(item.tuple[0] === ':groups' ||
|
||||
item.tuple[0] === ':replace' ||
|
||||
item.tuple[0] === ':retries' ||
|
||||
item.tuple[0] === ':timeout' ||
|
||||
(item.tuple[0] === ':headers' && key === 'Pleroma.Web.MediaProxy.Invalidation.Http') ||
|
||||
item.tuple[0] === ':crontab' ||
|
||||
item.tuple[0] === ':transparency_exclusions' ||
|
||||
|
@ -107,14 +108,14 @@ export const parseTuples = (tuples, key) => {
|
|||
}, [])
|
||||
} else if (item.tuple[0] === ':prune') {
|
||||
accum[item.tuple[0]] = item.tuple[1] === ':disabled' ? [item.tuple[1]] : item.tuple[1].tuple
|
||||
} else if (item.tuple[0] === ':proxy_url' || item.tuple[0] === ':sender') {
|
||||
} else if (item.tuple[0] === ':sender') {
|
||||
accum[item.tuple[0]] = parseStringOrTupleValue(item.tuple[0], item.tuple[1])
|
||||
} else if (item.tuple[0] === ':args') {
|
||||
accum[item.tuple[0]] = parseNonTuples(item.tuple[0], item.tuple[1])
|
||||
} else if (item.tuple[0] === ':ip_whitelist') {
|
||||
accum[item.tuple[0]] = item.tuple[1].map(ip => typeof ip === 'string' ? ip : ip.tuple.join('.'))
|
||||
} else if (Array.isArray(item.tuple[1]) &&
|
||||
(typeof item.tuple[1][0] === 'object' && !Array.isArray(item.tuple[1][0])) && item.tuple[1][0]['tuple']) {
|
||||
} else if (Array.isArray(item.tuple[1]) && (item.tuple[1][0] !== null &&
|
||||
typeof item.tuple[1][0] === 'object' && !Array.isArray(item.tuple[1][0])) && item.tuple[1][0]['tuple']) {
|
||||
accum[item.tuple[0]] = parseTuples(item.tuple[1], item.tuple[0])
|
||||
} else if (Array.isArray(item.tuple[1])) {
|
||||
accum[item.tuple[0]] = item.tuple[1]
|
||||
|
@ -167,7 +168,7 @@ const parseStringOrTupleValue = (key, value) => {
|
|||
}
|
||||
}
|
||||
|
||||
const prependWithСolon = (type, value) => {
|
||||
const prependWithColon = (type, value) => {
|
||||
return (type === 'atom' && value.length > 0) ||
|
||||
(Array.isArray(type) && type.includes('boolean') && type.includes('atom') && typeof value === 'string')
|
||||
}
|
||||
|
@ -256,7 +257,7 @@ const wrapValues = (settings, currentState) => {
|
|||
))
|
||||
) {
|
||||
return { 'tuple': [setting, wrapValues(value, currentState)] }
|
||||
} else if (prependWithСolon(type, value)) {
|
||||
} else if (prependWithColon(type, value)) {
|
||||
return { 'tuple': [setting, `:${value}`] }
|
||||
} else if (type.includes('tuple') &&
|
||||
(type.includes('string') || type.includes('atom') || type.includes('boolean'))) {
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
import { fetchUser, fetchUserStatuses, fetchUserChats, fetchUserCredentials, updateUserCredentials } from '@/api/users'
|
||||
import { fetchUser, fetchUserStatuses, fetchUserCredentials, updateUserCredentials } from '@/api/users'
|
||||
|
||||
const userProfile = {
|
||||
state: {
|
||||
statuses: [],
|
||||
statusesLoading: true,
|
||||
chats: [],
|
||||
chatsLoading: true,
|
||||
user: {},
|
||||
userCredentials: {},
|
||||
userProfileLoading: true
|
||||
|
@ -17,12 +15,6 @@ const userProfile = {
|
|||
SET_STATUSES_LOADING: (state, status) => {
|
||||
state.statusesLoading = status
|
||||
},
|
||||
SET_CHATS: (state, chats) => {
|
||||
state.chats = chats
|
||||
},
|
||||
SET_CHATS_LOADING: (state, chat) => {
|
||||
state.chatsLoading = chat
|
||||
},
|
||||
SET_USER: (state, user) => {
|
||||
state.user = user
|
||||
},
|
||||
|
@ -42,24 +34,15 @@ const userProfile = {
|
|||
commit('SET_USER_PROFILE_LOADING', false)
|
||||
|
||||
dispatch('FetchUserStatuses', { userId, godmode })
|
||||
dispatch('FetchUserChats', { userId })
|
||||
},
|
||||
FetchUserStatuses({ commit, dispatch, getters }, { userId, godmode }) {
|
||||
commit('SET_STATUSES_LOADING', true)
|
||||
|
||||
fetchUserStatuses(userId, getters.authHost, godmode, getters.token)
|
||||
.then(statuses => dispatch('SetStatuses', statuses.data))
|
||||
.then(statuses => dispatch('SetStatuses', statuses.data.activities))
|
||||
|
||||
commit('SET_STATUSES_LOADING', false)
|
||||
},
|
||||
FetchUserChats({ commit, dispatch, getters }, { userId }) {
|
||||
commit('SET_CHATS_LOADING', true)
|
||||
|
||||
fetchUserChats(userId, getters.authHost, getters.token)
|
||||
.then(chats => dispatch('SetChats', chats.data))
|
||||
|
||||
commit('SET_CHATS_LOADING', false)
|
||||
},
|
||||
async FetchUserCredentials({ commit, getters }, { nickname }) {
|
||||
const userResponse = await fetchUserCredentials(nickname, getters.authHost, getters.token)
|
||||
commit('SET_USER_CREDENTIALS', userResponse.data)
|
||||
|
@ -67,9 +50,6 @@ const userProfile = {
|
|||
SetStatuses({ commit }, statuses) {
|
||||
commit('SET_STATUSES', statuses)
|
||||
},
|
||||
SetChats({ commit }, chats) {
|
||||
commit('SET_CHATS', chats)
|
||||
},
|
||||
async UpdateUserCredentials({ dispatch, getters }, { nickname, credentials }) {
|
||||
await updateUserCredentials(nickname, credentials, getters.authHost, getters.token)
|
||||
dispatch('FetchUserCredentials', { nickname })
|
||||
|
|
|
@ -2,10 +2,8 @@ export const tabs = [
|
|||
{ label: 'ActivityPub', path: 'activity-pub', tab: ':activity_pub' },
|
||||
{ label: 'Authentication', path: 'authentication', tab: ':authentication' },
|
||||
{ label: 'Captcha', path: 'captcha', tab: ':captcha' },
|
||||
{ label: 'BBS / SSH access', path: 'esshd', tab: ':esshd' },
|
||||
{ label: 'Emoji', path: 'emoji', tab: ':emoji' },
|
||||
{ label: 'Frontend', path: 'frontend', tab: ':frontend' },
|
||||
{ label: 'Gopher', path: 'gopher', tab: ':gopher' },
|
||||
{ label: 'HTTP', path: 'http', tab: ':http' },
|
||||
{ label: 'Instance', path: 'instance', tab: ':instance' },
|
||||
{ label: 'Job queue', path: 'job-queue', tab: ':job_queue' },
|
||||
|
@ -18,5 +16,6 @@ export const tabs = [
|
|||
{ label: 'Rate limiters', path: 'rate-limiters', tab: ':rate_limiters' },
|
||||
{ label: 'Web push encryption', path: 'web-push', tab: ':web_push' },
|
||||
{ label: 'Upload', path: 'upload', tab: ':upload' },
|
||||
{ label: 'Search', path: 'search', tab: ':search' },
|
||||
{ label: 'Other', path: 'other', tab: ':other' }
|
||||
]
|
||||
|
|
|
@ -1,250 +0,0 @@
|
|||
<template>
|
||||
<div v-if="!loading" class="chat-show-container">
|
||||
<header class="chat-page-header">
|
||||
<h1>
|
||||
{{ $t('chats.chatHistory') }}:
|
||||
</h1>
|
||||
<div class="chat-card-participants">
|
||||
<div class="chat-particiants-sender">
|
||||
<div class="avatar-name-container">
|
||||
<el-avatar v-if="propertyExists(chat.sender, 'avatar')" :src="chat.sender.avatar" size="large" />
|
||||
<h1 v-if="propertyExists(chat.sender, 'display_name')" class="particiant-display-name">{{ chat.sender.display_name }}</h1>
|
||||
<h1 v-else class="particiant-display-name invalid">({{ $t('users.invalidNickname') }})</h1>
|
||||
<a v-if="propertyExists(chat.sender, 'url')" :href="chat.sender.url" target="_blank">
|
||||
<i :title="$t('userProfile.openAccountInInstance')" class="el-icon-top-right"/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chat-particiants-receiver">
|
||||
<div class="avatar-name-container">
|
||||
<el-avatar v-if="propertyExists(chat.receiver, 'avatar')" :src="chat.receiver.avatar" size="large" />
|
||||
<h1 v-if="propertyExists(chat.receiver, 'display_name')" class="particiant-display-name">{{ chat.receiver.display_name }}</h1>
|
||||
<h1 v-else class="particiant-display-name invalid">({{ $t('users.invalidNickname') }})</h1>
|
||||
<a v-if="propertyExists(chat.receiver, 'url')" :href="chat.receiver.url" target="_blank">
|
||||
<i :title="$t('userProfile.openAccountInInstance')" class="el-icon-top-right"/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div v-if="isMobile" class="chat-page-header-container">
|
||||
<header class="chat-page-header">
|
||||
<div class="avatar-name-container"/>
|
||||
<reboot-button/>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
<div class="chat-messages-container">
|
||||
|
||||
<el-timeline v-if="!loading" class="messages">
|
||||
<el-timeline-item v-for="message in chatMessages" :key="message.id">
|
||||
<chat-message :message="message" :author="getAuthor(message.account_id)"/>
|
||||
</el-timeline-item>
|
||||
<p v-if="chatMessages.length === 0" class="no-messages">{{ $t('userProfile.noMessages') }}</p>
|
||||
<div v-if="chatMessages.length === 20" class="statuses-pagination">
|
||||
<el-button v-if="!allLoaded" :loading="buttonLoading" @click="handleLoadMore">{{ $t('statuses.loadMore') }}</el-button>
|
||||
<el-button v-else icon="el-icon-check" circle/>
|
||||
</div>
|
||||
</el-timeline>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ChatMessage from '@/components/ChatMessage'
|
||||
import RebootButton from '@/components/RebootButton'
|
||||
|
||||
export default {
|
||||
name: 'ChatShow',
|
||||
components: { RebootButton, ChatMessage },
|
||||
computed: {
|
||||
isDesktop() {
|
||||
return this.$store.state.app.device === 'desktop'
|
||||
},
|
||||
isMobile() {
|
||||
return this.$store.state.app.device === 'mobile'
|
||||
},
|
||||
isTablet() {
|
||||
return this.$store.state.app.device === 'tablet'
|
||||
},
|
||||
allLoaded() {
|
||||
return this.$store.state.chat.allLoaded
|
||||
},
|
||||
buttonLoading() {
|
||||
return this.$store.state.chat.buttonLoading
|
||||
},
|
||||
loading() {
|
||||
return this.$store.state.chat.loading
|
||||
},
|
||||
chat() {
|
||||
return this.$store.state.chat.fetchedChat
|
||||
},
|
||||
chatMessages() {
|
||||
return this.$store.state.chat.fetchedChatMessages
|
||||
}
|
||||
},
|
||||
beforeMount: function() {
|
||||
this.$store.dispatch('HandlePageChange', null)
|
||||
this.$store.dispatch('NeedReboot')
|
||||
this.$store.dispatch('GetNodeInfo')
|
||||
this.$store.dispatch('FetchChat', this.$route.params.id)
|
||||
this.$store.dispatch('FetchChatMessages', this.$route.params.id)
|
||||
},
|
||||
methods: {
|
||||
propertyExists(account, property) {
|
||||
return account[property]
|
||||
},
|
||||
getAuthor(account_id) {
|
||||
const sender = this.chat.sender
|
||||
const receiver = this.chat.receiver
|
||||
return account_id === sender.id ? sender : receiver
|
||||
},
|
||||
handleLoadMore() {
|
||||
const max_id = this.chatMessages.pop().id
|
||||
this.$store.dispatch('HandlePageChange', max_id)
|
||||
this.$store.dispatch('FetchChatMessages', this.$route.params.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel='stylesheet/scss' lang='scss'>
|
||||
.chat-page-header {
|
||||
display: flex;
|
||||
margin: 22px 15px 22px 20px;
|
||||
justify-content: center;
|
||||
padding: 0;
|
||||
h1 {
|
||||
display: inline
|
||||
}
|
||||
}
|
||||
.chat-card-participants {
|
||||
display: flex;
|
||||
margin: 0 20px;
|
||||
}
|
||||
.avatar-name-container {
|
||||
padding-right: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.el-icon-top-right {
|
||||
font-size: 2em;
|
||||
line-height: 36px;
|
||||
color: #606266;
|
||||
}
|
||||
.particiant-display-name {
|
||||
padding-left: 5px;
|
||||
}
|
||||
}
|
||||
.el-avatar h1 {
|
||||
padding-right: 5px;
|
||||
}
|
||||
.chat-messages-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.messages.el-timeline {
|
||||
padding: 0;
|
||||
}
|
||||
.no-chats {
|
||||
margin-left: 28px;
|
||||
color: #606266;
|
||||
}
|
||||
.reboot-button {
|
||||
padding: 10px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
.router-link {
|
||||
text-decoration: none;
|
||||
}
|
||||
.chat-container {
|
||||
margin: 0 15px 0 20px;
|
||||
}
|
||||
.chats {
|
||||
padding: 0 20px 0 0;
|
||||
}
|
||||
.statuses-pagination {
|
||||
padding: 15px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media only screen and (max-width:480px) {
|
||||
.chat-page-header {
|
||||
padding: 0;
|
||||
margin: 7px 15px 15px 30px;
|
||||
flex-direction: column;
|
||||
align-items: baseline;
|
||||
h1 {
|
||||
margin-left: 0;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
.chat-card-participants {
|
||||
display: flex;
|
||||
margin: 0;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.avatar-name-container {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.messages.el-timeline {
|
||||
padding-left: 10px;
|
||||
}
|
||||
.el-timeline-item__wrapper {
|
||||
padding-left: 18px;
|
||||
}
|
||||
.message-card .el-card__header .message-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.message-actions {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
.message-card .message-header .message-meta {
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
.message-timestamp {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1051px) {
|
||||
.messages.el-timeline {
|
||||
max-width: 90%;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width:801px) and (min-width: 481px) {
|
||||
.chat-page-header {
|
||||
padding: 0;
|
||||
margin: 7px 15px 15px 30px;
|
||||
flex-direction: column;
|
||||
align-items: baseline;
|
||||
h1 {
|
||||
margin-left: 0;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
.chat-card-participants {
|
||||
display: flex;
|
||||
margin: 0;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.avatar-name-container {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.messages.el-timeline {
|
||||
padding-left: 10px;
|
||||
max-width: 97%;
|
||||
}
|
||||
.el-timeline-item__wrapper {
|
||||
padding-left: 18px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -30,7 +30,7 @@
|
|||
<div class="download-pack-button-container">
|
||||
<el-link
|
||||
v-if="pack.pack['can-download']"
|
||||
:href="`//${host}//api/pleroma/emoji/packs/archive?name=${name}`"
|
||||
:href="`//${host}//api/v1/pleroma/emoji/packs/archive?name=${name}`"
|
||||
:underline="false"
|
||||
type="primary"
|
||||
target="_blank">
|
||||
|
|
|
@ -55,7 +55,12 @@ export default {
|
|||
},
|
||||
async handleOpen($event) {
|
||||
if ($event === '/settings') {
|
||||
if (!localStorage.getItem('settingsTabs')) {
|
||||
let settingsTabs = localStorage.getItem('settingsTabs')
|
||||
if (settingsTabs === '[]') {
|
||||
localStorage.removeItem('settingsTabs')
|
||||
settingsTabs = null
|
||||
}
|
||||
if (!settingsTabs) {
|
||||
await this.$store.dispatch('FetchSettings')
|
||||
const menuItems = this.tabs
|
||||
localStorage.setItem('settingsTabs', JSON.stringify(menuItems))
|
||||
|
|
|
@ -18,10 +18,6 @@
|
|||
<setting :setting-group="assets" :data="assetsData"/>
|
||||
</el-form>
|
||||
<el-divider v-if="assets" class="divider thick-line"/>
|
||||
<el-form :model="chatData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="chat" :data="chatData"/>
|
||||
</el-form>
|
||||
<el-divider v-if="chat" class="divider thick-line"/>
|
||||
<el-form :model="markupData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="markup" :data="markupData"/>
|
||||
</el-form>
|
||||
|
@ -55,12 +51,6 @@ export default {
|
|||
assetsData() {
|
||||
return _.get(this.settings.settings, [':pleroma', ':assets']) || {}
|
||||
},
|
||||
chat() {
|
||||
return this.settings.description.find(setting => setting.key === ':chat')
|
||||
},
|
||||
chatData() {
|
||||
return _.get(this.settings.settings, [':pleroma', ':chat']) || {}
|
||||
},
|
||||
frontend() {
|
||||
return this.settings.description.find(setting => setting.key === ':frontend_configurations')
|
||||
},
|
||||
|
|
|
@ -115,7 +115,6 @@
|
|||
<icons-input v-if="setting.key === ':icons'" :data="iconsData" :setting-group="settingGroup" :setting="setting"/>
|
||||
<boolean-combined-input v-if="booleanCombinedInput" :data="data" :setting-group="settingGroup" :setting="setting"/>
|
||||
<mascots-input v-if="setting.key === ':mascots'" :data="keywordData" :setting-group="settingGroup" :setting="setting"/>
|
||||
<proxy-url-input v-if="setting.key === ':proxy_url'" :data="data[setting.key]" :setting-group="settingGroup" :setting="setting" :parents="settingParent"/>
|
||||
<prune-input v-if="setting.key === ':prune'" :data="data[setting.key]" :setting-group="settingGroup" :setting="setting"/>
|
||||
<rate-limit-input v-if="settingGroup.key === ':rate_limit'" :data="data" :setting-group="settingGroup" :setting="setting"/>
|
||||
<reg-invites-input v-if="[':registrations_open', ':invites_enabled'].includes(setting.key)" :data="data" :setting-group="settingGroup" :setting="setting"/>
|
||||
|
|
|
@ -44,6 +44,17 @@
|
|||
<el-form :model="streamerData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="streamer" :data="streamerData"/>
|
||||
</el-form>
|
||||
<el-divider v-if="translator" class="divider thick-line"/>
|
||||
<el-form :model="translatorData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="translator" :data="translatorData"/>
|
||||
</el-form>
|
||||
<el-form v-if="usesDeepL" :model="deeplData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="deepl" :data="deeplData"/>
|
||||
</el-form>
|
||||
<el-form v-if="usesLibreTranslate" :model="libretranslateData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="libre_translate" :data="libretranslateData"/>
|
||||
</el-form>
|
||||
|
||||
<div class="submit-button-container">
|
||||
<el-button class="submit-button" type="primary" @click="onSubmit">{{ $t('settings.submit') }}</el-button>
|
||||
</div>
|
||||
|
@ -172,6 +183,30 @@ export default {
|
|||
},
|
||||
welcomeData() {
|
||||
return _.get(this.settings.settings, [':pleroma', ':welcome']) || {}
|
||||
},
|
||||
translator() {
|
||||
return this.$store.state.settings.description.find(setting => setting.key === ':translator')
|
||||
},
|
||||
translatorData() {
|
||||
return _.get(this.settings.settings, [':pleroma', ':translator']) || {}
|
||||
},
|
||||
usesDeepL() {
|
||||
return (_.get(this.settings.settings, [':pleroma', ':translator', ':module']) || '').toLowerCase().endsWith('deepl')
|
||||
},
|
||||
usesLibreTranslate() {
|
||||
return (_.get(this.settings.settings, [':pleroma', ':translator', ':module']) || '').toLowerCase().endsWith('libretranslate')
|
||||
},
|
||||
deepl() {
|
||||
return this.$store.state.settings.description.find(setting => setting.key === ':deepl')
|
||||
},
|
||||
deeplData() {
|
||||
return _.get(this.settings.settings, [':pleroma', ':deepl']) || {}
|
||||
},
|
||||
libre_translate() {
|
||||
return this.$store.state.settings.description.find(setting => setting.key === ':libre_translate')
|
||||
},
|
||||
libretranslateData() {
|
||||
return _.get(this.settings.settings, [':pleroma', ':libre_translate']) || {}
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
<template>
|
||||
<div v-if="!loading" :class="isSidebarOpen" class="form-container">
|
||||
<el-form v-if="!loading" :model="gopherData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="gopher" :data="gopherData"/>
|
||||
<el-form :model="searchData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="search" :data="searchData"/>
|
||||
</el-form>
|
||||
<el-form v-if="isMeilisearch" :model="meilisearchData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="meilisearch" :data="meilisearchData"/>
|
||||
</el-form>
|
||||
<el-form v-if="isElasticsearch" :model="elasticsearchData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="elasticsearch" :data="elasticsearchData"/>
|
||||
</el-form>
|
||||
<div class="submit-button-container">
|
||||
<el-button class="submit-button" type="primary" @click="onSubmit">{{ $t('settings.submit') }}</el-button>
|
||||
|
@ -16,17 +22,35 @@ import Setting from './Setting'
|
|||
import _ from 'lodash'
|
||||
|
||||
export default {
|
||||
name: 'Gopher',
|
||||
name: 'Search',
|
||||
components: { Setting },
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'settings'
|
||||
]),
|
||||
gopher() {
|
||||
return this.settings.description.find(setting => setting.key === ':gopher')
|
||||
search() {
|
||||
return this.settings.description.find(setting => setting.key === 'Pleroma.Search')
|
||||
},
|
||||
gopherData() {
|
||||
return _.get(this.settings.settings, [':pleroma', ':gopher']) || {}
|
||||
searchData() {
|
||||
return _.get(this.settings.settings, [':pleroma', 'Pleroma.Search']) || {}
|
||||
},
|
||||
meilisearch() {
|
||||
return this.settings.description.find(setting => setting.key === 'Pleroma.Search.Meilisearch')
|
||||
},
|
||||
isMeilisearch() {
|
||||
return (_.get(this.settings.settings, [':pleroma', 'Pleroma.Search', ':module']) || '').toLowerCase().endsWith('meilisearch')
|
||||
},
|
||||
meilisearchData() {
|
||||
return _.get(this.settings.settings, [':pleroma', 'Pleroma.Search.Meilisearch']) || {}
|
||||
},
|
||||
elasticsearch() {
|
||||
return this.settings.description.find(setting => setting.key === 'Pleroma.Search.Elasticsearch.Cluster')
|
||||
},
|
||||
isElasticsearch() {
|
||||
return (_.get(this.settings.settings, [':pleroma', 'Pleroma.Search', ':module']) || '').toLowerCase().endsWith('elasticsearch')
|
||||
},
|
||||
elasticsearchData() {
|
||||
return _.get(this.settings.settings, [':pleroma', 'Pleroma.Search.Elasticsearch.Cluster']) || {}
|
||||
},
|
||||
isMobile() {
|
||||
return this.$store.state.app.device === 'mobile'
|
|
@ -4,7 +4,6 @@ export { default as Captcha } from './Captcha'
|
|||
export { default as Emoji } from './Emoji'
|
||||
export { default as Esshd } from './Esshd'
|
||||
export { default as Frontend } from './Frontend'
|
||||
export { default as Gopher } from './Gopher'
|
||||
export { default as Http } from './Http'
|
||||
export { default as Instance } from './Instance'
|
||||
export { default as JobQueue } from './JobQueue'
|
||||
|
@ -18,3 +17,4 @@ export { default as Other } from './Other'
|
|||
export { default as RateLimiters } from './RateLimiters'
|
||||
export { default as Upload } from './Upload'
|
||||
export { default as WebPush } from './WebPush'
|
||||
export { default as Search } from './Search'
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
<template>
|
||||
<div :data-search="setting.key || setting.group" class="rate-limit-container">
|
||||
<div v-if="!rateLimitAuthUsers">
|
||||
<el-input-number
|
||||
:value="rateLimitAllUsers[0]"
|
||||
:controls="false"
|
||||
placeholder="scale"
|
||||
class="scale-input"
|
||||
@input="parseRateLimiter($event, setting.key, 'scale', 'oneLimit', rateLimitAllUsers)"/>
|
||||
<span>:</span>
|
||||
<label>{{ $t('settings.limit') }}:</label>
|
||||
<el-input-number
|
||||
:value="rateLimitAllUsers[1]"
|
||||
:controls="false"
|
||||
placeholder="limit"
|
||||
class="limit-input"
|
||||
@input="parseRateLimiter($event, setting.key, 'limit', 'oneLimit', rateLimitAllUsers)"/>
|
||||
<label>{{ $t('settings.scale') }}:</label>
|
||||
<el-input-number
|
||||
:value="rateLimitAllUsers[0]"
|
||||
:controls="false"
|
||||
placeholder="scale"
|
||||
class="scale-input"
|
||||
@input="parseRateLimiter($event, setting.key, 'scale', 'oneLimit', rateLimitAllUsers)"/>
|
||||
<div class="limit-button-container">
|
||||
<el-button :size="isDesktop ? 'medium' : 'mini'" icon="el-icon-plus" circle @click="toggleLimits([['', ''], ['', '']], setting.key)"/>
|
||||
<p class="expl limit-expl">{{ $t('settings.setLimits') }}</p>
|
||||
|
@ -27,15 +28,7 @@
|
|||
</span>
|
||||
</div>
|
||||
<div class="rate-limit-content">
|
||||
<el-input-number
|
||||
:value="rateLimitUnauthUsers[0]"
|
||||
:controls="false"
|
||||
placeholder="scale"
|
||||
class="scale-input"
|
||||
@input="parseRateLimiter(
|
||||
$event, setting.key, 'scale', 'unauthUsersLimit', [rateLimitUnauthUsers, rateLimitAuthUsers]
|
||||
)"/>
|
||||
<span>:</span>
|
||||
<label>{{ $t('settings.limit') }}:</label>
|
||||
<el-input-number
|
||||
:value="rateLimitUnauthUsers[1]"
|
||||
:controls="false"
|
||||
|
@ -44,6 +37,15 @@
|
|||
@input="parseRateLimiter(
|
||||
$event, setting.key, 'limit', 'unauthUsersLimit', [rateLimitUnauthUsers, rateLimitAuthUsers]
|
||||
)"/>
|
||||
<label>{{ $t('settings.scale') }}:</label>
|
||||
<el-input-number
|
||||
:value="rateLimitUnauthUsers[0]"
|
||||
:controls="false"
|
||||
placeholder="scale"
|
||||
class="scale-input"
|
||||
@input="parseRateLimiter(
|
||||
$event, setting.key, 'scale', 'unauthUsersLimit', [rateLimitUnauthUsers, rateLimitAuthUsers]
|
||||
)"/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item class="rate-limit">
|
||||
|
@ -53,6 +55,14 @@
|
|||
</span>
|
||||
</div>
|
||||
<div class="rate-limit-content">
|
||||
<label>{{ $t('settings.limit') }}:</label>
|
||||
<el-input-number
|
||||
:value="rateLimitAuthUsers[1]"
|
||||
:controls="false"
|
||||
placeholder="limit"
|
||||
class="limit-input"
|
||||
@input="parseRateLimiter($event, setting.key, 'limit', 'authUserslimit', [rateLimitUnauthUsers, rateLimitAuthUsers])"/>
|
||||
<label>{{ $t('settings.scale') }}:</label>
|
||||
<el-input-number
|
||||
:value="rateLimitAuthUsers[0]"
|
||||
:controls="false"
|
||||
|
@ -60,12 +70,6 @@
|
|||
class="scale-input"
|
||||
@input="parseRateLimiter($event, setting.key, 'scale', 'authUserslimit', [rateLimitUnauthUsers, rateLimitAuthUsers])"/>
|
||||
<span>:</span>
|
||||
<el-input-number
|
||||
:value="rateLimitAuthUsers[1]"
|
||||
:controls="false"
|
||||
placeholder="limit"
|
||||
class="limit-input"
|
||||
@input="parseRateLimiter($event, setting.key, 'limit', 'authUserslimit', [rateLimitUnauthUsers, rateLimitAuthUsers])"/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<div class="limit-button-container">
|
||||
|
|
|
@ -8,10 +8,6 @@ export const tabs = description => {
|
|||
label: 'settings.auth',
|
||||
settings: [':auth', ':ldap', ':oauth2', 'Pleroma.Web.Auth.Authenticator']
|
||||
},
|
||||
'esshd': {
|
||||
label: 'settings.esshd',
|
||||
settings: [':esshd']
|
||||
},
|
||||
'captcha': {
|
||||
label: 'settings.captcha',
|
||||
settings: ['Pleroma.Captcha', 'Pleroma.Captcha.Kocaptcha']
|
||||
|
@ -22,11 +18,7 @@ export const tabs = description => {
|
|||
},
|
||||
'frontend': {
|
||||
label: 'settings.frontend',
|
||||
settings: [':assets', ':chat', ':frontends', ':emoji', ':frontend_configurations', ':markup', ':static_fe', 'Pleroma.Web.Preload']
|
||||
},
|
||||
'gopher': {
|
||||
label: 'settings.gopher',
|
||||
settings: [':gopher']
|
||||
settings: [':assets', ':frontends', ':emoji', ':frontend_configurations', ':markup', ':static_fe', 'Pleroma.Web.Preload']
|
||||
},
|
||||
'http': {
|
||||
label: 'settings.http',
|
||||
|
@ -34,7 +26,7 @@ export const tabs = description => {
|
|||
},
|
||||
'instance': {
|
||||
label: 'settings.instance',
|
||||
settings: [':admin_token', ':instance', ':instance_panel', ':instances_favicons', ':welcome', ':manifest', 'Pleroma.User', 'Pleroma.ScheduledActivity', ':uri_schemes', ':feed', ':streamer', ':restrict_unauthenticated']
|
||||
settings: [':admin_token', ':instance', ':instance_panel', ':instances_favicons', ':welcome', ':manifest', 'Pleroma.User', 'Pleroma.ScheduledActivity', ':uri_schemes', ':feed', ':streamer', ':restrict_unauthenticated', ':translator', ':deepl', ':libre_translate']
|
||||
},
|
||||
'job-queue': {
|
||||
label: 'settings.jobQueue',
|
||||
|
@ -76,6 +68,10 @@ export const tabs = description => {
|
|||
label: 'settings.upload',
|
||||
settings: ['Pleroma.Upload.Filter.AnonymizeFilename', 'Pleroma.Upload.Filter.Mogrify', 'Pleroma.Uploaders.S3', 'Pleroma.Uploaders.Local', 'Pleroma.Upload', ':s3']
|
||||
},
|
||||
'search': {
|
||||
label: 'settings.search',
|
||||
settings: ['Pleroma.Search', 'Pleroma.Search.Meilisearch', 'Pleroma.Search.Elasticsearch.Cluster']
|
||||
},
|
||||
'other': {
|
||||
label: 'settings.other',
|
||||
settings: [':mime', 'Pleroma.User.Backup', 'Pleroma.Web.Plugs.RemoteIp', 'Pleroma.Web.Endpoint.MetricsExporter', ':modules', 'Pleroma.Web.ApiSpec.CastAndValidate', ':terms_of_services']
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div class="docs-search-container">
|
||||
<el-link
|
||||
:underline="false"
|
||||
href="https://docs-develop.pleroma.social/backend/administration/CLI_tasks/config/"
|
||||
href="https://docs.akkoma.dev/stable/administration/CLI_tasks/config/"
|
||||
target="_blank">
|
||||
<el-button class="settings-docs-button">
|
||||
<span>
|
||||
|
@ -71,7 +71,6 @@ import {
|
|||
Emoji,
|
||||
Esshd,
|
||||
Frontend,
|
||||
Gopher,
|
||||
Http,
|
||||
Instance,
|
||||
JobQueue,
|
||||
|
@ -84,6 +83,7 @@ import {
|
|||
Other,
|
||||
RateLimiters,
|
||||
Upload,
|
||||
Search,
|
||||
WebPush
|
||||
} from './components'
|
||||
import RebootButton from '@/components/RebootButton'
|
||||
|
@ -96,7 +96,6 @@ export default {
|
|||
Emoji,
|
||||
Esshd,
|
||||
Frontend,
|
||||
Gopher,
|
||||
Http,
|
||||
Instance,
|
||||
JobQueue,
|
||||
|
@ -110,6 +109,7 @@ export default {
|
|||
RateLimiters,
|
||||
RebootButton,
|
||||
Upload,
|
||||
Search,
|
||||
WebPush
|
||||
},
|
||||
data() {
|
||||
|
|
|
@ -162,7 +162,7 @@
|
|||
margin-left: 10px;
|
||||
}
|
||||
.limit-input {
|
||||
width: 47%;
|
||||
width: 27%;
|
||||
margin: 0 0 5px 1%
|
||||
}
|
||||
.line {
|
||||
|
@ -492,7 +492,7 @@
|
|||
margin-left: 15px;
|
||||
}
|
||||
.limit-input {
|
||||
width: 45%;
|
||||
width: 27%;
|
||||
}
|
||||
.proxy-url-input {
|
||||
flex-direction: column;
|
||||
|
|
|
@ -110,40 +110,6 @@
|
|||
:visible="securitySettingsModalVisible"
|
||||
@close="securitySettingsModalVisible = false" />
|
||||
</el-card>
|
||||
<el-card class="user-chats-card">
|
||||
<h2 class="chats">{{ $t('userProfile.chats') }}</h2>
|
||||
<div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition el-table--medium">
|
||||
<table class="user-chats-table">
|
||||
<tbody v-if="!chatsLoading" class="chats">
|
||||
<tr v-if="chats.length === 0" class="no-statuses">
|
||||
{{ $t('userProfile.noChats') }}
|
||||
</tr>
|
||||
<tr v-for="chat in chats" :key="chat.id" class="el-table__row chat-item">
|
||||
<td>
|
||||
<router-link
|
||||
v-if="propertyExists(chat, 'id')"
|
||||
:to="{ name: 'ChatsShow', params: { id: chat.id }}"
|
||||
class="router-link">
|
||||
<div class="chat-card-header">
|
||||
<img v-if="propertyExists(chat.receiver, 'avatar')" :src="chat.receiver.avatar" class="chat-avatar-img">
|
||||
<span v-if="propertyExists(chat.receiver, 'username')" class="chat-account-name">{{ chat.receiver.username }}</span>
|
||||
<span v-else>
|
||||
<span v-if="propertyExists(chat.receiver, 'username')" class="chat-account-name">
|
||||
{{ chat.receiver.username }}
|
||||
</span>
|
||||
<span v-else class="chat-account-name deactivated">({{ $t('users.invalidNickname') }})</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="chat-card-preview">
|
||||
<span v-if="propertyExists(chat, 'last_message')" class="chat-preview">{{ chat.last_message.content }}</span>
|
||||
</div>
|
||||
</router-link>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<div class="recent-statuses-container">
|
||||
<h2 class="recent-statuses">{{ $t('userProfile.recentStatuses') }}</h2>
|
||||
|
@ -197,12 +163,6 @@ export default {
|
|||
statusesLoading() {
|
||||
return this.$store.state.userProfile.statusesLoading
|
||||
},
|
||||
chats() {
|
||||
return this.$store.state.userProfile.chats
|
||||
},
|
||||
chatsLoading() {
|
||||
return this.$store.state.userProfile.chatsLoading
|
||||
},
|
||||
user() {
|
||||
return this.$store.state.userProfile.user
|
||||
},
|
||||
|
@ -369,11 +329,6 @@ table {
|
|||
width: auto;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.user-chats-card {
|
||||
width: auto;
|
||||
height: fit-content;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.user-profile-container {
|
||||
display: flex;
|
||||
}
|
||||
|
@ -381,9 +336,6 @@ table {
|
|||
margin: 0;
|
||||
width: inherit;
|
||||
}
|
||||
.user-chats-table {
|
||||
width: 100%;
|
||||
}
|
||||
.user-profile-tag {
|
||||
margin: 0 4px 4px 0;
|
||||
}
|
||||
|
@ -392,27 +344,6 @@ table {
|
|||
font-weight: bold;
|
||||
margin: 5px 0;
|
||||
}
|
||||
.chat-card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chat-avatar-img {
|
||||
display: inline-block;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.chat-account-name {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.chat-card-preview {
|
||||
color: gray;
|
||||
font-style: italic;
|
||||
margin: 5px 0 0 20px;
|
||||
}
|
||||
|
||||
@media only screen and (max-width:480px) {
|
||||
.avatar-name-container {
|
||||
|
@ -451,7 +382,7 @@ table {
|
|||
margin: 0 15px 15px 10px;
|
||||
}
|
||||
}
|
||||
.user-profile-card, .user-chats-card {
|
||||
.user-profile-card {
|
||||
margin: 0 10px 20px;
|
||||
width: 95%;
|
||||
td {
|
||||
|
|
|
@ -274,20 +274,6 @@ describe('Parse tuples', () => {
|
|||
expect(_.isEqual(expectedSenderString, parseTuples(senderString, ':welcome'))).toBeTruthy()
|
||||
})
|
||||
|
||||
it('parses proxy_url', () => {
|
||||
const proxyUrlNull = [{ tuple: [':proxy_url', null] }]
|
||||
const proxyUrlTuple = [{ tuple: [':proxy_url', { tuple: [':socks5', ':localhost', 3090] }]}]
|
||||
const proxyUrlString = [{ tuple: [':proxy_url', 'localhost:9020'] }]
|
||||
|
||||
const expectedProxyUrlNull = { ':proxy_url': { socks5: false, host: null, port: null }}
|
||||
const expectedProxyUrlTuple = { ':proxy_url': { socks5: true, host: ':localhost', port: 3090 }}
|
||||
const expectedProxyUrlString = { ':proxy_url': { socks5: false, host: 'localhost', port: '9020' }}
|
||||
|
||||
expect(_.isEqual(expectedProxyUrlNull, parseTuples(proxyUrlNull, ':http'))).toBeTruthy()
|
||||
expect(_.isEqual(expectedProxyUrlTuple, parseTuples(proxyUrlTuple, ':http'))).toBeTruthy()
|
||||
expect(_.isEqual(expectedProxyUrlString, parseTuples(proxyUrlString, ':http'))).toBeTruthy()
|
||||
})
|
||||
|
||||
it('parses args setting in Pleroma.Upload.Filter.Mogrify', () => {
|
||||
const tuples = [{ tuple: [':args', ['strip', '{ "implode", "1" }']]}]
|
||||
const expectedResult = { ':args': ['strip', '{ "implode", "1" }'] }
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
import Vuex from 'vuex'
|
||||
import { mount, createLocalVue, config } from '@vue/test-utils'
|
||||
import flushPromises from 'flush-promises'
|
||||
import Element from 'element-ui'
|
||||
import ChatShow from '@/views/chats/show'
|
||||
import { storeConfig } from './store.conf'
|
||||
import { cloneDeep } from 'lodash'
|
||||
|
||||
config.mocks["$t"] = () => {}
|
||||
|
||||
const localVue = createLocalVue()
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Element)
|
||||
|
||||
const $route = {
|
||||
params: {
|
||||
id: '9y8e7ESoVUiKVMAoCW'
|
||||
}
|
||||
}
|
||||
|
||||
jest.mock('@/api/nodeInfo')
|
||||
jest.mock('@/api/chat')
|
||||
|
||||
describe('Chat view', () => {
|
||||
let store
|
||||
|
||||
beforeEach(() => {
|
||||
store = new Vuex.Store(cloneDeep(storeConfig))
|
||||
})
|
||||
|
||||
it('fetches chat messages', async (done) => {
|
||||
const wrapper = mount(ChatShow, {
|
||||
store,
|
||||
localVue,
|
||||
sync: false,
|
||||
stubs: ['router-link'],
|
||||
mocks: {
|
||||
$route
|
||||
}
|
||||
})
|
||||
|
||||
await flushPromises()
|
||||
expect(wrapper.find('.message-card').isVisible()).toBe(true)
|
||||
expect(wrapper.find('.chat-particiants-sender').isVisible()).toBe(true)
|
||||
expect(wrapper.find('.chat-particiants-receiver').isVisible()).toBe(true)
|
||||
expect(store.state.chat.fetchedChat.receiver.acct).toBe('test10')
|
||||
expect(store.state.chat.fetchedChatMessages[0].chat_id).toBe('9y8e7ESoVUiKVMAoCW')
|
||||
expect(store.state.chat.maxId).toBe(null)
|
||||
done()
|
||||
})
|
||||
})
|
|
@ -1,25 +0,0 @@
|
|||
import app from '@/store/modules/app'
|
||||
import settings from '@/store/modules/settings'
|
||||
import user from '@/store/modules/user'
|
||||
import chat from '@/store/modules/chat'
|
||||
import getters from '@/store/getters'
|
||||
|
||||
export const storeConfig = {
|
||||
modules: {
|
||||
app,
|
||||
settings,
|
||||
user,
|
||||
chat
|
||||
},
|
||||
getters
|
||||
}
|
||||
|
||||
export const storeWithTagPolicy = {
|
||||
modules: {
|
||||
app,
|
||||
settings,
|
||||
user,
|
||||
chat
|
||||
},
|
||||
getters
|
||||
}
|
|
@ -276,7 +276,7 @@ describe('Users actions', () => {
|
|||
|
||||
expect(wrapper.vm.resetPasswordDialogOpen).toBe(true)
|
||||
expect(store.state.users.passwordResetToken.token).toBe('g05lxnBJQnL')
|
||||
expect(store.state.users.passwordResetToken.link).toBe('http://url/api/pleroma/password_reset/g05lxnBJQnL')
|
||||
expect(store.state.users.passwordResetToken.link).toBe('http://url/api/v1/pleroma/password_reset/g05lxnBJQnL')
|
||||
|
||||
closeDialogButton.trigger('click')
|
||||
await flushPromises()
|
||||
|
|
Loading…
Reference in a new issue