mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-06-03 06:07:20 +02:00
Point on the I
This commit is contained in:
parent
8df68f1f4e
commit
97a6cf016a
@ -287,10 +287,13 @@ func ReverseProxyHandleAddEndpoint(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tagsStr, _ := utils.PostPara(r, "tags")
|
tagStr, _ := utils.PostPara(r, "tags")
|
||||||
tags := strings.Split(tagsStr, ",")
|
tags := []string{}
|
||||||
for i := range tags {
|
if tagStr != "" {
|
||||||
tags[i] = strings.TrimSpace(tags[i])
|
tags = strings.Split(tagStr, ",")
|
||||||
|
for i := range tags {
|
||||||
|
tags[i] = strings.TrimSpace(tags[i])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var proxyEndpointCreated *dynamicproxy.ProxyEndpoint
|
var proxyEndpointCreated *dynamicproxy.ProxyEndpoint
|
||||||
@ -523,10 +526,13 @@ func ReverseProxyHandleEditEndpoint(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
tagsStr, _ := utils.PostPara(r, "tags")
|
tagStr, _ := utils.PostPara(r, "tags")
|
||||||
tags := strings.Split(tagsStr, ",")
|
tags := []string{}
|
||||||
for i := range tags {
|
if tagStr != "" {
|
||||||
tags[i] = strings.TrimSpace(tags[i])
|
tags = strings.Split(tagStr, ",")
|
||||||
|
for i := range tags {
|
||||||
|
tags[i] = strings.TrimSpace(tags[i])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Generate a new proxyEndpoint from the new config
|
//Generate a new proxyEndpoint from the new config
|
||||||
|
@ -138,7 +138,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td data-label="" editable="true" datatype="vdir">${vdList}</td>
|
<td data-label="" editable="true" datatype="vdir">${vdList}</td>
|
||||||
<td data-label="tags">${subd.Tags.join(", ")}</td> <!-- Display tags -->
|
<td data-label="tags">
|
||||||
|
${subd.Tags.map(tag => `<span class="ui tiny label tag-select">${tag}</span>`).join("")}
|
||||||
|
</td>
|
||||||
<td data-label="" editable="true" datatype="advanced" style="width: 350px;">
|
<td data-label="" editable="true" datatype="advanced" style="width: 350px;">
|
||||||
${subd.AuthenticationProvider.AuthMethod == 0x1?`<i class="ui grey key icon"></i> Basic Auth`:``}
|
${subd.AuthenticationProvider.AuthMethod == 0x1?`<i class="ui grey key icon"></i> Basic Auth`:``}
|
||||||
${subd.AuthenticationProvider.AuthMethod == 0x2?`<i class="ui blue key icon"></i> Authelia`:``}
|
${subd.AuthenticationProvider.AuthMethod == 0x2?`<i class="ui blue key icon"></i> Authelia`:``}
|
||||||
@ -170,10 +172,11 @@
|
|||||||
data.forEach(subd => {
|
data.forEach(subd => {
|
||||||
subd.Tags.forEach(tag => tags.add(tag));
|
subd.Tags.forEach(tag => tags.add(tag));
|
||||||
});
|
});
|
||||||
|
tags = Array.from(tags).sort((a, b) => a.localeCompare(b));
|
||||||
let dropdownMenu = $("#tagFilterDropdown .menu");
|
let dropdownMenu = $("#tagFilterDropdown .menu");
|
||||||
dropdownMenu.html('<div class="item" data-value="">All</div>');
|
dropdownMenu.html('<div class="item tag-select" data-value="">All</div>');
|
||||||
tags.forEach(tag => {
|
tags.forEach(tag => {
|
||||||
dropdownMenu.append(`<div class="item" data-value="${tag}">${tag}</div>`);
|
dropdownMenu.append(`<div class="item tag-select" data-value="${tag}">${tag}</div>`);
|
||||||
});
|
});
|
||||||
$('#tagFilterDropdown').dropdown();
|
$('#tagFilterDropdown').dropdown();
|
||||||
}
|
}
|
||||||
@ -669,5 +672,12 @@
|
|||||||
// Initialize the proxy list on page load
|
// Initialize the proxy list on page load
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
listProxyEndpoints();
|
listProxyEndpoints();
|
||||||
|
|
||||||
|
// Event listener for clicking on tags
|
||||||
|
$(document).on('click', '.tag-select', function() {
|
||||||
|
let tag = $(this).text().trim();
|
||||||
|
$('#tagFilterDropdown').dropdown('set selected', tag);
|
||||||
|
filterProxyList();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
@ -246,6 +246,7 @@
|
|||||||
//Clear old data
|
//Clear old data
|
||||||
$("#rootname").val("");
|
$("#rootname").val("");
|
||||||
$("#proxyDomain").val("");
|
$("#proxyDomain").val("");
|
||||||
|
$("#proxyTags").val("");
|
||||||
credentials = [];
|
credentials = [];
|
||||||
updateTable();
|
updateTable();
|
||||||
reloadUptimeList();
|
reloadUptimeList();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user