diff --git a/frontend/src/App.vue b/frontend/src/App.vue index b464a74..ec30545 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -6,6 +6,12 @@

{{$t("warning")}}

{{$t("connection_error")}}

+
@@ -65,8 +71,16 @@ export default { report: '', sending_report: false, connect_dev: undefined, + backendSuggestions: [ + { name: 'Bang Xamin', url: 'https://bang.xamin.it' }, + { name: 'Bang Miga', url: 'https://bang.migani.synology.me/' }, + { name: 'Localhost', url: 'http://localhost:5001' }, + ], }), computed: { + shouldShowBackendSuggestions() { + return window.location.origin.indexOf('vercel') !== -1 || window.location.origin.indexOf('localhost') !== -1 + }, }, sockets: { connect() { @@ -100,6 +114,11 @@ export default { // Send message to SW to skip the waiting and activate the new SW this.registration.waiting.postMessage({ type: 'SKIP_WAITING' }) }, + changeBackend(suggestion) { + this.$socket.disconnect(); + window.localStorage.setItem('connect-dev', suggestion.url); + window.location.reload(); + }, resetConnection() { this.$socket.disconnect(); window.localStorage.removeItem('connect-dev');