Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
les
gancio
Commits
807f74c4
Commit
807f74c4
authored
May 22, 2020
by
les
Browse files
ask before remove friendly instance
parent
f0624b14
Changes
1
Hide whitespace changes
Inline
Side-by-side
components/admin/Federation.vue
View file @
807f74c4
...
...
@@ -46,7 +46,7 @@
</
template
>
<
script
>
import
{
mapActions
,
mapState
}
from
'
vuex
'
import
{
Message
}
from
'
element-ui
'
import
{
Message
,
MessageBox
}
from
'
element-ui
'
import
axios
from
'
axios
'
export
default
{
...
...
@@ -81,9 +81,7 @@ export default {
...
mapActions
([
'
setSetting
'
]),
async
createTrustedInstance
()
{
try
{
const
instance
=
await
axios
.
get
(
`
${
this
.
instance_url
}
/.well-known/nodeinfo/2.1`
)
console
.
error
(
instance
)
const
instance
=
await
axios
.
get
(
`
${
this
.
instance_url
}
/.well-known/nodeinfo/2.1`
)
this
.
setSetting
({
key
:
'
trusted_instances
'
,
value
:
this
.
settings
.
trusted_instances
.
concat
({
...
...
@@ -101,10 +99,18 @@ export default {
})
}
},
async
deleteInstance
(
instance
)
{
await
this
.
setSetting
({
key
:
'
trusted_instances
'
,
value
:
this
.
settings
.
trusted_instances
.
filter
(
i
=>
i
.
url
!==
instance
.
url
)
deleteInstance
(
instance
)
{
MessageBox
.
confirm
(
this
.
$t
(
'
admin.delete_trusted_instance_confirm
'
),
this
.
$t
(
'
common.confirm
'
),
{
confirmButtonText
:
this
.
$t
(
'
common.ok
'
),
cancelButtonText
:
this
.
$t
(
'
common.cancel
'
),
type
:
'
error
'
}
).
then
(()
=>
{
this
.
setSetting
({
key
:
'
trusted_instances
'
,
value
:
this
.
settings
.
trusted_instances
.
filter
(
i
=>
i
.
url
!==
instance
.
url
)
})
})
},
save
(
key
,
value
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment