Files
mainsail/src/components/TheConnectingDialog.vue
T
steadyjaw 8a4a4ce234 refactor: button overhaul and minor changes to the ui (#413)
* refactor(appbar): change buttons to new design

* refactor(appbar): change height and add pritnername

* refactor: small sidebar

* refactor(vuetify): define parts of the mainsail theme and expose colors to css

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor: ui settings add missing divider

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor: add farm printer selection and menu to new top and sidebar, added icons to version-tooltip

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor: make topbar buttons hideable via ui settings

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor: move miniConsole buttons to toolbar and make'em collapsible

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor: set matching colors for buttons on console page

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor: use colornames from theme and set play/resume button to green

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* fix: correct visibility of hide buttons on collapse

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* feature: add virtual tab button to console-input on touch devices

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor: remove hide e-stop button setting

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* fix: add reactivity to hide upload and print button functionality

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor: move logo to topbar and clip menu under topbar

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor: remove unused TheSidebarPrinterMenu

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* feature: create and add about component to sidebar ...no dialog on click yet

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* fix: correct appearance of the close icon from interface settings dialog

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* Revert "fix: correct appearance of the close icon from interface settings dialog"

This reverts commit f66e29d4f2.

* refactor: close ui settings on ESC and change close icon to tile

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor: change font style in wide sidebar and extend width of wide menu

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor: change menu style ui-settings-entry to dropdown

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor: correct variablenames in locales

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor: re-do menuStyle setting implementation

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor(miniconsole): change collapse button to tile and remove empty cols and row in template

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor: gui variables and button appearance in toolbars

* move some vars to configure gui appearance to variables.ts

* force buttons in bars to 100% height

* set icon button width to toolbar-heigth

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor(heightmap): add autofocus and close on ESC to dialogs

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor(throttledStates): bigger dropdownlist in favor of readability

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor(confFiles): change imageviewer topbar to darkcolor and move close button to left

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* fix: camera-dropdown visability condition

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor(history): ad close on ESC on dialogs

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* refactor: button overhaul

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* fix: correct navigation width and change variablenames

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>

* fix: change more close buttons to tiles

Signed-off-by: steadyjaw <martin.keilaus@gmail.com>
2021-11-19 21:07:22 +01:00

94 lines
3.0 KiB
Vue

<style scoped>
</style>
<template>
<v-dialog v-model="showDialog" persistent :width="400">
<v-card dark>
<v-toolbar flat dense>
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-connection" left></v-icon>
<template v-if="connectingFailed">{{ $t("ConnectionDialog.Failed", {'host': formatHostname}) }}</template>
<template v-else-if="isConnecting">{{ $t("ConnectionDialog.Connecting", {'host': formatHostname}) }}</template>
<template v-else>{{ formatHostname }}</template>
</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="pt-5" v-if="isConnecting">
<v-progress-linear color="white" indeterminate></v-progress-linear>
</v-card-text>
<v-card-text class="pt-5" v-if="!isConnecting && connectingFailed">
<connection-status :moonraker="false"></connection-status>
<p class="text-center mt-3">{{ $t("ConnectionDialog.CannotConnectTo", {'host': formatHostname}) }}</p>
<template v-if="counter > 2">
<v-divider class="my-3"></v-divider>
<p>{{ $t("ConnectionDialog.CheckMoonrakerLog") }}</p>
<ul>
<li>~/klipper_logs/moonraker.log</li>
<li>/tmp/moonraker.log</li>
</ul>
<v-divider class="mt-4 mb-5"></v-divider>
</template>
<div class="text-center">
<v-btn @click="reconnect" class="primary--text">{{ $t("ConnectionDialog.TryAgain") }}</v-btn>
</div>
</v-card-text>
</v-card>
</v-dialog>
</template>
<script lang="ts">
import Component from 'vue-class-component'
import { Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import ConnectionStatus from '@/components/ui/ConnectionStatus.vue'
@Component({
components: {
ConnectionStatus,
}
})
export default class TheUpdateDialog extends Mixins(BaseMixin) {
counter = 0
get protocol() {
return this.$store.state.socket.protocol
}
get hostname() {
return this.$store.state.socket.hostname
}
get port() {
return this.$store.state.socket.port
}
get formatHostname() {
return parseInt(this.port) !== 80 && this.port !== '' ? this.hostname+':'+this.port : this.hostname
}
get isConnected() {
return this.$store.state.socket.isConnected
}
get isConnecting() {
return this.$store.state.socket.isConnecting
}
get connectingFailed() {
return this.$store.state.socket.connectingFailed
}
get showDialog() {
return !this.isConnected
}
reconnect() {
this.counter++
this.$store.dispatch('socket/setData', { connectingFailed: false })
this.$socket.connect()
}
}
</script>