Added a proper indeterminate progress bar
This commit is contained in:
parent
e9fafd5dce
commit
3de9927cd2
4 changed files with 164 additions and 7 deletions
|
|
@ -66,9 +66,10 @@
|
||||||
<a class="uk-accordion-title" href="#">Autofocus</a>
|
<a class="uk-accordion-title" href="#">Autofocus</a>
|
||||||
<div class="uk-accordion-content">
|
<div class="uk-accordion-content">
|
||||||
|
|
||||||
<div class="uk-text-center uk-container" v-if="isAutofocusing">
|
<div v-if="isAutofocusing">
|
||||||
<div class="center-spinner" uk-spinner></div>
|
<progressBar/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="uk-grid-small uk-child-width-1-3" v-bind:hidden="isAutofocusing" uk-grid>
|
<div class="uk-grid-small uk-child-width-1-3" v-bind:hidden="isAutofocusing" uk-grid>
|
||||||
<div>
|
<div>
|
||||||
<button v-on:click="runFastAutofocus(2000, 300);" class="uk-button uk-button-default uk-form-small uk-float-right uk-width-1-1">Fast</button>
|
<button v-on:click="runFastAutofocus(2000, 300);" class="uk-button uk-button-default uk-form-small uk-float-right uk-width-1-1">Fast</button>
|
||||||
|
|
@ -90,6 +91,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import progressBar from "../genericComponents/progressBar"
|
||||||
|
|
||||||
// Key Codes
|
// Key Codes
|
||||||
const keyCodes = {
|
const keyCodes = {
|
||||||
|
|
@ -107,6 +109,10 @@ const keyCodes = {
|
||||||
export default {
|
export default {
|
||||||
name: 'paneNavigate',
|
name: 'paneNavigate',
|
||||||
|
|
||||||
|
components: {
|
||||||
|
progressBar
|
||||||
|
},
|
||||||
|
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
keysDown: {},
|
keysDown: {},
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,10 @@
|
||||||
|
|
||||||
<button type="submit" class="uk-button uk-button-primary uk-form-small uk-float-right uk-margin-small uk-width-1-1">Apply Settings</button>
|
<button type="submit" class="uk-button uk-button-primary uk-form-small uk-float-right uk-margin-small uk-width-1-1">Apply Settings</button>
|
||||||
|
|
||||||
<div class="uk-text-center uk-container" v-if="isCalibrating">
|
<div v-if="isCalibrating">
|
||||||
<div class="center-spinner" uk-spinner></div>
|
<progressBar/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-bind:hidden="isCalibrating">
|
<div v-bind:hidden="isCalibrating">
|
||||||
<button type="button" v-on:click="recalibrateConfirm()" class="uk-button uk-button-default uk-form-small uk-float-right uk-margin-small uk-width-1-1">Auto-Calibrate</button>
|
<button type="button" v-on:click="recalibrateConfirm()" class="uk-button uk-button-default uk-form-small uk-float-right uk-margin-small uk-width-1-1">Auto-Calibrate</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -40,11 +41,16 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import progressBar from "../../genericComponents/progressBar"
|
||||||
|
|
||||||
// Export main app
|
// Export main app
|
||||||
export default {
|
export default {
|
||||||
name: 'microscopeSettings',
|
name: 'microscopeSettings',
|
||||||
|
|
||||||
|
components: {
|
||||||
|
progressBar
|
||||||
|
},
|
||||||
|
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
shutterSpeed: this.$store.state.apiConfig.camera_settings.picamera_settings.shutter_speed,
|
shutterSpeed: this.$store.state.apiConfig.camera_settings.picamera_settings.shutter_speed,
|
||||||
|
|
|
||||||
142
src/components/genericComponents/progressBar.vue
Normal file
142
src/components/genericComponents/progressBar.vue
Normal file
|
|
@ -0,0 +1,142 @@
|
||||||
|
<template>
|
||||||
|
<div class="progress uk-margin-top uk-margin-horizontal-remove uk-padding-remove">
|
||||||
|
<div class="indeterminate"></div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'progressBar',
|
||||||
|
|
||||||
|
props: {},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
setThisTab(event, value) {
|
||||||
|
this.$emit('set-tab', event, this.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
tooltipOptions: function () {
|
||||||
|
var title = this.id.charAt(0).toUpperCase() + this.id.slice(1);
|
||||||
|
return `pos: right; title: ${title}; delay: 500`
|
||||||
|
},
|
||||||
|
|
||||||
|
classObject: function () {
|
||||||
|
return {
|
||||||
|
'tabicon-active': this.currentTab == this.id,
|
||||||
|
'uk-disabled': (this.requireConnection && !this.$store.getters.ready)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
@import "../../assets/less/theme.less";
|
||||||
|
|
||||||
|
.progress {
|
||||||
|
position: relative;
|
||||||
|
height: 5px;
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
background-color: rgba(180, 180, 180, 0.15);
|
||||||
|
border-radius: 2px;
|
||||||
|
background-clip: padding-box;
|
||||||
|
margin: 0.5rem 0 1rem 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress .determinate {
|
||||||
|
position: absolute;
|
||||||
|
background-color: inherit;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
transition: width .3s linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress .indeterminate, .progress .determinate {
|
||||||
|
background-color: @global-primary-background;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hook-inverse() {
|
||||||
|
.progress .indeterminate, .progress .determinate{
|
||||||
|
background-color: @inverse-primary-muted-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress .indeterminate:before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
background-color: inherit;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
will-change: left, right;
|
||||||
|
-webkit-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
|
||||||
|
animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress .indeterminate:after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
background-color: inherit;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
will-change: left, right;
|
||||||
|
-webkit-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
|
||||||
|
animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
|
||||||
|
-webkit-animation-delay: 1.15s;
|
||||||
|
animation-delay: 1.15s;
|
||||||
|
}
|
||||||
|
|
||||||
|
@-webkit-keyframes indeterminate {
|
||||||
|
0% {
|
||||||
|
left: -35%;
|
||||||
|
right: 100%; }
|
||||||
|
60% {
|
||||||
|
left: 100%;
|
||||||
|
right: -90%; }
|
||||||
|
100% {
|
||||||
|
left: 100%;
|
||||||
|
right: -90%; }
|
||||||
|
}
|
||||||
|
@keyframes indeterminate {
|
||||||
|
0% {
|
||||||
|
left: -35%;
|
||||||
|
right: 100%; }
|
||||||
|
60% {
|
||||||
|
left: 100%;
|
||||||
|
right: -90%; }
|
||||||
|
100% {
|
||||||
|
left: 100%;
|
||||||
|
right: -90%; }
|
||||||
|
}
|
||||||
|
@-webkit-keyframes indeterminate-short {
|
||||||
|
0% {
|
||||||
|
left: -200%;
|
||||||
|
right: 100%; }
|
||||||
|
60% {
|
||||||
|
left: 107%;
|
||||||
|
right: -8%; }
|
||||||
|
100% {
|
||||||
|
left: 107%;
|
||||||
|
right: -8%; }
|
||||||
|
}
|
||||||
|
@keyframes indeterminate-short {
|
||||||
|
0% {
|
||||||
|
left: -200%;
|
||||||
|
right: 100%; }
|
||||||
|
60% {
|
||||||
|
left: 107%;
|
||||||
|
right: -8%; }
|
||||||
|
100% {
|
||||||
|
left: 107%;
|
||||||
|
right: -8%; }
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -26,8 +26,8 @@
|
||||||
</component>
|
</component>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="uk-text-center uk-container uk-margin-small" v-if="taskRunning">
|
<div v-if="taskRunning">
|
||||||
<div class="center-spinner" uk-spinner></div>
|
<progressBar/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button v-bind:hidden="taskRunning" class="uk-button uk-button-primary uk-form-small uk-float-right uk-margin-small uk-width-1-1">{{ submitLabel }}</button>
|
<button v-bind:hidden="taskRunning" class="uk-button uk-button-primary uk-form-small uk-float-right uk-margin-small uk-width-1-1">{{ submitLabel }}</button>
|
||||||
|
|
@ -48,6 +48,8 @@ import htmlBlock from "./fieldComponents/htmlBlock";
|
||||||
import radioList from "./fieldComponents/radioList";
|
import radioList from "./fieldComponents/radioList";
|
||||||
import checkList from "./fieldComponents/checkList"
|
import checkList from "./fieldComponents/checkList"
|
||||||
|
|
||||||
|
import progressBar from "../../genericComponents/progressBar"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'JsonForm',
|
name: 'JsonForm',
|
||||||
|
|
||||||
|
|
@ -57,7 +59,8 @@ export default {
|
||||||
textInput,
|
textInput,
|
||||||
htmlBlock,
|
htmlBlock,
|
||||||
radioList,
|
radioList,
|
||||||
checkList
|
checkList,
|
||||||
|
progressBar
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue