Browse Source

Show progress circle on testing a config

pull/1206/head
Hironsan 3 years ago
parent
commit
f639bdf9e8
1 changed files with 13 additions and 1 deletions
  1. 14
      frontend/components/containers/settings/ConfigCreationForm.vue

14
frontend/components/containers/settings/ConfigCreationForm.vue

@ -26,6 +26,9 @@
</v-stepper-header> </v-stepper-header>
<v-card> <v-card>
<v-overlay :value="isLoading">
<v-progress-circular indeterminate size="64" />
</v-overlay>
<v-card-text class="pa-0"> <v-card-text class="pa-0">
<v-stepper-content step="1"> <v-stepper-content step="1">
<h4 class="text-h6">Select a config template</h4> <h4 class="text-h6">Select a config template</h4>
@ -114,7 +117,7 @@
</v-btn> </v-btn>
<v-btn <v-btn
v-show="step.isLast() && !passTesting" v-show="step.isLast() && !passTesting"
:disabled="sampleText === ''"
:disabled="sampleText === '' || isLoading"
color="primary" color="primary"
class="text-capitalize" class="text-capitalize"
@click="testConfig" @click="testConfig"
@ -152,6 +155,7 @@ export default Vue.extend({
data() { data() {
return { return {
isLoading: false,
passTesting: false, passTesting: false,
sampleText: '', sampleText: '',
step: new StepCounter(1, 3), step: new StepCounter(1, 3),
@ -212,18 +216,26 @@ export default Vue.extend({
testConfig() { testConfig() {
const projectId = this.$route.params.id const projectId = this.$route.params.id
const item = this.createConfig() const item = this.createConfig()
this.isLoading = true
this.configService.testConfig(projectId, item, this.sampleText) this.configService.testConfig(projectId, item, this.sampleText)
.then(value => { .then(value => {
this.passTesting = value.valid this.passTesting = value.valid
}) })
.finally(() => {
this.isLoading = false
})
}, },
saveConfig() { saveConfig() {
const projectId = this.$route.params.id const projectId = this.$route.params.id
const item = this.createConfig() const item = this.createConfig()
this.isLoading = true
this.configService.save(projectId, item) this.configService.save(projectId, item)
.then(item => { .then(item => {
this.$emit('onCreate') this.$emit('onCreate')
}) })
.finally(() => {
this.isLoading = false
})
} }
} }
}) })

Loading…
Cancel
Save