Show validation result for github on console
:options="cmOptions">
</code-mirror>
</pane>
- <pane v-if="validationResult" :min-size="10" size="15">
+ <pane v-if="validationResult" :min-size="10" :size="resultConsoleSize">
<pre class="border h-100 validation-result" v-text="validationResult"></pre>
</pane>
</splitpanes>
SCRIPT_DESCRIPTION_HIDE_KEY = 'script_description_hide';
hideDescription = false;
+ resultConsoleSize = 15;
+
beforeRouteEnter(to, from, next) {
const path = to.params.remainedPath;
const revision = to.query.r || -1;
this.validateGitConfig();
return;
}
-
this.validateScript();
}
this.showProgressBar(this.i18n('script.editor.message.validate'));
this.$http.post('/script/api/github/validate', { content })
- .then(() => this.showSuccessMsg(this.i18n('script.editor.validate.success')))
- .catch(error => this.showErrorMsg(this.decorateGitHubConfigurationErrorMessage(error.response.data.message)))
+ .then(() => this.showScriptValidationResult(this.i18n('script.editor.validate.success')))
+ .catch(error => this.showScriptValidationResult(this.decorateGitHubConfigurationErrorMessage(error.response.data.message)))
.finally(this.hideProgressBar);
} catch (error) {
- this.showErrorMsg(`YAML syntax error<br>${error.message}`);
this.hideProgressBar();
+ this.showScriptValidationResult(`YAML syntax error<br>${error.message}`);
}
}
+ showScriptValidationResult(result) {
+ this.resultConsoleSize = 150;
+ this.validationResult = result;
+ }
+
decorateGitHubConfigurationErrorMessage(errorMsg) {
return errorMsg
.replace('Not Found', "Not found GitHub repository.<br>Please check your 'owner' or 'repo' field is correct.")
},
hostString: this.targetHosts.join(','),
}).then(res => {
- this.validationResult = res.data;
+ this.showScriptValidationResult(res.data);
this.validated = true;
}).catch(() => this.showErrorMsg(this.i18n('script.editor.validate.error')))
.finally(this.hideProgressBar);
