Commit 0d036eb7 authored by les's avatar les
Browse files

fix trusted instances

parent e87cbbad
......@@ -3,6 +3,22 @@
v-btn(color='primary' text href='https://gancio.org') Gancio {{settings.version}}
v-btn(v-for='link in settings.footerLinks'
:key='link.label' color='primary' text :href='link.href') {{link.label}}
v-menu(v-if='settings.enable_trusted_instances && settings.trusted_instances && settings.trusted_instances.length'
offset-y bottom open-on-hover transition="slide-y-transition")
template(v-slot:activator="{ on, attrs }")
v-btn(v-bind='attrs' v-on='on' color='primary' text) {{$t('common.places')}}
v-list
v-list-item(v-for='instance in settings.trusted_instances'
:key='instance.name'
:href='instance.url'
two-line)
v-list-item-avatar
v-img(:src='`${instance.url}/favicon.ico`')
v-list-item-content
v-list-item-title {{instance.name}}
v-list-item-subtitle {{instance.label}}
//- v-btn(v-if='settings.enable_federation' text rel='me' @click.prevent='showFollowMe=true') follow me
//- v-btn(nuxt to='/about' text) about
//- v-btn(href='https://blog.gancio.org' text) blog
......
......@@ -112,8 +112,11 @@ export default {
methods: {
...mapActions(['setSetting']),
async createTrustedInstance () {
if (!this.$refs.form.validate()) return
if (!this.$refs.form.validate()) { return }
try {
if (!this.instance_url.startsWith('http')) {
this.instance_url = `https://${this.instance_url}`
}
const instance = await axios.get(`${this.instance_url}/.well-known/nodeinfo/2.1`)
this.setSetting({
key: 'trusted_instances',
......@@ -123,7 +126,8 @@ export default {
label: instance.data.metadata.nodeLabel
})
})
this.instance_url = ''
this.$refs.form.reset()
this.dialogAddInstance = false
} catch (e) {
this.$root.$message(e, { color: 'error' })
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment