|
@@ -3,9 +3,11 @@
|
|
<head>
|
|
<head>
|
|
<!-- Notes: This should be open in its original path-->
|
|
<!-- Notes: This should be open in its original path-->
|
|
<meta charset="utf-8">
|
|
<meta charset="utf-8">
|
|
|
|
+ <meta name="zoraxy.csrf.Token" content="{{.csrfToken}}">
|
|
<link rel="stylesheet" href="../script/semantic/semantic.min.css">
|
|
<link rel="stylesheet" href="../script/semantic/semantic.min.css">
|
|
<script src="../script/jquery-3.6.0.min.js"></script>
|
|
<script src="../script/jquery-3.6.0.min.js"></script>
|
|
<script src="../script/semantic/semantic.min.js"></script>
|
|
<script src="../script/semantic/semantic.min.js"></script>
|
|
|
|
+ <script src="../script/utils.js"></script>
|
|
<style>
|
|
<style>
|
|
.ui.tabular.menu .item.narrowpadding{
|
|
.ui.tabular.menu .item.narrowpadding{
|
|
padding: 0.6em !important;
|
|
padding: 0.6em !important;
|
|
@@ -92,9 +94,6 @@
|
|
</div>
|
|
</div>
|
|
<div class="content">
|
|
<div class="content">
|
|
<br>
|
|
<br>
|
|
- <div class="ui yellow message">
|
|
|
|
- <p><i class="exclamation triangle icon"></i>Settings in this section are for advanced users. Invalid settings might cause werid, unexpected behavior.</p>
|
|
|
|
- </div>
|
|
|
|
<div class="ui container">
|
|
<div class="ui container">
|
|
<h4>Overwrite Host Header</h4>
|
|
<h4>Overwrite Host Header</h4>
|
|
<p>Manual override the automatic "Host" header rewrite logic. Leave empty for automatic.</p>
|
|
<p>Manual override the automatic "Host" header rewrite logic. Leave empty for automatic.</p>
|
|
@@ -112,7 +111,9 @@
|
|
<label>Remove Hop-by-hop Header<br>
|
|
<label>Remove Hop-by-hop Header<br>
|
|
<small>This should be ON by default</small></label>
|
|
<small>This should be ON by default</small></label>
|
|
</div>
|
|
</div>
|
|
- <div class="ui divider"></div>
|
|
|
|
|
|
+ <div class="ui yellow message">
|
|
|
|
+ <p><i class="exclamation triangle icon"></i>Settings in this section are for advanced users. Invalid settings might cause werid, unexpected behavior.</p>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -247,8 +248,9 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- $.ajax({
|
|
|
|
|
|
+ $.cjax({
|
|
url: "/api/proxy/header/add",
|
|
url: "/api/proxy/header/add",
|
|
|
|
+ method: "POST",
|
|
data: {
|
|
data: {
|
|
"type": getHeaderEditMode(),
|
|
"type": getHeaderEditMode(),
|
|
"domain": editingEndpoint.ep,
|
|
"domain": editingEndpoint.ep,
|
|
@@ -279,10 +281,10 @@
|
|
}
|
|
}
|
|
|
|
|
|
function deleteCustomHeader(name){
|
|
function deleteCustomHeader(name){
|
|
- $.ajax({
|
|
|
|
|
|
+ $.cjax({
|
|
url: "/api/proxy/header/remove",
|
|
url: "/api/proxy/header/remove",
|
|
|
|
+ method: "POST",
|
|
data: {
|
|
data: {
|
|
- //"type": editingEndpoint.ept,
|
|
|
|
"domain": editingEndpoint.ep,
|
|
"domain": editingEndpoint.ep,
|
|
"name": name,
|
|
"name": name,
|
|
},
|
|
},
|
|
@@ -299,6 +301,7 @@
|
|
$("#headerTable").html(`<tr><td colspan="3"><i class="ui loading spinner icon"></i> Loading</td></tr>`);
|
|
$("#headerTable").html(`<tr><td colspan="3"><i class="ui loading spinner icon"></i> Loading</td></tr>`);
|
|
$.ajax({
|
|
$.ajax({
|
|
url: "/api/proxy/header/list",
|
|
url: "/api/proxy/header/list",
|
|
|
|
+ method: "GET",
|
|
data: {
|
|
data: {
|
|
"type": editingEndpoint.ept,
|
|
"type": editingEndpoint.ept,
|
|
"domain": editingEndpoint.ep,
|
|
"domain": editingEndpoint.ep,
|
|
@@ -307,7 +310,6 @@
|
|
if (data.error != undefined){
|
|
if (data.error != undefined){
|
|
alert(data.error);
|
|
alert(data.error);
|
|
}else{
|
|
}else{
|
|
-
|
|
|
|
$("#headerTable").html("");
|
|
$("#headerTable").html("");
|
|
data.forEach(header => {
|
|
data.forEach(header => {
|
|
let editModeIcon = header.IsRemove?`<i class="ui red times circle icon"></i>`:`<i class="ui green add circle icon"></i>`;
|
|
let editModeIcon = header.IsRemove?`<i class="ui red times circle icon"></i>`:`<i class="ui green add circle icon"></i>`;
|
|
@@ -351,7 +353,7 @@
|
|
/* Bind events to toggles */
|
|
/* Bind events to toggles */
|
|
$("#enableHSTS").on("change", function(){
|
|
$("#enableHSTS").on("change", function(){
|
|
let HSTSEnabled = $("#enableHSTS")[0].checked;
|
|
let HSTSEnabled = $("#enableHSTS")[0].checked;
|
|
- $.ajax({
|
|
|
|
|
|
+ $.cjax({
|
|
url: "/api/proxy/header/handleHSTS",
|
|
url: "/api/proxy/header/handleHSTS",
|
|
method: "POST",
|
|
method: "POST",
|
|
data: {
|
|
data: {
|
|
@@ -426,7 +428,7 @@
|
|
$("#permissionPolicyEditor").addClass("disabled");
|
|
$("#permissionPolicyEditor").addClass("disabled");
|
|
}
|
|
}
|
|
|
|
|
|
- $.ajax({
|
|
|
|
|
|
+ $.cjax({
|
|
url: "/api/proxy/header/handlePermissionPolicy",
|
|
url: "/api/proxy/header/handlePermissionPolicy",
|
|
method: "POST",
|
|
method: "POST",
|
|
data: {
|
|
data: {
|
|
@@ -532,7 +534,7 @@
|
|
let permissionPolicy = generatePermissionPolicyObject();
|
|
let permissionPolicy = generatePermissionPolicyObject();
|
|
let domain = editingEndpoint.ep;
|
|
let domain = editingEndpoint.ep;
|
|
|
|
|
|
- $.ajax({
|
|
|
|
|
|
+ $.cjax({
|
|
url: "/api/proxy/header/handlePermissionPolicy",
|
|
url: "/api/proxy/header/handlePermissionPolicy",
|
|
method: "PUT",
|
|
method: "PUT",
|
|
data: {
|
|
data: {
|
|
@@ -576,7 +578,7 @@
|
|
|
|
|
|
function updateManualHostOverwriteVal(callback=undefined){
|
|
function updateManualHostOverwriteVal(callback=undefined){
|
|
let newHostname = $("#manualHostOverwrite").val().trim();
|
|
let newHostname = $("#manualHostOverwrite").val().trim();
|
|
- $.ajax({
|
|
|
|
|
|
+ $.cjax({
|
|
url: "/api/proxy/header/handleHostOverwrite",
|
|
url: "/api/proxy/header/handleHostOverwrite",
|
|
method: "POST",
|
|
method: "POST",
|
|
data: {
|
|
data: {
|
|
@@ -615,7 +617,7 @@
|
|
//Bind event to the checkbox
|
|
//Bind event to the checkbox
|
|
$("#removeHopByHop").on("change", function(evt){
|
|
$("#removeHopByHop").on("change", function(evt){
|
|
let isChecked = $(this)[0].checked;
|
|
let isChecked = $(this)[0].checked;
|
|
- $.ajax({
|
|
|
|
|
|
+ $.cjax({
|
|
url: "/api/proxy/header/handleHopByHop",
|
|
url: "/api/proxy/header/handleHopByHop",
|
|
method: "POST",
|
|
method: "POST",
|
|
data: {
|
|
data: {
|