mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-06-29 20:39:51 +00:00
Compare commits
204 commits
2.15.0-bet
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
a4bf4cd3c5 | ||
|
61b0f724ba | ||
|
52945b04ff | ||
|
8e5bbdbd4b | ||
|
e6a01ac546 | ||
|
e8440f7d1d | ||
|
6cc212751b | ||
|
ae9d23d4a8 | ||
|
566254e617 | ||
|
88339d1c40 | ||
|
254bbcef57 | ||
|
e7aacfbec1 | ||
|
7a75a67701 | ||
|
7632d9ef87 | ||
|
eded494024 | ||
|
e5979edf63 | ||
|
f27b17aad0 | ||
|
fd4daba2aa | ||
|
ce7a8e8cc5 | ||
|
4282792ebd | ||
|
4766d1907f | ||
|
7f6f686b2b | ||
|
02b659c1bc | ||
|
db6e63c4aa | ||
|
a666d109d9 | ||
|
1f23f1f3ca | ||
|
51b8a6b610 | ||
|
28034d4b74 | ||
|
10ff5183f1 | ||
|
47b5313bf3 | ||
|
791400f565 | ||
|
06c9f7c771 | ||
|
2a0db84959 | ||
|
74cade6553 | ||
|
1b5f258c96 | ||
|
aa511f8c42 | ||
|
c28d2440b1 | ||
|
9d4c002813 | ||
|
d7392e4b8d | ||
|
4dc54794bd | ||
|
a36335ef92 | ||
|
9096367843 | ||
|
0d0321a5ab | ||
|
d903da0051 | ||
|
b65dc35cb7 | ||
|
7bb7ad40c4 | ||
|
7579e2d580 | ||
|
6eb1d73ca4 | ||
|
3055c3582b | ||
|
f9f7e8c2c9 | ||
|
fc2305266f | ||
|
6df7d89867 | ||
|
67bc6a1716 | ||
|
391d1da1ff | ||
|
a171eda41c | ||
|
6e0f437c6b | ||
|
2f1e8d38a8 | ||
|
c0f7449a95 | ||
|
b223076dae | ||
|
9eb200f5da | ||
|
f9149056fd | ||
|
29af26f118 | ||
|
f7c3ba0374 | ||
|
715ca0ab3f | ||
|
ffcc0c2da0 | ||
|
8761652eaa | ||
|
b7d4680f9c | ||
|
d6b16b230c | ||
|
7d1845f806 | ||
|
bd08c98849 | ||
|
7991f29707 | ||
|
be3e76eafc | ||
|
5bf2db8a52 | ||
|
0eae951eed | ||
|
f8f18be723 | ||
|
b685010a03 | ||
|
a8cbed5ca0 | ||
|
cce54c8ba5 | ||
|
4f903d8e4c | ||
|
9a747dd2fb | ||
|
27b0c3a3a0 | ||
|
b981f4a5cb | ||
|
d34d881722 | ||
|
ad6e75b6fb | ||
|
4dd77a39d8 | ||
|
8801428167 | ||
|
1dd23906c3 | ||
|
c5d2892ec2 | ||
|
1c5f0e46f5 | ||
|
5f5d79147f | ||
|
38d2955a8c | ||
|
212e57149f | ||
|
c4ee498d62 | ||
|
9295321cda | ||
|
1e84fbfcb0 | ||
|
2326470578 | ||
|
3c397d208f | ||
|
e4298cc062 | ||
|
8b7b85fd61 | ||
|
a88dc21974 | ||
|
5e72d5579a | ||
|
f838302720 | ||
|
18ee68d684 | ||
|
d3b6833e15 | ||
|
b56234be91 | ||
|
d48687bfa0 | ||
|
6ab603d459 | ||
|
7e13285b7e | ||
|
999da666b4 | ||
|
fac793a3a2 | ||
|
5be5377110 | ||
|
ecc9cf1073 | ||
|
fd25088791 | ||
|
e013b1496e | ||
|
b270ca2b8c | ||
|
a3c63ffd9a | ||
|
e88b61eb90 | ||
|
ac5be8b500 | ||
|
4b3129656b | ||
|
a8d0bd95a6 | ||
|
5fdeaa80b7 | ||
|
806e74ca9f | ||
|
31ad3fcf6a | ||
|
d65ea6520c | ||
|
ce8d38958e | ||
|
ad6cb92d4b | ||
|
442c7d9264 | ||
|
a0b566446b | ||
|
4d8660d363 | ||
|
a58b97a1bd | ||
|
2a075816b3 | ||
|
59a7a31a4f | ||
|
654284b46a | ||
|
019367ca93 | ||
|
7c0b592715 | ||
|
133d29aa91 | ||
|
dac07edd89 | ||
|
ba2a27fef0 | ||
|
9de9b0afec | ||
|
0821fd4e0e | ||
|
8859468a66 | ||
|
19ae91905f | ||
|
7087bd5aee | ||
|
f624fdbc43 | ||
|
0a2a86ef81 | ||
|
693e66e125 | ||
|
e603814d42 | ||
|
7a89aea3a5 | ||
|
dcad63fe5c | ||
|
bce93fa5ca | ||
|
e21e34668d | ||
|
6629237548 | ||
|
923fb97f03 | ||
|
568b879054 | ||
|
4702c8c427 | ||
|
c60b62345b | ||
|
ca4fa5d7df | ||
|
dab9f69e69 | ||
|
eb703c6f58 | ||
|
9cd480aa9a | ||
|
e2757d4b8f | ||
|
6985efc4cb | ||
|
34246d238b | ||
|
dba9c8b9ac | ||
|
3a210fb9fd | ||
|
b2c2a1452f | ||
|
00f77fc12c | ||
|
0dc10abc29 | ||
|
a2d8e9d1c1 | ||
|
d51964de32 | ||
|
c249b757b2 | ||
|
7fa5eee014 | ||
|
034280afa8 | ||
|
5dbe1e3f74 | ||
|
5f4580b6a0 | ||
|
6e8ecf11a0 | ||
|
7d2da49bc8 | ||
|
2f4bf402fe | ||
|
3f057062f1 | ||
|
b977aed9bd | ||
|
11dd6b23bd | ||
|
5ca3c04c89 | ||
|
3e152db6ac | ||
|
ed0bc65285 | ||
|
c150d2ba23 | ||
|
2fca44f195 | ||
|
1bc1efbe56 | ||
|
8df0781da6 | ||
|
5f448f0af0 | ||
|
2585826a29 | ||
|
9b1e36df5b | ||
|
794b690c91 | ||
|
f8f3914cad | ||
|
3eaf7143f2 | ||
|
ae3e172033 | ||
|
16f1d4664c | ||
|
1a7925f49d | ||
|
aed2500fa4 | ||
|
d92d755381 | ||
|
340ef4f00e | ||
|
02b9bd034f | ||
|
a4e8694cc1 | ||
|
406f7c832f | ||
|
2f95173d22 |
183 changed files with 7192 additions and 4584 deletions
51
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
51
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
name: Report a bug
|
||||
description: |
|
||||
You detected something wrong on the application.
|
||||
labels: ["bug"]
|
||||
body:
|
||||
- type: textarea
|
||||
id: steps
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: Steps to reproduce the problem you are running into.
|
||||
placeholder: |
|
||||
1. ...
|
||||
2. ...
|
||||
3. ...
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected-results
|
||||
attributes:
|
||||
label: Expected results
|
||||
description: What is expected to happen.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: actual-results
|
||||
attributes:
|
||||
label: Actual results
|
||||
description: What is actually happening.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: screenshots
|
||||
attributes:
|
||||
label: Screenshots or Video
|
||||
description: |
|
||||
Upload any screenshots or video of the bug.
|
||||
value: |
|
||||
Screenshots or video demonstration
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: app-os-details
|
||||
attributes:
|
||||
label: App and OS details
|
||||
description: |
|
||||
Some details about the app version and the OS where you are running the application.
|
||||
value: |
|
||||
- App version: (eg: v2.16.0)
|
||||
- Device OS version: (eg: Android 14)
|
||||
validations:
|
||||
required: true
|
32
.github/ISSUE_TEMPLATE/feature_request_agh.yml
vendored
Normal file
32
.github/ISSUE_TEMPLATE/feature_request_agh.yml
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
name: Request a new feature that has been added to AdGuard Home
|
||||
description: |
|
||||
The AdGuard Home team added recently a new feature that you want on the app.
|
||||
labels: ["agh feature request"]
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: Describe the feature that you want on the app.
|
||||
placeholder: |
|
||||
Write the details here...
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: screenshots
|
||||
attributes:
|
||||
label: Screenshots
|
||||
description: Attach some screenshots of where that new feature is located on the web administration panel.
|
||||
placeholder: |
|
||||
Screenshots here.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: version-introduced
|
||||
attributes:
|
||||
label: Version where feature was introduced
|
||||
description: Version of the AdGuard Home server where this feature was introduced.
|
||||
placeholder: |
|
||||
- Version: (eg: v0.107.44)
|
||||
validations:
|
||||
required: true
|
20
.github/ISSUE_TEMPLATE/feature_request_app.yml
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request_app.yml
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
name: Request a new feature or an improvement for the app itself
|
||||
description: |
|
||||
You want a new feature for the application, or an improvement for an existing one.
|
||||
labels: ["app feature request"]
|
||||
body:
|
||||
- type: markdown
|
||||
id: important-info
|
||||
attributes:
|
||||
value: |
|
||||
ℹ️ IMPORTANT INFO ℹ️
|
||||
Please note that if the functionality is related to data representation, it may not be implemented, as AdGuard Home Manager depends on the capabilities of the AdGuard Home API.
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: Describe the feature that you want on the app.
|
||||
placeholder: |
|
||||
Write the details here...
|
||||
validations:
|
||||
required: true
|
19
.github/ISSUE_TEMPLATE/question.yml
vendored
Normal file
19
.github/ISSUE_TEMPLATE/question.yml
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
name: You have a question about the app
|
||||
description: |
|
||||
You want ask something that's not related with a feature request or a bug.
|
||||
labels: ["question"]
|
||||
body:
|
||||
- type: markdown
|
||||
id: important-info
|
||||
attributes:
|
||||
value: |
|
||||
Having problems while adding a connection to a server? Check out [this guide](https://github.com/JGeek00/adguard-home-manager/wiki/Create-a-connection).
|
||||
- type: textarea
|
||||
id: question
|
||||
attributes:
|
||||
label: Question
|
||||
description: Write your question here giving the maximum detail possible.
|
||||
placeholder: |
|
||||
Write your question here...
|
||||
validations:
|
||||
required: true
|
123
.github/workflows/release-beta.yaml
vendored
123
.github/workflows/release-beta.yaml
vendored
|
@ -1,123 +0,0 @@
|
|||
name: Compile and release beta build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
branches:
|
||||
- beta
|
||||
|
||||
jobs:
|
||||
build-android:
|
||||
name: Build Android .apk and .aab
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ANDROID_AAB_RELEASE_PATH: build/app/outputs/bundle/release
|
||||
ANDROID_APK_RELEASE_PATH: build/app/outputs/apk/release
|
||||
outputs:
|
||||
VERSION_NAME: ${{ steps.save_version.outputs.version_name }}
|
||||
VERSION_NUMBER: ${{ steps.save_version.outputs.version_number }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: beta
|
||||
- name: Decode android/app/keystore.jks
|
||||
run: echo "${{ secrets.KEYSTORE_JKS }}" | base64 --decode > android/app/keystore.jks
|
||||
- name: Decode android/key.properties
|
||||
run: echo "${{ secrets.KEY_PROPERTIES }}" | base64 --decode > android/key.properties
|
||||
- name: Decode .env
|
||||
run: echo "${{ secrets.ENV }}" | base64 --decode > .env
|
||||
- name: Read pubspec.yaml
|
||||
uses: adore-me/read-yaml@v1.0.0
|
||||
id: read_pubspec
|
||||
with:
|
||||
file: './pubspec.yaml'
|
||||
key-path: '["version"]'
|
||||
- name: Save version on env variable
|
||||
id: save_version
|
||||
run: |
|
||||
version=${{ steps.read_pubspec.outputs.data }}
|
||||
IFS='+'
|
||||
read -r -a split <<< "$version"
|
||||
echo "VERSION_NAME=$(echo ${split[0]})" >> $GITHUB_ENV
|
||||
echo "version_name=${split[0]}" >> $GITHUB_OUTPUT
|
||||
echo "version_number=${split[1]}" >> $GITHUB_OUTPUT
|
||||
- name: Update KeyStore password in gradle properties
|
||||
run: sed -i 's/#{KEYSTORE_PASS}#/${{ secrets.KEYSTORE_PASS }}/g' android/key.properties
|
||||
- name: Update KeyStore key password in gradle properties
|
||||
run: sed -i 's/#{KEYSTORE_KEY_PASS}#/${{ secrets.KEYSTORE_KEY_PASS }}/g' android/key.properties
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: '18.x'
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: "stable"
|
||||
- run: flutter clean
|
||||
- run: flutter pub get
|
||||
- run: flutter build apk --release
|
||||
- run: flutter build appbundle --release
|
||||
- name: Rename apk
|
||||
run: mv $ANDROID_APK_RELEASE_PATH/app-release.apk $ANDROID_APK_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.apk
|
||||
- name: Rename aab
|
||||
run: mv $ANDROID_AAB_RELEASE_PATH/app-release.aab $ANDROID_AAB_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.aab
|
||||
- name: Copy apk to project root
|
||||
run: cp $ANDROID_APK_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.apk AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.apk
|
||||
- name: Copy aab to project root
|
||||
run: cp $ANDROID_AAB_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.aab AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.aab
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: android
|
||||
path: |
|
||||
AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.aab
|
||||
AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.apk
|
||||
release-builds-github:
|
||||
name: Release beta build to GitHub
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-android]
|
||||
env:
|
||||
VERSION_NAME: ${{ needs.build-android.outputs.VERSION_NAME }}
|
||||
VERSION_NUMBER: ${{ needs.build-android.outputs.VERSION_NUMBER }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: beta
|
||||
- name: Create builds directory
|
||||
run: mkdir releases
|
||||
- name: Download Android artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: android
|
||||
path: releases/
|
||||
- name: Release to GitHub
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "releases/*"
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
tag: '${{ env.VERSION_NAME }}_(${{ env.VERSION_NUMBER }})'
|
||||
name: v${{ env.VERSION_NAME }}
|
||||
draft: true
|
||||
prerelease: true
|
||||
commit: ${{ github.sha }}
|
||||
release-build-google-play:
|
||||
name: Release Android beta build to the Google Play Store
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-android]
|
||||
env:
|
||||
VERSION_NAME: ${{ needs.build-android.outputs.VERSION_NAME }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: beta
|
||||
- name: Download Android artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: android
|
||||
- name: Release app to Google Play
|
||||
uses: r0adkll/upload-google-play@v1
|
||||
with:
|
||||
serviceAccountJsonPlainText: ${{ secrets.PLAYSTORE_ACCOUNT_KEY }}
|
||||
packageName: com.jgeek00.adguard_home_manager
|
||||
releaseFiles: AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.aab
|
||||
track: beta
|
||||
status: draft
|
||||
releaseName: ${{ env.VERSION_NAME }}
|
302
.github/workflows/release-stable.yaml
vendored
302
.github/workflows/release-stable.yaml
vendored
|
@ -1,302 +0,0 @@
|
|||
name: Compile and release production build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build-android:
|
||||
name: Build Android .apk and .aab
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ANDROID_AAB_RELEASE_PATH: build/app/outputs/bundle/release
|
||||
ANDROID_APK_RELEASE_PATH: build/app/outputs/apk/release
|
||||
outputs:
|
||||
VERSION_NAME: ${{ steps.save_version.outputs.version_name }}
|
||||
VERSION_NUMBER: ${{ steps.save_version.outputs.version_number }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Decode android/app/keystore.jks
|
||||
run: echo "${{ secrets.KEYSTORE_JKS }}" | base64 --decode > android/app/keystore.jks
|
||||
- name: Decode android/key.properties
|
||||
run: echo "${{ secrets.KEY_PROPERTIES }}" | base64 --decode > android/key.properties
|
||||
- name: Decode .env
|
||||
run: echo "${{ secrets.ENV }}" | base64 --decode > .env
|
||||
- name: Read pubspec.yaml
|
||||
uses: adore-me/read-yaml@v1.0.0
|
||||
id: read_pubspec
|
||||
with:
|
||||
file: './pubspec.yaml'
|
||||
key-path: '["version"]'
|
||||
- name: Save version on env variable
|
||||
id: save_version
|
||||
run: |
|
||||
version=${{ steps.read_pubspec.outputs.data }}
|
||||
IFS='+'
|
||||
read -r -a split <<< "$version"
|
||||
echo "VERSION_NAME=$(echo ${split[0]})" >> $GITHUB_ENV
|
||||
echo "version_name=${split[0]}" >> $GITHUB_OUTPUT
|
||||
echo "version_number=${split[1]}" >> $GITHUB_OUTPUT
|
||||
- name: Update KeyStore password in gradle properties
|
||||
run: sed -i 's/#{KEYSTORE_PASS}#/${{ secrets.KEYSTORE_PASS }}/g' android/key.properties
|
||||
- name: Update KeyStore key password in gradle properties
|
||||
run: sed -i 's/#{KEYSTORE_KEY_PASS}#/${{ secrets.KEYSTORE_KEY_PASS }}/g' android/key.properties
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: '18.x'
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: "stable"
|
||||
- run: flutter clean
|
||||
- run: flutter pub get
|
||||
- run: flutter build apk --release
|
||||
- run: flutter build appbundle --release
|
||||
- name: Rename apk
|
||||
run: mv $ANDROID_APK_RELEASE_PATH/app-release.apk $ANDROID_APK_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.apk
|
||||
- name: Rename aab
|
||||
run: mv $ANDROID_AAB_RELEASE_PATH/app-release.aab $ANDROID_AAB_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.aab
|
||||
- name: Copy apk to project root
|
||||
run: cp $ANDROID_APK_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.apk AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.apk
|
||||
- name: Copy aab to project root
|
||||
run: cp $ANDROID_AAB_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.aab AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.aab
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: android
|
||||
path: |
|
||||
AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.aab
|
||||
AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.apk
|
||||
build-macos:
|
||||
name: Build macOS .dmg
|
||||
runs-on: macos-latest
|
||||
env:
|
||||
MACOS_APP_RELEASE_PATH: build/macos/Build/Products/Release
|
||||
outputs:
|
||||
VERSION_NAME: ${{ steps.save_version.outputs.version_name }}
|
||||
VERSION_NUMBER: ${{ steps.save_version.outputs.version_number }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Decode .env
|
||||
run: echo "${{ secrets.ENV }}" | base64 --decode > .env
|
||||
- name: Read pubspec.yaml
|
||||
uses: adore-me/read-yaml@v1.0.0
|
||||
id: read_pubspec
|
||||
with:
|
||||
file: './pubspec.yaml'
|
||||
key-path: '["version"]'
|
||||
- name: Save version on env variable
|
||||
id: save_version
|
||||
run: |
|
||||
version=${{ steps.read_pubspec.outputs.data }}
|
||||
IFS='+'
|
||||
read -r -a split <<< "$version"
|
||||
echo "VERSION_NAME=$(echo ${split[0]})" >> $GITHUB_ENV
|
||||
echo "version_name=${split[0]}" >> $GITHUB_OUTPUT
|
||||
echo "version_number=${split[1]}" >> $GITHUB_OUTPUT
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: "stable"
|
||||
- run: flutter clean
|
||||
- run: flutter pub get
|
||||
- run: flutter build macos --release
|
||||
- name: Install the Apple certificate and sign the application
|
||||
env:
|
||||
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE_PWD: ${{ secrets.APPLE_CERTIFICATE_PWD }}
|
||||
APPLE_KEYCHAIN_PWD: ${{ secrets.APPLE_KEYCHAIN_PWD }}
|
||||
APPLE_IDENTITY_ID: ${{ secrets.APPLE_IDENTITY_ID }}
|
||||
run: |
|
||||
echo "$APPLE_CERTIFICATE" | base64 --decode > certificate.p12
|
||||
security create-keychain -p $APPLE_KEYCHAIN_PWD build.keychain
|
||||
security default-keychain -s build.keychain
|
||||
security unlock-keychain -p $APPLE_KEYCHAIN_PWD build.keychain
|
||||
security import certificate.p12 -k build.keychain -P $APPLE_CERTIFICATE_PWD -T /usr/bin/codesign
|
||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $APPLE_KEYCHAIN_PWD build.keychain
|
||||
/usr/bin/codesign --force -s "$APPLE_IDENTITY_ID" $MACOS_APP_RELEASE_PATH/AdGuard\ Home\ Manager.app -v
|
||||
- name: Create folder to build dmg
|
||||
run: mkdir $MACOS_APP_RELEASE_PATH/AdGuard\ Home\ Manager
|
||||
- name: Copy app into folder
|
||||
run: cp -r $MACOS_APP_RELEASE_PATH/AdGuard\ Home\ Manager.app $MACOS_APP_RELEASE_PATH/AdGuard\ Home\ Manager/AdGuard\ Home\ Manager.app
|
||||
- name: Generate symbolic link to Applications dir
|
||||
run: ln -s /Applications $MACOS_APP_RELEASE_PATH/AdGuard\ Home\ Manager
|
||||
- name: Generate dmg
|
||||
run: hdiutil create -srcfolder $MACOS_APP_RELEASE_PATH/AdGuard\ Home\ Manager $MACOS_APP_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_macOS_Universal.dmg
|
||||
- name: Copy dmg to project root
|
||||
run: cp $MACOS_APP_RELEASE_PATH/AdGuardHomeManager_${{ env.VERSION_NAME }}_macOS_Universal.dmg AdGuardHomeManager_${{ env.VERSION_NAME }}_macOS_Universal.dmg
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: macos
|
||||
path: AdGuardHomeManager_${{ env.VERSION_NAME }}_macOS_Universal.dmg
|
||||
build-linux:
|
||||
name: Build Linux .tar.gz and .deb
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
VERSION_NAME: ${{ steps.save_version.outputs.version_name }}
|
||||
VERSION_NUMBER: ${{ steps.save_version.outputs.version_number }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Decode .env
|
||||
run: echo "${{ secrets.ENV }}" | base64 --decode > .env
|
||||
- name: Read pubspec.yaml
|
||||
uses: adore-me/read-yaml@v1.0.0
|
||||
id: read_pubspec
|
||||
with:
|
||||
file: './pubspec.yaml'
|
||||
key-path: '["version"]'
|
||||
- name: Save version on env variable
|
||||
id: save_version
|
||||
run: |
|
||||
version=${{ steps.read_pubspec.outputs.data }}
|
||||
IFS='+'
|
||||
read -r -a split <<< "$version"
|
||||
echo "VERSION_NAME=$(echo ${split[0]})" >> $GITHUB_ENV
|
||||
echo "version_name=${split[0]}" >> $GITHUB_OUTPUT
|
||||
echo "version_number=${split[1]}" >> $GITHUB_OUTPUT
|
||||
- name: Update version in debian.yaml
|
||||
run: sed -i 's/<REPLACE_VERSION_NUMBER_ACTIONS>/${{ env.VERSION_NAME }}/g' debian/debian.yaml
|
||||
- name: Update dependencies list
|
||||
run: sudo apt-get update
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: "stable"
|
||||
- run: flutter clean
|
||||
- run: flutter pub get
|
||||
- run: flutter build linux --release
|
||||
- name: Install flutter_to_debian
|
||||
run: dart pub global activate flutter_to_debian
|
||||
- name: Generate .deb package
|
||||
run: flutter_to_debian
|
||||
- name: Move .deb package to project root
|
||||
run: mv build/linux/x64/release/debian/AdGuardHomeManager_${{ env.VERSION_NAME }}_amd64.deb AdGuardHomeManager_${{ env.VERSION_NAME }}_Linux_amd64.deb
|
||||
- name: Generate .tar.gz package
|
||||
uses: a7ul/tar-action@v1.1.3
|
||||
id: compress
|
||||
with:
|
||||
command: c
|
||||
cwd: build/linux/x64/release/bundle
|
||||
files: |
|
||||
./data
|
||||
./lib
|
||||
./AdGuardHomeManager
|
||||
outPath: AdGuardHomeManager_${{ env.VERSION_NAME }}_Linux.tar.gz
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: linux
|
||||
path: |
|
||||
AdGuardHomeManager_${{ env.VERSION_NAME }}_Linux_amd64.deb
|
||||
AdGuardHomeManager_${{ env.VERSION_NAME }}_Linux.tar.gz
|
||||
build-windows:
|
||||
name: Build Windows installer
|
||||
runs-on: windows-latest
|
||||
outputs:
|
||||
VERSION_NAME: ${{ steps.save_version.outputs.version_name }}
|
||||
VERSION_NUMBER: ${{ steps.save_version.outputs.version_number }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Decode .env
|
||||
shell: pwsh
|
||||
run: |
|
||||
[IO.File]::WriteAllBytes('.env', [Convert]::FromBase64String('${{ secrets.ENV }}'))
|
||||
- name: Read pubspec.yaml
|
||||
uses: adore-me/read-yaml@v1.0.0
|
||||
id: read_pubspec
|
||||
with:
|
||||
file: './pubspec.yaml'
|
||||
key-path: '["version"]'
|
||||
- name: Save version on env variable
|
||||
shell: bash
|
||||
id: save_version
|
||||
run: |
|
||||
version=${{ steps.read_pubspec.outputs.data }}
|
||||
IFS='+'
|
||||
read -r -a split <<< "$version"
|
||||
echo "VERSION_NAME=$(echo ${split[0]})" >> $GITHUB_ENV
|
||||
echo "version_name=${split[0]}" >> $GITHUB_OUTPUT
|
||||
echo "version_number=${split[1]}" >> $GITHUB_OUTPUT
|
||||
- name: Update version in innosetup config file
|
||||
shell: pwsh
|
||||
run: |
|
||||
(Get-Content windows/innosetup_installer_builder.iss) -replace '<REPLACE_VERSION_ACTIONS>', '${{ env.VERSION_NAME }}' | Out-File -encoding ASCII windows/innosetup_installer_builder.iss
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: "stable"
|
||||
- run: flutter clean
|
||||
- run: flutter pub get
|
||||
- run: flutter build windows --release
|
||||
- name: Build installer witn innosetup
|
||||
run: iscc /Q windows/innosetup_installer_builder.iss
|
||||
- name: Move installer file to root directory
|
||||
run: move build/windows/aghm_installer.exe AdGuardHomeManager_${{ env.VERSION_NAME }}_Windows_x64.exe
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: windows
|
||||
path: AdGuardHomeManager_${{ env.VERSION_NAME }}_Windows_x64.exe
|
||||
release-builds-github:
|
||||
name: Release builds to GitHub
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-android, build-macos, build-linux, build-windows]
|
||||
env:
|
||||
VERSION_NAME: ${{ needs.build-android.outputs.VERSION_NAME }}
|
||||
VERSION_NUMBER: ${{ needs.build-android.outputs.VERSION_NUMBER }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Create builds directory
|
||||
run: mkdir releases
|
||||
- name: Download Android artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: android
|
||||
path: releases/
|
||||
- name: Download macOS artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: macos
|
||||
path: releases/
|
||||
- name: Download Linux artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: linux
|
||||
path: releases/
|
||||
- name: Download Windows artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows
|
||||
path: releases/
|
||||
- name: Release to GitHub
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "releases/*"
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
tag: '${{ env.VERSION_NAME }}_(${{ env.VERSION_NUMBER }})'
|
||||
name: v${{ env.VERSION_NAME }}
|
||||
draft: true
|
||||
prerelease: false
|
||||
commit: ${{ github.sha }}
|
||||
release-build-google-play:
|
||||
name: Release Android build to the Google Play Store
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-android, build-macos, build-linux, build-windows]
|
||||
env:
|
||||
VERSION_NAME: ${{ needs.build-android.outputs.VERSION_NAME }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Download Android artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: android
|
||||
- name: Release app to Google Play
|
||||
uses: r0adkll/upload-google-play@v1
|
||||
with:
|
||||
serviceAccountJsonPlainText: ${{ secrets.PLAYSTORE_ACCOUNT_KEY }}
|
||||
packageName: com.jgeek00.adguard_home_manager
|
||||
releaseFiles: AdGuardHomeManager_${{ env.VERSION_NAME }}_Android.aab
|
||||
track: production
|
||||
status: draft
|
||||
releaseName: ${{ env.VERSION_NAME }}
|
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -5,9 +5,11 @@
|
|||
*.swp
|
||||
.DS_Store
|
||||
.atom/
|
||||
.build/
|
||||
.buildlog/
|
||||
.history
|
||||
.svn/
|
||||
.swiftpm/
|
||||
migrate_working_dir/
|
||||
|
||||
# Env
|
||||
|
@ -48,4 +50,6 @@ app.*.map.json
|
|||
|
||||
/debian/packages
|
||||
|
||||
untranslated.json
|
||||
untranslated.json
|
||||
|
||||
android/app/.cxx
|
||||
|
|
20
.vscode/settings.json
vendored
Normal file
20
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"editor.formatOnSave": false,
|
||||
"editor.formatOnPaste": false,
|
||||
"editor.formatOnType": false,
|
||||
"editor.defaultFormatter": "Dart-Code.flutter",
|
||||
"dart.lineLength": 120,
|
||||
"[dart]": {
|
||||
"editor.rulers": [
|
||||
120
|
||||
],
|
||||
"editor.defaultFormatter": "Dart-Code.dart-code",
|
||||
"editor.formatOnSave": false,
|
||||
"editor.formatOnPaste": false,
|
||||
"editor.formatOnType": false
|
||||
},
|
||||
"cSpell.ignorePaths": [
|
||||
"/pubspec.yaml",
|
||||
"/.github/workflows"
|
||||
],
|
||||
}
|
18
README.md
18
README.md
|
@ -40,7 +40,16 @@ Check the privacy policy [here](https://github.com/JGeek00/adguard-home-manager/
|
|||
This is an unofficial application. The AdGuard Home team and the development of the AdGuard Home software is not related in any way with this application.
|
||||
|
||||
## Recommended configuration and lists
|
||||
On [this repository](https://github.com/JuanRodenas/Pihole_list) you can find a recommended configuration for AdGuard Home and some lists. Thanks to [JuanRodenas](https://github.com/JuanRodenas).
|
||||
On [this repository](https://github.com/juanico10/Pihole_list) you can find a recommended configuration for AdGuard Home and some lists. Thanks to [juanico10](https://github.com/juanico10).
|
||||
|
||||
## Donations
|
||||
If you like the project and you want to contribute with the development, you can [become a sponsor on GitHub](https://github.com/sponsors/JGeek00), or you can donate using PayPal.
|
||||
|
||||
<div align="center">
|
||||
<a href="https://www.paypal.com/donate/?hosted_button_id=T63UK6AVL3MG8">
|
||||
<img src="https://raw.githubusercontent.com/stefan-niedermann/paypal-donate-button/master/paypal-donate-button.png" alt="Donate with PayPal" height="100" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
## Generate production build
|
||||
<ul>
|
||||
|
@ -104,7 +113,6 @@ On [this repository](https://github.com/JuanRodenas/Pihole_list) you can find a
|
|||
- [expandable](https://pub.dev/packages/expandable)
|
||||
- [package info plus](https://pub.dev/packages/package_info_plus)
|
||||
- [flutter phoenix](https://pub.dev/packages/flutter_phoenix)
|
||||
- [flutter displaymode](https://pub.dev/packages/flutter_displaymode)
|
||||
- [flutter launcher icons](https://pub.dev/packages/flutter_launcher_icons)
|
||||
- [flutter native splash](https://pub.dev/packages/flutter_native_splash)
|
||||
- [intl](https://pub.dev/packages/intl)
|
||||
|
@ -112,10 +120,8 @@ On [this repository](https://github.com/JuanRodenas/Pihole_list) you can find a
|
|||
- [dynamic color](https://pub.dev/packages/dynamic_color)
|
||||
- [device info](https://pub.dev/packages/device_info)
|
||||
- [fl chart](https://pub.dev/packages/fl_chart)
|
||||
- [flutter web browser](https://pub.dev/packages/flutter_web_browser)
|
||||
- [flutter svg](https://pub.dev/packages/flutter_svg)
|
||||
- [percent indicator](https://pub.dev/packages/percent_indicator)
|
||||
- [store checker](https://pub.dev/packages/store_checker)
|
||||
- [flutter markdown](https://pub.dev/packages/flutter_markdown)
|
||||
- [markdown](https://pub.dev/packages/markdown)
|
||||
- [html](https://pub.dev/packages/html)
|
||||
|
@ -131,6 +137,10 @@ On [this repository](https://github.com/JuanRodenas/Pihole_list) you can find a
|
|||
- [pie chart](https://pub.dev/packages/pie_chart)
|
||||
- [segmented button slide](https://pub.dev/packages/segmented_button_slide)
|
||||
- [timezone](https://pub.dev/packages/timezone)
|
||||
- [url launcher](https://pub.dev/packages/url_launcher)
|
||||
- [flutter custom tabs](https://pub.dev/packages/flutter_custom_tabs)
|
||||
- [shared preferences](https://pub.dev/packages/shared_preferences)
|
||||
- [window manager](https://pub.dev/packages/window_manager)
|
||||
|
||||
<br>
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
plugins {
|
||||
id "com.android.application"
|
||||
id "kotlin-android"
|
||||
id "dev.flutter.flutter-gradle-plugin"
|
||||
}
|
||||
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
|
@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
|
|||
}
|
||||
}
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
|
@ -21,10 +22,6 @@ if (flutterVersionName == null) {
|
|||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
def keystoreProperties = new Properties()
|
||||
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
|
@ -32,8 +29,9 @@ if (keystorePropertiesFile.exists()) {
|
|||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 33
|
||||
ndkVersion flutter.ndkVersion
|
||||
namespace "com.jgeek00.adguard_home_manager"
|
||||
compileSdkVersion 35
|
||||
ndkVersion "26.1.10909125"
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
|
@ -49,12 +47,9 @@ android {
|
|||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.jgeek00.adguard_home_manager"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 33
|
||||
targetSdkVersion 35
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
}
|
||||
|
@ -80,5 +75,5 @@ flutter {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.20"
|
||||
}
|
||||
|
|
|
@ -1,16 +1,3 @@
|
|||
buildscript {
|
||||
ext.kotlin_version = '1.8.20'
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.2.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
|
||||
|
|
|
@ -1,11 +1,26 @@
|
|||
include ':app'
|
||||
pluginManagement {
|
||||
def flutterSdkPath = {
|
||||
def properties = new Properties()
|
||||
file("local.properties").withInputStream { properties.load(it) }
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
return flutterSdkPath
|
||||
}
|
||||
settings.ext.flutterSdkPath = flutterSdkPath()
|
||||
|
||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||
def properties = new Properties()
|
||||
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
|
||||
|
||||
assert localPropertiesFile.exists()
|
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
||||
plugins {
|
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||
id "com.android.application" version '8.6.0' apply false
|
||||
id "org.jetbrains.kotlin.android" version "1.8.20" apply false
|
||||
}
|
||||
|
||||
include ":app"
|
||||
|
|
2
debian/debian.yaml
vendored
2
debian/debian.yaml
vendored
|
@ -5,7 +5,7 @@ flutter_app:
|
|||
|
||||
control:
|
||||
Package: AdGuardHomeManager
|
||||
Version: <REPLACE_VERSION_NUMBER_ACTIONS>
|
||||
Version: 2.20.1
|
||||
Architecture: amd64
|
||||
Essential: no
|
||||
Priority: optional
|
||||
|
|
|
@ -2,60 +2,53 @@ PODS:
|
|||
- device_info_plus (0.0.1):
|
||||
- Flutter
|
||||
- Flutter (1.0.0)
|
||||
- flutter_custom_tabs_ios (2.0.0):
|
||||
- Flutter
|
||||
- flutter_native_splash (0.0.1):
|
||||
- Flutter
|
||||
- flutter_web_browser (0.17.1):
|
||||
- Flutter
|
||||
- FMDB (2.7.5):
|
||||
- FMDB/standard (= 2.7.5)
|
||||
- FMDB/standard (2.7.5)
|
||||
- package_info_plus (0.4.5):
|
||||
- Flutter
|
||||
- Sentry/HybridSDK (8.17.2):
|
||||
- SentryPrivate (= 8.17.2)
|
||||
- Sentry/HybridSDK (8.18.0):
|
||||
- SentryPrivate (= 8.18.0)
|
||||
- sentry_flutter (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- Sentry/HybridSDK (= 8.17.2)
|
||||
- SentryPrivate (8.17.2)
|
||||
- Sentry/HybridSDK (= 8.18.0)
|
||||
- SentryPrivate (8.18.0)
|
||||
- sqflite (0.0.3):
|
||||
- Flutter
|
||||
- FMDB (>= 2.7.5)
|
||||
- sqlite3 (3.44.0):
|
||||
- sqlite3/common (= 3.44.0)
|
||||
- sqlite3/common (3.44.0)
|
||||
- sqlite3/fts5 (3.44.0):
|
||||
- FlutterMacOS
|
||||
- sqlite3 (3.45.0):
|
||||
- sqlite3/common (= 3.45.0)
|
||||
- sqlite3/common (3.45.0)
|
||||
- sqlite3/fts5 (3.45.0):
|
||||
- sqlite3/common
|
||||
- sqlite3/perf-threadsafe (3.44.0):
|
||||
- sqlite3/perf-threadsafe (3.45.0):
|
||||
- sqlite3/common
|
||||
- sqlite3/rtree (3.44.0):
|
||||
- sqlite3/rtree (3.45.0):
|
||||
- sqlite3/common
|
||||
- sqlite3_flutter_libs (0.0.1):
|
||||
- Flutter
|
||||
- sqlite3 (~> 3.44.0)
|
||||
- sqlite3 (~> 3.45.0)
|
||||
- sqlite3/fts5
|
||||
- sqlite3/perf-threadsafe
|
||||
- sqlite3/rtree
|
||||
- store_checker (0.0.1):
|
||||
- Flutter
|
||||
- url_launcher_ios (0.0.1):
|
||||
- Flutter
|
||||
|
||||
DEPENDENCIES:
|
||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_custom_tabs_ios (from `.symlinks/plugins/flutter_custom_tabs_ios/ios`)
|
||||
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
|
||||
- flutter_web_browser (from `.symlinks/plugins/flutter_web_browser/ios`)
|
||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||
- sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)
|
||||
- sqflite (from `.symlinks/plugins/sqflite/ios`)
|
||||
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
|
||||
- sqlite3_flutter_libs (from `.symlinks/plugins/sqlite3_flutter_libs/ios`)
|
||||
- store_checker (from `.symlinks/plugins/store_checker/ios`)
|
||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- FMDB
|
||||
- Sentry
|
||||
- SentryPrivate
|
||||
- sqlite3
|
||||
|
@ -65,38 +58,34 @@ EXTERNAL SOURCES:
|
|||
:path: ".symlinks/plugins/device_info_plus/ios"
|
||||
Flutter:
|
||||
:path: Flutter
|
||||
flutter_custom_tabs_ios:
|
||||
:path: ".symlinks/plugins/flutter_custom_tabs_ios/ios"
|
||||
flutter_native_splash:
|
||||
:path: ".symlinks/plugins/flutter_native_splash/ios"
|
||||
flutter_web_browser:
|
||||
:path: ".symlinks/plugins/flutter_web_browser/ios"
|
||||
package_info_plus:
|
||||
:path: ".symlinks/plugins/package_info_plus/ios"
|
||||
sentry_flutter:
|
||||
:path: ".symlinks/plugins/sentry_flutter/ios"
|
||||
sqflite:
|
||||
:path: ".symlinks/plugins/sqflite/ios"
|
||||
:path: ".symlinks/plugins/sqflite/darwin"
|
||||
sqlite3_flutter_libs:
|
||||
:path: ".symlinks/plugins/sqlite3_flutter_libs/ios"
|
||||
store_checker:
|
||||
:path: ".symlinks/plugins/store_checker/ios"
|
||||
url_launcher_ios:
|
||||
:path: ".symlinks/plugins/url_launcher_ios/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
|
||||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||
flutter_custom_tabs_ios: 62439c843b2691aae516fd50119a01eb9755fff7
|
||||
flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
|
||||
flutter_web_browser: 7bccaafbb0c5b8862afe7bcd158f15557109f61f
|
||||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
||||
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
|
||||
Sentry: 64a9f9c3637af913adcf53deced05bbe452d1410
|
||||
sentry_flutter: 57912cf425e09398bdf47f38842a1fcb9836f1be
|
||||
SentryPrivate: 024c6fed507ac39ae98e6d087034160f942920d5
|
||||
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
|
||||
sqlite3: 6e2d4a4879854d0ec86b476bf3c3e30870bac273
|
||||
sqlite3_flutter_libs: eb769059df0356dc52ddda040f09cacc9391a7cf
|
||||
Sentry: 8984a4ffb2b9bd2894d74fb36e6f5833865bc18e
|
||||
sentry_flutter: c87a0556eeb6cbf7f9f924d30e878bdedf22d364
|
||||
SentryPrivate: 2f0c9ba4c3fc993f70eab6ca95673509561e0085
|
||||
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
|
||||
sqlite3: f307b6291c4db7b5086c38d6237446b98a738581
|
||||
sqlite3_flutter_libs: aeb4d37509853dfa79d9b59386a2dac5dd079428
|
||||
store_checker: 359c5051d9ec30ff0a8fa39eb5ec9df021bb745d
|
||||
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812
|
||||
|
||||
PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011
|
||||
|
||||
|
|
|
@ -15,6 +15,24 @@ ThemeData lightTheme(ColorScheme? dynamicColorScheme) => ThemeData(
|
|||
textColor: dynamicColorScheme != null ? dynamicColorScheme.onSurfaceVariant : const Color.fromRGBO(117, 117, 117, 1),
|
||||
iconColor: dynamicColorScheme != null ? dynamicColorScheme.onSurfaceVariant : const Color.fromRGBO(117, 117, 117, 1),
|
||||
),
|
||||
cardTheme: CardTheme(
|
||||
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
||||
),
|
||||
popupMenuTheme: PopupMenuThemeData(
|
||||
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
||||
),
|
||||
navigationBarTheme: NavigationBarThemeData(
|
||||
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
||||
),
|
||||
dialogTheme: DialogTheme(
|
||||
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
||||
),
|
||||
// DISABLE PREDICTIVE BACK GESTURE
|
||||
// pageTransitionsTheme: const PageTransitionsTheme(
|
||||
// builders: {
|
||||
// TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
||||
// }
|
||||
// )
|
||||
);
|
||||
|
||||
ThemeData darkTheme(ColorScheme? dynamicColorScheme) => ThemeData(
|
||||
|
@ -33,6 +51,24 @@ ThemeData darkTheme(ColorScheme? dynamicColorScheme) => ThemeData(
|
|||
textColor: dynamicColorScheme != null ? dynamicColorScheme.onSurfaceVariant : const Color.fromRGBO(187, 187, 187, 1),
|
||||
iconColor: dynamicColorScheme != null ? dynamicColorScheme.onSurfaceVariant : const Color.fromRGBO(187, 187, 187, 1),
|
||||
),
|
||||
cardTheme: CardTheme(
|
||||
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
||||
),
|
||||
popupMenuTheme: PopupMenuThemeData(
|
||||
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
||||
),
|
||||
navigationBarTheme: NavigationBarThemeData(
|
||||
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
||||
),
|
||||
dialogTheme: DialogTheme(
|
||||
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
||||
),
|
||||
// DISABLE PREDICTIVE BACK GESTURE
|
||||
// pageTransitionsTheme: const PageTransitionsTheme(
|
||||
// builders: {
|
||||
// TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
||||
// }
|
||||
// )
|
||||
);
|
||||
|
||||
ThemeData lightThemeOldVersions(MaterialColor primaryColor) => ThemeData(
|
||||
|
@ -51,6 +87,12 @@ ThemeData lightThemeOldVersions(MaterialColor primaryColor) => ThemeData(
|
|||
iconColor: Color.fromRGBO(117, 117, 117, 1),
|
||||
),
|
||||
brightness: Brightness.light,
|
||||
// DISABLE PREDICTIVE BACK GESTURE
|
||||
// pageTransitionsTheme: const PageTransitionsTheme(
|
||||
// builders: {
|
||||
// TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
||||
// }
|
||||
// )
|
||||
);
|
||||
|
||||
ThemeData darkThemeOldVersions(MaterialColor primaryColor) => ThemeData(
|
||||
|
@ -72,4 +114,10 @@ ThemeData darkThemeOldVersions(MaterialColor primaryColor) => ThemeData(
|
|||
iconColor: Color.fromRGBO(187, 187, 187, 1),
|
||||
),
|
||||
brightness: Brightness.dark,
|
||||
// DISABLE PREDICTIVE BACK GESTURE
|
||||
// pageTransitionsTheme: const PageTransitionsTheme(
|
||||
// builders: {
|
||||
// TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
||||
// }
|
||||
// )
|
||||
);
|
|
@ -1,2 +1,3 @@
|
|||
enum LoadStatus { loading, loaded, error }
|
||||
enum HomeTopItems { queriedDomains, blockedDomains, recurrentClients, topUpstreams, avgUpstreamResponseTime }
|
||||
enum HomeTopItems { queriedDomains, blockedDomains, recurrentClients, topUpstreams, avgUpstreamResponseTime }
|
||||
enum CustomRulesSorting { topBottom, bottomTop }
|
12
lib/constants/regexps.dart
Normal file
12
lib/constants/regexps.dart
Normal file
|
@ -0,0 +1,12 @@
|
|||
class Regexps {
|
||||
static final wildcardDomain = RegExp(r'^(\*\.)?(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,10}$');
|
||||
static final domain = RegExp(r'^((?:(?:[a-zA-Z]{1})|(?:[a-zA-Z]{1}[a-zA-Z]{1})|(?:[a-zA-Z]{1}[0-9]{1})|(?:[0-9]{1}[a-zA-Z]{1})|(?:[a-zA-Z0-9][a-zA-Z0-9-_]{1,61}[a-zA-Z0-9]))\.)+([a-zA-Z]{2,10}|[a-zA-Z0-9-]{2,30}\.[a-zA-Z]{2,10})$');
|
||||
static final ipv4Address = RegExp(r'^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$');
|
||||
static final ipv6Address = RegExp(r'(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))');
|
||||
static final subroute = RegExp(r'^\/\b([A-Za-z0-9_\-~/]*)[^\/|\.|\:]$');
|
||||
static final macAddress = RegExp(r'^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$');
|
||||
static final url = RegExp(r'^(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})$');
|
||||
static final certificate = RegExp(r'(-{3,}(\bBEGIN CERTIFICATE\b))|(-{3,}-{3,}(\END CERTIFICATE\b)-{3,})', multiLine: true);
|
||||
static final privateKey = RegExp(r'(-{3,}(\bBEGIN\b).*(PRIVATE KEY\b))|(-{3,}-{3,}(\bEND\b).*(PRIVATE KEY\b)-{3,})', multiLine: true);
|
||||
static final path = RegExp(r'^(\/{0,1}(?!\/))[A-Za-z0-9\/\-_]+(\.([a-zA-Z]+))?$');
|
||||
}
|
|
@ -7,4 +7,6 @@ class Urls {
|
|||
static const String adGuardHomeReleasesTags = "https://api.github.com/repos/AdGuardTeam/AdGuardHome/releases/tags";
|
||||
static const String googleSearchUrl = "https://www.google.com/search";
|
||||
static const String connectionInstructions = "https://github.com/JGeek00/adguard-home-manager/wiki/Create-a-connection";
|
||||
static const String appDetailsWebpage = "https://apps.jgeek00.com/jlfed8mcgyz6laf";
|
||||
static const String jgeek00AppsWebpage = "https://apps.jgeek00.com";
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:store_checker/store_checker.dart';
|
||||
|
||||
import 'package:adguard_home_manager/functions/compare_versions.dart';
|
||||
import 'package:adguard_home_manager/services/external_requests.dart';
|
||||
import 'package:adguard_home_manager/models/github_release.dart';
|
||||
|
||||
Future<GitHubRelease?> checkAppUpdates({
|
||||
required String currentBuildNumber,
|
||||
required void Function(GitHubRelease?) setUpdateAvailable,
|
||||
required Source installationSource,
|
||||
required bool isBeta
|
||||
}) async {
|
||||
var result = isBeta
|
||||
? await ExternalRequests.getReleasesGitHub()
|
||||
: await ExternalRequests.getReleaseData();
|
||||
|
||||
if (result.successful == true) {
|
||||
late GitHubRelease gitHubRelease;
|
||||
if (isBeta) {
|
||||
gitHubRelease = (result.content as List<GitHubRelease>).firstWhere((r) => r.prerelease == true);
|
||||
}
|
||||
else {
|
||||
gitHubRelease = result.content as GitHubRelease;
|
||||
}
|
||||
|
||||
final update = gitHubUpdateExists(
|
||||
currentBuildNumber: currentBuildNumber,
|
||||
gitHubRelease: gitHubRelease,
|
||||
isBeta: isBeta
|
||||
);
|
||||
print(update);
|
||||
if (update == true) {
|
||||
setUpdateAvailable(gitHubRelease);
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
if (
|
||||
installationSource == Source.IS_INSTALLED_FROM_LOCAL_SOURCE ||
|
||||
installationSource == Source.IS_INSTALLED_FROM_PLAY_PACKAGE_INSTALLER ||
|
||||
installationSource == Source.UNKNOWN
|
||||
) {
|
||||
return gitHubRelease;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (Platform.isIOS) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
return gitHubRelease;
|
||||
}
|
||||
}
|
||||
else {
|
||||
setUpdateAvailable(null);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
10
lib/functions/is_ip.dart
Normal file
10
lib/functions/is_ip.dart
Normal file
|
@ -0,0 +1,10 @@
|
|||
import 'package:adguard_home_manager/constants/regexps.dart';
|
||||
|
||||
bool isIpAddress(String value) {
|
||||
if (Regexps.ipv4Address.hasMatch(value) || Regexps.ipv6Address.hasMatch(value)) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,30 +1,43 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_web_browser/flutter_web_browser.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:flutter_custom_tabs/flutter_custom_tabs.dart' as flutter_custom_tabs;
|
||||
import 'package:url_launcher/url_launcher.dart' as url_launcher;
|
||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
|
||||
void openUrl(String url) async {
|
||||
if (!(url.startsWith("http") || url.startsWith("https"))) {
|
||||
try {
|
||||
url_launcher.launchUrl(Uri.parse(url));
|
||||
} catch (e, stackTrace) {
|
||||
Sentry.captureException(e, stackTrace: stackTrace);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
FlutterWebBrowser.openWebPage(
|
||||
url: url,
|
||||
customTabsOptions: const CustomTabsOptions(
|
||||
instantAppsEnabled: true,
|
||||
showTitle: true,
|
||||
urlBarHidingEnabled: false,
|
||||
),
|
||||
safariVCOptions: const SafariViewControllerOptions(
|
||||
barCollapsingEnabled: true,
|
||||
dismissButtonStyle: SafariViewControllerDismissButtonStyle.close,
|
||||
modalPresentationCapturesStatusBarAppearance: true,
|
||||
)
|
||||
);
|
||||
try {
|
||||
await flutter_custom_tabs.launchUrl(
|
||||
Uri.parse(url),
|
||||
customTabsOptions: const flutter_custom_tabs.CustomTabsOptions(
|
||||
shareState: flutter_custom_tabs.CustomTabsShareState.browserDefault,
|
||||
urlBarHidingEnabled: true,
|
||||
showTitle: true,
|
||||
),
|
||||
safariVCOptions: const flutter_custom_tabs.SafariViewControllerOptions(
|
||||
barCollapsingEnabled: true,
|
||||
dismissButtonStyle: flutter_custom_tabs.SafariViewControllerDismissButtonStyle.close,
|
||||
),
|
||||
);
|
||||
} catch (e, stackTrace) {
|
||||
url_launcher.launchUrl(Uri.parse(url));
|
||||
Sentry.captureException(e, stackTrace: stackTrace);
|
||||
}
|
||||
}
|
||||
else {
|
||||
final uri = Uri.parse(url);
|
||||
if (await canLaunchUrl(uri)) {
|
||||
await launchUrl(uri);
|
||||
} else {
|
||||
throw 'Could not launch $url';
|
||||
try {
|
||||
url_launcher.launchUrl(Uri.parse(url));
|
||||
} catch (e, stackTrace) {
|
||||
Sentry.captureException(e, stackTrace: stackTrace);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,14 +5,16 @@ import 'package:flutter/material.dart';
|
|||
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
||||
import 'package:adguard_home_manager/config/globals.dart';
|
||||
|
||||
void showSnacbkar({
|
||||
void showSnackbar({
|
||||
required AppConfigProvider appConfigProvider,
|
||||
required String label,
|
||||
required Color color,
|
||||
Color? labelColor
|
||||
Color? labelColor,
|
||||
GlobalKey<ScaffoldMessengerState>? key,
|
||||
}) async {
|
||||
final GlobalKey<ScaffoldMessengerState> scaffoldKey = key ?? scaffoldMessengerKey;
|
||||
if (appConfigProvider.showingSnackbar == true) {
|
||||
scaffoldMessengerKey.currentState?.clearSnackBars();
|
||||
scaffoldKey.currentState?.clearSnackBars();
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
}
|
||||
appConfigProvider.setShowingSnackbar(true);
|
||||
|
@ -26,7 +28,7 @@ void showSnacbkar({
|
|||
),
|
||||
backgroundColor: color,
|
||||
);
|
||||
scaffoldMessengerKey.currentState?.showSnackBar(snackBar).closed.then(
|
||||
scaffoldKey.currentState?.showSnackBar(snackBar).closed.then(
|
||||
(value) => appConfigProvider.setShowingSnackbar(false)
|
||||
);
|
||||
}
|
|
@ -754,9 +754,57 @@
|
|||
"statisticsSettingsDescription": "Configure data collection for statistics",
|
||||
"loadingStatisticsSettings": "Loading statistics settings...",
|
||||
"statisticsSettingsLoadError": "An error occured when loading statistics settings.",
|
||||
"statisticsConfigUpdated": "Statistics settings updated successfully",
|
||||
"statisticsConfigNotUpdated": "Statistics settings couldn't be updated",
|
||||
"customTimeInHours": "Custom time (in hours)",
|
||||
"invalidTime": "Invalid time",
|
||||
"removeDomain": "Remove domain",
|
||||
"addDomain": "Add domain",
|
||||
"notLess1Hour": "Time cannot be less than 1 hour"
|
||||
"notLess1Hour": "Time cannot be less than 1 hour",
|
||||
"rateLimit": "Rate limit",
|
||||
"subnetPrefixLengthIpv4": "Subnet prefix length for IPv4",
|
||||
"subnetPrefixLengthIpv6": "Subnet prefix length for IPv6",
|
||||
"rateLimitAllowlist": "Rate limit allowlist",
|
||||
"rateLimitAllowlistDescription": "IP addresses excluded from rate limiting",
|
||||
"dnsOptions": "DNS options",
|
||||
"editor": "Editor",
|
||||
"editCustomRules": "Edit custom rules",
|
||||
"savingCustomRules": "Saving custom rules...",
|
||||
"customRulesUpdatedSuccessfully": "Custom rules updated successfully",
|
||||
"customRulesNotUpdated": "Custom rules could not be updated",
|
||||
"reorder": "Reorder",
|
||||
"showHide": "Show/hide",
|
||||
"noElementsReorderMessage": "Enable some elements on the show/hide tab to reorder them here.",
|
||||
"enablePlainDns": "Enable plain DNS",
|
||||
"enablePlainDnsDescription": "Plain DNS is enabled by default. You can disable it to force all devices to use encrypted DNS. To do this, you must enable at least one encrypted DNS protocol.",
|
||||
"date": "Date",
|
||||
"loadingChangelog": "Loading changelog...",
|
||||
"invalidIpOrUrl": "Invalid IP address or URL",
|
||||
"addPersistentClient": "Add as a persistent client",
|
||||
"blockThisClientOnly": "Block for this client only",
|
||||
"unblockThisClientOnly": "Unblock for this client only",
|
||||
"domainBlockedThisClient": "{domain} blocked for this client",
|
||||
"domainUnblockedThisClient": "{domain} unblocked for this client",
|
||||
"disallowThisClient": "Disallow this client",
|
||||
"allowThisClient": "Allow this client",
|
||||
"clientAllowedSuccessfully": "Client allowed successfully",
|
||||
"clientDisallowedSuccessfully": "Client disallowed successfully",
|
||||
"changesNotSaved": "Changes could not be saved",
|
||||
"allowingClient": "Allowing client...",
|
||||
"disallowingClient": "Disallowing client...",
|
||||
"clientIpCopied": "Client IP copied to the clipboard",
|
||||
"clientNameCopied": "Client name copied to the clipboard",
|
||||
"dnsServerAddressCopied": "DNS server address copied to the clipboard",
|
||||
"select": "Select",
|
||||
"liveLogs": "Live logs",
|
||||
"hereWillAppearRealtimeLogs": "Here there will appear the logs on realtime.",
|
||||
"applicationDetails": "Application details",
|
||||
"applicationDetailsDescription": "App repository, stores where it's available, and more",
|
||||
"myOtherApps": "My other apps",
|
||||
"myOtherAppsDescription": "Check my other apps, make a donation, contact support, and more",
|
||||
"topToBottom": "From top to bottom",
|
||||
"bottomToTop": "From bottom to top",
|
||||
"upstreamTimeout": "Upstream timeout",
|
||||
"upstreamTimeoutHelper": "Specifies the number of seconds to wait for a response from the upstream server",
|
||||
"fieldCannotBeEmpty": "This field cannot be empty"
|
||||
}
|
|
@ -403,7 +403,7 @@
|
|||
"dnsRewriteRuleDeleted": "Reescritura DNS eliminada correctamente",
|
||||
"dnsRewriteRuleNotDeleted": "La reescritura DNS no pudo ser eliminada",
|
||||
"addDnsRewrite": "Añadir reescritura DNS",
|
||||
"addingRewrite": "Añadiend reescritura...",
|
||||
"addingRewrite": "Añadiendo reescritura...",
|
||||
"dnsRewriteRuleAdded": "Regla de reescritura DNS añadida correctamente",
|
||||
"dnsRewriteRuleNotAdded": "La regla de reescritura DNS no ha podido ser añadida",
|
||||
"logsSettings": "Ajustes de registros",
|
||||
|
@ -754,9 +754,57 @@
|
|||
"statisticsSettingsDescription": "Configura la recolección de datos para estadísticas",
|
||||
"loadingStatisticsSettings": "Cargando ajustes de estadísticas...",
|
||||
"statisticsSettingsLoadError": "Ocurrió un error al cargar los ajustes de estadísticas.",
|
||||
"statisticsConfigNotUpdated": "La configuración de estadísticas no pudo ser actualizada.",
|
||||
"statisticsConfigUpdated": "Configuración de estadísticas actualizada correctamente.",
|
||||
"customTimeInHours": "Tiempo personalizado (en horas)",
|
||||
"invalidTime": "Tiempo no válido",
|
||||
"removeDomain": "Eliminar dominio",
|
||||
"addDomain": "Añadir dominio",
|
||||
"notLess1Hour": "El tiempo no puede ser inferior a 1 hora"
|
||||
"notLess1Hour": "El tiempo no puede ser inferior a 1 hora",
|
||||
"rateLimit": "Limitación de velocidad",
|
||||
"subnetPrefixLengthIpv4": "Longitud del prefijo de subred para IPv4",
|
||||
"subnetPrefixLengthIpv6": "Longitud del prefijo de subred para IPv6",
|
||||
"rateLimitAllowlist": "Lista de permitidos de limitación de velocidad",
|
||||
"rateLimitAllowlistDescription": "Direcciones IP excluidas de la limitación de velocidad",
|
||||
"dnsOptions": "Opciones de DNS",
|
||||
"editor": "Editor",
|
||||
"editCustomRules": "Editar reglas personalizadas",
|
||||
"savingCustomRules": "Guardando reglas personalizadas...",
|
||||
"customRulesUpdatedSuccessfully": "Reglas personalizadas actualizadas correctamente",
|
||||
"customRulesNotUpdated": "Las reglas personalizadas no pudieron ser actualizadas",
|
||||
"reorder": "Reordenar",
|
||||
"showHide": "Mostrar/ocultar",
|
||||
"noElementsReorderMessage": "Activa algunos elementos en la pestaña de mostrar/ocultar para reordenarlos aquí.",
|
||||
"enablePlainDns": "Activar DNS simple (sin cifrado)",
|
||||
"enablePlainDnsDescription": "El DNS simple (sin cifrado) está activado de forma predeterminada. Puedes desactivarlo para obligar a todos los dispositivos a utilizar DNS cifrado. Para ello, debes habilitar al menos un protocolo DNS cifrado.",
|
||||
"date": "Fecha",
|
||||
"loadingChangelog": "Cargando registro de cambios...",
|
||||
"invalidIpOrUrl": "Dirección IP o URL no válida",
|
||||
"addPersistentClient": "Añadir como cliente persistente",
|
||||
"blockThisClientOnly": "Bloquear sólo para este cliente",
|
||||
"unblockThisClientOnly": "Desbloquear sólo para este cliente",
|
||||
"domainBlockedThisClient": "{domain} bloqueado para este cliente",
|
||||
"domainUnblockedThisClient": "{domain} desbloqueado para este cliente",
|
||||
"disallowThisClient": "No permitir este cliente",
|
||||
"allowThisClient": "Permitir este cliente",
|
||||
"clientAllowedSuccessfully": "Cliente permitido correctamente",
|
||||
"clientDisallowedSuccessfully": "Cliente no permitido correctamente",
|
||||
"changesNotSaved": "Los cambios no han podido ser guardados",
|
||||
"allowingClient": "Permitiendo cliente...",
|
||||
"disallowingClient": "No permitiendo cliente...",
|
||||
"clientIpCopied": "Dirección IP del cliente copiada al portapapeles",
|
||||
"clientNameCopied": "Nombre del cliente copiado al portapapeles",
|
||||
"dnsServerAddressCopied": "Dirección del servidor DNS copiada al portapapeles",
|
||||
"select": "Seleccionar",
|
||||
"liveLogs": "Registros en directo",
|
||||
"hereWillAppearRealtimeLogs": "Aquí aparecerán los registros en tiempo real.",
|
||||
"applicationDetails": "Detalles de la aplicación",
|
||||
"applicationDetailsDescription": "Repositorio de la app, tiendas donde está disponible, y más",
|
||||
"myOtherApps": "Mis otras apps",
|
||||
"myOtherAppsDescription": "Comprueba mis otras apps, hacer una donación, contactar al soporte, y más",
|
||||
"topToBottom": "Desde arriba hacia abajo",
|
||||
"bottomToTop": "Desde abajo hacia arriba",
|
||||
"upstreamTimeout": "Tiempo de espera del upstream",
|
||||
"upstreamTimeoutHelper": "Especifica el número de segundos que se debe esperar para recibir una respuesta del servidor upstream",
|
||||
"fieldCannotBeEmpty": "El campo no puede estar vacío"
|
||||
}
|
|
@ -11,7 +11,7 @@
|
|||
"port": "Bağlantı noktası",
|
||||
"username": "Kullanıcı adı",
|
||||
"password": "Şifre",
|
||||
"defaultServer": "Varsayılan sunucu",
|
||||
"defaultServer": "Varsayılan sunucu olarak ayarla",
|
||||
"general": "Genel",
|
||||
"connection": "Bağlantı",
|
||||
"authentication": "Kimlik doğrulama",
|
||||
|
@ -40,18 +40,18 @@
|
|||
"removeWarning": "Bu AdGuard Home sunucusuyla olan bağlantıyı kaldırmak istediğinizden emin misiniz?",
|
||||
"cancel": "İptal",
|
||||
"defaultConnection": "Varsayılan bağlantı",
|
||||
"setDefault": "Varsayılan ayarla",
|
||||
"setDefault": "Varsayılan sunucu yap",
|
||||
"edit": "Düzenle",
|
||||
"delete": "Sil",
|
||||
"save": "Kaydet",
|
||||
"serverStatus": "Sunucu durumu",
|
||||
"connectionNotUpdated": "Bağlantı Güncellenmedi",
|
||||
"ruleFilteringWidget": "Kural filtreleme",
|
||||
"safeBrowsingWidget": "Güvenli gezinti",
|
||||
"safeBrowsingWidget": "Güvenli gezinme",
|
||||
"parentalFilteringWidget": "Ebeveyn filtreleme",
|
||||
"safeSearchWidget": "Güvenli arama",
|
||||
"ruleFiltering": "Kural filtreleme",
|
||||
"safeBrowsing": "Güvenli gezinti",
|
||||
"safeBrowsing": "Güvenli gezinme",
|
||||
"parentalFiltering": "Ebeveyn filtreleme",
|
||||
"safeSearch": "Güvenli arama",
|
||||
"serverStatusNotRefreshed": "Sunucu durumu yenilenemedi",
|
||||
|
@ -63,9 +63,9 @@
|
|||
"topBlockedDomains": "En çok engellenenler",
|
||||
"appSettings": "Uygulama ayarları",
|
||||
"theme": "Tema",
|
||||
"light": "Aydınlık",
|
||||
"dark": "Karanlık",
|
||||
"systemDefined": "Sistemle uyumlu hale getir",
|
||||
"light": "Açık",
|
||||
"dark": "Koyu",
|
||||
"systemDefined": "Otomatik (Cihazınızın renk düzenine göre)",
|
||||
"close": "Kapat",
|
||||
"connectedTo": "Bağlandı:",
|
||||
"selectedServer": "Seçili sunucu:",
|
||||
|
@ -75,13 +75,13 @@
|
|||
"userNotEmpty": "Kullanıcı adı boş bırakılamaz",
|
||||
"passwordNotEmpty": "Şifre boş bırakılamaz",
|
||||
"examplePath": "Örnek: /adguard",
|
||||
"helperPath": "Ters proxy kullanıyorsanız",
|
||||
"helperPath": "Eğer ters proxy kullanıyorsanız",
|
||||
"aboutApp": "Uygulama hakkında",
|
||||
"appVersion": "Uygulama sürümü",
|
||||
"createdBy": "Geliştirici",
|
||||
"clients": "İstemciler",
|
||||
"allowed": "İzin verildi",
|
||||
"blocked": "Engellendi",
|
||||
"allowed": "İzin verilen",
|
||||
"blocked": "Engellenen",
|
||||
"noClientsList": "Bu listede hiç istemci yok",
|
||||
"activeClients": "Etkin",
|
||||
"removeClient": "İstemciyi kaldır",
|
||||
|
@ -102,8 +102,8 @@
|
|||
"copyLogsClipboard": "Günlükleri panoya kopyala",
|
||||
"logsCopiedClipboard": "Günlükler panoya kopyalandı",
|
||||
"advancedSettings": "Gelişmiş ayarlar",
|
||||
"dontCheckCertificate": "SSL sertifikasını asla kontrol etme",
|
||||
"dontCheckCertificateDescription": "Sunucunun SSL sertifikası doğrulamasını geçersiz kılar",
|
||||
"dontCheckCertificate": "SSL sertifikasını kontrol etme",
|
||||
"dontCheckCertificateDescription": "Sunucunun SSL sertifikası doğrulamasını geçersiz kılar.",
|
||||
"advancedSetupDescription": "Gelişmiş seçenekleri yönet",
|
||||
"settingsUpdatedSuccessfully": "Ayarlar başarıyla güncellendi.",
|
||||
"cannotUpdateSettings": "Ayarlar güncellenemiyor.",
|
||||
|
@ -114,8 +114,8 @@
|
|||
"processedRow": "İşlendi (Liste yok)",
|
||||
"blockedBlacklist": "Engellendi\nKara Liste",
|
||||
"blockedBlacklistRow": "Engellendi (Kara liste)",
|
||||
"blockedSafeBrowsing": "Engellendi\nGüvenli gezinti",
|
||||
"blockedSafeBrowsingRow": "Engellendi (Güvenli gezinti)",
|
||||
"blockedSafeBrowsing": "Engellendi\nGüvenli gezinme",
|
||||
"blockedSafeBrowsingRow": "Engellendi (Güvenli gezinme)",
|
||||
"blockedParental": "Engellendi\nEbeveyn filtreleme",
|
||||
"blockedParentalRow": "Engellendi (Ebeveyn filtreleme)",
|
||||
"blockedInvalid": "Engellendi\nGeçersiz",
|
||||
|
@ -131,11 +131,11 @@
|
|||
"rewrite": "Yeniden Yaz",
|
||||
"status": "Durum",
|
||||
"result": "Sonuç",
|
||||
"time": "Zaman",
|
||||
"time": "Saat",
|
||||
"blocklist": "Engelleme Listesi",
|
||||
"request": "İstek",
|
||||
"domain": "Alan adı",
|
||||
"type": "Tip",
|
||||
"type": "Tür",
|
||||
"clas": "Sınıf",
|
||||
"response": "Yanıt",
|
||||
"dnsServer": "DNS sunucusu",
|
||||
|
@ -181,7 +181,7 @@
|
|||
"visitGooglePlay": "Google Play sayfasını ziyaret et",
|
||||
"gitHub": "Kaynak kodlarına GitHub'dan ulaşabilirsiniz",
|
||||
"blockClient": "İstemciyi engelle",
|
||||
"selectTags": "Etiketleri seçin",
|
||||
"selectTags": "Etiketleri seç",
|
||||
"noTagsSelected": "Seçili etiket yok",
|
||||
"tags": "Etiketler",
|
||||
"identifiers": "Tanımlayıcılar",
|
||||
|
@ -190,21 +190,21 @@
|
|||
"noIdentifiers": "Tanımlayıcı eklenmedi",
|
||||
"useGlobalSettings": "Küresel ayarları kullan",
|
||||
"enableFiltering": "Filtrelemeyi etkinleştir",
|
||||
"enableSafeBrowsing": "Güvenli gezintiyi etkinleştir",
|
||||
"enableSafeBrowsing": "Güvenli gezinmeyi etkinleştir",
|
||||
"enableParentalControl": "Ebeveyn kontrolünü etkinleştir",
|
||||
"enableSafeSearch": "Güvenli aramayı aktif et",
|
||||
"enableSafeSearch": "Güvenli aramayı etkinleştir",
|
||||
"blockedServices": "Engellenen hizmetler",
|
||||
"selectBlockedServices": "Engellenen hizmetleri seç",
|
||||
"noBlockedServicesSelected": "Engellenen hizmetler seçilmedi",
|
||||
"services": "Hizmetler",
|
||||
"servicesBlocked": "Hizmetler engellendi",
|
||||
"tagsSelected": "Seçilen etiketler",
|
||||
"upstreamServers": "Üst kaynak sunucuları",
|
||||
"tagsSelected": "Etiket seçildi",
|
||||
"upstreamServers": "Üst sunucular",
|
||||
"serverAddress": "Sunucu adresi",
|
||||
"noUpstreamServers": "Üst kaynak sunucusu yok.",
|
||||
"willBeUsedGeneralServers": "Genel üst kaynak sunucuları kullanılacak.",
|
||||
"noUpstreamServers": "Üst sunucu yok.",
|
||||
"willBeUsedGeneralServers": "Genel üst sunucular kullanılacak.",
|
||||
"added": "Eklenenler",
|
||||
"clientUpdatedSuccessfully": "İstemci başarıyla güncellendi",
|
||||
"clientUpdatedSuccessfully": "İstemci ayarları başarıyla güncellendi",
|
||||
"clientNotUpdated": "İstemci güncellenemedi",
|
||||
"clientDeletedSuccessfully": "İstemci başarıyla kaldırıldı",
|
||||
"clientNotDeleted": "İstemci silinemedi",
|
||||
|
@ -215,7 +215,7 @@
|
|||
"blacklists": "Kara listeler",
|
||||
"rules": "Kurallar",
|
||||
"customRules": "Özel kurallar",
|
||||
"enabledRules": "Etkin kurallar",
|
||||
"enabledRules": "Etkin kural",
|
||||
"enabled": "Etkin",
|
||||
"disabled": "Devre dışı",
|
||||
"rule": "Kural",
|
||||
|
@ -234,7 +234,7 @@
|
|||
"addWhitelist": "Beyaz liste ekle",
|
||||
"addBlacklist": "Kara liste ekle",
|
||||
"urlNotValid": "Bağlantı adresi geçerli değil",
|
||||
"urlAbsolutePath": "Bağlantı adresi veya kesin dosya yolu",
|
||||
"urlAbsolutePath": "Bağlantı adresi veya dosya yolu",
|
||||
"addingList": "Liste ekleniyor...",
|
||||
"listAdded": "Liste başarıyla eklendi. Eklenen öğeler:",
|
||||
"listAlreadyAdded": "Liste zaten eklenmiş",
|
||||
|
@ -267,13 +267,13 @@
|
|||
"seeDnsAddresses": "DNS adreslerine göz at",
|
||||
"dnsPort": "DNS bağlantı noktası",
|
||||
"httpPort": "HTTP bağlantı noktası",
|
||||
"protectionEnabled": "Koruma etkin mi?",
|
||||
"dhcpAvailable": "DHCP mevcut mu?",
|
||||
"serverRunning": "Sunucu çalışıyor mu?",
|
||||
"protectionEnabled": "Koruma durumu",
|
||||
"dhcpAvailable": "DHCP durumu",
|
||||
"serverRunning": "Sunucu durumu",
|
||||
"serverVersion": "Sunucu sürümü",
|
||||
"serverLanguage": "Sunucu dili",
|
||||
"yes": "Evet",
|
||||
"no": "Hayır",
|
||||
"yes": "Etkin",
|
||||
"no": "Mevcut değil",
|
||||
"allowedClients": "İzin verilen istemciler",
|
||||
"disallowedClients": "İzin verilmeyen istemciler",
|
||||
"disallowedDomains": "İzin verilmeyen alan adları",
|
||||
|
@ -288,7 +288,7 @@
|
|||
"addClientFieldDescription": "CIDR'ler, IP adresi veya ClientID",
|
||||
"clientIdentifier": "İstemci tanımlayıcısı",
|
||||
"allowClient": "İstemciye izin ver",
|
||||
"disallowClient": "İstemciye izin verme",
|
||||
"disallowClient": "İstemciyi engelle",
|
||||
"noDisallowedDomains": "İzin verilmeyen alan adı yok",
|
||||
"domainNotAdded": "Alan adı eklenemedi",
|
||||
"statusSelected": "Durum seçildi.",
|
||||
|
@ -305,7 +305,7 @@
|
|||
"block": "Engelle",
|
||||
"unblock": "Engeli kaldır",
|
||||
"custom": "Özel",
|
||||
"addImportant": "Ekle ($important)",
|
||||
"addImportant": "Başına $important ekle",
|
||||
"howCreateRules": "Özel kurallar nasıl oluşturulur?",
|
||||
"examples": "Örnekler",
|
||||
"example1": "example.org ve tüm alt alan adlarına erişimi engeller.",
|
||||
|
@ -342,7 +342,7 @@
|
|||
"dhcpSettingsNotLoaded": "DHCP ayarları yüklenemedi",
|
||||
"loadingDhcp": "DHCP ayarları yükleniyor...",
|
||||
"enableDhcpServer": "DHCP sunucusunu etkinleştir",
|
||||
"selectInterface": "Arayüz seçin",
|
||||
"selectInterface": "Arayüz seç",
|
||||
"hardwareAddress": "Donanım adresi",
|
||||
"gatewayIp": "Ağ Geçidi IP'si",
|
||||
"ipv4addresses": "IPv4 adresleri",
|
||||
|
@ -368,37 +368,37 @@
|
|||
"restoringConfig": "Yapılandırma geri yükleniyor...",
|
||||
"configRestored": "Yapılandırma başarıyla sıfırlandı",
|
||||
"configNotRestored": "Yapılandırma sıfırlanamadı",
|
||||
"dhcpStatic": "DHCP statik kiralamaları",
|
||||
"noDhcpStaticLeases": "DHCP statik kiralamaları bulunamadı",
|
||||
"dhcpStatic": "DHCP statik kiraları",
|
||||
"noDhcpStaticLeases": "DHCP statik kirası bulunamadı",
|
||||
"deleting": "Siliniyor...",
|
||||
"staticLeaseDeleted": "DHCP statik kiralama başarıyla silindi",
|
||||
"staticLeaseNotDeleted": "DHCP statik kiralaması silinemedi",
|
||||
"deleteStaticLease": "Statik kiralamayı sil",
|
||||
"staticLeaseDeleted": "DHCP statik kirası başarıyla silindi",
|
||||
"staticLeaseNotDeleted": "DHCP statik kirası silinemedi",
|
||||
"deleteStaticLease": "Statik kirasını sil",
|
||||
"deleteStaticLeaseDescription": "DHCP statik kirası silinecek. Bu işlem geri alınamaz.",
|
||||
"addStaticLease": "Statik kiralama ekleyin",
|
||||
"addStaticLease": "Statik kira ekleyin",
|
||||
"macAddress": "MAC adresi",
|
||||
"macAddressNotValid": "MAC adresi geçersiz",
|
||||
"hostName": "Ana bilgisayar adı",
|
||||
"hostNameError": "Ana bilgisayar adı boş olamaz",
|
||||
"creating": "Oluşturuluyor...",
|
||||
"staticLeaseCreated": "DHCP statik kiralaması başarıyla oluşturuldu",
|
||||
"staticLeaseNotCreated": "DHCP statik kiralaması oluşturulamadı",
|
||||
"staticLeaseExists": "DHCP statik kiralaması zaten mevcut",
|
||||
"staticLeaseCreated": "DHCP statik kirası başarıyla oluşturuldu",
|
||||
"staticLeaseNotCreated": "DHCP statik kirası oluşturulamadı",
|
||||
"staticLeaseExists": "DHCP statik kirası zaten mevcut",
|
||||
"serverNotConfigured": "Sunucu yapılandırılmamış",
|
||||
"restoreLeases": "Kiralamaları sıfırla",
|
||||
"restoreLeasesMessage": "Devam etmek istediğinizden emin misiniz? Bu, mevcut tüm kiralamaları sıfırlayacaktır. Bu işlem geri alınamaz.",
|
||||
"restoringLeases": "Kiralamalar sıfırlanıyor...",
|
||||
"leasesRestored": "Kiralamalar başarıyla sıfırlandı",
|
||||
"restoreLeases": "Kiraları sıfırla",
|
||||
"restoreLeasesMessage": "Devam etmek istediğinizden emin misiniz? Bu, mevcut tüm kiraları sıfırlayacaktır. Bu işlem geri alınamaz.",
|
||||
"restoringLeases": "Kiralar sıfırlanıyor...",
|
||||
"leasesRestored": "Kiralar başarıyla sıfırlandı",
|
||||
"leasesNotRestored": "Kiralar sıfırlanamadı",
|
||||
"dhcpLeases": "DHCP kiralamaları",
|
||||
"noLeases": "Kullanılabilir DHCP kiralaması yok",
|
||||
"dhcpLeases": "DHCP kiraları",
|
||||
"noLeases": "Kullanılabilir DHCP kiraları yok",
|
||||
"dnsRewrites": "DNS yeniden yazımları",
|
||||
"dnsRewritesDescription": "Özel DNS kurallarını yapılandır",
|
||||
"loadingRewriteRules": "Yeniden yazım kuralları yükleniyor...",
|
||||
"rewriteRulesNotLoaded": "DNS yeniden yazım kuralları yüklenemedi.",
|
||||
"noRewriteRules": "DNS yeniden yazım kuralları yok",
|
||||
"answer": "Yanıt",
|
||||
"deleteDnsRewrite": "DNS yeniden yazımı sil",
|
||||
"deleteDnsRewrite": "DNS yeniden yazımını sil",
|
||||
"deleteDnsRewriteMessage": "Bu DNS yeniden yazımını silmek istediğinizden emin misiniz? Bu işlem geri alınamaz.",
|
||||
"dnsRewriteRuleDeleted": "DNS yeniden yazım kuralı başarıyla silindi",
|
||||
"dnsRewriteRuleNotDeleted": "DNS yeniden yazım kuralı silinemedi",
|
||||
|
@ -409,7 +409,7 @@
|
|||
"logsSettings": "Günlük ayarları",
|
||||
"enableLog": "Günlüğü etkinleştir",
|
||||
"clearLogs": "Günlükleri temizle",
|
||||
"anonymizeClientIp": "İstemci IP'sini anonimleştir",
|
||||
"anonymizeClientIp": "İstemci IP'sini gizle",
|
||||
"hours6": "6 saat",
|
||||
"days30": "30 gün",
|
||||
"days90": "90 gün",
|
||||
|
@ -418,7 +418,7 @@
|
|||
"logSettingsNotLoaded": "Günlük ayarları yüklenemedi.",
|
||||
"updatingSettings": "Ayarlar güncelleniyor...",
|
||||
"logsConfigUpdated": "Günlük ayarları başarıyla güncellendi",
|
||||
"logsConfigNotUpdated": "Günlük ayarları başarıyla güncellendi",
|
||||
"logsConfigNotUpdated": "Günlük ayarları güncellenemedi",
|
||||
"deletingLogs": "Günlükler temizleniyor...",
|
||||
"logsCleared": "Günlükler başarıyla temizlendi",
|
||||
"logsNotCleared": "Günlükler temizlenemedi",
|
||||
|
@ -427,17 +427,17 @@
|
|||
"noItems": "Burada gösterilecek öğe yok",
|
||||
"dnsSettings": "DNS ayarları",
|
||||
"dnsSettingsDescription": "DNS sunucuları ile bağlantıyı yapılandır",
|
||||
"upstreamDns": "Üst kaynak DNS sunucuları",
|
||||
"upstreamDns": "Üst DNS sunucuları",
|
||||
"bootstrapDns": "Önyükleme DNS sunucuları",
|
||||
"noUpstreamDns": "Üst kaynak DNS sunucuları eklenmedi.",
|
||||
"noUpstreamDns": "Üst DNS sunucuları eklenmedi.",
|
||||
"dnsMode": "DNS modu",
|
||||
"noDnsMode": "DNS modu seçili değil",
|
||||
"loadBalancing": "Yük dengeleme",
|
||||
"parallelRequests": "Paralel istekler",
|
||||
"fastestIpAddress": "En hızlı IP adresi",
|
||||
"loadBalancingDescription": "Her seferinde bir üst kaynak sunucusuna sorgu yap. AdGuard Home, sunucuyu seçmek için ağırlıklı rastgele algoritmasını kullanır, böylece en hızlı sunucu daha sık kullanılır.",
|
||||
"parallelRequestsDescription": "Tüm üst kaynak sunucularını aynı anda sorgulayarak çözümlemeyi hızlandırmak için paralel sorgular kullanın.",
|
||||
"fastestIpAddressDescription": "Tüm DNS sunucularına sorgu yapın ve tüm yanıtlar arasında en hızlı IP adresini döndürün. Bu, AdGuard Home'un tüm DNS sunucularından yanıtları beklemesi gerektiği için DNS sorgularını yavaşlatır, ancak genel bağlantıyı iyileştirir.",
|
||||
"loadBalancingDescription": "Her seferinde bir üst sunucuya sorgu yapar. AdGuard Home, sunucuyu seçmek için ağırlıklı rastgele algoritmasını kullanır, böylece en hızlı sunucu daha sık kullanılır.",
|
||||
"parallelRequestsDescription": "Tüm üst sunucuları aynı anda sorgulayarak çözümlemeyi hızlandırmak için paralel sorgular kullanılır.",
|
||||
"fastestIpAddressDescription": "Tüm DNS sunucularına sorgu yapın ve tüm yanıtlar arasında en hızlı IP adresini döndürür. Bu, AdGuard Home'un tüm DNS sunucularından yanıtları beklemesi gerektiği için DNS sorgularını yavaşlatır, ancak genel bağlantıyı iyileştirir.",
|
||||
"noBootstrapDns": "Önyükleme DNS sunucuları eklenmedi.",
|
||||
"bootstrapDnsServersInfo": "Önyükleme DNS sunucuları, üst kaynaklarda belirttiğiniz DoH/DoT çözümleyicilerinin IP adreslerini çözmek için kullanılır.",
|
||||
"privateReverseDnsServers": "Özel ters DNS sunucuları",
|
||||
|
@ -446,36 +446,36 @@
|
|||
"addItem": "Öğe ekle",
|
||||
"noServerAddressesAdded": "Sunucu adresleri eklenmedi.",
|
||||
"usePrivateReverseDnsResolvers": "Özel ters DNS çözümleyicilerini kullan",
|
||||
"usePrivateReverseDnsResolversDescription": "Bu üst kaynak sunucularını kullanarak yerel olarak sunulan adresler için ters DNS sorguları gerçekleştirin. Devre dışı bırakılırsa, AdGuard Home, DHCP, /etc/hosts vb. kaynaklardan bilinen istemciler dışında tüm PTR isteklerine NXDOMAIN yanıtı verir.",
|
||||
"usePrivateReverseDnsResolversDescription": "Bu üst sunucuları kullanarak yerel olarak sunulan adresler için ters DNS sorguları gerçekleştirin. Devre dışı bırakılırsa, AdGuard Home, DHCP, /etc/hosts vb. kaynaklardan bilinen istemciler dışında tüm PTR isteklerine NXDOMAIN yanıtı verir.",
|
||||
"enableReverseResolving": "İstemcilerin IP adreslerinin ters çözümlemesini etkinleştir",
|
||||
"enableReverseResolvingDescription": "İstemcilerin IP adreslerini karşılık gelen çözücülere PTR sorguları göndererek IP adreslerini tersine çözümleyerek (yerel istemciler için özel DNS sunucuları, genel IP adresine sahip istemciler için üst kaynak sunucuları) istemcilerin ana bilgisayar adlarını tersine çöz.",
|
||||
"enableReverseResolvingDescription": "Karşılık gelen çözümleyicilere (yerel istemciler için özel DNS sunucuları, genel IP adresleri olan istemciler için üst sunuculara) PTR sorguları göndererek istemcilerin IP adreslerini ana makine adlarının tersine çözer.",
|
||||
"dnsServerSettings": "AdGuard Home DNS sunucusu ayarları",
|
||||
"limitRequestsSecond": "Saniye başına sınırlama isteği",
|
||||
"limitRequestsSecond": "Sıklık limiti",
|
||||
"valueNotNumber": "Değer bir sayı değil",
|
||||
"enableEdns": "EDNS istemci alt ağını etkinleştir",
|
||||
"enableEdnsDescription": "Kaynak yönü isteklerine EDNS İstemci Alt Ağı Seçeneği (ECS) ekleyin ve istemciler tarafından gönderilen değerleri sorgu günlüğüne kaydedin.",
|
||||
"enableEdnsDescription": "Kaynak yönü isteklerine EDNS İstemci Alt Ağı Seçeneği (ECS) ekler ve istemciler tarafından gönderilen değerleri sorgu günlüğüne kaydeder.",
|
||||
"enableDnssec": "DNSSEC'i etkinleştir",
|
||||
"enableDnssecDescription": "Giden DNS sorguları için DNSSEC özelliğini etkinleştir ve sonucu kontrol edin.(DNSSEC etkinleştirilmiş bir çözümleyici gerekli)",
|
||||
"enableDnssecDescription": "Giden DNS sorguları için DNSSEC özelliğini etkinleştirir ve sonucu kontrol eder. (DNSSEC etkinleştirilmiş bir çözümleyici gerekli)",
|
||||
"disableResolvingIpv6": "IPv6 adreslerinin çözümlenmesini devre dışı bırak",
|
||||
"disableResolvingIpv6Description": "IPv6 adresleri için tüm DNS sorgularını bırakın (AAAA yazın) ve HTTPS yanıtlarından IPv6 ipuçlarını kaldırın.",
|
||||
"disableResolvingIpv6Description": "IPv6 adresleri için tüm DNS sorgularını bırakır (AAAA yazar) ve HTTPS yanıtlarından IPv6 ipuçlarını kaldırır.",
|
||||
"blockingMode": "Engelleme modu",
|
||||
"defaultMode": "Varsayılan",
|
||||
"defaultDescription": "Reklam engelleme tarzı bir kural tarafından engellendiğinde sıfır IP adresi ile yanıt verin. (A için 0.0.0.0; :: AAAA için) /etc/hosts tarzı bir kural tarafından engellendiğinde kuralda belirtilen IP adresi ile yanıt verin.",
|
||||
"refusedDescription": "REFUSED kodu ile yanıt verin.",
|
||||
"nxdomainDescription": "NXDOMAIN kodu ile yanıt verin.",
|
||||
"defaultDescription": "Reklam engelleme tarzı bir kural tarafından engellendiğinde sıfır IP adresi ile yanıt verir. (A için 0.0.0.0; :: AAAA için) /etc/hosts tarzı bir kural tarafından engellendiğinde kuralda belirtilen IP adresi ile yanıt verir.",
|
||||
"refusedDescription": "REFUSED kodu ile yanıt verir.",
|
||||
"nxdomainDescription": "NXDOMAIN kodu ile yanıt verir.",
|
||||
"nullIp": "Boş IP",
|
||||
"nullIpDescription": "Sıfır IP adresi ile yanıt verin. (A için 0.0.0.0; :: AAAA için)",
|
||||
"nullIpDescription": "Sıfır IP adresi ile yanıt verir. (A için 0.0.0.0; :: AAAA için)",
|
||||
"customIp": "Özel IP",
|
||||
"customIpDescription": "Manuel olarak ayarlanmış bir IP adresi ile yanıt verin.",
|
||||
"customIpDescription": "Manuel olarak ayarlanmış bir IP adresi ile yanıt verir.",
|
||||
"dnsCacheConfig": "DNS önbellek yapılandırması",
|
||||
"cacheSize": "Önbellek boyutu",
|
||||
"inBytes": "Bayt olarak",
|
||||
"inBytes": "Alınacak önbelleğin boyutunu ayarla (Bayt olarak)",
|
||||
"overrideMinimumTtl": "Minimum kullanım süresini geçersiz kıl",
|
||||
"overrideMinimumTtlDescription": "DNS yanıtlarını önbelleğe alırken üst sunucudan alınan minimum kullanım süresi değerini ayarlayın (saniye olarak)",
|
||||
"overrideMinimumTtlDescription": "DNS yanıtlarını önbelleğe alırken üst sunucudan alınan minimum kullanım süresi değerini (TTL) saniye olarak ayarlayın.",
|
||||
"overrideMaximumTtl": "Maksimum kullanım süresini geçersiz kıl",
|
||||
"overrideMaximumTtlDescription": "DNS önbelleğindeki girişler için maksimum kullanım süresi değerini ayarlayın (saniye olarak)",
|
||||
"overrideMaximumTtlDescription": "DNS yanıtlarını önbelleğe alırken üst sunucudan alınan maksimum kullanım süresi değerini (TTL) saniye olarak ayarlayın.",
|
||||
"optimisticCaching": "İyimser önbelleğe alma",
|
||||
"optimisticCachingDescription": "Girişlerin süresi dolmuş olsa bile Adguard Home'un önbellekten yanıt vermesini sağlayın ve aynı zamanda bunları yenilemeye çalışın.",
|
||||
"optimisticCachingDescription": "Girişlerin süresi dolmuş olsa bile Adguard Home'un önbellekten yanıt vermesini sağlar ve aynı zamanda bunları yenilemeye çalışır.",
|
||||
"loadingDnsConfig": "DNS yapılandırması yükleniyor...",
|
||||
"dnsConfigNotLoaded": "DNS yapılandırması yüklenemedi.",
|
||||
"blockingIpv4": "IPv4 engelleniyor",
|
||||
|
@ -487,14 +487,14 @@
|
|||
"dnsConfigNotSaved": "DNS sunucusu yapılandırması kaydedilemedi",
|
||||
"savingConfig": "Yapılandırma kaydediliyor...",
|
||||
"someValueNotValid": "Bazı değerler geçerli değil",
|
||||
"upstreamDnsDescription": "Üst kaynak sunucularını ve DNS modunu yapılandır",
|
||||
"upstreamDnsDescription": "Üst sunucuları ve DNS modunu yapılandır",
|
||||
"bootstrapDnsDescription": "Önyükleme DNS sunucularını yapılandır",
|
||||
"privateReverseDnsDescription": "Özel DNS çözümleyicileri yapılandır ve özel ters DNS çözümlemeyi etkinleştir",
|
||||
"dnsServerSettingsDescription": "Hız limiti, engelleme modu ve daha fazlasını yapılandır",
|
||||
"dnsCacheConfigDescription": "Sunucunun DNS önbelleğini nasıl yöneteceğini yapılandır",
|
||||
"comment": "Yorum",
|
||||
"address": "Adres",
|
||||
"commentsDescription": "Yorumlar her zaman # işareti ile başlar. Onu eklemenize gerek yok, otomatik olarak eklenir.",
|
||||
"commentsDescription": "Yorumlar her zaman # işareti ile başlar. Eklemenize gerek yok, otomatik olarak eklenecektir.",
|
||||
"encryptionSettings": "Şifreleme ayarları",
|
||||
"encryptionSettingsDescription": "Şifreleme (HTTPS/QUIC/TLS) desteği",
|
||||
"loadingEncryptionSettings": "Şifreleme ayarları yükleniyor...",
|
||||
|
@ -513,13 +513,13 @@
|
|||
"certificatesDescription": "Şifreleme kullanmak için, alan adınız için geçerli bir SSL sertifikası zinciri sağlamanız gereklidir. letsencrypt.org'dan ücretsiz bir sertifika alabilir veya güvenilir sertifika yetkililerinden satın alabilirsiniz.",
|
||||
"certificateFilePath": "Sertifika dosyası belirle",
|
||||
"pasteCertificateContent": "Sertifika içeriğini yapıştır",
|
||||
"certificatePath": "Sertifika dosya yolu",
|
||||
"certificatePath": "Sertifikanın dosya yolu",
|
||||
"certificateContent": "Sertifika içeriği",
|
||||
"privateKey": "Özel anahtarlar",
|
||||
"privateKeyFile": "Özel anahtar dosyası belirle",
|
||||
"pastePrivateKey": "Özel anahtar içeriğini yapıştır",
|
||||
"usePreviousKey": "Önceden kaydedilmiş anahtarı kullan",
|
||||
"privateKeyPath": "Özel anahtar dosya yolu",
|
||||
"usePreviousKey": "Önceden kaydedilmiş olan anahtarı kullan",
|
||||
"privateKeyPath": "Özel anahtarın dosya yolu",
|
||||
"invalidCertificate": "Geçersiz sertifika",
|
||||
"invalidPrivateKey": "Geçersiz özel anahtar",
|
||||
"validatingData": "Veri doğrulama",
|
||||
|
@ -560,8 +560,8 @@
|
|||
"validPrivateKey": "Geçerli özel anahtar",
|
||||
"expirationDate": "Son kullanma tarihi",
|
||||
"keysNotMatch": "Geçersiz bir sertifika veya anahtar: tls: özel anahtar genel anahtarla eşleşmiyor.",
|
||||
"timeLogs": "Günlüklerdeki işlem süresi",
|
||||
"timeLogsDescription": "Günlükler listesinde zaman yerine işlem süresini göster",
|
||||
"timeLogs": "Günlüklerde işlem süresini göster",
|
||||
"timeLogsDescription": "Günlükler listesinde zaman yerine işlem süresini gösterir.",
|
||||
"hostNames": "Ana bilgisayar adları",
|
||||
"keyType": "Anahtar türü",
|
||||
"updateAvailable": "Güncelleme mevcut",
|
||||
|
@ -591,7 +591,7 @@
|
|||
"updates": "Güncellemeler",
|
||||
"updatesDescription": "AdGuard Home sunucusunu güncelle",
|
||||
"updateNow": "Şimdi güncelle",
|
||||
"currentVersion": "Mevcut sürüm",
|
||||
"currentVersion": "Yüklü sürüm",
|
||||
"requestStartUpdateFailed": "Güncellemeyi başlatma isteği başarısız oldu",
|
||||
"requestStartUpdateSuccessful": "Güncellemeyi başlatma isteği başarılı",
|
||||
"serverUpdated": "Sunucu güncellendi",
|
||||
|
@ -618,15 +618,15 @@
|
|||
"copiedClipboard": "Panoya kopyalandı",
|
||||
"seeDetails": "Detayları gör",
|
||||
"listNotAvailable": "Liste mevcut değil",
|
||||
"copyListUrl": "Liste bağlantısını kopyala",
|
||||
"listUrlCopied": "Panoya kopyalanan bağlantı adresini listeleyin",
|
||||
"copyListUrl": "Bağlantıyı kopyala",
|
||||
"listUrlCopied": "Liste bağlantısı panoya kopyalandı",
|
||||
"unsupportedVersion": "Desteklenmeyen sürüm",
|
||||
"unsupprtedVersionMessage": "Sunucu sürümünüz {version} için destek garantisi verilmiyor. Bu uygulamanın bu sunucu sürümüyle çalışmasında bazı sorunlar olabilir. AdGuard Home Yöneticisi, AdGuard Home sunucunun kararlı sürümleriyle çalışacak şekilde tasarlanmıştır. Alfa ve beta sürümleriyle çalışabilir, ancak uyumluluk garanti edilmez ve uygulama bu sürümlerle çalışırken bazı sorunlar yaşayabilir.",
|
||||
"iUnderstand": "Anladım",
|
||||
"appUpdates": "Uygulama güncellemeleri",
|
||||
"usingLatestVersion": "En son sürümü kullanıyorsunuz :)",
|
||||
"ipLogs": "Günlüklerdeki IP",
|
||||
"ipLogsDescription": "Günlükler listesinde istemci adı yerine IP adresini göster",
|
||||
"usingLatestVersion": "En son sürümü kullanıyorsunuz",
|
||||
"ipLogs": "Günlüklerde IP adresini göster",
|
||||
"ipLogsDescription": "Günlükler listesinde istemci adı yerine IP adresini gösterir.",
|
||||
"application": "Uygulama",
|
||||
"combinedChart": "Birleştirilmiş grafik",
|
||||
"combinedChartDescription": "Tüm grafikleri bir araya getirir.",
|
||||
|
@ -655,11 +655,11 @@
|
|||
"queries": "Sorgular",
|
||||
"adultSites": "Yetişkin içerikler",
|
||||
"quickFilters": "Hızlı filtreler",
|
||||
"searchDomainInternet": "İnternette alan adı ara",
|
||||
"searchDomainInternet": "Alan adını arat",
|
||||
"hideServerAddress": "Sunucu adresini gizle",
|
||||
"hideServerAddressDescription": "Ana ekranda sunucu adresini gizler.",
|
||||
"topItemsOrder": "Öne çıkan öğeler sıralaması",
|
||||
"topItemsOrderDescription": "Ana ekrandaki öne çıkan öğe listelerini sırala",
|
||||
"topItemsOrderDescription": "Ana ekrandaki öne çıkan öğe listelerini sıralayın.",
|
||||
"topItemsReorderInfo": "Yeniden sıralamak için bir öğeyi basılı tutun ve kaydırın.",
|
||||
"discardChanges": "Değişiklikleri iptal et",
|
||||
"discardChangesDescription": "Değişiklikleri iptal etmek istediğinizden emin misiniz?",
|
||||
|
@ -687,6 +687,124 @@
|
|||
"unsupportedServerVersionMessage": "AdGuard Home sunucu sürümünüz çok eski ve AdGuard Home Manager tarafından desteklenmiyor. Bu uygulamayı kullanmak için AdGuard Home sunucunuzu daha yeni bir sürüme yükseltmeniz gerekecektir.",
|
||||
"yourVersion": "Yüklü sürüm: {version}",
|
||||
"minimumRequiredVersion": "Gerekli minimum sürüm: {version}",
|
||||
"topUpstreams": "Öne çıkan üst kaynaklar",
|
||||
"averageUpstreamResponseTime": "Üst kaynak ortalama yanıt süresi"
|
||||
"topUpstreams": "Öne çıkan DNS sunucuları",
|
||||
"averageUpstreamResponseTime": "DNS sunucuları işlem süresi" ,
|
||||
"dhcpNotAvailable": "DHCP sunucusu kullanılamıyor.",
|
||||
"osServerInstalledIncompatible": "AdGuard Home, işletim sisteminizde DHCP sunucusu çalıştıramıyor.",
|
||||
"resetSettings": "Ayarları sıfırla",
|
||||
"resetEncryptionSettingsDescription": "Şifreleme ayarlarını sıfırlamak istediğinizden emin misiniz?",
|
||||
"resettingConfig": "Yapılandırma sıfırlanıyor...",
|
||||
"configurationResetSuccessfully": "Yapılandırma başarıyla sıfırlandı",
|
||||
"configurationResetError": "Yapılandırma sıfırlanamadı",
|
||||
"testUpstreamDnsServers": "DNS sunucusunu test et",
|
||||
"errorTestUpstreamDns": "DNS sunucularını test ederken hata oluştu.",
|
||||
"useCustomIpEdns": "EDNS için özel IP kullan",
|
||||
"useCustomIpEdnsDescription": "EDNS için özel IP kullanımına izin ver",
|
||||
"sortingOptions": "Sıralama seçenekleri",
|
||||
"fromHighestToLowest": "Yüksekten düşüğe",
|
||||
"fromLowestToHighest": "Düşükten yükseğe",
|
||||
"queryLogsAndStatistics": "Sorgu günlüğü ve istatistikler",
|
||||
"ignoreClientQueryLog": "Sorgu günlüğünde bu istemciyi yoksay",
|
||||
"ignoreClientStatistics": "İstatistiklerde bu istemciyi yoksay",
|
||||
"savingChanges": "Değişiklikler kaydediliyor...",
|
||||
"fallbackDnsServers": "Yedek DNS sunucuları",
|
||||
"fallbackDnsServersDescription": "Yedek DNS sunucularını yapılandır",
|
||||
"fallbackDnsServersInfo": "Üst DNS sunucuları yanıt vermediğinde kullanılan yedek DNS sunucularının listesi. Sözdizimi, yukarıdaki ana üst kaynak alanıyla aynıdır.",
|
||||
"noFallbackDnsAdded": "Yedek DNS sunucusu eklenmedi.",
|
||||
"blockedResponseTtl": "Engellenen yanıtın kullanım süresi",
|
||||
"blockedResponseTtlDescription": "İstemcilerin filtrelenmiş bir yanıtı kaç saniye süreyle önbelleğe alması gerektiğini belirtir",
|
||||
"invalidValue": "Geçersiz değer",
|
||||
"noDataChart": "Bu grafiği görüntüleyecek veri yok.",
|
||||
"noData": "Veri yok",
|
||||
"unblockClient": "İstemci engelini kaldır",
|
||||
"blockingClient": "İstemci engelleniyor...",
|
||||
"unblockingClient": "İstemci engeli kaldırılıyor...",
|
||||
"upstreamDnsCacheConfiguration": "DNS önbellek yapılandırması",
|
||||
"enableDnsCachingClient": "Bu istemci için DNS önbelleğe almayı etkinleştir",
|
||||
"dnsCacheSize": "DNS önbellek boyutu (Bayt cinsinden)",
|
||||
"nameInvalid": "Ad gereklidir",
|
||||
"oneIdentifierRequired": "En az bir tanımlayıcı gereklidir",
|
||||
"dnsCacheNumber": "DNS önbellek boyutu bir rakam içermelidir",
|
||||
"errors": "Hatalar",
|
||||
"redirectHttpsWarning": "AdGuard Home sunucunuzda \"Otomatik olarak HTTPS'e yönlendir\" seçeneğini etkinleştirdiyseniz, bir HTTPS bağlantısı seçmeli ve sunucunuzun HTTPS bağlantı noktasını kullanmalısınız.",
|
||||
"logsSettingsDescription": "Sorgu günlüklerini yapılandır",
|
||||
"ignoredDomains": "Yok sayılan alan adları",
|
||||
"noIgnoredDomainsAdded": "Yok sayılacak alan adı eklenmedi",
|
||||
"pauseServiceBlocking": "Hizmet engellemeyi duraklat",
|
||||
"newSchedule": "Yeni program",
|
||||
"editSchedule": "Programı düzenle",
|
||||
"timezone": "Zaman dilimi",
|
||||
"monday": "Pazartesi",
|
||||
"tuesday": "Salı",
|
||||
"wednesday": "Çarşamba",
|
||||
"thursday": "Perşembe",
|
||||
"friday": "Cuma",
|
||||
"saturday": "Cumartesi",
|
||||
"sunday": "Pazar",
|
||||
"from": "Başlangıç",
|
||||
"to": "Bitiş",
|
||||
"selectStartTime": "Başlangıç zamanını seç",
|
||||
"selectEndTime": "Bitiş zamanını seç",
|
||||
"startTimeBeforeEndTime": "Başlangıç zamanı bitiş zamanından önce olmalıdır.",
|
||||
"noBlockingScheduleThisDevice": "Bu cihaz için herhangi bir engelleme programı bulunmamaktadır.",
|
||||
"selectTimezone": "Bir zaman dilimi seç",
|
||||
"selectClientsFiltersInfo": "Görüntülemek istediğiniz istemcileri seçin. Hiçbir istemci seçilmemişse, hepsi görüntülenecektir.",
|
||||
"noDataThisSection": "Bu bölüm için veri yok.",
|
||||
"statisticsSettings": "İstatistik ayarları",
|
||||
"statisticsSettingsDescription": "İstatistikler için veri toplamayı yapılandır",
|
||||
"loadingStatisticsSettings": "İstatistik ayarları yükleniyor...",
|
||||
"statisticsSettingsLoadError": "İstatistik ayarları yüklenirken bir hata oluştu.",
|
||||
"statisticsConfigUpdated": "İstatistik ayarları başarıyla güncellendi",
|
||||
"statisticsConfigNotUpdated": "İstatistik ayarları güncellenemedi",
|
||||
"customTimeInHours": "Özel zaman (Saat olarak)",
|
||||
"invalidTime": "Geçersiz zaman",
|
||||
"removeDomain": "Alan adını kaldır",
|
||||
"addDomain": "Alan adı ekle",
|
||||
"notLess1Hour": "Zaman 1 saatten az olamaz",
|
||||
"rateLimit": "Hız sınırı",
|
||||
"subnetPrefixLengthIpv4": "IPv4 için alt ağ önek uzunluğu",
|
||||
"subnetPrefixLengthIpv6": "IPv6 için alt ağ önek uzunluğu",
|
||||
"rateLimitAllowlist": "Hız sınırlama izin listesi",
|
||||
"rateLimitAllowlistDescription": "Hız sınırlamasından hariç tutulan IP adresleri",
|
||||
"dnsOptions": "DNS ayarları",
|
||||
"editor": "Editör",
|
||||
"editCustomRules": "Özel kuralları düzenle",
|
||||
"savingCustomRules": "Özel kurallar kaydediliyor...",
|
||||
"customRulesUpdatedSuccessfully": "Özel kurallar başarıyla güncellendi",
|
||||
"customRulesNotUpdated": "Özel kurallar güncellenemedi",
|
||||
"reorder": "Sırala",
|
||||
"showHide": "Göster/gizle",
|
||||
"noElementsReorderMessage": "Burada yeniden sıralamak için göster/gizle sekmesindeki bazı öğeleri etkinleştirin.",
|
||||
"enablePlainDns": "Düz DNS'i etkinleştir",
|
||||
"enablePlainDnsDescription": "Düz DNS varsayılan olarak etkindir. Tüm aygıtları şifrelenmiş DNS kullanmaya zorlamak için bunu devre dışı bırakabilirsiniz. Bunu yapmak için en az bir şifrelenmiş DNS protokolünü etkinleştirmeniz gerekir.",
|
||||
"date": "Tarih",
|
||||
"loadingChangelog": "Değişiklikler yükleniyor...",
|
||||
"invalidIpOrUrl": "Geçersiz IP adresi veya URL",
|
||||
"addPersistentClient": "Kalıcı istemci olarak ekle",
|
||||
"blockThisClientOnly": "Yalnızca bu istemci için engelle",
|
||||
"unblockThisClientOnly": "Yalnızca bu istemci için engeli kaldır",
|
||||
"domainBlockedThisClient": "Bu istemci için {domain} engellendi",
|
||||
"domainUnblockedThisClient": "Bu istemci için {domain} engeli kaldırıldı",
|
||||
"disallowThisClient": "Bu istemciye izin verme",
|
||||
"allowThisClient": "Bu istemciye izin ver",
|
||||
"clientAllowedSuccessfully": "İstemciye başarıyla izin verildi",
|
||||
"clientDisallowedSuccessfully": "İstemci başarıyla reddedildi",
|
||||
"changesNotSaved": "Değişiklikler kaydedilemedi",
|
||||
"allowingClient": "İstemciye izin veriliyor...",
|
||||
"disallowingClient": "İstemci reddediliyor...",
|
||||
"clientIpCopied": "İstemci IP'si panoya kopyalandı",
|
||||
"clientNameCopied": "İstemci adı panoya kopyalandı",
|
||||
"dnsServerAddressCopied": "DNS sunucu adresi panoya kopyalandı",
|
||||
"select": "Seç",
|
||||
"liveLogs": "Canlı günlükler",
|
||||
"hereWillAppearRealtimeLogs": "Burada gerçek zamanlı günlükler görünecek.",
|
||||
"applicationDetails": "Uygulama detayları",
|
||||
"applicationDetailsDescription": "Uygulama deposu, mevcut olduğu mağazalar ve daha fazlası",
|
||||
"myOtherApps": "Diğer uygulamalarım",
|
||||
"myOtherAppsDescription": "Diğer uygulamalarımı kontrol et, bağış yap, destekle iletişime geç ve daha fazlası",
|
||||
"topToBottom": "Yukarıdan aşağıya",
|
||||
"bottomToTop": "Aşağıdan yukarıya",
|
||||
"upstreamTimeout": "Üst sunucu zaman aşımı",
|
||||
"upstreamTimeoutHelper": "Üst DNS sunucusundan yanıt bekleme süresini saniye cinsinden belirtir",
|
||||
"fieldCannotBeEmpty": "Bu alan boş olamaz"
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
"invalidUsernamePassword": "用户名或密码错误",
|
||||
"tooManyAttempts": "尝试次数过多,请稍后再试",
|
||||
"cantReachServer": "无法连接服务器,请检查连接信息是否正确",
|
||||
"sslError": "SSL 错误。转到 设置 > 高级设置 并启用 不检查 SSL 证书",
|
||||
"sslError": "SSL 错误 转到 设置 > 高级设置 并启用 不检查 SSL 证书",
|
||||
"unknownError": "未知错误",
|
||||
"connectionNotCreated": "连接无法创建",
|
||||
"connecting": "正在连接...",
|
||||
|
@ -158,7 +158,7 @@
|
|||
"notSelected": "未选择",
|
||||
"resetFilters": "重置过滤器",
|
||||
"noLogsDisplay": "无日志可显示",
|
||||
"noLogsThatOld": "选择的时间段可能没有日志。尝试选择近期时间。",
|
||||
"noLogsThatOld": "选择的时间段可能没有日志 请尝试选择近期时间 ",
|
||||
"apply": "应用",
|
||||
"selectAll": "全选",
|
||||
"unselectAll": "取消全选",
|
||||
|
@ -235,7 +235,7 @@
|
|||
"urlNotValid": "URL 无效",
|
||||
"urlAbsolutePath": "URL 或绝对路径",
|
||||
"addingList": "正在添加订阅规则...",
|
||||
"listAdded": "订阅规则添加成功 。已添加项目:",
|
||||
"listAdded": "订阅规则添加成功 已添加项目:",
|
||||
"listAlreadyAdded": "订阅规则已被添加",
|
||||
"listUrlInvalid": "订阅规则 URL 无效",
|
||||
"listNotAdded": "无法添加订阅规则",
|
||||
|
@ -282,7 +282,7 @@
|
|||
"clientsNotLoaded": "无法加载客户端",
|
||||
"noAllowedClients": "没有已允许的客户端",
|
||||
"allowedClientsDescription": "如果此列表中有条目,AdGuard Home 将仅接受来自这些客户端的请求",
|
||||
"blockedClientsDescription": "如果此列表中有条目,AdGuard Home 将拒绝来自这些客户端的请求。如果已允许客户端中有条目,则会忽略此字段",
|
||||
"blockedClientsDescription": "如果此列表中有条目,AdGuard Home 将拒绝来自这些客户端的请求 如果已允许客户端中有条目,则会忽略此字段",
|
||||
"disallowedDomainsDescription": "AdGuard Home 会丢弃与这些域名匹配的 DNS 查询,这些查询甚至不会出现在查询日志中",
|
||||
"addClientFieldDescription": "CIDR、IP 地址或客户端 ID",
|
||||
"clientIdentifier": "客户端标识符",
|
||||
|
@ -358,7 +358,7 @@
|
|||
"seconds": "{time} 秒",
|
||||
"leaseTimeNotValid": "租期无效",
|
||||
"restoreConfiguration": "重置配置",
|
||||
"restoreConfigurationMessage": "您确定要继续吗?这将重置所有配置。此操作无法撤消",
|
||||
"restoreConfigurationMessage": "您确定要继续吗?这将重置所有配置 此操作无法撤消",
|
||||
"changeInterface": "更改接口",
|
||||
"savingSettings": "正在保存设置...",
|
||||
"settingsSaved": "设置保存成功",
|
||||
|
@ -372,7 +372,7 @@
|
|||
"staticLeaseDeleted": "DHCP 静态租用删除成功",
|
||||
"staticLeaseNotDeleted": "无法删除 DHCP 静态租用",
|
||||
"deleteStaticLease": "删除静态租用",
|
||||
"deleteStaticLeaseDescription": "DHCP 静态租用将被删除。此操作无法撤消",
|
||||
"deleteStaticLeaseDescription": "DHCP 静态租用将被删除 此操作无法撤消",
|
||||
"addStaticLease": "添加静态租用",
|
||||
"macAddress": "MAC 地址",
|
||||
"macAddressNotValid": "MAC 地址无效",
|
||||
|
@ -384,7 +384,7 @@
|
|||
"staticLeaseExists": "DHCP 静态租用已存在",
|
||||
"serverNotConfigured": "未配置服务器",
|
||||
"restoreLeases": "重置租用",
|
||||
"restoreLeasesMessage": "您确定要继续吗?这将重置所有现有租用。此操作无法撤消",
|
||||
"restoreLeasesMessage": "您确定要继续吗?这将重置所有现有租用 此操作无法撤消",
|
||||
"restoringLeases": "正在重置租用...",
|
||||
"leasesRestored": "租用重置成功",
|
||||
"leasesNotRestored": "无法重置租用",
|
||||
|
@ -427,24 +427,24 @@
|
|||
"dnsSettingsDescription": "配置与 DNS 服务器的连接",
|
||||
"upstreamDns": "上游 DNS 服务器",
|
||||
"bootstrapDns": "引导 DNS 服务器",
|
||||
"noUpstreamDns": "未添加上游 DNS 服务器。",
|
||||
"noUpstreamDns": "未添加上游 DNS 服务器 ",
|
||||
"dnsMode": "DNS 模式",
|
||||
"noDnsMode": "未选择 DNS 模式",
|
||||
"loadBalancing": "负载均衡",
|
||||
"parallelRequests": "并行请求",
|
||||
"fastestIpAddress": "最快的 IP 地址",
|
||||
"loadBalancingDescription": "每次查询一个上游服务器。AdGuard Home 使用其加权随机算法选择服务器,以便更频繁地使用最快的服务器",
|
||||
"loadBalancingDescription": "每次查询一个上游服务器 AdGuard Home 使用其加权随机算法选择服务器,以便更频繁地使用最快的服务器",
|
||||
"parallelRequestsDescription": "使用并行查询同时加速解析,同时查询所有上游服务器",
|
||||
"fastestIpAddressDescription": "查询所有 DNS 服务器并返回所有响应中最快的 IP 地址。这会减慢 DNS 查询,因为 AdGuard Home 必须等待所有 DNS 服务器的响应,但可以改善整体连接性",
|
||||
"noBootstrapDns": "未添加引导 DNS 服务器。",
|
||||
"bootstrapDnsServersInfo": "引导 DNS 服务器用于解析您指定的上游 DoH/DoT 解析器的 IP 地址。",
|
||||
"fastestIpAddressDescription": "查询所有 DNS 服务器并返回所有响应中最快的 IP 地址 这会减慢 DNS 查询,因为 AdGuard Home 必须等待所有 DNS 服务器的响应,但可以改善整体连接性",
|
||||
"noBootstrapDns": "未添加引导 DNS 服务器 ",
|
||||
"bootstrapDnsServersInfo": "引导 DNS 服务器用于解析您指定的上游 DoH/DoT 解析器的 IP 地址 ",
|
||||
"privateReverseDnsServers": "私有反向 DNS 服务器",
|
||||
"privateReverseDnsServersDescription": "AdGuard Home 用于本地 PTR 查询的 DNS 服务器。这些服务器用于解析私有 IP 范围内的地址的 PTR 请求,例如 \"192.168.12.34\"。如果未设置,AdGuard Home 将使用操作系统的默认 DNS 解析器地址,但不包括 AdGuard Home 本身的地址。",
|
||||
"privateReverseDnsServersDescription": "AdGuard Home 用于本地 PTR 查询的 DNS 服务器 这些服务器用于解析私有 IP 范围内的地址的 PTR 请求,例如 \"192.168.12.34\" 如果未设置,AdGuard Home 将使用操作系统的默认 DNS 解析器地址,但不包括 AdGuard Home 本身的地址 ",
|
||||
"reverseDnsDefault": "默认情况下,AdGuard Home 使用以下默认反向 DNS 解析器",
|
||||
"addItem": "添加项目",
|
||||
"noServerAddressesAdded": "未添加服务器地址",
|
||||
"usePrivateReverseDnsResolvers": "使用私有反向 DNS 解析器",
|
||||
"usePrivateReverseDnsResolversDescription": "使用这些上游服务器执行本地提供的地址的反向 DNS 查询。如果禁用,AdGuard Home 会对所有此类 PTR 请求(除了来自 DHCP、/etc/hosts 等已知客户端)响应 NXDOMAIN",
|
||||
"usePrivateReverseDnsResolversDescription": "使用这些上游服务器执行本地提供的地址的反向 DNS 查询 如果禁用,AdGuard Home 会对所有此类 PTR 请求(除了来自 DHCP、/etc/hosts 等已知客户端)响应 NXDOMAIN",
|
||||
"enableReverseResolving": "启用客户端 IP 地址的反向解析",
|
||||
"enableReverseResolvingDescription": "通过向相应的解析器发送 PTR 查询,将客户端 IP 地址进行反向解析为主机名(对于本地客户端使用私有 DNS 服务器,对于具有公共 IP 地址的客户端使用上游服务器)",
|
||||
"dnsServerSettings": "AdGuard Home DNS 服务器设置",
|
||||
|
@ -492,7 +492,7 @@
|
|||
"dnsCacheConfigDescription": "配置服务器如何管理 DNS 缓存",
|
||||
"comment": "注释",
|
||||
"address": "地址",
|
||||
"commentsDescription": "注释始终以 # 开头。您无需添加它,系统将自动添加",
|
||||
"commentsDescription": "注释始终以 # 开头 您无需添加它,系统将自动添加",
|
||||
"encryptionSettings": "加密设置",
|
||||
"encryptionSettingsDescription": "加密(HTTPS/QUIC/TLS)支持",
|
||||
"loadingEncryptionSettings": "正在加载加密设置...",
|
||||
|
@ -502,13 +502,13 @@
|
|||
"enableEncryptionDescription": "如果启用加密,AdGuard Home 管理界面将通过 HTTPS 运行,并且 DNS 服务器将监听 DNS-over-HTTPS 和 DNS-over-TLS 请求",
|
||||
"serverConfiguration": "服务器配置",
|
||||
"domainName": "域名",
|
||||
"domainNameDescription": "如果设置,AdGuard Home 将检测 ClientID、响应 DDR 查询并执行其他连接验证。如果未设置,这些功能将被禁用。必须与证书中的 DNS 名称之一匹配",
|
||||
"domainNameDescription": "如果设置,AdGuard Home 将检测 ClientID、响应 DDR 查询并执行其他连接验证 如果未设置,这些功能将被禁用 必须与证书中的 DNS 名称之一匹配",
|
||||
"redirectHttps": "自动重定向到 HTTPS",
|
||||
"httpsPort": "HTTPS 端口",
|
||||
"tlsPort": "DNS-over-TLS 端口",
|
||||
"dnsOverQuicPort": "DNS-over-QUIC 端口",
|
||||
"certificates": "证书",
|
||||
"certificatesDescription": "为了使用加密,您需要为您的域提供有效的 SSL 证书链。您可以在 letsencrypt.org 上获得免费证书,也可以从受信任的证书颁发机构购买",
|
||||
"certificatesDescription": "为了使用加密,您需要为您的域提供有效的 SSL 证书链 您可以在 letsencrypt.org 上获得免费证书,也可以从受信任的证书颁发机构购买",
|
||||
"certificateFilePath": "设置证书文件路径",
|
||||
"pasteCertificateContent": "粘贴证书内容",
|
||||
"certificatePath": "证书路径",
|
||||
|
@ -526,13 +526,13 @@
|
|||
"encryptionConfigSaved": "加密配置已成功保存",
|
||||
"encryptionConfigNotSaved": "无法保存加密配置",
|
||||
"configError": "配置错误",
|
||||
"enterOnlyCertificate": "只输入证书。不要输入 ---BEGIN--- 和 ---END--- 行。",
|
||||
"enterOnlyPrivateKey": "只输入密钥。不要输入 ---BEGIN--- 和 ---END--- 行。",
|
||||
"enterOnlyCertificate": "只输入证书 不要输入 ---BEGIN--- 和 ---END--- 行 ",
|
||||
"enterOnlyPrivateKey": "只输入密钥 不要输入 ---BEGIN--- 和 ---END--- 行 ",
|
||||
"noItemsSearch": "没有匹配的项目",
|
||||
"clearSearch": "清除搜索",
|
||||
"exitSearch": "退出搜索",
|
||||
"searchClients": "搜索客户端",
|
||||
"noClientsSearch": "没有匹配的客户端。",
|
||||
"noClientsSearch": "没有匹配的客户端 ",
|
||||
"customization": "定制",
|
||||
"customizationDescription": "自定义此应用程序",
|
||||
"color": "颜色",
|
||||
|
@ -598,7 +598,7 @@
|
|||
"checkUpdates": "检查更新",
|
||||
"requestingUpdate": "正在请求更新...",
|
||||
"autoupdateUnavailable": "自动更新不可用",
|
||||
"autoupdateUnavailableDescription": "此服务器不支持自动更新服务。这可能是因为服务器正在 Docker 容器中运行。您需要手动更新服务器",
|
||||
"autoupdateUnavailableDescription": "此服务器不支持自动更新服务 这可能是因为服务器正在 Docker 容器中运行 您需要手动更新服务器",
|
||||
"minute": "{time} 分钟",
|
||||
"minutes": "{time} 分钟",
|
||||
"hour": "{time} 小时",
|
||||
|
@ -606,7 +606,7 @@
|
|||
"remainingTime": "剩余时间",
|
||||
"safeSearchSettings": "安全搜索设置",
|
||||
"loadingSafeSearchSettings": "正在加载安全搜索设置...",
|
||||
"safeSearchSettingsNotLoaded": "加载安全搜索设置时出错。",
|
||||
"safeSearchSettingsNotLoaded": "加载安全搜索设置时出错 ",
|
||||
"loadingLogsSettings": "正在加载日志设置...",
|
||||
"selectOptionLeftColumn": "在左侧栏中选择一个选项",
|
||||
"selectClientLeftColumn": "在左侧栏中选择一个客户端",
|
||||
|
@ -619,7 +619,7 @@
|
|||
"copyListUrl": "复制订阅规则 URL",
|
||||
"listUrlCopied": "订阅规则 URL 已复制到剪贴板",
|
||||
"unsupportedVersion": "不支持的版本",
|
||||
"unsupprtedVersionMessage": "您的服务器版本 {version} 不在支持范围,配合使用可能会存在问题\n\nAdGuard Home Manager 只适配了 AdGuard Home 服务器的稳定版本。alpha 和 beta 版本也许能用,但不保证兼容性,同时使用时可能会存在问题",
|
||||
"unsupprtedVersionMessage": "您的服务器版本 {version} 不在支持范围,配合使用可能会存在问题\n\nAdGuard Home Manager 只适配了 AdGuard Home 服务器的稳定版本 alpha 和 beta 版本也许能用,但不保证兼容性,同时使用时可能会存在问题",
|
||||
"iUnderstand": "我了解",
|
||||
"appUpdates": "应用程序更新",
|
||||
"usingLatestVersion": "您正在使用最新版本",
|
||||
|
@ -658,7 +658,136 @@
|
|||
"hideServerAddressDescription": "在主页上隐藏服务器地址",
|
||||
"topItemsOrder": "顶部项目顺序",
|
||||
"topItemsOrderDescription": "排列主页顶部项目列表",
|
||||
"topItemsReorderInfo": "按住并滑动一个项目以重新排序。",
|
||||
"topItemsReorderInfo": "按住并滑动一个项目以重新排序 ",
|
||||
"discardChanges": "放弃更改",
|
||||
"discardChangesDescription": "您确定要放弃更改吗?"
|
||||
"discardChangesDescription": "您确定要放弃更改吗?",
|
||||
"others": "其他",
|
||||
"showChart": "显示图表",
|
||||
"hideChart": "隐藏图表",
|
||||
"showTopItemsChart": "显示顶部项目图表",
|
||||
"showTopItemsChartDescription": "默认情况下在移动视图中显示顶部项目部分的环形图 ",
|
||||
"openMenu": "打开菜单",
|
||||
"closeMenu": "关闭菜单",
|
||||
"openListUrl": "打开列表URL",
|
||||
"selectionMode": "选择模式",
|
||||
"enableDisableSelected": "启用或禁用选定项目",
|
||||
"deleteSelected": "删除选定项目",
|
||||
"deleteSelectedLists": "删除选定列表",
|
||||
"allSelectedListsDeletedSuccessfully": "所有选定列表已成功删除 ",
|
||||
"deletionResult": "删除结果",
|
||||
"deletingLists": "正在删除列表...",
|
||||
"failedElements": "失败元素",
|
||||
"processingLists": "正在处理列表...",
|
||||
"enableDisableResult": "启用或禁用结果",
|
||||
"selectedListsEnabledDisabledSuccessfully": "所有选定列表已成功启用或禁用",
|
||||
"sslWarning": "如果您正在使用带有自签名证书的 HTTPS 连接,请确保在设置 > 高级设置中启用 '不检查 SSL 证书' ",
|
||||
"unsupportedServerVersion": "不支持的服务器版本",
|
||||
"unsupportedServerVersionMessage": "您的 AdGuard Home 服务器版本过旧,不受 AdGuard Home Manager 支持 您需要将 AdGuard Home 服务器升级到更新的版本才能使用此应用程序 ",
|
||||
"yourVersion": "您的版本:{version}",
|
||||
"minimumRequiredVersion": "最低要求版本:{version}",
|
||||
"topUpstreams": "主要上游",
|
||||
"averageUpstreamResponseTime": "平均上游响应时间",
|
||||
"dhcpNotAvailable": "DHCP 服务器不可用 ",
|
||||
"osServerInstalledIncompatible": "服务器安装的操作系统与此功能不兼容 ",
|
||||
"resetSettings": "重置设置",
|
||||
"resetEncryptionSettingsDescription": "您确定要将加密设置重置为默认值吗?",
|
||||
"resettingConfig": "正在重置配置...",
|
||||
"configurationResetSuccessfully": "配置已成功重置",
|
||||
"configurationResetError": "配置无法重置",
|
||||
"testUpstreamDnsServers": "测试上游 DNS 服务器",
|
||||
"errorTestUpstreamDns": "测试上游 DNS 服务器时出错 ",
|
||||
"useCustomIpEdns": "使用 EDNS 的自定义 IP",
|
||||
"useCustomIpEdnsDescription": "允许使用 EDNS 的自定义 IP",
|
||||
"sortingOptions": "排序选项",
|
||||
"fromHighestToLowest": "从高到低",
|
||||
"fromLowestToHighest": "从低到高",
|
||||
"queryLogsAndStatistics": "查询日志和统计",
|
||||
"ignoreClientQueryLog": "在查询日志中忽略此客户端",
|
||||
"ignoreClientStatistics": "在统计中忽略此客户端",
|
||||
"savingChanges": "正在保存更改...",
|
||||
"fallbackDnsServers": "备用 DNS 服务器",
|
||||
"fallbackDnsServersDescription": "配置备用 DNS 服务器",
|
||||
"fallbackDnsServersInfo": "当上游 DNS 服务器无响应时使用的备用 DNS 服务器列表 语法与上面的主上游字段相同 ",
|
||||
"noFallbackDnsAdded": "未添加备用 DNS 服务器 ",
|
||||
"blockedResponseTtl": "被阻止的响应 TTL",
|
||||
"blockedResponseTtlDescription": "指定客户端应缓存过滤响应的秒数",
|
||||
"invalidValue": "无效值",
|
||||
"noDataChart": "没有数据显示此图表 ",
|
||||
"noData": "无数据",
|
||||
"unblockClient": "解除客户端封锁",
|
||||
"blockingClient": "正在封锁客户端...",
|
||||
"unblockingClient": "正在解除客户端封锁...",
|
||||
"upstreamDnsCacheConfiguration": "DNS 上游缓存配置",
|
||||
"enableDnsCachingClient": "为此客户端启用 DNS 缓存",
|
||||
"dnsCacheSize": "DNS 缓存大小",
|
||||
"nameInvalid": "名称是必需的",
|
||||
"oneIdentifierRequired": "至少需要一个标识符",
|
||||
"dnsCacheNumber": "DNS 缓存大小必须是一个数字",
|
||||
"errors": "错误",
|
||||
"redirectHttpsWarning": "如果您在 AdGuard Home 服务器上启用了 '自动重定向到 HTTPS',则必须选择 HTTPS 连接并使用服务器的 HTTPS 端口 ",
|
||||
"logsSettingsDescription": "配置查询日志",
|
||||
"ignoredDomains": "忽略的域名",
|
||||
"noIgnoredDomainsAdded": "未添加忽略的域名",
|
||||
"pauseServiceBlocking": "暂停服务阻止",
|
||||
"newSchedule": "新计划",
|
||||
"editSchedule": "编辑计划",
|
||||
"timezone": "时区",
|
||||
"monday": "星期一",
|
||||
"tuesday": "星期二",
|
||||
"wednesday": "星期三",
|
||||
"thursday": "星期四",
|
||||
"friday": "星期五",
|
||||
"saturday": "星期六",
|
||||
"sunday": "星期日",
|
||||
"from": "从",
|
||||
"to": "到",
|
||||
"selectStartTime": "选择开始时间",
|
||||
"selectEndTime": "选择结束时间",
|
||||
"startTimeBeforeEndTime": "开始时间必须在结束时间之前 ",
|
||||
"noBlockingScheduleThisDevice": "此设备没有阻止计划 ",
|
||||
"selectTimezone": "选择时区",
|
||||
"selectClientsFiltersInfo": "选择您想要显示的客户端 如果没有选择任何客户端,将显示所有客户端 ",
|
||||
"noDataThisSection": "本节没有数据 ",
|
||||
"statisticsSettings": "统计设置",
|
||||
"statisticsSettingsDescription": "配置统计数据收集",
|
||||
"loadingStatisticsSettings": "正在加载统计设置...",
|
||||
"statisticsSettingsLoadError": "加载统计设置时发生错误 ",
|
||||
"statisticsConfigUpdated": "统计设置成功更新",
|
||||
"statisticsConfigNotUpdated": "统计设置无法更新",
|
||||
"customTimeInHours": "自定义时间(以小时为单位)",
|
||||
"invalidTime": "无效时间",
|
||||
"removeDomain": "移除域名",
|
||||
"addDomain": "添加域名",
|
||||
"notLess1Hour": "时间不能少于 1 小时",
|
||||
"rateLimit": "速率限制",
|
||||
"subnetPrefixLengthIpv4": "IPv4 的子网前缀长度",
|
||||
"subnetPrefixLengthIpv6": "IPv6 的子网前缀长度",
|
||||
"rateLimitAllowlist": "速率限制白名单",
|
||||
"rateLimitAllowlistDescription": "从速率限制中排除的 IP 地址",
|
||||
"dnsOptions": "DNS 选项",
|
||||
"editor": "编辑器",
|
||||
"editCustomRules": "编辑自定义规则",
|
||||
"savingCustomRules": "正在保存自定义规则...",
|
||||
"customRulesUpdatedSuccessfully": "自定义规则成功更新",
|
||||
"customRulesNotUpdated": "自定义规则无法更新",
|
||||
"reorder": "重新排序",
|
||||
"showHide": "显示/隐藏",
|
||||
"noElementsReorderMessage": "在显示/隐藏标签页上启用一些元素,然后在这里重新排序 ",
|
||||
"enablePlainDns": "启用普通 DNS",
|
||||
"enablePlainDnsDescription": "默认启用普通 DNS 您可以禁用它,强制所有设备使用加密 DNS 要做到这一点,您必须至少启用一个加密 DNS 协议 ",
|
||||
"date": "日期",
|
||||
"loadingChangelog": "正在加载更新日志...",
|
||||
"invalidIpOrUrl": "无效的 IP 地址或 URL",
|
||||
"addPersistentClient": "添加为持久客户端",
|
||||
"blockThisClientOnly": "仅为此客户端封锁",
|
||||
"unblockThisClientOnly": "仅为此客户端解封",
|
||||
"domainBlockedThisClient": "{domain} 已为此客户端封锁",
|
||||
"domainUnblockedThisClient": "{domain} 已为此客户端解封",
|
||||
"disallowThisClient": "禁止此客户端",
|
||||
"allowThisClient": "允许此客户端",
|
||||
"clientAllowedSuccessfully": "客户端成功允许",
|
||||
"clientDisallowedSuccessfully": "客户端成功禁止",
|
||||
"changesNotSaved": "更改无法保存",
|
||||
"allowingClient": "正在允许客户端...",
|
||||
"disallowingClient": "正在禁止客户端..."
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
"invalidUsernamePassword": "用户名或密码错误",
|
||||
"tooManyAttempts": "尝试次数过多,请稍后再试",
|
||||
"cantReachServer": "无法连接服务器,请检查连接信息是否正确",
|
||||
"sslError": "SSL 错误。转到 设置 > 高级设置 并启用 不检查 SSL 证书",
|
||||
"sslError": "SSL 错误 转到 设置 > 高级设置 并启用 不检查 SSL 证书",
|
||||
"unknownError": "未知错误",
|
||||
"connectionNotCreated": "连接无法创建",
|
||||
"connecting": "正在连接...",
|
||||
|
@ -158,7 +158,7 @@
|
|||
"notSelected": "未选择",
|
||||
"resetFilters": "重置过滤器",
|
||||
"noLogsDisplay": "无日志可显示",
|
||||
"noLogsThatOld": "选择的时间段可能没有日志。尝试选择近期时间。",
|
||||
"noLogsThatOld": "选择的时间段可能没有日志 请尝试选择近期时间 ",
|
||||
"apply": "应用",
|
||||
"selectAll": "全选",
|
||||
"unselectAll": "取消全选",
|
||||
|
@ -235,7 +235,7 @@
|
|||
"urlNotValid": "URL 无效",
|
||||
"urlAbsolutePath": "URL 或绝对路径",
|
||||
"addingList": "正在添加订阅规则...",
|
||||
"listAdded": "订阅规则添加成功 。已添加项目:",
|
||||
"listAdded": "订阅规则添加成功 已添加项目:",
|
||||
"listAlreadyAdded": "订阅规则已被添加",
|
||||
"listUrlInvalid": "订阅规则 URL 无效",
|
||||
"listNotAdded": "无法添加订阅规则",
|
||||
|
@ -282,7 +282,7 @@
|
|||
"clientsNotLoaded": "无法加载客户端",
|
||||
"noAllowedClients": "没有已允许的客户端",
|
||||
"allowedClientsDescription": "如果此列表中有条目,AdGuard Home 将仅接受来自这些客户端的请求",
|
||||
"blockedClientsDescription": "如果此列表中有条目,AdGuard Home 将拒绝来自这些客户端的请求。如果已允许客户端中有条目,则会忽略此字段",
|
||||
"blockedClientsDescription": "如果此列表中有条目,AdGuard Home 将拒绝来自这些客户端的请求 如果已允许客户端中有条目,则会忽略此字段",
|
||||
"disallowedDomainsDescription": "AdGuard Home 会丢弃与这些域名匹配的 DNS 查询,这些查询甚至不会出现在查询日志中",
|
||||
"addClientFieldDescription": "CIDR、IP 地址或客户端 ID",
|
||||
"clientIdentifier": "客户端标识符",
|
||||
|
@ -358,7 +358,7 @@
|
|||
"seconds": "{time} 秒",
|
||||
"leaseTimeNotValid": "租期无效",
|
||||
"restoreConfiguration": "重置配置",
|
||||
"restoreConfigurationMessage": "您确定要继续吗?这将重置所有配置。此操作无法撤消",
|
||||
"restoreConfigurationMessage": "您确定要继续吗?这将重置所有配置 此操作无法撤消",
|
||||
"changeInterface": "更改接口",
|
||||
"savingSettings": "正在保存设置...",
|
||||
"settingsSaved": "设置保存成功",
|
||||
|
@ -372,7 +372,7 @@
|
|||
"staticLeaseDeleted": "DHCP 静态租用删除成功",
|
||||
"staticLeaseNotDeleted": "无法删除 DHCP 静态租用",
|
||||
"deleteStaticLease": "删除静态租用",
|
||||
"deleteStaticLeaseDescription": "DHCP 静态租用将被删除。此操作无法撤消",
|
||||
"deleteStaticLeaseDescription": "DHCP 静态租用将被删除 此操作无法撤消",
|
||||
"addStaticLease": "添加静态租用",
|
||||
"macAddress": "MAC 地址",
|
||||
"macAddressNotValid": "MAC 地址无效",
|
||||
|
@ -384,7 +384,7 @@
|
|||
"staticLeaseExists": "DHCP 静态租用已存在",
|
||||
"serverNotConfigured": "未配置服务器",
|
||||
"restoreLeases": "重置租用",
|
||||
"restoreLeasesMessage": "您确定要继续吗?这将重置所有现有租用。此操作无法撤消",
|
||||
"restoreLeasesMessage": "您确定要继续吗?这将重置所有现有租用 此操作无法撤消",
|
||||
"restoringLeases": "正在重置租用...",
|
||||
"leasesRestored": "租用重置成功",
|
||||
"leasesNotRestored": "无法重置租用",
|
||||
|
@ -427,24 +427,24 @@
|
|||
"dnsSettingsDescription": "配置与 DNS 服务器的连接",
|
||||
"upstreamDns": "上游 DNS 服务器",
|
||||
"bootstrapDns": "引导 DNS 服务器",
|
||||
"noUpstreamDns": "未添加上游 DNS 服务器。",
|
||||
"noUpstreamDns": "未添加上游 DNS 服务器 ",
|
||||
"dnsMode": "DNS 模式",
|
||||
"noDnsMode": "未选择 DNS 模式",
|
||||
"loadBalancing": "负载均衡",
|
||||
"parallelRequests": "并行请求",
|
||||
"fastestIpAddress": "最快的 IP 地址",
|
||||
"loadBalancingDescription": "每次查询一个上游服务器。AdGuard Home 使用其加权随机算法选择服务器,以便更频繁地使用最快的服务器",
|
||||
"loadBalancingDescription": "每次查询一个上游服务器 AdGuard Home 使用其加权随机算法选择服务器,以便更频繁地使用最快的服务器",
|
||||
"parallelRequestsDescription": "使用并行查询同时加速解析,同时查询所有上游服务器",
|
||||
"fastestIpAddressDescription": "查询所有 DNS 服务器并返回所有响应中最快的 IP 地址。这会减慢 DNS 查询,因为 AdGuard Home 必须等待所有 DNS 服务器的响应,但可以改善整体连接性",
|
||||
"noBootstrapDns": "未添加引导 DNS 服务器。",
|
||||
"bootstrapDnsServersInfo": "引导 DNS 服务器用于解析您指定的上游 DoH/DoT 解析器的 IP 地址。",
|
||||
"fastestIpAddressDescription": "查询所有 DNS 服务器并返回所有响应中最快的 IP 地址 这会减慢 DNS 查询,因为 AdGuard Home 必须等待所有 DNS 服务器的响应,但可以改善整体连接性",
|
||||
"noBootstrapDns": "未添加引导 DNS 服务器 ",
|
||||
"bootstrapDnsServersInfo": "引导 DNS 服务器用于解析您指定的上游 DoH/DoT 解析器的 IP 地址 ",
|
||||
"privateReverseDnsServers": "私有反向 DNS 服务器",
|
||||
"privateReverseDnsServersDescription": "AdGuard Home 用于本地 PTR 查询的 DNS 服务器。这些服务器用于解析私有 IP 范围内的地址的 PTR 请求,例如 \"192.168.12.34\"。如果未设置,AdGuard Home 将使用操作系统的默认 DNS 解析器地址,但不包括 AdGuard Home 本身的地址。",
|
||||
"privateReverseDnsServersDescription": "AdGuard Home 用于本地 PTR 查询的 DNS 服务器 这些服务器用于解析私有 IP 范围内的地址的 PTR 请求,例如 \"192.168.12.34\" 如果未设置,AdGuard Home 将使用操作系统的默认 DNS 解析器地址,但不包括 AdGuard Home 本身的地址 ",
|
||||
"reverseDnsDefault": "默认情况下,AdGuard Home 使用以下默认反向 DNS 解析器",
|
||||
"addItem": "添加项目",
|
||||
"noServerAddressesAdded": "未添加服务器地址",
|
||||
"usePrivateReverseDnsResolvers": "使用私有反向 DNS 解析器",
|
||||
"usePrivateReverseDnsResolversDescription": "使用这些上游服务器执行本地提供的地址的反向 DNS 查询。如果禁用,AdGuard Home 会对所有此类 PTR 请求(除了来自 DHCP、/etc/hosts 等已知客户端)响应 NXDOMAIN",
|
||||
"usePrivateReverseDnsResolversDescription": "使用这些上游服务器执行本地提供的地址的反向 DNS 查询 如果禁用,AdGuard Home 会对所有此类 PTR 请求(除了来自 DHCP、/etc/hosts 等已知客户端)响应 NXDOMAIN",
|
||||
"enableReverseResolving": "启用客户端 IP 地址的反向解析",
|
||||
"enableReverseResolvingDescription": "通过向相应的解析器发送 PTR 查询,将客户端 IP 地址进行反向解析为主机名(对于本地客户端使用私有 DNS 服务器,对于具有公共 IP 地址的客户端使用上游服务器)",
|
||||
"dnsServerSettings": "AdGuard Home DNS 服务器设置",
|
||||
|
@ -492,7 +492,7 @@
|
|||
"dnsCacheConfigDescription": "配置服务器如何管理 DNS 缓存",
|
||||
"comment": "注释",
|
||||
"address": "地址",
|
||||
"commentsDescription": "注释始终以 # 开头。您无需添加它,系统将自动添加",
|
||||
"commentsDescription": "注释始终以 # 开头 您无需添加它,系统将自动添加",
|
||||
"encryptionSettings": "加密设置",
|
||||
"encryptionSettingsDescription": "加密(HTTPS/QUIC/TLS)支持",
|
||||
"loadingEncryptionSettings": "正在加载加密设置...",
|
||||
|
@ -502,13 +502,13 @@
|
|||
"enableEncryptionDescription": "如果启用加密,AdGuard Home 管理界面将通过 HTTPS 运行,并且 DNS 服务器将监听 DNS-over-HTTPS 和 DNS-over-TLS 请求",
|
||||
"serverConfiguration": "服务器配置",
|
||||
"domainName": "域名",
|
||||
"domainNameDescription": "如果设置,AdGuard Home 将检测 ClientID、响应 DDR 查询并执行其他连接验证。如果未设置,这些功能将被禁用。必须与证书中的 DNS 名称之一匹配",
|
||||
"domainNameDescription": "如果设置,AdGuard Home 将检测 ClientID、响应 DDR 查询并执行其他连接验证 如果未设置,这些功能将被禁用 必须与证书中的 DNS 名称之一匹配",
|
||||
"redirectHttps": "自动重定向到 HTTPS",
|
||||
"httpsPort": "HTTPS 端口",
|
||||
"tlsPort": "DNS-over-TLS 端口",
|
||||
"dnsOverQuicPort": "DNS-over-QUIC 端口",
|
||||
"certificates": "证书",
|
||||
"certificatesDescription": "为了使用加密,您需要为您的域提供有效的 SSL 证书链。您可以在 letsencrypt.org 上获得免费证书,也可以从受信任的证书颁发机构购买",
|
||||
"certificatesDescription": "为了使用加密,您需要为您的域提供有效的 SSL 证书链 您可以在 letsencrypt.org 上获得免费证书,也可以从受信任的证书颁发机构购买",
|
||||
"certificateFilePath": "设置证书文件路径",
|
||||
"pasteCertificateContent": "粘贴证书内容",
|
||||
"certificatePath": "证书路径",
|
||||
|
@ -526,13 +526,13 @@
|
|||
"encryptionConfigSaved": "加密配置已成功保存",
|
||||
"encryptionConfigNotSaved": "无法保存加密配置",
|
||||
"configError": "配置错误",
|
||||
"enterOnlyCertificate": "只输入证书。不要输入 ---BEGIN--- 和 ---END--- 行。",
|
||||
"enterOnlyPrivateKey": "只输入密钥。不要输入 ---BEGIN--- 和 ---END--- 行。",
|
||||
"enterOnlyCertificate": "只输入证书 不要输入 ---BEGIN--- 和 ---END--- 行 ",
|
||||
"enterOnlyPrivateKey": "只输入密钥 不要输入 ---BEGIN--- 和 ---END--- 行 ",
|
||||
"noItemsSearch": "没有匹配的项目",
|
||||
"clearSearch": "清除搜索",
|
||||
"exitSearch": "退出搜索",
|
||||
"searchClients": "搜索客户端",
|
||||
"noClientsSearch": "没有匹配的客户端。",
|
||||
"noClientsSearch": "没有匹配的客户端 ",
|
||||
"customization": "定制",
|
||||
"customizationDescription": "自定义此应用程序",
|
||||
"color": "颜色",
|
||||
|
@ -598,7 +598,7 @@
|
|||
"checkUpdates": "检查更新",
|
||||
"requestingUpdate": "正在请求更新...",
|
||||
"autoupdateUnavailable": "自动更新不可用",
|
||||
"autoupdateUnavailableDescription": "此服务器不支持自动更新服务。这可能是因为服务器正在 Docker 容器中运行。您需要手动更新服务器",
|
||||
"autoupdateUnavailableDescription": "此服务器不支持自动更新服务 这可能是因为服务器正在 Docker 容器中运行 您需要手动更新服务器",
|
||||
"minute": "{time} 分钟",
|
||||
"minutes": "{time} 分钟",
|
||||
"hour": "{time} 小时",
|
||||
|
@ -606,7 +606,7 @@
|
|||
"remainingTime": "剩余时间",
|
||||
"safeSearchSettings": "安全搜索设置",
|
||||
"loadingSafeSearchSettings": "正在加载安全搜索设置...",
|
||||
"safeSearchSettingsNotLoaded": "加载安全搜索设置时出错。",
|
||||
"safeSearchSettingsNotLoaded": "加载安全搜索设置时出错 ",
|
||||
"loadingLogsSettings": "正在加载日志设置...",
|
||||
"selectOptionLeftColumn": "在左侧栏中选择一个选项",
|
||||
"selectClientLeftColumn": "在左侧栏中选择一个客户端",
|
||||
|
@ -619,7 +619,7 @@
|
|||
"copyListUrl": "复制订阅规则 URL",
|
||||
"listUrlCopied": "订阅规则 URL 已复制到剪贴板",
|
||||
"unsupportedVersion": "不支持的版本",
|
||||
"unsupprtedVersionMessage": "您的服务器版本 {version} 不在支持范围,配合使用可能会存在问题\n\nAdGuard Home Manager 只适配了 AdGuard Home 服务器的稳定版本。alpha 和 beta 版本也许能用,但不保证兼容性,同时使用时可能会存在问题",
|
||||
"unsupprtedVersionMessage": "您的服务器版本 {version} 不在支持范围,配合使用可能会存在问题\n\nAdGuard Home Manager 只适配了 AdGuard Home 服务器的稳定版本 alpha 和 beta 版本也许能用,但不保证兼容性,同时使用时可能会存在问题",
|
||||
"iUnderstand": "我了解",
|
||||
"appUpdates": "应用程序更新",
|
||||
"usingLatestVersion": "您正在使用最新版本",
|
||||
|
@ -658,7 +658,136 @@
|
|||
"hideServerAddressDescription": "在主页上隐藏服务器地址",
|
||||
"topItemsOrder": "顶部项目顺序",
|
||||
"topItemsOrderDescription": "排列主页顶部项目列表",
|
||||
"topItemsReorderInfo": "按住并滑动一个项目以重新排序。",
|
||||
"topItemsReorderInfo": "按住并滑动一个项目以重新排序 ",
|
||||
"discardChanges": "放弃更改",
|
||||
"discardChangesDescription": "您确定要放弃更改吗?"
|
||||
"discardChangesDescription": "您确定要放弃更改吗?",
|
||||
"others": "其他",
|
||||
"showChart": "显示图表",
|
||||
"hideChart": "隐藏图表",
|
||||
"showTopItemsChart": "显示顶部项目图表",
|
||||
"showTopItemsChartDescription": "默认情况下在移动视图中显示顶部项目部分的环形图 ",
|
||||
"openMenu": "打开菜单",
|
||||
"closeMenu": "关闭菜单",
|
||||
"openListUrl": "打开列表URL",
|
||||
"selectionMode": "选择模式",
|
||||
"enableDisableSelected": "启用或禁用选定项目",
|
||||
"deleteSelected": "删除选定项目",
|
||||
"deleteSelectedLists": "删除选定列表",
|
||||
"allSelectedListsDeletedSuccessfully": "所有选定列表已成功删除 ",
|
||||
"deletionResult": "删除结果",
|
||||
"deletingLists": "正在删除列表...",
|
||||
"failedElements": "失败元素",
|
||||
"processingLists": "正在处理列表...",
|
||||
"enableDisableResult": "启用或禁用结果",
|
||||
"selectedListsEnabledDisabledSuccessfully": "所有选定列表已成功启用或禁用",
|
||||
"sslWarning": "如果您正在使用带有自签名证书的 HTTPS 连接,请确保在设置 > 高级设置中启用 '不检查 SSL 证书' ",
|
||||
"unsupportedServerVersion": "不支持的服务器版本",
|
||||
"unsupportedServerVersionMessage": "您的 AdGuard Home 服务器版本过旧,不受 AdGuard Home Manager 支持 您需要将 AdGuard Home 服务器升级到更新的版本才能使用此应用程序 ",
|
||||
"yourVersion": "您的版本:{version}",
|
||||
"minimumRequiredVersion": "最低要求版本:{version}",
|
||||
"topUpstreams": "主要上游",
|
||||
"averageUpstreamResponseTime": "平均上游响应时间",
|
||||
"dhcpNotAvailable": "DHCP 服务器不可用 ",
|
||||
"osServerInstalledIncompatible": "服务器安装的操作系统与此功能不兼容 ",
|
||||
"resetSettings": "重置设置",
|
||||
"resetEncryptionSettingsDescription": "您确定要将加密设置重置为默认值吗?",
|
||||
"resettingConfig": "正在重置配置...",
|
||||
"configurationResetSuccessfully": "配置已成功重置",
|
||||
"configurationResetError": "配置无法重置",
|
||||
"testUpstreamDnsServers": "测试上游 DNS 服务器",
|
||||
"errorTestUpstreamDns": "测试上游 DNS 服务器时出错 ",
|
||||
"useCustomIpEdns": "使用 EDNS 的自定义 IP",
|
||||
"useCustomIpEdnsDescription": "允许使用 EDNS 的自定义 IP",
|
||||
"sortingOptions": "排序选项",
|
||||
"fromHighestToLowest": "从高到低",
|
||||
"fromLowestToHighest": "从低到高",
|
||||
"queryLogsAndStatistics": "查询日志和统计",
|
||||
"ignoreClientQueryLog": "在查询日志中忽略此客户端",
|
||||
"ignoreClientStatistics": "在统计中忽略此客户端",
|
||||
"savingChanges": "正在保存更改...",
|
||||
"fallbackDnsServers": "备用 DNS 服务器",
|
||||
"fallbackDnsServersDescription": "配置备用 DNS 服务器",
|
||||
"fallbackDnsServersInfo": "当上游 DNS 服务器无响应时使用的备用 DNS 服务器列表 语法与上面的主上游字段相同 ",
|
||||
"noFallbackDnsAdded": "未添加备用 DNS 服务器 ",
|
||||
"blockedResponseTtl": "被阻止的响应 TTL",
|
||||
"blockedResponseTtlDescription": "指定客户端应缓存过滤响应的秒数",
|
||||
"invalidValue": "无效值",
|
||||
"noDataChart": "没有数据显示此图表 ",
|
||||
"noData": "无数据",
|
||||
"unblockClient": "解除客户端封锁",
|
||||
"blockingClient": "正在封锁客户端...",
|
||||
"unblockingClient": "正在解除客户端封锁...",
|
||||
"upstreamDnsCacheConfiguration": "DNS 上游缓存配置",
|
||||
"enableDnsCachingClient": "为此客户端启用 DNS 缓存",
|
||||
"dnsCacheSize": "DNS 缓存大小",
|
||||
"nameInvalid": "名称是必需的",
|
||||
"oneIdentifierRequired": "至少需要一个标识符",
|
||||
"dnsCacheNumber": "DNS 缓存大小必须是一个数字",
|
||||
"errors": "错误",
|
||||
"redirectHttpsWarning": "如果您在 AdGuard Home 服务器上启用了 '自动重定向到 HTTPS',则必须选择 HTTPS 连接并使用服务器的 HTTPS 端口 ",
|
||||
"logsSettingsDescription": "配置查询日志",
|
||||
"ignoredDomains": "忽略的域名",
|
||||
"noIgnoredDomainsAdded": "未添加忽略的域名",
|
||||
"pauseServiceBlocking": "暂停服务阻止",
|
||||
"newSchedule": "新计划",
|
||||
"editSchedule": "编辑计划",
|
||||
"timezone": "时区",
|
||||
"monday": "星期一",
|
||||
"tuesday": "星期二",
|
||||
"wednesday": "星期三",
|
||||
"thursday": "星期四",
|
||||
"friday": "星期五",
|
||||
"saturday": "星期六",
|
||||
"sunday": "星期日",
|
||||
"from": "从",
|
||||
"to": "到",
|
||||
"selectStartTime": "选择开始时间",
|
||||
"selectEndTime": "选择结束时间",
|
||||
"startTimeBeforeEndTime": "开始时间必须在结束时间之前 ",
|
||||
"noBlockingScheduleThisDevice": "此设备没有阻止计划 ",
|
||||
"selectTimezone": "选择时区",
|
||||
"selectClientsFiltersInfo": "选择您想要显示的客户端 如果没有选择任何客户端,将显示所有客户端 ",
|
||||
"noDataThisSection": "本节没有数据 ",
|
||||
"statisticsSettings": "统计设置",
|
||||
"statisticsSettingsDescription": "配置统计数据收集",
|
||||
"loadingStatisticsSettings": "正在加载统计设置...",
|
||||
"statisticsSettingsLoadError": "加载统计设置时发生错误 ",
|
||||
"statisticsConfigUpdated": "统计设置成功更新",
|
||||
"statisticsConfigNotUpdated": "统计设置无法更新",
|
||||
"customTimeInHours": "自定义时间(以小时为单位)",
|
||||
"invalidTime": "无效时间",
|
||||
"removeDomain": "移除域名",
|
||||
"addDomain": "添加域名",
|
||||
"notLess1Hour": "时间不能少于 1 小时",
|
||||
"rateLimit": "速率限制",
|
||||
"subnetPrefixLengthIpv4": "IPv4 的子网前缀长度",
|
||||
"subnetPrefixLengthIpv6": "IPv6 的子网前缀长度",
|
||||
"rateLimitAllowlist": "速率限制白名单",
|
||||
"rateLimitAllowlistDescription": "从速率限制中排除的 IP 地址",
|
||||
"dnsOptions": "DNS 选项",
|
||||
"editor": "编辑器",
|
||||
"editCustomRules": "编辑自定义规则",
|
||||
"savingCustomRules": "正在保存自定义规则...",
|
||||
"customRulesUpdatedSuccessfully": "自定义规则成功更新",
|
||||
"customRulesNotUpdated": "自定义规则无法更新",
|
||||
"reorder": "重新排序",
|
||||
"showHide": "显示/隐藏",
|
||||
"noElementsReorderMessage": "在显示/隐藏标签页上启用一些元素,然后在这里重新排序 ",
|
||||
"enablePlainDns": "启用普通 DNS",
|
||||
"enablePlainDnsDescription": "默认启用普通 DNS 您可以禁用它,强制所有设备使用加密 DNS 要做到这一点,您必须至少启用一个加密 DNS 协议 ",
|
||||
"date": "日期",
|
||||
"loadingChangelog": "正在加载更新日志...",
|
||||
"invalidIpOrUrl": "无效的 IP 地址或 URL",
|
||||
"addPersistentClient": "添加为持久客户端",
|
||||
"blockThisClientOnly": "仅为此客户端封锁",
|
||||
"unblockThisClientOnly": "仅为此客户端解封",
|
||||
"domainBlockedThisClient": "{domain} 已为此客户端封锁",
|
||||
"domainUnblockedThisClient": "{domain} 已为此客户端解封",
|
||||
"disallowThisClient": "禁止此客户端",
|
||||
"allowThisClient": "允许此客户端",
|
||||
"clientAllowedSuccessfully": "客户端成功允许",
|
||||
"clientDisallowedSuccessfully": "客户端成功禁止",
|
||||
"changesNotSaved": "更改无法保存",
|
||||
"allowingClient": "正在允许客户端...",
|
||||
"disallowingClient": "正在禁止客户端..."
|
||||
}
|
||||
|
|
159
lib/main.dart
159
lib/main.dart
|
@ -5,14 +5,13 @@ import 'package:flutter/foundation.dart';
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_displaymode/flutter_displaymode.dart';
|
||||
import 'package:dynamic_color/dynamic_color.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
|
||||
import 'package:store_checker/store_checker.dart';
|
||||
import 'package:window_size/window_size.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
|
@ -31,15 +30,16 @@ import 'package:adguard_home_manager/providers/servers_provider.dart';
|
|||
import 'package:adguard_home_manager/constants/colors.dart';
|
||||
import 'package:adguard_home_manager/config/globals.dart';
|
||||
import 'package:adguard_home_manager/config/theme.dart';
|
||||
import 'package:adguard_home_manager/classes/http_override.dart';
|
||||
import 'package:adguard_home_manager/services/db/database.dart';
|
||||
import 'package:adguard_home_manager/classes/http_override.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||
|
||||
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
|
||||
setWindowMinSize(const Size(500, 500));
|
||||
await windowManager.ensureInitialized();
|
||||
WindowManager.instance.setMinimumSize(const Size(500, 700));
|
||||
}
|
||||
|
||||
if (Platform.isWindows || Platform.isLinux) {
|
||||
|
@ -48,8 +48,12 @@ void main() async {
|
|||
}
|
||||
|
||||
await dotenv.load(fileName: '.env');
|
||||
|
||||
final sharedPreferences = await SharedPreferences.getInstance();
|
||||
|
||||
final AppConfigProvider appConfigProvider = AppConfigProvider();
|
||||
final AppConfigProvider appConfigProvider = AppConfigProvider(
|
||||
sharedPreferencesInstance: sharedPreferences
|
||||
);
|
||||
final ServersProvider serversProvider = ServersProvider();
|
||||
final StatusProvider statusProvider = StatusProvider();
|
||||
final ClientsProvider clientsProvider = ClientsProvider();
|
||||
|
@ -69,21 +73,16 @@ void main() async {
|
|||
appConfigProvider.setIosInfo(iosInfo);
|
||||
}
|
||||
|
||||
final dbData = await loadDb(appConfigProvider.androidDeviceInfo != null && appConfigProvider.androidDeviceInfo!.version.sdkInt >= 31);
|
||||
|
||||
if (dbData['appConfig']['overrideSslCheck'] == 1) {
|
||||
if (sharedPreferences.getBool('overrideSslCheck') == true) {
|
||||
HttpOverrides.global = MyHttpOverrides();
|
||||
}
|
||||
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
Source installationSource = await StoreChecker.getSource;
|
||||
appConfigProvider.setInstallationSource(installationSource);
|
||||
}
|
||||
|
||||
final dbData = await loadDb();
|
||||
serversProvider.setDbInstance(dbData['dbInstance']);
|
||||
appConfigProvider.saveFromDb(dbData['dbInstance'], dbData['appConfig']);
|
||||
serversProvider.saveFromDb(dbData['servers']);
|
||||
|
||||
appConfigProvider.saveFromSharedPreferences();
|
||||
|
||||
PackageInfo appInfo = await PackageInfo.fromPlatform();
|
||||
appConfigProvider.setAppInfo(appInfo);
|
||||
|
||||
|
@ -163,6 +162,31 @@ void main() async {
|
|||
(options) {
|
||||
options.dsn = dotenv.env['SENTRY_DSN'];
|
||||
options.sendDefaultPii = false;
|
||||
options.beforeSend = (event, hint) {
|
||||
if (event.throwable is HttpException) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (event.message?.formatted.contains("HttpException") == true) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (
|
||||
event.message?.formatted.contains("Unexpected character") ?? false ||
|
||||
(event.throwable != null && event.throwable!.toString().contains("Unexpected character"))
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (
|
||||
event.message?.formatted.contains("Unexpected end of input") ?? false ||
|
||||
(event.throwable != null && event.throwable!.toString().contains("Unexpected end of input"))
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return event;
|
||||
};
|
||||
},
|
||||
appRunner: () => startApp()
|
||||
);
|
||||
|
@ -172,78 +196,53 @@ void main() async {
|
|||
}
|
||||
}
|
||||
|
||||
class Main extends StatefulWidget {
|
||||
class Main extends StatelessWidget {
|
||||
const Main({super.key});
|
||||
|
||||
@override
|
||||
State<Main> createState() => _MainState();
|
||||
}
|
||||
|
||||
class _MainState extends State<Main> {
|
||||
List<DisplayMode> modes = <DisplayMode>[];
|
||||
DisplayMode? active;
|
||||
DisplayMode? preferred;
|
||||
|
||||
Future<void> displayMode() async {
|
||||
try {
|
||||
modes = await FlutterDisplayMode.supported;
|
||||
preferred = await FlutterDisplayMode.preferred;
|
||||
active = await FlutterDisplayMode.active;
|
||||
await FlutterDisplayMode.setHighRefreshRate();
|
||||
setState(() {});
|
||||
} catch (_) {
|
||||
// ---- //
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
displayMode();
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
||||
|
||||
return DynamicColorBuilder(
|
||||
builder: (lightDynamic, darkDynamic) => MaterialApp(
|
||||
title: 'AdGuard Home Manager',
|
||||
theme: appConfigProvider.androidDeviceInfo != null && appConfigProvider.androidDeviceInfo!.version.sdkInt >= 31
|
||||
? appConfigProvider.useDynamicColor == true
|
||||
? lightTheme(lightDynamic)
|
||||
: lightThemeOldVersions(colors[appConfigProvider.staticColor])
|
||||
: lightThemeOldVersions(colors[appConfigProvider.staticColor]),
|
||||
darkTheme: appConfigProvider.androidDeviceInfo != null && appConfigProvider.androidDeviceInfo!.version.sdkInt >= 31
|
||||
? appConfigProvider.useDynamicColor == true
|
||||
? darkTheme(darkDynamic)
|
||||
: darkThemeOldVersions(colors[appConfigProvider.staticColor])
|
||||
: darkThemeOldVersions(colors[appConfigProvider.staticColor]),
|
||||
themeMode: appConfigProvider.selectedTheme,
|
||||
debugShowCheckedModeBanner: false,
|
||||
localizationsDelegates: const [
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
AppLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: const [
|
||||
Locale('en', ''),
|
||||
Locale('es', ''),
|
||||
Locale('zh', ''),
|
||||
Locale('zh', 'CN'),
|
||||
Locale('pl', ''),
|
||||
Locale('tr', ''),
|
||||
Locale('ru', '')
|
||||
],
|
||||
scaffoldMessengerKey: scaffoldMessengerKey,
|
||||
navigatorKey: globalNavigatorKey,
|
||||
builder: (context, child) => CustomMenuBar(
|
||||
child: child!,
|
||||
),
|
||||
home: const Layout(),
|
||||
),
|
||||
builder: (lightDynamic, darkDynamic) {
|
||||
appConfigProvider.setSupportsDynamicTheme(lightDynamic != null && darkDynamic != null);
|
||||
return MaterialApp(
|
||||
title: 'AdGuard Home Manager',
|
||||
theme: lightDynamic != null
|
||||
? appConfigProvider.useDynamicColor == true
|
||||
? lightTheme(lightDynamic)
|
||||
: lightThemeOldVersions(colors[appConfigProvider.staticColor])
|
||||
: lightThemeOldVersions(colors[appConfigProvider.staticColor]),
|
||||
darkTheme: darkDynamic != null
|
||||
? appConfigProvider.useDynamicColor == true
|
||||
? darkTheme(darkDynamic)
|
||||
: darkThemeOldVersions(colors[appConfigProvider.staticColor])
|
||||
: darkThemeOldVersions(colors[appConfigProvider.staticColor]),
|
||||
themeMode: appConfigProvider.selectedTheme,
|
||||
debugShowCheckedModeBanner: false,
|
||||
localizationsDelegates: const [
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
AppLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: const [
|
||||
Locale('en', ''),
|
||||
Locale('es', ''),
|
||||
Locale('zh', ''),
|
||||
Locale('zh', 'CN'),
|
||||
Locale('pl', ''),
|
||||
Locale('tr', ''),
|
||||
Locale('ru', '')
|
||||
],
|
||||
scaffoldMessengerKey: scaffoldMessengerKey,
|
||||
navigatorKey: globalNavigatorKey,
|
||||
builder: (context, child) => CustomMenuBar(
|
||||
child: child!,
|
||||
),
|
||||
home: const Layout(),
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
class AppliedFiters {
|
||||
String selectedResultStatus = 'all';
|
||||
String? searchText;
|
||||
List<String>? clients;
|
||||
List<String> clients;
|
||||
|
||||
AppliedFiters({
|
||||
required this.selectedResultStatus,
|
||||
|
|
|
@ -130,7 +130,9 @@ class Client {
|
|||
ignoreStatistics: json["ignore_statistics"],
|
||||
upstreamsCacheEnabled: json["upstreams_cache_enabled"],
|
||||
upstreamsCacheSize: json["upstreams_cache_size"],
|
||||
blockedServicesSchedule: BlockedServicesSchedule.fromJson(json["blocked_services_schedule"])
|
||||
blockedServicesSchedule: json["blocked_services_schedule"] != null
|
||||
? BlockedServicesSchedule.fromJson(json["blocked_services_schedule"])
|
||||
: null
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
|
|
@ -23,6 +23,10 @@ class DnsInfo {
|
|||
String blockingIpv6;
|
||||
List<String> defaultLocalPtrUpstreams;
|
||||
int? blockedResponseTtl;
|
||||
int? ratelimitSubnetLenIpv4;
|
||||
int? ratelimitSubnetLenIpv6;
|
||||
List<String>? ratelimitWhitelist;
|
||||
int? upstreamTimeout;
|
||||
|
||||
DnsInfo({
|
||||
required this.upstreamDns,
|
||||
|
@ -49,6 +53,10 @@ class DnsInfo {
|
|||
required this.blockingIpv6,
|
||||
required this.defaultLocalPtrUpstreams,
|
||||
required this.blockedResponseTtl,
|
||||
required this.ratelimitSubnetLenIpv4,
|
||||
required this.ratelimitSubnetLenIpv6,
|
||||
required this.ratelimitWhitelist,
|
||||
required this.upstreamTimeout,
|
||||
});
|
||||
|
||||
factory DnsInfo.fromJson(Map<String, dynamic> json) => DnsInfo(
|
||||
|
@ -75,7 +83,11 @@ class DnsInfo {
|
|||
blockingIpv4: json["blocking_ipv4"],
|
||||
blockingIpv6: json["blocking_ipv6"],
|
||||
defaultLocalPtrUpstreams: json["default_local_ptr_upstreams"] != null ? List<String>.from(json["default_local_ptr_upstreams"].map((x) => x)) : [],
|
||||
blockedResponseTtl: json["blocked_response_ttl"]
|
||||
blockedResponseTtl: json["blocked_response_ttl"],
|
||||
ratelimitSubnetLenIpv4: json["ratelimit_subnet_len_ipv4"],
|
||||
ratelimitSubnetLenIpv6: json["ratelimit_subnet_len_ipv6"],
|
||||
ratelimitWhitelist: json["ratelimit_whitelist"] != null ? List<String>.from(json["ratelimit_whitelist"].map((x) => x)) : [],
|
||||
upstreamTimeout: json["upstream_timeout"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
@ -102,6 +114,10 @@ class DnsInfo {
|
|||
"blocking_ipv4": blockingIpv4,
|
||||
"blocking_ipv6": blockingIpv6,
|
||||
"default_local_ptr_upstreams": List<dynamic>.from(defaultLocalPtrUpstreams.map((x) => x)),
|
||||
"blocked_response_ttl": blockedResponseTtl
|
||||
"blocked_response_ttl": blockedResponseTtl,
|
||||
"ratelimit_subnet_len_ipv4": ratelimitSubnetLenIpv4,
|
||||
"ratelimit_subnet_len_ipv6": ratelimitSubnetLenIpv6,
|
||||
"ratelimit_whitelist": ratelimitWhitelist != null ? List<String>.from(ratelimitWhitelist!.map((x) => x)) : null,
|
||||
"upstream_timeout": upstreamTimeout,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ DnsStatistics dnsStatisticsFromJson(String str) => DnsStatistics.fromJson(json.d
|
|||
String dnsStatisticsToJson(DnsStatistics data) => json.encode(data.toJson());
|
||||
|
||||
class DnsStatistics {
|
||||
final String timeUnits;
|
||||
final String? timeUnits;
|
||||
final List<Map<String, int>> topQueriedDomains;
|
||||
final List<Map<String, int>> topClients;
|
||||
final List<Map<String, int>> topBlockedDomains;
|
||||
|
@ -43,9 +43,9 @@ class DnsStatistics {
|
|||
|
||||
factory DnsStatistics.fromJson(Map<String, dynamic> json) => DnsStatistics(
|
||||
timeUnits: json["time_units"],
|
||||
topQueriedDomains: List<Map<String, int>>.from(json["top_queried_domains"].map((x) => Map.from(x).map((k, v) => MapEntry<String, int>(k, v)))),
|
||||
topClients: List<Map<String, int>>.from(json["top_clients"].map((x) => Map.from(x).map((k, v) => MapEntry<String, int>(k, v)))),
|
||||
topBlockedDomains: List<Map<String, int>>.from(json["top_blocked_domains"].map((x) => Map.from(x).map((k, v) => MapEntry<String, int>(k, v)))),
|
||||
topQueriedDomains: json["top_queried_domains"] != null ? List<Map<String, int>>.from(json["top_queried_domains"].map((x) => Map.from(x).map((k, v) => MapEntry<String, int>(k, v)))) : [],
|
||||
topClients: json["top_clients"] != null ? List<Map<String, int>>.from(json["top_clients"].map((x) => Map.from(x).map((k, v) => MapEntry<String, int>(k, v)))) : [],
|
||||
topBlockedDomains: json["top_blocked_domains"] != null ? List<Map<String, int>>.from(json["top_blocked_domains"].map((x) => Map.from(x).map((k, v) => MapEntry<String, int>(k, v)))): [],
|
||||
topUpstreamResponses: json["top_upstreams_responses"] != null ? List<Map<String, int>>.from(json["top_upstreams_responses"].map((x) => Map.from(x).map((k, v) => MapEntry<String, int>(k, v)))) : null,
|
||||
topUpstreamsAvgTime: json["top_upstreams_avg_time"] != null ? List<Map<String, double>>.from(json["top_upstreams_avg_time"].map((x) => Map.from(x).map((k, v) => MapEntry<String, double>(k, v)))) : null,
|
||||
dnsQueries: List<int>.from(json["dns_queries"].map((x) => x)),
|
||||
|
|
|
@ -39,6 +39,7 @@ class EncryptionData {
|
|||
final String certificatePath;
|
||||
final String privateKeyPath;
|
||||
final bool privateKeySaved;
|
||||
final bool? servePlainDns;
|
||||
|
||||
EncryptionData({
|
||||
required this.validCert,
|
||||
|
@ -65,6 +66,7 @@ class EncryptionData {
|
|||
required this.certificatePath,
|
||||
required this.privateKeyPath,
|
||||
required this.privateKeySaved,
|
||||
required this.servePlainDns,
|
||||
});
|
||||
|
||||
|
||||
|
@ -93,6 +95,7 @@ class EncryptionData {
|
|||
certificatePath: json["certificate_path"],
|
||||
privateKeyPath: json["private_key_path"],
|
||||
privateKeySaved: json["private_key_saved"],
|
||||
servePlainDns: json["serve_plain_dns"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
@ -120,6 +123,7 @@ class EncryptionData {
|
|||
"certificate_path": certificatePath,
|
||||
"private_key_path": privateKeyPath,
|
||||
"private_key_saved": privateKeySaved,
|
||||
"serve_plain_dns": servePlainDns,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ class Filter {
|
|||
Map<String, dynamic> toJson() => {
|
||||
"url": url,
|
||||
"name": name,
|
||||
"last_updated": lastUpdated != null ? lastUpdated!.toIso8601String() : null,
|
||||
"last_updated": lastUpdated?.toIso8601String(),
|
||||
"id": id,
|
||||
"rules_count": rulesCount,
|
||||
"enabled": enabled,
|
||||
|
|
|
@ -65,7 +65,7 @@ class Filter {
|
|||
Map<String, dynamic> toJson() => {
|
||||
"url": url,
|
||||
"name": name,
|
||||
"last_updated": lastUpdated != null ? lastUpdated!.toIso8601String() : null,
|
||||
"last_updated": lastUpdated?.toIso8601String(),
|
||||
"id": id,
|
||||
"rules_count": rulesCount,
|
||||
"enabled": enabled,
|
||||
|
|
|
@ -30,7 +30,7 @@ class LogsData {
|
|||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"data": List<dynamic>.from(data.map((x) => x.toJson())),
|
||||
"oldest": oldest != null ? oldest!.toIso8601String() : null,
|
||||
"oldest": oldest?.toIso8601String(),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -66,6 +66,6 @@ class ServerStatus {
|
|||
safeSearchPixabay: json['safeSearch']['pixabay'],
|
||||
safeSearchYandex: json['safeSearch']['yandex'],
|
||||
safeSearchYoutube: json['safeSearch']['youtube'],
|
||||
dhcpAvailable: json['status']['dhcp_available']
|
||||
dhcpAvailable: json['status']['dhcp_available'] ?? false
|
||||
);
|
||||
}
|
|
@ -1,22 +1,22 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
import 'package:store_checker/store_checker.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:sqflite/sqlite_api.dart';
|
||||
|
||||
import 'package:adguard_home_manager/constants/enums.dart';
|
||||
import 'package:adguard_home_manager/config/home_top_items_default_order.dart';
|
||||
import 'package:adguard_home_manager/models/github_release.dart';
|
||||
import 'package:adguard_home_manager/services/db/queries.dart';
|
||||
import 'package:adguard_home_manager/functions/conversions.dart';
|
||||
import 'package:adguard_home_manager/models/app_log.dart';
|
||||
|
||||
class AppConfigProvider with ChangeNotifier {
|
||||
Database? _dbInstance;
|
||||
final SharedPreferences sharedPreferencesInstance;
|
||||
|
||||
AppConfigProvider({
|
||||
required this.sharedPreferencesInstance
|
||||
});
|
||||
|
||||
PackageInfo? _appInfo;
|
||||
AndroidDeviceInfo? _androidDeviceInfo;
|
||||
|
@ -28,36 +28,35 @@ class AppConfigProvider with ChangeNotifier {
|
|||
|
||||
bool _showingSnackbar = false;
|
||||
|
||||
bool _supportsDynamicTheme = true;
|
||||
int _selectedTheme = 0;
|
||||
bool _useDynamicColor = true;
|
||||
int _staticColor = 0;
|
||||
bool _useThemeColorForStatus = false;
|
||||
final bool _useThemeColorForStatus = false;
|
||||
|
||||
int _selectedClientsTab = 0;
|
||||
int _selectedFiltersTab = 0;
|
||||
|
||||
List<HomeTopItems> _homeTopItemsOrder = homeTopItemsDefaultOrder;
|
||||
|
||||
int _hideServerAddress = 0;
|
||||
bool _hideServerAddress = false;
|
||||
|
||||
final List<AppLog> _logs = [];
|
||||
|
||||
int _overrideSslCheck = 0;
|
||||
bool _overrideSslCheck = false;
|
||||
|
||||
int _hideZeroValues = 0;
|
||||
bool _hideZeroValues = false;
|
||||
|
||||
int _showTimeLogs = 0;
|
||||
bool _showTimeLogs = false;
|
||||
|
||||
int _showIpLogs = 0;
|
||||
bool _showIpLogs = false;
|
||||
|
||||
int _combinedChartHome = 0;
|
||||
bool _combinedChartHome = false;
|
||||
|
||||
String? _doNotRememberVersion;
|
||||
|
||||
GitHubRelease? _appUpdatesAvailable;
|
||||
|
||||
Source _installationSource = Source.UNKNOWN;
|
||||
|
||||
PackageInfo? get getAppInfo {
|
||||
return _appInfo;
|
||||
}
|
||||
|
@ -88,6 +87,10 @@ class AppConfigProvider with ChangeNotifier {
|
|||
}
|
||||
}
|
||||
|
||||
bool get supportsDynamicTheme {
|
||||
return _supportsDynamicTheme;
|
||||
}
|
||||
|
||||
int get selectedThemeNumber {
|
||||
return _selectedTheme;
|
||||
}
|
||||
|
@ -105,11 +108,11 @@ class AppConfigProvider with ChangeNotifier {
|
|||
}
|
||||
|
||||
bool get overrideSslCheck {
|
||||
return _overrideSslCheck == 1 ? true : false;
|
||||
return _overrideSslCheck;
|
||||
}
|
||||
|
||||
bool get hideZeroValues {
|
||||
return _hideZeroValues == 1 ? true : false;
|
||||
return _hideZeroValues;
|
||||
}
|
||||
|
||||
int get selectedScreen {
|
||||
|
@ -133,15 +136,15 @@ class AppConfigProvider with ChangeNotifier {
|
|||
}
|
||||
|
||||
bool get showTimeLogs {
|
||||
return _showTimeLogs == 1 ? true : false;
|
||||
return _showTimeLogs;
|
||||
}
|
||||
|
||||
bool get showIpLogs {
|
||||
return _showIpLogs == 1 ? true : false;
|
||||
return _showIpLogs;
|
||||
}
|
||||
|
||||
bool get combinedChartHome {
|
||||
return _combinedChartHome == 1 ? true : false;
|
||||
return _combinedChartHome;
|
||||
}
|
||||
|
||||
String? get doNotRememberVersion {
|
||||
|
@ -156,20 +159,16 @@ class AppConfigProvider with ChangeNotifier {
|
|||
return _appUpdatesAvailable;
|
||||
}
|
||||
|
||||
Source get installationSource {
|
||||
return _installationSource;
|
||||
}
|
||||
|
||||
List<HomeTopItems> get homeTopItemsOrder {
|
||||
return _homeTopItemsOrder;
|
||||
}
|
||||
|
||||
bool get hideServerAddress {
|
||||
return _hideServerAddress == 1 ? true : false;
|
||||
return _hideServerAddress;
|
||||
}
|
||||
|
||||
void setDbInstance(Database db) {
|
||||
_dbInstance = db;
|
||||
void setSupportsDynamicTheme(bool value) {
|
||||
_supportsDynamicTheme = value;
|
||||
}
|
||||
|
||||
void setAppInfo(PackageInfo appInfo) {
|
||||
|
@ -221,212 +220,146 @@ class AppConfigProvider with ChangeNotifier {
|
|||
notifyListeners();
|
||||
}
|
||||
|
||||
void setInstallationSource(Source value) {
|
||||
_installationSource = value;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<bool> setOverrideSslCheck(bool status) async {
|
||||
final updated = await updateConfigQuery(
|
||||
db: _dbInstance!,
|
||||
column: 'overrideSslCheck',
|
||||
value: status == true ? 1 : 0
|
||||
);
|
||||
if (updated == true) {
|
||||
_overrideSslCheck = status == true ? 1 : 0;
|
||||
try {
|
||||
sharedPreferencesInstance.setBool('overrideSslCheck', status);
|
||||
_overrideSslCheck = status;
|
||||
notifyListeners();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} catch (e, stackTrace) {
|
||||
Sentry.captureException(e, stackTrace: stackTrace);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> setHideZeroValues(bool status) async {
|
||||
final updated = await updateConfigQuery(
|
||||
db: _dbInstance!,
|
||||
column: 'hideZeroValues',
|
||||
value: status == true ? 1 : 0
|
||||
);
|
||||
if (updated == true) {
|
||||
_hideZeroValues = status == true ? 1 : 0;
|
||||
try {
|
||||
sharedPreferencesInstance.setBool('hideZeroValues', status);
|
||||
_hideZeroValues = status;
|
||||
notifyListeners();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} catch (e, stackTrace) {
|
||||
Sentry.captureException(e, stackTrace: stackTrace);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> setshowTimeLogs(bool status) async {
|
||||
final updated = await updateConfigQuery(
|
||||
db: _dbInstance!,
|
||||
column: 'showTimeLogs',
|
||||
value: status == true ? 1 : 0
|
||||
);
|
||||
if (updated == true) {
|
||||
_showTimeLogs = status == true ? 1 : 0;
|
||||
try {
|
||||
sharedPreferencesInstance.setBool('showTimeLogs', status);
|
||||
_showTimeLogs = status;
|
||||
notifyListeners();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} catch (e, stackTrace) {
|
||||
Sentry.captureException(e, stackTrace: stackTrace);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> setShowIpLogs(bool status) async {
|
||||
final updated = await updateConfigQuery(
|
||||
db: _dbInstance!,
|
||||
column: 'showIpLogs',
|
||||
value: status == true ? 1 : 0
|
||||
);
|
||||
if (updated == true) {
|
||||
_showIpLogs = status == true ? 1 : 0;
|
||||
try {
|
||||
sharedPreferencesInstance.setBool('showIpLogs', status);
|
||||
_showIpLogs = status;
|
||||
notifyListeners();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} catch (e, stackTrace) {
|
||||
Sentry.captureException(e, stackTrace: stackTrace);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> setSelectedTheme(int value) async {
|
||||
final updated = await updateConfigQuery(
|
||||
db: _dbInstance!,
|
||||
column: 'theme',
|
||||
value: value
|
||||
);
|
||||
if (updated == true) {
|
||||
try {
|
||||
sharedPreferencesInstance.setInt('selectedTheme', value);
|
||||
_selectedTheme = value;
|
||||
notifyListeners();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} catch (e, stackTrace) {
|
||||
Sentry.captureException(e, stackTrace: stackTrace);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> setUseDynamicColor(bool value) async {
|
||||
final updated = await updateConfigQuery(
|
||||
db: _dbInstance!,
|
||||
column: 'useDynamicColor',
|
||||
value: value == true ? 1 : 0
|
||||
);
|
||||
if (updated == true) {
|
||||
try {
|
||||
sharedPreferencesInstance.setBool('useDynamicColor', value);
|
||||
_useDynamicColor = value;
|
||||
notifyListeners();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> setUseThemeColorForStatus(bool value) async {
|
||||
final updated = await updateConfigQuery(
|
||||
db: _dbInstance!,
|
||||
column: 'useThemeColorForStatus',
|
||||
value: value == true ? 1 : 0
|
||||
);
|
||||
if (updated == true) {
|
||||
_useThemeColorForStatus = value;
|
||||
notifyListeners();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} catch (e, stackTrace) {
|
||||
Sentry.captureException(e, stackTrace: stackTrace);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> setCombinedChartHome(bool value) async {
|
||||
final updated = await updateConfigQuery(
|
||||
db: _dbInstance!,
|
||||
column: 'combinedChart',
|
||||
value: value == true ? 1 : 0
|
||||
);
|
||||
if (updated == true) {
|
||||
_combinedChartHome = value == true ? 1 : 0;
|
||||
try {
|
||||
sharedPreferencesInstance.setBool('combinedChart', value);
|
||||
_combinedChartHome = value;
|
||||
notifyListeners();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} catch (e, stackTrace) {
|
||||
Sentry.captureException(e, stackTrace: stackTrace);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> setStaticColor(int value) async {
|
||||
final updated = await updateConfigQuery(
|
||||
db: _dbInstance!,
|
||||
column: 'staticColor',
|
||||
value: value
|
||||
);
|
||||
if (updated == true) {
|
||||
try {
|
||||
sharedPreferencesInstance.setInt('staticColor', value);
|
||||
_staticColor = value;
|
||||
notifyListeners();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} catch (e, stackTrace) {
|
||||
Sentry.captureException(e, stackTrace: stackTrace);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> setHomeTopItemsOrder(List<HomeTopItems> order) async {
|
||||
final updated = await updateConfigQuery(
|
||||
db: _dbInstance!,
|
||||
column: 'homeTopItemsOrder',
|
||||
value: jsonEncode(List<String>.from(order.map((e) => e.name)))
|
||||
);
|
||||
if (updated == true) {
|
||||
try {
|
||||
sharedPreferencesInstance.setStringList('homeTopItemsOrder', List<String>.from(order.map((e) => e.name)));
|
||||
_homeTopItemsOrder = order;
|
||||
notifyListeners();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} catch (e, stackTrace) {
|
||||
Sentry.captureException(e, stackTrace: stackTrace);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> setHideServerAddress(bool value) async {
|
||||
final updated = await updateConfigQuery(
|
||||
db: _dbInstance!,
|
||||
column: 'hideServerAddress',
|
||||
value: value == true ? 1 : 0
|
||||
);
|
||||
if (updated == true) {
|
||||
_hideServerAddress = value == true ? 1 : 0;
|
||||
try {
|
||||
sharedPreferencesInstance.setBool('hideServerAddress', value);
|
||||
_hideServerAddress = value;
|
||||
notifyListeners();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} catch (e, stackTrace) {
|
||||
Sentry.captureException(e, stackTrace: stackTrace);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> setDoNotRememberVersion(String value) async {
|
||||
final updated = await updateConfigQuery(
|
||||
db: _dbInstance!,
|
||||
column: 'doNotRememberVersion',
|
||||
value: value
|
||||
);
|
||||
final updated = await sharedPreferencesInstance.setString('hideServerAddress', value);
|
||||
return updated;
|
||||
}
|
||||
|
||||
void saveFromDb(Database dbInstance, Map<String, dynamic> dbData) {
|
||||
_selectedTheme = dbData['theme'] ?? 0;
|
||||
_overrideSslCheck = dbData['overrideSslCheck'] ?? 0;
|
||||
_hideZeroValues = dbData['hideZeroValues'];
|
||||
_useDynamicColor = convertFromIntToBool(dbData['useDynamicColor'])!;
|
||||
_staticColor = dbData['staticColor'] ?? 0;
|
||||
_useThemeColorForStatus = dbData['useThemeColorForStatus'] != null ? convertFromIntToBool(dbData['useThemeColorForStatus'])! : false;
|
||||
_showTimeLogs = dbData['showTimeLogs'] ?? 0;
|
||||
_doNotRememberVersion = dbData['doNotRememberVersion'];
|
||||
_showIpLogs = dbData['showIpLogs'] ?? 0;
|
||||
_combinedChartHome = dbData['combinedChart'] ?? 0;
|
||||
_hideServerAddress = dbData['hideServerAddress'];
|
||||
if (dbData['homeTopItemsOrder'] != null) {
|
||||
|
||||
void saveFromSharedPreferences() {
|
||||
_selectedTheme = sharedPreferencesInstance.getInt('selectedTheme') ?? 0;
|
||||
_overrideSslCheck = sharedPreferencesInstance.getBool('overrideSslCheck') ?? false;
|
||||
_hideZeroValues = sharedPreferencesInstance.getBool('hideZeroValues') ?? false;
|
||||
_useDynamicColor = sharedPreferencesInstance.getBool('useDynamicColor') ?? true;
|
||||
_staticColor = sharedPreferencesInstance.getInt('staticColor') ?? 0;
|
||||
_showTimeLogs = sharedPreferencesInstance.getBool('showTimeLogs') ?? false;
|
||||
_doNotRememberVersion = sharedPreferencesInstance.getString('doNotRememberVersion');
|
||||
_showIpLogs = sharedPreferencesInstance.getBool('showIpLogs') ?? false;
|
||||
_combinedChartHome = sharedPreferencesInstance.getBool('combinedChart') ?? false;
|
||||
_hideServerAddress = sharedPreferencesInstance.getBool('hideServerAddress') ?? false;
|
||||
if (sharedPreferencesInstance.getStringList('homeTopItemsOrder') != null) {
|
||||
try {
|
||||
final itemsOrder = List<HomeTopItems>.from(
|
||||
List<String>.from(jsonDecode(dbData['homeTopItemsOrder'])).map((e) {
|
||||
_homeTopItemsOrder = List<HomeTopItems>.from(
|
||||
List<String>.from(sharedPreferencesInstance.getStringList('homeTopItemsOrder')!).map((e) {
|
||||
switch (e) {
|
||||
case 'queriedDomains':
|
||||
return HomeTopItems.queriedDomains;
|
||||
|
@ -448,18 +381,10 @@ class AppConfigProvider with ChangeNotifier {
|
|||
}
|
||||
}).where((e) => e != null).toList()
|
||||
);
|
||||
final missingItems = homeTopItemsDefaultOrder.where((e) => !itemsOrder.contains(e));
|
||||
_homeTopItemsOrder = [
|
||||
...itemsOrder,
|
||||
...missingItems
|
||||
];
|
||||
} catch (e) {
|
||||
Sentry.captureException(e);
|
||||
_homeTopItemsOrder = homeTopItemsDefaultOrder;
|
||||
}
|
||||
}
|
||||
|
||||
_dbInstance = dbInstance;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
|
@ -151,17 +151,26 @@ class DnsProvider with ChangeNotifier {
|
|||
final result = await _serversProvider!.apiClient2!.setDnsConfig(
|
||||
data: value
|
||||
);
|
||||
|
||||
void updateValue(dynamic parameter, dynamic value) {
|
||||
if (value != null) {
|
||||
parameter = value;
|
||||
}
|
||||
}
|
||||
|
||||
if (result.successful == true) {
|
||||
DnsInfo data = dnsInfo!;
|
||||
data.ratelimit = value['ratelimit'];
|
||||
data.ednsCsEnabled = value['edns_cs_enabled'];
|
||||
data.dnssecEnabled = value['dnssec_enabled'];
|
||||
data.disableIpv6 = value['disable_ipv6'];
|
||||
data.blockingMode = value['blocking_mode'];
|
||||
data.blockingIpv4 = value['blocking_ipv4'];
|
||||
data.blockingIpv6 = value['blocking_ipv6'];
|
||||
data.blockedResponseTtl = value['blocked_response_ttl'];
|
||||
updateValue(data.ratelimit, value['ratelimit']);
|
||||
updateValue(data.ednsCsEnabled, value['edns_cs_enabled']);
|
||||
updateValue(data.dnssecEnabled, value['dnssec_enabled']);
|
||||
updateValue(data.disableIpv6, value['disable_ipv6']);
|
||||
updateValue(data.blockingMode, value['blocking_mode']);
|
||||
updateValue(data.blockingIpv4, value['blocking_ipv4']);
|
||||
updateValue(data.blockingIpv6, value['blocking_ipv6']);
|
||||
updateValue(data.blockedResponseTtl, value['blocked_response_ttl']);
|
||||
updateValue(data.ratelimitSubnetLenIpv4, value['ratelimit_subnet_len_ipv4']);
|
||||
updateValue(data.ratelimitSubnetLenIpv6, value['ratelimit_subnet_len_ipv6']);
|
||||
updateValue(data.ratelimitWhitelist, value['ratelimit_whitelist']);
|
||||
setDnsInfoData(data);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -133,7 +133,6 @@ class FilteringProvider with ChangeNotifier {
|
|||
if (result2.successful == true) {
|
||||
_filtering = result2.content as Filtering;
|
||||
notifyListeners();
|
||||
print(result.content);
|
||||
return {
|
||||
"success": true,
|
||||
"data": result.content
|
||||
|
@ -289,6 +288,23 @@ class FilteringProvider with ChangeNotifier {
|
|||
}
|
||||
}
|
||||
|
||||
Future<bool> setCustomRules(List<String> rules) async {
|
||||
final newRules = rules.where((r) => r != " " && r != "").toList();
|
||||
final result = await _serversProvider!.apiClient2!.setCustomRules(rules: newRules);
|
||||
|
||||
if (result.successful == true) {
|
||||
Filtering filteringData = filtering!;
|
||||
filteringData.userRules = newRules;
|
||||
_filtering = filteringData;
|
||||
notifyListeners();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
notifyListeners();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> addList({required String name, required String url, required String type}) async {
|
||||
final result1 = await _serversProvider!.apiClient2!.addFilteringList(
|
||||
data: {
|
||||
|
|
51
lib/providers/live_logs_provider.dart
Normal file
51
lib/providers/live_logs_provider.dart
Normal file
|
@ -0,0 +1,51 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'package:adguard_home_manager/models/logs.dart';
|
||||
import 'package:adguard_home_manager/providers/servers_provider.dart';
|
||||
|
||||
class LiveLogsProvider with ChangeNotifier {
|
||||
ServersProvider? _serversProvider;
|
||||
|
||||
update(ServersProvider? provider) {
|
||||
_serversProvider = provider;
|
||||
}
|
||||
|
||||
bool _isDisposed = false;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_isDisposed = true;
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
List<Log> _logs = [];
|
||||
|
||||
List<Log> get logs {
|
||||
return _logs;
|
||||
}
|
||||
|
||||
DateTime? _lastTime;
|
||||
|
||||
void startFetchLogs() {
|
||||
_lastTime = DateTime.now();
|
||||
_fetchLogs();
|
||||
}
|
||||
|
||||
void _fetchLogs() async {
|
||||
if (_lastTime == null) return;
|
||||
final result = await _serversProvider!.apiClient2!.getLogs(
|
||||
count: 100
|
||||
);
|
||||
if (result.successful == false || result.content == null) return;
|
||||
final valid = (result.content as LogsData).data.where((e) => e.time.isAfter(_lastTime!));
|
||||
_logs = [...valid, ..._logs];
|
||||
_lastTime = DateTime.now();
|
||||
notifyListeners();
|
||||
|
||||
await Future.delayed(const Duration(seconds: 2));
|
||||
if (_isDisposed == true) return;
|
||||
_fetchLogs();
|
||||
}
|
||||
}
|
|
@ -30,7 +30,7 @@ class LogsProvider with ChangeNotifier {
|
|||
AppliedFiters _appliedFilters = AppliedFiters(
|
||||
selectedResultStatus: 'all',
|
||||
searchText: null,
|
||||
clients: null
|
||||
clients: []
|
||||
);
|
||||
|
||||
LoadStatus get loadStatus {
|
||||
|
@ -177,18 +177,18 @@ class LogsProvider with ChangeNotifier {
|
|||
if (loadingMore != null && loadingMore == true && logsData != null) {
|
||||
LogsData newLogsData = result.content;
|
||||
newLogsData.data = [...logsData!.data, ...(result.content as LogsData).data];
|
||||
if (appliedFilters.clients != null) {
|
||||
if (appliedFilters.clients.isNotEmpty) {
|
||||
newLogsData.data = newLogsData.data.where(
|
||||
(item) => appliedFilters.clients!.contains(item.client)
|
||||
(item) => appliedFilters.clients.contains(item.client)
|
||||
).toList();
|
||||
}
|
||||
_logsData = newLogsData;
|
||||
}
|
||||
else {
|
||||
LogsData newLogsData = result.content;
|
||||
if (appliedFilters.clients != null) {
|
||||
if (appliedFilters.clients.isNotEmpty) {
|
||||
newLogsData.data = newLogsData.data.where(
|
||||
(item) => appliedFilters.clients!.contains(item.client)
|
||||
(item) => appliedFilters.clients.contains(item.client)
|
||||
).toList();
|
||||
}
|
||||
_logsData = newLogsData;
|
||||
|
@ -217,7 +217,7 @@ class LogsProvider with ChangeNotifier {
|
|||
_appliedFilters = AppliedFiters(
|
||||
selectedResultStatus: 'all',
|
||||
searchText: null,
|
||||
clients: null
|
||||
clients: []
|
||||
);
|
||||
|
||||
if (result.successful == true) {
|
||||
|
@ -254,9 +254,9 @@ class LogsProvider with ChangeNotifier {
|
|||
|
||||
if (result.successful == true) {
|
||||
LogsData newLogsData = result.content as LogsData;
|
||||
if (appliedFilters.clients != null) {
|
||||
if (appliedFilters.clients.isNotEmpty) {
|
||||
newLogsData.data = newLogsData.data.where(
|
||||
(item) => appliedFilters.clients!.contains(item.client)
|
||||
(item) => appliedFilters.clients.contains(item.client)
|
||||
).toList();
|
||||
}
|
||||
_logsData = newLogsData;
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:animations/animations.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_split_view/flutter_split_view.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/clients/clients.dart';
|
||||
import 'package:adguard_home_manager/screens/clients/client/client_screen_functions.dart';
|
||||
import 'package:adguard_home_manager/screens/clients/client/added_client_tile.dart';
|
||||
import 'package:adguard_home_manager/screens/clients/client/remove_client_modal.dart';
|
||||
|
@ -82,14 +82,14 @@ class _AddedListState extends State<AddedList> {
|
|||
processModal.close();
|
||||
|
||||
if (result == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientUpdatedSuccessfully,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientNotUpdated,
|
||||
color: Colors.red
|
||||
|
@ -107,16 +107,16 @@ class _AddedListState extends State<AddedList> {
|
|||
|
||||
if (result == true) {
|
||||
if (widget.splitView == true) {
|
||||
SplitView.of(context).popUntil(0);
|
||||
Navigator.of(clientsNavigatorKey.currentContext!).popUntil((route) => false);
|
||||
}
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientDeletedSuccessfully,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientNotDeleted,
|
||||
color: Colors.red
|
||||
|
|
|
@ -81,7 +81,7 @@ class _AddedClientTileState extends State<AddedClientTile> {
|
|||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
widget.client.ids.toString().replaceAll(RegExp(r'^\[|\]$'), ''),
|
||||
widget.client.name,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400,
|
||||
|
@ -89,6 +89,15 @@ class _AddedClientTileState extends State<AddedClientTile> {
|
|||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
widget.client.ids.toString().replaceAll(RegExp(r'^\[|\]$'), ''),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class ClientPlaceholder extends StatelessWidget {
|
||||
const ClientPlaceholder({Key? key}) : super(key: key);
|
||||
const ClientPlaceholder({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
return const Center(
|
||||
child: Text("Select a client"),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -10,6 +10,16 @@ import 'package:adguard_home_manager/models/safe_search.dart';
|
|||
import 'package:adguard_home_manager/providers/clients_provider.dart';
|
||||
import 'package:adguard_home_manager/models/clients.dart';
|
||||
|
||||
class ClientInitialData {
|
||||
final String name;
|
||||
final String ip;
|
||||
|
||||
const ClientInitialData({
|
||||
required this.name,
|
||||
required this.ip,
|
||||
});
|
||||
}
|
||||
|
||||
class ControllerListItem {
|
||||
final String id;
|
||||
final TextEditingController controller;
|
||||
|
@ -25,13 +35,15 @@ class ClientScreen extends StatefulWidget {
|
|||
final void Function(Client) onConfirm;
|
||||
final void Function(Client)? onDelete;
|
||||
final bool fullScreen;
|
||||
final ClientInitialData? initialData;
|
||||
|
||||
const ClientScreen({
|
||||
super.key,
|
||||
this.client,
|
||||
required this.onConfirm,
|
||||
this.onDelete,
|
||||
required this.fullScreen
|
||||
required this.fullScreen,
|
||||
this.initialData,
|
||||
});
|
||||
|
||||
@override
|
||||
|
@ -146,6 +158,13 @@ class _ClientScreenState extends State<ClientScreen> {
|
|||
_blockedServicesSchedule = widget.client!.blockedServicesSchedule!;
|
||||
}
|
||||
}
|
||||
if (widget.initialData != null) {
|
||||
nameController.text = widget.initialData!.name;
|
||||
identifiersControllers[0] = ControllerListItem(
|
||||
id: uuid.v4(),
|
||||
controller: TextEditingController(text: widget.initialData!.ip)
|
||||
);
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
@ -216,71 +235,90 @@ class _ClientScreenState extends State<ClientScreen> {
|
|||
|
||||
|
||||
if (widget.fullScreen == true) {
|
||||
return Dialog.fullscreen(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: IconButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
icon: const Icon(Icons.close)
|
||||
),
|
||||
title: Text(
|
||||
widget.client != null
|
||||
? AppLocalizations.of(context)!.client
|
||||
: AppLocalizations.of(context)!.addClient
|
||||
),
|
||||
actions: actions(),
|
||||
),
|
||||
return Material(
|
||||
child: NestedScrollView(
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||
SliverOverlapAbsorber(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
sliver: SliverAppBar.large(
|
||||
pinned: true,
|
||||
floating: true,
|
||||
centerTitle: false,
|
||||
forceElevated: innerBoxIsScrolled,
|
||||
leading: IconButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
icon: const Icon(Icons.close)
|
||||
),
|
||||
title: Text(
|
||||
widget.client != null
|
||||
? AppLocalizations.of(context)!.client
|
||||
: AppLocalizations.of(context)!.addClient
|
||||
),
|
||||
actions: actions(),
|
||||
)
|
||||
)
|
||||
],
|
||||
body: SafeArea(
|
||||
child: ListView(
|
||||
controller: _scrollController,
|
||||
children: [
|
||||
if (!_nameValid || !_identifiersValid || !_dnsCacheValid) _Errors(
|
||||
nameValid: _nameValid,
|
||||
identifiersValid: _identifiersValid,
|
||||
dnsCacheValid: _dnsCacheValid
|
||||
),
|
||||
ClientForm(
|
||||
isFullScreen: true,
|
||||
client: widget.client,
|
||||
nameController: nameController,
|
||||
identifiersControllers: identifiersControllers,
|
||||
selectedTags: selectedTags,
|
||||
useGlobalSettingsFiltering: useGlobalSettingsFiltering,
|
||||
enableFiltering: enableFiltering,
|
||||
enableParentalControl: enableParentalControl,
|
||||
enableSafeBrowsing: enableSafeBrowsing,
|
||||
enableSafeSearch: enableSafeSearch,
|
||||
safeSearch: safeSearch,
|
||||
blockedServices: blockedServices,
|
||||
updateBlockedServices: (v) => setState(() => blockedServices = v),
|
||||
upstreamServers: upstreamServers,
|
||||
updateUpstreamServers: (v) => setState(() => upstreamServers = v),
|
||||
defaultSafeSearch: defaultSafeSearch,
|
||||
useGlobalSettingsServices: useGlobalSettingsServices,
|
||||
updateSelectedTags: (v) => setState(() => selectedTags = v),
|
||||
updateIdentifiersControllers: (v) => setState(() => identifiersControllers = v),
|
||||
enableDisableGlobalSettingsFiltering: enableDisableGlobalSettingsFiltering,
|
||||
updateEnableFiltering: (v) => setState(() => enableFiltering = v),
|
||||
updateEnableParentalControl: (v) => setState(() => enableParentalControl = v),
|
||||
updateEnableSafeBrowsing: (v) => setState(() => enableSafeBrowsing = v),
|
||||
updateEnableSafeSearch: (v) => setState(() => enableSafeSearch = v),
|
||||
updateSafeSearch: (v) => setState(() => safeSearch = v),
|
||||
updateUseGlobalSettingsServices: (v) => setState(() => useGlobalSettingsServices = v),
|
||||
ignoreClientQueryLog: _ignoreClientQueryLog,
|
||||
ignoreClientStatistics: _ignoreClientStatistics,
|
||||
updateIgnoreClientQueryLog: (v) => setState(() => _ignoreClientQueryLog = v),
|
||||
updateIgnoreClientStatistics: (v) => setState(() => _ignoreClientStatistics = v),
|
||||
enableDnsCache: _enableDnsCache,
|
||||
updateEnableDnsCache: (v) => setState(() => _enableDnsCache = v),
|
||||
dnsCacheField: _dnsCacheField,
|
||||
dnsCacheError: _dnsCacheError,
|
||||
updateDnsCacheError: (v) => setState(() => _dnsCacheError = v),
|
||||
blockedServicesSchedule: _blockedServicesSchedule,
|
||||
setBlockedServicesSchedule: (v) => setState(() => _blockedServicesSchedule = v),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Builder(
|
||||
builder: (context) => CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
SliverList.list(
|
||||
children: [
|
||||
if (!_nameValid || !_identifiersValid || !_dnsCacheValid) _Errors(
|
||||
nameValid: _nameValid,
|
||||
identifiersValid: _identifiersValid,
|
||||
dnsCacheValid: _dnsCacheValid
|
||||
),
|
||||
ClientForm(
|
||||
isFullScreen: true,
|
||||
client: widget.client,
|
||||
nameController: nameController,
|
||||
identifiersControllers: identifiersControllers,
|
||||
selectedTags: selectedTags,
|
||||
useGlobalSettingsFiltering: useGlobalSettingsFiltering,
|
||||
enableFiltering: enableFiltering,
|
||||
enableParentalControl: enableParentalControl,
|
||||
enableSafeBrowsing: enableSafeBrowsing,
|
||||
enableSafeSearch: enableSafeSearch,
|
||||
safeSearch: safeSearch,
|
||||
blockedServices: blockedServices,
|
||||
updateBlockedServices: (v) => setState(() => blockedServices = v),
|
||||
upstreamServers: upstreamServers,
|
||||
updateUpstreamServers: (v) => setState(() => upstreamServers = v),
|
||||
defaultSafeSearch: defaultSafeSearch,
|
||||
useGlobalSettingsServices: useGlobalSettingsServices,
|
||||
updateSelectedTags: (v) => setState(() => selectedTags = v),
|
||||
updateIdentifiersControllers: (v) => setState(() => identifiersControllers = v),
|
||||
enableDisableGlobalSettingsFiltering: enableDisableGlobalSettingsFiltering,
|
||||
updateEnableFiltering: (v) => setState(() => enableFiltering = v),
|
||||
updateEnableParentalControl: (v) => setState(() => enableParentalControl = v),
|
||||
updateEnableSafeBrowsing: (v) => setState(() => enableSafeBrowsing = v),
|
||||
updateEnableSafeSearch: (v) => setState(() => enableSafeSearch = v),
|
||||
updateSafeSearch: (v) => setState(() => safeSearch = v),
|
||||
updateUseGlobalSettingsServices: (v) => setState(() => useGlobalSettingsServices = v),
|
||||
ignoreClientQueryLog: _ignoreClientQueryLog,
|
||||
ignoreClientStatistics: _ignoreClientStatistics,
|
||||
updateIgnoreClientQueryLog: (v) => setState(() => _ignoreClientQueryLog = v),
|
||||
updateIgnoreClientStatistics: (v) => setState(() => _ignoreClientStatistics = v),
|
||||
enableDnsCache: _enableDnsCache,
|
||||
updateEnableDnsCache: (v) => setState(() => _enableDnsCache = v),
|
||||
dnsCacheField: _dnsCacheField,
|
||||
dnsCacheError: _dnsCacheError,
|
||||
updateDnsCacheError: (v) => setState(() => _dnsCacheError = v),
|
||||
blockedServicesSchedule: _blockedServicesSchedule,
|
||||
setBlockedServicesSchedule: (v) => setState(() => _blockedServicesSchedule = v),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -80,6 +80,7 @@ void openClientFormModal({
|
|||
Client? client,
|
||||
required void Function(Client) onConfirm,
|
||||
void Function(Client)? onDelete,
|
||||
ClientInitialData? initialData,
|
||||
}) {
|
||||
showGeneralDialog(
|
||||
context: context,
|
||||
|
@ -105,6 +106,7 @@ void openClientFormModal({
|
|||
client: client,
|
||||
onConfirm: onConfirm,
|
||||
onDelete: onDelete,
|
||||
initialData: initialData,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -131,146 +131,177 @@ class _LogsListClientState extends State<LogsListClient> {
|
|||
setState(() => previousIp = widget.ip);
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(widget.name != null && widget.name != '' ? widget.name! : widget.ip),
|
||||
centerTitle: true,
|
||||
surfaceTintColor: isDesktop(MediaQuery.of(context).size.width)
|
||||
? Colors.transparent
|
||||
: null,
|
||||
actions: [
|
||||
if (!(Platform.isAndroid || Platform.isIOS)) ...[
|
||||
IconButton(
|
||||
onPressed: fetchLogs,
|
||||
icon: const Icon(Icons.refresh_rounded),
|
||||
tooltip: AppLocalizations.of(context)!.refresh,
|
||||
),
|
||||
const SizedBox(width: 8)
|
||||
]
|
||||
],
|
||||
),
|
||||
body: SafeArea(
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
switch (loadStatus) {
|
||||
case 0:
|
||||
return SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const CircularProgressIndicator(),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.loadingLogs,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
return Material(
|
||||
child: NestedScrollView(
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||
SliverOverlapAbsorber(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
sliver: SliverAppBar.large(
|
||||
pinned: true,
|
||||
floating: true,
|
||||
centerTitle: false,
|
||||
forceElevated: innerBoxIsScrolled,
|
||||
title: SafeArea(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.client,
|
||||
style: const TextStyle(
|
||||
fontSize: 24
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
widget.name != null && widget.name != '' ? widget.name! : widget.ip,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.secondary
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
surfaceTintColor: isDesktop(MediaQuery.of(context).size.width)
|
||||
? Colors.transparent
|
||||
: null,
|
||||
actions: [
|
||||
if (!(Platform.isAndroid || Platform.isIOS)) ...[
|
||||
IconButton(
|
||||
onPressed: fetchLogs,
|
||||
icon: const Icon(Icons.refresh_rounded),
|
||||
tooltip: AppLocalizations.of(context)!.refresh,
|
||||
),
|
||||
);
|
||||
|
||||
case 1:
|
||||
if (logsData!.data.isNotEmpty) {
|
||||
return RefreshIndicator(
|
||||
onRefresh: fetchLogs,
|
||||
child: ListView.builder(
|
||||
controller: scrollController,
|
||||
padding: const EdgeInsets.only(top: 0),
|
||||
itemCount: isLoadingMore == true
|
||||
? logsData!.data.length+1
|
||||
: logsData!.data.length,
|
||||
itemBuilder: (context, index) {
|
||||
if (isLoadingMore == true && index == logsData!.data.length) {
|
||||
return const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
const SizedBox(width: 8)
|
||||
]
|
||||
],
|
||||
)
|
||||
)
|
||||
],
|
||||
body: SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Builder(
|
||||
builder: (context) => RefreshIndicator(
|
||||
onRefresh: fetchLogs,
|
||||
displacement: 95,
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
if (loadStatus == 0) SliverFillRemaining(
|
||||
child: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const CircularProgressIndicator(),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.loadingLogs,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
return LogTile(
|
||||
log: logsData!.data[index],
|
||||
index: index,
|
||||
length: logsData!.data.length,
|
||||
useAlwaysNormalTile: true,
|
||||
onLogTap: (log) => {
|
||||
if (width > 700) {
|
||||
showDialog(
|
||||
context: context,
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
if (loadStatus == 1 && logsData!.data.isNotEmpty) SliverList.builder(
|
||||
itemCount: isLoadingMore == true
|
||||
? logsData!.data.length+1
|
||||
: logsData!.data.length,
|
||||
itemBuilder: (context, index) {
|
||||
if (isLoadingMore == true && index == logsData!.data.length) {
|
||||
return const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
return LogTile(
|
||||
log: logsData!.data[index],
|
||||
index: index,
|
||||
length: logsData!.data.length,
|
||||
useAlwaysNormalTile: true,
|
||||
onLogTap: (log) => {
|
||||
if (width > 700) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => LogDetailsScreen(
|
||||
log: log,
|
||||
dialog: true,
|
||||
twoColumns: widget.splitView,
|
||||
)
|
||||
)
|
||||
}
|
||||
else {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => LogDetailsScreen(
|
||||
log: log,
|
||||
dialog: true
|
||||
dialog: false,
|
||||
twoColumns: widget.splitView,
|
||||
)
|
||||
)
|
||||
}
|
||||
else {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => LogDetailsScreen(
|
||||
log: log,
|
||||
dialog: false
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
},
|
||||
twoColumns: widget.splitView,
|
||||
);
|
||||
}
|
||||
)
|
||||
}
|
||||
},
|
||||
twoColumns: widget.splitView,
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
return Center(
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.noLogsDisplay,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
case 2:
|
||||
return SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.error,
|
||||
color: Colors.red,
|
||||
size: 50,
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.logsNotLoaded,
|
||||
}
|
||||
),
|
||||
if (loadStatus == 1 && logsData!.data.isEmpty) SliverFillRemaining(
|
||||
child: Center(
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.noLogsDisplay,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
default:
|
||||
return const SizedBox();
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
if (loadStatus == 2) SliverFillRemaining(
|
||||
child: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.error,
|
||||
color: Colors.red,
|
||||
size: 50,
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.logsNotLoaded,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -5,9 +5,9 @@ class RemoveClientModal extends StatelessWidget {
|
|||
final void Function() onConfirm;
|
||||
|
||||
const RemoveClientModal({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.onConfirm
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
|
@ -11,11 +11,11 @@ class SafeSearchModal extends StatefulWidget {
|
|||
final void Function(SafeSearch) onConfirm;
|
||||
|
||||
const SafeSearchModal({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.safeSearch,
|
||||
required this.disabled,
|
||||
required this.onConfirm
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
State<SafeSearchModal> createState() => _SafeSearchModalState();
|
||||
|
|
|
@ -10,10 +10,10 @@ class ServicesModal extends StatefulWidget {
|
|||
final void Function(List<String>) onConfirm;
|
||||
|
||||
const ServicesModal({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.blockedServices,
|
||||
required this.onConfirm,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
State<ServicesModal> createState() => _ServicesModalStateWidget();
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_split_view/flutter_split_view.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/clients/clients_lists.dart';
|
||||
|
||||
import 'package:adguard_home_manager/models/clients.dart';
|
||||
|
||||
final clientsNavigatorKey = GlobalKey<NavigatorState>();
|
||||
|
||||
class Clients extends StatefulWidget {
|
||||
const Clients({super.key});
|
||||
|
||||
|
@ -23,27 +23,24 @@ class _ClientsState extends State<Clients> with TickerProviderStateMixin {
|
|||
return Scaffold(
|
||||
body: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
if (constraints.maxWidth > 1000) {
|
||||
return SplitView.material(
|
||||
hideDivider: true,
|
||||
flexWidth: const FlexWidth(mainViewFlexWidth: 1, secondaryViewFlexWidth: 2),
|
||||
placeholder: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.selectClientLeftColumn,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant
|
||||
),
|
||||
),
|
||||
),
|
||||
if (constraints.maxWidth > 900) {
|
||||
return Row(
|
||||
children: [
|
||||
const Expanded(
|
||||
flex: 1,
|
||||
child: ClientsLists(
|
||||
splitView: true,
|
||||
)
|
||||
),
|
||||
child: const ClientsLists(
|
||||
splitView: true,
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Navigator(
|
||||
key: clientsNavigatorKey,
|
||||
onGenerateRoute: (settings) => MaterialPageRoute(builder: (ctx) => const SizedBox()),
|
||||
),
|
||||
)
|
||||
);
|
||||
],
|
||||
);
|
||||
}
|
||||
else {
|
||||
return const ClientsLists(
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_split_view/flutter_split_view.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/clients/clients.dart';
|
||||
import 'package:adguard_home_manager/screens/clients/added_list.dart';
|
||||
import 'package:adguard_home_manager/screens/clients/client/logs_list_client.dart';
|
||||
import 'package:adguard_home_manager/screens/clients/clients_list.dart';
|
||||
|
@ -68,7 +68,13 @@ class _ClientsListsState extends State<ClientsLists> with TickerProviderStateMix
|
|||
splitView: widget.splitView,
|
||||
);
|
||||
if (widget.splitView) {
|
||||
SplitView.of(context).push(w);
|
||||
Navigator.of(clientsNavigatorKey.currentContext!).pushReplacement(
|
||||
PageRouteBuilder(
|
||||
pageBuilder: (context, animation1, animation2) => w,
|
||||
transitionDuration: Duration.zero,
|
||||
reverseTransitionDuration: Duration.zero,
|
||||
)
|
||||
);
|
||||
}
|
||||
else {
|
||||
Navigator.of(context).push(
|
||||
|
@ -88,7 +94,13 @@ class _ClientsListsState extends State<ClientsLists> with TickerProviderStateMix
|
|||
splitView: widget.splitView,
|
||||
);
|
||||
if (widget.splitView) {
|
||||
SplitView.of(context).push(w);
|
||||
Navigator.of(clientsNavigatorKey.currentContext!).pushReplacement(
|
||||
PageRouteBuilder(
|
||||
pageBuilder: (context, animation1, animation2) => w,
|
||||
transitionDuration: Duration.zero,
|
||||
reverseTransitionDuration: Duration.zero,
|
||||
)
|
||||
);
|
||||
}
|
||||
else {
|
||||
Navigator.of(context).push(
|
||||
|
|
|
@ -14,7 +14,7 @@ import 'package:adguard_home_manager/classes/process_modal.dart';
|
|||
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
||||
|
||||
class ClientsFab extends StatelessWidget {
|
||||
const ClientsFab({Key? key}) : super(key: key);
|
||||
const ClientsFab({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -25,22 +25,26 @@ class ClientsFab extends StatelessWidget {
|
|||
final width = MediaQuery.of(context).size.width;
|
||||
|
||||
void confirmAddClient(Client client) async {
|
||||
if (!context.mounted) return;
|
||||
|
||||
ProcessModal processModal = ProcessModal();
|
||||
processModal.open(AppLocalizations.of(context)!.addingClient);
|
||||
|
||||
final result = await clientsProvider.addClient(client);
|
||||
|
||||
if (!context.mounted) return;
|
||||
|
||||
processModal.close();
|
||||
|
||||
if (result == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientAddedSuccessfully,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientNotAdded,
|
||||
color: Colors.red
|
||||
|
|
|
@ -95,14 +95,14 @@ class _SearchClientsState extends State<SearchClients> {
|
|||
processModal.close();
|
||||
|
||||
if (result == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientDeletedSuccessfully,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientNotDeleted,
|
||||
color: Colors.red
|
||||
|
@ -119,14 +119,14 @@ class _SearchClientsState extends State<SearchClients> {
|
|||
processModal.close();
|
||||
|
||||
if (result == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientUpdatedSuccessfully,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientNotUpdated,
|
||||
color: Colors.red
|
||||
|
@ -205,7 +205,7 @@ class _SearchClientsState extends State<SearchClients> {
|
|||
height: 1,
|
||||
decoration: BoxDecoration(
|
||||
color: showDivider == true
|
||||
? Theme.of(context).colorScheme.surfaceVariant
|
||||
? Theme.of(context).colorScheme.surfaceContainerHighest
|
||||
: Colors.transparent
|
||||
),
|
||||
),
|
||||
|
|
|
@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:adguard_home_manager/widgets/add_server/add_server_functions.dart';
|
||||
|
||||
class FabConnect extends StatelessWidget {
|
||||
const FabConnect({Key? key}) : super(key: key);
|
||||
const FabConnect({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
|
@ -6,7 +6,8 @@ import 'package:flutter/material.dart';
|
|||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/filters/modals/add_custom_rule.dart';
|
||||
import 'package:adguard_home_manager/screens/filters/modals/custom_rules/edit_custom_rules.dart';
|
||||
import 'package:adguard_home_manager/screens/filters/modals/custom_rules/add_custom_rule.dart';
|
||||
import 'package:adguard_home_manager/screens/filters/details/add_list_modal.dart';
|
||||
|
||||
import 'package:adguard_home_manager/providers/filtering_provider.dart';
|
||||
|
@ -19,10 +20,10 @@ class AddFiltersButton extends StatelessWidget {
|
|||
final Widget Function(void Function()) widget;
|
||||
|
||||
const AddFiltersButton({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.type,
|
||||
required this.widget
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -32,6 +33,8 @@ class AddFiltersButton extends StatelessWidget {
|
|||
final width = MediaQuery.of(context).size.width;
|
||||
|
||||
void confirmAddRule(String rule) async {
|
||||
if (!context.mounted) return;
|
||||
|
||||
ProcessModal processModal = ProcessModal();
|
||||
processModal.open(AppLocalizations.of(context)!.addingRule);
|
||||
|
||||
|
@ -41,14 +44,14 @@ class AddFiltersButton extends StatelessWidget {
|
|||
|
||||
if (!context.mounted) return;
|
||||
if (result == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.ruleAddedSuccessfully,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.ruleNotAdded,
|
||||
color: Colors.red
|
||||
|
@ -56,6 +59,33 @@ class AddFiltersButton extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
|
||||
void confirmEditCustomRules(List<String> rules) async {
|
||||
if (!context.mounted) return;
|
||||
|
||||
ProcessModal processModal = ProcessModal();
|
||||
processModal.open(AppLocalizations.of(context)!.savingCustomRules);
|
||||
|
||||
final result = await filteringProvider.setCustomRules(rules);
|
||||
|
||||
processModal.close();
|
||||
|
||||
if (!context.mounted) return;
|
||||
if (result == true) {
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.customRulesUpdatedSuccessfully,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.customRulesNotUpdated,
|
||||
color: Colors.red
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void openAddCustomRule() {
|
||||
showGeneralDialog(
|
||||
context: context,
|
||||
|
@ -83,7 +113,36 @@ class AddFiltersButton extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
|
||||
void openEditCustomRule() {
|
||||
showGeneralDialog(
|
||||
context: context,
|
||||
barrierColor: !(width > 700 || !(Platform.isAndroid || Platform.isIOS))
|
||||
?Colors.transparent
|
||||
: Colors.black54,
|
||||
transitionBuilder: (context, anim1, anim2, child) {
|
||||
return SlideTransition(
|
||||
position: Tween(
|
||||
begin: const Offset(0, 1),
|
||||
end: const Offset(0, 0)
|
||||
).animate(
|
||||
CurvedAnimation(
|
||||
parent: anim1,
|
||||
curve: Curves.easeInOutCubicEmphasized
|
||||
)
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
pageBuilder: (context, animation, secondaryAnimation) => EditCustomRules(
|
||||
fullScreen: !(width > 700 || !(Platform.isAndroid || Platform.isIOS)),
|
||||
onConfirm: confirmEditCustomRules,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void confirmAddList({required String name, required String url, required String type}) async {
|
||||
if (!context.mounted) return;
|
||||
|
||||
ProcessModal processModal = ProcessModal();
|
||||
processModal.open(AppLocalizations.of(context)!.addingList);
|
||||
|
||||
|
@ -91,29 +150,30 @@ class AddFiltersButton extends StatelessWidget {
|
|||
|
||||
processModal.close();
|
||||
|
||||
if (!context.mounted) return;
|
||||
if (result['success'] == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: "${AppLocalizations.of(context)!.listAdded} ${result['data']}.",
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else if (result['success'] == false && result['error'] == 'invalid_url') {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.listUrlInvalid,
|
||||
color: Colors.red
|
||||
);
|
||||
}
|
||||
else if (result['success'] == false && result['error'] == 'url_exists') {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.listAlreadyAdded,
|
||||
color: Colors.red
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.listNotAdded,
|
||||
color: Colors.red
|
||||
|
@ -147,10 +207,25 @@ class AddFiltersButton extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
|
||||
return widget(
|
||||
type == 'blacklist' || type == 'whitelist'
|
||||
? () => openAddWhitelistBlacklist()
|
||||
: () => openAddCustomRule(),
|
||||
);
|
||||
switch (type) {
|
||||
case 'blacklist':
|
||||
case 'whitelist':
|
||||
return widget(
|
||||
() => openAddWhitelistBlacklist(),
|
||||
);
|
||||
|
||||
case 'add_custom_rule':
|
||||
return widget(
|
||||
() => openAddCustomRule(),
|
||||
);
|
||||
|
||||
case 'edit_custom_rule':
|
||||
return widget(
|
||||
() => openEditCustomRule(),
|
||||
);
|
||||
|
||||
default:
|
||||
return const SizedBox();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ import 'package:provider/provider.dart';
|
|||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/filters/add_button.dart';
|
||||
import 'package:adguard_home_manager/screens/filters/modals/custom_rules/sort_rules.dart';
|
||||
import 'package:adguard_home_manager/widgets/tab_content_list.dart';
|
||||
|
||||
import 'package:adguard_home_manager/functions/snackbar.dart';
|
||||
|
@ -20,12 +21,12 @@ class CustomRulesList extends StatefulWidget {
|
|||
final void Function(String) onRemoveCustomRule;
|
||||
|
||||
const CustomRulesList({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.loadStatus,
|
||||
required this.scrollController,
|
||||
required this.data,
|
||||
required this.onRemoveCustomRule
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
State<CustomRulesList> createState() => _CustomRulesListState();
|
||||
|
@ -34,6 +35,8 @@ class CustomRulesList extends StatefulWidget {
|
|||
class _CustomRulesListState extends State<CustomRulesList> {
|
||||
late bool isVisible;
|
||||
|
||||
CustomRulesSorting _sortingMethod = CustomRulesSorting.topBottom;
|
||||
|
||||
@override
|
||||
initState(){
|
||||
super.initState();
|
||||
|
@ -60,6 +63,8 @@ class _CustomRulesListState extends State<CustomRulesList> {
|
|||
final filteringProvider = Provider.of<FilteringProvider>(context);
|
||||
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
||||
|
||||
final renderData = _sortingMethod == CustomRulesSorting.bottomTop ? widget.data.reversed.toList() : widget.data.toList();
|
||||
|
||||
bool checkIfComment(String value) {
|
||||
final regex = RegExp(r'^(!|#).*$');
|
||||
if (regex.hasMatch(value)) {
|
||||
|
@ -104,6 +109,16 @@ class _CustomRulesListState extends State<CustomRulesList> {
|
|||
}
|
||||
}
|
||||
|
||||
void showSortingMethodModal() {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => SortCustomRulesModal(
|
||||
sortingMethod: _sortingMethod,
|
||||
onSelect: (value) => setState(() => _sortingMethod = value),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return CustomTabContentList(
|
||||
loadingGenerator: () => SizedBox(
|
||||
width: double.maxFinite,
|
||||
|
@ -124,10 +139,10 @@ class _CustomRulesListState extends State<CustomRulesList> {
|
|||
],
|
||||
),
|
||||
),
|
||||
itemsCount: widget.data.length,
|
||||
itemsCount: renderData.length,
|
||||
contentWidget: (index) => ListTile(
|
||||
title: Text(
|
||||
widget.data[index],
|
||||
renderData[index],
|
||||
style: TextStyle(
|
||||
color: checkIfComment(widget.data[index]) == true
|
||||
? Theme.of(context).colorScheme.onSurface.withOpacity(0.6)
|
||||
|
@ -135,9 +150,9 @@ class _CustomRulesListState extends State<CustomRulesList> {
|
|||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
),
|
||||
subtitle: generateSubtitle(widget.data[index]),
|
||||
subtitle: generateSubtitle(renderData[index]),
|
||||
trailing: IconButton(
|
||||
onPressed: () => widget.onRemoveCustomRule(widget.data[index]),
|
||||
onPressed: () => widget.onRemoveCustomRule(renderData[index]),
|
||||
icon: const Icon(Icons.delete)
|
||||
),
|
||||
),
|
||||
|
@ -162,8 +177,8 @@ class _CustomRulesListState extends State<CustomRulesList> {
|
|||
TextButton.icon(
|
||||
onPressed: () async {
|
||||
final result = await filteringProvider.fetchFilters();
|
||||
if (result == false) {
|
||||
showSnacbkar(
|
||||
if (result == false && context.mounted) {
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.errorLoadFilters,
|
||||
color: Colors.red
|
||||
|
@ -203,20 +218,38 @@ class _CustomRulesListState extends State<CustomRulesList> {
|
|||
onRefresh: () async {
|
||||
final result = await filteringProvider.fetchFilters();
|
||||
if (result == false) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.errorLoadFilters,
|
||||
color: Colors.red
|
||||
);
|
||||
}
|
||||
},
|
||||
fab: AddFiltersButton(
|
||||
type: 'custom_rule',
|
||||
widget: (fn) => FloatingActionButton(
|
||||
onPressed: fn,
|
||||
child: const Icon(Icons.add),
|
||||
),
|
||||
fab: Column(
|
||||
children: [
|
||||
FloatingActionButton.small(
|
||||
onPressed: showSortingMethodModal,
|
||||
child: Icon(Icons.sort_rounded),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
AddFiltersButton(
|
||||
type: 'edit_custom_rule',
|
||||
widget: (fn) => FloatingActionButton.small(
|
||||
onPressed: fn,
|
||||
child: const Icon(Icons.edit_rounded),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
AddFiltersButton(
|
||||
type: 'add_custom_rule',
|
||||
widget: (fn) => FloatingActionButton(
|
||||
onPressed: fn,
|
||||
child: const Icon(Icons.add),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
heightFabHidden: -180,
|
||||
fabVisible: isVisible,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:adguard_home_manager/constants/regexps.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
|
@ -97,8 +98,7 @@ class _ContentState extends State<_Content> {
|
|||
}
|
||||
|
||||
void validateUrl(String value) {
|
||||
final urlRegex = RegExp(r'^(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})$');
|
||||
if (urlRegex.hasMatch(value)) {
|
||||
if (Regexps.url.hasMatch(value)) {
|
||||
setState(() => urlError = null);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'package:adguard_home_manager/constants/regexps.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
@ -63,8 +64,7 @@ class _ContentState extends State<_Content> {
|
|||
Widget? resultWidget;
|
||||
|
||||
void validateDomain(String value) {
|
||||
final domainRegex = RegExp(r'^([a-z0-9|-]+\.)*[a-z0-9|-]+\.[a-z]+$');
|
||||
if (domainRegex.hasMatch(value)) {
|
||||
if (Regexps.domain.hasMatch(value)) {
|
||||
setState(() => domainError = null);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -94,14 +94,14 @@ class _ListDetailsScreenState extends State<ListDetailsScreen> {
|
|||
);
|
||||
processModal.close();
|
||||
if (result == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.listDataUpdated,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.listDataNotUpdated,
|
||||
color: Colors.red
|
||||
|
@ -175,6 +175,7 @@ class _ListDetailsScreenState extends State<ListDetailsScreen> {
|
|||
_Content(
|
||||
isDialog: widget.dialog,
|
||||
list: list,
|
||||
type: widget.type,
|
||||
)
|
||||
],
|
||||
),
|
||||
|
@ -216,6 +217,7 @@ class _ListDetailsScreenState extends State<ListDetailsScreen> {
|
|||
_Content(
|
||||
isDialog: widget.dialog,
|
||||
list: list,
|
||||
type: widget.type,
|
||||
)
|
||||
],
|
||||
),
|
||||
|
@ -261,10 +263,12 @@ class _ListDetailsScreenState extends State<ListDetailsScreen> {
|
|||
class _Content extends StatelessWidget {
|
||||
final Filter list;
|
||||
final bool isDialog;
|
||||
final String type;
|
||||
|
||||
const _Content({
|
||||
required this.list,
|
||||
required this.isDialog
|
||||
required this.isDialog,
|
||||
required this.type,
|
||||
});
|
||||
|
||||
@override
|
||||
|
@ -339,7 +343,7 @@ class _Content extends StatelessWidget {
|
|||
CustomListTile(
|
||||
icon: Icons.shield_rounded,
|
||||
title: AppLocalizations.of(context)!.listType,
|
||||
subtitle: isDialog == 'whitelist'
|
||||
subtitle: type == 'whitelist'
|
||||
? AppLocalizations.of(context)!.whitelist
|
||||
: AppLocalizations.of(context)!.blacklist,
|
||||
padding: isDialog == true
|
||||
|
@ -431,7 +435,7 @@ class _Actions extends StatelessWidget {
|
|||
);
|
||||
processModal.close();
|
||||
if (result == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.listDeleted,
|
||||
color: Colors.green
|
||||
|
@ -439,7 +443,7 @@ class _Actions extends StatelessWidget {
|
|||
Navigator.pop(context);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.listNotDeleted,
|
||||
color: Colors.red
|
||||
|
|
|
@ -24,7 +24,7 @@ import 'package:adguard_home_manager/constants/enums.dart';
|
|||
import 'package:adguard_home_manager/models/clients.dart';
|
||||
|
||||
class Filters extends StatefulWidget {
|
||||
const Filters({Key? key}) : super(key: key);
|
||||
const Filters({super.key});
|
||||
|
||||
@override
|
||||
State<Filters> createState() => _FiltersState();
|
||||
|
@ -57,14 +57,14 @@ class _FiltersState extends State<Filters> {
|
|||
if (!mounted) return;
|
||||
processModal.close();
|
||||
if (result['success'] == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: "${result['data']['updated']} ${AppLocalizations.of(context)!.listsUpdated}",
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.listsNotUpdated,
|
||||
color: Colors.red
|
||||
|
@ -109,14 +109,14 @@ class _FiltersState extends State<Filters> {
|
|||
processModal.close();
|
||||
|
||||
if (result == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.filteringStatusUpdated,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.filteringStatusNotUpdated,
|
||||
color: Colors.red
|
||||
|
@ -133,14 +133,14 @@ class _FiltersState extends State<Filters> {
|
|||
processModal.close();
|
||||
|
||||
if (result == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.updateFrequencyChanged,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.updateFrequencyNotChanged,
|
||||
color: Colors.red
|
||||
|
@ -163,14 +163,14 @@ class _FiltersState extends State<Filters> {
|
|||
processModal.close();
|
||||
|
||||
if (result == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.ruleRemovedSuccessfully,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.ruleNotRemoved,
|
||||
color: Colors.red
|
||||
|
|
|
@ -27,13 +27,13 @@ class FiltersList extends StatefulWidget {
|
|||
final void Function(Filter, String) onOpenDetailsScreen;
|
||||
|
||||
const FiltersList({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.loadStatus,
|
||||
required this.scrollController,
|
||||
required this.data,
|
||||
required this.type,
|
||||
required this.onOpenDetailsScreen
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
State<FiltersList> createState() => _FiltersListState();
|
||||
|
@ -133,7 +133,7 @@ class _FiltersListState extends State<FiltersList> {
|
|||
onPressed: () async {
|
||||
final result = await filteringProvider.fetchFilters();
|
||||
if (result == false && mounted) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.errorLoadFilters,
|
||||
color: Colors.red
|
||||
|
@ -173,7 +173,7 @@ class _FiltersListState extends State<FiltersList> {
|
|||
onRefresh: () async {
|
||||
final result = await filteringProvider.fetchFilters();
|
||||
if (result == false && mounted) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.errorLoadFilters,
|
||||
color: Colors.red
|
||||
|
|
|
@ -84,7 +84,7 @@ class FiltersTripleColumn extends StatelessWidget {
|
|||
onPressed: () async {
|
||||
final result = await filteringProvider.fetchFilters();
|
||||
if (result == false && context.mounted) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.errorLoadFilters,
|
||||
color: Colors.red
|
||||
|
@ -247,21 +247,34 @@ class FiltersTripleColumn extends StatelessWidget {
|
|||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.customRules,
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500
|
||||
Flexible(
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.customRules,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
AddFiltersButton(
|
||||
type: '',
|
||||
type: 'edit_custom_rule',
|
||||
widget: (fn) => IconButton(
|
||||
onPressed: fn,
|
||||
icon: const Icon(Icons.edit_rounded),
|
||||
tooltip: AppLocalizations.of(context)!.editCustomRules,
|
||||
)
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
AddFiltersButton(
|
||||
type: 'add_custom_rule',
|
||||
widget: (fn) => IconButton(
|
||||
onPressed: fn,
|
||||
icon: const Icon(Icons.add_rounded),
|
||||
tooltip: AppLocalizations.of(context)!.addCustomRule,
|
||||
)
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
@ -59,14 +59,14 @@ class ListOptionsMenu extends StatelessWidget {
|
|||
|
||||
if (!context.mounted) return;
|
||||
if (result == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.listDataUpdated,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.listDataNotUpdated,
|
||||
color: Colors.red
|
||||
|
|
|
@ -1,416 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:segmented_button_slide/segmented_button_slide.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/functions/open_url.dart';
|
||||
import 'package:adguard_home_manager/constants/urls.dart';
|
||||
|
||||
class AddCustomRule extends StatefulWidget {
|
||||
final void Function(String) onConfirm;
|
||||
final bool fullScreen;
|
||||
|
||||
const AddCustomRule({
|
||||
super.key,
|
||||
required this.onConfirm,
|
||||
required this.fullScreen
|
||||
});
|
||||
|
||||
@override
|
||||
State<AddCustomRule> createState() => _AddCustomRuleState();
|
||||
}
|
||||
|
||||
enum BlockingPresets { block, unblock, custom }
|
||||
|
||||
class _AddCustomRuleState extends State<AddCustomRule> {
|
||||
final TextEditingController domainController = TextEditingController();
|
||||
String? domainError;
|
||||
|
||||
BlockingPresets preset = BlockingPresets.block;
|
||||
|
||||
bool addImportant = false;
|
||||
|
||||
bool checkValidValues() {
|
||||
if (
|
||||
domainController.text != '' &&
|
||||
domainError == null
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void validateDomain(String value) {
|
||||
final domainRegex = RegExp(r'^(([a-zA-Z]{1})|([a-zA-Z]{1}[a-zA-Z]{1})|([a-zA-Z]{1}[0-9]{1})|([0-9]{1}[a-zA-Z]{1})|([a-zA-Z0-9][a-zA-Z0-9-_]{1,61}[a-zA-Z0-9]))\.([a-zA-Z]{2,6}|[a-zA-Z0-9-]{2,30}\.[a-zA-Z]{2,3})$');
|
||||
if (domainRegex.hasMatch(value)) {
|
||||
setState(() => domainError = null);
|
||||
}
|
||||
else {
|
||||
setState(() => domainError = AppLocalizations.of(context)!.domainNotValid);
|
||||
}
|
||||
checkValidValues();
|
||||
}
|
||||
|
||||
String buildRule({String?value}) {
|
||||
String rule = "";
|
||||
|
||||
String fieldValue = value ?? domainController.text;
|
||||
|
||||
if (preset == BlockingPresets.block) {
|
||||
rule = "||${fieldValue.trim()}^";
|
||||
}
|
||||
else if (preset == BlockingPresets.unblock) {
|
||||
rule = "@@||${fieldValue.trim()}^";
|
||||
}
|
||||
else {
|
||||
rule = fieldValue.trim();
|
||||
}
|
||||
|
||||
if (addImportant == true) {
|
||||
rule = "$rule\$important";
|
||||
}
|
||||
|
||||
return rule;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
List<Widget> content() {
|
||||
return [
|
||||
const SizedBox(height: 24),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 5
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primary.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
border: Border.all(
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
)
|
||||
),
|
||||
child: Text(
|
||||
buildRule(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(height: 30),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
child: TextFormField(
|
||||
controller: domainController,
|
||||
onChanged: (value) => setState(() => {}),
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.link_rounded),
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10)
|
||||
)
|
||||
),
|
||||
errorText: domainError,
|
||||
labelText: AppLocalizations.of(context)!.domain,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(height: 30),
|
||||
SegmentedButtonSlide(
|
||||
entries: [
|
||||
SegmentedButtonSlideEntry(label: AppLocalizations.of(context)!.block),
|
||||
SegmentedButtonSlideEntry(label: AppLocalizations.of(context)!.unblock),
|
||||
SegmentedButtonSlideEntry(label: AppLocalizations.of(context)!.custom),
|
||||
],
|
||||
selectedEntry: preset.index,
|
||||
onChange: (v) => setState(() => preset = BlockingPresets.values[v]),
|
||||
colors: SegmentedButtonSlideColors(
|
||||
barColor: Theme.of(context).colorScheme.primary.withOpacity(0.2),
|
||||
backgroundSelectedColor: Theme.of(context).colorScheme.primary,
|
||||
foregroundSelectedColor: Theme.of(context).colorScheme.onPrimary,
|
||||
foregroundUnselectedColor: Theme.of(context).colorScheme.onSurface,
|
||||
hoverColor: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
textOverflow: TextOverflow.ellipsis,
|
||||
fontSize: 14,
|
||||
height: 40,
|
||||
margin: const EdgeInsets.symmetric(
|
||||
horizontal: 24,
|
||||
),
|
||||
),
|
||||
Container(height: 20),
|
||||
Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => setState(() => addImportant = !addImportant),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 28),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.addImportant,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
),
|
||||
),
|
||||
Switch(
|
||||
value: addImportant,
|
||||
onChanged: (value) => setState(() => addImportant = value),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(height: 20),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
child: Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.info,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.examples,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"||example.org^",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.example1,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
"@@||example.org^",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.example2,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
"! Here goes a comment",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"# Also a comment",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.example3,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
"/REGEX/",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.example4,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(height: 20),
|
||||
Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => openUrl(Urls.customRuleDocs),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 28, vertical: 10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.moreInformation,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 15),
|
||||
child: Icon(
|
||||
Icons.open_in_new,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(height: 20)
|
||||
];
|
||||
}
|
||||
|
||||
if (widget.fullScreen == true) {
|
||||
return Dialog.fullscreen(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: CloseButton(onPressed: () => Navigator.pop(context)),
|
||||
title: Text(AppLocalizations.of(context)!.addCustomRule),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: checkValidValues() == true
|
||||
? () {
|
||||
Navigator.pop(context);
|
||||
widget.onConfirm(buildRule());
|
||||
}
|
||||
: null,
|
||||
icon: const Icon(Icons.check)
|
||||
),
|
||||
const SizedBox(width: 10)
|
||||
],
|
||||
),
|
||||
body: SafeArea(
|
||||
child: ListView(
|
||||
children: content(),
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
return Dialog(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 500
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
icon: const Icon(Icons.clear_rounded),
|
||||
tooltip: AppLocalizations.of(context)!.close,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.addCustomRule,
|
||||
style: const TextStyle(
|
||||
fontSize: 22
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
IconButton(
|
||||
onPressed: checkValidValues() == true
|
||||
? () {
|
||||
Navigator.pop(context);
|
||||
widget.onConfirm(buildRule());
|
||||
}
|
||||
: null,
|
||||
icon: const Icon(Icons.check)
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: SingleChildScrollView(
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: content(),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -68,14 +68,14 @@ class _BlockedServicesScreenStateWidget extends State<BlockedServicesScreen> {
|
|||
processModal.close();
|
||||
|
||||
if (result == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.blockedServicesUpdated,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.blockedServicesNotUpdated,
|
||||
color: Colors.red
|
||||
|
@ -85,38 +85,134 @@ class _BlockedServicesScreenStateWidget extends State<BlockedServicesScreen> {
|
|||
|
||||
if (widget.fullScreen == true) {
|
||||
return Dialog.fullscreen(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: CloseButton(onPressed: () => Navigator.pop(context)),
|
||||
title: Text(AppLocalizations.of(context)!.blockedServices),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: updateBlockedServices,
|
||||
icon: const Icon(
|
||||
Icons.save_rounded
|
||||
),
|
||||
tooltip: AppLocalizations.of(context)!.save,
|
||||
),
|
||||
const SizedBox(width: 10)
|
||||
],
|
||||
),
|
||||
body: SafeArea(
|
||||
child: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
final result = await filteringProvider.loadBlockedServices();
|
||||
if (result == false) {
|
||||
showSnacbkar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.blockedServicesListNotLoaded,
|
||||
color: Colors.red
|
||||
);
|
||||
}
|
||||
},
|
||||
child: _Content(
|
||||
values: values,
|
||||
updateValues: updateValues,
|
||||
child: Material(
|
||||
child: NestedScrollView(
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||
SliverOverlapAbsorber(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
sliver: SliverAppBar.large(
|
||||
pinned: true,
|
||||
floating: true,
|
||||
centerTitle: false,
|
||||
forceElevated: innerBoxIsScrolled,
|
||||
leading: CloseButton(onPressed: () => Navigator.pop(context)),
|
||||
title: Text(AppLocalizations.of(context)!.blockedServices),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: updateBlockedServices,
|
||||
icon: const Icon(
|
||||
Icons.save_rounded
|
||||
),
|
||||
tooltip: AppLocalizations.of(context)!.save,
|
||||
),
|
||||
const SizedBox(width: 10)
|
||||
],
|
||||
)
|
||||
)
|
||||
),
|
||||
],
|
||||
body: SafeArea(
|
||||
top: false,
|
||||
bottom: true,
|
||||
child: Builder(
|
||||
builder: (context) => CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
if (filteringProvider.blockedServicesLoadStatus == LoadStatus.loading) SliverFillRemaining(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const CircularProgressIndicator(),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.loadingBlockedServicesList,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (filteringProvider.blockedServicesLoadStatus == LoadStatus.loaded) SliverList.builder(
|
||||
itemCount: filteringProvider.blockedServices!.services.length,
|
||||
itemBuilder: (context, index) => Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => updateValues(
|
||||
values.contains(filteringProvider.blockedServices!.services[index].id),
|
||||
filteringProvider.blockedServices!.services[index]
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 6,
|
||||
bottom: 6,
|
||||
right: 12,
|
||||
left: 24
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
filteringProvider.blockedServices!.services[index].name,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
),
|
||||
Checkbox(
|
||||
value: values.contains(filteringProvider.blockedServices!.services[index].id),
|
||||
onChanged: (value) => updateValues(
|
||||
value!,
|
||||
filteringProvider.blockedServices!.services[index]
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5)
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
if (filteringProvider.blockedServicesLoadStatus == LoadStatus.error) SliverFillRemaining(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.error,
|
||||
color: Colors.red,
|
||||
size: 50,
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.blockedServicesListNotLoaded,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -162,9 +258,105 @@ class _BlockedServicesScreenStateWidget extends State<BlockedServicesScreen> {
|
|||
),
|
||||
),
|
||||
Expanded(
|
||||
child: _Content(
|
||||
values: values,
|
||||
updateValues: updateValues,
|
||||
child: Builder(
|
||||
builder: (ctx) {
|
||||
switch (filteringProvider.blockedServicesLoadStatus) {
|
||||
case LoadStatus.loading:
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const CircularProgressIndicator(),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.loadingBlockedServicesList,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
case LoadStatus.loaded:
|
||||
return ListView.builder(
|
||||
itemCount: filteringProvider.blockedServices!.services.length,
|
||||
itemBuilder: (context, index) => Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => updateValues(
|
||||
values.contains(filteringProvider.blockedServices!.services[index].id),
|
||||
filteringProvider.blockedServices!.services[index]
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 6,
|
||||
bottom: 6,
|
||||
right: 12,
|
||||
left: 24
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
filteringProvider.blockedServices!.services[index].name,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
),
|
||||
Checkbox(
|
||||
value: values.contains(filteringProvider.blockedServices!.services[index].id),
|
||||
onChanged: (value) => updateValues(
|
||||
value!,
|
||||
filteringProvider.blockedServices!.services[index]
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5)
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
case LoadStatus.error:
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.error,
|
||||
color: Colors.red,
|
||||
size: 50,
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.blockedServicesListNotLoaded,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
default:
|
||||
return const SizedBox();
|
||||
}
|
||||
},
|
||||
)
|
||||
),
|
||||
],
|
||||
|
@ -175,117 +367,6 @@ class _BlockedServicesScreenStateWidget extends State<BlockedServicesScreen> {
|
|||
}
|
||||
}
|
||||
|
||||
class _Content extends StatelessWidget {
|
||||
final List<String> values;
|
||||
final void Function(bool value, BlockedService item) updateValues;
|
||||
|
||||
const _Content({
|
||||
required this.values,
|
||||
required this.updateValues,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final filteringProvider = Provider.of<FilteringProvider>(context);
|
||||
|
||||
switch (filteringProvider.blockedServicesLoadStatus) {
|
||||
case LoadStatus.loading:
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const CircularProgressIndicator(),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.loadingBlockedServicesList,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
case LoadStatus.loaded:
|
||||
return ListView.builder(
|
||||
itemCount: filteringProvider.blockedServices!.services.length,
|
||||
itemBuilder: (context, index) => Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => updateValues(
|
||||
values.contains(filteringProvider.blockedServices!.services[index].id),
|
||||
filteringProvider.blockedServices!.services[index]
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 6,
|
||||
bottom: 6,
|
||||
right: 12,
|
||||
left: 24
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
filteringProvider.blockedServices!.services[index].name,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
),
|
||||
Checkbox(
|
||||
value: values.contains(filteringProvider.blockedServices!.services[index].id),
|
||||
onChanged: (value) => updateValues(
|
||||
value!,
|
||||
filteringProvider.blockedServices!.services[index]
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5)
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
case LoadStatus.error:
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.error,
|
||||
color: Colors.red,
|
||||
size: 50,
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.blockedServicesListNotLoaded,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
default:
|
||||
return const SizedBox();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void openBlockedServicesModal({
|
||||
required BuildContext context,
|
||||
|
|
354
lib/screens/filters/modals/custom_rules/add_custom_rule.dart
Normal file
354
lib/screens/filters/modals/custom_rules/add_custom_rule.dart
Normal file
|
@ -0,0 +1,354 @@
|
|||
import 'package:adguard_home_manager/constants/regexps.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:segmented_button_slide/segmented_button_slide.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/filters/modals/custom_rules/custom_rule_docs.dart';
|
||||
|
||||
enum _BlockingPresets { block, unblock, custom }
|
||||
|
||||
class AddCustomRule extends StatefulWidget {
|
||||
final void Function(String) onConfirm;
|
||||
final bool fullScreen;
|
||||
|
||||
const AddCustomRule({
|
||||
super.key,
|
||||
required this.onConfirm,
|
||||
required this.fullScreen
|
||||
});
|
||||
|
||||
@override
|
||||
State<AddCustomRule> createState() => _AddCustomRuleState();
|
||||
}
|
||||
|
||||
class _AddCustomRuleState extends State<AddCustomRule> {
|
||||
final TextEditingController _domainController = TextEditingController();
|
||||
String? _domainError;
|
||||
|
||||
_BlockingPresets _preset = _BlockingPresets.block;
|
||||
|
||||
bool _addImportant = false;
|
||||
|
||||
bool _checkValidValues() {
|
||||
if (
|
||||
_domainController.text != '' &&
|
||||
_domainError == null
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void validateDomain(String value) {
|
||||
if (Regexps.domain.hasMatch(value)) {
|
||||
setState(() => _domainError = null);
|
||||
}
|
||||
else {
|
||||
setState(() => _domainError = AppLocalizations.of(context)!.domainNotValid);
|
||||
}
|
||||
_checkValidValues();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (widget.fullScreen == true) {
|
||||
return Dialog.fullscreen(
|
||||
child: Material(
|
||||
child: NestedScrollView(
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||
SliverOverlapAbsorber(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
sliver: SliverAppBar.large(
|
||||
pinned: true,
|
||||
floating: true,
|
||||
centerTitle: false,
|
||||
forceElevated: innerBoxIsScrolled,
|
||||
leading: CloseButton(onPressed: () => Navigator.pop(context)),
|
||||
title: Text(AppLocalizations.of(context)!.addCustomRule),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: _checkValidValues() == true
|
||||
? () {
|
||||
Navigator.pop(context);
|
||||
widget.onConfirm(
|
||||
_buildRule(
|
||||
domainController: _domainController,
|
||||
important: _addImportant,
|
||||
preset: _preset
|
||||
)
|
||||
);
|
||||
}
|
||||
: null,
|
||||
icon: const Icon(Icons.check)
|
||||
),
|
||||
const SizedBox(width: 10)
|
||||
],
|
||||
)
|
||||
)
|
||||
],
|
||||
body: SafeArea(
|
||||
top: false,
|
||||
bottom: true,
|
||||
child: Builder(
|
||||
builder: (context) => CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
SliverList.list(
|
||||
children: [
|
||||
_CustomRuleEditor(
|
||||
domainController: _domainController,
|
||||
domainError: _domainError,
|
||||
important: _addImportant,
|
||||
preset: _preset,
|
||||
setImportant: (v) => setState(() => _addImportant = v),
|
||||
setPreset: (v) => setState(() => _preset = v),
|
||||
validateDomain: validateDomain
|
||||
)
|
||||
]
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
return Dialog(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 500
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
icon: const Icon(Icons.clear_rounded),
|
||||
tooltip: AppLocalizations.of(context)!.close,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.addCustomRule,
|
||||
style: const TextStyle(
|
||||
fontSize: 22
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
IconButton(
|
||||
onPressed: _checkValidValues() == true
|
||||
? () {
|
||||
Navigator.pop(context);
|
||||
widget.onConfirm(
|
||||
_buildRule(
|
||||
domainController: _domainController,
|
||||
important: _addImportant,
|
||||
preset: _preset
|
||||
)
|
||||
);
|
||||
}
|
||||
: null,
|
||||
icon: const Icon(Icons.check)
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: SingleChildScrollView(
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: [
|
||||
_CustomRuleEditor(
|
||||
domainController: _domainController,
|
||||
domainError: _domainError,
|
||||
important: _addImportant,
|
||||
preset: _preset,
|
||||
setImportant: (v) => setState(() => _addImportant = v),
|
||||
setPreset: (v) => setState(() => _preset = v),
|
||||
validateDomain: validateDomain
|
||||
)
|
||||
]
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class _CustomRuleEditor extends StatelessWidget {
|
||||
final TextEditingController domainController;
|
||||
final String? domainError;
|
||||
final bool important;
|
||||
final void Function(bool) setImportant;
|
||||
final _BlockingPresets preset;
|
||||
final void Function(_BlockingPresets) setPreset;
|
||||
final void Function(String) validateDomain;
|
||||
|
||||
const _CustomRuleEditor({
|
||||
required this.domainController,
|
||||
required this.domainError,
|
||||
required this.important,
|
||||
required this.setImportant,
|
||||
required this.preset,
|
||||
required this.setPreset,
|
||||
required this.validateDomain,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
const SizedBox(height: 24),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 5
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primary.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
border: Border.all(
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
)
|
||||
),
|
||||
child: Text(
|
||||
_buildRule(
|
||||
domainController: domainController,
|
||||
important: important,
|
||||
preset: preset,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(height: 30),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
child: TextFormField(
|
||||
controller: domainController,
|
||||
onChanged: validateDomain,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.link_rounded),
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10)
|
||||
)
|
||||
),
|
||||
errorText: domainError,
|
||||
labelText: AppLocalizations.of(context)!.domain,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(height: 30),
|
||||
SegmentedButtonSlide(
|
||||
entries: [
|
||||
SegmentedButtonSlideEntry(label: AppLocalizations.of(context)!.block),
|
||||
SegmentedButtonSlideEntry(label: AppLocalizations.of(context)!.unblock),
|
||||
SegmentedButtonSlideEntry(label: AppLocalizations.of(context)!.custom),
|
||||
],
|
||||
selectedEntry: preset.index,
|
||||
onChange: (v) => setPreset(_BlockingPresets.values[v]),
|
||||
colors: SegmentedButtonSlideColors(
|
||||
barColor: Theme.of(context).colorScheme.primary.withOpacity(0.2),
|
||||
backgroundSelectedColor: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
textOverflow: TextOverflow.ellipsis,
|
||||
height: 40,
|
||||
margin: const EdgeInsets.symmetric(
|
||||
horizontal: 24,
|
||||
),
|
||||
selectedTextStyle: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
fontWeight: FontWeight.w700
|
||||
),
|
||||
unselectedTextStyle: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
hoverTextStyle: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
Container(height: 20),
|
||||
Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => setImportant(!important),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 28),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.addImportant,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
),
|
||||
),
|
||||
Switch(
|
||||
value: important,
|
||||
onChanged: setImportant,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(height: 20),
|
||||
const CustomRuleDocs(),
|
||||
Container(height: 20)
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
String _buildRule({
|
||||
String? value,
|
||||
required TextEditingController domainController,
|
||||
required _BlockingPresets preset,
|
||||
required bool important
|
||||
}) {
|
||||
String rule = "";
|
||||
String fieldValue = value ?? domainController.text;
|
||||
if (preset == _BlockingPresets.block) {
|
||||
rule = "||${fieldValue.trim()}^";
|
||||
}
|
||||
else if (preset == _BlockingPresets.unblock) {
|
||||
rule = "@@||${fieldValue.trim()}^";
|
||||
}
|
||||
else {
|
||||
rule = fieldValue.trim();
|
||||
}
|
||||
if (important == true) {
|
||||
rule = "$rule\$important";
|
||||
}
|
||||
return rule;
|
||||
}
|
166
lib/screens/filters/modals/custom_rules/custom_rule_docs.dart
Normal file
166
lib/screens/filters/modals/custom_rules/custom_rule_docs.dart
Normal file
|
@ -0,0 +1,166 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/constants/urls.dart';
|
||||
import 'package:adguard_home_manager/functions/open_url.dart';
|
||||
|
||||
class CustomRuleDocs extends StatelessWidget {
|
||||
const CustomRuleDocs({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
child: Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.info,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.examples,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"||example.org^",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.example1,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
"@@||example.org^",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.example2,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
"! Here goes a comment",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"# Also a comment",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.example3,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
"/REGEX/",
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.example4,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).colorScheme.primary
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(height: 8),
|
||||
Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => openUrl(Urls.customRuleDocs),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.moreInformation,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 15),
|
||||
child: Icon(
|
||||
Icons.open_in_new,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
188
lib/screens/filters/modals/custom_rules/edit_custom_rules.dart
Normal file
188
lib/screens/filters/modals/custom_rules/edit_custom_rules.dart
Normal file
|
@ -0,0 +1,188 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/filters/modals/custom_rules/custom_rule_docs.dart';
|
||||
|
||||
import 'package:adguard_home_manager/providers/filtering_provider.dart';
|
||||
|
||||
class EditCustomRules extends StatefulWidget {
|
||||
final bool fullScreen;
|
||||
final void Function(List<String>) onConfirm;
|
||||
|
||||
const EditCustomRules({
|
||||
super.key,
|
||||
required this.fullScreen,
|
||||
required this.onConfirm,
|
||||
});
|
||||
|
||||
@override
|
||||
State<EditCustomRules> createState() => _EditCustomRulesState();
|
||||
}
|
||||
|
||||
class _EditCustomRulesState extends State<EditCustomRules> {
|
||||
final _fieldController = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
final filteringProvider = Provider.of<FilteringProvider>(context, listen: false);
|
||||
if (filteringProvider.filtering != null) {
|
||||
_fieldController.text = filteringProvider.filtering!.userRules.join("\n");
|
||||
}
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (widget.fullScreen == true) {
|
||||
return Dialog.fullscreen(
|
||||
child: Material(
|
||||
child: NestedScrollView(
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||
SliverOverlapAbsorber(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
sliver: SliverAppBar.large(
|
||||
pinned: true,
|
||||
floating: true,
|
||||
centerTitle: false,
|
||||
forceElevated: innerBoxIsScrolled,
|
||||
leading: CloseButton(onPressed: () => Navigator.pop(context)),
|
||||
title: Text(AppLocalizations.of(context)!.editCustomRules),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
widget.onConfirm(_fieldController.text.split("\n"));
|
||||
},
|
||||
icon: const Icon(Icons.save_rounded),
|
||||
tooltip: AppLocalizations.of(context)!.save,
|
||||
),
|
||||
const SizedBox(width: 10)
|
||||
],
|
||||
)
|
||||
)
|
||||
],
|
||||
body: SafeArea(
|
||||
top: false,
|
||||
bottom: true,
|
||||
child: Builder(
|
||||
builder: (context) => CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
SliverList.list(
|
||||
children: [
|
||||
_CustomRulesRawEditor(fieldController: _fieldController)
|
||||
]
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
return Dialog(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 500
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
icon: const Icon(Icons.clear_rounded),
|
||||
tooltip: AppLocalizations.of(context)!.close,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.editCustomRules,
|
||||
style: const TextStyle(
|
||||
fontSize: 22
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
widget.onConfirm(_fieldController.text.split("\n"));
|
||||
},
|
||||
icon: const Icon(Icons.save_rounded),
|
||||
tooltip: AppLocalizations.of(context)!.save,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: SingleChildScrollView(
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: [
|
||||
_CustomRulesRawEditor(fieldController: _fieldController)
|
||||
]
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class _CustomRulesRawEditor extends StatelessWidget {
|
||||
final TextEditingController fieldController;
|
||||
|
||||
const _CustomRulesRawEditor({
|
||||
required this.fieldController
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
const SizedBox(height: 24),
|
||||
SizedBox(
|
||||
height: 300,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 28),
|
||||
child: TextField(
|
||||
controller: fieldController,
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10)
|
||||
)
|
||||
),
|
||||
labelText: AppLocalizations.of(context)!.rules,
|
||||
floatingLabelBehavior: FloatingLabelBehavior.always
|
||||
),
|
||||
autocorrect: false,
|
||||
expands: true,
|
||||
minLines: null,
|
||||
maxLines: null,
|
||||
textAlignVertical: TextAlignVertical.top,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
const CustomRuleDocs(),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
128
lib/screens/filters/modals/custom_rules/sort_rules.dart
Normal file
128
lib/screens/filters/modals/custom_rules/sort_rules.dart
Normal file
|
@ -0,0 +1,128 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/constants/enums.dart';
|
||||
|
||||
class SortCustomRulesModal extends StatelessWidget {
|
||||
final CustomRulesSorting sortingMethod;
|
||||
final void Function(CustomRulesSorting) onSelect;
|
||||
|
||||
const SortCustomRulesModal({
|
||||
super.key,
|
||||
required this.sortingMethod,
|
||||
required this.onSelect,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 16),
|
||||
scrollable: true,
|
||||
title: Column(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.sort_rounded,
|
||||
size: 24,
|
||||
color: Theme.of(context).listTileTheme.iconColor
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.sortingOptions,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
content: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 500
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
_CustomListTileDialog(
|
||||
title: AppLocalizations.of(context)!.topToBottom,
|
||||
icon: Icons.arrow_downward_rounded,
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
onSelect(CustomRulesSorting.topBottom);
|
||||
},
|
||||
isSelected: sortingMethod == CustomRulesSorting.topBottom
|
||||
),
|
||||
_CustomListTileDialog(
|
||||
title: AppLocalizations.of(context)!.bottomToTop,
|
||||
icon: Icons.arrow_upward_rounded,
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
onSelect(CustomRulesSorting.bottomTop);
|
||||
},
|
||||
isSelected: sortingMethod == CustomRulesSorting.bottomTop
|
||||
),
|
||||
]
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: Text(AppLocalizations.of(context)!.close)
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _CustomListTileDialog extends StatelessWidget {
|
||||
final String title;
|
||||
final IconData? icon;
|
||||
final void Function()? onTap;
|
||||
final bool isSelected;
|
||||
|
||||
const _CustomListTileDialog({
|
||||
required this.title,
|
||||
required this.icon,
|
||||
required this.onTap,
|
||||
required this.isSelected,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
icon,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
const SizedBox(width: 24),
|
||||
Flexible(
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 24),
|
||||
Icon(
|
||||
isSelected == true ? Icons.radio_button_checked_rounded : Icons.radio_button_unchecked_rounded,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -5,9 +5,9 @@ class RemoveCustomRule extends StatelessWidget {
|
|||
final void Function() onConfirm;
|
||||
|
||||
const RemoveCustomRule({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.onConfirm
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
|
@ -235,10 +235,10 @@ class _Content extends StatelessWidget {
|
|||
}
|
||||
: null,
|
||||
style: ButtonStyle(
|
||||
overlayColor: MaterialStateProperty.all(
|
||||
overlayColor: WidgetStateProperty.all(
|
||||
Theme.of(context).colorScheme.primary.withOpacity(0.1)
|
||||
),
|
||||
foregroundColor: MaterialStateProperty.all(
|
||||
foregroundColor: WidgetStateProperty.all(
|
||||
selectedOption != null
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Colors.grey,
|
||||
|
|
|
@ -9,11 +9,11 @@ class DeleteSelectionModal extends StatefulWidget {
|
|||
final void Function() onDelete;
|
||||
|
||||
const DeleteSelectionModal({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.selectedBlacklists,
|
||||
required this.selectedWhitelists,
|
||||
required this.onDelete,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
State<DeleteSelectionModal> createState() => _DeleteSelectionModalState();
|
||||
|
|
|
@ -9,11 +9,11 @@ class EnableDisableSelectionModal extends StatefulWidget {
|
|||
final void Function() onDelete;
|
||||
|
||||
const EnableDisableSelectionModal({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.selectedBlacklists,
|
||||
required this.selectedWhitelists,
|
||||
required this.onDelete,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
State<EnableDisableSelectionModal> createState() => _EnableDisableSelectionModalState();
|
||||
|
|
|
@ -13,13 +13,13 @@ class SelectionList extends StatelessWidget {
|
|||
final void Function() unselectAll;
|
||||
|
||||
const SelectionList({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.lists,
|
||||
required this.selectedLists,
|
||||
required this.onSelect,
|
||||
required this.selectAll,
|
||||
required this.unselectAll,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -231,11 +231,10 @@ class _CheckboxTile extends StatelessWidget {
|
|||
final bool isSelected;
|
||||
|
||||
const _CheckboxTile({
|
||||
Key? key,
|
||||
required this.list,
|
||||
required this.onSelect,
|
||||
required this.isSelected,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
|
@ -82,8 +82,8 @@ class _SelectionScreenState extends State<SelectionScreen> with TickerProviderSt
|
|||
blacklists: _selectedBlacklists,
|
||||
whitelists: _selectedWhitelists
|
||||
);
|
||||
if (!mounted) return;
|
||||
processModal.close();
|
||||
if (!context.mounted) return;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => SelectionResultModal(
|
||||
|
@ -113,8 +113,8 @@ class _SelectionScreenState extends State<SelectionScreen> with TickerProviderSt
|
|||
blacklists: _selectedBlacklists,
|
||||
whitelists: _selectedWhitelists
|
||||
);
|
||||
if (!mounted) return;
|
||||
processModal.close();
|
||||
if (!context.mounted) return;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => SelectionResultModal(
|
||||
|
|
|
@ -34,6 +34,7 @@ class HomeAppBar extends StatelessWidget {
|
|||
|
||||
void navigateServers() {
|
||||
Future.delayed(const Duration(milliseconds: 0), (() {
|
||||
if (!context.mounted) return;
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(builder: (context) => const Servers())
|
||||
);
|
||||
|
@ -151,7 +152,8 @@ class HomeAppBar extends StatelessWidget {
|
|||
),
|
||||
)
|
||||
]
|
||||
)
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ class _HomeChartState extends State<HomeChart> {
|
|||
|
||||
if (!(appConfigProvider.hideZeroValues == true && isEmpty == true)) {
|
||||
List<DateTime> dateTimes = [];
|
||||
DateTime currentDate = DateTime.now().subtract(Duration(hours: widget.hoursInterval*widget.data.length+1));
|
||||
DateTime currentDate = DateTime.now().subtract(Duration(hours: widget.hoursInterval*widget.data.length));
|
||||
for (var i = 0; i < widget.data.length; i++) {
|
||||
currentDate = currentDate.add(Duration(hours: widget.hoursInterval));
|
||||
dateTimes.add(currentDate);
|
||||
|
|
|
@ -37,7 +37,7 @@ class CombinedChartItem {
|
|||
}
|
||||
|
||||
class CombinedHomeChart extends StatelessWidget {
|
||||
const CombinedHomeChart({Key? key}) : super(key: key);
|
||||
const CombinedHomeChart({super.key});
|
||||
|
||||
List<int>? removeZero(List<int> list) {
|
||||
final removed = list.where((i) => i > 0);
|
||||
|
@ -266,12 +266,11 @@ class _Legend extends StatelessWidget {
|
|||
final String? secondaryValue;
|
||||
|
||||
const _Legend({
|
||||
Key? key,
|
||||
required this.label,
|
||||
required this.color,
|
||||
required this.primaryValue,
|
||||
this.secondaryValue
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
|
@ -7,7 +7,7 @@ import 'package:adguard_home_manager/providers/status_provider.dart';
|
|||
import 'package:adguard_home_manager/constants/enums.dart';
|
||||
|
||||
class HomeFab extends StatelessWidget {
|
||||
const HomeFab({Key? key}) : super(key: key);
|
||||
const HomeFab({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
|
@ -93,7 +93,7 @@ class _HomeState extends State<Home> {
|
|||
onRefresh: () async {
|
||||
final result = await statusProvider.getServerStatus();
|
||||
if (mounted && result == false) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.serverStatusNotRefreshed,
|
||||
color: Colors.red
|
||||
|
|
|
@ -82,7 +82,7 @@ class _ManagementModalState extends State<ManagementModal> with SingleTickerProv
|
|||
time: time
|
||||
);
|
||||
if (mounted && result == false) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.invalidUsernamePassword,
|
||||
color: Colors.red
|
||||
|
|
|
@ -8,13 +8,13 @@ class SmallSwitch extends StatelessWidget {
|
|||
final bool disabled;
|
||||
|
||||
const SmallSwitch({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.label,
|
||||
required this.icon,
|
||||
required this.value,
|
||||
required this.onChange,
|
||||
required this.disabled,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
|
@ -51,7 +51,7 @@ class TopItemsLists extends StatelessWidget {
|
|||
AppliedFiters(
|
||||
selectedResultStatus: 'all',
|
||||
searchText: value,
|
||||
clients: null
|
||||
clients: []
|
||||
)
|
||||
);
|
||||
appConfigProvider.setSelectedScreen(2);
|
||||
|
@ -83,14 +83,14 @@ class TopItemsLists extends StatelessWidget {
|
|||
|
||||
if (!context.mounted) return;
|
||||
if (rules == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.userFilteringRulesUpdated,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.userFilteringRulesNotUpdated,
|
||||
color: Colors.red
|
||||
|
@ -121,21 +121,21 @@ class TopItemsLists extends StatelessWidget {
|
|||
processModal.close();
|
||||
|
||||
if (result.successful == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientAddedSuccessfully,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else if (result.successful == false && result.content == 'client_another_list') {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientAnotherList,
|
||||
color: Colors.red
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: newList == AccessSettingsList.allowed || newList == AccessSettingsList.disallowed
|
||||
? AppLocalizations.of(context)!.clientNotRemoved
|
||||
|
|
|
@ -9,6 +9,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
|||
|
||||
import 'package:adguard_home_manager/widgets/options_menu.dart';
|
||||
import 'package:adguard_home_manager/widgets/custom_list_tile.dart';
|
||||
import 'package:adguard_home_manager/widgets/floating_search_bar.dart';
|
||||
|
||||
import 'package:adguard_home_manager/models/menu_option.dart';
|
||||
import 'package:adguard_home_manager/constants/enums.dart';
|
||||
|
@ -16,6 +17,7 @@ import 'package:adguard_home_manager/functions/number_format.dart';
|
|||
import 'package:adguard_home_manager/providers/status_provider.dart';
|
||||
|
||||
enum _SortingOptions { highestToLowest, lowestToHighest }
|
||||
final GlobalKey _searchButtonKey = GlobalKey();
|
||||
|
||||
class TopItemsScreen extends StatefulWidget {
|
||||
final HomeTopItems type;
|
||||
|
@ -47,15 +49,18 @@ class TopItemsScreen extends StatefulWidget {
|
|||
|
||||
class _TopItemsScreenState extends State<TopItemsScreen> {
|
||||
_SortingOptions _sortingOptions = _SortingOptions.highestToLowest;
|
||||
bool searchActive = false;
|
||||
final TextEditingController searchController = TextEditingController();
|
||||
String? _currentSearchValue = "";
|
||||
|
||||
List<Map<String, dynamic>> data = [];
|
||||
List<Map<String, dynamic>> screenData = [];
|
||||
|
||||
void search(String value) {
|
||||
List<Map<String, dynamic>> newValues = widget.data.where((item) => item.keys.toList()[0].contains(value)).toList();
|
||||
setState(() => screenData = newValues);
|
||||
setState(() {
|
||||
screenData = newValues;
|
||||
_currentSearchValue = searchController.text;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -75,118 +80,132 @@ class _TopItemsScreenState extends State<TopItemsScreen> {
|
|||
final sortedValues = _sortingOptions == _SortingOptions.lowestToHighest
|
||||
? screenData.reversed.toList()
|
||||
: screenData.toList();
|
||||
|
||||
void showSearchDialog() {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => FloatingSearchBar(
|
||||
existingSearchValue: _currentSearchValue,
|
||||
searchButtonRenderBox: _searchButtonKey.currentContext?.findRenderObject() as RenderBox?,
|
||||
onSearchCompleted: (v) {
|
||||
List<Map<String, dynamic>> newValues = widget.data.where((item) => item.keys.toList()[0].contains(v)).toList();
|
||||
setState(() {
|
||||
screenData = newValues;
|
||||
_currentSearchValue = v;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (widget.isFullscreen == true) {
|
||||
return Dialog.fullscreen(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: searchActive == true
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(bottom: 3),
|
||||
child: TextFormField(
|
||||
controller: searchController,
|
||||
onChanged: search,
|
||||
decoration: InputDecoration(
|
||||
hintText: AppLocalizations.of(context)!.search,
|
||||
hintStyle: const TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 18
|
||||
return Scaffold(
|
||||
body: NestedScrollView(
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||
SliverOverlapAbsorber(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
sliver: SliverAppBar.large(
|
||||
title: Text(widget.title),
|
||||
actions: [
|
||||
IconButton(
|
||||
key: _searchButtonKey,
|
||||
onPressed: showSearchDialog,
|
||||
icon: const Icon(Icons.search_rounded),
|
||||
tooltip: AppLocalizations.of(context)!.search,
|
||||
),
|
||||
PopupMenuButton(
|
||||
icon: const Icon(Icons.sort_rounded),
|
||||
itemBuilder: (context) => [
|
||||
PopupMenuItem(
|
||||
onTap: () => setState(() => _sortingOptions = _SortingOptions.highestToLowest),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.arrow_downward_rounded),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(AppLocalizations.of(context)!.fromHighestToLowest)
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Icon(
|
||||
_sortingOptions == _SortingOptions.highestToLowest
|
||||
? Icons.radio_button_checked_rounded
|
||||
: Icons.radio_button_unchecked_rounded,
|
||||
color: _sortingOptions == _SortingOptions.highestToLowest
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
border: InputBorder.none,
|
||||
),
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 18
|
||||
),
|
||||
autofocus: true,
|
||||
),
|
||||
)
|
||||
: Text(widget.title),
|
||||
leading: searchActive == true ?
|
||||
IconButton(
|
||||
onPressed: () => setState(() {
|
||||
searchActive = false;
|
||||
searchController.text = '';
|
||||
screenData = data;
|
||||
}),
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
tooltip: AppLocalizations.of(context)!.exitSearch,
|
||||
) : null,
|
||||
actions: [
|
||||
if (searchActive == false) IconButton(
|
||||
onPressed: () => setState(() => searchActive = true),
|
||||
icon: const Icon(Icons.search),
|
||||
tooltip: AppLocalizations.of(context)!.search,
|
||||
),
|
||||
if (searchActive == true) IconButton(
|
||||
onPressed: () => setState(() {
|
||||
searchController.text = '';
|
||||
screenData = data;
|
||||
}),
|
||||
icon: const Icon(Icons.clear_rounded),
|
||||
tooltip: AppLocalizations.of(context)!.clearSearch,
|
||||
),
|
||||
PopupMenuButton(
|
||||
icon: const Icon(Icons.sort_rounded),
|
||||
itemBuilder: (context) => [
|
||||
PopupMenuItem(
|
||||
onTap: () => setState(() => _sortingOptions = _SortingOptions.highestToLowest),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.arrow_downward_rounded),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(AppLocalizations.of(context)!.fromHighestToLowest)
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Icon(
|
||||
_sortingOptions == _SortingOptions.highestToLowest
|
||||
? Icons.radio_button_checked_rounded
|
||||
: Icons.radio_button_unchecked_rounded,
|
||||
color: _sortingOptions == _SortingOptions.highestToLowest
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
PopupMenuItem(
|
||||
onTap: () => setState(() => _sortingOptions = _SortingOptions.lowestToHighest),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.arrow_upward_rounded),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(AppLocalizations.of(context)!.fromLowestToHighest)
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Icon(
|
||||
_sortingOptions == _SortingOptions.lowestToHighest
|
||||
? Icons.radio_button_checked_rounded
|
||||
: Icons.radio_button_unchecked_rounded,
|
||||
color: _sortingOptions == _SortingOptions.lowestToHighest
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
PopupMenuItem(
|
||||
onTap: () => setState(() => _sortingOptions = _SortingOptions.lowestToHighest),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.arrow_upward_rounded),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(AppLocalizations.of(context)!.fromLowestToHighest)
|
||||
const SizedBox(width: 8)
|
||||
],
|
||||
)
|
||||
)
|
||||
],
|
||||
body: SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Builder(
|
||||
builder: (context) => CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
if (sortedValues.isEmpty) Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.noItemsSearch,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Icon(
|
||||
_sortingOptions == _SortingOptions.lowestToHighest
|
||||
? Icons.radio_button_checked_rounded
|
||||
: Icons.radio_button_unchecked_rounded,
|
||||
color: _sortingOptions == _SortingOptions.lowestToHighest
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
if (sortedValues.isNotEmpty) SliverPadding(
|
||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewPadding.bottom),
|
||||
sliver: SliverList.builder(
|
||||
itemCount: sortedValues.length,
|
||||
itemBuilder: (context, index) => _Item(
|
||||
data: sortedValues[index],
|
||||
isClient: widget.isClient,
|
||||
options: widget.options,
|
||||
total: total,
|
||||
withProgressBar: widget.withProgressBar,
|
||||
onTapEntry: widget.onTapEntry,
|
||||
buildValue: widget.buildValue,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 8)
|
||||
],
|
||||
),
|
||||
body: SafeArea(
|
||||
child: _Content(
|
||||
buildValue: widget.buildValue,
|
||||
isClient: widget.isClient,
|
||||
onTapEntry: widget.onTapEntry,
|
||||
options: widget.options,
|
||||
screenData: sortedValues,
|
||||
total: total,
|
||||
withProgressBar: widget.withProgressBar,
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -242,14 +261,29 @@ class _TopItemsScreenState extends State<TopItemsScreen> {
|
|||
),
|
||||
),
|
||||
Expanded(
|
||||
child: _Content(
|
||||
buildValue: widget.buildValue,
|
||||
isClient: widget.isClient,
|
||||
onTapEntry: widget.onTapEntry,
|
||||
options: widget.options,
|
||||
screenData: sortedValues,
|
||||
total: total,
|
||||
withProgressBar: widget.withProgressBar,
|
||||
child: sortedValues.isNotEmpty ? ListView.builder(
|
||||
itemCount: sortedValues.length,
|
||||
itemBuilder: (context, index) => _Item(
|
||||
data: sortedValues[index],
|
||||
isClient: widget.isClient,
|
||||
options: widget.options,
|
||||
withProgressBar: widget.withProgressBar,
|
||||
onTapEntry: widget.onTapEntry,
|
||||
buildValue: widget.buildValue,
|
||||
total: total,
|
||||
),
|
||||
) : Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.noItemsSearch,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -260,8 +294,8 @@ class _TopItemsScreenState extends State<TopItemsScreen> {
|
|||
}
|
||||
}
|
||||
|
||||
class _Content extends StatelessWidget {
|
||||
final List<Map<String, dynamic>> screenData;
|
||||
class _Item extends StatelessWidget {
|
||||
final dynamic data;
|
||||
final bool? isClient;
|
||||
final List<MenuOption> Function(dynamic) options;
|
||||
final bool withProgressBar;
|
||||
|
@ -269,8 +303,8 @@ class _Content extends StatelessWidget {
|
|||
final String Function(dynamic) buildValue;
|
||||
final double total;
|
||||
|
||||
const _Content({
|
||||
required this.screenData,
|
||||
const _Item({
|
||||
required this.data,
|
||||
required this.isClient,
|
||||
required this.options,
|
||||
required this.withProgressBar,
|
||||
|
@ -283,98 +317,75 @@ class _Content extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
final statusProvider = Provider.of<StatusProvider>(context);
|
||||
|
||||
if (screenData.isNotEmpty) {
|
||||
return ListView.builder(
|
||||
padding: const EdgeInsets.only(top: 0),
|
||||
itemCount: screenData.length,
|
||||
itemBuilder: (context, index) {
|
||||
String? name;
|
||||
if (isClient != null && isClient == true) {
|
||||
try {
|
||||
name = statusProvider.serverStatus!.clients.firstWhere((c) => c.ids.contains(screenData[index].keys.toList()[0])).name;
|
||||
} catch (e) {
|
||||
// ---- //
|
||||
}
|
||||
}
|
||||
|
||||
return OptionsMenu(
|
||||
options: options,
|
||||
value: screenData[index].keys.toList()[0],
|
||||
onTap: onTapEntry != null
|
||||
? (v) {
|
||||
onTapEntry!(v);
|
||||
Navigator.pop(context);
|
||||
}
|
||||
: null,
|
||||
child: CustomListTile(
|
||||
title: screenData[index].keys.toList()[0],
|
||||
trailing: Text(
|
||||
buildValue(screenData[index].values.toList()[0]),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant
|
||||
),
|
||||
),
|
||||
subtitleWidget: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (name != null) ...[
|
||||
Text(
|
||||
name,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
],
|
||||
if (withProgressBar == true) Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 50,
|
||||
child: Text(
|
||||
"${doubleFormat((screenData[index].values.toList()[0]/total*100), Platform.localeName)}%",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).listTileTheme.textColor
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Flexible(
|
||||
child: LinearPercentIndicator(
|
||||
animation: true,
|
||||
lineHeight: 4,
|
||||
animationDuration: 500,
|
||||
curve: Curves.easeOut,
|
||||
percent: screenData[index].values.toList()[0]/total,
|
||||
barRadius: const Radius.circular(5),
|
||||
progressColor: Theme.of(context).colorScheme.primary,
|
||||
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
);
|
||||
String? name;
|
||||
if (isClient != null && isClient == true) {
|
||||
try {
|
||||
name = statusProvider.serverStatus!.clients.firstWhere((c) => c.ids.contains(data.keys.toList()[0])).name;
|
||||
} catch (e) {
|
||||
// ---- //
|
||||
}
|
||||
}
|
||||
else {
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.noItemsSearch,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
|
||||
return OptionsMenu(
|
||||
options: options,
|
||||
value: data.keys.toList()[0],
|
||||
onTap: onTapEntry != null
|
||||
? (v) {
|
||||
onTapEntry!(v);
|
||||
Navigator.pop(context);
|
||||
}
|
||||
: null,
|
||||
child: CustomListTile(
|
||||
title: data.keys.toList()[0],
|
||||
trailing: Text(
|
||||
buildValue(data.values.toList()[0]),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
subtitleWidget: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (name != null) ...[
|
||||
Text(
|
||||
name,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
],
|
||||
if (withProgressBar == true) Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 50,
|
||||
child: Text(
|
||||
"${doubleFormat((data.values.toList()[0]/total*100), Platform.localeName)}%",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).listTileTheme.textColor
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Flexible(
|
||||
child: LinearPercentIndicator(
|
||||
animation: true,
|
||||
lineHeight: 4,
|
||||
animationDuration: 500,
|
||||
curve: Curves.easeOut,
|
||||
percent: data.values.toList()[0]/total,
|
||||
barRadius: const Radius.circular(5),
|
||||
progressColor: Theme.of(context).colorScheme.primary,
|
||||
backgroundColor: Theme.of(context).colorScheme.surfaceTint.withOpacity(0.2),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -10,6 +10,7 @@ import 'package:adguard_home_manager/screens/logs/details/log_list_tile.dart';
|
|||
|
||||
import 'package:adguard_home_manager/functions/desktop_mode.dart';
|
||||
import 'package:adguard_home_manager/functions/open_url.dart';
|
||||
import 'package:adguard_home_manager/functions/copy_clipboard.dart';
|
||||
import 'package:adguard_home_manager/constants/urls.dart';
|
||||
import 'package:adguard_home_manager/classes/process_modal.dart';
|
||||
import 'package:adguard_home_manager/functions/get_filtered_status.dart';
|
||||
|
@ -23,11 +24,13 @@ import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
|||
class LogDetailsScreen extends StatelessWidget {
|
||||
final Log log;
|
||||
final bool dialog;
|
||||
final bool twoColumns;
|
||||
|
||||
const LogDetailsScreen({
|
||||
super.key,
|
||||
required this.log,
|
||||
required this.dialog
|
||||
required this.dialog,
|
||||
required this.twoColumns,
|
||||
});
|
||||
|
||||
@override
|
||||
|
@ -37,27 +40,6 @@ class LogDetailsScreen extends StatelessWidget {
|
|||
|
||||
final width = MediaQuery.of(context).size.width;
|
||||
|
||||
Filter? getList(int id) {
|
||||
try {
|
||||
return statusProvider.filteringStatus!.filters.firstWhere((filter) => filter.id == id, orElse: () {
|
||||
return statusProvider.filteringStatus!.whitelistFilters.firstWhere((filter) => filter.id == id);
|
||||
});
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Widget getResult() {
|
||||
final filter = getFilteredStatus(context, appConfigProvider, log.reason, true);
|
||||
return Text(
|
||||
filter['label'],
|
||||
style: TextStyle(
|
||||
color: filter['color'],
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void blockUnblock(String domain, String newStatus) async {
|
||||
final ProcessModal processModal = ProcessModal();
|
||||
processModal.open(AppLocalizations.of(context)!.savingUserFilters);
|
||||
|
@ -70,14 +52,14 @@ class LogDetailsScreen extends StatelessWidget {
|
|||
processModal.close();
|
||||
|
||||
if (rules == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.userFilteringRulesUpdated,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.userFilteringRulesNotUpdated,
|
||||
color: Colors.red
|
||||
|
@ -85,132 +67,6 @@ class LogDetailsScreen extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
|
||||
List<Widget> content() {
|
||||
return [
|
||||
SectionLabel(label: AppLocalizations.of(context)!.status),
|
||||
LogListTile(
|
||||
icon: Icons.shield_rounded,
|
||||
title: AppLocalizations.of(context)!.result,
|
||||
subtitleWidget: getResult(),
|
||||
trailing: log.cached == true
|
||||
? Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 5
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).floatingActionButtonTheme.backgroundColor,
|
||||
borderRadius: BorderRadius.circular(30)
|
||||
),
|
||||
child: Text(
|
||||
"CACHE",
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).floatingActionButtonTheme.foregroundColor,
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
if (log.rule != null) LogListTile(
|
||||
icon: Icons.block,
|
||||
title: AppLocalizations.of(context)!.blockingRule,
|
||||
subtitle: log.rule
|
||||
),
|
||||
LogListTile(
|
||||
icon: Icons.schedule,
|
||||
title: AppLocalizations.of(context)!.time,
|
||||
subtitle: convertTimestampLocalTimezone(log.time, 'HH:mm:ss')
|
||||
),
|
||||
SectionLabel(label: AppLocalizations.of(context)!.request),
|
||||
LogListTile(
|
||||
icon: Icons.domain_rounded,
|
||||
title: AppLocalizations.of(context)!.domain,
|
||||
subtitle: log.question.name
|
||||
),
|
||||
LogListTile(
|
||||
icon: Icons.category_rounded,
|
||||
title: AppLocalizations.of(context)!.type,
|
||||
subtitle: log.question.type
|
||||
),
|
||||
LogListTile(
|
||||
icon: Icons.class_rounded,
|
||||
title: AppLocalizations.of(context)!.clas,
|
||||
subtitle: log.question.questionClass
|
||||
),
|
||||
SectionLabel(label: AppLocalizations.of(context)!.response),
|
||||
if (log.upstream != null && log.upstream != '') LogListTile(
|
||||
icon: Icons.dns_rounded,
|
||||
title: AppLocalizations.of(context)!.dnsServer,
|
||||
subtitle: log.upstream
|
||||
),
|
||||
LogListTile(
|
||||
icon: Icons.timer_rounded,
|
||||
title: AppLocalizations.of(context)!.elapsedTime,
|
||||
subtitle: "${double.parse(log.elapsedMs).toStringAsFixed(2)} ms"
|
||||
),
|
||||
if (log.status != null) LogListTile(
|
||||
icon: Icons.system_update_alt_rounded,
|
||||
title: AppLocalizations.of(context)!.responseCode,
|
||||
subtitle: log.status
|
||||
),
|
||||
SectionLabel(label: AppLocalizations.of(context)!.client),
|
||||
LogListTile(
|
||||
icon: Icons.smartphone_rounded,
|
||||
title: AppLocalizations.of(context)!.deviceIp,
|
||||
subtitle: log.client
|
||||
),
|
||||
if (log.clientInfo != null && log.clientInfo!.name != '') LogListTile(
|
||||
icon: Icons.abc_rounded,
|
||||
title: AppLocalizations.of(context)!.deviceName,
|
||||
subtitle: log.clientInfo!.name
|
||||
),
|
||||
if (log.rules.isNotEmpty) ...[
|
||||
SectionLabel(label: AppLocalizations.of(context)!.rules),
|
||||
...log.rules.map((rule) {
|
||||
final Filter? list = getList(rule.filterListId);
|
||||
if (list != null) {
|
||||
return LogListTile(
|
||||
icon: Icons.rule_rounded,
|
||||
title: rule.text,
|
||||
subtitle: list.name
|
||||
);
|
||||
}
|
||||
else {
|
||||
return const SizedBox();
|
||||
}
|
||||
}).toList()
|
||||
],
|
||||
if (log.answer.isNotEmpty) ...[
|
||||
SectionLabel(label: AppLocalizations.of(context)!.answers),
|
||||
...log.answer.map((a) => LogListTile(
|
||||
icon: Icons.download_rounded,
|
||||
title: a.value,
|
||||
subtitle: "TTL: ${a.ttl.toString()}",
|
||||
trailing: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 5
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).floatingActionButtonTheme.backgroundColor,
|
||||
borderRadius: BorderRadius.circular(30)
|
||||
),
|
||||
child: Text(
|
||||
a.type,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).floatingActionButtonTheme.foregroundColor,
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
)
|
||||
)).toList()
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
if (dialog) {
|
||||
return Dialog(
|
||||
child: ConstrainedBox(
|
||||
|
@ -271,7 +127,9 @@ class LogDetailsScreen extends StatelessWidget {
|
|||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: ListView(
|
||||
children: content(),
|
||||
children: [
|
||||
_Content(log: log)
|
||||
]
|
||||
)
|
||||
),
|
||||
)
|
||||
|
@ -292,6 +150,7 @@ class LogDetailsScreen extends StatelessWidget {
|
|||
centerTitle: false,
|
||||
forceElevated: innerBoxIsScrolled,
|
||||
surfaceTintColor: isDesktop(width) ? Colors.transparent : null,
|
||||
automaticallyImplyLeading: twoColumns != true,
|
||||
title: Text(AppLocalizations.of(context)!.logDetails),
|
||||
actions: [
|
||||
IconButton(
|
||||
|
@ -329,7 +188,9 @@ class LogDetailsScreen extends StatelessWidget {
|
|||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
SliverList.list(
|
||||
children: content()
|
||||
children: [
|
||||
_Content(log: log)
|
||||
]
|
||||
)
|
||||
],
|
||||
),
|
||||
|
@ -339,4 +200,174 @@ class LogDetailsScreen extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class _Content extends StatelessWidget {
|
||||
final Log log;
|
||||
|
||||
const _Content({
|
||||
required this.log,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
||||
final statusProvider = Provider.of<StatusProvider>(context);
|
||||
|
||||
Widget getResult() {
|
||||
final filter = getFilteredStatus(context, appConfigProvider, log.reason, true);
|
||||
return Text(
|
||||
filter['label'],
|
||||
style: TextStyle(
|
||||
color: filter['color'],
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Filter? getList(int id) {
|
||||
try {
|
||||
return statusProvider.filteringStatus!.filters.firstWhere((filter) => filter.id == id, orElse: () {
|
||||
return statusProvider.filteringStatus!.whitelistFilters.firstWhere((filter) => filter.id == id);
|
||||
});
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
SectionLabel(label: AppLocalizations.of(context)!.status),
|
||||
LogListTile(
|
||||
icon: Icons.shield_rounded,
|
||||
title: AppLocalizations.of(context)!.result,
|
||||
subtitleWidget: getResult(),
|
||||
trailing: log.cached == true
|
||||
? Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 5
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).floatingActionButtonTheme.backgroundColor,
|
||||
borderRadius: BorderRadius.circular(30)
|
||||
),
|
||||
child: Text(
|
||||
"CACHE",
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).floatingActionButtonTheme.foregroundColor,
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
if (log.rule != null) LogListTile(
|
||||
icon: Icons.block,
|
||||
title: AppLocalizations.of(context)!.blockingRule,
|
||||
subtitle: log.rule
|
||||
),
|
||||
LogListTile(
|
||||
icon: Icons.calendar_month_rounded,
|
||||
title: AppLocalizations.of(context)!.date,
|
||||
subtitle: convertTimestampLocalTimezone(log.time, 'dd-MM-yyyy')
|
||||
),
|
||||
LogListTile(
|
||||
icon: Icons.schedule,
|
||||
title: AppLocalizations.of(context)!.time,
|
||||
subtitle: convertTimestampLocalTimezone(log.time, 'HH:mm:ss')
|
||||
),
|
||||
SectionLabel(label: AppLocalizations.of(context)!.request),
|
||||
if (log.question.name != null) LogListTile(
|
||||
icon: Icons.domain_rounded,
|
||||
title: AppLocalizations.of(context)!.domain,
|
||||
subtitle: log.question.name,
|
||||
onTap: () => copyToClipboard(value: log.question.name!, successMessage: AppLocalizations.of(context)!.domainCopiedClipboard),
|
||||
),
|
||||
LogListTile(
|
||||
icon: Icons.category_rounded,
|
||||
title: AppLocalizations.of(context)!.type,
|
||||
subtitle: log.question.type
|
||||
),
|
||||
LogListTile(
|
||||
icon: Icons.class_rounded,
|
||||
title: AppLocalizations.of(context)!.clas,
|
||||
subtitle: log.question.questionClass
|
||||
),
|
||||
SectionLabel(label: AppLocalizations.of(context)!.response),
|
||||
if (log.upstream != null && log.upstream != '') LogListTile(
|
||||
icon: Icons.dns_rounded,
|
||||
title: AppLocalizations.of(context)!.dnsServer,
|
||||
subtitle: log.upstream,
|
||||
onTap: () => copyToClipboard(value: log.upstream!, successMessage: AppLocalizations.of(context)!.dnsServerAddressCopied)
|
||||
),
|
||||
LogListTile(
|
||||
icon: Icons.timer_rounded,
|
||||
title: AppLocalizations.of(context)!.elapsedTime,
|
||||
subtitle: "${double.parse(log.elapsedMs).toStringAsFixed(2)} ms"
|
||||
),
|
||||
if (log.status != null) LogListTile(
|
||||
icon: Icons.system_update_alt_rounded,
|
||||
title: AppLocalizations.of(context)!.responseCode,
|
||||
subtitle: log.status
|
||||
),
|
||||
SectionLabel(label: AppLocalizations.of(context)!.client),
|
||||
LogListTile(
|
||||
icon: Icons.smartphone_rounded,
|
||||
title: AppLocalizations.of(context)!.deviceIp,
|
||||
subtitle: log.client,
|
||||
onTap: () => copyToClipboard(value: log.client, successMessage: AppLocalizations.of(context)!.clientIpCopied),
|
||||
),
|
||||
if (log.clientInfo != null && log.clientInfo!.name != '') LogListTile(
|
||||
icon: Icons.abc_rounded,
|
||||
title: AppLocalizations.of(context)!.deviceName,
|
||||
subtitle: log.clientInfo!.name,
|
||||
onTap: () => copyToClipboard(value: log.clientInfo!.name, successMessage: AppLocalizations.of(context)!.clientNameCopied),
|
||||
),
|
||||
if (log.rules.isNotEmpty) ...[
|
||||
SectionLabel(label: AppLocalizations.of(context)!.rules),
|
||||
...log.rules.map((rule) {
|
||||
final Filter? list = getList(rule.filterListId);
|
||||
if (list != null) {
|
||||
return LogListTile(
|
||||
icon: Icons.rule_rounded,
|
||||
title: rule.text,
|
||||
subtitle: list.name
|
||||
);
|
||||
}
|
||||
else {
|
||||
return const SizedBox();
|
||||
}
|
||||
})
|
||||
],
|
||||
if (log.answer.isNotEmpty) ...[
|
||||
SectionLabel(label: AppLocalizations.of(context)!.answers),
|
||||
...log.answer.map((a) => LogListTile(
|
||||
icon: Icons.download_rounded,
|
||||
title: a.value,
|
||||
subtitle: "TTL: ${a.ttl.toString()}",
|
||||
trailing: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 5
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).floatingActionButtonTheme.backgroundColor,
|
||||
borderRadius: BorderRadius.circular(30)
|
||||
),
|
||||
child: Text(
|
||||
a.type,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).floatingActionButtonTheme.foregroundColor,
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
),
|
||||
)
|
||||
))
|
||||
]
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
|
@ -6,63 +6,68 @@ class LogListTile extends StatelessWidget {
|
|||
final String? subtitle;
|
||||
final Widget? subtitleWidget;
|
||||
final Widget? trailing;
|
||||
final void Function()? onTap;
|
||||
|
||||
const LogListTile({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.icon,
|
||||
required this.title,
|
||||
this.subtitle,
|
||||
this.subtitleWidget,
|
||||
this.trailing,
|
||||
}) : super(key: key);
|
||||
this.onTap,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
icon,
|
||||
size: 24,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Flexible(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 3),
|
||||
subtitleWidget ?? Text(
|
||||
subtitle!,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).listTileTheme.textColor,
|
||||
),
|
||||
)
|
||||
],
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
icon,
|
||||
size: 24,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(width: 16),
|
||||
Flexible(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 3),
|
||||
subtitleWidget ?? Text(
|
||||
subtitle!,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).listTileTheme.textColor,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (trailing != null) ...[
|
||||
const SizedBox(width: 16),
|
||||
trailing!
|
||||
]
|
||||
],
|
||||
if (trailing != null) ...[
|
||||
const SizedBox(width: 16),
|
||||
trailing!
|
||||
]
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -2,15 +2,31 @@ import 'dart:io';
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:segmented_button_slide/segmented_button_slide.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/widgets/custom_checkbox_list_tile.dart';
|
||||
import 'package:adguard_home_manager/functions/is_ip.dart';
|
||||
import 'package:adguard_home_manager/widgets/list_bottom_sheet.dart';
|
||||
import 'package:adguard_home_manager/widgets/custom_list_tile.dart';
|
||||
|
||||
import 'package:adguard_home_manager/providers/status_provider.dart';
|
||||
import 'package:adguard_home_manager/providers/clients_provider.dart';
|
||||
import 'package:adguard_home_manager/providers/logs_provider.dart';
|
||||
|
||||
class ClientsModal extends StatelessWidget {
|
||||
class _ClientLog {
|
||||
final String ip;
|
||||
final String? name;
|
||||
final List<String>? ids;
|
||||
|
||||
const _ClientLog({
|
||||
required this.ip,
|
||||
required this.name,
|
||||
this.ids,
|
||||
});
|
||||
}
|
||||
|
||||
class ClientsModal extends StatefulWidget {
|
||||
final List<String>? value;
|
||||
final bool dialog;
|
||||
|
||||
|
@ -20,248 +36,384 @@ class ClientsModal extends StatelessWidget {
|
|||
required this.dialog
|
||||
});
|
||||
|
||||
@override
|
||||
State<ClientsModal> createState() => _ClientsModalState();
|
||||
}
|
||||
|
||||
class _ClientsModalState extends State<ClientsModal> {
|
||||
List<_ClientLog> _filteredClients = [];
|
||||
final _searchController = TextEditingController();
|
||||
int _selectedList = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
final clientsProvider = Provider.of<ClientsProvider>(context, listen: false);
|
||||
final statusProvider = Provider.of<StatusProvider>(context, listen: false);
|
||||
_filteredClients = clientsProvider.clients!.autoClients.map((e) {
|
||||
String? name;
|
||||
try {
|
||||
name = statusProvider.serverStatus!.clients.firstWhere((c) => c.ids.contains(e.ip)).name;
|
||||
} catch (e) {
|
||||
// ---- //
|
||||
}
|
||||
return _ClientLog(
|
||||
ip: e.ip,
|
||||
name: name
|
||||
);
|
||||
}).toList();
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final clientsProvider = Provider.of<ClientsProvider>(context);
|
||||
final logsProvider = Provider.of<LogsProvider>(context);
|
||||
final statusProvider = Provider.of<StatusProvider>(context);
|
||||
|
||||
if (dialog == true) {
|
||||
void onSearch({required String value, int? selectedList}) {
|
||||
if ((selectedList ?? _selectedList) == 1) {
|
||||
final filtered = clientsProvider.clients!.clients.map((e) {
|
||||
String? name;
|
||||
try {
|
||||
name = statusProvider.serverStatus!.clients.firstWhere((c) => c.ids.contains(e.ids[0])).name;
|
||||
} catch (e) {
|
||||
// ---- //
|
||||
}
|
||||
return _ClientLog(
|
||||
ip: e.ids[0],
|
||||
name: name,
|
||||
ids: e.ids
|
||||
);
|
||||
}).where(
|
||||
(c) => c.ip.contains(value.toLowerCase()) || (c.name != null && c.name!.toLowerCase().contains(value.toLowerCase()))
|
||||
).toList();
|
||||
setState(() => _filteredClients = filtered);
|
||||
}
|
||||
else {
|
||||
final filtered = clientsProvider.clients!.autoClients.map((e) {
|
||||
String? name;
|
||||
try {
|
||||
name = statusProvider.serverStatus!.clients.firstWhere((c) => c.ids.contains(e.ip)).name;
|
||||
} catch (e) {
|
||||
// ---- //
|
||||
}
|
||||
return _ClientLog(
|
||||
ip: e.ip,
|
||||
name: name
|
||||
);
|
||||
}).where(
|
||||
(c) => c.ip.contains(value.toLowerCase()) || (c.name != null && c.name!.toLowerCase().contains(value.toLowerCase()))
|
||||
).toList();
|
||||
setState(() => _filteredClients = filtered);
|
||||
}
|
||||
}
|
||||
|
||||
void onListChange(int list) {
|
||||
onSearch(value: _searchController.text, selectedList: list);
|
||||
}
|
||||
|
||||
void searchAddedClient(_ClientLog client) {
|
||||
final ips = client.ids?.where((e) => isIpAddress(e) == true).toList();
|
||||
if (ips == null || ips.isEmpty) return;
|
||||
logsProvider.setSearchText(ips[0]);
|
||||
logsProvider.filterLogs();
|
||||
Navigator.of(context).pop();
|
||||
Navigator.pop(context);
|
||||
}
|
||||
|
||||
if (widget.dialog == true) {
|
||||
return Dialog(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 500
|
||||
),
|
||||
child: _ModalContent(
|
||||
selectedClients: logsProvider.selectedClients,
|
||||
onClientsSelected: (v) => logsProvider.setSelectedClients(v),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
children: [
|
||||
CloseButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.clients,
|
||||
style: const TextStyle(
|
||||
fontSize: 22
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: ListView(
|
||||
children: [
|
||||
_SearchField(
|
||||
controller: _searchController,
|
||||
onClear: () => setState(() => _searchController.text = ""),
|
||||
onSearch: (v) => onSearch(value: v)
|
||||
),
|
||||
Card(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.info_rounded,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Flexible(
|
||||
child: Text(AppLocalizations.of(context)!.selectClientsFiltersInfo)
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: SegmentedButtonSlide(
|
||||
entries: [
|
||||
SegmentedButtonSlideEntry(icon: Icons.devices, label: AppLocalizations.of(context)!.activeClients),
|
||||
SegmentedButtonSlideEntry(icon: Icons.add_rounded, label: AppLocalizations.of(context)!.added),
|
||||
],
|
||||
selectedEntry: _selectedList,
|
||||
onChange: (v) {
|
||||
onListChange(v);
|
||||
setState(() => _selectedList = v);
|
||||
},
|
||||
colors: SegmentedButtonSlideColors(
|
||||
barColor: Theme.of(context).colorScheme.primary.withOpacity(0.2),
|
||||
backgroundSelectedColor: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
selectedTextStyle: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
),
|
||||
unselectedTextStyle: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
hoverTextStyle: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
ListView.builder(
|
||||
primary: false,
|
||||
shrinkWrap: true,
|
||||
itemCount: _filteredClients.length,
|
||||
itemBuilder: (context, index) => _ListItem(
|
||||
title: _filteredClients[index].ip,
|
||||
subtitle: _selectedList == 0 ? _filteredClients[index].name : _filteredClients[index].ids?.join(", "),
|
||||
checkboxActive: logsProvider.selectedClients.contains(_filteredClients[index].ip),
|
||||
isAddedClient: _selectedList == 0,
|
||||
onSearchAddedClient: () => searchAddedClient(_filteredClients[index]),
|
||||
onChanged: (isSelected) {
|
||||
if (isSelected == true) {
|
||||
logsProvider.setSelectedClients([
|
||||
...logsProvider.selectedClients,
|
||||
_filteredClients[index].ip
|
||||
]);
|
||||
}
|
||||
else {
|
||||
logsProvider.setSelectedClients(
|
||||
logsProvider.selectedClients.where(
|
||||
(item) => item != _filteredClients[index].ip
|
||||
).toList()
|
||||
);
|
||||
}
|
||||
}
|
||||
)
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
if (Platform.isIOS) const SizedBox(height: 16)
|
||||
],
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
return ListBottomSheet(
|
||||
icon: Icons.smartphone_rounded,
|
||||
title: AppLocalizations.of(context)!.clients,
|
||||
children: [
|
||||
Card(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.info_rounded,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Flexible(
|
||||
child: Text(AppLocalizations.of(context)!.selectClientsFiltersInfo)
|
||||
)
|
||||
],
|
||||
return Padding(
|
||||
padding: MediaQuery.of(context).viewInsets,
|
||||
child: ListBottomSheet(
|
||||
icon: Icons.smartphone_rounded,
|
||||
title: AppLocalizations.of(context)!.clients,
|
||||
children: [
|
||||
_SearchField(
|
||||
controller: _searchController,
|
||||
onClear: () => setState(() => _searchController.text = ""),
|
||||
onSearch: (v) => onSearch(value: v)
|
||||
),
|
||||
Card(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.info_rounded,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Flexible(
|
||||
child: Text(AppLocalizations.of(context)!.selectClientsFiltersInfo)
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
CustomCheckboxListTile(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 24,
|
||||
top: 8,
|
||||
right: 12,
|
||||
bottom: 8
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: SegmentedButtonSlide(
|
||||
entries: [
|
||||
SegmentedButtonSlideEntry(icon: Icons.devices, label: AppLocalizations.of(context)!.activeClients),
|
||||
SegmentedButtonSlideEntry(icon: Icons.add_rounded, label: AppLocalizations.of(context)!.added),
|
||||
],
|
||||
selectedEntry: _selectedList,
|
||||
onChange: (v) {
|
||||
onListChange(v);
|
||||
setState(() => _selectedList = v);
|
||||
},
|
||||
colors: SegmentedButtonSlideColors(
|
||||
barColor: Theme.of(context).colorScheme.primary.withOpacity(0.2),
|
||||
backgroundSelectedColor: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
selectedTextStyle: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
fontWeight: FontWeight.w700
|
||||
),
|
||||
unselectedTextStyle: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
hoverTextStyle: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
value: logsProvider.selectedClients.length == clientsProvider.clients!.autoClients.length,
|
||||
onChanged: (v) {
|
||||
if (v == true) {
|
||||
logsProvider.setSelectedClients(clientsProvider.clients!.autoClients.map((e) => e.ip).toList());
|
||||
}
|
||||
else {
|
||||
logsProvider.setSelectedClients([]);
|
||||
}
|
||||
},
|
||||
title: AppLocalizations.of(context)!.selectAll
|
||||
),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
primary: false,
|
||||
itemCount: clientsProvider.clients!.autoClients.length,
|
||||
itemBuilder: (context, index) => _ListItem(
|
||||
label: clientsProvider.clients!.autoClients[index].ip,
|
||||
checkboxActive: logsProvider.selectedClients.contains(clientsProvider.clients!.autoClients[index].ip),
|
||||
onChanged: (isSelected) {
|
||||
if (isSelected == true) {
|
||||
logsProvider.setSelectedClients([
|
||||
...logsProvider.selectedClients,
|
||||
clientsProvider.clients!.autoClients[index].ip
|
||||
]);
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
primary: false,
|
||||
itemCount: _filteredClients.length,
|
||||
itemBuilder: (context, index) => _ListItem(
|
||||
title: _selectedList == 0 ? _filteredClients[index].ip : _filteredClients[index].name ?? "",
|
||||
subtitle: _selectedList == 0 ? _filteredClients[index].name : _filteredClients[index].ids?.join(", "),
|
||||
checkboxActive: logsProvider.selectedClients.contains(_filteredClients[index].ip),
|
||||
isAddedClient: _selectedList == 1,
|
||||
onSearchAddedClient: _filteredClients[index].ids != null && _filteredClients[index].ids!.where((e) => isIpAddress(e) == true).isNotEmpty ? () => searchAddedClient(_filteredClients[index]) : null,
|
||||
onChanged: (isSelected) {
|
||||
if (isSelected == true) {
|
||||
logsProvider.setSelectedClients([
|
||||
...logsProvider.selectedClients,
|
||||
_filteredClients[index].ip
|
||||
]);
|
||||
}
|
||||
else {
|
||||
logsProvider.setSelectedClients(
|
||||
logsProvider.selectedClients.where(
|
||||
(item) => item != _filteredClients[index].ip
|
||||
).toList()
|
||||
);
|
||||
}
|
||||
}
|
||||
else {
|
||||
logsProvider.setSelectedClients(
|
||||
logsProvider.selectedClients.where(
|
||||
(item) => item != clientsProvider.clients!.autoClients[index].ip
|
||||
).toList()
|
||||
);
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
]
|
||||
)
|
||||
),
|
||||
]
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class _ModalContent extends StatelessWidget {
|
||||
final List<String> selectedClients;
|
||||
final void Function(List<String>) onClientsSelected;
|
||||
class _SearchField extends StatelessWidget {
|
||||
final TextEditingController controller;
|
||||
final void Function(String) onSearch;
|
||||
final void Function() onClear;
|
||||
|
||||
const _ModalContent({
|
||||
required this.selectedClients,
|
||||
required this.onClientsSelected,
|
||||
const _SearchField({
|
||||
required this.controller,
|
||||
required this.onClear,
|
||||
required this.onSearch,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final clientsProvider = Provider.of<ClientsProvider>(context);
|
||||
final logsProvider = Provider.of<LogsProvider>(context);
|
||||
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
children: [
|
||||
CloseButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.clients,
|
||||
style: const TextStyle(
|
||||
fontSize: 22
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: ListView(
|
||||
children: [
|
||||
Card(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.info_rounded,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Flexible(
|
||||
child: Text(AppLocalizations.of(context)!.selectClientsFiltersInfo)
|
||||
)
|
||||
],
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: TextFormField(
|
||||
controller: controller,
|
||||
onChanged: onSearch,
|
||||
decoration: InputDecoration(
|
||||
hintText: AppLocalizations.of(context)!.search,
|
||||
prefixIcon: const Icon(Icons.search_rounded),
|
||||
border: InputBorder.none,
|
||||
filled: true,
|
||||
fillColor: Colors.grey.withOpacity(0.2),
|
||||
suffixIcon: controller.text != ""
|
||||
? IconButton(
|
||||
onPressed: onClear,
|
||||
icon: const Icon(
|
||||
Icons.close_rounded,
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
CustomCheckboxListTile(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 24,
|
||||
top: 8,
|
||||
right: 12,
|
||||
bottom: 8
|
||||
),
|
||||
value: logsProvider.selectedClients.length == clientsProvider.clients!.autoClients.length,
|
||||
onChanged: (v) {
|
||||
if (v == true) {
|
||||
logsProvider.setSelectedClients(clientsProvider.clients!.autoClients.map((e) => e.ip).toList());
|
||||
}
|
||||
else {
|
||||
logsProvider.setSelectedClients([]);
|
||||
}
|
||||
},
|
||||
title: AppLocalizations.of(context)!.selectAll
|
||||
),
|
||||
ListView.builder(
|
||||
primary: false,
|
||||
shrinkWrap: true,
|
||||
itemCount: clientsProvider.clients!.autoClients.length,
|
||||
itemBuilder: (context, index) => _ListItem(
|
||||
label: clientsProvider.clients!.autoClients[index].ip,
|
||||
checkboxActive: selectedClients.contains(clientsProvider.clients!.autoClients[index].ip),
|
||||
onChanged: (isSelected) {
|
||||
if (isSelected == true) {
|
||||
onClientsSelected([
|
||||
...selectedClients,
|
||||
clientsProvider.clients!.autoClients[index].ip
|
||||
]);
|
||||
}
|
||||
else {
|
||||
onClientsSelected(
|
||||
selectedClients.where(
|
||||
(item) => item != clientsProvider.clients!.autoClients[index].ip
|
||||
).toList()
|
||||
);
|
||||
}
|
||||
}
|
||||
tooltip: AppLocalizations.of(context)!.clearSearch,
|
||||
)
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
if (Platform.isIOS) const SizedBox(height: 16)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ListItem extends StatelessWidget {
|
||||
final String label;
|
||||
final bool checkboxActive;
|
||||
final void Function(bool) onChanged;
|
||||
|
||||
const _ListItem({
|
||||
required this.label,
|
||||
required this.checkboxActive,
|
||||
required this.onChanged,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => onChanged(!checkboxActive),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 24,
|
||||
top: 4,
|
||||
right: 12,
|
||||
bottom: 4
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
),
|
||||
),
|
||||
Checkbox(
|
||||
value: checkboxActive,
|
||||
onChanged: (v) => onChanged(!checkboxActive),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5)
|
||||
),
|
||||
)
|
||||
],
|
||||
: null
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ListItem extends StatelessWidget {
|
||||
final String title;
|
||||
final String? subtitle;
|
||||
final bool checkboxActive;
|
||||
final void Function(bool) onChanged;
|
||||
final bool isAddedClient;
|
||||
final void Function()? onSearchAddedClient;
|
||||
|
||||
const _ListItem({
|
||||
required this.title,
|
||||
this.subtitle,
|
||||
required this.checkboxActive,
|
||||
required this.onChanged,
|
||||
required this.isAddedClient,
|
||||
required this.onSearchAddedClient,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (isAddedClient == true) {
|
||||
return CustomListTile(
|
||||
title: title,
|
||||
subtitle: subtitle,
|
||||
trailing: TextButton(
|
||||
onPressed: onSearchAddedClient,
|
||||
child: Text(AppLocalizations.of(context)!.select)
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
return CustomCheckboxListTile(
|
||||
value: checkboxActive,
|
||||
onChanged: (v) => onChanged(v),
|
||||
title: title,
|
||||
subtitle: subtitle,
|
||||
padding: const EdgeInsets.only(
|
||||
left: 24,
|
||||
top: 8,
|
||||
right: 12,
|
||||
bottom: 8
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +1,11 @@
|
|||
import 'dart:io';
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/widgets/list_bottom_sheet.dart';
|
||||
|
||||
import 'package:adguard_home_manager/providers/logs_provider.dart';
|
||||
|
||||
class FilterStatusModal extends StatefulWidget {
|
||||
|
@ -33,169 +35,141 @@ class _FilterStatusModalState extends State<FilterStatusModal> {
|
|||
Widget build(BuildContext context) {
|
||||
final logsProvider = Provider.of<LogsProvider>(context);
|
||||
|
||||
void apply() async {
|
||||
logsProvider.setSelectedResultStatus(value: selectedResultStatus);
|
||||
|
||||
Navigator.pop(context);
|
||||
}
|
||||
|
||||
if (widget.dialog == true) {
|
||||
return Dialog(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 400
|
||||
),
|
||||
child: _Content(
|
||||
onApply: apply,
|
||||
updateSelectedResultStatus: (v) => setState(() => selectedResultStatus = v),
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Flexible(
|
||||
child: SingleChildScrollView(
|
||||
child: Wrap(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 16, left: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
CloseButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.responseStatus,
|
||||
style: const TextStyle(
|
||||
fontSize: 22
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(height: 16),
|
||||
_ItemsList(
|
||||
selectedResultStatus: logsProvider.selectedResultStatus,
|
||||
updateSelectedResultStatus: (v) => logsProvider.setSelectedResultStatus(value: v),
|
||||
),
|
||||
Container(height: 16)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(28),
|
||||
topRight: Radius.circular(28)
|
||||
),
|
||||
color: Theme.of(context).dialogBackgroundColor
|
||||
return SizedBox(
|
||||
height: 700,
|
||||
child: ListBottomSheet(
|
||||
icon: Icons.shield_rounded,
|
||||
title: AppLocalizations.of(context)!.responseStatus,
|
||||
initialChildSize: 1,
|
||||
minChildSize: 0.5,
|
||||
children: [
|
||||
_ItemsList(
|
||||
selectedResultStatus: logsProvider.selectedResultStatus,
|
||||
updateSelectedResultStatus: (v) => logsProvider.setSelectedResultStatus(value: v),
|
||||
)
|
||||
]
|
||||
),
|
||||
child: SafeArea(
|
||||
child: _Content(
|
||||
onApply: apply,
|
||||
updateSelectedResultStatus: (v) => setState(() => selectedResultStatus = v),
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class _Content extends StatelessWidget {
|
||||
class _ItemsList extends StatelessWidget {
|
||||
final String selectedResultStatus;
|
||||
final void Function(String) updateSelectedResultStatus;
|
||||
final void Function() onApply;
|
||||
|
||||
const _Content({
|
||||
const _ItemsList({
|
||||
required this.selectedResultStatus,
|
||||
required this.updateSelectedResultStatus,
|
||||
required this.onApply,
|
||||
required this.updateSelectedResultStatus
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Flexible(
|
||||
child: SingleChildScrollView(
|
||||
child: Wrap(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 24,
|
||||
bottom: 16,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.shield_rounded,
|
||||
size: 24,
|
||||
color: Theme.of(context).listTileTheme.iconColor
|
||||
),
|
||||
),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.responseStatus,
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
Container(height: 16),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "all",
|
||||
icon: Icons.shield_rounded,
|
||||
label: AppLocalizations.of(context)!.all,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "filtered",
|
||||
icon: Icons.shield_rounded,
|
||||
label: AppLocalizations.of(context)!.filtered,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "processed",
|
||||
icon: Icons.verified_user_rounded,
|
||||
label: AppLocalizations.of(context)!.processedRow,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "whitelisted",
|
||||
icon: Icons.verified_user_rounded,
|
||||
label: AppLocalizations.of(context)!.processedWhitelistRow,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "blocked",
|
||||
icon: Icons.gpp_bad_rounded,
|
||||
label: AppLocalizations.of(context)!.blocked,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "blocked_safebrowsing",
|
||||
icon: Icons.gpp_bad_rounded,
|
||||
label: AppLocalizations.of(context)!.blockedSafeBrowsingRow,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "blocked_parental",
|
||||
icon: Icons.gpp_bad_rounded,
|
||||
label: AppLocalizations.of(context)!.blockedParentalRow,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "safe_search",
|
||||
icon: Icons.gpp_bad_rounded,
|
||||
label: AppLocalizations.of(context)!.blockedSafeSearchRow,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "all",
|
||||
icon: Icons.shield_rounded,
|
||||
label: AppLocalizations.of(context)!.all,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: onApply,
|
||||
child: Text(AppLocalizations.of(context)!.apply)
|
||||
)
|
||||
],
|
||||
),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "filtered",
|
||||
icon: Icons.shield_rounded,
|
||||
label: AppLocalizations.of(context)!.filtered,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "processed",
|
||||
icon: Icons.verified_user_rounded,
|
||||
label: AppLocalizations.of(context)!.processedRow,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "whitelisted",
|
||||
icon: Icons.verified_user_rounded,
|
||||
label: AppLocalizations.of(context)!.processedWhitelistRow,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "blocked",
|
||||
icon: Icons.gpp_bad_rounded,
|
||||
label: AppLocalizations.of(context)!.blocked,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "blocked_safebrowsing",
|
||||
icon: Icons.gpp_bad_rounded,
|
||||
label: AppLocalizations.of(context)!.blockedSafeBrowsingRow,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "blocked_parental",
|
||||
icon: Icons.gpp_bad_rounded,
|
||||
label: AppLocalizations.of(context)!.blockedParentalRow,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
_Item(
|
||||
selectedResultStatus: selectedResultStatus,
|
||||
id: "safe_search",
|
||||
icon: Icons.gpp_bad_rounded,
|
||||
label: AppLocalizations.of(context)!.blockedSafeSearchRow,
|
||||
onChanged: updateSelectedResultStatus
|
||||
),
|
||||
if (Platform.isIOS) const SizedBox(height: 16)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ import 'package:adguard_home_manager/constants/enums.dart';
|
|||
import 'package:adguard_home_manager/providers/clients_provider.dart';
|
||||
import 'package:adguard_home_manager/providers/logs_provider.dart';
|
||||
|
||||
class LogsFiltersModal extends StatefulWidget {
|
||||
class LogsFiltersModal extends StatelessWidget {
|
||||
final bool dialog;
|
||||
|
||||
const LogsFiltersModal({
|
||||
|
@ -23,22 +23,9 @@ class LogsFiltersModal extends StatefulWidget {
|
|||
required this.dialog
|
||||
});
|
||||
|
||||
@override
|
||||
State<LogsFiltersModal> createState() => _LogsFiltersModalState();
|
||||
}
|
||||
|
||||
class _LogsFiltersModalState extends State<LogsFiltersModal> {
|
||||
TextEditingController searchController = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
searchController.text = Provider.of<LogsProvider>(context, listen: false).searchText ?? '';
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (widget.dialog == true) {
|
||||
if (dialog == true) {
|
||||
return Padding(
|
||||
padding: MediaQuery.of(context).viewInsets,
|
||||
child: Dialog(
|
||||
|
@ -46,10 +33,7 @@ class _LogsFiltersModalState extends State<LogsFiltersModal> {
|
|||
constraints: const BoxConstraints(
|
||||
maxWidth: 500
|
||||
),
|
||||
child: _FiltersList(
|
||||
searchController: searchController,
|
||||
onClearSearch: () => setState(() => searchController.text = "")
|
||||
)
|
||||
child: const _FiltersList()
|
||||
)
|
||||
),
|
||||
);
|
||||
|
@ -65,11 +49,8 @@ class _LogsFiltersModalState extends State<LogsFiltersModal> {
|
|||
topRight: Radius.circular(28)
|
||||
)
|
||||
),
|
||||
child: SafeArea(
|
||||
child: _FiltersList(
|
||||
searchController: searchController,
|
||||
onClearSearch: () => setState(() => searchController.text = "")
|
||||
),
|
||||
child: const SafeArea(
|
||||
child: _FiltersList(),
|
||||
)
|
||||
),
|
||||
);
|
||||
|
@ -78,14 +59,7 @@ class _LogsFiltersModalState extends State<LogsFiltersModal> {
|
|||
}
|
||||
|
||||
class _FiltersList extends StatelessWidget {
|
||||
final TextEditingController searchController;
|
||||
final void Function() onClearSearch;
|
||||
|
||||
const _FiltersList({
|
||||
Key? key,
|
||||
required this.searchController,
|
||||
required this.onClearSearch,
|
||||
}) : super(key: key);
|
||||
const _FiltersList();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -125,7 +99,8 @@ class _FiltersList extends StatelessWidget {
|
|||
dialog: false,
|
||||
),
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent
|
||||
backgroundColor: Colors.transparent,
|
||||
useSafeArea: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -194,35 +169,6 @@ class _FiltersList extends StatelessWidget {
|
|||
),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextFormField(
|
||||
controller: searchController,
|
||||
onChanged: logsProvider.setSearchText,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.search_rounded),
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10)
|
||||
)
|
||||
),
|
||||
labelText: AppLocalizations.of(context)!.search,
|
||||
suffixIcon: IconButton(
|
||||
onPressed: () {
|
||||
onClearSearch();
|
||||
logsProvider.setSearchText(null);
|
||||
},
|
||||
icon: const Icon(Icons.clear)
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(height: 16),
|
||||
CustomListTile(
|
||||
title: AppLocalizations.of(context)!.client,
|
||||
|
@ -300,7 +246,6 @@ class _FiltersList extends StatelessWidget {
|
|||
children: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
searchController.text = "";
|
||||
logsProvider.requestResetFilters();
|
||||
},
|
||||
child: Text(AppLocalizations.of(context)!.resetFilters)
|
||||
|
|
93
lib/screens/logs/live/live_logs_list.dart
Normal file
93
lib/screens/logs/live/live_logs_list.dart
Normal file
|
@ -0,0 +1,93 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/logs/log_tile.dart';
|
||||
import 'package:adguard_home_manager/screens/logs/details/log_details_screen.dart';
|
||||
|
||||
import 'package:adguard_home_manager/models/logs.dart';
|
||||
import 'package:adguard_home_manager/providers/live_logs_provider.dart';
|
||||
|
||||
class LiveLogsList extends StatelessWidget {
|
||||
final Log? selectedLog;
|
||||
final void Function(Log) onLogSelected;
|
||||
final bool twoColumns;
|
||||
|
||||
const LiveLogsList({
|
||||
super.key,
|
||||
required this.selectedLog,
|
||||
required this.onLogSelected,
|
||||
required this.twoColumns,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final liveLogsProvider = Provider.of<LiveLogsProvider>(context);
|
||||
|
||||
return NestedScrollView(
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||
SliverOverlapAbsorber(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
sliver: SliverAppBar.large(
|
||||
title: Text(AppLocalizations.of(context)!.liveLogs),
|
||||
)
|
||||
)
|
||||
],
|
||||
body: SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Builder(
|
||||
builder: (context) => CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
if (liveLogsProvider.logs.isEmpty) SliverFillRemaining(
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.hereWillAppearRealtimeLogs,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
fontSize: 22
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (liveLogsProvider.logs.isNotEmpty) SliverPadding(
|
||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewPadding.bottom),
|
||||
sliver: SliverList.builder(
|
||||
itemCount: liveLogsProvider.logs.length,
|
||||
itemBuilder: (context, index) => LogTile(
|
||||
log: liveLogsProvider.logs[index],
|
||||
length: liveLogsProvider.logs.length,
|
||||
index: index,
|
||||
onLogTap: (log) {
|
||||
if (!twoColumns) {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => LogDetailsScreen(
|
||||
log: log,
|
||||
dialog: false,
|
||||
twoColumns: twoColumns,
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
onLogSelected(log);
|
||||
},
|
||||
isLogSelected: selectedLog == liveLogsProvider.logs[index],
|
||||
twoColumns: twoColumns
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
70
lib/screens/logs/live/live_logs_screen.dart
Normal file
70
lib/screens/logs/live/live_logs_screen.dart
Normal file
|
@ -0,0 +1,70 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/logs/details/log_details_screen.dart';
|
||||
import 'package:adguard_home_manager/screens/logs/live/live_logs_list.dart';
|
||||
|
||||
import 'package:adguard_home_manager/models/logs.dart';
|
||||
import 'package:adguard_home_manager/providers/live_logs_provider.dart';
|
||||
|
||||
class LiveLogsScreen extends StatefulWidget {
|
||||
const LiveLogsScreen({super.key});
|
||||
|
||||
@override
|
||||
State<LiveLogsScreen> createState() => _LiveLogsScreenState();
|
||||
}
|
||||
|
||||
class _LiveLogsScreenState extends State<LiveLogsScreen> {
|
||||
Log? _selectedLog;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
Provider.of<LiveLogsProvider>(context, listen: false).startFetchLogs();
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
if (constraints.maxWidth > 800) {
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: LiveLogsList(
|
||||
twoColumns: true,
|
||||
selectedLog: _selectedLog,
|
||||
onLogSelected: (log) => setState(() => _selectedLog = log),
|
||||
)
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: _selectedLog != null
|
||||
? LogDetailsScreen(
|
||||
log: _selectedLog!,
|
||||
dialog: false,
|
||||
twoColumns: true,
|
||||
)
|
||||
: const SizedBox()
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
else {
|
||||
return LiveLogsList(
|
||||
twoColumns: false,
|
||||
selectedLog: _selectedLog,
|
||||
onLogSelected: (log) => setState(() => _selectedLog = log),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,15 +1,18 @@
|
|||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/clients/client/client_screen_functions.dart';
|
||||
import 'package:adguard_home_manager/screens/clients/client/client_screen.dart';
|
||||
import 'package:adguard_home_manager/widgets/options_menu.dart';
|
||||
|
||||
import 'package:adguard_home_manager/providers/status_provider.dart';
|
||||
import 'package:adguard_home_manager/providers/filtering_provider.dart';
|
||||
import 'package:adguard_home_manager/classes/process_modal.dart';
|
||||
import 'package:adguard_home_manager/functions/snackbar.dart';
|
||||
import 'package:adguard_home_manager/functions/copy_clipboard.dart';
|
||||
import 'package:adguard_home_manager/models/clients.dart';
|
||||
import 'package:adguard_home_manager/providers/clients_provider.dart';
|
||||
import 'package:adguard_home_manager/models/menu_option.dart';
|
||||
import 'package:adguard_home_manager/providers/app_config_provider.dart';
|
||||
import 'package:adguard_home_manager/functions/get_filtered_status.dart';
|
||||
|
@ -40,6 +43,8 @@ class LogTile extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
||||
final statusProvider = Provider.of<StatusProvider>(context);
|
||||
final clientsProvider = Provider.of<ClientsProvider>(context);
|
||||
final filteringProvider = Provider.of<FilteringProvider>(context);
|
||||
|
||||
Widget logStatusWidget({
|
||||
required IconData icon,
|
||||
|
@ -91,6 +96,8 @@ class LogTile extends StatelessWidget {
|
|||
}
|
||||
|
||||
void blockUnblock({required String domain, required String newStatus}) async {
|
||||
if (!context.mounted) return;
|
||||
|
||||
final ProcessModal processModal = ProcessModal();
|
||||
processModal.open(AppLocalizations.of(context)!.savingUserFilters);
|
||||
|
||||
|
@ -103,14 +110,14 @@ class LogTile extends StatelessWidget {
|
|||
|
||||
if (!context.mounted) return;
|
||||
if (rules == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.userFilteringRulesUpdated,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.userFilteringRulesNotUpdated,
|
||||
color: Colors.red
|
||||
|
@ -118,6 +125,123 @@ class LogTile extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
|
||||
void confirmAddClient(Client client) async {
|
||||
if (!context.mounted) return;
|
||||
|
||||
ProcessModal processModal = ProcessModal();
|
||||
processModal.open(AppLocalizations.of(context)!.addingClient);
|
||||
|
||||
final result = await clientsProvider.addClient(client);
|
||||
|
||||
processModal.close();
|
||||
|
||||
if (!context.mounted) return;
|
||||
|
||||
if (result == true) {
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientAddedSuccessfully,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientNotAdded,
|
||||
color: Colors.red
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void blockUnblockRuleClient() async {
|
||||
if (!context.mounted) return;
|
||||
|
||||
ProcessModal processModal = ProcessModal();
|
||||
processModal.open(AppLocalizations.of(context)!.addingRule);
|
||||
|
||||
final rule = isDomainBlocked(log.reason) == true
|
||||
? "@@||${log.question.name}^\$client='${log.client}'"
|
||||
: "||${log.question.name}^\$client='${log.client}'";
|
||||
|
||||
final result = await filteringProvider.addCustomRule(rule);
|
||||
|
||||
processModal.close();
|
||||
|
||||
if (!context.mounted) return;
|
||||
if (result == true) {
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: isDomainBlocked(log.reason) == true
|
||||
? AppLocalizations.of(context)!.domainUnblockedThisClient(log.question.name!)
|
||||
: AppLocalizations.of(context)!.domainBlockedThisClient(log.question.name!),
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.ruleNotAdded,
|
||||
color: Colors.red
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void allowDisallowClient() async {
|
||||
ProcessModal processModal = ProcessModal();
|
||||
processModal.open(
|
||||
log.clientInfo!.disallowed == true
|
||||
? AppLocalizations.of(context)!.allowingClient
|
||||
: AppLocalizations.of(context)!.disallowingClient
|
||||
);
|
||||
|
||||
final result = await clientsProvider.addClientList(
|
||||
log.client,
|
||||
log.clientInfo!.disallowed == true
|
||||
? AccessSettingsList.allowed
|
||||
: AccessSettingsList.disallowed
|
||||
);
|
||||
|
||||
processModal.close();
|
||||
|
||||
if (!context.mounted) return;
|
||||
if (result.successful == true) {
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientAddedSuccessfully,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else if (result.successful == false && result.content == 'client_another_list') {
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientAnotherList,
|
||||
color: Colors.red
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.changesNotSaved,
|
||||
color: Colors.red
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void openAddClient() {
|
||||
Future.delayed(
|
||||
const Duration(milliseconds: 0),
|
||||
() {
|
||||
if (!context.mounted) return;
|
||||
openClientFormModal(
|
||||
context: context,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
onConfirm: confirmAddClient,
|
||||
initialData: ClientInitialData(name: "Client ${log.client}", ip: log.client)
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
final domainBlocked = isDomainBlocked(log.reason);
|
||||
|
||||
if (twoColumns && !(useAlwaysNormalTile == true)) {
|
||||
|
@ -141,6 +265,29 @@ class LogTile extends StatelessWidget {
|
|||
newStatus: domainBlocked == true ? 'unblock' : 'block'
|
||||
)
|
||||
),
|
||||
if (filteringProvider.filtering != null) MenuOption(
|
||||
title: domainBlocked == true
|
||||
? AppLocalizations.of(context)!.unblockThisClientOnly
|
||||
: AppLocalizations.of(context)!.blockThisClientOnly,
|
||||
icon: domainBlocked == true
|
||||
? Icons.check_rounded
|
||||
: Icons.block_rounded,
|
||||
action: blockUnblockRuleClient
|
||||
),
|
||||
if (log.clientInfo?.name == "") MenuOption(
|
||||
title: AppLocalizations.of(context)!.addPersistentClient,
|
||||
icon: Icons.add_rounded,
|
||||
action: openAddClient
|
||||
),
|
||||
MenuOption(
|
||||
title: log.clientInfo!.disallowed == true
|
||||
? AppLocalizations.of(context)!.allowThisClient
|
||||
: AppLocalizations.of(context)!.disallowThisClient,
|
||||
icon: log.clientInfo!.disallowed == true
|
||||
? Icons.check_rounded
|
||||
: Icons.block_rounded,
|
||||
action: allowDisallowClient
|
||||
),
|
||||
if (log.question.name != null) MenuOption(
|
||||
title: AppLocalizations.of(context)!.copyClipboard,
|
||||
icon: Icons.copy_rounded,
|
||||
|
@ -319,6 +466,29 @@ class LogTile extends StatelessWidget {
|
|||
newStatus: domainBlocked == true ? 'unblock' : 'block'
|
||||
)
|
||||
),
|
||||
if (filteringProvider.filtering != null) MenuOption(
|
||||
title: domainBlocked == true
|
||||
? AppLocalizations.of(context)!.unblockThisClientOnly
|
||||
: AppLocalizations.of(context)!.blockThisClientOnly,
|
||||
icon: domainBlocked == true
|
||||
? Icons.check_rounded
|
||||
: Icons.block_rounded,
|
||||
action: blockUnblockRuleClient
|
||||
),
|
||||
if (log.clientInfo?.name == "") MenuOption(
|
||||
title: AppLocalizations.of(context)!.addPersistentClient,
|
||||
icon: Icons.add_rounded,
|
||||
action: openAddClient
|
||||
),
|
||||
MenuOption(
|
||||
title: log.clientInfo!.disallowed == true
|
||||
? AppLocalizations.of(context)!.allowThisClient
|
||||
: AppLocalizations.of(context)!.disallowThisClient,
|
||||
icon: log.clientInfo!.disallowed == true
|
||||
? Icons.check_rounded
|
||||
: Icons.block_rounded,
|
||||
action: allowDisallowClient
|
||||
),
|
||||
if (log.question.name != null) MenuOption(
|
||||
title: AppLocalizations.of(context)!.copyClipboard,
|
||||
icon: Icons.copy_rounded,
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/logs/logs_list.dart';
|
||||
import 'package:adguard_home_manager/screens/logs/details/log_details_screen.dart';
|
||||
|
||||
import 'package:adguard_home_manager/models/logs.dart';
|
||||
import 'package:adguard_home_manager/providers/filtering_provider.dart';
|
||||
|
||||
class Logs extends StatefulWidget {
|
||||
const Logs({Key? key}) : super(key: key);
|
||||
const Logs({super.key});
|
||||
|
||||
@override
|
||||
State<Logs> createState() => _LogsState();
|
||||
|
@ -17,6 +19,12 @@ class Logs extends StatefulWidget {
|
|||
class _LogsState extends State<Logs> {
|
||||
Log? _selectedLog;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
Provider.of<FilteringProvider>(context, listen: false).fetchFilters();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(
|
||||
|
@ -40,6 +48,7 @@ class _LogsState extends State<Logs> {
|
|||
? LogDetailsScreen(
|
||||
log: _selectedLog!,
|
||||
dialog: false,
|
||||
twoColumns: true,
|
||||
)
|
||||
: const SizedBox()
|
||||
)
|
||||
|
|
|
@ -33,6 +33,7 @@ class LogsListWidget extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _LogsListWidgetState extends State<LogsListWidget> {
|
||||
final _scaffoldMessengerKey = GlobalKey<ScaffoldMessengerState>();
|
||||
bool showDivider = true;
|
||||
|
||||
void fetchFilteringRules() async {
|
||||
|
@ -41,7 +42,7 @@ class _LogsListWidgetState extends State<LogsListWidget> {
|
|||
|
||||
final result = await statusProvider.getFilteringRules();
|
||||
if (mounted && result == false) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.couldntGetFilteringStatus,
|
||||
color: Colors.red
|
||||
|
@ -55,7 +56,7 @@ class _LogsListWidgetState extends State<LogsListWidget> {
|
|||
|
||||
final result = await clientsProvider.fetchClients();
|
||||
if (mounted && result == false) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.couldntGetFilteringStatus,
|
||||
color: Colors.red
|
||||
|
@ -93,194 +94,198 @@ class _LogsListWidgetState extends State<LogsListWidget> {
|
|||
Widget build(BuildContext context) {
|
||||
final logsProvider = Provider.of<LogsProvider>(context);
|
||||
|
||||
return Scaffold(
|
||||
body: NestedScrollView(
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||
SliverOverlapAbsorber(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
sliver: LogsListAppBar(
|
||||
innerBoxIsScrolled: innerBoxIsScrolled,
|
||||
showDivider: showDivider,
|
||||
return ScaffoldMessenger(
|
||||
key: widget.twoColumns ? _scaffoldMessengerKey : null,
|
||||
child: Scaffold(
|
||||
body: NestedScrollView(
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||
SliverOverlapAbsorber(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
sliver: LogsListAppBar(
|
||||
innerBoxIsScrolled: innerBoxIsScrolled,
|
||||
showDivider: showDivider,
|
||||
)
|
||||
)
|
||||
)
|
||||
],
|
||||
body: Builder(
|
||||
builder: (context) {
|
||||
switch (logsProvider.loadStatus) {
|
||||
case LoadStatus.loading:
|
||||
return SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Builder(
|
||||
builder: (context) => CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
SliverFillRemaining(
|
||||
child: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const CircularProgressIndicator(),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.loadingLogs,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
body: Builder(
|
||||
builder: (context) {
|
||||
switch (logsProvider.loadStatus) {
|
||||
case LoadStatus.loading:
|
||||
return SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Builder(
|
||||
builder: (context) => CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
SliverFillRemaining(
|
||||
child: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const CircularProgressIndicator(),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.loadingLogs,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
case LoadStatus.loaded:
|
||||
return SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Builder(
|
||||
builder: (context) => RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
await logsProvider.fetchLogs(inOffset: 0);
|
||||
},
|
||||
displacement: 95,
|
||||
child: NotificationListener(
|
||||
onNotification: scrollListener,
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
if (logsProvider.logsData!.data.isNotEmpty) SliverList.builder(
|
||||
itemCount: logsProvider.isLoadingMore
|
||||
? logsProvider.logsData!.data.length + 1
|
||||
: logsProvider.logsData!.data.length,
|
||||
itemBuilder: (context, index) {
|
||||
if (logsProvider.isLoadingMore == true && index == logsProvider.logsData!.data.length) {
|
||||
return const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
}
|
||||
else if (logsProvider.logsData!.data[index].question.name != null) {
|
||||
return LogTile(
|
||||
log: logsProvider.logsData!.data[index],
|
||||
index: index,
|
||||
length: logsProvider.logsData!.data.length,
|
||||
isLogSelected: widget.selectedLog != null && widget.selectedLog == logsProvider.logsData!.data[index],
|
||||
onLogTap: (log) {
|
||||
if (!widget.twoColumns) {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => LogDetailsScreen(
|
||||
log: log,
|
||||
dialog: false,
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
case LoadStatus.loaded:
|
||||
return SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Builder(
|
||||
builder: (context) => RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
await logsProvider.fetchLogs(inOffset: 0);
|
||||
},
|
||||
displacement: 95,
|
||||
child: NotificationListener(
|
||||
onNotification: scrollListener,
|
||||
child: CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
if (logsProvider.logsData!.data.isNotEmpty) SliverList.builder(
|
||||
itemCount: logsProvider.isLoadingMore
|
||||
? logsProvider.logsData!.data.length + 1
|
||||
: logsProvider.logsData!.data.length,
|
||||
itemBuilder: (context, index) {
|
||||
if (logsProvider.isLoadingMore == true && index == logsProvider.logsData!.data.length) {
|
||||
return const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
}
|
||||
else if (logsProvider.logsData!.data[index].question.name != null) {
|
||||
return LogTile(
|
||||
log: logsProvider.logsData!.data[index],
|
||||
index: index,
|
||||
length: logsProvider.logsData!.data.length,
|
||||
isLogSelected: widget.selectedLog != null && widget.selectedLog == logsProvider.logsData!.data[index],
|
||||
onLogTap: (log) {
|
||||
if (!widget.twoColumns) {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => LogDetailsScreen(
|
||||
log: log,
|
||||
dialog: false,
|
||||
twoColumns: widget.twoColumns,
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
widget.onLogSelected(log);
|
||||
},
|
||||
twoColumns: widget.twoColumns,
|
||||
);
|
||||
);
|
||||
}
|
||||
widget.onLogSelected(log);
|
||||
},
|
||||
twoColumns: widget.twoColumns,
|
||||
);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
),
|
||||
if (logsProvider.logsData!.data.isEmpty) SliverFillRemaining(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.noLogsDisplay,
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
if (logsProvider.logsOlderThan != null) Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 30,
|
||||
left: 20,
|
||||
right: 20
|
||||
),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.noLogsThatOld,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
if (logsProvider.logsData!.data.isEmpty) SliverFillRemaining(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
AppLocalizations.of(context)!.noLogsDisplay,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontSize: 24,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
]
|
||||
if (logsProvider.logsOlderThan != null) Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 30,
|
||||
left: 20,
|
||||
right: 20
|
||||
),
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.noLogsThatOld,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
]
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
case LoadStatus.error:
|
||||
return SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Builder(
|
||||
builder: (context) => CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
SliverFillRemaining(
|
||||
child: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.error,
|
||||
color: Colors.red,
|
||||
size: 50,
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.logsNotLoaded,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
)
|
||||
);
|
||||
|
||||
case LoadStatus.error:
|
||||
return SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Builder(
|
||||
builder: (context) => CustomScrollView(
|
||||
slivers: [
|
||||
SliverOverlapInjector(
|
||||
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||
),
|
||||
SliverFillRemaining(
|
||||
child: SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.error,
|
||||
color: Colors.red,
|
||||
size: 50,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.logsNotLoaded,
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
default:
|
||||
return const SizedBox();
|
||||
}
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
default:
|
||||
return const SizedBox();
|
||||
}
|
||||
},
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -6,13 +6,19 @@ import 'package:flutter/material.dart';
|
|||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/screens/logs/live/live_logs_screen.dart';
|
||||
import 'package:adguard_home_manager/screens/logs/filters/logs_filters_modal.dart';
|
||||
import 'package:adguard_home_manager/widgets/floating_search_bar.dart';
|
||||
|
||||
import 'package:adguard_home_manager/constants/enums.dart';
|
||||
import 'package:adguard_home_manager/functions/desktop_mode.dart';
|
||||
import 'package:adguard_home_manager/providers/live_logs_provider.dart';
|
||||
import 'package:adguard_home_manager/providers/servers_provider.dart';
|
||||
import 'package:adguard_home_manager/models/applied_filters.dart';
|
||||
import 'package:adguard_home_manager/providers/logs_provider.dart';
|
||||
|
||||
final GlobalKey _searchButtonKey = GlobalKey();
|
||||
|
||||
class LogsListAppBar extends StatelessWidget {
|
||||
final bool innerBoxIsScrolled;
|
||||
final bool showDivider;
|
||||
|
@ -52,6 +58,53 @@ class LogsListAppBar extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
|
||||
void showSearchDialog() {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => FloatingSearchBar(
|
||||
existingSearchValue: logsProvider.appliedFilters.searchText ?? "",
|
||||
searchButtonRenderBox: _searchButtonKey.currentContext?.findRenderObject() as RenderBox?,
|
||||
onSearchCompleted: (v) {
|
||||
logsProvider.setAppliedFilters(
|
||||
AppliedFiters(
|
||||
selectedResultStatus: logsProvider.appliedFilters.selectedResultStatus,
|
||||
searchText: v != "" ? v : null,
|
||||
clients: logsProvider.appliedFilters.clients
|
||||
)
|
||||
);
|
||||
logsProvider.filterLogs();
|
||||
},
|
||||
onSearchFieldUpdated: (v) {
|
||||
if (v == "") {
|
||||
logsProvider.setSearchText(null);
|
||||
return;
|
||||
}
|
||||
logsProvider.setSearchText(v);
|
||||
},
|
||||
onSearchFieldCleared: () {
|
||||
logsProvider.setSearchText(null);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void openLiveLogsScreen() {
|
||||
if (!context.mounted) return;
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProxyProvider<ServersProvider, LiveLogsProvider>(
|
||||
create: (context) => LiveLogsProvider(),
|
||||
update: (context, servers, logs) => logs!..update(servers),
|
||||
),
|
||||
],
|
||||
child: const LiveLogsScreen()
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
final Map<String, String> translatedString = {
|
||||
"all": AppLocalizations.of(context)!.all,
|
||||
"filtered": AppLocalizations.of(context)!.filtered,
|
||||
|
@ -70,24 +123,45 @@ class LogsListAppBar extends StatelessWidget {
|
|||
forceElevated: innerBoxIsScrolled,
|
||||
surfaceTintColor: isDesktop(width) ? Colors.transparent : null,
|
||||
title: Text(AppLocalizations.of(context)!.logs),
|
||||
expandedHeight: logsProvider.appliedFilters.searchText != null || logsProvider.appliedFilters.selectedResultStatus != 'all' || logsProvider.appliedFilters.clients != null
|
||||
? 170 : null,
|
||||
actions: [
|
||||
if (!(Platform.isAndroid || Platform.isIOS)) IconButton(
|
||||
onPressed: () => logsProvider.fetchLogs(inOffset: 0),
|
||||
icon: const Icon(Icons.refresh_rounded),
|
||||
tooltip: AppLocalizations.of(context)!.refresh,
|
||||
),
|
||||
logsProvider.loadStatus == LoadStatus.loaded
|
||||
? IconButton(
|
||||
onPressed: openFilersModal,
|
||||
icon: const Icon(Icons.filter_list_rounded),
|
||||
tooltip: AppLocalizations.of(context)!.filters,
|
||||
)
|
||||
: const SizedBox(),
|
||||
const SizedBox(width: 5),
|
||||
if (logsProvider.loadStatus == LoadStatus.loaded) IconButton(
|
||||
key: _searchButtonKey,
|
||||
onPressed: showSearchDialog,
|
||||
icon: const Icon(Icons.search_rounded),
|
||||
tooltip: AppLocalizations.of(context)!.search,
|
||||
),
|
||||
if (logsProvider.loadStatus == LoadStatus.loaded) PopupMenuButton(
|
||||
itemBuilder: (context) => [
|
||||
PopupMenuItem(
|
||||
onTap: openFilersModal,
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.filter_list_rounded),
|
||||
const SizedBox(width: 10),
|
||||
Text(AppLocalizations.of(context)!.filters)
|
||||
],
|
||||
)
|
||||
),
|
||||
PopupMenuItem(
|
||||
onTap: openLiveLogsScreen,
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.stream_rounded),
|
||||
const SizedBox(width: 10),
|
||||
Text(AppLocalizations.of(context)!.liveLogs)
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
],
|
||||
bottom: logsProvider.appliedFilters.searchText != null || logsProvider.appliedFilters.selectedResultStatus != 'all' || logsProvider.appliedFilters.clients != null
|
||||
bottom: logsProvider.appliedFilters.searchText != null || logsProvider.appliedFilters.selectedResultStatus != 'all' || logsProvider.appliedFilters.clients.isNotEmpty
|
||||
? PreferredSize(
|
||||
preferredSize: const Size(double.maxFinite, 70),
|
||||
child: Container(
|
||||
|
@ -172,7 +246,7 @@ class LogsListAppBar extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
],
|
||||
if (logsProvider.appliedFilters.clients != null) ...[
|
||||
if (logsProvider.appliedFilters.clients.isNotEmpty) ...[
|
||||
const SizedBox(width: 15),
|
||||
Chip(
|
||||
avatar: const Icon(
|
||||
|
@ -181,9 +255,9 @@ class LogsListAppBar extends StatelessWidget {
|
|||
label: Row(
|
||||
children: [
|
||||
Text(
|
||||
logsProvider.appliedFilters.clients!.length == 1
|
||||
? logsProvider.appliedFilters.clients![0]
|
||||
: "${logsProvider.appliedFilters.clients!.length} ${AppLocalizations.of(context)!.clients}",
|
||||
logsProvider.appliedFilters.clients.length == 1
|
||||
? logsProvider.appliedFilters.clients[0]
|
||||
: "${logsProvider.appliedFilters.clients.length} ${AppLocalizations.of(context)!.clients}",
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -196,7 +270,7 @@ class LogsListAppBar extends StatelessWidget {
|
|||
AppliedFiters(
|
||||
selectedResultStatus: logsProvider.appliedFilters.selectedResultStatus,
|
||||
searchText: logsProvider.appliedFilters.searchText,
|
||||
clients: null
|
||||
clients: []
|
||||
)
|
||||
);
|
||||
logsProvider.setSelectedClients(null);
|
||||
|
@ -215,4 +289,5 @@ class LogsListAppBar extends StatelessWidget {
|
|||
: null,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ class _ClientsListState extends State<ClientsList> {
|
|||
Future refetchClients() async {
|
||||
final result = await clientsProvider.fetchClients();
|
||||
if (result == false && mounted) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientsNotLoaded,
|
||||
color: Colors.red
|
||||
|
@ -104,21 +104,21 @@ class _ClientsListState extends State<ClientsList> {
|
|||
processModal.close();
|
||||
|
||||
if (result.successful == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientRemovedSuccessfully,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else if (result.successful == false && result.content == 'client_another_list') {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientAnotherList,
|
||||
color: Colors.red
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: type == AccessSettingsList.allowed || type == AccessSettingsList.disallowed
|
||||
? AppLocalizations.of(context)!.clientNotRemoved
|
||||
|
@ -137,21 +137,21 @@ class _ClientsListState extends State<ClientsList> {
|
|||
processModal.close();
|
||||
|
||||
if (result.successful == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientAddedSuccessfully,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else if (result.successful == false && result.content == 'client_another_list') {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.clientAnotherList,
|
||||
color: Colors.red
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: type == AccessSettingsList.allowed || type == AccessSettingsList.disallowed
|
||||
? AppLocalizations.of(context)!.clientNotRemoved
|
||||
|
|
|
@ -26,14 +26,14 @@ class AdvancedSettings extends StatelessWidget {
|
|||
final result = await function(newStatus);
|
||||
if (!context.mounted) return;
|
||||
if (result == true) {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.settingsUpdatedSuccessfully,
|
||||
color: Colors.green
|
||||
);
|
||||
}
|
||||
else {
|
||||
showSnacbkar(
|
||||
showSnackbar(
|
||||
appConfigProvider: appConfigProvider,
|
||||
label: AppLocalizations.of(context)!.cannotUpdateSettings,
|
||||
color: Colors.red
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue