Skip to content

Commit

Permalink
feat: Add link to the Docs for Unauthorized connections (#2035)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored Oct 26, 2024
1 parent 3604c67 commit 0302094
Show file tree
Hide file tree
Showing 3 changed files with 14 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/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
"CheckMoonrakerLog": "Wenn diese Meldung wiederholt erscheint, schaue bitte in die Logdatei unter:",
"Connecting": "Verbinde zu {host}",
"Failed": "Verbindung fehlgeschlagen",
"Help": "Hilfe",
"Initializing": "Initialisieren",
"TryAgain": "Erneut versuchen"
},
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 0302094

Please sign in to comment.