Merge branch 'master' of https://github.com/meteyou/mainsail into LanguageChange

# Conflicts:
#	package.json
#	src/App.vue
#	src/components/ConnectingDialog.vue
#	src/components/SelectPrinterDialog.vue
#	src/components/panels/ControlPanel.vue
#	src/components/panels/ExtruderPanel.vue
#	src/components/panels/Settings/ConfigFilesPanel.vue
#	src/components/panels/Settings/ControlPanel.vue
#	src/components/panels/Settings/EndstopPanel.vue
#	src/components/panels/Settings/GeneralPanel.vue
#	src/components/panels/Settings/LimitsPanel.vue
#	src/components/panels/Settings/UpdatePanel.vue
#	src/components/panels/StatusPanel.vue
#	src/components/panels/ToolsPanel.vue
#	src/components/panels/WebcamPanel.vue
#	src/components/panels/ZOffsetPanel.vue
#	src/main.js
#	src/pages/Files.vue
#	src/store/gui/actions.js
#	src/store/gui/index.js
This commit is contained in:
winbin committed 2021-03-15 16:17:56 +08:00
commit ef732ebc87
91 files changed
+3530 -1162

No files matched your search

+1 -2
View File
@@ -16,7 +16,7 @@
<v-progress-linear color="white" indeterminate></v-progress-linear>
</v-card-text>
<v-card-text class="pt-5" v-if="!isConnecting && connectingFailed">
<p>{{ $t("App.CannotNotConnectTo") }} {{ parseInt(port) !== 80 && port !== "" ? hostname+":"+port : hostname }}.</p>
<p>{{ $t("App.CannotNotConnectTo") }}{{ parseInt(port) !== 80 && port !== "" ? hostname+":"+port : hostname }}.</p>
<div class="text-center">
<v-btn @click="reconnect" color="primary">{{ $t("App.TryAgain") }}</v-btn>
</div>
@@ -65,7 +65,6 @@ export default {
},
methods: {
connect() {
window.console.log("save connection")
Vue.prototype.$socket.setUrl(this.protocol+"://"+this.hostname+":"+this.port+"/websocket")
Vue.prototype.$socket.connect()
},
+2 -2
View File
@@ -12,7 +12,7 @@
role="button"
>
<v-icon>mdi-view-dashboard-outline</v-icon>
<span class="nav-title">Printers</span>
<span class="nav-title">{{ $t("App.Printers")}}</span>
<v-menu bottom :offset-x="true">
<template v-slot:activator="{ on, attrs }">
@@ -30,7 +30,7 @@
</v-menu>
</div>
<v-item-group class="v-btn-toggle mx-4 d-block row" name="printers" v-if="false">
<v-btn class="col" color="primary" @click="switchToPrinters">Printers</v-btn>
<v-btn class="col" color="primary" @click="switchToPrinters">{{ $t("App.Printers")}}</v-btn>
</v-item-group>
</li>
+2 -2
View File
@@ -120,7 +120,7 @@
<v-card-text class="pt-3" v-if="!isConnecting && !connectingFailed && !dialogAddPrinter.bool && !dialogEditPrinter.bool">
<v-container class="px-0 pb-0">
<v-row v-for="(printer, index) in this['farm/getPrinters']" v-bind:key="index">
<v-col class="rounded transition-swing secondary py-2 px-2 mb-6" style="cursor: pointer;" @click="connect(printer)">
<v-col class="rounded transition-swing secondary py-2 px-2 mb-2" style="cursor: pointer;" @click="connect(printer)">
<v-row align="center">
<v-col class="col-auto pr-0">
<v-progress-circular
@@ -142,7 +142,7 @@
<v-col>
<p class="text-center" v-if="this['farm/countPrinters'] === 0">{{ $t("App.Hello") }}</p>
<p class="text-center">{{ $t("App.PleaseRememberToAdd") }}<code>{{ currentUrl }}</code> {{ $t("App.InMoonrakerConf") }}</p>
<p class="text-center">{{ $t("App.YouCanFindMore") }}<a href="https://docs.mainsail.xyz/remotemode" target="_blank">{{ $t("App.Remotemode") }}</a>.</p>
<p class="text-center mb-0">{{ $t("App.YouCanFindMore") }} <a :href="$t('App.Remotemode')" target="_blank">{{ $t("App.Remotemode") }}</a>.</p>
</v-col>
</v-row>
<v-row>
+1 -1
View File
@@ -15,7 +15,7 @@
</style>
<template>
<v-dialog :value="application !== ''" persistent width="60%" max-width="800">
<v-dialog :value="application !== ''" persistent max-width="800" class="mx-0">
<v-card
dark
:loading="!complete"
+68 -53
View File
@@ -1,5 +1,5 @@
<template>
<div id="tempchart" style="height: 250px; width: 100%;"></div>
<div id="tempchart" style="height: 250px; width: 100%;" v-observe-visibility="visibilityChanged"></div>
</template>
<script>
@@ -16,7 +16,7 @@ export default {
chart : null,
timerChart: '',
timerDataset: '',
chartFocus: false,
isVisable: true,
chartOptions: {
darkMode: true,
animation: false,
@@ -36,7 +36,7 @@ export default {
let outputTime = datasets[0]['axisValueLabel']
outputTime = outputTime.substr(outputTime.indexOf(" "))
output += "<div class=\"row mb-2\">" +
output += "<div class=\"row\">" +
"<div class=\"col py-1\" style='border-bottom: 1px solid rgba(255, 255, 255, 0.24);'>" +
"<span class='v-icon mdi mdi-clock theme-dark' style='font-size: 14px; margin-right: 5px;'></span>" +
"<span class='font-weight-bold'>"+outputTime+"</span>" +
@@ -51,23 +51,23 @@ export default {
!dataset.seriesName.endsWith('_speed')
) {
output += "<div class=\"row\">"
output += "<div class=\"col-auto pt-2 pb-1\">"
output += "<div class=\"col-auto py-0\">"
const mainDataset = this.series.find(tmpDataset => tmpDataset.name === dataset.seriesName)
if (mainDataset)
output += "<span style=\"" +
"display:inline-block;" +
"margin-right:6px;" +
"width:10px;" +
"height:10px;" +
"border:1px solid "+mainDataset.lineStyle.color+";" +
"background-color:"+mainDataset.lineStyle.color+"66;" +
"margin-right:10px;" +
"width:8px;" +
"height:8px;" +
"border-radius: 50%;" +
"background-color:"+mainDataset.lineStyle.color+"CC;" +
"\"></span>"
output += convertName(dataset.seriesName)+":"
output += "</div>"
output += "<div class=\"col text-right pt-2 pb-1 font-weight-bold\">"
output += "<div class=\"col text-right py-0 font-weight-bold\">"
if (dataset.value[1]) output += dataset.value[1].toFixed(1)
@@ -93,7 +93,7 @@ export default {
grid: {
top: 35,
right: 25,
bottom: 25,
bottom: 30,
left: 25,
},
dataZoom: [{
@@ -118,7 +118,7 @@ export default {
},
yAxis: [
{
name: '[°C] Temperature',
name: 'Temperature [°C]',
type: 'value',
min: 0,
max: 300,
@@ -180,43 +180,6 @@ export default {
},
],
series: [],
media: [{
query: {
minWidth: 500,
},
option: {
xAxis: {
//splitNumber: 10,
}
}
}, {
query: {
minWidth: 500,
},
option: {
grid: {
right: 40,
left: 40,
},
yAxis: [
{
maxInterval: 50,
axisLabel: {
showMinLabel: false,
showMaxLabel: true,
rotate: 0
}
},
{
maxInterval: 25,
axisLabel: {
showMinLabel: false,
rotate: 0
}
},
],
}
}],
},
}
},
@@ -255,34 +218,86 @@ export default {
get() {
return this.$store.getters["printer/tempHistory/getCurrentMaxTemp"]
}
},
boolDisplayPwmAxis: {
get() {
return this.$store.getters["printer/tempHistory/getBoolDisplayPwmAxis"]
}
}
},
methods: {
createChart() {
if (document.getElementById("tempchart") && this.chart === null) {
this.chart = echarts.init(document.getElementById("tempchart"), null, {renderer: 'svg'})
this.chart = echarts.init(document.getElementById("tempchart"), null, {renderer: 'canvas'})
this.chart.setOption(this.chartOptions)
} else setTimeout(() => {
this.createChart()
}, 500)
},
visibilityChanged (isVisible) {
this.isVisible = isVisible
if(isVisible && this.chart !== null) this.chart.resize()
},
},
created() {
this.timerChart = setInterval(() => {
if (
this.chart &&
this.boolTempchart &&
document.visibilityState === "visible" &&
this.$route.path === "/"
this.isVisable
) {
this.chart.setOption({
series: this.series,
grid: {
left: 25,
right: this.boolDisplayPwmAxis ? 25 : 15,
},
xAxis: {
min: new Date() - this.maxHistory * 1000,
max: new Date(),
},
yAxis: [{
axisLabel: {
rotate: 90,
showMinLabel: true,
margin: 5,
},
max: this.autoscale ? this.currentMaxTemp : this.maxTemp,
}, {
show: this.boolDisplayPwmAxis,
axisLabel: {
showMinLabel: true,
rotate: 90,
margin: 5,
}
}],
media: [{
query: {
minWidth: 500,
},
option: {
grid: {
right: this.boolDisplayPwmAxis ? 40 : 15,
left: 40,
},
yAxis: [
{
maxInterval: 50,
axisLabel: {
showMinLabel: false,
showMaxLabel: true,
rotate: 0
}
},
{
maxInterval: 25,
axisLabel: {
showMinLabel: false,
rotate: 0
}
},
],
}
}],
})
}
@@ -298,6 +313,6 @@ export default {
},
mounted: function() {
this.createChart()
}
},
}
</script>
+387 -56
View File
@@ -1,58 +1,280 @@
<style>
.btnHomeAxis {
width: 36px;
min-width: 36px !important;
}
<style lang="scss">
.btnHomeAxis {
width: 36px;
min-width: 36px !important;
}
.btnMinWidthAuto {
min-width: auto !important;
.btnMinWidthAuto {
min-width: auto !important;
}
.steps {
width: 100%;
> div {
width: 100%;
display: flex;
> button {
flex-grow: 1;
}
}
}
</style>
<template>
<v-card>
<v-container class="pt-0">
<v-row no-gutters class="" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
<v-col class="col-12 mt-3 pb-0 text-center">
<v-btn small @click="doHome" :loading="loadings.includes('homeAll')" :color="homedAxes.includes('xyz') ? 'primary' : 'warning'"><v-icon class="mr-1">mdi-home</v-icon><span class="d-none d-sm-inline">{{ $t("Dashboard.Home")}} </span>{{ $t("Dashboard.All")}}</v-btn>
<v-btn small @click="doQGL" :loading="loadings.includes('qgl')" color="primary" class="ml-2" v-if="'quad_gantry_level' in config">{{ $t("Dashboard.QGL")}}</v-btn>
<v-btn small @click="doZtilt" :loading="loadings.includes('zTilt')" color="primary" class="ml-2" v-if="'z_tilt' in config">{{ $t("Dashboard.ZTilt")}}</v-btn>
</v-col>
</v-row>
<v-row no-gutters class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
<v-col class="text-center">
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
<v-btn @click="doSendMove('X-'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsorted" v-bind:key="'x-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
<v-btn @click="doHomeX" :color="homedAxes.includes('x') ? 'primary' : 'warning'" :loading="loadings.includes('homeX')" class="font-weight-bold btnHomeAxis">X</v-btn>
<v-btn @click="doSendMove('X+'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsortedReverse" v-bind:key="'x+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-row no-gutters class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
<v-col class="text-center">
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
<v-btn @click="doSendMove('Y-'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsorted" v-bind:key="'y-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
<v-btn @click="doHomeY" :color="homedAxes.includes('y') ? 'primary' : 'warning'" :loading="loadings.includes('homeY')" class="font-weight-bold btnHomeAxis">Y</v-btn>
<v-btn @click="doSendMove('Y+'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsortedReverse" v-bind:key="'y+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-row no-gutters class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
<v-col class="text-center">
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
<v-btn @click="doSendMove('Z-'+steps, feedrateZ)" class="btnMinWidthAuto col" v-for="steps of stepsZsorted" v-bind:key="'z-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
<v-btn @click="doHomeZ" :color="homedAxes.includes('z') ? 'primary' : 'warning'" :loading="loadings.includes('homeZ')" class="font-weight-bold btnHomeAxis">Z</v-btn>
<v-btn @click="doSendMove('Z+'+steps, feedrateZ)" class="btnMinWidthAuto col" v-for="steps of stepsZsortedReverse" v-bind:key="'z+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-row no-gutters v-if="this['printer/getMacros'].length > 0">
<v-col class="text-center">
<v-btn v-for="(macro, index) in this['printer/getMacros']" v-bind:key="index+99" small color="primary" class="mx-1 mt-3" :loading="loadings.includes('macro_'+macro.name)" @click="doSendMacro(macro.name)">{{ macro.name.replace(/_/g, " ") }}</v-btn>
</v-col>
</v-row>
</v-container>
</v-card>
<div>
<v-card class="mb-4" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
<v-toolbar flat dense>
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-gamepad</v-icon>{{ $t('Panels.ControlPanel.Controls') }}</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Panels.ControlPanel.SetupControls')" left>
<template v-slot:activator="{ on, attrs }">
<v-btn small class="px-2 minwidth-0" color="grey darken-3" v-bind="attrs" v-on="on"><v-icon small>mdi-cog</v-icon></v-btn>
</template>
<v-list>
<v-list-item class="minHeight36">
<v-checkbox v-model="useCross" class="mt-0" hide-details :label="$t('Panels.ControlPanel.AlternateControls')"></v-checkbox>
</v-list-item>
<v-list-item class="minHeight36" v-if="useCross">
<v-checkbox v-model="reverseZ" class="mt-0" hide-details :label="$t('Panels.ControlPanel.InvertZ')"></v-checkbox>
</v-list-item>
</v-list>
</v-menu>
</v-toolbar>
<v-container>
<template v-if="useCross">
<v-row>
<v-col :cols="homeCols">
<v-row dense class="mb-1">
<v-col cols="3"></v-col>
<v-col cols="3">
<v-btn class="btnMinWidthAuto fill-width"
:disabled="selectedCrossStep === null || selectedCrossStep === undefined"
@click="doSendMove('Y+'+stepsReversed[selectedCrossStep], feedrateXY)"
>
<v-icon>mdi-chevron-up</v-icon>
</v-btn>
</v-col>
<v-col cols="3"></v-col>
<v-col cols="3">
<v-btn class="btnMinWidthAuto fill-width"
:disabled="selectedCrossStep === null || selectedCrossStep === undefined"
@click="doSendMove('Z'+(reverseZ ? '-' : '+')+stepsReversed[selectedCrossStep], feedrateZ)"
>
<v-icon>mdi-chevron-up</v-icon>
</v-btn>
</v-col>
</v-row>
<v-row dense>
<v-col cols="3" class="p-rel">
<v-btn class="btnMinWidthAuto fill-width p-abs" style="top: -50%; width: calc(100% - 8px);"
:disabled="selectedCrossStep === null || selectedCrossStep === undefined"
@click="doSendMove('X-'+stepsReversed[selectedCrossStep], feedrateXY)"
>
<v-icon>mdi-chevron-left</v-icon>
</v-btn>
</v-col>
<v-col cols="3">
<v-btn class="btnMinWidthAuto fill-width"
:disabled="selectedCrossStep === null || selectedCrossStep === undefined"
@click="doSendMove('Y-'+stepsReversed[selectedCrossStep], feedrateXY)"
>
<v-icon>mdi-chevron-down</v-icon>
</v-btn>
</v-col>
<v-col cols="3" class="p-rel">
<v-btn class="btnMinWidthAuto fill-width p-abs" style="top: -50%; width: calc(100% - 8px);"
:disabled="selectedCrossStep === null || selectedCrossStep === undefined"
@click="doSendMove('X+'+stepsReversed[selectedCrossStep], feedrateXY)"
>
<v-icon>mdi-chevron-right</v-icon>
</v-btn>
</v-col>
<v-col cols="3">
<v-btn class="btnMinWidthAuto fill-width"
:disabled="selectedCrossStep === null || selectedCrossStep === undefined"
@click="doSendMove('Z'+(reverseZ ? '+' : '-')+stepsReversed[selectedCrossStep], feedrateZ)"
>
<v-icon>mdi-chevron-down</v-icon>
</v-btn>
</v-col>
</v-row>
</v-col>
<v-col :cols="homeCols" class="d-flex align-center">
<div class="flex-grow-1" style="border-radius: 4px; overflow: hidden;">
<v-row dense class="" style="margin-bottom: -2px!important;">
<v-col :cols="'quad_gantry_level' in config || 'z_tilt' in config ? 6 : 12">
<v-btn class="w-100"
tile
@click="doHome"
height="30"
:loading="loadings.includes('homeAll')"
:color="homedAxes.includes('xyz') ? 'primary' : 'warning'"
>
<div class="d-flex align-center">
<v-icon>mdi-home</v-icon>
<span class="ml-1">{{ $t('Panels.ControlPanel.ALL') }}</span>
</div>
</v-btn>
</v-col>
<v-col v-if="'quad_gantry_level' in config || 'z_tilt' in config" cols="6" class="d-flex">
<v-btn v-if="'quad_gantry_level' in config"
class="btnMinWidthAuto flex-grow-1 px-0"
tile
dense
color="primary"
height="30"
:loading="loadings.includes('qgl')"
@click="doQGL"
>{{ $t('Panels.ControlPanel.QGL') }}</v-btn>
<v-btn v-if="'z_tilt' in config"
class="btnMinWidthAuto flex-grow-1 px-0"
tile
dense
color="primary"
height="30"
:loading="loadings.includes('zTilt')"
@click="doZtilt"
>{{ $t('Panels.ControlPanel.ZTilt') }}</v-btn>
</v-col>
</v-row>
<v-row dense class="">
<v-col cols="4" class="flex-grow-1">
<v-btn class="btnMinWidthAuto w-100"
tile
height="30"
:loading="loadings.includes('homeX')"
:color="homedAxes.includes('x') ? 'primary' : 'warning'"
@click="doHomeX"
>
{{ $t('Panels.ControlPanel.X') }}
</v-btn>
</v-col>
<v-col cols="4" class="flex-grow-1">
<v-btn class="btnMinWidthAuto w-100"
tile
height="30"
:loading="loadings.includes('homeY')"
:color="homedAxes.includes('y') ? 'primary' : 'warning'"
@click="doHomeY"
>
{{ $t('Panels.ControlPanel.Y') }}
</v-btn>
</v-col>
<v-col cols="4" class="flex-grow-1">
<v-btn class="btnMinWidthAuto w-100"
tile
height="30"
:loading="loadings.includes('homeZ')"
:color="homedAxes.includes('z') ? 'primary' : 'warning'"
@click="doHomeZ"
>
{{ $t('Panels.ControlPanel.Z') }}
</v-btn>
</v-col>
</v-row>
</div>
</v-col>
</v-row>
<v-row no-gutters>
<v-col class="col-12">
<v-btn-toggle v-if="stepsReversed.length > 0" dense no-gutters style="flex-wrap: nowrap; width: 100%;" v-model="selectedCrossStep">
<v-btn dense class="btnMinWidthAuto flex-grow-1 px-0" v-for="steps of stepsReversed" :key="'all-'+steps">
<span class="body-2">{{ steps }}</span>
</v-btn>
</v-btn-toggle>
<div class="font-weight-bold warning rounded pa-2" v-else>
{{ $t('Panels.ControlPanel.PleaseConfigureSteps') }}<br>
<router-link style="color: white;" to="/settings/interface">{{ $t('Panels.ControlPanel.SettingsInterfaceControl') }}</router-link>
</div>
</v-col>
</v-row>
</template>
<template v-else>
<v-row no-gutters>
<v-col class="col-12 pb-0 text-center">
<v-btn small @click="doHome" :loading="loadings.includes('homeAll')" :color="homedAxes.includes('xyz') ? 'primary' : 'warning'"><v-icon class="mr-1">mdi-home</v-icon><span class="d-none d-sm-inline">{{ $t('Panels.ControlPanel.Home') }} </span>{{ $t('Panels.ControlPanel.ALL') }}</v-btn>
<v-btn small @click="doQGL" :loading="loadings.includes('qgl')" color="primary" class="ml-2" v-if="'quad_gantry_level' in config">{{ $t('Panels.ControlPanel.QGL') }}</v-btn>
<v-btn small @click="doZtilt" :loading="loadings.includes('zTilt')" color="primary" class="ml-2" v-if="'z_tilt' in config">{{ $t('Panels.ControlPanel.ZTilt') }}</v-btn>
</v-col>
</v-row>
<v-row no-gutters class="mt-2">
<v-col class="text-center">
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
<v-btn @click="doSendMove('X-'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsorted" v-bind:key="'x-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
<v-btn @click="doHomeX" :color="homedAxes.includes('x') ? 'primary' : 'warning'" :loading="loadings.includes('homeX')" class="font-weight-bold btnHomeAxis">{{ $t('Panels.ControlPanel.X') }}</v-btn>
<v-btn @click="doSendMove('X+'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsortedReverse" v-bind:key="'x+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-row no-gutters class="mt-3">
<v-col class="text-center">
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
<v-btn @click="doSendMove('Y-'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsorted" v-bind:key="'y-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
<v-btn @click="doHomeY" :color="homedAxes.includes('y') ? 'primary' : 'warning'" :loading="loadings.includes('homeY')" class="font-weight-bold btnHomeAxis">{{ $t('Panels.ControlPanel.Y') }}</v-btn>
<v-btn @click="doSendMove('Y+'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsortedReverse" v-bind:key="'y+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-row no-gutters class="mt-3">
<v-col class="text-center">
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
<v-btn @click="doSendMove('Z-'+steps, feedrateZ)" class="btnMinWidthAuto col" v-for="steps of stepsZsorted" v-bind:key="'z-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
<v-btn @click="doHomeZ" :color="homedAxes.includes('z') ? 'primary' : 'warning'" :loading="loadings.includes('homeZ')" class="font-weight-bold btnHomeAxis">{{ $t('Panels.ControlPanel.Z') }}</v-btn>
<v-btn @click="doSendMove('Z+'+steps, feedrateZ)" class="btnMinWidthAuto col" v-for="steps of stepsZsortedReverse" v-bind:key="'z+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
</v-btn-toggle>
</v-col>
</v-row>
</template>
<v-row>
<v-col class="pa-0">
<v-divider></v-divider>
</v-col>
</v-row>
<v-row class="">
<v-col class="col col-md-6 pt-2">
<span class="text--disabled" style="font-size: .9em">Feed amount [mm]</span>
<v-btn-toggle class="mt-1" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn v-for="amount in feedamountsSorted" v-bind:key="amount" @click="setFeedAmount(amount)" dense :class="(amount === currentFeedAmount ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ amount }}</v-btn>
</v-btn-toggle>
</v-col>
<v-col class="col col-md-6 pt-2">
<span class="text--disabled" style="font-size: .9em">Feedrate [mm/s]</span>
<v-btn-toggle class="mt-1" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn v-for="rate in feedratesSorted" v-bind:key="rate" @click="setFeedrate(rate)" dense :class="(rate === currentFeedRate ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ rate }}</v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-row class="">
<v-col class="col text-center pt-0">
<v-btn small @click="sendRetract()" class="mx-3" :loading="loadings.includes('btnRetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-up-bold</v-icon> {{ $t('Panels.ControlPanel.Retract') }}</v-btn>
<v-btn small @click="sendDetract()" class="mx-3" :loading="loadings.includes('btnDetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-down-bold</v-icon> {{ $t('Panels.ControlPanel.Extrude') }}</v-btn>
</v-col>
</v-row>
</v-container>
</v-card>
<v-card class="mt-6" v-if="this['printer/getMacros'].length > 0">
<v-toolbar flat dense>
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-code-tags</v-icon>{{ $t('Panels.ControlPanel.Macros') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-container>
<v-row no-gutters v-if="this['printer/getMacros'].length > 0">
<v-col class="text-center mr-fix-2 mb-fix-2">
<v-btn v-for="(macro, index) in this['printer/getMacros']"
:key="index+99"
small
color="primary"
class="mr-2 mb-2"
:loading="loadings.includes('macro_'+macro.name)"
@click="doSendMacro(macro.name)">{{ macro.name.replace(/_/g, " ") }}</v-btn>
</v-col>
</v-row>
</v-container>
</v-card>
</div>
</template>
<script>
@@ -63,9 +285,11 @@
components: {
},
data: function() {
data() {
return {
crossWidth: 40,
crossHeight: 40,
homeCols: 6
}
},
computed: {
@@ -74,15 +298,48 @@
config: state => state.printer.configfile.config,
loadings: state => state.socket.loadings,
printer_state: state => state.printer.print_stats.state,
extruder: state => state.printer.extruder,
absolute_coordinates: state => state.printer.gcode_move.absolute_coordinates,
feedamounts: state => state.gui.dashboard.extruder.feedamounts,
feedrates: state => state.gui.dashboard.extruder.feedrates,
feedrateXY: state => state.gui.dashboard.control.feedrateXY,
stepsXY: state => state.gui.dashboard.control.stepsXY,
feedrateZ: state => state.gui.dashboard.control.feedrateZ,
stepsZ: state => state.gui.dashboard.control.stepsZ,
stepsAll: state => state.gui.dashboard.control.stepsAll,
useCross: state => state.gui.dashboard.control.useCross,
reverseZ: state => state.gui.dashboard.control.reverseZ,
}),
...mapGetters([
'printer/getMacros',
'printer/getExtrudePossible',
]),
reverseZ: {
get() {
return this.$store.state.gui.dashboard.control.reverseZ;
},
set(reverseZ) {
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { reverseZ } } })
}
},
useCross: {
get() {
return this.$store.state.gui.dashboard.control.useCross;
},
set(useCross) {
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { useCross } } })
}
},
selectedCrossStep: {
get() {
return this.$store.state.gui.dashboard.control.selectedCrossStep;
},
set(selectedCrossStep) {
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { selectedCrossStep } } })
}
},
stepsXYsorted: {
get() {
return [...this.$store.state.gui.dashboard.control.stepsXY].sort(function(a, b) { return b-a })
@@ -102,9 +359,63 @@
get() {
return [...this.$store.state.gui.dashboard.control.stepsZ].sort(function(a, b) { return a-b })
}
},
steps: {
get() {
return Array.from(new Set([
...(this.stepsAll ?? [])
])).entries().sort((a, b) => b-a)
}
},
stepsReversed: {
get() {
return Array.from(new Set([
...(this.stepsAll ?? []),
])).sort((a, b) => a-b)
}
},
feedamountsSorted: {
get() {
return [...this.feedamounts].sort((a,b) => { return b-a })
}
},
feedratesSorted: {
get() {
return [...this.feedrates].sort((a,b) => { return b-a })
}
},
currentFeedAmount: {
get() {
return parseFloat(this.$store.state.gui.dashboard.extruder.feedamount)
},
set(newVal) {
return this.$store.dispatch('gui/setSettings', { dashboard: { extruder: { feedamount: newVal } } })
}
},
currentFeedRate: {
get() {
return parseFloat(this.$store.state.gui.dashboard.extruder.feedrate)
},
set(newVal) {
return this.$store.dispatch('gui/setSettings', { dashboard: { extruder: { feedrate: newVal } } })
}
}
},
created() {
window.addEventListener('resize', this.onResize);
},
mounted() {
if (window.screen.width < 330) {
this.homeCols = 12;
}
},
destroyed() {
window.removeEventListener('resize', this.onResize);
},
methods: {
onResize() {
this.homeCols = window.screen.width < 360 ? 12 : 6;
},
doHome() {
this.$store.commit('server/addEvent', { message: "G28", type: 'command' });
this.$store.commit('socket/addLoading', { name: 'homeAll' });
@@ -136,9 +447,11 @@
this.$socket.sendObj('printer.gcode.script', { script: "Z_TILT_ADJUST" }, "socket/removeLoading", { name: 'zTilt' });
},
doSendMove(gcode, feedrate) {
gcode = "G91" + "\n" +
"G1 " + gcode + " F"+feedrate*60 + "\n" +
"G90";
if (this.absolute_coordinates) {
gcode = "G91" + "\n" +
"G1 " + gcode + " F"+feedrate*60 + "\n" +
"G90"
} else gcode = "G1 " + gcode + " F"+feedrate*60
this.doSend(gcode);
},
@@ -151,6 +464,24 @@
this.$store.commit('socket/addLoading', { name: 'macro_'+gcode });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'macro_'+gcode });
},
setFeedAmount(value) {
this.currentFeedAmount = value;
},
setFeedrate(value) {
this.currentFeedRate = value;
},
sendRetract() {
let gcode = "M83\nG1 E-"+this.currentFeedAmount+" F"+(this.currentFeedRate * 60);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
this.$store.commit('socket/addLoading', { name: 'btnRetract' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnRetract' });
},
sendDetract() {
let gcode = "M83\nG1 E"+this.currentFeedAmount+" F"+(this.currentFeedRate * 60);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
this.$store.commit('socket/addLoading', { name: 'btnDetract' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnDetract' });
},
},
}
</script>
</script>
+4 -4
View File
@@ -7,13 +7,13 @@
<v-container>
<v-row class="">
<v-col class="col col-md-6">
<v-label>{{ $t("Dashboard.FeedAmountIn") }} mm:</v-label>
<v-label>{{ $t("Panels.ExtruderPanel.FeedAmountIn") }} mm:</v-label>
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn v-for="amount in feedamountsSorted" v-bind:key="amount" @click="setFeedAmount(amount)" dense :class="(amount === feedAmount ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ amount }}</v-btn>
</v-btn-toggle>
</v-col>
<v-col class="col col-md-6">
<v-label>{{ $t("Dashboard.FeedrateIn") }} mm/s:</v-label>
<v-label>{{ $t("Panels.ExtruderPanel.FeedrateIn") }} mm/s:</v-label>
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn v-for="rate in feedratesSorted" v-bind:key="rate" @click="setFeedrate(rate)" dense :class="(feedrate === rate ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ rate }}</v-btn>
</v-btn-toggle>
@@ -21,8 +21,8 @@
</v-row>
<v-row class="">
<v-col class="col text-center">
<v-btn small @click="sendRetract()" class="mx-2" :loading="loadings.includes('btnRetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-up-bold</v-icon> {{ $t("Dashboard.Retract") }}</v-btn>
<v-btn small @click="sendDetract()" class="mx-2" :loading="loadings.includes('btnDetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-down-bold</v-icon> {{ $t("Dashboard.Extrude") }}</v-btn>
<v-btn small @click="sendRetract()" class="mx-2" :loading="loadings.includes('btnRetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-up-bold</v-icon> {{ $t("Panels.ExtruderPanel.Retract") }}</v-btn>
<v-btn small @click="sendDetract()" class="mx-2" :loading="loadings.includes('btnDetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-down-bold</v-icon> {{ $t("Panels.ExtruderPanel.Extrude") }}</v-btn>
</v-col>
</v-row>
</v-container>
+4 -4
View File
@@ -2,21 +2,21 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-alert-circle</v-icon>{{ $t('Setting.KlippyState')}}{{ klippy_state}}</span>
<span class="subheading"><v-icon left>mdi-alert-circle</v-icon>{{ $t('Panels.KlippyStatePanel.KlippyState')}}{{ klippy_state}}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="py-0">
<v-layout wrap class=" text-center">
<v-flex col class="text-left" v-if="klippy_connected"><pre style="white-space: pre-wrap;">{{ klippy_message }}</pre></v-flex>
<v-flex col class="text-left" v-if="!klippy_connected">
<p style="white-space:pre-wrap">{{ $t('Setting.KlippyInfo') }}</p>
<p style="white-space:pre-wrap">{{ $t('Panels.KlippyStatePanel.KlippyInfo') }}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-divider class="my-2" v-if="klippy_connected" ></v-divider>
<v-card-text class="px-4 pt-2 pb-4 content text-center text-lg-left" v-if="klippy_connected">
<v-btn small @click="doRestart" color="error" class=""><v-icon class="mr-sm-2">mdi-restart</v-icon>{{ $t('Setting.Restart') }}</v-btn>
<v-btn small @click="doRestartFirmware" class="ml-4" color="error"><v-icon class="mr-sm-2">mdi-restart</v-icon>{{ $t('Setting.FIRMWARERestart') }}</v-btn>
<v-btn small @click="doRestart" color="error" class=""><v-icon class="mr-sm-2">mdi-restart</v-icon>{{ $t('Panels.KlippyStatePanel.Restart') }}</v-btn>
<v-btn small @click="doRestartFirmware" class="ml-4" color="error"><v-icon class="mr-sm-2">mdi-restart</v-icon>{{ $t('Panels.KlippyStatePanel.FIRMWARERestart') }}</v-btn>
</v-card-text>
</v-card>
</template>
+8 -8
View File
@@ -12,21 +12,21 @@
<v-toolbar flat dense color="orange darken-2">
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-alert-circle" left></v-icon>{{ $t("Dashboard.MissingConfiguration") }}
<v-icon class="mdi mdi-alert-circle" left></v-icon>{{ $t("Panels.MinSettingsPanel.MissingConfiguration") }}
</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="px-0 pt-0 pb-2 content">
<v-layout wrap class=" text-center">
<v-flex col class="text-left">
<p v-if="!boolVirtualSdcard" class="orange--text"><code>virtual_sdcard</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
<p v-if="!boolPauseResume" class="orange--text"><code>pause_resume</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
<p v-if="!boolDisplayStatus" class="orange--text"><code>display_status</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
<p v-if="!boolMacroPause" class="orange--text"><code>gcode_macro PAUSE</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
<p v-if="!boolMacroResume" class="orange--text"><code>gcode_macro RESUME</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
<p v-if="!boolMacroCancelPrint" class="orange--text"><code>gcode_macro CANCEL_PRINT</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
<p v-if="!boolVirtualSdcard" class="orange--text"><code>virtual_sdcard</code> {{ $t("Panels.MinSettingsPanel.IsNotDefinedInConfig") }}</p>
<p v-if="!boolPauseResume" class="orange--text"><code>pause_resume</code> {{ $t("Panels.MinSettingsPanel.IsNotDefinedInConfig") }}</p>
<p v-if="!boolDisplayStatus" class="orange--text"><code>display_status</code> {{ $t("Panels.MinSettingsPanel.IsNotDefinedInConfig") }}</p>
<p v-if="!boolMacroPause" class="orange--text"><code>gcode_macro PAUSE</code> {{ $t("Panels.MinSettingsPanel.IsNotDefinedInConfig") }}</p>
<p v-if="!boolMacroResume" class="orange--text"><code>gcode_macro RESUME</code> {{ $t("Panels.MinSettingsPanel.IsNotDefinedInConfig") }}</p>
<p v-if="!boolMacroCancelPrint" class="orange--text"><code>gcode_macro CANCEL_PRINT</code> {{ $t("Panels.MinSettingsPanel.IsNotDefinedInConfig") }}</p>
<div class="text-center">
<v-btn href="https://docs.mainsail.xyz/necessary-configuration" target="_blank" color="white" outlined small><v-icon small class="mr-1">mdi-information</v-icon>{{ $t("Dashboard.MoreInformation") }}</v-btn>
<v-btn href="https://docs.mainsail.xyz/necessary-configuration" target="_blank" color="white" outlined small><v-icon small class="mr-1">mdi-information</v-icon>{{ $t("Panels.MinSettingsPanel.MoreInformation") }}</v-btn>
</div>
</v-flex>
</v-layout>
+7 -7
View File
@@ -23,19 +23,19 @@
<v-card>
<v-toolbar flat dense>
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-console-line</v-icon>{{ $t("Dashboard.Console") }}</span>
<span class="subheading"><v-icon left>mdi-console-line</v-icon>{{ $t("Panels.MiniconsolePanel.Console") }}</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Dashboard.SetupConsole')">
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Panels.MiniconsolePanel.SetupConsole')">
<template v-slot:activator="{ on, attrs }">
<v-btn small class="px-2 minwidth-0" color="grey darken-3" v-bind="attrs" v-on="on"><v-icon small>mdi-cog</v-icon></v-btn>
</template>
<v-list>
<v-list-item class="minHeight36">
<v-checkbox class="mt-0" v-model="hideWaitTemperatures" hide-details :label="$t('Dashboard.HideTemperatures')"></v-checkbox>
<v-checkbox class="mt-0" v-model="hideWaitTemperatures" hide-details :label="$t('Panels.MiniconsolePanel.HideTemperatures')"></v-checkbox>
</v-list-item>
<v-list-item class="minHeight36">
<v-checkbox class="mt-0" v-model="boolCustomFilters" hide-details :label="$t('Dashboard.CustomFilters')"></v-checkbox>
<v-checkbox class="mt-0" v-model="boolCustomFilters" hide-details :label="$t('Panels.MiniconsolePanel.CustomFilters')"></v-checkbox>
</v-list-item>
</v-list>
</v-menu>
@@ -45,7 +45,7 @@
<v-row>
<v-col>
<v-text-field
:label="$t('Dashboard.SendCode')"
:label="$t('Panels.MiniconsolePanel.SendCode')"
ref="gcodeCommandField"
solo
hide-details
@@ -60,7 +60,7 @@
</v-col>
<v-col class="col-auto align-content-center">
<v-btn color="info" class="gcode-command-btn" @click="doSend" :loading="loadings.includes('sendGcode')" :disabled="loadings.includes('sendGcode')" >
<v-icon class="mr-2">mdi-send</v-icon> {{ $t("Dashboard.Send") }}
<v-icon class="mr-2">mdi-send</v-icon> {{ $t("Panels.MiniconsolePanel.Send") }}
</v-btn>
</v-col>
</v-row>
@@ -81,7 +81,7 @@
sort-by="date"
>
<template #no-data>
<div class="py-2">{{ $t("Dashboard.Empty") }}</div>
<div class="py-2">{{ $t("Panels.MiniconsolePanel.Empty") }}</div>
</template>
<template #item="{ item }">
+15 -5
View File
@@ -20,22 +20,32 @@
<v-card class="mt-6" v-if="['printing', 'paused'].includes(printer_state)">
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon class="mdi mdi-printer-3d" left></v-icon>{{ $t("Dashboard.PrintSettings") }}</span>
<span class="subheading"><v-icon class="mdi mdi-printer-3d" left></v-icon>{{ $t("Panels.MiscellaneousPanel.PrintSettings") }}</span>
</v-toolbar-title>
</v-toolbar>
<tool-slider label="Speed factor" :target="speed_factor" :max="200" :multi="100" :step="5" command="M220" attribute-name="S" ></tool-slider>
<tool-slider label="Speed factor" :target="speed_factor" :max="200" :multi="100" :step="5" :dynamic-range="true" command="M220" attribute-name="S" ></tool-slider>
<v-divider></v-divider>
<tool-slider label="Extrusion factor" :target="extrude_factor" :max="200" :multi="100" :step="1" command="M221" attribute-name="S" ></tool-slider>
</v-card>
<v-card class="mt-6" v-if="this['printer/getMiscellaneous'].length">
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-dip-switch</v-icon>{{ $t("Dashboard.Miscellaneous") }}</span>
<span class="subheading"><v-icon left>mdi-dip-switch</v-icon>{{ $t("Panels.MiscellaneousPanel.Miscellaneous") }}</span>
</v-toolbar-title>
</v-toolbar>
<div v-for="(object, index) of this['printer/getMiscellaneous']" v-bind:key="index">
<v-divider v-if="index"></v-divider>
<miscellaneous-slider :name="object.name" :type="object.type" :target="object.power" :controllable="object.controllable" :pwm="object.pwm" :multi="parseInt(object.scale)" ></miscellaneous-slider>
<miscellaneous-slider
:name="object.name"
:type="object.type"
:target="object.power"
:rpm="object.rpm"
:controllable="object.controllable"
:pwm="object.pwm"
:off_below="object.off_below"
:max="object.max_power"
:multi="parseInt(object.scale)"
></miscellaneous-slider>
</div>
</v-card>
</div>
@@ -65,6 +75,6 @@
...mapGetters([
'printer/getMiscellaneous',
]),
},
}
}
</script>
@@ -4,15 +4,15 @@
<v-toolbar flat dense color="orange darken-2">
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-alert-circle" left></v-icon>{{ $t("Dashboard.MoonrakerFailedPlugins") }}
<v-icon class="mdi mdi-alert-circle" left></v-icon>{{ $t("Panels.MoonrakerFailedPluginsPanel.MoonrakerFailedPlugins") }}
</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="px-0 pt-0 pb-2 content">
<v-layout wrap class=" text-center">
<v-flex col class="text-left">
<p class="orange--text">{{ $t("Dashboard.MoonrakerErrorInfo") }}</p>
<p class="mb-2 orange--text">{{ $t("Dashboard.FollowingPluginHasAnError") }}</p>
<p class="orange--text">{{ $t("Panels.MoonrakerFailedPluginsPanel.MoonrakerErrorInfo") }}</p>
<p class="mb-2 orange--text">{{ $t("Panels.MoonrakerFailedPluginsPanel.FollowingPluginHasAnError") }}</p>
<ul class="mt-0 pt-0">
<li v-for="plugin in failedPlugins" v-bind:key="plugin" class="orange--text"><code>{{ plugin }}</code></li>
</ul>
@@ -21,7 +21,7 @@
</v-card-text>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-4 pt-2 pb-4 content text-center text-lg-left">
<v-btn small :href="'//'+hostname+':'+port+'/server/files/moonraker.log'" color="primary" class=""><v-icon class="mr-2">mdi-download</v-icon>{{ $t("Dashboard.DownloadLog") }}</v-btn>
<v-btn small :href="'//'+hostname+':'+port+'/server/files/moonraker.log'" color="primary" class=""><v-icon class="mr-2">mdi-download</v-icon>{{ $t("Panels.MoonrakerFailedPluginsPanel.DownloadLog") }}</v-btn>
</v-card-text>
</v-card>
</template>
+4 -4
View File
@@ -7,7 +7,7 @@
<v-toolbar flat dense>
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-power" left></v-icon>Power Control
<v-icon class="mdi mdi-power" left></v-icon>{{ $t('Panels.PowerControlPanel.PowerControl') }}
</span>
</v-toolbar-title>
</v-toolbar>
@@ -19,9 +19,9 @@
<v-col class="py-0 pt-1">{{ device.device }}</v-col>
<v-col class="py-0 text-right">
<v-btn-toggle v-model="device.status">
<v-btn small v-if="device.status === 'error'" disabled>Error</v-btn>
<v-btn small v-if="device.status !== 'error'" :disabled="device.status === 'on'" @click="setPower(device,1)">On</v-btn>
<v-btn small v-if="device.status !== 'error'" :disabled="device.status === 'off'" @click="setPower(device,0)">Off</v-btn>
<v-btn small v-if="device.status === 'error'" disabled>{{ $t('Panels.PowerControlPanel.Error') }}</v-btn>
<v-btn small v-if="device.status !== 'error'" :disabled="device.status === 'on'" @click="setPower(device,1)">{{ $t('Panels.PowerControlPanel.On') }}</v-btn>
<v-btn small v-if="device.status !== 'error'" :disabled="device.status === 'off'" @click="setPower(device,0)">{{ $t('Panels.PowerControlPanel.Off') }}</v-btn>
</v-btn-toggle>
</v-col>
</v-row>
@@ -29,7 +29,7 @@
<v-col>
<v-card>
<v-card-title>
{{ $t('Setting.ConfigFiles') }}
{{ $t('Settings.ConfigFilesPanel.ConfigFiles') }}
<v-spacer class="d-none d-sm-block"></v-spacer>
<input type="file" ref="fileUpload" style="display: none" multiple @change="uploadFile" />
<v-item-group class="v-btn-toggle my-5 my-sm-0 col-12 col-sm-auto px-0 py-0">
@@ -37,19 +37,19 @@
<v-btn v-if="currentPath !== '' && currentPath !== '/config_examples'" class="flex-grow-1" @click="createFile"><v-icon>mdi-file-plus</v-icon></v-btn>
<v-btn v-if="currentPath !== '' && currentPath !== '/config_examples'" class="flex-grow-1" @click="createFolder"><v-icon>mdi-folder-plus</v-icon></v-btn>
<v-btn class="flex-grow-1" @click="refreshFileList"><v-icon>mdi-refresh</v-icon></v-btn>
<v-menu :offset-y="true" title="Setup current list">
<v-menu :offset-y="true" :title="$t('Settings.ConfigFilesPanel.SetupCurrentList')">
<template v-slot:activator="{ on, attrs }">
<v-btn class="flex-grow-1" v-bind="attrs" v-on="on"><v-icon class="">mdi-cog</v-icon></v-btn>
</template>
<v-list>
<v-list-item class="minHeight36">
<v-checkbox class="mt-0" hide-details v-model="showHiddenFiles" :label="$t('Setting.HiddenFiles')"></v-checkbox>
<v-checkbox class="mt-0" hide-details v-model="showHiddenFiles" :label="$t('Settings.ConfigFilesPanel.HiddenFiles')"></v-checkbox>
</v-list-item>
</v-list>
</v-menu>
</v-item-group>
</v-card-title>
<v-card-subtitle>{{ $t('Setting.CurrentPath') }} {{ this.currentPath === "" ? "/" : this.currentPath }}</v-card-subtitle>
<v-card-subtitle>{{ $t('Settings.ConfigFilesPanel.CurrentPath') }} {{ this.currentPath === "" ? "/" : this.currentPath }}</v-card-subtitle>
<v-data-table
:items="files"
class="files-table"
@@ -61,13 +61,13 @@
:sort-desc.sync="sortDesc"
:items-per-page.sync="countPerPage"
:footer-props="{
itemsPerPageText: $t('Setting.Files')
itemsPerPageText: $t('Settings.ConfigFilesPanel.Files')
}"
mobile-breakpoint="0"
item-key="name">
<template #no-data>
<div class="text-center">{{ $t('Setting.Empty') }}</div>
<div class="text-center">{{ $t('Settings.ConfigFilesPanel.Empty') }}</div>
</template>
<template slot="body.prepend" v-if="(currentPath !== '')">
@@ -81,9 +81,10 @@
<template #item="{ item }">
<tr
v-longpress:600="(e) => showContextMenu(e, item)"
@contextmenu="showContextMenu($event, item)"
@click="clickRow(item)"
class="file-list-cursor"
class="file-list-cursor user-select-none"
:data-name="item.filename">
<td class="pr-0 text-center" style="width: 32px;">
<v-icon v-if="item.isDirectory">mdi-folder</v-icon>
@@ -98,27 +99,27 @@
</v-card>
<v-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
<v-list>
<v-list-item @click="clickRow(contextMenu.item)" v-if="!contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-file-document-edit-outline</v-icon> {{ $t('Setting.EditFile') }}
<v-list-item @click="clickRow(contextMenu.item, true)" v-if="!contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-file-document-edit-outline</v-icon> {{ $t('Settings.ConfigFilesPanel.EditFile') }}
</v-list-item>
<v-list-item @click="downloadFile" v-if="!contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-cloud-download</v-icon> {{ $t('Setting.Download') }}
<v-icon class="mr-1">mdi-cloud-download</v-icon> {{ $t('Settings.ConfigFilesPanel.Download') }}
</v-list-item>
<v-list-item @click="renameFile(contextMenu.item)" v-if="!contextMenu.item.isDirectory && currentPath !== '/config_examples'">
<v-icon class="mr-1">mdi-rename-box</v-icon> {{ $t('Setting.Rename') }}
<v-icon class="mr-1">mdi-rename-box</v-icon> {{ $t('Settings.ConfigFilesPanel.Rename') }}
</v-list-item>
<v-list-item @click="removeFile" v-if="!contextMenu.item.isDirectory && currentPath !== '/config_examples'">
<v-icon class="mr-1">mdi-delete</v-icon> {{ $t('Setting.Delete') }}
<v-icon class="mr-1">mdi-delete</v-icon> {{ $t('Settings.ConfigFilesPanel.Delete') }}
</v-list-item>
<v-list-item @click="deleteDirectoryAction" v-if="contextMenu.item.isDirectory && currentPath !== '' && currentPath !== '/config_examples'">
<v-icon class="mr-1">mdi-delete</v-icon> {{ $t('Setting.Delete') }}
<v-icon class="mr-1">mdi-delete</v-icon> {{ $t('Settings.ConfigFilesPanel.Delete') }}
</v-list-item>
</v-list>
</v-menu>
<v-dialog v-model="editor.showLoader" hide-overlay persistent width="300" >
<v-card color="primary" dark >
<v-card-text>
{{ $t('Setting.PleaseStandBy') }}
{{ $t('Settings.ConfigFilesPanel.PleaseStandBy') }}
<v-progress-linear indeterminate color="white" class="mb-0" ></v-progress-linear>
</v-card-text>
</v-card>
@@ -132,11 +133,11 @@
<v-toolbar-title>{{ editor.item.filename }}</v-toolbar-title>
<v-spacer></v-spacer>
<v-toolbar-items>
<v-btn dark text href="https://www.klipper3d.org/Config_Reference.html" target="_blank" class="d-none d-md-flex"><v-icon small class="mr-1">mdi-help</v-icon>{{ $t('Setting.ConfigReference') }}</v-btn>
<v-btn dark text href="https://www.klipper3d.org/Config_Reference.html" target="_blank" class="d-none d-md-flex"><v-icon small class="mr-1">mdi-help</v-icon>{{ $t('Settings.ConfigFilesPanel.ConfigReference') }}</v-btn>
<v-divider white vertical v-if="currentPath !== '/config_examples'" class="d-none d-md-flex"></v-divider>
<v-btn dark text @click="saveFile(false)" v-if="currentPath !== '/config_examples'"><v-icon small class="mr-1">mdi-content-save</v-icon><span class="d-none d-sm-inline">{{ $t('Setting.Save') }}</span></v-btn>
<v-btn dark text @click="saveFile(false)" v-if="currentPath !== '/config_examples'"><v-icon small class="mr-1">mdi-content-save</v-icon><span class="d-none d-sm-inline">{{ $t('Settings.ConfigFilesPanel.Save') }}</span></v-btn>
<v-divider white vertical v-if="currentPath !== '/config_examples' && !['printing', 'paused'].includes(printer_state)" class="d-none d-sm-flex"></v-divider>
<v-btn dark text @click="saveFile(true)" v-if="currentPath !== '/config_examples' && !['printing', 'paused'].includes(printer_state)" class="d-none d-sm-flex"><v-icon small class="mr-1">mdi-restart</v-icon>{{ $t('Setting.SaveRestart') }}</v-btn>
<v-btn dark text @click="saveFile(true)" v-if="currentPath !== '/config_examples' && !['printing', 'paused'].includes(printer_state)" class="d-none d-sm-flex"><v-icon small class="mr-1">mdi-restart</v-icon>{{ $t('Settings.ConfigFilesPanel.SaveRestart') }}</v-btn>
</v-toolbar-items>
</v-toolbar>
<prism-editor class="my-editor" v-model="editor.sourcecode" :readonly="editor.readonly" :highlight="highlighter" line-numbers></prism-editor>
@@ -144,40 +145,40 @@
</v-dialog>
<v-dialog v-model="dialogRenameFile.show" max-width="400">
<v-card>
<v-card-title class="headline">{{ $t('Setting.RenameFile') }}</v-card-title>
<v-card-title class="headline">{{ $t('Settings.ConfigFilesPanel.RenameFile') }}</v-card-title>
<v-card-text>
<v-text-field :label="$t('Setting.Name')" required v-model="dialogRenameFile.newName"></v-text-field>
<v-text-field :label="$t('Settings.ConfigFilesPanel.Name')" required v-model="dialogRenameFile.newName"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="" text @click="dialogRenameFile.show = false">{{ $t('Setting.Cancel') }}</v-btn>
<v-btn color="primary" text @click="renameFileAction">{{ $t('Setting.Rename') }}</v-btn>
<v-btn color="" text @click="dialogRenameFile.show = false">{{ $t('Settings.ConfigFilesPanel.Cancel') }}</v-btn>
<v-btn color="primary" text @click="renameFileAction">{{ $t('Settings.ConfigFilesPanel.Rename') }}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogCreateFile.show" max-width="400">
<v-card>
<v-card-title class="headline">{{ $t('Setting.CreateFile') }}</v-card-title>
<v-card-title class="headline">{{ $t('Settings.ConfigFilesPanel.CreateFile') }}</v-card-title>
<v-card-text>
<v-text-field :label="$t('Setting.Name')" required v-model="dialogCreateFile.name"></v-text-field>
<v-text-field :label="$t('Settings.ConfigFilesPanel.Name')" required v-model="dialogCreateFile.name"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="" text @click="dialogCreateFile.show = false">{{ $t('Setting.Cancel') }}</v-btn>
<v-btn color="primary" text @click="createFileAction">{{ $t('Setting.Create') }}</v-btn>
<v-btn color="" text @click="dialogCreateFile.show = false">{{ $t('Settings.ConfigFilesPanel.Cancel') }}</v-btn>
<v-btn color="primary" text @click="createFileAction">{{ $t('Settings.ConfigFilesPanel.Create') }}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogCreateFolder.show" max-width="400">
<v-card>
<v-card-title class="headline">{{ $t('Setting.CreateFolder') }}</v-card-title>
<v-card-title class="headline">{{ $t('Settings.ConfigFilesPanel.CreateFolder') }}</v-card-title>
<v-card-text>
<v-text-field :label="$t('Setting.Name')" required v-model="dialogCreateFolder.name"></v-text-field>
<v-text-field :label="$t('Settings.ConfigFilesPanel.Name')" required v-model="dialogCreateFolder.name"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="" text @click="dialogCreateFolder.show = false">{{ $t('Setting.Cancel') }}</v-btn>
<v-btn color="primary" text @click="createFolderAction">{{ $t('Setting.Create') }}</v-btn>
<v-btn color="" text @click="dialogCreateFolder.show = false">{{ $t('Settings.ConfigFilesPanel.Cancel') }}</v-btn>
<v-btn color="primary" text @click="createFolderAction">{{ $t('Settings.ConfigFilesPanel.Create') }}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
@@ -190,7 +191,7 @@
dark
v-model="uploadSnackbar.status"
>
<span v-if="uploadSnackbar.max > 1" class="mr-1">({{ uploadSnackbar.number }}/{{ uploadSnackbar.max }})</span><strong>{{ $t('Setting.Uploading') }} {{ uploadSnackbar.filename }}</strong><br />
<span v-if="uploadSnackbar.max > 1" class="mr-1">({{ uploadSnackbar.number }}/{{ uploadSnackbar.max }})</span><strong>{{ $t('Settings.ConfigFilesPanel.Uploading') }} {{ uploadSnackbar.filename }}</strong><br />
{{ Math.round(uploadSnackbar.percent) }} % @ {{ formatFilesize(Math.round(uploadSnackbar.speed)) }}/s<br />
<v-progress-linear class="mt-2" :value="uploadSnackbar.percent"></v-progress-linear>
<template v-slot:action="{ attrs }">
@@ -234,9 +235,9 @@
selected: [],
headers: [
{ text: '', value: '', },
{ text: this.$t('Setting.Name'), value: 'filename', },
{ text: this.$t('Setting.Filesize'), value: 'size', align: 'right', },
{ text: this.$t('Setting.LastModified'), value: 'modified', align: 'right', },
{ text: this.$t('Settings.ConfigFilesPanel.Name'), value: 'filename', },
{ text: this.$t('Settings.ConfigFilesPanel.Filesize'), value: 'size', align: 'right', },
{ text: this.$t('Settings.ConfigFilesPanel.LastModified'), value: 'modified', align: 'right', },
],
options: {
},
@@ -321,7 +322,7 @@
highlighter(code) {
return highlight(code, languages.ini); //returns html
},
refreshFileList: function() {
refreshFileList() {
if (this.currentPath === "") {
this.$socket.sendObj('server.files.get_directory', { path: 'config' }, 'files/getDirectory');
this.$socket.sendObj('server.files.get_directory', { path: 'config_examples' }, 'files/getDirectory');
@@ -377,7 +378,7 @@
}
return items;
},
loadPath: function() {
loadPath() {
let dirArray = this.currentPath.substring(1).split("/");
this.files = findDirectory(this.filetree, dirArray);
@@ -389,30 +390,35 @@
this.files = this.files.filter(file => file.filename.substr(0, 1) !== ".");
}
},
clickRow: function(item) {
if (!item.isDirectory) {
this.editor.showLoader = true;
this.editor.sourcecode = "";
this.editor.item = item;
clickRow(item, force = false) {
if (!this.contextMenu.shown || force) {
if (force) {
this.contextMenu.shown = false;
}
if (!item.isDirectory) {
this.editor.showLoader = true;
this.editor.sourcecode = "";
this.editor.item = item;
let url = '//'+this.hostname+':'+this.port+'/server/files'+this.currentPath+'/'+item.filename+'?time='+Date.now();
fetch(url, { cache: "no-cache" }).then(res => res.text()).then(file => {
this.editor.sourcecode = file;
this.editor.show = true;
this.editor.showLoader = false;
this.editor.readonly = false;
if (this.currentPath === '/config_examples') this.editor.readonly = true;
});
let url = '//' + this.hostname + ':' + this.port + '/server/files' + this.currentPath + '/' + item.filename + '?time=' + Date.now();
fetch(url, {cache: "no-cache"}).then(res => res.text()).then(file => {
this.editor.sourcecode = file;
this.editor.show = true;
this.editor.showLoader = false;
this.editor.readonly = false;
if (this.currentPath === '/config_examples') this.editor.readonly = true;
});
} else {
this.currentPath += "/"+item.filename;
this.currentPage = 1;
} else {
this.currentPath += "/" + item.filename;
this.currentPage = 1;
}
}
},
clickRowGoBack: function() {
clickRowGoBack() {
this.currentPath = this.currentPath.substr(0, this.currentPath.lastIndexOf("/"));
},
saveFile: function(boolRestart = false) {
saveFile(boolRestart = false) {
let file = new File([this.editor.sourcecode], this.editor.item.filename);
let formData = new FormData();
@@ -440,14 +446,16 @@
});
},
showContextMenu (e, item) {
e.preventDefault();
this.contextMenu.shown = true;
this.contextMenu.x = e.clientX;
this.contextMenu.y = e.clientY;
this.contextMenu.item = item;
this.$nextTick(() => {
this.contextMenu.shown = true
});
if (!this.contextMenu.shown) {
e?.preventDefault();
this.contextMenu.shown = true;
this.contextMenu.x = e?.clientX || e?.pageX || window.screenX / 2;
this.contextMenu.y = e?.clientY || e?.pageY || window.screenY / 2;
this.contextMenu.item = item;
this.$nextTick(() => {
this.contextMenu.shown = true
});
}
},
downloadFile() {
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
@@ -507,10 +515,10 @@
removeFile() {
this.$socket.sendObj('server.files.delete_file', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'files/getDeleteFile');
},
deleteDirectoryAction: function() {
deleteDirectoryAction() {
this.$socket.sendObj('server.files.delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'files/getDeleteDir');
},
uploadFileButton: function() {
uploadFileButton() {
this.$refs.fileUpload.click()
},
async uploadFile() {
@@ -533,7 +541,7 @@
this.$refs.fileUpload.value = ''
}
},
doUploadFile: function(file) {
doUploadFile(file) {
let toast = this.$toast;
let formData = new FormData();
let filename = file.name.replace(" ", "_");
@@ -579,7 +587,7 @@
})
})
},
cancelUpload: function() {
cancelUpload() {
this.uploadSnackbar.cancelTokenSource.cancel()
this.uploadSnackbar.status = false
},
@@ -6,26 +6,26 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-console-line</v-icon>{{ $t('Setting.Console') }}</span>
<span class="subheading"><v-icon left>mdi-console-line</v-icon>{{ $t('Settings.ConsolePanel.Console') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="py-3">
<v-container px-0 py-0>
<v-row>
<v-col class="py-2">
<v-switch v-model="hideWaitTemperatures" :label="$t('Setting.HideTemperatures')" hide-details class="mt-0"></v-switch>
<v-switch v-model="hideWaitTemperatures" :label="$t('Settings.ConsolePanel.HideTemperatures')" hide-details class="mt-0"></v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-switch v-model="boolCustomFilters" :label="$t('Setting.CustomFilter')" hide-details class="mt-0"></v-switch>
<v-switch v-model="boolCustomFilters" :label="$t('Settings.ConsolePanel.CustomFilters')" hide-details class="mt-0"></v-switch>
</v-col>
</v-row>
<v-row v-if="boolCustomFilters">
<v-col class="py-2">
<v-textarea
outlined
:label="$t('Setting.Rules')"
:label="$t('Settings.ConsolePanel.Rules')"
v-model="customFilters"
hide-details
class="mb-2"
+203 -24
View File
@@ -5,27 +5,168 @@
</style>
<template>
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-tune</v-icon>{{ $t('Setting.ControlExtruder') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="pt-2 pb-0">
<v-text-field
:label="$t('Setting.FeedrateXY')"
v-model="feedrateXY"
type="number"
suffix="mm/s"
></v-text-field>
<v-text-field
:label="$t('Setting.FeedrateZ')"
v-model="feedrateZ"
type="number"
suffix="mm/s"
></v-text-field>
</v-card-text>
</v-card>
<v-form ref="formControlExtruder">
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-tune</v-icon>{{ $t('Settings.ControlPanel.Control')}}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="pa-0">
<v-container>
<v-row>
<v-col col-6>
<v-text-field
:label="$t('Settings.ControlPanel.SpeedXY')"
v-model="feedrateXY"
@blur="blurFeedrateXY"
type="number"
suffix="mm/s"
hide-details="auto"
:rules="[
v => v > 0 || 'Minimum speed is 1'
]"
></v-text-field>
</v-col>
<v-col col-6>
<v-text-field
:label="$t('Settings.ControlPanel.SpeedZ')"
v-model="feedrateZ"
@blur="blurFeedrateZ"
type="number"
suffix="mm/s"
hide-details="auto"
ref="feedrateZ"
:rules="[
v => v > 1 || 'Minimum speed is 1'
]"
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col class="py-0">
<v-switch v-model="useCross" label="Enable movement cross" hide-details="auto" class="mt-0"></v-switch>
</v-col>
</v-row>
<template v-if="useCross">
<v-row>
<v-col>
<v-combobox
:label="$t('Settings.ControlPanel.MoveDistancesInMm')"
v-model="stepsAll"
hide-selected
hide-details="auto"
multiple
small-chips
:deletable-chips="true"
append-icon=""
type="number"
:rules="[
v => v.length > 0 || 'Minimum 1 value',
v => v.length < 9 || 'For narrow screens it is recommended to enter max. 3 values.',
]"
></v-combobox>
</v-col>
</v-row>
<v-row>
<v-col class="pt-0">
<v-switch v-model="reverseZ" :label="$t('Settings.ControlPanel.ReverseZMovement')" hide-details="auto" class="mt-0"></v-switch>
</v-col>
</v-row>
</template>
<template v-else>
<v-row>
<v-col>
<v-combobox
:label="$t('Settings.ControlPanel.MoveDistancesXYInMm')"
v-model="stepsXY"
hide-selected
hide-details="auto"
multiple
small-chips
:deletable-chips="true"
append-icon=""
type="number"
:rules="[
v => v.length > 0 || 'Minimum 1 value',
v => v.length < 4 || 'For narrow screens it is recommended to enter max. 3 values.',
]"
></v-combobox>
</v-col>
</v-row>
<v-row>
<v-col>
<v-combobox
:label="$t('Settings.ControlPanel.MoveDistancesZInMm')"
v-model="stepsZ"
hide-selected
hide-details="auto"
multiple
small-chips
:deletable-chips="true"
append-icon=""
type="number"
:rules="[
v => v.length > 0 || 'Minimum 1 value',
v => v.length < 4 || 'For narrow screens it is recommended to enter max. 3 values.',
]"
></v-combobox>
</v-col>
</v-row>
</template>
</v-container>
</v-card-text>
</v-card>
<v-card class="mt-6">
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-tune</v-icon>{{ $t('Settings.ControlPanel.Extruder') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="pa-0">
<v-container>
<v-row>
<v-col>
<v-combobox
:label="$t('Settings.ControlPanel.MoveDistancesEInMm')"
v-model="feedamountsE"
hide-selected
hide-details="auto"
multiple
small-chips
:deletable-chips="true"
append-icon=""
type="number"
:rules="[
v => v.length > 0 || 'Minimum 1 value',
v => v.length < 6 || 'For narrow screens it is recommended to enter max. 5 values.',
]"
></v-combobox>
</v-col>
</v-row>
<v-row>
<v-col>
<v-combobox
:label="$t('Settings.ControlPanel.SpeedEInMms')"
v-model="feedratesE"
hide-selected
hide-details="auto"
multiple
small-chips
:deletable-chips="true"
append-icon=""
type="number"
:rules="[
v => v.length > 0 || 'Minimum 1 value',
v => v.length < 6 || 'For narrow screens it is recommended to enter max. 5 values.',
]"
></v-combobox>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
</v-form>
</template>
<script>
@@ -39,12 +180,50 @@
}
},
computed: {
reverseZ: {
get() {
return this.$store.state.gui.dashboard.control.reverseZ;
},
set(reverseZ) {
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { reverseZ } } })
}
},
useCross: {
get() {
return this.$store.state.gui.dashboard.control.useCross;
},
set(useCross) {
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { useCross } } })
}
},
feedrateXY: {
get() {
return this.$store.state.gui.dashboard.control.feedrateXY
},
set(value) {
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { feedrateXY: value } } })
set(feedrate) {
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { feedrateXY: feedrate } } })
}
},
stepsAll: {
get() {
const steps = this.$store.state.gui.dashboard.control.stepsAll
return (steps ?? []).sort(function (a,b) { return b-a })
},
set(steps) {
const absSteps = []
for(const value of steps) absSteps.push(Math.abs(value))
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { stepsAll: absSteps } } })
}
},
stepsXY: {
get() {
const steps = this.$store.state.gui.dashboard.control.stepsXY
return steps.sort(function (a,b) { return b-a })
},
set(steps) {
const absSteps = []
for(const value of steps) absSteps.push(Math.abs(value))
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { stepsXY: absSteps } } })
}
},
feedrateZ: {
@@ -60,4 +239,4 @@
}
}
</script>
</script>
@@ -6,30 +6,30 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-view-dashboard</v-icon>{{ $t('Setting.Dashboard') }}</span>
<span class="subheading"><v-icon left>mdi-view-dashboard</v-icon>{{ $t('Settings.DashboardPanel.Dashboard') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text>
<v-container px-0 py-0>
<v-row>
<v-col class="py-2">
<v-switch v-model="boolShowWebcamOnDashboard" :label="$t('Setting.Webcam')" hide-details class="mt-0"></v-switch>
<v-switch v-model="boolShowWebcamOnDashboard" :label="$t('Settings.DashboardPanel.Webcam')" hide-details class="mt-0"></v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-switch v-model="boolShowTempchartOnDashboard" :label="$t('Setting.Tempchart')" hide-details class="mt-0"></v-switch>
<v-switch v-model="boolShowTempchartOnDashboard" :label="$t('Settings.DashboardPanel.Tempchart')" hide-details class="mt-0"></v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-switch v-model="boolShowConsoleOnDashboard" :label="$t('Setting.Console')" hide-details class="mt-0"></v-switch>
<v-switch v-model="boolShowConsoleOnDashboard" :label="$t('Settings.DashboardPanel.Console')" hide-details class="mt-0"></v-switch>
</v-col>
</v-row>
<v-row class="mt-2">
<v-col col-6>
<v-text-field
label="Chart update interval"
:label="$t('Settings.DashboardPanel.ChartUpdateInterval')"
v-model="intervalChartUpdate"
@blur="blurIntervalChartUpdate"
type="number"
@@ -42,7 +42,7 @@
</v-col>
<v-col col-6>
<v-text-field
label="Datapoint interval"
:label="$t('Settings.DashboardPanel.DatapointInterval')"
type="number"
v-model="intervalDatasetUpdate"
@blur="blurIntervalDatasetUpdate"
@@ -99,7 +99,7 @@
return this.$store.state.gui.tempchart.intervalChartUpdate
},
set(newVal) {
if (newVal >= 500) return this.$store.dispatch('gui/setSettings', { gui: { tempchart: { intervalChartUpdate: newVal } } })
if (newVal >= 500) return this.$store.dispatch('gui/setSettings', { tempchart: { intervalChartUpdate: newVal } })
}
},
intervalDatasetUpdate: {
@@ -107,7 +107,7 @@
return this.$store.state.gui.tempchart.intervalDatasetUpdate
},
set(newVal) {
if (newVal >= 500) return this.$store.dispatch('gui/setSettings', { gui: { tempchart: { intervalDatasetUpdate: newVal } } })
if (newVal >= 500) return this.$store.dispatch('gui/setSettings', { tempchart: { intervalDatasetUpdate: newVal } })
}
},
},
+33 -11
View File
@@ -2,20 +2,28 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-arrow-expand-vertical</v-icon>{{ $t('Setting.Endstops')}}</span>
<span class="subheading"><v-icon left>mdi-arrow-expand-vertical</v-icon>{{ $t('Settings.EndstopPanel.Endstops')}}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="pb-0">
<v-container px-0 py-0>
<v-row v-for="(status, index) of sortEndstops" v-bind:key="index">
<v-col>
<label class="mt-1 d-inline-block">{{ $t('Setting.Endstop')}} <b>{{ index.toUpperCase() }}</b></label>
<v-chip class="float-right" :color="status === 'open' ? 'green' : 'red' " text-color="white">{{ $t(`Setting.${status}`) }}</v-chip>
</v-col>
</v-row>
<div class="py-2" v-if="Object.keys(endstops).length">
<v-row v-for="(status, index) of sortEndstops" v-bind:key="index">
<v-col class="py-1">
<label class="mt-1 d-inline-block">{{ $t('Settings.EndstopPanel.Endstop')}} <b>{{ index.toUpperCase() }}</b></label>
<v-chip class="float-right" small :color="status === 'open' ? 'green' : 'red' " text-color="white">{{ status }}</v-chip>
</v-col>
</v-row>
<v-row v-if="probe !== false">
<v-col class="py-1">
<label class="mt-1 d-inline-block">Probe</label>
<v-chip class="float-right" small :color="probe ? 'red' : 'green' " text-color="white">{{ probe ? 'TRIGGERED' : 'open' }}</v-chip>
</v-col>
</v-row>
</div>
<v-row v-if="(Object.keys(endstops).length === 0 && endstops.constructor === Object)" >
<v-col>
<p>{{ $t('Setting.EndstopInfo')}}</p>
<p>{{ $t('Settings.EndstopPanel.EndstopInfo')}}</p>
</v-col>
</v-row>
</v-container>
@@ -45,15 +53,29 @@
...mapState({
loadings: state => state.socket.loadings,
endstops: state => state.printer.endstops,
})
}),
probe: {
get() {
if (
'probe' in this.$store.state.printer &&
'last_query' in this.$store.state.printer.probe
) return this.$store.state.printer.probe.last_query
return false
}
}
},
created() {
this.getEndstops();
},
methods: {
syncEndstops() {
this.$store.commit('socket/addLoading', { name: 'queryEndstops' });
this.$socket.sendObj('printer.query_endstops.status', { }, "printer/getEndstopStatus");
this.$store.commit('socket/addLoading', { name: 'queryEndstops' })
this.$socket.sendObj('printer.query_endstops.status', { }, "printer/getEndstopStatus")
if (this.probe !== false) {
this.$store.commit('server/addEvent', { message: "QUERY_PROBE", type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "QUERY_PROBE" })
}
},
getEndstops() {
this.sortEndstops = {};
+89 -23
View File
@@ -1,23 +1,78 @@
<style>
.webcamImage {
width: 100%;
}
</style>
<template>
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-cog</v-icon>{{ $t('Setting.General') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="pt-2 pb-0">
<v-text-field
v-model="printerName"
:label="$t('Setting.PrinterName')"
></v-text-field>
</v-card-text>
</v-card>
<div>
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-cog</v-icon>{{ $t('Settings.GeneralPanel.General') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text>
<v-row>
<v-col>
<v-text-field
v-model="printerName"
:label="$t('Settings.GeneralPanel.PrinterName')"
hide-details
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-switch v-model="displayCancelPrint" hide-details class="mt-0">
<template v-slot:label>
{{ $t('Settings.GeneralPanel.DisplayCANCEL_PRINT') }}
<v-tooltip right>
<template v-slot:activator="{ on, attrs }">
<v-icon class="text--secondary ml-2" v-bind="attrs" v-on="on">mdi mdi-information</v-icon>
</template>
<span>{{ $t('Settings.GeneralPanel.ShowCANCEL_PRINT') }}</span>
</v-tooltip>
</template>
</v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="text-center">
<v-btn @click="dialogResetMainsail=true" >{{ $t('Settings.GeneralPanel.FactoryReset') }}</v-btn>
</v-col>
</v-row>
</v-card-text>
</v-card>
<v-dialog v-model="dialogResetMainsail" persistent :width="300">
<v-card dark>
<v-toolbar flat dense color="primary">
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-help-circle" left></v-icon> {{ $t('Settings.GeneralPanel.FactoryReset') }}
</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn small class="minwidth-0" @click="dialogResetMainsail = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
</v-toolbar>
<v-card-text class="pt-3">
<v-container class="pb-0">
<v-row>
<v-col>
<p class="text-center mb-0">{{ $t('Settings.GeneralPanel.FactoryInfo') }}</p>
</v-col>
</v-row>
<v-row>
<v-col class="text-center">
<v-btn
color="red"
@click="resetMainsail"
>
{{ $t('Settings.GeneralPanel.ResetMainsail') }}
</v-btn>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
</v-dialog>
</div>
</template>
<script>
@@ -27,21 +82,32 @@
},
data: function() {
return {
dialogResetMainsail: false,
}
},
computed: {
printerName: {
get() {
return this.$store.state.gui.general.printername;
return this.$store.state.gui.general.printername
},
set(newName) {
return this.$store.dispatch('gui/setSettings', { general: { printername: newName } });
return this.$store.dispatch('gui/setSettings', { general: { printername: newName } })
}
},
displayCancelPrint: {
get() {
return this.$store.state.gui.general.displayCancelPrint;
},
set(displayCancelPrint) {
return this.$store.dispatch('gui/setSettings', { general: { displayCancelPrint: displayCancelPrint } });
}
},
},
methods: {
resetMainsail() {
this.$store.dispatch('gui/resetMoonrakerDB')
this.dialogResetMainsail = false
}
}
}
</script>
@@ -6,7 +6,7 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-translate</v-icon>{{ $t('Setting.Language') }}</span>
<span class="subheading"><v-icon left>mdi-translate</v-icon>{{ $t('Settings.LanguagePanel.Language') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="pt-2 pb-0">
@@ -14,7 +14,7 @@
v-model="lang"
@change="changeLanguage"
:items="items"
:label="$t('Setting.Language')"
:label="$t('Settings.LanguagePanel.Language')"
></v-select>
</v-card-text>
</v-card>
+10 -10
View File
@@ -2,16 +2,16 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-speedometer</v-icon>{{ $t('Setting.MachineLimits')}}</span>
<span class="subheading"><v-icon left>mdi-speedometer</v-icon>{{ $t('Settings.LimitsPanel.MachineLimits')}}</span>
</v-toolbar-title>
</v-toolbar>
<tool-slider :label="$t('Setting.Velocity')" unit="mm/s" :target="current_velocity" :max="max_velocity" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" ></tool-slider>
<tool-slider :label="$t('Settings.LimitsPanel.Velocity')" unit="mm/s" :target="current_velocity" :max="max_velocity" :default-value="max_velocity" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" ></tool-slider>
<v-divider></v-divider>
<tool-slider :label="$t('Setting.Acceleration')" unit="mm/s²" :target="current_accel" :max="max_accel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL=" ></tool-slider>
<tool-slider :label="$t('Settings.LimitsPanel.Acceleration')" unit="mm/s²" :target="current_accel" :max="max_accel" :default-value="max_accel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL=" ></tool-slider>
<v-divider></v-divider>
<tool-slider :label="$t('Setting.Deceleration')" unit="mm/s²" :target="current_accel_to_decel" :max="max_accel_to_decel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" ></tool-slider>
<tool-slider :label="$t('Settings.LimitsPanel.Deceleration')" unit="mm/s²" :target="current_accel_to_decel" :max="max_accel_to_decel" :default-value="max_accel_to_decel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" ></tool-slider>
<v-divider></v-divider>
<tool-slider :label="$t('Setting.SquareCornerVelocity')" unit="mm/s" :target="current_square_corner_velocity" :max="max_square_corner_velocity" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" ></tool-slider>
<tool-slider :label="$t('Settings.LimitsPanel.SquareCornerVelocity')" unit="mm/s" :target="current_square_corner_velocity" :max="max_square_corner_velocity" :default-value="max_square_corner_velocity" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" ></tool-slider>
</v-card>
</template>
@@ -33,11 +33,11 @@
current_accel: state => state.printer.toolhead.max_accel,
current_accel_to_decel: state => state.printer.toolhead.max_accel_to_decel,
current_square_corner_velocity: state => state.printer.toolhead.square_corner_velocity,
config: state => state.printer.configfile.config,
max_velocity: state => parseInt(state.printer.configfile.config.printer.max_velocity) || 0,
max_accel: state => parseInt(state.printer.configfile.config.printer.max_accel) || 0,
max_accel_to_decel: state => parseInt(state.printer.configfile.config.printer.max_accel_to_decel) || parseInt(state.printer.configfile.config.printer.max_accel) / 2,
max_square_corner_velocity: state => parseInt(state.printer.configfile.config.printer.square_corner_velocity) || 5,
config: state => state.printer.configfile.settings,
max_velocity: state => state.printer.configfile.settings.printer.max_velocity || 0,
max_accel: state => state.printer.configfile.settings.printer.max_accel || 0,
max_accel_to_decel: state => state.printer.configfile.settings.printer.max_accel_to_decel || 0,
max_square_corner_velocity: state => state.printer.configfile.settings.printer.square_corner_velocity || 0,
}),
},
watch: {
@@ -2,7 +2,7 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-file-document-edit</v-icon>{{ $t("Setting.Logfiles")}}</span>
<span class="subheading"><v-icon left>mdi-file-document-edit</v-icon>{{ $t("Settings.LogfilesPanel.Logfiles")}}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text :class="'text-center text-lg-left py-0'">
@@ -3,7 +3,7 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-code-tags</v-icon>{{ $t('Setting.Macros') }}</span>
<span class="subheading"><v-icon left>mdi-code-tags</v-icon>{{ $t('Settings.MacrosPanel.Macros') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="py-3">
@@ -13,6 +13,11 @@
<settings-macro-switch :name="macro.name"></settings-macro-switch>
</v-col>
</v-row>
<v-row v-if="this['printer/getAllMacros'].length === 0">
<v-col>
<p class="mb-0 text-center font-italic">{{ $t('Settings.MacrosPanel.NOMacros') }}</p>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
+18 -17
View File
@@ -4,13 +4,13 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-fire</v-icon>{{ $t('Setting.PreheatPresets') }}</span>
<span class="subheading"><v-icon left>mdi-fire</v-icon>{{ $t('Settings.PresetsPanel.PreheatPresets') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="py-3">
<v-container>
<v-row v-for="(preset, index) in this['gui/getPreheatPresets']" v-bind:key="index">
<v-col class="rounded transition-swing secondary py-2 px-2 mb-6" style="cursor: pointer;">
<v-col class="rounded transition-swing secondary py-2 px-2 mb-3" style="cursor: pointer;">
<v-row align="center">
<v-col class="pl-6">
<strong>{{ preset.name }}</strong>
@@ -25,10 +25,10 @@
</v-col>
</v-row>
<v-row>
<v-col class="rounded transition-swing secondary py-2 px-2 mb-6" style="cursor: pointer;">
<v-col class="rounded transition-swing secondary py-2 px-2 mb-2" style="cursor: pointer;">
<v-row align="center">
<v-col class="pl-6">
<strong>{{ $t('Setting.Cooldown')}}</strong>
<strong>{{ $t('Settings.PresetsPanel.Cooldown')}}</strong>
</v-col>
<v-col class="col-auto text-right"><v-btn small class="minwidth-0 float-right" v-on:click.stop.prevent="editCooldown"><v-icon small>mdi-pencil</v-icon></v-btn></v-col>
</v-row>
@@ -36,7 +36,7 @@
</v-row>
<v-row>
<v-col class="text-center mt-0">
<v-btn @click="createPreset">{{ $t('Setting.AddPreset')}}</v-btn>
<v-btn @click="createPreset">{{ $t('Settings.PresetsPanel.AddPreset')}}</v-btn>
</v-col>
</v-row>
</v-container>
@@ -48,7 +48,7 @@
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-fire" left></v-icon>
{{ dialog.index === null ? $t('Setting.Create') : $t('Setting.Edit') }} {{ $t('Setting.Preset') }}
{{ dialog.index === null ? $t('Settings.PresetsPanel.Create') : $t('Settings.PresetsPanel.Edit') }} {{ $t('Settings.PresetsPanel.Preset') }}
</span>
</v-toolbar-title>
<v-spacer></v-spacer>
@@ -62,12 +62,12 @@
>
<template v-if="dialog.bool">
<v-row>
<v-col class="col-6">
<v-col class="col-12 col-sm-6">
<v-row>
<v-col class="col-12">
<v-text-field
v-model="dialog.name"
:label="$t('Setting.Name')"
:label="$t('Settings.PresetsPanel.Name')"
hide-details="auto"
:rules="[rules.required, rules.unique]"
dense
@@ -103,11 +103,11 @@
></v-text-field>
</v-row>
</v-col>
<v-col class="col-6">
<v-col class="col-12 col-sm-6">
<v-textarea
outlined
name="input-7-4"
:label="$t('Setting.CustomGCode')"
:label="$t('Settings.PresetsPanel.CustomGCode')"
v-model="dialog.gcode"
hide-details="auto"
></v-textarea>
@@ -115,7 +115,7 @@
</v-row>
<v-row class="mt-3" v-if="dialog.boolInvalidMin">
<v-col class="py-0">
<v-alert dense text type="error">{{ $t('Setting.PresetInfo')}}</v-alert>
<v-alert dense text type="error">{{ $t('Settings.PresetsPanel.PresetInfo')}}</v-alert>
</v-col>
</v-row>
<v-row class="mt-3">
@@ -135,7 +135,7 @@
:class="dialog.index !== null ? 'float-right' : '' "
type="submit"
>
{{ dialog.index === null ? $t('Setting.Store') : $t('Setting.Update') }} {{ $t('Setting.Preset') }}
{{ dialog.index === null ? $t('Settings.PresetsPanel.Store') : $t('Settings.PresetsPanel.Update') }} {{ $t('Settings.PresetsPanel.Preset') }}
</v-btn>
</v-col>
</v-row>
@@ -150,7 +150,7 @@
<v-toolbar flat dense color="primary">
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-fire" left></v-icon> {{ $t('Setting.EditCooldown')}}
<v-icon class="mdi mdi-fire" left></v-icon> {{ $t('Settings.PresetsPanel.EditCooldown')}}
</span>
</v-toolbar-title>
<v-spacer></v-spacer>
@@ -167,9 +167,10 @@
<v-textarea
outlined
name="input-7-4"
:label="$t('Setting.CustomGCode')"
:label="$t('Settings.PresetsPanel.CustomGCode')"
v-model="cooldownDialog.gcode"
:rules="[rules.required]"
hide-details="auto"
></v-textarea>
</v-col>
</v-row>
@@ -180,7 +181,7 @@
outlined
type="submit"
>
{{ $t('Setting.UpdateCooldown')}}
{{ $t('Settings.PresetsPanel.UpdateCooldown')}}
</v-btn>
</v-col>
</v-row>
@@ -225,7 +226,7 @@
computed: {
...mapState({
orgState: state => state.gui.presets,
cooldownGcode: state => state.gui.cooldownGcode,
cooldownGcode: state => state.gui.cooldown_gcode,
}),
...mapGetters([
'printer/getHeaters',
@@ -336,7 +337,7 @@
},
saveCooldown() {
if (this.cooldownDialog.valid) {
this.$store.dispatch("gui/setSettings", {cooldownGcode: this.cooldownDialog.gcode})
this.$store.dispatch("gui/setSettings", { cooldown_gcode: this.cooldownDialog.gcode })
this.cooldownDialog.bool = false
}
},
@@ -4,13 +4,13 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-printer-3d</v-icon>{{ $t('Setting.RemotePrinters') }}</span>
<span class="subheading"><v-icon left>mdi-printer-3d</v-icon>{{ $t('Settings.RemotePrintersPanel.RemotePrinters') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="py-3">
<v-container>
<v-row v-for="(printer, index) in this['farm/getPrinters']" v-bind:key="index">
<v-col class="rounded transition-swing secondary py-2 px-2 mb-6" style="cursor: pointer;">
<v-col class="rounded transition-swing secondary py-2 px-2 mb-3" style="cursor: pointer;">
<v-row align="center">
<v-col class="col-auto pr-0">
<v-progress-circular
@@ -30,7 +30,7 @@
</v-row>
<v-row>
<v-col class="text-center mt-0">
<v-btn @click="dialogAddPrinter.bool = true">{{ $t('Setting.AddPrinter')}}</v-btn>
<v-btn @click="dialogAddPrinter.bool = true">{{ $t('Settings.RemotePrintersPanel.AddPrinter')}}</v-btn>
</v-col>
</v-row>
</v-container>
@@ -42,7 +42,7 @@
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-connection" left></v-icon>
{{ $t('Setting.AddPrinter')}}
{{ $t('Settings.RemotePrintersPanel.AddPrinter')}}
</span>
</v-toolbar-title>
<v-spacer></v-spacer>
@@ -80,7 +80,7 @@
class="middle"
@click="addPrinter"
>
{{ $t('Setting.AddPrinter')}}
{{ $t('Settings.RemotePrintersPanel.AddPrinter')}}
</v-btn>
</v-col>
</v-row>
@@ -128,7 +128,7 @@
class="middle"
@click="addPrinter"
>
{{ $t('Setting.AddPrinter')}}
{{ $t('Settings.RemotePrintersPanel.AddPrinter')}}
</v-btn>
</v-col>
</v-row>
@@ -142,7 +142,7 @@
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-connection" left></v-icon>
{{ $t('Setting.EditPrinter')}}
{{ $t('Settings.RemotePrintersPanel.EditPrinter')}}
</span>
</v-toolbar-title>
<v-spacer></v-spacer>
@@ -190,7 +190,7 @@
class="middle"
@click="updatePrinter"
>
{{ $t('Setting.UpdatePrinter')}}
{{ $t('Settings.RemotePrintersPanel.UpdatePrinter')}}
</v-btn>
</v-col>
</v-row>
@@ -248,7 +248,7 @@
class="middle"
@click="updatePrinter"
>
{{ $t('Setting.UpdatePrinter')}}
{{ $t('Settings.RemotePrintersPanel.UpdatePrinter')}}
</v-btn>
</v-col>
</v-row>
@@ -10,7 +10,7 @@
<v-switch v-model="runout.enabled" hide-details @change="changeSensor(runout)" class="settingsRunoutSwitchInput my-0"></v-switch>
</v-toolbar>
<v-card-text v-if="runout.enabled">
<v-chip label block :color="runout.filament_detected ? 'green' : 'red' " class="d-block text-center">{{ runout.filament_detected ? $t('Setting.Detected') : $t('Setting.Empty') }}</v-chip>
<v-chip label block :color="runout.filament_detected ? 'green' : 'red' " class="d-block text-center">{{ runout.filament_detected ? $t('Settings.RunoutPanel.Detected') : $t('Settings.RunoutPanel.Empty') }}</v-chip>
</v-card-text>
</v-card>
</div>
+239 -77
View File
@@ -1,73 +1,120 @@
<template>
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-update</v-icon>{{ $t('Setting.UpdateManager')}}</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<v-btn small class="px-2 minwidth-0" color="primary" :loading="loadings.includes('loadingBtnSyncUpdateManager')" :disabled="['printing', 'paused'].includes(printer_state)" @click="btnSync" v-bind="attrs" v-on="on"><v-icon small>mdi-refresh</v-icon></v-btn>
</template>
<span>{{ $t('Setting.CheckForUpdates')}}</span>
</v-tooltip>
</v-toolbar>
<v-card-text class="px-0 py-0">
<v-container py-0 px-0>
<style scoped>
.cursor--pointer {
cursor: pointer;
}
</style>
<div v-for="(value, key) of updateableSoftwares" v-bind:key="key">
<v-divider class="my-0" ></v-divider>
<v-row class="py-2">
<v-col class="pl-6">
{{ 'name' in value ? value.name : key }}<br />
{{ getVersionOutput(value) }}
</v-col>
<v-col class="col-auto pr-6 text-right" align-self="center">
<v-chip
small
label
outlined
:color="getBtnColor(value)"
@click="updateModule(key)"
:disabled="getBtnDisabled(value)"
class="minwidth-0 px-2 text-uppercase"
><v-icon small class="mr-1">mdi-{{ getBtnIcon(value) }}</v-icon>{{ getBtnText(value) }}</v-chip>
<template>
<div>
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-update</v-icon>{{ $t('Settings.UpdatePanel.UpdateManager') }}</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<v-btn small class="px-2 minwidth-0" color="primary" :loading="loadings.includes('loadingBtnSyncUpdateManager')" :disabled="['printing', 'paused'].includes(printer_state)" @click="btnSync" v-bind="attrs" v-on="on"><v-icon small>mdi-refresh</v-icon></v-btn>
</template>
<span>{{ $t('Settings.UpdatePanel.CheckForUpdates') }}</span>
</v-tooltip>
</v-toolbar>
<v-card-text class="px-0 py-0">
<v-container py-0 px-0>
<div v-for="(value, key, index) of updateableSoftwares" v-bind:key="key">
<v-divider class="my-0" v-if="index" ></v-divider>
<v-row class="py-2">
<v-col class="pl-6">
<strong>{{ 'name' in value ? value.name : key }}</strong><br />
<span @click="openCommitsOverlay(key, value)" :class="getVersionClickable(value) ? 'primary--text cursor--pointer' : ''"><v-icon v-if="getVersionClickable(value)" small color="primary" class="mr-1">mdi mdi-information</v-icon>{{ getVersionOutput(value) }}</span>
</v-col>
<v-col class="col-auto pr-6 text-right" align-self="center">
<v-chip
small
label
outlined
:color="getBtnColor(value)"
@click="updateModule(key)"
:disabled="getBtnDisabled(value)"
class="minwidth-0 px-2 text-uppercase"
><v-icon small class="mr-1">mdi-{{ getBtnIcon(value) }}</v-icon>{{ getBtnText(value) }}</v-chip>
</v-col>
</v-row>
</div>
<div v-if="'system' in version_info">
<v-divider class="my-0 border-top-2" ></v-divider>
<v-row class="pt-2">
<v-col class="col-auto pl-6 text-no-wrap">
<strong>{{ $t('Settings.UpdatePanel.System') }}</strong><br />
<v-tooltip top v-if="version_info.system.package_count > 0" :max-width="300">
<template v-slot:activator="{ on, attrs }">
<span v-bind="attrs" v-on="on">{{ version_info.system.package_count }} {{ $t('Settings.UpdatePanel.PackagesCanBeUpgraded') }}</span>
</template>
<span>{{ version_info.system.package_list.join(', ') }}</span>
</v-tooltip>
<span v-if="version_info.system.package_count === 0">{{ $t('Settings.UpdatePanel.OSPackages') }}</span>
</v-col>
<v-col class="pr-6 text-right" align-self="center">
<v-chip
small
label
outlined
:color="version_info.system.package_count ? 'primary' : 'green'"
:disabled="!(version_info.system.package_count) || printer_state === 'printing'"
@click="updateSystem"
class="minwidth-0 px-2 text-uppercase"
><v-icon small class="mr-1">mdi-{{ version_info.system.package_count ? 'progress-upload' : 'check' }}</v-icon>{{ version_info.system.package_count ? 'upgrade' : 'up-to-date' }}</v-chip>
</v-col>
</v-row>
</div>
</v-container>
</v-card-text>
</v-card>
<v-dialog v-model="commitsOverlay.bool" persistent max-width="800">
<v-card dark>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-update</v-icon>{{ $t('Settings.UpdatePanel.Commits') }}</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn small class="minwidth-0" color="grey darken-3" @click="commitsOverlay.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
</v-toolbar>
<v-card-text class="py-5" v-if="commitsOverlay.loading">
<v-row class="pt-0">
<v-col>
<v-progress-linear color="primary" indeterminate></v-progress-linear>
</v-col>
</v-row>
</div>
<div v-if="'system' in version_info">
<v-divider class="my-0 border-top-2" ></v-divider>
<v-row class="pt-2">
<v-col class="col-auto pl-6 text-no-wrap">
<strong>{{ $t('Setting.System')}}</strong><br />
<v-tooltip top v-if="version_info.system.package_count > 0" :max-width="300">
<template v-slot:activator="{ on, attrs }">
<span v-bind="attrs" v-on="on">{{ version_info.system.package_count }} {{ $t('Setting.PackagesCanBeUpgraded')}}</span>
</template>
<span>{{ version_info.system.package_list.join(', ') }}</span>
</v-tooltip>
<span v-if="version_info.system.package_count === 0">{{ $t('Setting.OSPackages')}}</span>
</v-col>
<v-col class="pr-6 text-right" align-self="center">
<v-chip
small
label
outlined
:color="version_info.system.package_count ? 'primary' : 'green'"
:disabled="!(version_info.system.package_count) || printer_state === 'printing'"
@click="updateSystem"
class="minwidth-0 px-2 text-uppercase"
><v-icon small class="mr-1">mdi-{{ version_info.system.package_count ? 'progress-upload' : 'check' }}</v-icon>{{ version_info.system.package_count ? $t('Setting.Upgrade') : $t('Setting.UpToDate')}}</v-chip>
</v-card-text>
<v-card-text class="py-0" v-if="!commitsOverlay.loading" style="max-height: 400px; overflow-y: scroll;">
<v-row>
<v-col class="pt-3 pl-0">
<v-timeline class="updateManager" align-top dense >
<v-timeline-item color="primary" small v-for="commit of commitsOverlay.outputs" v-bind:key="commit.sha">
<v-row class="pt-0">
<v-col>
<a class="font-weight-bold white--text" :href="commit.url" target="_blank">{{ commit.title }}</a><br />
<p v-if="commit.message" class="mb-0" v-html="commit.message.replace(/(?:\r\n|\r|\n)/g, '<br />')"></p>
<div class="caption">
<strong>{{ commit.author }}</strong> {{ $t('Settings.UpdatePanel.CommittedAt') }} {{ commit.date.toLocaleString() }}
</div>
</v-col>
</v-row>
</v-timeline-item>
</v-timeline>
</v-col>
</v-row>
</div>
</v-container>
</v-card-text>
</v-card>
</v-card-text>
</v-card>
</v-dialog>
</div>
</template>
<script>
import { mapState } from 'vuex';
import { mapState } from 'vuex'
import semver from 'semver'
import axios from 'axios'
export default {
components: {
@@ -75,12 +122,16 @@
},
data: function() {
return {
commitsOverlay: {
bool: false,
loading: false,
response: [],
outputs: [],
}
}
},
computed: {
...mapState({
package_version: state => state.packageVersion,
loadings: state => state.socket.loadings,
remoteMode: state => state.socket.remoteMode,
printer_state: state => state.printer.print_stats.state,
@@ -99,11 +150,22 @@
},
getBtnColor(object) {
if (typeof object === 'object' && object !== false) {
if ('detached' in object && object.detached) return 'orange'
if (
'debug_enabled' in object &&
!object.debug_enabled &&
'detached' in object &&
object.detached
) return 'orange'
if ('is_dirty' in object && object.is_dirty) return 'orange'
if ('is_valid' in object && !object.is_valid) return 'red'
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return 'primary'
if (
'version' in object &&
'remote_version' in object &&
semver.valid(object.remote_version) &&
semver.valid(object.version) &&
semver.gt(object.remote_version, object.version)
) return 'primary'
return 'green'
}
@@ -112,24 +174,46 @@
},
getBtnText(object) {
if (typeof object === 'object' && object !== false) {
if ('detached' in object && object.detached) return this.$t('Setting.Detached')
if ('is_valid' in object && !object.is_valid) return this.$t('Setting.Invalid')
if ('is_dirty' in object && object.is_dirty) return this.$t('Setting.Dirty')
if (
'debug_enabled' in object &&
!object.debug_enabled &&
'detached' in object &&
object.detached
) return 'detached'
if ('is_valid' in object && !object.is_valid) return 'invalid'
if ('is_dirty' in object && object.is_dirty) return 'dirty'
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return this.$t('Setting.Update')
if (
'version' in object &&
'remote_version' in object &&
semver.valid(object.remote_version) &&
semver.valid(object.version) &&
semver.gt(object.remote_version, object.version)
) return 'update'
return this.$t('Setting.UpToDate')
return this.$t('Settings.UpdatePanel.UpToDate')
}
return this.$t('Setting.ERROR')
return this.$t('Settings.UpdatePanel.ERROR')
},
getBtnIcon(object) {
if (typeof object === 'object' && object !== false) {
if ('detached' in object && object.detached) return 'alert-circle'
if (
'debug_enabled' in object &&
!object.debug_enabled &&
'detached' in object &&
object.detached
) return 'alert-circle'
if ('is_valid' in object && !object.is_valid) return 'alert-circle'
if ('is_dirty' in object && object.is_dirty) return 'alert-circle'
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return 'progress-upload'
if (
'version' in object &&
'remote_version' in object &&
semver.valid(object.remote_version) &&
semver.valid(object.version) &&
semver.gt(object.remote_version, object.version)
) return 'progress-upload'
return 'check'
}
@@ -138,11 +222,22 @@
},
getBtnDisabled(object) {
if (['printing', 'paused'].includes(this.printer_state)) return true
if ('detached' in object && object.detached) return true
if (
'debug_enabled' in object &&
!object.debug_enabled &&
'detached' in object &&
object.detached
) return true
if (typeof object === 'object' && object !== false) {
if ('is_valid' in object && !object.is_valid) return true
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return false
if (
'version' in object &&
'remote_version' in object &&
semver.valid(object.remote_version) &&
semver.valid(object.version) &&
semver.gt(object.remote_version, object.version)
) return false
}
return true
@@ -160,10 +255,23 @@
}
if (output !== "") output += ": "
output += local_version !== remote_version ? local_version+" > "+remote_version : local_version
if (semver.valid(remote_version) && semver.valid(local_version) && semver.gt(remote_version, local_version))
output += local_version+" > "+remote_version
else
output += local_version
return output
},
getVersionClickable(object) {
return (
'branch' in object &&
object.branch === "master" &&
'current_hash' in object &&
'remote_hash' in object &&
object.current_hash !== object.remote_hash &&
'owner' in object
)
},
updateModule(key) {
if (["klipper", "moonraker"].includes(key)) this.$socket.sendObj('machine.update.'+key, { })
else this.$socket.sendObj('machine.update.client', { name: key })
@@ -171,6 +279,60 @@
updateSystem() {
this.$socket.sendObj('machine.update.system', { })
},
openCommitsOverlay(key, object) {
if (
['klipper', 'moonraker'].includes(key) &&
this.getVersionClickable(object) &&
'owner' in object
) {
this.commitsOverlay.bool = true
this.commitsOverlay.loading = true
const apiUrl = "https://api.github.com/repos/"+object.owner+"/"+key+"/commits"
if (apiUrl) {
axios
.get(apiUrl)
.then(response => {
this.commitsOverlay.response = response
this.commitsOverlay.outputs.splice(0, this.commitsOverlay.outputs.length)
const index = response.data.findIndex(commit => commit.sha === object.current_hash)
if (index !== -1) {
this.commitsOverlay.response = response.data.splice(0, index).sort((a,b) => {
const dataA = new Date(a.commit.author.date)
const dataB = new Date(b.commit.author.date)
return dataB - dataA
})
this.commitsOverlay.response.forEach(commit => {
const date = new Date(commit.commit.author.date)
const author = commit.commit.author.name
const firstIndex = commit.commit.message.indexOf('\n\n')
let lastIndex = commit.commit.message.lastIndexOf('\n\n')
if (firstIndex === lastIndex && commit.commit.message.lastIndexOf('\r') > firstIndex) {
lastIndex = commit.commit.message.lastIndexOf('\r')
}
this.commitsOverlay.outputs.push({
sha: commit.sha,
date: date,
author: author,
url: commit.html_url,
title: commit.commit.message.substr(0, firstIndex),
message: (firstIndex+2 < lastIndex-2) ? commit.commit.message.substr(firstIndex+2, lastIndex-firstIndex-2) : "",
firstIndex: firstIndex,
lastIndex: lastIndex,
})
})
}
this.commitsOverlay.loading = false
})
}
}
},
}
}
</script>
+42 -12
View File
@@ -6,23 +6,33 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-webcam</v-icon>{{ $t('Setting.Webcam') }}</span>
<span class="subheading"><v-icon left>mdi-webcam</v-icon>{{ $t('Settings.WebcamPanel.Webcam') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text>
<v-container px-0 py-0>
<v-row>
<v-col class="pt-2 mb-1">
<v-col class="py-2">
<v-select v-model="service" :items="serviceItems" hide-details :label="$t('Settings.WebcamPanel.Service')" class="mt-0"></v-select>
</v-col>
</v-row>
<v-row v-if="service === 'mjpegstreamer-adaptive'">
<v-col class="py-2 mt-2">
<v-text-field v-model="targetFps" hide-details label="Target FPS" class="mt-0"></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col class="pt-2 mt-2 mb-1">
<v-text-field
v-model="webcamUrl"
hide-details
:label="$t('Setting.WebcamURL')"
:label="$t('Settings.WebcamPanel.WebcamURL')"
></v-text-field>
</v-col>
</v-row>
<v-row v-if="rotationEnabled">
<v-col class="py-2" col-auto>
<v-switch v-model="rotate" hide-details :label="$t('Setting.Rotate')" class="mt-0"></v-switch>
<v-switch v-model="rotate" hide-details :label="$t('Settings.WebcamPanel.Rotate')" class="mt-0"></v-switch>
</v-col>
<v-col>
<v-select :items="[{ text: '90 degrees', value: 90 }, { text: '270 degrees', value: 270 }]" v-model="rotateDegrees" hide-details></v-select>
@@ -30,17 +40,17 @@
</v-row>
<v-row>
<v-col class="py-2">
<v-switch v-model="flipX" hide-details :label="$t('Setting.FlipWebcamHorizontally')" class="mt-0"></v-switch>
<v-switch v-model="flipX" hide-details :label="$t('Settings.WebcamPanel.FlipWebcamHorizontally')" class="mt-0"></v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-switch v-model="flipY" hide-details :label="$t('Setting.FlipWebcamVertically')" class="mt-0"></v-switch>
<v-switch v-model="flipY" hide-details :label="$t('Settings.WebcamPanel.FlipWebcamVertically')" class="mt-0"></v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-switch v-model="boolNavi" hide-details :label="$t('Setting.ShowInNavigation')" class="mt-0"></v-switch>
<v-switch v-model="boolNavi" hide-details :label="$t('Settings.WebcamPanel.ShowInNavigation')" class="mt-0"></v-switch>
</v-col>
</v-row>
</v-container>
@@ -55,7 +65,11 @@
},
data: function() {
return {
rotationEnabled: false
rotationEnabled: false,
serviceItems: [
{ value: 'mjpegstreamer', text: 'MJPEG-Streamer' },
{ value: 'mjpegstreamer-adaptive', text: 'Adaptive MJPEG-Streamer (experimental)' },
]
}
},
computed: {
@@ -64,7 +78,7 @@
return this.$store.state.gui.webcam.url;
},
set(url) {
return this.$store.dispatch('gui/setSettings', { webcam: { url } });
return this.$store.dispatch('gui/setSettings', { webcam: { url: url } })
}
},
flipX: {
@@ -72,7 +86,7 @@
return this.$store.state.gui.webcam.flipX;
},
set(flipX) {
return this.$store.dispatch('gui/setSettings', { webcam: { flipX } });
return this.$store.dispatch('gui/setSettings', { webcam: { flipX: flipX } });
}
},
flipY: {
@@ -80,7 +94,7 @@
return this.$store.state.gui.webcam.flipY;
},
set(flipY) {
return this.$store.dispatch('gui/setSettings', { webcam: { flipY } });
return this.$store.dispatch('gui/setSettings', { webcam: { flipY: flipY } });
}
},
rotate: {
@@ -96,7 +110,7 @@
return this.$store.state.gui.webcam.rotateDegrees;
},
set(rotateDegrees) {
return this.$store.dispatch('gui/setSettings', { webcam: { rotateDegrees } });
return this.$store.dispatch('gui/setSettings', { webcam: { rotateDegrees: rotateDegrees } });
}
},
boolNavi: {
@@ -107,6 +121,22 @@
return this.$store.dispatch('gui/setSettings', { webcam: { bool: showNav } });
}
},
service: {
get() {
return this.$store.state.gui.webcam.service;
},
set(selectedMethod) {
return this.$store.dispatch('gui/setSettings', { webcam: { service: selectedMethod } });
}
},
targetFps: {
get() {
return this.$store.state.gui.webcam.targetFps;
},
set(fps) {
return this.$store.dispatch('gui/setSettings', { webcam: { targetFps: fps } });
}
}
},
methods: {
+64 -60
View File
@@ -17,7 +17,7 @@
<v-toolbar flat dense>
<v-toolbar-title>
<span class="subheading align-baseline">
<v-icon left>mdi-information</v-icon>{{ (printer_state !== "" ? printer_state.charAt(0).toUpperCase() + printer_state.slice(1) : $t("Dashboard.Unknown")) }}
<v-icon left>mdi-information</v-icon>{{ (printer_state !== "" ? printer_state.charAt(0).toUpperCase() + printer_state.slice(1) : $t("Panels.StatusPanel.Unknown")) }}
</span>
</v-toolbar-title>
<v-spacer></v-spacer>
@@ -27,15 +27,7 @@
<template v-slot:activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" small>mdi-pause</v-icon>
</template>
<span>{{ $t("Dashboard.PausePrint") }}</span>
</v-tooltip>
</v-btn>
<v-btn small class="px-2 minwidth-0" color="red" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintCancel')" @click="btnCancelJob">
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" small>mdi-stop</v-icon>
</template>
<span>{{ $t("Dashboard.CancelPrint") }}</span>
<span>{{ $t("Panels.StatusPanel.PausePrint") }}</span>
</v-tooltip>
</v-btn>
<v-btn small class="px-2 minwidth-0" color="orange" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintResume')" @click="btnResumeJob">
@@ -43,7 +35,15 @@
<template v-slot:activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" small>mdi-play</v-icon>
</template>
<span>{{ $t("Dashboard.ResumePrint") }}</span>
<span>{{ $t("Panels.StatusPanel.ResumePrint") }}</span>
</v-tooltip>
</v-btn>
<v-btn small class="px-2 minwidth-0" color="red" v-if="(printer_state === 'paused' || (displayCancelPrint && printer_state === 'printing'))" :loading="loadings.includes('statusPrintCancel')" @click="btnCancelJob">
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" small>mdi-stop</v-icon>
</template>
<span>{{ $t("Panels.StatusPanel.CancelPrint") }}</span>
</v-tooltip>
</v-btn>
<v-btn small class="px-2 minwidth-0" color="primary" v-if="['error', 'complete'].includes(printer_state)" :loading="loadings.includes('statusPrintClear')" @click="btnClearJob">
@@ -51,7 +51,7 @@
<template v-slot:activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" small>mdi-broom</v-icon>
</template>
<span>{{ $t("Dashboard.ClearPrintStats") }}</span>
<span>{{ $t("Panels.StatusPanel.ClearPrintStats") }}</span>
</v-tooltip>
</v-btn>
<v-btn small class="px-2 minwidth-0" color="primary" v-if="['error', 'complete'].includes(printer_state)" :loading="loadings.includes('statusPrintReprint')" @click="btnReprintJob">
@@ -59,7 +59,7 @@
<template v-slot:activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" small>mdi-printer</v-icon>
</template>
<span>{{ $t("Dashboard.ReprintJob") }}</span>
<span>{{ $t("Panels.StatusPanel.ReprintJob") }}</span>
</v-tooltip>
</v-btn>
</v-item-group>
@@ -108,22 +108,22 @@
current_file.thumbnails.length &&
current_file.thumbnails.find(element => element.width >= 300 && element.width <= 400)) ? 'col-12 col-sm-8' : 'col-12'
">
<v-row class="text-center" align="center">
<v-col class="flex-grow-0 py-2">
<v-row class="text-center py-4" align="center">
<v-col class="flex-grow-0 py-0">
<v-icon>mdi-axis-arrow</v-icon>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>X</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ position.length ? position[0].toFixed(2) : "--" }}</v-col></v-row>
<v-col class="equal-width py-0">
<v-row><v-col class="pa-0"><strong>{{ $t("Panels.StatusPanel.X") }}</strong></v-col></v-row>
<v-row><v-col class="pa-0">{{ position.length ? position[0].toFixed(2) : "--" }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>Y</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ position.length ? position[1].toFixed(2) : "--" }}</v-col></v-row>
<v-col class="equal-width py-0">
<v-row><v-col class="pa-0"><strong>{{ $t("Panels.StatusPanel.Y") }}</strong></v-col></v-row>
<v-row><v-col class="pa-0">{{ position.length ? position[1].toFixed(2) : "--" }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>Z</strong></v-col></v-row>
<v-col class="equal-width py-0">
<v-row><v-col class="pa-0"><strong>{{ $t("Panels.StatusPanel.Z") }}</strong></v-col></v-row>
<v-row>
<v-col class="px-0 pt-1">
<v-col class="pa-0">
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
@@ -136,18 +136,18 @@
</v-col>
</v-row>
<v-row v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state) ">
<v-col class="px-0">
<v-col class="pa-0">
<v-divider></v-divider>
</v-col>
</v-row>
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state) ">
<v-col class="flex-grow-0 py-2">
<v-row class="text-center py-4" align="center" v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state) ">
<v-col class="flex-grow-0 py-0">
<v-icon>mdi-poll</v-icon>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Filament") }}</strong></v-col></v-row>
<v-col class="equal-width py-0">
<v-row><v-col class="pa-0"><strong>{{ $t("Panels.StatusPanel.Filament") }}</strong></v-col></v-row>
<v-row>
<v-col class="px-0 pt-1">
<v-col class="pa-0">
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<span v-bind="attrs" v-on="on" v-if="filament_used >= 1000" class=" text-no-wrap">{{ (filament_used / 1000).toFixed(2) }} m</span>
@@ -158,57 +158,58 @@
</v-col>
</v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Print") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ formatTime(print_time) }}</v-col></v-row>
<v-col class="equal-width py-0">
<v-row><v-col class="pa-0"><strong>{{ $t("Panels.StatusPanel.Print") }}</strong></v-col></v-row>
<v-row><v-col class="pa-0">{{ formatTime(print_time) }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Total") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ formatTime(print_time_total) }}</v-col></v-row>
<v-col class="equal-width py-0">
<v-row><v-col class="pa-0"><strong>{{ $t("Panels.StatusPanel.Total") }}</strong></v-col></v-row>
<v-row><v-col class="pa-0">{{ formatTime(print_time_total) }}</v-col></v-row>
</v-col>
</v-row>
<v-row v-if="['printing', 'paused', 'error'].includes(printer_state) ">
<v-col class="px-0">
<v-col class="pa-0">
<v-divider></v-divider>
</v-col>
</v-row>
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state)">
<v-col class="flex-grow-0 py-2">
<v-row class="text-center py-4" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state)">
<v-col class="flex-grow-0 py-0">
<v-icon>mdi-printer-3d</v-icon>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Speed") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1 text-no-wrap">{{ (requested_speed / 60).toFixed(0) }} mm/s</v-col></v-row>
<v-col class="equal-width py-0">
<v-row><v-col class="pa-0"><strong>{{ $t("Panels.StatusPanel.Speed") }}</strong></v-col></v-row>
<v-row><v-col class="pa-0 text-no-wrap">{{ (requested_speed / 60 * speed_factor).toFixed(0) }} mm/s</v-col></v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Layer") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1 text-no-wrap">{{ current_layer }} of {{ max_layers }}</v-col></v-row>
<v-col class="equal-width py-0">
<v-row><v-col class="pa-0"><strong>{{ $t("Panels.StatusPanel.Layer") }}</strong></v-col></v-row>
<v-row><v-col class="pa-0 text-no-wrap">{{ current_layer }} of {{ max_layers }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.ETA") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ eta ? formatDateTime(eta) : '--' }}</v-col></v-row>
<v-col class="equal-width py-0">
<v-row><v-col class="pa-0"><strong>{{ $t("Panels.StatusPanel.ETA") }}</strong></v-col></v-row>
<v-row><v-col class="pa-0">{{ eta ? formatDateTime(eta) : '--' }}</v-col></v-row>
</v-col>
</v-row>
<v-row v-if="['printing', 'paused', 'error'].includes(printer_state) ">
<v-col class="px-0">
<v-col class="pa-0">
<v-divider></v-divider>
</v-col>
</v-row>
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state) ">
<v-col class="flex-grow-0 py-2">
<v-row class="text-center py-4" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state) ">
<v-col class="flex-grow-0 py-0">
<v-icon>mdi-clock-outline</v-icon>
</v-col>
<v-col class="equal-width py-2 ">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.File") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ estimated_time_file ? formatTime(estimated_time_file) : '--' }}</v-col></v-row>
<v-col class="equal-width py-0 ">
<v-row><v-col class="pa-0"><strong>{{ $t("Panels.StatusPanel.File") }}</strong></v-col></v-row>
<v-row><v-col class="pa-0">{{ estimated_time_file ? formatTime(estimated_time_file) : '--' }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Filament") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ estimated_time_filament ? formatTime(estimated_time_filament) : '--' }}</v-col></v-row>
<v-col class="equal-width py-0">
<v-row><v-col class="pa-0"><strong>{{ $t("Panels.StatusPanel.Filament") }}</strong></v-col></v-row>
<v-row><v-col class="pa-0">{{ estimated_time_filament ? formatTime(estimated_time_filament) : '--' }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Slicer") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ estimated_time_slicer ? formatTime(estimated_time_slicer) : '--' }}</v-col></v-row>
<v-col class="equal-width py-0">
<v-row><v-col class="pa-0"><strong>{{ $t("Panels.StatusPanel.Slicer") }}</strong></v-col></v-row>
<v-row><v-col class="pa-0">{{ estimated_time_slicer ? formatTime(estimated_time_slicer) : '--' }}</v-col></v-row>
</v-col>
</v-row>
</v-col>
@@ -233,6 +234,7 @@
position: state => state.printer.toolhead.position,
gcode_position: state => state.printer.gcode_move.gcode_position,
requested_speed: state => state.printer.gcode_move.speed,
speed_factor: state => state.printer.gcode_move.speed_factor,
printProgress: state => state.printer.virtual_sdcard.progress,
file_position: state => state.printer.virtual_sdcard.file_position,
@@ -247,6 +249,8 @@
display_message: state => state.printer.display_status.message,
loadings: state => state.socket.loadings,
displayCancelPrint: state => state.gui.general.displayCancelPrint,
}),
printPercent: {
get() {
+44 -39
View File
@@ -12,10 +12,12 @@
}
.datasetColorSymbol {
width: 15px;
height: 15px;
width: 8px;
height: 8px;
border-style: solid;
border-width: 1px;
border-width: 0px;
cursor: pointer;
border-radius: 50%;
}
</style>
@@ -25,13 +27,13 @@
<v-card>
<v-toolbar flat dense>
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-thermometer-lines</v-icon>{{ $t("Dashboard.Temperatures") }}</span>
<span class="subheading"><v-icon left>mdi-thermometer-lines</v-icon>{{ $t("Panels.ToolsPanel.Temperatures") }}</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-item-group class="v-btn-toggle" name="controllers">
<v-menu :offset-y="true" title="Preheat" v-if="this['gui/getPreheatPresets'].length">
<template v-slot:activator="{ on, attrs }">
<v-btn small class="px-2 minwidth-0" color="primary" v-bind="attrs" v-on="on" :disabled="['printing', 'paused'].includes(printer_state)">{{ $t("Dashboard.Presets") }} <v-icon small>mdi-menu-down</v-icon></v-btn>
<v-btn small class="px-2 minwidth-0" color="primary" v-bind="attrs" v-on="on" :disabled="['printing', 'paused'].includes(printer_state)">{{ $t("Panels.ToolsPanel.Presets") }} <v-icon small>mdi-menu-down</v-icon></v-btn>
</template>
<v-list dense class="py-0">
<v-list-item v-for="preset of this['gui/getPreheatPresets']" v-bind:key="preset.index" link @click="preheat(preset)">
@@ -50,35 +52,35 @@
<v-icon small>mdi-snowflake</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>{{ $t("Dashboard.Cooldown") }}</v-list-item-title>
<v-list-item-title>{{ $t("Panels.ToolsPanel.Cooldown") }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list>
</v-menu>
<v-btn small class="px-2 minwidth-0" color="primary" @click="cooldown()" v-if="this['gui/getPreheatPresets'].length === 0"><v-icon small class="mr-1">mdi-snowflake</v-icon>{{ $t("Dashboard.Cooldown") }}</v-btn>
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Dashboard.SetupTemperatures')">
<v-btn small class="px-2 minwidth-0" color="primary" @click="cooldown()" v-if="this['gui/getPreheatPresets'].length === 0"><v-icon small class="mr-1">mdi-snowflake</v-icon>{{ $t("Panels.ToolsPanel.Cooldown") }}</v-btn>
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Panels.ToolsPanel.SetupTemperatures')">
<template v-slot:activator="{ on, attrs }">
<v-btn small class="px-2 minwidth-0" color="grey darken-3" v-bind="attrs" v-on="on"><v-icon small>mdi-cog</v-icon></v-btn>
</template>
<v-list>
<v-list-item class="minHeight36">
<v-checkbox class="mt-0" v-model="boolTempchart" hide-details :label="$t('Dashboard.ShowChart')"></v-checkbox>
<v-checkbox class="mt-0" v-model="boolTempchart" hide-details :label="$t('Panels.ToolsPanel.ShowChart')"></v-checkbox>
</v-list-item>
<v-list-item class="minHeight36">
<v-checkbox class="mt-0" v-model="autoscaleTempchart" hide-details :label="$t('Dashboard.AutoscaleChart')"></v-checkbox>
<v-checkbox class="mt-0" v-model="autoscaleTempchart" hide-details :label="$t('Panels.ToolsPanel.AutoscaleChart')"></v-checkbox>
</v-list-item>
</v-list>
</v-menu>
</v-item-group>
</v-toolbar>
<v-card-text class="px-0 py-2 content">
<v-card-text class="pa-0 content">
<v-container class="px-0">
<v-row align="center">
<v-col class="py-2 font-weight-bold" style="padding-left: 68px;">{{ $t("Dashboard.Name") }}</v-col>
<v-col class="py-2 text-center flex-grow-0 font-weight-bold d-none d-sm-block" style="min-width: 70px;">{{ $t("Dashboard.Color") }}Color</v-col>
<v-col class="py-2 text-center font-weight-bold d-none d-sm-block">{{ $t("Dashboard.State") }}</v-col>
<v-col class="py-2 text-center font-weight-bold">{{ $t("Dashboard.Current") }}</v-col>
<v-col class="py-2 pr-8 text-center font-weight-bold">{{ $t("Dashboard.Target") }}</v-col>
<v-col class="py-2 font-weight-bold" style="padding-left: 68px;">{{ $t("Panels.ToolsPanel.Name") }}</v-col>
<v-col class="py-2 text-center flex-grow-0 font-weight-bold d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">{{ $t("Panels.ToolsPanel.Color") }}</v-col>
<v-col class="py-2 text-center font-weight-bold d-none d-sm-block">{{ $t("Panels.ToolsPanel.State") }}</v-col>
<v-col class="py-2 text-center font-weight-bold">{{ $t("Panels.ToolsPanel.Current") }}</v-col>
<v-col class="py-2 pr-8 text-center font-weight-bold">{{ $t("Panels.ToolsPanel.Target") }}</v-col>
</v-row>
<div v-for="(heater, index) in heaters" v-bind:key="index" >
<v-divider class="my-2"></v-divider>
@@ -87,8 +89,8 @@
<v-icon :color="heater.color">mdi-{{ heater.icon }}</v-icon>
</v-col>
<v-col class="py-2 font-weight-bold"><span style="cursor: pointer;" @click="openHeater(heater)">{{ convertName(heater.name) }}</span></v-col>
<v-col class="py-2 flex-grow-0 text-center d-none d-sm-block" style="min-width: 70px;">
<div :style="'background-color: '+heater.chartColor+'66; border-color: '+heater.chartColor+'; cursor: pointer;'" class="datasetColorSymbol d-inline-block" @click="openHeater(heater)"></div>
<v-col class="py-2 flex-grow-0 text-center d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">
<div :style="'background-color: '+heater.chartColor+'cc;'" class="datasetColorSymbol d-inline-block" @click="openHeater(heater)"></div>
</v-col>
<v-col class="py-2 text-center d-none d-sm-block"><small>{{ heater.target > 0 ? (heater.power !== null ? (heater.power > 0 ? (heater.power * 100).toFixed(0)+'%' : "0%") : "active") : "off" }}</small></v-col>
<v-col class="py-2 text-center">
@@ -107,13 +109,16 @@
<v-icon :color="(fan.target ? 'grey lighten-5' : 'grey darken-2')" :class="(fan.speed ? ' icon-rotate' : '')">mdi-fan</v-icon>
</v-col>
<v-col class="py-2 font-weight-bold"><span style="cursor: pointer;" @click="openHeater(fan)">{{ convertName(fan.name) }}</span></v-col>
<v-col class="py-2 flex-grow-0 text-center d-none d-sm-block" style="min-width: 70px;">
<div :style="'background-color: '+fan.chartColor+'66; border-color: '+fan.chartColor+'; cursor: pointer;'" class="datasetColorSymbol d-inline-block" @click="openHeater(fan)"></div>
<v-col class="py-2 flex-grow-0 text-center d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">
<div :style="'background-color: '+fan.chartColor+'cc;'" class="datasetColorSymbol d-inline-block" @click="openHeater(fan)"></div>
</v-col>
<v-col class="py-2 text-center d-none d-sm-block">
<small class="d-block">{{ fan.target > 0 && fan.speed > 0 ? (fan.speed * 100).toFixed(0)+"%" : (fan.target > 0 ? "standby" : "off") }}</small>
</v-col>
<v-col class="py-2 text-center d-none d-sm-block"><small>{{ fan.target > 0 && fan.speed > 0 ? (fan.speed * 100).toFixed(0)+"%" : (fan.target > 0 ? "standby" : "off") }}</small></v-col>
<v-col class="py-2 text-center">
<span class="d-block">{{ fan.temperature ? fan.temperature.toFixed(1) : 0}}°C</span>
<span v-for="(values, key) of fan.tempListAdditionValues" v-bind:key="key" class="d-block"><small>{{ values.value.toFixed(1) }} {{ values.unit }}</small></span>
<small v-if="fan.rpm || fan.rpm === 0" :class="'d-block ' + (fan.rpm === 0 && fan.speed > 0 ? 'red--text' : '')">{{ Math.round(fan.rpm) }} RPM</small>
</v-col>
<v-col class="text-center py-2 pr-8 pr-0 vertical_align_center">
<toolInput :name="fan.name" :target="fan.target" command="SET_TEMPERATURE_FAN_TARGET" attribute-name="temperature_fan" :items="fan.presets" ></toolInput>
@@ -124,13 +129,13 @@
<v-divider class="my-2"></v-divider>
<v-row align="center">
<v-col class="flex-grow-0 py-2 pl-8 pr-0 colHeaterIcons">
<v-icon color="grey darken-2" :title="$t('Dashboard.Min')+sensor.min_temp+'° / ' + $t('Dashboard.Max')+sensor.max_temp+'°'">{{ sensor.icon }}</v-icon>
<v-icon color="grey darken-2" :title="$t('Panels.ToolsPanel.Min')+sensor.min_temp+'° / ' + $t('Panels.ToolsPanel.Max')+sensor.max_temp+'°'">{{ sensor.icon }}</v-icon>
</v-col>
<v-col class="py-2 font-weight-bold">
<span style="cursor: pointer;" @click="openHeater(sensor)">{{ convertName(sensor.name) }}</span>
</v-col>
<v-col class="py-2 flex-grow-0 text-center d-none d-sm-block" style="min-width: 70px;">
<div :style="'background-color: '+sensor.chartColor+'66; border-color: '+sensor.chartColor+'; cursor: pointer;'" class="datasetColorSymbol d-inline-block" @click="openHeater(sensor)"></div>
<v-col class="py-2 flex-grow-0 text-center d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">
<div :style="'background-color: '+sensor.chartColor+'CC;'" class="datasetColorSymbol d-inline-block" @click="openHeater(sensor)"></div>
</v-col>
<v-col class="py-2 d-none d-sm-block"><span>&nbsp;</span></v-col>
<v-col class="py-2 text-center">
@@ -143,7 +148,7 @@
v-on="on"
>{{ sensor.temperature ? sensor.temperature.toFixed(1) : 0 }}°C</span>
</template>
<span>{{ $t('Dashboard.Min') }}{{ sensor.measured_min_temp ? sensor.measured_min_temp.toFixed(1) : 0}}°<br />{{ $t('Dashboard.Max')}}{{ sensor.measured_max_temp ? sensor.measured_max_temp.toFixed(1) : 0 }}°</span>
<span>{{ $t('Panels.ToolsPanel.Min') }}{{ sensor.measured_min_temp ? sensor.measured_min_temp.toFixed(1) : 0}}°<br />{{ $t('Panels.ToolsPanel.Max')}}{{ sensor.measured_max_temp ? sensor.measured_max_temp.toFixed(1) : 0 }}°</span>
</v-tooltip>
<span v-for="(values, key) of sensor.tempListAdditionValues" v-bind:key="key" class="d-block"><small>{{ values.value.toFixed(1) }} {{ values.unit }}</small></span>
</v-col>
@@ -165,19 +170,19 @@
<v-toolbar-title>
<span class="subheading">
<v-icon left>mdi-{{ 'icon' in editHeater.object ? editHeater.object.icon : "info" }}</v-icon>
{{ 'name' in editHeater.object ? convertName(editHeater.object.name) : "UNKNOWN" }}
{{ 'name' in editHeater.object ? convertName(editHeater.object.name) : $t('Panels.ToolsPanel.UNKNOWN') }}
</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn small class="minwidth-0" @click="editHeater.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
</v-toolbar>
<v-card-text class="pt-3">
<v-card-text class="pt-6">
<v-container class="px-0 py-0">
<v-row v-if="'chartTemperature' in editHeater.object && editHeater.object.chartTemperature">
<v-col class="col-12">
<v-col class="col-12 py-1">
<v-checkbox
v-model="editHeater.boolTemperature"
:label="$t('Dashboard.ShowCurrentTemperatureInChart')"
:label="$t('Panels.ToolsPanel.ShowCurrentTemperatureInChart')"
hide-details
class="mt-0"
@change="setVisible('temperature')"
@@ -185,10 +190,10 @@
</v-col>
</v-row>
<v-row v-if="'chartTarget' in editHeater.object && editHeater.object.chartTarget">
<v-col class="col-12">
<v-col class="col-12 py-1">
<v-checkbox
v-model="editHeater.boolTarget"
:label="$t('Dashboard.ShowTargetTemperatureInChart')"
:label="$t('Panels.ToolsPanel.ShowTargetTemperatureInChart')"
hide-details
class="mt-0"
@change="setVisible('target')"
@@ -196,10 +201,10 @@
</v-col>
</v-row>
<v-row v-if="'chartPower' in editHeater.object && editHeater.object.chartPower">
<v-col class="col-12">
<v-col class="col-12 py-1">
<v-checkbox
v-model="editHeater.boolPower"
:label="$t('Dashboard.ShowPWMPowerInChart')"
:label="$t('Panels.ToolsPanel.ShowPWMPowerInChart')"
hide-details
class="mt-0"
@change="setVisible('power')"
@@ -207,10 +212,10 @@
</v-col>
</v-row>
<v-row v-if="'chartSpeed' in editHeater.object && editHeater.object.chartSpeed">
<v-col class="col-12">
<v-col class="col-12 py-1">
<v-checkbox
v-model="editHeater.boolSpeed"
:label="$t('Dashboard.ShowPWMPowerInChart')"
:label="$t('Panels.ToolsPanel.ShowPWMPowerInChart')"
hide-details
class="mt-0"
@change="setVisible('speed')"
@@ -218,10 +223,10 @@
</v-col>
</v-row>
<v-row v-for="key in Object.keys(editHeater.additionSensors)" v-bind:key="key">
<v-col class="col-12">
<v-col class="col-12 py-1">
<v-checkbox
v-model="editHeater.additionSensors[key]"
:label="$t('Dashboard.Show')+key+$t('Dashboard.InList')"
:label="$t('Panels.ToolsPanel.Show')+key+$t('Panels.ToolsPanel.InList')"
hide-details
class="mt-0"
@change="setVisibleAdditionalSensor(key)"
@@ -229,7 +234,7 @@
</v-col>
</v-row>
<v-row>
<v-col class="col-12 text-center">
<v-col class="col-12 text-center py-0">
<v-color-picker
hide-canvas
hide-mode-switch
@@ -277,7 +282,7 @@
datasets: state => state.printer.tempHistory.datasets,
boolTempchart: state => state.gui.dashboard.boolTempchart,
printer: state => state.printer,
cooldownGcode: state => state.gui.cooldownGcode,
cooldownGcode: state => state.gui.cooldown_gcode,
printer_state: state => state.printer.print_stats.state,
}),
...mapGetters([
+77 -11
View File
@@ -5,14 +5,17 @@
</style>
<template>
<v-card>
<v-card v-observe-visibility="visibilityChanged">
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-webcam</v-icon>{{ $t('Setting.Webcam')}}</span>
<span class="subheading">
<v-icon left>mdi-webcam</v-icon> {{ $t('Panels.WebcamPanel.Webcam')}}
<small v-if="this.webcamConfig.service === 'mjpegstreamer-adaptive' && this.time">( {{ $t('Panels.WebcamPanel.FPS')}}: {{ currentFPS }})</small>
</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="px-0 py-0 content">
<img :src="url" class="webcamImage" :style="webcamStyle" :alt="$t('Setting.Webcam')"/>
<img :src="url" class="webcamImage" :style="webcamStyle" @load="onLoad" alt="Webcam" v-if="['mjpegstreamer', 'mjpegstreamer-adaptive'].includes(this.webcamConfig.service)" />
</v-card-text>
</v-card>
</template>
@@ -23,12 +26,28 @@
export default {
data: function() {
return {
refresh: Math.ceil(Math.random() * Math.pow(10, 12))
}
refresh: Math.ceil(Math.random() * Math.pow(10, 12)),
connection: "",
imageData: "",
request_start_time: performance.now(),
start_time: performance.now(),
time: 0,
request_time: 0,
time_smoothing: 0.6,
request_time_smoothing: 0.1,
isVisible: true,
currentFPS: 0,
};
},
created: function () {
document.addEventListener("focus", () => this.handleRefreshChange(), false);
document.addEventListener("visibilitychange", this.handleRefreshChange, false);
if(this.webcamConfig.service === 'mjpegstreamer-adaptive') {
this.requestMjpeg()
}
},
components: {
@@ -37,14 +56,20 @@
...mapState({
'webcamConfig': state => state.gui.webcam
}),
url() {
let basicUrl = this.webcamConfig.url
if (basicUrl && basicUrl.indexOf("?") === -1) basicUrl += "?"
const params = new URLSearchParams(basicUrl)
params.set('bypassCache', ""+this.refresh)
return decodeURIComponent(params.toString())
url() {
if (this.webcamConfig.service === 'mjpegstreamer' && this.webcamConfig.url.indexOf("?") !== -1) {
let basicUrl = this.webcamConfig.url
const params = new URLSearchParams(basicUrl)
params.set('bypassCache', ""+this.refresh)
return decodeURIComponent(params.toString())
} else if (this.webcamConfig.service === 'mjpegstreamer-adaptive') {
return this.imageData
} else {
return this.webcamConfig.url
}
},
webcamStyle() {
let transforms = '';
if (this.webcamConfig.flipX) {
@@ -69,6 +94,47 @@
if (!document.hidden) {
this.refresh = Math.ceil(Math.random() * Math.pow(10, 12))
}
},
onLoad() {
const end_time = performance.now()
const current_time = end_time - this.start_time
this.time = (this.time * this.time_smoothing) + (current_time * (1.0 - this.time_smoothing))
this.start_time = end_time
const target_time = 1000/this.webcamConfig.targetFps
const current_request_time = performance.now() - this.request_start_time
this.request_time = (this.request_time * this.request_time_smoothing) + (current_request_time * (1.0 - this.request_time_smoothing))
const timeout = Math.max(0, target_time - this.request_time)
this.$nextTick(() => {
setTimeout(this.requestMjpeg, timeout)
})
},
requestMjpeg() {
if(!this.isVisible) return
this.request_start_time = performance.now()
let basicUrl = this.webcamConfig.url
basicUrl = basicUrl.replace("action=stream", "action=snapshot")
if (basicUrl && basicUrl.indexOf("?") === -1) basicUrl += "?"
const params = new URLSearchParams(basicUrl)
params.set('bypassCache', ""+ this.refresh + (Math.random() * 1000))
this.currentFPS = Math.round(1000 / this.time)
this.$nextTick(() => {
this.imageData = decodeURIComponent(params.toString())
})
},
visibilityChanged(isVisible) {
this.isVisible = isVisible
if(isVisible) this.requestMjpeg()
}
}
}
+3 -3
View File
@@ -6,15 +6,15 @@
<v-card v-if="(['printing', 'paused'].includes(printer_state))">
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon class="mdi mdi-arrow-collapse-vertical" left></v-icon>{{ $t("Dashboard.ZBabyStepping") }}</span>
<span class="subheading"><v-icon class="mdi mdi-arrow-collapse-vertical" left></v-icon>{{ $t("Panels.ZOffsetPanel.ZBabyStepping") }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="px-0 py-0">
<v-container>
<v-row class="py-0">
<v-col class="col text-center">
<p class="mb-0">{{ $t("Dashboard.CurrentOffset") }} {{ homing_origin.length > 1 ? homing_origin[2].toFixed(2) : 0.00 }}mm</p>
<v-col class="pb-0 text-center">
<p class="mb-0">{{ $t("Panels.ZOffsetPanel.CurrentOffset") }}{{ homing_origin.length > 1 ? homing_origin[2].toFixed(2) : 0.00 }}mm</p>
</v-col>
</v-row>
<v-row>
-2
View File
@@ -6,7 +6,6 @@ import MinSettingsPanel from './MinSettingsPanel.vue'
import MoonrakerFailedPluginsPanel from './MoonrakerFailedPluginsPanel.vue'
import ToolsPanel from './ToolsPanel.vue'
import ControlPanel from "./ControlPanel";
import ExtruderPanel from "./ExtruderPanel";
import ZOffsetPanel from "./ZOffsetPanel";
import Miscellaneous from "./MiscellaneousPanel";
import WebcamPanel from "./WebcamPanel";
@@ -20,7 +19,6 @@ Vue.component('min-settings-panel', MinSettingsPanel);
Vue.component('moonraker-failed-plugins-panel', MoonrakerFailedPluginsPanel);
Vue.component('tools-panel', ToolsPanel);
Vue.component('control-panel', ControlPanel);
Vue.component('extruder-panel', ExtruderPanel);
Vue.component('zoffset-panel', ZOffsetPanel);
Vue.component('miscellaneous-panel', Miscellaneous);
Vue.component('webcam-panel', WebcamPanel);