Skip to content

Commit

Permalink
Merge branch 'develop' into pedrolamas/client-linear-move-macro
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrolamas authored Nov 20, 2024
2 parents c40df1d + 4a90376 commit 66096d6
Show file tree
Hide file tree
Showing 18 changed files with 404 additions and 32 deletions.
8 changes: 8 additions & 0 deletions public/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@
"src": "logo_ldo.svg"
}
},
{
"name": "Mellow",
"color": "#003DFF",
"isDark": true,
"logo": {
"src": "logo_mellow.svg"
}
},
{
"name": "Peopoly",
"color": "#007CC2",
Expand Down
6 changes: 6 additions & 0 deletions public/logo_mellow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions server/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@
"src": "logo_ldo.svg"
}
},
{
"name": "Mellow",
"color": "#003DFF",
"isDark": true,
"logo": {
"src": "logo_mellow.svg"
}
},
{
"name": "Peopoly",
"color": "#007CC2",
Expand Down
211 changes: 211 additions & 0 deletions src/components/widgets/beacon/BeaconCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
<template>
<collapsable-card
:title="$t('app.general.title.beacon')"
icon="$beacon"
:draggable="!fullscreen"
:collapsable="!fullscreen"
layout-path="dashboard.beacon-card"
>
<template #menu>
<app-btn
v-if="!fullscreen"
color=""
fab
x-small
text
class="ms-1 my-1"
@click="$filters.routeTo({ name: 'tune' })"
>
<v-icon>$fullScreen</v-icon>
</app-btn>
</template>

<template v-if="beaconModels.length > 0">
<v-simple-table>
<thead>
<tr>
<th>{{ $t('app.general.label.name') }}</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr
v-for="item in beaconModels"
:key="item.name"
>
<td class="">
{{ item.name }}
</td>
<td>
<v-chip
v-if="item.active"
small
block
>
{{ $t('app.beacon.label.active') }}
</v-chip>
</td>
<td
class="text-right"
nowrap
>
<v-tooltip
v-if="!item.active"
bottom
>
<template #activator="{ on, attrs }">
<app-btn
v-bind="attrs"
x-small
color=""
fab
text
@click="loadModel(item.name)"
v-on="on"
>
<v-icon>$open</v-icon>
</app-btn>
</template>
<span>{{ $t('app.beacon.tooltip.load') }}</span>
</v-tooltip>

<v-tooltip bottom>
<template #activator="{ on, attrs }">
<app-btn
v-bind="attrs"
color=""
class="ml-2"
fab
text
x-small
@click="removeModel(item.name)"
v-on="on"
>
<v-icon color="">
$close
</v-icon>
</app-btn>
</template>
<span>{{ $t('app.beacon.tooltip.delete') }}</span>
</v-tooltip>
</td>
</tr>
</tbody>
</v-simple-table>
</template>

<v-divider />

<v-card-text>
<div
v-if="beaconModels.length === 0"
class="mb-4"
>
No existing beacon models found
</div>
<v-row>
<v-col cols="6">
<app-btn
block
small
color="primary"
@click="handleOpenSaveDialog"
>
{{ $t('app.general.btn.save_as') }}
</app-btn>
</v-col>
<v-col cols="6">
<app-btn
small
block
class="mb-2"
:loading="hasWait($waits.onBeaconCalibrate)"
:disabled="printerBusy || !xyHomed"
@click="calibrate"
>
{{ $t('app.general.btn.calibrate') }}
</app-btn>
</v-col>
</v-row>

<!-- <div>{{ beacon }}</div> -->
</v-card-text>

<save-model-dialog
v-if="saveDialogState.open"
v-model="saveDialogState.open"
:existing-name="saveDialogState.existingName"
@save="handlModelSave"
/>
</collapsable-card>
</template>

<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import SaveModelDialog from './SaveModelDialog.vue'
import StateMixin from '@/mixins/state'
import ToolheadMixin from '@/mixins/toolhead'
import type { BeaconModel, BeaconState } from '@/store/printer/types'
@Component({
components: {
SaveModelDialog
}
})
export default class BeaconCard extends Mixins(StateMixin, ToolheadMixin) {
saveDialogState = {
open: false,
existingName: 'default'
}
@Prop({ type: Boolean })
readonly fullscreen?: boolean
get beacon (): BeaconState {
return this.$store.state.printer.printer.beacon
}
get beaconModels (): BeaconModel[] {
return this.$store.getters['printer/getBeaconModels']
}
async loadModel (name: string) {
const result = (
!this.printerPrinting ||
await this.$confirm(
this.$tc('app.general.simple_form.msg.confirm_change_beacon_model'),
{ title: this.$tc('app.general.label.confirm'), color: 'card-heading', icon: '$error' }
)
)
if (result) {
this.sendGcode(`BEACON_MODEL_SELECT NAME="${name}"`)
}
}
removeModel (name: string) {
this.sendGcode(`BEACON_MODEL_REMOVE NAME="${name}"`)
}
calibrate () {
this.sendGcode('BEACON_CALIBRATE', this.$waits.onBeaconCalibrate)
}
handleOpenSaveDialog () {
this.saveDialogState = {
open: true,
existingName: this.beacon.model ?? ''
}
}
handlModelSave (config: { name: string; removeDefault: boolean }) {
if (config.name !== this.beacon.model) {
this.sendGcode(`BEACON_MODEL_SAVE NAME="${config.name}"`)
}
if (config.removeDefault) {
this.sendGcode(`BEACON_MODEL_REMOVE NAME="${this.beacon.model}"`)
}
}
}
</script>
63 changes: 63 additions & 0 deletions src/components/widgets/beacon/SaveModelDialog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<template>
<app-dialog
v-model="open"
:title="$t('app.general.label.save_as')"
max-width="450"
@save="handleSubmit()"
>
<v-card-text>
<v-text-field
v-model="name"
autofocus
filled
required
class="mb-4"
:rules="[
$rules.required
]"
hide-details="auto"
:label="$t('app.beacon.label.model_name')"
/>

<v-checkbox
v-model="removeDefault"
:label="$t('app.beacon.label.remove_model', { name: existingName })"
hide-details="auto"
class="mb-4"
:disabled="name === existingName"
/>

<span>
{{ $t('app.beacon.msg.hint', { name: existingName }) }}
</span>
</v-card-text>
</app-dialog>
</template>

<script lang="ts">
import { Component, Mixins, Prop, VModel } from 'vue-property-decorator'
import StateMixin from '@/mixins/state'
import ToolheadMixin from '@/mixins/toolhead'
@Component({})
export default class SaveModelDialog extends Mixins(StateMixin, ToolheadMixin) {
@VModel({ type: Boolean })
open?: boolean
@Prop({ type: String })
readonly existingName!: string
mounted () {
this.name = 'default'
this.removeDefault = false
}
name = 'default'
removeDefault = false
handleSubmit () {
this.$emit('save', { name: this.name, removeDefault: this.removeDefault })
this.open = false
}
}
</script>
10 changes: 4 additions & 6 deletions src/components/widgets/history/JobHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class="ms-1 my-1"
>
<v-text-field
v-model="searchModel"
v-model="search"
outlined
dense
single-line
Expand All @@ -32,7 +32,7 @@
:items-per-page="15"
:item-class="getRowClasses"
single-expand
:search="searchModel"
:search="search"
:expanded="expanded"
mobile-breakpoint="0"
item-key="job_id"
Expand Down Expand Up @@ -189,7 +189,7 @@
</template>
<script lang="ts">
import { Component, Mixins, PropSync } from 'vue-property-decorator'
import { Component, Mixins } from 'vue-property-decorator'
import JobHistoryItemStatus from './JobHistoryItemStatus.vue'
import FilesMixin from '@/mixins/files'
import getFilePaths from '@/util/get-file-paths'
Expand All @@ -204,9 +204,7 @@ import type { AppTableHeader } from '@/types'
})
export default class JobHistory extends Mixins(FilesMixin) {
expanded: HistoryItem[] = []
@PropSync('search', { type: String, default: '' })
searchModel!: string
search = ''
get headers (): AppTableHeader[] {
const headers = [
Expand Down
7 changes: 1 addition & 6 deletions src/components/widgets/stats/PrinterStatsCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,9 @@

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'
import JobHistory from '@/components/widgets/history/JobHistory.vue'
import { SocketActions } from '@/api/socketActions'
@Component({
components: {
JobHistory
}
})
@Component({})
export default class PrinterStatsCard extends Vue {
@Prop({ type: Boolean })
readonly menuCollapsed?: boolean
Expand Down
7 changes: 1 addition & 6 deletions src/components/widgets/system/DiskUsageCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,8 @@

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import JobHistory from '@/components/widgets/history/JobHistory.vue'
@Component({
components: {
JobHistory
}
})
@Component({})
export default class PrinterStatsCard extends Vue {
get sdInfo () {
const info = this.$store.getters['server/getSystemInfo']
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/thermals/TemperatureTargets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
<span>
<template v-for="sensor in getNevermoreSensors(item)">
<v-tooltip
:key="sensor"
:key="`${item.key}-${sensor.key}`"
left
:disabled="sensor.disableTooltip"
>
Expand Down
Loading

0 comments on commit 66096d6

Please sign in to comment.