...
 
Commits (2)
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<div v-show="ruleComment != ''"> <div v-show="ruleComment != ''">
<div id="rule-comment" class="mt-3 card collapse"> <div id="rule-comment" class="mt-3 card collapse">
<div class="card-body"> <div class="card-body">
<pre id="rule_comment_pre" v-html="this.ruleComment"></pre> <pre id="rule_comment_pre" v-html="ruleComment"></pre>
</div> </div>
</div> </div>
</div> </div>
...@@ -221,21 +221,19 @@ ...@@ -221,21 +221,19 @@
}) })
}, },
getContentRule: function(){ getContentRule: function(){
if(this.commit_id) { let data_param = {
let data_param = { 'file': this.filename,
'file': this.filename, 'commit_id': this.commit_id?this.commit_id : 'HEAD',
'commit_id': this.commit_id, }
} this.$http
this.$http .get('/source/file', {params: data_param})
.get('/source/file', {params: data_param}) .then(response => {
.then(response => { this.content = response.body;
this.content = response.body; return true;
return true; }, response => {
}, response => { if(response.status == 500) this.content = '';
if(response.status == 500) this.content = ''; return false;
return false; })
})
} else this.content = this.ruleData;
}, },
auth_to_edit: function () { auth_to_edit: function () {
this.error_flags.noUser = false; this.error_flags.noUser = false;
......