Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
42ed8bb548
@ -34,7 +34,7 @@
|
|||||||
</v-tabs>
|
</v-tabs>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col :class="isMobile ? '' : 'pl-0'">
|
<v-col :class="isMobile ? '' : 'pl-0'">
|
||||||
<perfect-scrollbar :class="'settings-tabs '+(isMobile ? '' : 'height500')" ref="settingsScroll">
|
<perfect-scrollbar :class="'settings-tabs '+(isMobile ? '' : 'height500')" ref="settingsScroll" :options="{ suppressScrollX: true }">
|
||||||
<component :is="'settings-'+activeTab+'-tab'" @scrollToTop="scrollToTop"></component>
|
<component :is="'settings-'+activeTab+'-tab'" @scrollToTop="scrollToTop"></component>
|
||||||
</perfect-scrollbar>
|
</perfect-scrollbar>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
@ -40,20 +40,14 @@
|
|||||||
<v-text-field
|
<v-text-field
|
||||||
:label="name"
|
:label="name"
|
||||||
v-model="params[name].value"
|
v-model="params[name].value"
|
||||||
|
:placeholder="params[name].default"
|
||||||
|
:persistent-placeholder="true"
|
||||||
hide-details
|
hide-details
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
>
|
clearable
|
||||||
<template v-slot:append>
|
clear-icon="mdi-refresh"
|
||||||
<v-btn
|
></v-text-field>
|
||||||
v-if="params[name].value !== params[name].default"
|
|
||||||
@click="params[name].value = params[name].default"
|
|
||||||
icon
|
|
||||||
small>
|
|
||||||
<v-icon>mdi-refresh</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</template>
|
|
||||||
</v-text-field>
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row class="my-2">
|
<v-row class="my-2">
|
||||||
@ -78,8 +72,8 @@ import {GuiStateMacrogroupMacros} from '@/store/gui/types'
|
|||||||
|
|
||||||
interface param {
|
interface param {
|
||||||
type: 'int' | 'double' | 'string' | null,
|
type: 'int' | 'double' | 'string' | null,
|
||||||
default: string | null
|
default: string | number | null
|
||||||
value: string | null
|
value: string | number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
interface params {
|
interface params {
|
||||||
@ -114,7 +108,7 @@ export default class MacroButton extends Mixins(BaseMixin) {
|
|||||||
this.params[name] = {
|
this.params[name] = {
|
||||||
type: this.klipperMacro.params[name].type,
|
type: this.klipperMacro.params[name].type,
|
||||||
default: this.klipperMacro.params[name].default,
|
default: this.klipperMacro.params[name].default,
|
||||||
value: this.klipperMacro.params[name].default
|
value: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -169,7 +169,7 @@ export function formatTime(date: Date): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getMacroParams(macro: { gcode: string }): PrinterStateMacroParams {
|
export function getMacroParams(macro: { gcode: string }): PrinterStateMacroParams {
|
||||||
const paramRegex = /{%?.*?\sparams\.([A-Za-z_0-9]+)(?:\|(int|string|double))?(?:\|default\('?(.*?)'?\))?(?:\|(int|string))?.*?%?}/
|
const paramRegex = /{%?.*?\sparams\.([A-Za-z_0-9]+)(?:\|(int|string|double))?(?:\|default\('?"?(.*?)"?'?\))?(?:\|(int|string))?.*?%?}/
|
||||||
|
|
||||||
let params = paramRegex.exec(macro.gcode)
|
let params = paramRegex.exec(macro.gcode)
|
||||||
let currentMatch = macro.gcode
|
let currentMatch = macro.gcode
|
||||||
|
Loading…
x
Reference in New Issue
Block a user