Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishamm committed Oct 21, 2019
2 parents df0551a + 8d94061 commit baeb5bd
Show file tree
Hide file tree
Showing 93 changed files with 3,159 additions and 2,729 deletions.
3 changes: 0 additions & 3 deletions .browserslistrc

This file was deleted.

17 changes: 0 additions & 17 deletions .eslintrc.js

This file was deleted.

1,508 changes: 931 additions & 577 deletions package-lock.json

Large diffs are not rendered by default.

59 changes: 43 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "duetwebcontrol",
"version": "2.0.2",
"version": "2.0.3",
"repository": "github:chrishamm/DuetWebControl",
"homepage": "https://forum.duet3d.com/category/27/duet-web-control",
"license": "GPL-3.0",
Expand All @@ -12,39 +12,66 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.18.1",
"axios": "^0.19.0",
"chart.js": "^2.8.0",
"core-js": "^2.6.5",
"file-saver": "^2.0.2",
"izitoast": "^1.4.0",
"jszip": "^3.2.2",
"piecon": "^0.5.0",
"roboto-fontface": "*",
"three": "^0.105.2",
"three-orbitcontrols": "2.102.2",
"three": "^0.109.0",
"three-orbitcontrols": "^2.108.1",
"turbo-crc32": "^1.0.1",
"vue": "^2.6.10",
"vue-i18n": "^8.14.1",
"vue-i18n": "^8.15.0",
"vue-router": "^3.1.3",
"vuetify": "^1.5.18",
"vuetify": "^2.1.5",
"vuex": "^3.1.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.11.0",
"@vue/cli-plugin-eslint": "^3.11.0",
"@vue/cli-service": "^3.11.0",
"@mdi/font": "^4.5.95",
"@vue/cli-plugin-babel": "^3.12.1",
"@vue/cli-plugin-eslint": "^3.12.1",
"@vue/cli-service": "^3.12.1",
"babel-eslint": "^10.0.3",
"babel-plugin-transform-builtin-extend": "^1.1.2",
"compression-webpack-plugin": "^2.0.0",
"core-js": "^2.6.9",
"compression-webpack-plugin": "^3.0.0",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.2.3",
"material-design-icons-iconfont": "^4.0.5",
"rimraf": "^2.7.1",
"eslint-plugin-vue": "^5.0.0",
"rimraf": "^3.0.0",
"sass": "^1.17.4",
"sass-loader": "^7.1.0",
"stylus": "^0.54.7",
"stylus-loader": "^3.0.1",
"vue-cli-plugin-vuetify": "^0.4.6",
"vue-cli-plugin-vuetify": "^1.1.0",
"vue-template-compiler": "^2.6.10",
"vuetify-loader": "^1.3.0",
"zip-webpack-plugin": "^3.0.0"
}
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {
"no-console": "off"
},
"parserOptions": {
"parser": "babel-eslint"
}
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
81 changes: 42 additions & 39 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
margin-right: 20px;
}
.container {
padding: 4px;
}
.container div.component,
.container div.v-card {
margin: 8px;
}
.empty-table-fix td {
padding-left: 0px !important;
padding-right: 0px !important;
Expand Down Expand Up @@ -45,85 +37,93 @@ a:not(:hover) {
text-decoration: none;
}
.theme--dark textarea {
caret-color: #FFF;
}
.v-item-group.theme--dark .v-btn__content {
color: #FFF !important;
}
.v-card__title {
font-size: 1rem;
}
</style>

<template>
<v-app :dark="darkTheme">
<v-navigation-drawer persistent clipped v-model="drawer" enable-resize-watcher fixed app>
<v-app>
<v-navigation-drawer v-model="drawer" clipped fixed app width="300">
<div class="pa-2 hidden-sm-and-up">
<connect-btn v-if="isLocal" class="mb-3" block></connect-btn>
<emergency-btn block></emergency-btn>
</div>

<v-list class="pt-0" :expand="$vuetify.breakpoint.mdAndUp">
<v-list-group v-for="(category, index) in routing" :key="index" :prepend-icon="category.icon" no-action :value="isExpanded(category)">
<v-list-tile slot="activator">
<v-list-tile-title>{{ $t(category.caption) }}</v-list-tile-title>
</v-list-tile>

<template v-for="(page, pageIndex) in category.pages">
<v-list-tile v-if="checkMenuCondition(page.condition)" :key="`${index}-${pageIndex}`" v-ripple :to="page.path" @click.prevent>
<v-list-tile-action>
<v-icon>{{ page.icon }}</v-icon>
</v-list-tile-action>
<v-list-tile-title>{{ $t(page.caption) }}</v-list-tile-title>
</v-list-tile>
<template #activator>
<v-list-item-title>{{ $t(category.caption) }}</v-list-item-title>
</template>

<v-list-item v-for="(page, pageIndex) in category.pages.filter(page => checkMenuCondition(page.condition))" :key="`${index}-${pageIndex}`" v-ripple :to="page.path" @click.prevent="">
<v-list-item-icon>
<v-icon>{{ page.icon }}</v-icon>
</v-list-item-icon>
<v-list-item-title>{{ $t(page.caption) }}</v-list-item-title>
</v-list-item>
</v-list-group>
</v-list>
</v-navigation-drawer>

<v-toolbar ref="appToolbar" app clipped-left>
<v-toolbar-side-icon @click.stop="drawer = !drawer" v-tab-control></v-toolbar-side-icon>
<v-app-bar ref="appToolbar" app clipped-left>
<v-app-bar-nav-icon @click.stop="drawer = !drawer">
<v-icon>mdi-menu</v-icon>
</v-app-bar-nav-icon>
<v-toolbar-title>
<!-- TODO: Optional OEM branding -->
<a id="title" v-tab-control>{{ name }}</a>
<a href="javascript:void(0)" id="title">{{ name }}</a>
</v-toolbar-title>
<connect-btn v-if="isLocal" class="hidden-xs-only"></connect-btn>

<v-spacer></v-spacer>

<code-input class="hidden-sm-and-down"></code-input>
<code-input class="mx-3 hidden-sm-and-down"></code-input>

<v-spacer></v-spacer>

<upload-btn target="start" class="hidden-sm-and-down"></upload-btn>
<upload-btn target="start" class="mr-3 hidden-sm-and-down"></upload-btn>
<emergency-btn class="hidden-xs-only"></emergency-btn>

<v-btn icon class="hidden-md-and-up" :class="toggleGlobalContainerColor" @click="hideGlobalContainer = !hideGlobalContainer">
<v-icon>aspect_ratio</v-icon>
<v-btn icon class="hidden-md-and-up ml-3" :class="toggleGlobalContainerColor" @click="hideGlobalContainer = !hideGlobalContainer">
<v-icon>mdi-aspect-ratio</v-icon>
</v-btn>
<!-- TODO: Add quick actions and UI designer here -->
<!--<v-btn icon class="hidden-sm-and-down" @click="rightDrawer = !rightDrawer">
<v-icon>menu</v-icon>
</v-btn>-->
</v-toolbar>
</v-app-bar>

<v-content id="content">
<v-scroll-y-transition>
<v-container fluid id="global-container" class="container" v-show="!hideGlobalContainer || $vuetify.breakpoint.mdAndUp">
<v-layout row wrap>
<v-flex xs12 sm6 md4 lg4>
<v-container v-show="!hideGlobalContainer || $vuetify.breakpoint.mdAndUp" id="global-container" fluid class="py-0">
<v-row>
<v-col>
<status-panel></status-panel>
</v-flex>
</v-col>

<v-flex xs12 sm6 md5 lg4>
<v-col>
<tools-panel></tools-panel>
</v-flex>
</v-col>

<v-flex v-if="$vuetify.breakpoint.mdAndUp" :d-flex="hasTemperaturesToDisplay" md3 lg4>
<v-col v-if="$vuetify.breakpoint.mdAndUp" :class="{ 'd-flex': hasTemperaturesToDisplay }">
<temperature-chart></temperature-chart>
</v-flex>
</v-layout>
</v-col>
</v-row>
</v-container>
</v-scroll-y-transition>

<v-divider v-show="!hideGlobalContainer || $vuetify.breakpoint.mdAndUp"></v-divider>

<v-container fluid id="page-container" class="container">
<v-container fluid class="pt-0">
<keep-alive>
<router-view></router-view>
</keep-alive>
Expand Down Expand Up @@ -240,6 +240,9 @@ export default {
});
},
watch: {
darkTheme(to) {
this.$vuetify.theme.dark = to;
},
isPrinting(to) {
if (to) {
// Go to Job Status when a print starts
Expand Down
2 changes: 1 addition & 1 deletion src/components/buttons/CodeBtn.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-btn v-bind="$props" :disabled="$props.disabled || uiFrozen" :loading="waitingForCode" @click="click" @contextmenu="$emit('contextmenu', $event)" tabindex="0">
<v-btn v-bind="$props" :disabled="$props.disabled || uiFrozen" :loading="waitingForCode" @click="click" @contextmenu="$emit('contextmenu', $event)">
<slot></slot>
</v-btn>
</template>
Expand Down
4 changes: 2 additions & 2 deletions src/components/buttons/ConnectBtn.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-btn v-bind="$props" :color="buttonColor" :depressed="isBusy" @click="clicked" tabindex="0">
<v-btn v-bind="$props" :color="buttonColor" :depressed="isBusy" @click="clicked">
<v-icon v-show="!isBusy">{{ buttonIcon }}</v-icon>
<v-progress-circular size="20" v-show="isBusy" indeterminate></v-progress-circular>
<span class="ml-2">{{ caption }}</span>
Expand All @@ -24,7 +24,7 @@ export default {
: (this.isConnected ? 'success' : 'primary');
},
buttonIcon() {
return this.isConnected ? 'close' : 'power_settings_new';
return this.isConnected ? 'mdi-close-circle-outline' : 'mdi-power';
},
caption() {
return this.$t((this.isConnecting || this.isReconnecting) ? 'button.connect.connecting'
Expand Down
2 changes: 1 addition & 1 deletion src/components/buttons/EmergencyBtn.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<code-btn v-bind="$props" :code="'M112\nM999'" color="$props.color || error" :disabled="$props.disabled || isDisabled" :title="$t('button.emergencyStop.title')">
<v-icon class="mr-1">flash_on</v-icon> {{ $t('button.emergencyStop.caption') }}
<v-icon class="mr-1">mdi-flash</v-icon> {{ $t('button.emergencyStop.caption') }}
</code-btn>
</template>

Expand Down
16 changes: 9 additions & 7 deletions src/components/buttons/SDCardBtn.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<template>
<v-menu offset-y v-if="storages.length > 1" v-tab-control.dynamic>
<v-btn slot="activator" color="success">
<v-icon class="mr-1">sd_storage</v-icon> {{ $t('generic.sdCard', [storageIndex]) }} <v-icon class="ml-1">arrow_drop_down</v-icon>
</v-btn>
<v-menu offset-y v-if="storages.length > 1">
<template #activator="{ on }">
<v-btn v-bind="$props" v-on="on" color="success">
<v-icon class="mr-1">mdi-sd</v-icon> {{ $t('generic.sdCard', [storageIndex]) }} <v-icon class="ml-1">mdi-menu-down</v-icon>
</v-btn>
</template>

<v-list ref="list">
<v-list-tile v-for="(storage, index) in storages" :key="index" @click="$emit('storageSelected', index)" v-tab-control>
<v-icon class="mr-1">{{ storage.mounted ? 'done' : 'clear' }}</v-icon>
<v-list-item v-for="(storage, index) in storages" :key="index" @click="$emit('storageSelected', index)">
<v-icon class="mr-1">{{ storage.mounted ? 'mdi-check' : 'mdi-close' }}</v-icon>
{{ $t('generic.sdCard', [index]) }} ({{ $t(storage.mounted ? 'generic.mounted' : 'generic.notMounted') }})
</v-list-tile>
</v-list-item>
</v-list>
</v-menu>
</template>
Expand Down
11 changes: 7 additions & 4 deletions src/components/buttons/UploadBtn.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<template>
<div>
<v-btn v-bind="$props" @click="chooseFile" :disabled="$props.disabled || !canUpload" :loading="isBusy" :title="$t(`button.upload['${target}'].title`)" :color="innerColor" @dragover="dragOver" @dragleave="dragLeave" @drop.prevent.stop="dragDrop" tabindex="0">
<template slot="loader">
<v-btn v-bind="$props" @click="chooseFile" :disabled="$props.disabled || !canUpload" :loading="isBusy" :title="$t(`button.upload['${target}'].title`)" :color="innerColor" @dragover="dragOver" @dragleave="dragLeave" @drop.prevent.stop="dragDrop">
<template #loader>
<v-progress-circular indeterminate :size="23" :width="2" class="mr-2"></v-progress-circular>
{{ caption }}
</template>
<v-icon class="mr-2">cloud_upload</v-icon> {{ caption }}

<slot>
<v-icon class="mr-2">mdi-cloud-upload</v-icon> {{ caption }}
</slot>
</v-btn>

<input ref="fileInput" type="file" :accept="accept" hidden @change="fileSelected" multiple>
Expand Down Expand Up @@ -265,7 +268,7 @@ export default {
this.updates.codeSent = true;
try {
await this.sendCode(`M997 S${modules.reduce((a, b) => `${a}:${b}`)}`);
await this.sendCode(`M997 S${modules.join(':')}`);
} catch (e) {
// this is expected
}
Expand Down
17 changes: 5 additions & 12 deletions src/components/charts/LayerChart.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
<style scoped>
.card {
display: flex;
flex-direction: column;
width: 100%;
}
.content {
position: relative;
flex-grow: 1;
min-height: 200px;
min-height: 180px;
}
.content > canvas {
Expand All @@ -17,18 +10,18 @@
</style>

<template>
<v-card class="card">
<v-card class="d-flex flex-column flex-grow-1">
<v-card-title>
<span>
<v-icon small class="mr-1">timeline</v-icon> {{ $t('chart.layer.caption') }}
<v-icon small class="mr-1">mdi-vector-polyline</v-icon> {{ $t('chart.layer.caption') }}
</span>
<v-spacer></v-spacer>
<a v-show="job.layers.length > 30" href="#" @click.prevent="showAllLayers = !showAllLayers">
<a v-show="job.layers.length > 30" href="javascript:void(0)" @click.prevent="showAllLayers = !showAllLayers">
{{ showAllLayers ? $t('chart.layer.showLastLayers', [30]) : $t('chart.layer.showAllLayers') }}
</a>
</v-card-title>

<v-card-text class="content px-2 py-0">
<v-card-text class="content flex-grow-1 px-2 py-0">
<canvas ref="chart"></canvas>
</v-card-text>
</v-card>
Expand Down
Loading

0 comments on commit baeb5bd

Please sign in to comment.