var mainContent=$("#main-content");
var key=mainContent.find("#property-key").val();
var value=mainContent.find("#property-value").val();
- $.log("add property:"+key+":"+value+",size:"+self.proxyConnector.properties().length);
- var oldTab = proxyConnector.properties();
+ var oldTab = self.proxyConnector.properties();
oldTab.push(new Entry(key,value));
self.proxyConnector.properties(oldTab);
- $.log("add property:"+key+":"+value+",size:"+self.proxyConnector.properties().length);
- self.proxyConnector.modified(true);
+ }
+
+ addBlacklistPattern=function(){
+ var pattern = $("#main-content #blacklist-value").val();
+ var tab = self.proxyConnector.blackListPatterns();
+ tab.push(pattern);
+ self.proxyConnector.blackListPatterns(tab);
+
+ }
+
+ removeBlacklistPattern=function(pattern){
+ self.proxyConnector.blackListPatterns.remove(pattern);
+ }
+
+ addWhitelistPattern=function(){
+ var pattern = $("#main-content #whitelist-value").val();
+ var tab = self.proxyConnector.whiteListPatterns();
+ tab.push(pattern);
+ self.proxyConnector.whiteListPatterns(tab);
+
+ }
+
+ removeWhitelistPattern=function(pattern){
+ self.proxyConnector.whiteListPatterns.remove(pattern);
}
}
</table>
<table class="table">
-
<tbody data-bind="foreach: proxyConnector.properties">
<tr>
<td data-bind="text: key"></td>
</tr>
</tbody>
</table>
+ </div>
+
+ <div class="control-group span6">
+ <table>
+ <thead>
+ <th colspan="2" class="pull-left">${$.i18n.prop('proxy-connector.blacklist')}</th>
+ </thead>
+ <tr>
+ <td><input type="text" id="blacklist-value"/></td>
+ <td><a href="#" data-bind="click: function(){ addBlacklistPattern() }">${$.i18n.prop('add')}</a></td>
+ </tr>
+ </table>
+ <table class="table">
+ <tbody data-bind="foreach: proxyConnector.blackListPatterns">
+ <tr>
+ <td data-bind="text: $data"></td>
+ <td><a href="#" data-bind="click: function(){removeBlacklistPattern($data)}">${$.i18n.prop('delete')}</a></td>
+ </tr>
+ </tbody>
+ </table>
</div>
+
+
+ <div class="control-group span6">
+ <table>
+ <thead>
+ <th colspan="2" class="pull-left">${$.i18n.prop('proxy-connector.whitelist')}</th>
+ </thead>
+ <tr>
+ <td><input type="text" id="whitelist-value"/></td>
+ <td><a href="#" data-bind="click: function(){ addWhitelistPattern() }">${$.i18n.prop('add')}</a></td>
+ </tr>
+ </table>
+
+ <table class="table">
+ <tbody data-bind="foreach: proxyConnector.whiteListPatterns">
+ <tr>
+ <td data-bind="text: $data"></td>
+ <td><a href="#" data-bind="click: function(){removeWhitelistPattern($data)}">${$.i18n.prop('delete')}</a></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+
</fieldset>
</form>