mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
check if I'm reachable to myself to help in #298
This commit is contained in:
parent
829de697f2
commit
98c56b6d32
3 changed files with 16 additions and 2 deletions
|
@ -3,6 +3,8 @@ v-container.container.pa-0.pa-md-3
|
|||
v-card
|
||||
v-alert(v-if='url!==settings.baseurl' outlined type='warning' show-icon :icon='mdiAlert')
|
||||
span(v-html="$t('admin.wrong_domain_warning', { url, baseurl: settings.baseurl })")
|
||||
v-alert(v-if='!selfReachable' outlined type='warning' show-icon :icon='mdiAlert')
|
||||
span(v-html="$t('admin.not_reachable')")
|
||||
v-tabs(v-model='selectedTab' show-arrows :next-icon='mdiChevronRight' :prev-icon='mdiChevronLeft')
|
||||
|
||||
//- SETTINGS
|
||||
|
@ -101,9 +103,10 @@ export default {
|
|||
try {
|
||||
const users = await $axios.$get('/users')
|
||||
const unconfirmedEvents = await $axios.$get('/event/unconfirmed')
|
||||
return { users, unconfirmedEvents, url }
|
||||
const selfReachable = await $axios.$get('/reachable')
|
||||
return { users, unconfirmedEvents, url, selfReachable }
|
||||
} catch (e) {
|
||||
return { users: [], unconfirmedEvents: [], url }
|
||||
return { users: [], unconfirmedEvents: [], url, selfReachable: false }
|
||||
}
|
||||
},
|
||||
data () {
|
||||
|
@ -112,6 +115,7 @@ export default {
|
|||
users: [],
|
||||
description: '',
|
||||
unconfirmedEvents: [],
|
||||
selfReachable: false
|
||||
}
|
||||
},
|
||||
head () {
|
||||
|
|
|
@ -71,6 +71,7 @@ module.exports = () => {
|
|||
```
|
||||
*/
|
||||
api.get('/ping', (_req, res) => res.sendStatus(200))
|
||||
api.get('/reachable', helpers.reachable)
|
||||
api.get('/user', isAuth, (req, res) => res.json(req.user))
|
||||
|
||||
api.post('/user/recover', SPAMProtectionApiRateLimiter, userController.forgotPassword)
|
||||
|
|
|
@ -287,6 +287,15 @@ module.exports = {
|
|||
next()
|
||||
},
|
||||
|
||||
async reachable(req, res) {
|
||||
try {
|
||||
const response = await axios({ url: config.baseurl })
|
||||
return res.sendStatus(200)
|
||||
} catch(e) {
|
||||
return res.status(400).json(e)
|
||||
}
|
||||
},
|
||||
|
||||
async isGeocodingEnabled(req, res, next) {
|
||||
if (res.locals.settings.allow_geolocation) {
|
||||
next()
|
||||
|
|
Loading…
Reference in a new issue