diff --git a/CHANGELOG.md b/CHANGELOG.md
index 10be9b1f..45aac6ed 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,10 @@ and this project adheres to
## Added
+- Several new blockable services ([#3972]). Those will now be more in sync with
+ the services that are already blockable in AdGuard DNS.
+- A new HTTP API, `GET /control/blocked_services/all`, that lists all available
+ blocked services and their data, such as SVG icons ([#3972]).
- The new optional `tls.override_tls_ciphers` property, which allows
overriding TLS ciphers used by AdGuard Home ([#4925], [#4990]).
- The ability to serve DNS on link-local IPv6 addresses ([#2926]).
@@ -28,6 +32,11 @@ and this project adheres to
- Responses with `SERVFAIL` code are now cached for at least 30 seconds.
+### Deprecated
+
+- The `GET /control/blocked_services/services` HTTP API; use the new
+ `GET /control/blocked_services/all` API instead ([#3972]).
+
### Fixed
- ClientIDs not working when using DNS-over-HTTPS with HTTP/3.
@@ -41,6 +50,7 @@ and this project adheres to
[#2926]: https://github.com/AdguardTeam/AdGuardHome/issues/2926
[#3418]: https://github.com/AdguardTeam/AdGuardHome/issues/3418
+[#3972]: https://github.com/AdguardTeam/AdGuardHome/issues/3972
[#4916]: https://github.com/AdguardTeam/AdGuardHome/issues/4916
[#4925]: https://github.com/AdguardTeam/AdGuardHome/issues/4925
[#4942]: https://github.com/AdguardTeam/AdGuardHome/issues/4942
diff --git a/client/src/actions/services.js b/client/src/actions/services.js
index 650aa330..f360081e 100644
--- a/client/src/actions/services.js
+++ b/client/src/actions/services.js
@@ -32,6 +32,21 @@ export const getBlockedServices = () => async (dispatch) => {
}
};
+export const getAllBlockedServicesRequest = createAction('GET_ALL_BLOCKED_SERVICES_REQUEST');
+export const getAllBlockedServicesFailure = createAction('GET_ALL_BLOCKED_SERVICES_FAILURE');
+export const getAllBlockedServicesSuccess = createAction('GET_ALL_BLOCKED_SERVICES_SUCCESS');
+
+export const getAllBlockedServices = () => async (dispatch) => {
+ dispatch(getAllBlockedServicesRequest());
+ try {
+ const data = await apiClient.getAllBlockedServices();
+ dispatch(getAllBlockedServicesSuccess(data));
+ } catch (error) {
+ dispatch(addErrorToast({ error }));
+ dispatch(getAllBlockedServicesFailure());
+ }
+};
+
export const setBlockedServicesRequest = createAction('SET_BLOCKED_SERVICES_REQUEST');
export const setBlockedServicesFailure = createAction('SET_BLOCKED_SERVICES_FAILURE');
export const setBlockedServicesSuccess = createAction('SET_BLOCKED_SERVICES_SUCCESS');
diff --git a/client/src/api/Api.js b/client/src/api/Api.js
index 036f9050..bc030fa1 100644
--- a/client/src/api/Api.js
+++ b/client/src/api/Api.js
@@ -465,11 +465,18 @@ class Api {
BLOCKED_SERVICES_SET = { path: 'blocked_services/set', method: 'POST' };
+ BLOCKED_SERVICES_ALL = { path: 'blocked_services/all', method: 'GET' };
+
getBlockedServicesAvailableServices() {
const { path, method } = this.BLOCKED_SERVICES_SERVICES;
return this.makeRequest(path, method);
}
+ getAllBlockedServices() {
+ const { path, method } = this.BLOCKED_SERVICES_ALL;
+ return this.makeRequest(path, method);
+ }
+
getBlockedServices() {
const { path, method } = this.BLOCKED_SERVICES_LIST;
return this.makeRequest(path, method);
diff --git a/client/src/components/Filters/Services/Form.js b/client/src/components/Filters/Services/Form.js
index 4aed810d..1684d5ea 100644
--- a/client/src/components/Filters/Services/Form.js
+++ b/client/src/components/Filters/Services/Form.js
@@ -6,10 +6,11 @@ import flow from 'lodash/flow';
import { toggleAllServices } from '../../../helpers/helpers';
import { renderServiceField } from '../../../helpers/form';
-import { FORM_NAME, SERVICES } from '../../../helpers/constants';
+import { FORM_NAME } from '../../../helpers/constants';
const Form = (props) => {
const {
+ blockedServices,
handleSubmit,
change,
pristine,
@@ -27,7 +28,7 @@ const Form = (props) => {
type="button"
className="btn btn-secondary btn-block"
disabled={processing || processingSet}
- onClick={() => toggleAllServices(SERVICES, change, true)}
+ onClick={() => toggleAllServices(blockedServices, change, true)}
>