mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-08-11 23:55:24 +02:00
v3.1.1 init
- Fixed path traverse bug in web server file manager - Merged docker container list from main - Updated version code - Merged network status fix from PR - Removed unused comments in dpcore -
This commit is contained in:
@@ -583,14 +583,14 @@
|
||||
url: '/api/stats/netstatgraph?array=true',
|
||||
success: function(data){
|
||||
if (rxValues.length == 0){
|
||||
rxValues = JSON.parse(JSON.stringify(data.Rx));
|
||||
rxValues.push(...data.Rx);
|
||||
}else{
|
||||
rxValues.push(data.Rx[dataCount-1]);
|
||||
rxValues.shift();
|
||||
}
|
||||
|
||||
if (txValues.length == 0){
|
||||
txValues = JSON.parse(JSON.stringify(data.Tx));
|
||||
txValues.push(...data.Tx);
|
||||
}else{
|
||||
txValues.push(data.Tx[dataCount-1]);
|
||||
txValues.shift();
|
||||
|
@@ -30,7 +30,7 @@ Object.defineProperty(String.prototype, 'capitalize', {
|
||||
|
||||
//Add a new function to jquery for ajax override with csrf token injected
|
||||
$.cjax = function(payload){
|
||||
let requireTokenMethod = ["POST", "PUT", "DELETE"];;
|
||||
let requireTokenMethod = ["POST", "PUT", "DELETE"];
|
||||
if (requireTokenMethod.includes(payload.method) || requireTokenMethod.includes(payload.type)){
|
||||
//csrf token is required
|
||||
let csrfToken = document.getElementsByTagName("meta")["zoraxy.csrf.Token"].getAttribute("content");
|
||||
|
@@ -34,7 +34,7 @@
|
||||
|
||||
<script>
|
||||
const lines = {};
|
||||
const linesAded = [];
|
||||
const linesAded = {};
|
||||
|
||||
function getDockerContainers() {
|
||||
const hostRequest = $.get("/api/proxy/list?type=host");
|
||||
@@ -54,7 +54,9 @@
|
||||
Config: [{ Gateway: gateway }],
|
||||
},
|
||||
} = bridge;
|
||||
const existedDomains = hostData.map(({ Domain }) => Domain);
|
||||
const existedDomains = hostData.reduce((acc, { ActiveOrigins }) => {
|
||||
return acc.concat(ActiveOrigins.map(({ OriginIpOrDomain }) => OriginIpOrDomain));
|
||||
}, []);
|
||||
|
||||
for (const container of containers) {
|
||||
const {
|
||||
@@ -63,19 +65,20 @@
|
||||
} = container;
|
||||
|
||||
for (const portObject of Ports.filter(
|
||||
({ IP: ip }) => ip === "::"
|
||||
({ IP: ip }) => ip === "::" || ip === '0.0.0.0'
|
||||
)) {
|
||||
const { IP: ip, PublicPort: port } = portObject;
|
||||
const key = `${name}-${port}`;
|
||||
|
||||
if (
|
||||
existedDomains.some((item) => item === `${gateway}:${port}`)
|
||||
existedDomains.some((item) => item === `${gateway}:${port}`) &&
|
||||
!linesAded[key]
|
||||
) {
|
||||
linesAded.push({
|
||||
linesAded[key] = {
|
||||
name: name.replace(/^\//, ""),
|
||||
ip: gateway,
|
||||
port,
|
||||
});
|
||||
};
|
||||
} else if (!lines[key]) {
|
||||
lines[key] = {
|
||||
name: name.replace(/^\//, ""),
|
||||
@@ -100,7 +103,7 @@
|
||||
</div>`
|
||||
);
|
||||
}
|
||||
for (const line of linesAded) {
|
||||
for (const [key, line] of Object.entries(linesAded)) {
|
||||
$("#containersAddedList").append(
|
||||
`<div class="item">
|
||||
<div class="content">
|
||||
@@ -111,7 +114,7 @@
|
||||
</div>`
|
||||
);
|
||||
}
|
||||
linesAded.length &&
|
||||
Object.entries(linesAded).length &&
|
||||
$("#containersAddedListHeader").removeAttr("hidden");
|
||||
$("#containersList .loader").removeClass("active");
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user