Skip to content

Commit

Permalink
1, now can delete matcher
Browse files Browse the repository at this point in the history
2, make matcher table looks better
  • Loading branch information
alexazhou committed Feb 10, 2016
1 parent d68bece commit 724b862
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.swp
*.swo
5 changes: 4 additions & 1 deletion VeryNginx/dashboard/css/webInterface.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@
}

.config_matcher_block{
border: 1px solid !important;
border-width: 1px;
border-style:solid;
border-radius: 5px;
background-color: #f5f5f5;
padding-left:5px;
margin-top:5px;
margin-bottom:5px;
border-color:#CCC;
}

.config_matcher_block_type{
Expand All @@ -65,6 +67,7 @@

.config_matcher_block_value{
color: #666;
word-break: break-word;;
}

.matched {
Expand Down
10 changes: 2 additions & 8 deletions VeryNginx/dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ <h4 class="modal-title">Status Dashboard config</h4>
<div class="config_title">
Request Matcher
</div>
<table class="table table-bordered config_table" id="config_redirect_scheme_table">
<table class="table table-bordered config_table" id="config_matcher_matcher_table" >
<thead>
<tr>
<td>#</td>
Expand All @@ -277,15 +277,9 @@ <h4 class="modal-title">Status Dashboard config</h4>
</template>
</td>
<td class="no_break">
<button type="button" class="btn btn-default btn-xs" onclick="config.config_mod('redirect_scheme_rule',{{$index}},null)">
<button type="button" class="btn btn-default btn-xs" onclick="config.config_mod('matcher','{{$key}}',null)">
DEL
</button>
<button type="button" class="btn btn-default btn-xs" onclick="config.config_move_up('redirect_scheme_rule',{{$index}})">
UP
</button>
<button type="button" class="btn btn-default btn-xs" onclick="config.config_move_down('redirect_scheme_rule',{{$index}})">
DOWN
</button>
</td>
</tr>
</template>
Expand Down
6 changes: 4 additions & 2 deletions VeryNginx/dashboard/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@ config.get_config = function(){
});
}


//add a config
config.config_add = function(name,value){
config.verynginx_config[name].push(value);
}

//modify a config
//set value = null to delete
config.config_mod = function(name,index,value){

//console.log('-->',name,index,value);
if( value == null ){
config.verynginx_config[name].$remove( config.verynginx_config[name][index] );
Vue.delete( config.verynginx_config[name], index );
}else{
//config.verynginx_config[name].$set( index, config.verynginx_config[name][index] );
}
Expand Down

0 comments on commit 724b862

Please sign in to comment.