From 55820e4f77c784fca0b89fa24593f9f1286d04ef Mon Sep 17 00:00:00 2001
From: kulikov-a <36099472+kulikov-a@users.noreply.github.com>
Date: Mon, 10 Apr 2023 15:22:11 +0300
Subject: [PATCH] www/nginx: add uuid column to the grids (#3374)
---
.../OPNsense/Nginx/Api/SettingsController.php | 12 +-
.../mvc/app/views/OPNsense/Nginx/index.volt | 103 +++++++++---------
.../www/js/nginx/dist/configuration.min.js | 2 +-
.../opnsense/www/js/nginx/src/nginx_config.js | 12 +-
4 files changed, 70 insertions(+), 59 deletions(-)
diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php
index 314dc8538..4a0849cf5 100644
--- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php
+++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php
@@ -105,7 +105,7 @@ class SettingsController extends ApiMutableModelControllerBase
// Upstream
public function searchupstreamAction()
{
- return $this->searchBase('upstream', array('description', 'serverentries', 'tls_enable', 'load_balancing_algorithm'));
+ return $this->searchBase('upstream', array('uuid', 'description', 'serverentries', 'tls_enable', 'load_balancing_algorithm'));
}
public function getupstreamAction($uuid = null)
@@ -132,7 +132,7 @@ class SettingsController extends ApiMutableModelControllerBase
// Upstream Server
public function searchupstreamserverAction()
{
- return $this->searchBase('upstream_server', array('description', 'server', 'port', 'priority'));
+ return $this->searchBase('upstream_server', array('uuid', 'description', 'server', 'port', 'priority'));
}
public function getupstreamserverAction($uuid = null)
@@ -160,8 +160,8 @@ class SettingsController extends ApiMutableModelControllerBase
public function searchlocationAction()
{
$data = $this->searchBase('location', array(
- 'description','urlpattern', 'path_prefix', 'matchtype', 'upstream',
- 'enable_secrules', 'enable_learning_mode', 'force_https',
+ 'uuid', 'description', 'urlpattern', 'path_prefix', 'matchtype',
+ 'upstream', 'enable_secrules', 'enable_learning_mode', 'force_https',
'xss_block_score', 'sqli_block_score', 'custom_policy'
));
@@ -233,7 +233,7 @@ class SettingsController extends ApiMutableModelControllerBase
public function searchhttpserverAction()
{
return $this->searchBase('http_server', array(
- 'servername', 'locations', 'root', 'https_only', 'certificate',
+ 'uuid', 'servername', 'locations', 'root', 'https_only', 'certificate',
'listen_http_address', 'listen_https_address', 'default_server'
));
}
@@ -262,7 +262,7 @@ class SettingsController extends ApiMutableModelControllerBase
// stream server
public function searchstreamserverAction()
{
- return $this->searchBase('stream_server', array('description', 'certificate', 'udp', 'listen_address'));
+ return $this->searchBase('stream_server', array('uuid', 'description', 'certificate', 'udp', 'listen_address'));
}
public function getstreamserverAction($uuid = null)
diff --git a/www/nginx/src/opnsense/mvc/app/views/OPNsense/Nginx/index.volt b/www/nginx/src/opnsense/mvc/app/views/OPNsense/Nginx/index.volt
index 78cf04ada..7a876e42c 100644
--- a/www/nginx/src/opnsense/mvc/app/views/OPNsense/Nginx/index.volt
+++ b/www/nginx/src/opnsense/mvc/app/views/OPNsense/Nginx/index.volt
@@ -223,17 +223,18 @@
- | {{ lang._('Description') }} |
- {{ lang._('URL Pattern') }} |
- {{ lang._('URL Path Prefix') }} |
- {{ lang._('Match Type') }} |
- {{ lang._('Upstream') }} |
- {{ lang._('WAF Status') }} |
- {{ lang._('XSS Score') }} |
- {{ lang._('SQLi Score') }} |
- {{ lang._('WAF Policies') }} |
- {{ lang._('Force HTTPS') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('ID') }} |
+ {{ lang._('Description') }} |
+ {{ lang._('URL Pattern') }} |
+ {{ lang._('URL Path Prefix') }} |
+ {{ lang._('Match Type') }} |
+ {{ lang._('Upstream') }} |
+ {{ lang._('WAF Status') }} |
+ {{ lang._('XSS Score') }} |
+ {{ lang._('SQLi Score') }} |
+ {{ lang._('WAF Policies') }} |
+ {{ lang._('Force HTTPS') }} |
+ {{ lang._('Commands') }} |
@@ -254,11 +255,12 @@
- | {{ lang._('Description') }} |
- {{ lang._('Server') }} |
- {{ lang._('Port') }} |
- {{ lang._('Priority') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('ID') }} |
+ {{ lang._('Description') }} |
+ {{ lang._('Server') }} |
+ {{ lang._('Port') }} |
+ {{ lang._('Priority') }} |
+ {{ lang._('Commands') }} |
@@ -280,11 +282,12 @@
- | {{ lang._('Description') }} |
- {{ lang._('Servers') }} |
- {{ lang._('Load Balancing') }} |
- {{ lang._('TLS Enabled') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('ID') }} |
+ {{ lang._('Description') }} |
+ {{ lang._('Servers') }} |
+ {{ lang._('Load Balancing') }} |
+ {{ lang._('TLS Enabled') }} |
+ {{ lang._('Commands') }} |
@@ -304,8 +307,8 @@
- | {{ lang._('Username') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Username') }} |
+ {{ lang._('Commands') }} |
@@ -327,7 +330,7 @@
| {{ lang._('Name') }} |
{{ lang._('Users') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Commands') }} |
@@ -347,15 +350,16 @@
+ | {{ lang._('ID') }} |
{{ lang._('Servername') }} |
{{ lang._('Locations') }} |
{{ lang._('File System Root') }} |
{{ lang._('Certificate') }} |
- {{ lang._('HTTPS Only') }} |
+ {{ lang._('HTTPS Only') }} |
{{ lang._('HTTP Address') }} |
{{ lang._('HTTPS Address') }} |
- {{ lang._('Default') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Default') }} |
+ {{ lang._('Commands') }} |
@@ -375,10 +379,11 @@
+ | {{ lang._('ID') }} |
{{ lang._('Certificate') }} |
- {{ lang._('UDP') }} |
+ {{ lang._('UDP') }} |
{{ lang._('Address') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Commands') }} |
@@ -399,10 +404,10 @@
| {{ lang._('Description') }} |
- {{ lang._('Source URL') }} |
+ {{ lang._('Source URL') }} |
{{ lang._('Destination URL') }} |
{{ lang._('Flag') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Commands') }} |
@@ -433,11 +438,11 @@
| {{ lang._('Name') }} |
- {{ lang._('Operator') }} |
+ {{ lang._('Operator') }} |
{{ lang._('Value') }} |
{{ lang._('Rules') }} |
{{ lang._('Action') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Commands') }} |
@@ -457,14 +462,14 @@
+ | {{ lang._('ID') }} |
{{ lang._('Description') }} |
- {{ lang._('Rule Type') }} |
+ {{ lang._('Rule Type') }} |
{{ lang._('Match Type') }} |
- {{ lang._('ID') }} |
- {{ lang._('Score') }} |
+ {{ lang._('Score') }} |
{{ lang._('Value') }} |
{{ lang._('Message') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Commands') }} |
@@ -490,7 +495,7 @@
{{ lang._('HSTS') }} |
{{ lang._('CSP') }} |
{{ lang._('CSP Rules') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Commands') }} |
@@ -511,10 +516,10 @@
| {{ lang._('Path') }} |
- {{ lang._('Description') }} |
- {{ lang._('Description') }} |
- {{ lang._('Description') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Size') }} |
+ {{ lang._('Inactive') }} |
+ {{ lang._('Max Size') }} |
+ {{ lang._('Commands') }} |
@@ -539,7 +544,7 @@
{{ lang._('Size') }} |
{{ lang._('Rate') }} |
{{ lang._('Rate Unit') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Commands') }} |
@@ -564,7 +569,7 @@
{{ lang._('Connection Count') }} |
{{ lang._('Burst') }} |
{{ lang._('No Delay') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Commands') }} |
@@ -585,7 +590,7 @@
| {{ lang._('Description') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Commands') }} |
@@ -606,7 +611,7 @@
| {{ lang._('Description') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Commands') }} |
@@ -629,7 +634,7 @@
{{ lang._('Name') }} |
{{ lang._('Status Codes') }} |
{{ lang._('Response') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Commands') }} |
@@ -650,7 +655,7 @@
| {{ lang._('Description') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Commands') }} |
@@ -674,7 +679,7 @@
{{ lang._('Host') }} |
{{ lang._('Facility') }} |
{{ lang._('Severity') }} |
- {{ lang._('Commands') }} |
+ {{ lang._('Commands') }} |
diff --git a/www/nginx/src/opnsense/www/js/nginx/dist/configuration.min.js b/www/nginx/src/opnsense/www/js/nginx/dist/configuration.min.js
index c6a86734e..e7c57eb22 100644
--- a/www/nginx/src/opnsense/www/js/nginx/dist/configuration.min.js
+++ b/www/nginx/src/opnsense/www/js/nginx/dist/configuration.min.js
@@ -1 +1 @@
-!function(e){var t={};function n(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(s,i,function(t){return e[t]}.bind(null,i));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=27)}({27:function(e,t,n){"use strict";n.r(t);var s=Backbone.View.extend({tagName:"div",attributes:{class:"container-fluid"},child_views:[],createModel:null,upstreamCollection:null,initialize:function(e){this.dataField=$(e.dataField),this.entryclass=e.entryclass,this.createModel=e.createModel,this.upstreamCollection=e.upstreamCollection,this.listenTo(this.collection,"add remove reset",this.render),this.listenTo(this.collection,"change",this.update),this.dataField.after(this.$el)},events:{"click .add":"addEntry"},render:function(){this.child_views.forEach(e=>e.remove()),this.$el.html(""),this.child_views=[],this.update(),this.collection.each(e=>{const t=new this.entryclass({model:e,collection:this.collection,upstreamCollection:this.upstreamCollection});this.child_views.push(t),this.$el.append(t.$el),t.render()}),this.$el.append($('\n \n \n
'))},update:function(){this.dataField.data("data",this.collection.toJSON())},addEntry:function(e){e.preventDefault(),this.collection.add(this.createModel())}});var i=Backbone.Collection.extend({url:"/api/nginx/settings/searchupstream",parse:function(e){return e.rows}});const a=Backbone.View.extend({tagName:"div",attributes:{class:"row"},events:{"keyup .key":function(){this.model.set("hostname",this.key.value)},"change .value":function(){this.model.set("upstream",this.value.value)},"click .delete":"deleteEntry"},key:null,value:null,delBtn:null,first:null,second:null,third:null,upstreamCollection:null,initialize:function(e){this.upstreamCollection=e.upstreamCollection,this.listenTo(this.upstreamCollection,"update reset add remove",this.regenerate_list),this.first=document.createElement("div"),this.first.classList.add("col-sm-5"),this.key=document.createElement("input"),this.first.append(this.key),this.key.type="text",this.key.classList.add("key"),this.key.value=this.model.get("hostname"),this.second=document.createElement("div"),this.second.classList.add("col-sm-5"),this.value=document.createElement("select"),this.second.append(this.value),this.value.classList.add("value"),this.value.classList.add("form-control"),this.value.value=this.model.get("upstream"),this.third=document.createElement("div"),this.third.classList.add("col-sm-2"),this.third.style.textAlign="right",this.delBtn=document.createElement("button"),this.delBtn.classList.add("delete"),this.delBtn.classList.add("btn"),this.delBtn.innerHTML='',this.third.append(this.delBtn),this.model.has("upstream")&&0!==this.upstreamCollection.where({uuid:this.model.get("upstream")}).length||this.upstreamCollection.length>0&&this.model.set("upstream",this.upstreamCollection.at(0).get("uuid")),this.$el.append(this.first).append(this.second).append(this.third)},render:function(){$(this.key).val(this.model.get("hostname")),this.regenerate_list(),$(this.value).val(this.model.get("upstream"))},deleteEntry:function(e){e.preventDefault(),this.collection.remove(this.model)},regenerate_list:function(){const e=$(this.value);e.html(""),this.upstreamCollection.each(t=>e.append(``)),e.val(this.model.get("upstream")),e.selectpicker("refresh")}}),l=Backbone.View.extend({tagName:"div",attributes:{class:"row"},events:{"keyup .key":function(){this.model.set("network",this.key.value)},"change .value":function(){this.model.set("action",this.value.value)},"click .delete":"deleteEntry"},key:null,value:null,delBtn:null,first:null,second:null,third:null,upstreamCollection:null,initialize:function(e){this.upstreamCollection=e.upstreamCollection,this.listenTo(this.upstreamCollection,"update reset add remove",this.regenerate_list),this.first=document.createElement("div"),this.first.classList.add("col-sm-5"),this.key=document.createElement("input"),this.first.append(this.key),this.key.type="text",this.key.classList.add("key"),this.key.value=this.model.get("network"),this.second=document.createElement("div"),this.second.classList.add("col-sm-5"),this.value=document.createElement("select"),this.second.append(this.value),this.value.classList.add("value"),this.value.classList.add("form-control"),this.value.value=this.model.get("action"),this.third=document.createElement("div"),this.third.classList.add("col-sm-2"),this.third.style.textAlign="right",this.delBtn=document.createElement("button"),this.delBtn.classList.add("delete"),this.delBtn.classList.add("btn"),this.delBtn.innerHTML='',this.third.append(this.delBtn),this.$el.append(this.first).append(this.second).append(this.third)},render:function(){$(this.key).val(this.model.get("network")),this.regenerate_list(),$(this.value).val(this.model.get("action"))},deleteEntry:function(e){e.preventDefault(),this.collection.remove(this.model)},regenerate_list:function(){const e=$(this.value);e.html(""),this.upstreamCollection.each(t=>e.append(``)),e.val(this.model.get("action")),e.selectpicker("refresh")}});var o=Backbone.Collection.extend({initialize:function(){let e=this;$("#snihostname\\.data").change(function(){e.regenerateFromView()})},regenerateFromView:function(){let e=$("#snihostname\\.data").data("data");_.isArray(e)||(e=[]),this.reset(e)}}),r=Backbone.Model.extend({}),c=Backbone.Model.extend({}),d=Backbone.Collection.extend({initialize:function(){let e=this;$("#ipacl\\.data").change(function(){e.regenerateFromView()})},regenerateFromView:function(){let e=$("#ipacl\\.data").data("data");_.isArray(e)||(e=[]),this.reset(e)}});const u=new i,h=new Backbone.Collection([{name:"Deny",value:"deny"},{name:"Allow",value:"allow"}]);$(document).ready(function(){mapDataToFormUI({frm_nginx:"/api/nginx/settings/get"}).done(function(){formatTokenizersUI(),$('select[data-allownew="false"]').selectpicker("refresh"),updateServiceControlUI("nginx")}),""!==window.location.hash&&$('a[href="'+window.location.hash+'"]').click(),$(".nav-tabs a").on("shown.bs.tab",function(e){history.pushState(null,null,e.target.hash)}),$(".reload_btn").click(function(){$(".reloadAct_progress").addClass("fa-spin"),ajaxCall("/api/nginx/service/reconfigure",{},function(){$(".reloadAct_progress").removeClass("fa-spin")})}),$('[id*="save_"]').each(function(){$(this).click(function(){let e=$(this).closest("form").attr("id"),t=$(this).closest("form").attr("data-title");saveFormToEndpoint("/api/nginx/settings/set",e,function(){$("#"+e+"_progress").addClass("fa fa-spinner fa-pulse"),ajaxCall("/api/nginx/service/reconfigure",{},function(n,s){$("#"+e+"_progress").removeClass("fa fa-spinner fa-pulse"),void 0===n||"success"===s&&"ok"===n.status?updateServiceControlUI("nginx"):BootstrapDialog.show({type:BootstrapDialog.TYPE_WARNING,title:t,message:JSON.stringify(n),draggable:!0})})})})}),["upstream","upstreamserver","location","credential","userlist","httpserver","streamserver","httprewrite","custompolicy","security_header","ipacl","limit_zone","cache_path","limit_request_connection","snifwd","errorpage","tls_fingerprint","syslog_target","naxsirule"].forEach(function(e){$("#grid-"+e).UIBootgrid({search:"/api/nginx/settings/search"+e,get:"/api/nginx/settings/get"+e+"/",set:"/api/nginx/settings/set"+e+"/",add:"/api/nginx/settings/add"+e+"/",del:"/api/nginx/settings/del"+e+"/",options:{selection:!1,multiSelect:!1,formatters:{commands:function(e,t){return' '},response:function(e,t){return"none"==t.response?"unchanged":t.response},statuscodes:function(e,t){const n=[],s=t.statuscodes.split(",");for(let e of s)n.push(e.substr(0,3));return n.join(", ")}}}})}),bind_naxsi_rule_dl_button(),function(){let e=new s({dataField:document.getElementById("snihostname.data"),upstreamCollection:u,entryclass:a,collection:new o,createModel:function(){return new r({hostname:"localhost"})}});window.snifield=e,e.render(),$("#grid-upstream").on("loaded.rs.jquery.bootgrid",function(){u.fetch()}),u.fetch()}();let e=new s({dataField:document.getElementById("ipacl.data"),upstreamCollection:h,entryclass:l,collection:new d,createModel:function(){return new c({network:"::",action:"deny"})}});window.ipaclfield=e,e.render()})}});
\ No newline at end of file
+!function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=27)}({27:function(t,e,n){"use strict";n.r(e);var i=Backbone.View.extend({tagName:"div",attributes:{class:"container-fluid"},child_views:[],createModel:null,upstreamCollection:null,initialize:function(t){this.dataField=$(t.dataField),this.entryclass=t.entryclass,this.createModel=t.createModel,this.upstreamCollection=t.upstreamCollection,this.listenTo(this.collection,"add remove reset",this.render),this.listenTo(this.collection,"change",this.update),this.dataField.after(this.$el)},events:{"click .add":"addEntry"},render:function(){this.child_views.forEach(t=>t.remove()),this.$el.html(""),this.child_views=[],this.update(),this.collection.each(t=>{const e=new this.entryclass({model:t,collection:this.collection,upstreamCollection:this.upstreamCollection});this.child_views.push(e),this.$el.append(e.$el),e.render()}),this.$el.append($('\n \n \n
'))},update:function(){this.dataField.data("data",this.collection.toJSON())},addEntry:function(t){t.preventDefault(),this.collection.add(this.createModel())}});var s=Backbone.Collection.extend({url:"/api/nginx/settings/searchupstream",parse:function(t){return t.rows}});const a=Backbone.View.extend({tagName:"div",attributes:{class:"row"},events:{"keyup .key":function(){this.model.set("hostname",this.key.value)},"change .value":function(){this.model.set("upstream",this.value.value)},"click .delete":"deleteEntry"},key:null,value:null,delBtn:null,first:null,second:null,third:null,upstreamCollection:null,initialize:function(t){this.upstreamCollection=t.upstreamCollection,this.listenTo(this.upstreamCollection,"update reset add remove",this.regenerate_list),this.first=document.createElement("div"),this.first.classList.add("col-sm-5"),this.key=document.createElement("input"),this.first.append(this.key),this.key.type="text",this.key.classList.add("key"),this.key.value=this.model.get("hostname"),this.second=document.createElement("div"),this.second.classList.add("col-sm-5"),this.value=document.createElement("select"),this.second.append(this.value),this.value.classList.add("value"),this.value.classList.add("form-control"),this.value.value=this.model.get("upstream"),this.third=document.createElement("div"),this.third.classList.add("col-sm-2"),this.third.style.textAlign="right",this.delBtn=document.createElement("button"),this.delBtn.classList.add("delete"),this.delBtn.classList.add("btn"),this.delBtn.innerHTML='',this.third.append(this.delBtn),this.model.has("upstream")&&0!==this.upstreamCollection.where({uuid:this.model.get("upstream")}).length||this.upstreamCollection.length>0&&this.model.set("upstream",this.upstreamCollection.at(0).get("uuid")),this.$el.append(this.first).append(this.second).append(this.third)},render:function(){$(this.key).val(this.model.get("hostname")),this.regenerate_list(),$(this.value).val(this.model.get("upstream"))},deleteEntry:function(t){t.preventDefault(),this.collection.remove(this.model)},regenerate_list:function(){const t=$(this.value);t.html(""),this.upstreamCollection.each(e=>t.append(``)),t.val(this.model.get("upstream")),t.selectpicker("refresh")}}),l=Backbone.View.extend({tagName:"div",attributes:{class:"row"},events:{"keyup .key":function(){this.model.set("network",this.key.value)},"change .value":function(){this.model.set("action",this.value.value)},"click .delete":"deleteEntry"},key:null,value:null,delBtn:null,first:null,second:null,third:null,upstreamCollection:null,initialize:function(t){this.upstreamCollection=t.upstreamCollection,this.listenTo(this.upstreamCollection,"update reset add remove",this.regenerate_list),this.first=document.createElement("div"),this.first.classList.add("col-sm-5"),this.key=document.createElement("input"),this.first.append(this.key),this.key.type="text",this.key.classList.add("key"),this.key.value=this.model.get("network"),this.second=document.createElement("div"),this.second.classList.add("col-sm-5"),this.value=document.createElement("select"),this.second.append(this.value),this.value.classList.add("value"),this.value.classList.add("form-control"),this.value.value=this.model.get("action"),this.third=document.createElement("div"),this.third.classList.add("col-sm-2"),this.third.style.textAlign="right",this.delBtn=document.createElement("button"),this.delBtn.classList.add("delete"),this.delBtn.classList.add("btn"),this.delBtn.innerHTML='',this.third.append(this.delBtn),this.$el.append(this.first).append(this.second).append(this.third)},render:function(){$(this.key).val(this.model.get("network")),this.regenerate_list(),$(this.value).val(this.model.get("action"))},deleteEntry:function(t){t.preventDefault(),this.collection.remove(this.model)},regenerate_list:function(){const t=$(this.value);t.html(""),this.upstreamCollection.each(e=>t.append(``)),t.val(this.model.get("action")),t.selectpicker("refresh")}});var o=Backbone.Collection.extend({initialize:function(){let t=this;$("#snihostname\\.data").change(function(){t.regenerateFromView()})},regenerateFromView:function(){let t=$("#snihostname\\.data").data("data");_.isArray(t)||(t=[]),this.reset(t)}}),r=Backbone.Model.extend({}),d=Backbone.Model.extend({}),c=Backbone.Collection.extend({initialize:function(){let t=this;$("#ipacl\\.data").change(function(){t.regenerateFromView()})},regenerateFromView:function(){let t=$("#ipacl\\.data").data("data");_.isArray(t)||(t=[]),this.reset(t)}});const u=new s,h=new Backbone.Collection([{name:"Deny",value:"deny"},{name:"Allow",value:"allow"}]);$(document).ready(function(){mapDataToFormUI({frm_nginx:"/api/nginx/settings/get"}).done(function(){formatTokenizersUI(),$('select[data-allownew="false"]').selectpicker("refresh"),updateServiceControlUI("nginx")}),""!==window.location.hash&&$('a[href="'+window.location.hash+'"]').click(),$(".nav-tabs a").on("shown.bs.tab",function(t){history.pushState(null,null,t.target.hash)}),$(".reload_btn").click(function(){$(".reloadAct_progress").addClass("fa-spin"),ajaxCall("/api/nginx/service/reconfigure",{},function(){$(".reloadAct_progress").removeClass("fa-spin")})}),$('[id*="save_"]').each(function(){$(this).click(function(){let t=$(this).closest("form").attr("id"),e=$(this).closest("form").attr("data-title");saveFormToEndpoint("/api/nginx/settings/set",t,function(){$("#"+t+"_progress").addClass("fa fa-spinner fa-pulse"),ajaxCall("/api/nginx/service/reconfigure",{},function(n,i){$("#"+t+"_progress").removeClass("fa fa-spinner fa-pulse"),void 0===n||"success"===i&&"ok"===n.status?updateServiceControlUI("nginx"):BootstrapDialog.show({type:BootstrapDialog.TYPE_WARNING,title:e,message:JSON.stringify(n),draggable:!0})})})})}),["upstream","upstreamserver","location","credential","userlist","httpserver","streamserver","httprewrite","custompolicy","security_header","ipacl","limit_zone","cache_path","limit_request_connection","snifwd","errorpage","tls_fingerprint","syslog_target","naxsirule"].forEach(function(t){$("#grid-"+t).UIBootgrid({search:"/api/nginx/settings/search"+t,get:"/api/nginx/settings/get"+t+"/",set:"/api/nginx/settings/set"+t+"/",add:"/api/nginx/settings/add"+t+"/",del:"/api/nginx/settings/del"+t+"/",commands:{copy_uuid:{method:function(t){navigator.clipboard.writeText($(this).data("row-id"))}}},options:{selection:!1,multiSelect:!1,formatters:{commands:function(t,e){return' '},response:function(t,e){return"none"==e.response?"unchanged":e.response},statuscodes:function(t,e){const n=[],i=e.statuscodes.split(",");for(let t of i)n.push(t.substr(0,3));return n.join(", ")}}}})}),bind_naxsi_rule_dl_button(),function(){let t=new i({dataField:document.getElementById("snihostname.data"),upstreamCollection:u,entryclass:a,collection:new o,createModel:function(){return new r({hostname:"localhost"})}});window.snifield=t,t.render(),$("#grid-upstream").on("loaded.rs.jquery.bootgrid",function(){u.fetch()}),u.fetch()}();let t=new i({dataField:document.getElementById("ipacl.data"),upstreamCollection:h,entryclass:l,collection:new c,createModel:function(){return new d({network:"::",action:"deny"})}});window.ipaclfield=t,t.render()})}});
\ No newline at end of file
diff --git a/www/nginx/src/opnsense/www/js/nginx/src/nginx_config.js b/www/nginx/src/opnsense/www/js/nginx/src/nginx_config.js
index 0e69aaf17..c2719990e 100644
--- a/www/nginx/src/opnsense/www/js/nginx/src/nginx_config.js
+++ b/www/nginx/src/opnsense/www/js/nginx/src/nginx_config.js
@@ -79,14 +79,20 @@ function init_grids() {
'set': '/api/nginx/settings/set' + element + '/',
'add': '/api/nginx/settings/add' + element + '/',
'del': '/api/nginx/settings/del' + element + '/',
+ 'commands': {
+ copy_uuid: {
+ method: function(e) { navigator.clipboard.writeText($(this).data("row-id")); }
+ }
+ },
'options': {
selection: false,
multiSelect: false,
formatters: {
"commands": function (column, row) {
- return " " +
- "" +
- "";
+ return " " +
+ " " +
+ " " +
+ "";
},
"response": function (column, row) {
return ((row.response == "none") ? "unchanged" : row.response);