mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-01-23 02:35:14 +00:00
Merge pull request #779 from damien-alt-sudo/feature/ui-network-access-clientip
This commit is contained in:
commit
5481b18d8a
2 changed files with 12 additions and 3 deletions
|
|
@ -142,8 +142,12 @@ class CoreSettingsViewSet(viewsets.ModelViewSet):
|
|||
},
|
||||
status=status.HTTP_200_OK,
|
||||
)
|
||||
|
||||
return Response(in_network, status=status.HTTP_200_OK)
|
||||
|
||||
response_data = {
|
||||
**in_network,
|
||||
"client_ip": str(client_ip)
|
||||
}
|
||||
return Response(response_data, status=status.HTTP_200_OK)
|
||||
|
||||
return Response({}, status=status.HTTP_200_OK)
|
||||
|
||||
|
|
|
|||
|
|
@ -191,6 +191,8 @@ const SettingsPage = () => {
|
|||
useState(false);
|
||||
const [netNetworkAccessConfirmCIDRs, setNetNetworkAccessConfirmCIDRs] =
|
||||
useState([]);
|
||||
|
||||
const [clientIpAddress, setClientIpAddress] = useState(null);
|
||||
|
||||
const [proxySettingsSaved, setProxySettingsSaved] = useState(false);
|
||||
const [generalSettingsSaved, setGeneralSettingsSaved] = useState(false);
|
||||
|
|
@ -508,6 +510,9 @@ const SettingsPage = () => {
|
|||
return;
|
||||
}
|
||||
|
||||
// Store the client IP
|
||||
setClientIpAddress(check.client_ip);
|
||||
|
||||
// For now, only warn if we're blocking the UI
|
||||
const blockedAccess = check.UI;
|
||||
if (blockedAccess.length == 0) {
|
||||
|
|
@ -1365,7 +1370,7 @@ Please ensure you have time to let this complete before proceeding.`}
|
|||
message={
|
||||
<>
|
||||
<Text>
|
||||
Your client is not included in the allowed networks for the web
|
||||
Your client {clientIpAddress && `(${clientIpAddress}) `}is not included in the allowed networks for the web
|
||||
UI. Are you sure you want to proceed?
|
||||
</Text>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue