mirror of
https://git.vectorsigma.ru/public/AdGuardHome.git
synced 2026-07-29 00:39:06 +00:00
Pull request 2445: ADG-10438 fixed disabled state of clients action button
Updates #7923.
Squashed commit of the following:
commit 93a14a73b30f4e0e5ed7cd439781298782d9b78a
Merge: 39a009e99 ced9a1694
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Aug 5 13:18:57 2025 +0300
Merge branch 'master' into ADG-10438
commit 39a009e99b514ffac19f4716563e4aa8491b865e
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date: Mon Aug 4 14:55:27 2025 +0300
home: fix disallowed rule
commit 80a1906055185702daa6629b158f4d9c630cdda2
Author: Ildar Kamalov <ik@adguard.com>
Date: Thu Jul 31 17:21:53 2025 +0300
changelog
commit 5c90a6b49b0980f2596e6b9620249c3edfad387b
Author: Ildar Kamalov <ik@adguard.com>
Date: Thu Jul 31 17:15:56 2025 +0300
changelog
commit 501d3575aa28f6fca114e3a2b83f4a48f268e98d
Author: Ildar Kamalov <ik@adguard.com>
Date: Thu Jul 31 17:12:27 2025 +0300
ADG-10438 fixed disabled state of clients action button
This commit is contained in:
@@ -17,6 +17,13 @@ See also the [v0.107.65 GitHub milestone][ms-v0.107.65].
|
|||||||
|
|
||||||
NOTE: Add new changes BELOW THIS COMMENT.
|
NOTE: Add new changes BELOW THIS COMMENT.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Disabled state of Top clients action button in web UI ([#7923]).
|
||||||
|
|
||||||
|
[#7923]: https://github.com/AdguardTeam/AdGuardHome/issues/7923
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
NOTE: Add new changes ABOVE THIS COMMENT.
|
NOTE: Add new changes ABOVE THIS COMMENT.
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -337,7 +337,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.button-action--arrow-option:disabled {
|
.button-action--arrow-option:disabled {
|
||||||
display: none;
|
opacity: 0.5;
|
||||||
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tooltip-custom__container .button-action--arrow-option {
|
.tooltip-custom__container .button-action--arrow-option {
|
||||||
|
|||||||
@@ -475,7 +475,13 @@ func (clients *clientsContainer) findClient(
|
|||||||
params.RemoteIP,
|
params.RemoteIP,
|
||||||
string(params.ClientID),
|
string(params.ClientID),
|
||||||
)
|
)
|
||||||
cj.Disallowed, cj.DisallowedRule = &disallowed, &rule
|
cj.Disallowed = &disallowed
|
||||||
|
|
||||||
|
if disallowed && rule != "" {
|
||||||
|
// Since "disallowed_rule" is omitted from JSON unless present, it
|
||||||
|
// should only be set when the client is actually blocked.
|
||||||
|
cj.DisallowedRule = &rule
|
||||||
|
}
|
||||||
|
|
||||||
return cj
|
return cj
|
||||||
}
|
}
|
||||||
@@ -554,12 +560,19 @@ func (clients *clientsContainer) findRuntime(
|
|||||||
// See https://github.com/AdguardTeam/AdGuardHome/issues/2428.
|
// See https://github.com/AdguardTeam/AdGuardHome/issues/2428.
|
||||||
disallowed, rule := clients.clientChecker.IsBlockedClient(ip, string(params.ClientID))
|
disallowed, rule := clients.clientChecker.IsBlockedClient(ip, string(params.ClientID))
|
||||||
|
|
||||||
|
var disallowedRule *string
|
||||||
|
if disallowed && rule != "" {
|
||||||
|
// Since "disallowed_rule" is omitted from JSON unless present, it
|
||||||
|
// should only be set when the client is actually blocked.
|
||||||
|
disallowedRule = &rule
|
||||||
|
}
|
||||||
|
|
||||||
return &clientJSON{
|
return &clientJSON{
|
||||||
Name: host,
|
Name: host,
|
||||||
IDs: []string{idStr},
|
IDs: []string{idStr},
|
||||||
WHOIS: whois,
|
WHOIS: whois,
|
||||||
Disallowed: &disallowed,
|
Disallowed: &disallowed,
|
||||||
DisallowedRule: &rule,
|
DisallowedRule: disallowedRule,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -421,7 +421,6 @@ func TestClientsContainer_HandleSearchClient(t *testing.T) {
|
|||||||
allowed = false
|
allowed = false
|
||||||
dissallowed = true
|
dissallowed = true
|
||||||
|
|
||||||
emptyRule = ""
|
|
||||||
disallowedRule = "disallowed_rule"
|
disallowedRule = "disallowed_rule"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -432,7 +431,7 @@ func TestClientsContainer_HandleSearchClient(t *testing.T) {
|
|||||||
return true, disallowedRule
|
return true, disallowedRule
|
||||||
}
|
}
|
||||||
|
|
||||||
return false, emptyRule
|
return false, ""
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -481,11 +480,10 @@ func TestClientsContainer_HandleSearchClient(t *testing.T) {
|
|||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
wantRuntime: &clientJSON{
|
wantRuntime: &clientJSON{
|
||||||
Name: runtimeCli,
|
Name: runtimeCli,
|
||||||
IDs: []string{runtimeCliIP},
|
IDs: []string{runtimeCliIP},
|
||||||
Disallowed: &allowed,
|
Disallowed: &allowed,
|
||||||
DisallowedRule: &emptyRule,
|
WHOIS: &whois.Info{},
|
||||||
WHOIS: &whois.Info{},
|
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
name: "blocked_access",
|
name: "blocked_access",
|
||||||
@@ -508,10 +506,9 @@ func TestClientsContainer_HandleSearchClient(t *testing.T) {
|
|||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
wantRuntime: &clientJSON{
|
wantRuntime: &clientJSON{
|
||||||
IDs: []string{nonExistentCliIP},
|
IDs: []string{nonExistentCliIP},
|
||||||
Disallowed: &allowed,
|
Disallowed: &allowed,
|
||||||
DisallowedRule: &emptyRule,
|
WHOIS: &whois.Info{},
|
||||||
WHOIS: &whois.Info{},
|
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user