diff --git a/core/scripts/webpanel/templates/settings.html b/core/scripts/webpanel/templates/settings.html index 9f49953..c384a28 100644 --- a/core/scripts/webpanel/templates/settings.html +++ b/core/scripts/webpanel/templates/settings.html @@ -123,11 +123,11 @@
- +
- +
@@ -338,10 +338,29 @@ $("#normal_stop").on("click", stopNormal); $("#sni_change").on("click", changeSNI); $("#ip_change").on("click", saveIP); + + $.ajax({ + url: "{{ url_for('get_ip_api') }}", + type: "GET", + success: function (data) { + $("#ipv4").val(data.ipv4 || ""); + $("#ipv6").val(data.ipv6 || ""); + + $("#ipv4").attr("placeholder", "Enter IPv4"); + $("#ipv6").attr("placeholder", "Enter IPv6"); + + + }, + error: function () { + console.error("Failed to fetch IP addresses."); + $("#ipv4").attr("placeholder", "Enter IPv4"); + $("#ipv6").attr("placeholder", "Enter IPv6"); + } + }); }); -{% endblock %} \ No newline at end of file +{% endblock %}