Skip to content

Commit

Permalink
feat: Add link to the Docs for Unauthorized connections
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou committed Oct 26, 2024
1 parent 3604c67 commit 66f2bf2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/TheConnectingDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<v-divider class="mt-4 mb-5" />
</template>
<div class="text-center mt-3">
<v-btn v-if="helpButtonUrl" class="text--disabled mr-3" :href="helpButtonUrl" target="_blank">
<v-icon left>{{ mdiHelp }}</v-icon>
{{ $t('ConnectionDialog.Help') }}
</v-btn>
<v-btn class="primary--text" @click="reconnect">{{ $t('ConnectionDialog.TryAgain') }}</v-btn>
</div>
</v-card-text>
Expand All @@ -35,7 +39,7 @@ import BaseMixin from '@/components/mixins/base'
import ThemeMixin from '@/components/mixins/theme'
import ConnectionStatus from '@/components/ui/ConnectionStatus.vue'
import { mdiConnection } from '@mdi/js'
import { mdiConnection, mdiHelp } from '@mdi/js'
@Component({
components: {
Expand All @@ -44,6 +48,7 @@ import { mdiConnection } from '@mdi/js'
})
export default class TheConnectingDialog extends Mixins(BaseMixin, ThemeMixin) {
mdiConnection = mdiConnection
mdiHelp = mdiHelp
counter = 0
Expand Down Expand Up @@ -89,6 +94,12 @@ export default class TheConnectingDialog extends Mixins(BaseMixin, ThemeMixin) {
return this.$store.state.socket.connectionFailedMessage ?? null
}
get helpButtonUrl() {
if (!this.$store.state.socket.connectionFailedMessage) return null
return `https://docs.mainsail.xyz/faq/mainsail_errors/connection-${this.connectionFailedMessage?.toLowerCase()}`
}
reconnect() {
this.counter++
this.$store.dispatch('socket/setData', { connectingFailed: false })
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
"Connecting": "Connecting to {host}",
"ErrorMessage": "Error message: {message}",
"Failed": "Connection failed",
"Help": "Help",
"Initializing": "Initializing",
"TryAgain": "try again"
},
Expand Down

0 comments on commit 66f2bf2

Please sign in to comment.