Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add link to the Docs for Unauthorized connections #2035

Merged
merged 2 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading