mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +01:00
fix trusted instances
This commit is contained in:
parent
e87cbbad88
commit
0d036eb707
2 changed files with 22 additions and 2 deletions
|
@ -3,6 +3,22 @@
|
||||||
v-btn(color='primary' text href='https://gancio.org') Gancio {{settings.version}}
|
v-btn(color='primary' text href='https://gancio.org') Gancio {{settings.version}}
|
||||||
v-btn(v-for='link in settings.footerLinks'
|
v-btn(v-for='link in settings.footerLinks'
|
||||||
:key='link.label' color='primary' text :href='link.href') {{link.label}}
|
: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(v-if='settings.enable_federation' text rel='me' @click.prevent='showFollowMe=true') follow me
|
||||||
//- v-btn(nuxt to='/about' text) about
|
//- v-btn(nuxt to='/about' text) about
|
||||||
//- v-btn(href='https://blog.gancio.org' text) blog
|
//- v-btn(href='https://blog.gancio.org' text) blog
|
||||||
|
|
|
@ -112,8 +112,11 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['setSetting']),
|
...mapActions(['setSetting']),
|
||||||
async createTrustedInstance () {
|
async createTrustedInstance () {
|
||||||
if (!this.$refs.form.validate()) return
|
if (!this.$refs.form.validate()) { return }
|
||||||
try {
|
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`)
|
const instance = await axios.get(`${this.instance_url}/.well-known/nodeinfo/2.1`)
|
||||||
this.setSetting({
|
this.setSetting({
|
||||||
key: 'trusted_instances',
|
key: 'trusted_instances',
|
||||||
|
@ -123,7 +126,8 @@ export default {
|
||||||
label: instance.data.metadata.nodeLabel
|
label: instance.data.metadata.nodeLabel
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.instance_url = ''
|
this.$refs.form.reset()
|
||||||
|
this.dialogAddInstance = false
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.$root.$message(e, { color: 'error' })
|
this.$root.$message(e, { color: 'error' })
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue