Skip to content

Commit

Permalink
[Automated] Merged develop into target master
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored Aug 12, 2023
2 parents 1b763e2 + b0491de commit c9dc251
Show file tree
Hide file tree
Showing 38 changed files with 1,273 additions and 618 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@
# Changelog
All notable changes to Mainsail will be documented in this file.

## [2.6.2](https://github.com/mainsail-crew/mainsail/releases/tag/v2.6.2) - 2023-07-30
### Bug Fixes and Improvements

- Fix editor save & restart button behavior (#1483) | [8447be2](8447be2ecee64fa4a3c0211ac57f42c3adf1d050)
- Hide rpm in temperature_fans without tachometer_pin (#1489) | [e929c7c](e929c7cc0f45074f40407420b3585d9c02284fa1)
- Fix flip function in several webcam clients (#1487) | [5c40820](5c4082010890e0b341754f42673affe7d1ca9d99)
- Fix issue with camel-case object names in temperature panel (#1491) | [aeee198](aeee1982398acca803f7f4eae7b7b39a29253179)
- Use webcam name instead of UUID for timelapse plugin (#1492) | [d67ef3a](d67ef3aa908601b6bb87353957bcc97ea4f829ea)
- Fix issue with create/edit presets and refactor settings (#1499) | [6a4cca7](6a4cca751c88e89ddf5f2cc0f09a58f097a461af)
- Fix multiple issues in the refactored update manager (#1497) | [9eb133b](9eb133bd85530ac08416e94f02ebe19f060bc095)
- Fix issue with cannot extrude after a Klipper restart (#1495) | [cda3098](cda3098c9e09a054aa7baa69a3195e0a73f43e54)

### Refactor

- Refactor SettingsRow (#1484) | [0b47a80](0b47a80b133e6093aecdb0d7d87b718899dff0c7)

### Localization

- **pl**: Update Polish translation (#1482) | [0c5aca8](0c5aca8baffb65198f43a7d3b2b57571d8e911c9)
- **zh**: Update chinese locale (#1486) | [7251a8c](7251a8c6bae2b92395de4c8c23e8e8e3900df66a)

## [2.6.1](https://github.com/mainsail-crew/mainsail/releases/tag/v2.6.1) - 2023-07-24
### Bug Fixes and Improvements

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mainsail",
"version": "2.6.2",
"version": "2.7.0",
"private": true,
"decription": "a klipper web interface",
"author": {
Expand Down
79 changes: 46 additions & 33 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,37 +1,11 @@
<style>
@import './assets/styles/fonts.css';
@import './assets/styles/toastr.css';
@import './assets/styles/page.scss';
@import './assets/styles/sidebar.scss';
@import './assets/styles/utils.scss';
@import './assets/styles/updateManager.scss';
:root {
--app-height: 100%;
}
#content {
background-attachment: fixed;
background-size: cover;
background-repeat: no-repeat;
}
/*noinspection CssUnusedSymbol*/
.v-btn:not(.v-btn--outlined).primary {
/*noinspection CssUnresolvedCustomProperty*/
color: var(--v-btn-text-primary);
}
</style>

<template>
<v-app dark :style="cssVars">
<template v-if="socketIsConnected && guiIsReady">
<the-sidebar></the-sidebar>
<the-topbar></the-topbar>

<the-sidebar />
<the-topbar />
<v-main id="content" :style="mainStyle">
<v-container id="page-container" fluid class="container px-3 px-sm-6 py-sm-6 mx-auto">
<router-view></router-view>
<router-view />
</v-container>
</v-main>
<the-service-worker />
Expand All @@ -44,8 +18,8 @@
<the-bed-screws-dialog />
<the-screws-tilt-adjust-dialog />
</template>
<the-select-printer-dialog v-else-if="instancesDB !== 'moonraker'"></the-select-printer-dialog>
<the-connecting-dialog v-else></the-connecting-dialog>
<the-select-printer-dialog v-else-if="instancesDB !== 'moonraker'" />
<the-connecting-dialog v-else />
</v-app>
</template>

Expand Down Expand Up @@ -105,13 +79,27 @@ export default class App extends Mixins(BaseMixin) {
return this.$store.getters['files/getMainBackground']
}
get naviDrawer(): boolean {
return this.$store.state.naviDrawer
}
get navigationStyle() {
return this.$store.state.gui.uiSettings.navigationStyle
}
get mainStyle() {
let style = ''
let style: any = {
paddingLeft: '0',
}
if (this.mainBackground !== null) {
style = 'background-image: url(' + this.mainBackground + ');'
style.backgroundImage = 'url(' + this.mainBackground + ')'
}
// overwrite padding left for the sidebar
if (this.naviDrawer && this.navigationStyle === 'iconsAndText') style.paddingLeft = '220px'
if (this.naviDrawer && this.navigationStyle === 'iconsOnly') style.paddingLeft = '56px'
return style
}
Expand Down Expand Up @@ -311,3 +299,28 @@ export default class App extends Mixins(BaseMixin) {
}
}
</script>

<style>
@import './assets/styles/fonts.css';
@import './assets/styles/toastr.css';
@import './assets/styles/page.scss';
@import './assets/styles/sidebar.scss';
@import './assets/styles/utils.scss';
@import './assets/styles/updateManager.scss';
:root {
--app-height: 100%;
}
#content {
background-attachment: fixed;
background-size: cover;
background-repeat: no-repeat;
}
/*noinspection CssUnusedSymbol*/
.v-btn:not(.v-btn--outlined).primary {
/*noinspection CssUnresolvedCustomProperty*/
color: var(--v-btn-text-primary);
}
</style>
10 changes: 1 addition & 9 deletions src/components/TheSidebar.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-navigation-drawer
:key="navigationStyle"
v-model="naviDrawer"
:value="naviDrawer"
:src="sidebarBackground"
:mini-variant="navigationStyle === 'iconsOnly'"
:width="navigationWidth"
Expand Down Expand Up @@ -70,10 +70,6 @@ export default class TheSidebar extends Mixins(NavigationMixin, BaseMixin) {
return this.$store.state.naviDrawer
}
set naviDrawer(newVal: boolean) {
this.$store.dispatch('setNaviDrawer', newVal)
}
get navigationStyle() {
return this.$store.state.gui.uiSettings.navigationStyle
}
Expand Down Expand Up @@ -133,10 +129,6 @@ export default class TheSidebar extends Mixins(NavigationMixin, BaseMixin) {
return output
}
mounted() {
this.naviDrawer = this.$vuetify.breakpoint.lgAndUp
}
}
</script>

Expand Down
53 changes: 35 additions & 18 deletions src/components/TheTopbar.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<v-app-bar app elevate-on-scroll :height="topbarHeight" class="topbar pa-0" clipped-left>
<v-app-bar-nav-icon tile @click.stop="naviDrawer = !naviDrawer"></v-app-bar-nav-icon>
<v-app-bar-nav-icon tile @click.stop="naviDrawer = !naviDrawer" />
<router-link to="/">
<template v-if="sidebarLogo">
<img
Expand All @@ -17,12 +17,12 @@
class="nav-logo ml-4 mr-1 d-none d-sm-flex"
router
to="/"
:ripple="false"></mainsail-logo>
:ripple="false" />
</template>
</router-link>
<v-toolbar-title class="text-no-wrap ml-0 pl-2 mr-2">{{ printerName }}</v-toolbar-title>
<printer-selector v-if="countPrinters"></printer-selector>
<v-spacer></v-spacer>
<printer-selector v-if="countPrinters" />
<v-spacer />
<input
ref="fileUploadAndStart"
type="file"
Expand Down Expand Up @@ -66,9 +66,9 @@
<v-icon class="mr-md-2">{{ mdiAlertOctagonOutline }}</v-icon>
<span class="d-none d-md-inline">{{ $t('App.TopBar.EmergencyStop') }}</span>
</v-btn>
<the-notification-menu></the-notification-menu>
<the-settings-menu></the-settings-menu>
<the-top-corner-menu></the-top-corner-menu>
<the-notification-menu />
<the-settings-menu />
<the-top-corner-menu />
</v-app-bar>
<v-snackbar v-model="uploadSnackbar.status" :timeout="-1" :value="true" fixed right bottom dark>
<strong>{{ $t('App.TopBar.Uploading') }} {{ uploadSnackbar.filename }}</strong>
Expand All @@ -84,7 +84,7 @@
</v-snackbar>
<v-dialog v-model="showEmergencyStopDialog" width="400" :fullscreen="isMobile">
<panel
:title="$t('EmergencyStopDialog.EmergencyStop').toString()"
:title="$t('EmergencyStopDialog.EmergencyStop')"
toolbar-color="error"
card-class="emergency-stop-dialog"
:icon="mdiAlertOctagonOutline"
Expand All @@ -96,7 +96,7 @@
</template>
<v-card-text>{{ $t('EmergencyStopDialog.AreYouSure') }}</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-spacer />
<v-btn text @click="showEmergencyStopDialog = false">{{ $t('EmergencyStopDialog.No') }}</v-btn>
<v-btn color="primary" text @click="emergencyStop">{{ $t('EmergencyStopDialog.Yes') }}</v-btn>
</v-card-actions>
Expand Down Expand Up @@ -245,13 +245,31 @@ export default class TheTopbar extends Mixins(BaseMixin) {
)
}
get defaultNavigationStateSetting() {
return this.$store.state.gui?.uiSettings?.defaultNavigationStateSetting ?? 'alwaysOpen'
}
mounted() {
//this.naviDrawer = this.$vuetify.breakpoint.lgAndUp
switch (this.defaultNavigationStateSetting) {
case 'alwaysClosed':
this.naviDrawer = false
break
case 'lastState':
this.naviDrawer = (localStorage.getItem('naviDrawer') ?? 'true') === 'true'
break
default:
this.naviDrawer = this.$vuetify.breakpoint.lgAndUp
}
}
btnEmergencyStop() {
const confirmOnEmergencyStop = this.$store.state.gui.uiSettings.confirmOnEmergencyStop
if (confirmOnEmergencyStop) {
this.showEmergencyStopDialog = true
} else {
this.emergencyStop()
}
if (!confirmOnEmergencyStop) this.emergencyStop()
this.showEmergencyStopDialog = true
}
emergencyStop() {
Expand Down Expand Up @@ -342,14 +360,13 @@ export default class TheTopbar extends Mixins(BaseMixin) {
}
</script>

<style>
<style scoped>
/*noinspection CssUnusedSymbol*/
.topbar .v-toolbar__content {
::v-deep .topbar .v-toolbar__content {
padding-top: 0 !important;
padding-bottom: 0 !important;
}
</style>
<style scoped>
.button-min-width-auto {
min-width: auto !important;
}
Expand Down
8 changes: 8 additions & 0 deletions src/components/dialogs/TheScrewsTiltAdjustDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,21 @@ export default class TheScrewsTiltAdjustDialog extends Mixins(BaseMixin, Control
return this.$store.state.printer.screws_tilt_adjust?.error ?? false
}
get max_deviation() {
return this.$store.state.printer.screws_tilt_adjust?.max_deviation ?? null
}
get results() {
return this.$store.state.printer.screws_tilt_adjust?.results ?? {}
}
get showDialog() {
// don't display the dialog, if the user disabled it in the UI settings
if (!this.boolScrewsTiltAdjustDialog) return false
// don't display the dialog, if the user add the MAX_DEVIATION attribute to the SCREWS_TILT_CALCULATE command
if (this.max_deviation !== null) return false
return this.error || Object.keys(this.results).length
}
Expand Down
66 changes: 66 additions & 0 deletions src/components/inputs/CheckboxList.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<template>
<v-col class="pl-6">
<template v-if="selectAll">
<v-checkbox
v-model="selectAllModel"
:label="$t('Settings.GeneralTab.Everything')"
hide-details
class="mt-0"
:indeterminate="selectAllIndeterminate"
@change="$emit('update:selectedCheckboxes', selectedCheckboxes)"></v-checkbox>
<v-divider class="my-2" />
</template>
<template v-for="option in options">
<v-checkbox
:key="option.value"
v-model="selectedCheckboxes"
:label="option.label"
hide-details
class="mt-0"
:value="option.value"
@change="$emit('update:selectedCheckboxes', selectedCheckboxes)"></v-checkbox>
</template>
</v-col>
</template>

<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '../mixins/base'
import { computed } from 'vue'
import { TranslateResult } from 'vue-i18n'
@Component
export default class CheckboxList extends Mixins(BaseMixin) {
@Prop({ required: true })
declare readonly options: { label: string | TranslateResult; value: string }[]
@Prop({ type: Boolean, required: false, default: false })
declare readonly selectAll: boolean
selectedCheckboxes: (string | TranslateResult)[] = []
selectAllIndeterminate: boolean = false
selectAllModel = computed<boolean>({
get: this.getSelectAll,
set: this.setSelectAll,
})
getSelectAll(): boolean {
this.selectAllIndeterminate = false
if (0 < this.selectedCheckboxes.length && this.selectedCheckboxes.length < this.options.length) {
this.selectAllIndeterminate = true
return false
}
return this.selectedCheckboxes.length == this.options.length
}
setSelectAll(state: boolean) {
if (state) {
this.selectedCheckboxes = this.options.map((o) => o.value)
return
}
this.selectedCheckboxes = []
}
}
</script>
Loading

0 comments on commit c9dc251

Please sign in to comment.