mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-05 04:40:37 +00:00
Adapted added clients new version
This commit is contained in:
parent
415194d7a5
commit
f54770dbba
17 changed files with 343 additions and 94 deletions
|
@ -2,6 +2,7 @@ import 'dart:convert';
|
|||
|
||||
import 'package:adguard_home_manager/constants/enums.dart';
|
||||
import 'package:adguard_home_manager/models/clients_allowed_blocked.dart';
|
||||
import 'package:adguard_home_manager/models/safe_search.dart';
|
||||
|
||||
class Clients {
|
||||
LoadStatus loadStatus;
|
||||
|
@ -100,9 +101,10 @@ class Client {
|
|||
final bool filteringEnabled;
|
||||
final bool parentalEnabled;
|
||||
final bool safebrowsingEnabled;
|
||||
final bool safesearchEnabled;
|
||||
final bool? safesearchEnabled;
|
||||
final bool useGlobalBlockedServices;
|
||||
final bool useGlobalSettings;
|
||||
final SafeSearch? safeSearch;
|
||||
|
||||
Client({
|
||||
required this.name,
|
||||
|
@ -116,6 +118,7 @@ class Client {
|
|||
required this.safesearchEnabled,
|
||||
required this.useGlobalBlockedServices,
|
||||
required this.useGlobalSettings,
|
||||
required this.safeSearch,
|
||||
});
|
||||
|
||||
factory Client.fromJson(Map<String, dynamic> json) => Client(
|
||||
|
@ -130,6 +133,9 @@ class Client {
|
|||
safesearchEnabled: json["safesearch_enabled"],
|
||||
useGlobalBlockedServices: json["use_global_blocked_services"],
|
||||
useGlobalSettings: json["use_global_settings"],
|
||||
safeSearch: json["safe_search"] != null
|
||||
? SafeSearch.fromJson(json["safe_search"])
|
||||
: null
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
@ -142,6 +148,7 @@ class Client {
|
|||
"parental_enabled": parentalEnabled,
|
||||
"safebrowsing_enabled": safebrowsingEnabled,
|
||||
"safesearch_enabled": safesearchEnabled,
|
||||
"safe_search": safeSearch,
|
||||
"use_global_blocked_services": useGlobalBlockedServices,
|
||||
"use_global_settings": useGlobalSettings,
|
||||
};
|
||||
|
|
|
@ -1,25 +1,13 @@
|
|||
import 'package:adguard_home_manager/constants/enums.dart';
|
||||
|
||||
class SafeSearch {
|
||||
LoadStatus loadStatus = LoadStatus.loading;
|
||||
SafeSearchData? data;
|
||||
bool enabled = false;
|
||||
bool bing = false;
|
||||
bool duckduckgo = false;
|
||||
bool google = false;
|
||||
bool pixabay = false;
|
||||
bool yandex = false;
|
||||
bool youtube = false;
|
||||
|
||||
SafeSearch({
|
||||
required this.loadStatus,
|
||||
this.data
|
||||
});
|
||||
}
|
||||
|
||||
class SafeSearchData {
|
||||
final bool enabled;
|
||||
final bool bing;
|
||||
final bool duckduckgo;
|
||||
final bool google;
|
||||
final bool pixabay;
|
||||
final bool yandex;
|
||||
final bool youtube;
|
||||
|
||||
SafeSearchData({
|
||||
required this.enabled,
|
||||
required this.bing,
|
||||
required this.duckduckgo,
|
||||
|
@ -29,7 +17,7 @@ class SafeSearchData {
|
|||
required this.youtube,
|
||||
});
|
||||
|
||||
factory SafeSearchData.fromJson(Map<String, dynamic> json) => SafeSearchData(
|
||||
factory SafeSearch.fromJson(Map<String, dynamic> json) => SafeSearch(
|
||||
enabled: json["enabled"],
|
||||
bing: json["bing"],
|
||||
duckduckgo: json["duckduckgo"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue