Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zwordi
funkwhale
Commits
378572d8
Verified
Commit
378572d8
authored
6 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Enabled instance policies on actors
parent
bb1d5e4c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
front/src/views/admin/moderation/AccountsDetail.vue
+85
-19
85 additions, 19 deletions
front/src/views/admin/moderation/AccountsDetail.vue
with
85 additions
and
19 deletions
front/src/views/admin/moderation/AccountsDetail.vue
+
85
−
19
View file @
378572d8
...
...
@@ -5,26 +5,68 @@
</div>
<template
v-if=
"object"
>
<section
:class=
"['ui', 'head', 'vertical', 'stripe', 'segment']"
v-title=
"object.full_username"
>
<div
class=
"segment-content"
>
<h2
class=
"ui header"
>
<i
class=
"circular inverted user icon"
></i>
<div
class=
"content"
>
{{
object
.
full_username
}}
<div
class=
"sub header"
>
<template
v-if=
"object.user"
>
<span
class=
"ui tiny teal icon label"
>
<i
class=
"home icon"
></i>
<translate>
Local account
</translate>
</span>
</
template
>
<a
:href=
"object.url || object.fid"
target=
"_blank"
rel=
"noopener noreferrer"
>
<translate>
Open profile
</translate>
<i
class=
"external icon"
></i>
</a>
</div>
<div
class=
"ui stackable two column grid"
>
<div
class=
"ui column"
>
<div
class=
"segment-content"
>
<h2
class=
"ui header"
>
<i
class=
"circular inverted user icon"
></i>
<div
class=
"content"
>
{{
object
.
full_username
}}
<div
class=
"sub header"
>
<template
v-if=
"object.user"
>
<span
class=
"ui tiny teal icon label"
>
<i
class=
"home icon"
></i>
<translate>
Local account
</translate>
</span>
</
template
>
<a
:href=
"object.url || object.fid"
target=
"_blank"
rel=
"noopener noreferrer"
>
<translate>
Open profile
</translate>
<i
class=
"external icon"
></i>
</a>
</div>
</div>
</h2>
</div>
</div>
<div
class=
"ui column"
>
<div
v-if=
"!object.user"
class=
"ui compact clearing placeholder segment"
>
<
template
v-if=
"isLoadingPolicy"
>
<div
class=
"paragraph"
>
<div
class=
"line"
></div>
<div
class=
"line"
></div>
<div
class=
"line"
></div>
<div
class=
"line"
></div>
<div
class=
"line"
></div>
</div>
</
template
>
<
template
v-else-if=
"!policy && !showPolicyForm"
>
<header
class=
"ui header"
>
<h3>
<i
class=
"shield icon"
></i>
<translate>
You don't have any rule in place for this account.
</translate>
</h3>
</header>
<p><translate>
Moderation policies help you control how your instance interact with a given domain or account.
</translate></p>
<button
@
click=
"showPolicyForm = true"
class=
"ui primary button"
>
Add a moderation policy
</button>
</
template
>
<instance-policy-card
v-else-if=
"policy && !showPolicyForm"
:object=
"policy"
@
update=
"showPolicyForm = true"
>
<header
class=
"ui header"
>
<h3>
<translate>
This domain is subject to specific moderation rules
</translate>
</h3>
</header>
</instance-policy-card>
<instance-policy-form
v-else-if=
"showPolicyForm"
@
cancel=
"showPolicyForm = false"
@
save=
"updatePolicy"
@
delete=
"policy = null; showPolicyForm = false"
:object=
"policy"
type=
"actor"
:target=
"object.full_username"
/>
</div>
</
h2
>
</
div
>
</div>
</section>
<div
class=
"ui vertical stripe segment"
>
...
...
@@ -309,15 +351,24 @@ import logger from "@/logging"
import
lodash
from
'
@/lodash
'
import
$
from
"
jquery
"
import
InstancePolicyForm
from
"
@/components/manage/moderation/InstancePolicyForm
"
import
InstancePolicyCard
from
"
@/components/manage/moderation/InstancePolicyCard
"
export
default
{
props
:
[
"
id
"
],
components
:
{
InstancePolicyForm
,
InstancePolicyCard
,
},
data
()
{
return
{
lodash
,
isLoading
:
true
,
isLoadingStats
:
false
,
isLoadingPolicy
:
false
,
object
:
null
,
stats
:
null
,
showPolicyForm
:
false
,
permissions
:
[],
}
},
...
...
@@ -333,6 +384,9 @@ export default {
axios
.
get
(
url
).
then
(
response
=>
{
self
.
object
=
response
.
data
self
.
isLoading
=
false
if
(
self
.
object
.
instance_policy
)
{
self
.
fetchPolicy
(
self
.
object
.
instance_policy
)
}
if
(
response
.
data
.
user
)
{
self
.
allPermissions
.
forEach
(
p
=>
{
if
(
self
.
object
.
user
.
permissions
[
p
.
code
])
{
...
...
@@ -342,6 +396,15 @@ export default {
}
})
},
fetchPolicy
(
id
)
{
var
self
=
this
this
.
isLoadingPolicy
=
true
let
url
=
`manage/moderation/instance-policies/
${
id
}
/`
axios
.
get
(
url
).
then
(
response
=>
{
self
.
policy
=
response
.
data
self
.
isLoadingPolicy
=
false
})
},
fetchStats
()
{
var
self
=
this
this
.
isLoadingStats
=
true
...
...
@@ -423,4 +486,7 @@ export default {
<!-- Add "scoped" attribute to limit CSS to this component only -->
<
style
scoped
>
.placeholder.segment
{
width
:
100%
;
}
</
style
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment