Remove SingBox

This commit is contained in:
Whispering Wind
2025-04-11 21:33:28 +03:30
committed by GitHub
parent 90aa03ee16
commit 9297cf2467

View File

@ -68,19 +68,13 @@
<div class='tab-pane fade show active' id='subs' role='tabpanel' aria-labelledby='subs-tab'> <div class='tab-pane fade show active' id='subs' role='tabpanel' aria-labelledby='subs-tab'>
<ul class='nav nav-tabs' id='subs-tabs' role='tablist'> <ul class='nav nav-tabs' id='subs-tabs' role='tablist'>
<li class='nav-item'> <li class='nav-item'>
<a class='nav-link active' id='singbox-tab' data-toggle='tab' href='#singbox' <a class='nav-link active' id='normal-tab' data-toggle='tab' href='#normal' role='tab'
role='tab' aria-controls='singbox'
aria-selected='true'><strong>SingBox</strong></a>
</li>
<li class='nav-item'>
<a class='nav-link' id='normal-tab' data-toggle='tab' href='#normal' role='tab'
aria-controls='normal' aria-selected='false'><strong>Normal</strong></a> aria-controls='normal' aria-selected='false'><strong>Normal</strong></a>
</li> </li>
</ul> </ul>
<div class='tab-content' id='subs-tabs-content'> <div class='tab-content' id='subs-tabs-content'>
<br> <br>
<!-- SingBox Sub Tab --> <!-- <div class='tab-pane fade show active' id='singbox' role='tabpanel'
<div class='tab-pane fade show active' id='singbox' role='tabpanel'
aria-labelledby='singbox-tab'> aria-labelledby='singbox-tab'>
<form id="singbox"> <form id="singbox">
<div class='form-group'> <div class='form-group'>
@ -107,10 +101,10 @@
style="display: none;">Stop</button> style="display: none;">Stop</button>
</form> </form>
</div> </div> -->
<!-- Normal Sub Tab --> <!-- Normal Sub Tab -->
<div class='tab-pane fade' id='normal' role='tabpanel' aria-labelledby='normal-tab'> <div class='tab-pane fade show active' id='normal' role='tabpanel' aria-labelledby='normal-tab'>
<form id="normal"> <form id="normal">
<div class='form-group'> <div class='form-group'>
<label for='normal_domain'>Domain:</label> <label for='normal_domain'>Domain:</label>
@ -467,7 +461,7 @@
function updateServiceUI(data) { function updateServiceUI(data) {
const servicesMap = { const servicesMap = {
"hysteria_telegram_bot": "#telegram", "hysteria_telegram_bot": "#telegram",
"hysteria_singbox": "#singbox", // "hysteria_singbox": "#singbox", // singbox removed
"hysteria_normal_sub": "#normal", "hysteria_normal_sub": "#normal",
"hysteria_iplimit": "#ip-limit-service" "hysteria_iplimit": "#ip-limit-service"
}; };
@ -483,9 +477,9 @@
$(selector).prepend(`<div class='alert alert-info'>Service is running. You can stop it if needed.</div>`); $(selector).prepend(`<div class='alert alert-info'>Service is running. You can stop it if needed.</div>`);
$(selector + " .btn-danger").show(); $(selector + " .btn-danger").show();
if (service === "hysteria_singbox") { // if (service === "hysteria_singbox") { // singbox removed
$("#singbox_start").prop('disabled', true); // $("#singbox_start").prop('disabled', true);
} // }
if(service === "hysteria_telegram_bot"){ if(service === "hysteria_telegram_bot"){
$("#telegram_start").prop('disabled', true); $("#telegram_start").prop('disabled', true);
} }
@ -508,9 +502,9 @@
$(selector + " .btn-success").show(); $(selector + " .btn-success").show();
$(selector + " .btn-danger").hide(); $(selector + " .btn-danger").hide();
$(selector + " .alert-info").remove(); $(selector + " .alert-info").remove();
if (service === "hysteria_singbox") { // if (service === "hysteria_singbox") { // singbox removed
$("#singbox_start").prop('disabled', false); // $("#singbox_start").prop('disabled', false);
} // }
if(service === "hysteria_telegram_bot"){ if(service === "hysteria_telegram_bot"){
$("#telegram_start").prop('disabled', false); $("#telegram_start").prop('disabled', false);
} }
@ -598,32 +592,32 @@
}); });
} }
function startSingbox() { // function startSingbox() { // singbox removed
if (!validateForm('singbox')) return; // if (!validateForm('singbox')) return;
const domain = $("#singbox_domain").val(); // const domain = $("#singbox_domain").val();
const port = $("#singbox_port").val(); // const port = $("#singbox_port").val();
confirmAction("start SingBox", function () { // confirmAction("start SingBox", function () {
sendRequest( // sendRequest(
"{{ url_for('singbox_start_api') }}", // "{{ url_for('singbox_start_api') }}",
"POST", // "POST",
{ domain: domain, port: port }, // { domain: domain, port: port },
"SingBox started successfully!", // "SingBox started successfully!",
"#singbox_start" // "#singbox_start"
); // );
}); // });
} // }
function stopSingbox() { // function stopSingbox() { // singbox removed
confirmAction("stop SingBox", function () { // confirmAction("stop SingBox", function () {
sendRequest( // sendRequest(
"{{ url_for('singbox_stop_api') }}", // "{{ url_for('singbox_stop_api') }}",
"DELETE", // "DELETE",
null, // null,
"SingBox stopped successfully!", // "SingBox stopped successfully!",
null // null
); // );
}); // });
} // }
function startNormal() { function startNormal() {
if (!validateForm('normal')) return; if (!validateForm('normal')) return;
@ -792,8 +786,8 @@
$("#telegram_start").on("click", startTelegram); $("#telegram_start").on("click", startTelegram);
$("#telegram_stop").on("click", stopTelegram); $("#telegram_stop").on("click", stopTelegram);
$("#singbox_start").on("click", startSingbox); // $("#singbox_start").on("click", startSingbox); // singbox removed
$("#singbox_stop").on("click", stopSingbox); // $("#singbox_stop").on("click", stopSingbox); // singbox removed
$("#normal_start").on("click", startNormal); $("#normal_start").on("click", startNormal);
$("#normal_stop").on("click", stopNormal); $("#normal_stop").on("click", stopNormal);
$("#port_change").on("click", changePort); $("#port_change").on("click", changePort);
@ -806,7 +800,8 @@
$("#ip_limit_change_config").on("click", configIPLimit); $("#ip_limit_change_config").on("click", configIPLimit);
$('#singbox_domain, #normal_domain, #sni_domain').on('input', function () { // $('#singbox_domain, #normal_domain, #sni_domain').on('input', function () { // singbox removed
$('#normal_domain, #sni_domain').on('input', function () {
if (isValidDomain($(this).val())) { if (isValidDomain($(this).val())) {
$(this).removeClass('is-invalid'); $(this).removeClass('is-invalid');
} else { } else {
@ -814,7 +809,8 @@
} }
}); });
$('#singbox_port, #normal_port, #hysteria_port').on('input', function () { // $('#singbox_port, #normal_port, #hysteria_port').on('input', function () { // singbox removed
$('#normal_port, #hysteria_port').on('input', function () {
if (isValidPort($(this).val())) { if (isValidPort($(this).val())) {
$(this).removeClass('is-invalid'); $(this).removeClass('is-invalid');
} else { } else {