|
@ -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 |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|