Skip to content

Commit

Permalink
Update adguard-home extension
Browse files Browse the repository at this point in the history
- Merge branch \'contributions/merge-1738855517784\'
- Pull contributions
- fix linting
- Merge pull request raycast#3 from subsy/iconfix
- fix incorrect disabled icon and update extension title
- remove raycast gitignore
- chore: fix images
- chore: add raycast publish gitignore
- chore: add raycast-specific gitignore
- chore: add raycast-specific gitignore
- fix images
- chore: remove image files from git tracking
- fix linting errors
- fix minor issues
- fix merge issues
- resolve conflicts
- Pull contributions
- update readme
- update readme
- 1.1.1 bugfixes
- 1.1.2
- add an ESLint disable comment for test setup
- fix tests
- 1.1.1
- fix: linting and formatting issues
- Merge pull request raycast#2 from subsy:snooze-status
- fix AdGuard typo in extension name
- update snooze to show status fetched from adguard home api
- Merge pull request raycast#1 from subsy:snooze
- feat: add protection snooze functionality
  • Loading branch information
subsy committed Feb 6, 2025
1 parent bb5302f commit d2f9110
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 16 deletions.
6 changes: 6 additions & 0 deletions extensions/adguard-home/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# AdGuard Home Raycast Extension Changelog

## [1.1.2] - 2025-02-05

- Fixed disable protection status icon
- Updated extension title to use proper case
- Optimize status rendering

## [1.1.1] - 2025-01-29

- Added countdown timer for snooze status
Expand Down
Binary file modified extensions/adguard-home/assets/command-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extensions/adguard-home/images/adguard-home-query-log.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extensions/adguard-home/images/adguard-home-view-statistics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions extensions/adguard-home/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "https://www.raycast.com/schemas/extension.json",
"name": "adguard-home",
"title": "Adguard Home",
"title": "AdGuard Home",
"description": "Control your AdGuard Home instance",
"icon": "command-icon.png",
"version": "1.1.1",
"version": "1.1.2",
"author": "theplgeek",
"homepage": "https://plgeek.com",
"repository": "https://github.com/subsy/raycast-adguard-home",
Expand Down
23 changes: 13 additions & 10 deletions extensions/adguard-home/src/snooze-protection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ export default function Command() {
return;
}

if (diff % (5 * 1000) === 0) {
fetchStatus();
}

const seconds = Math.floor(diff / 1000);
const hours = Math.floor(seconds / 3600);
const minutes = Math.floor((seconds % 3600) / 60);
Expand All @@ -52,11 +48,18 @@ export default function Command() {
? `${minutes}m ${remainingSeconds}s`
: `${remainingSeconds}s`;
setRemainingTime(newRemainingTime);
}, 500);
}, 1000);

return () => clearInterval(interval);
}, [snoozeEndTime]);

useEffect(() => {
if (!snoozeEndTime) return;

const statusInterval = setInterval(fetchStatus, 5000);
return () => clearInterval(statusInterval);
}, [snoozeEndTime]);

async function fetchStatus() {
try {
const data = await getStatus();
Expand Down Expand Up @@ -112,10 +115,10 @@ export default function Command() {
return (
<List isLoading={isLoading}>
<List.Item
title="Current Status"
title="Protection Status"
icon={{
source: status?.protection_enabled ? Icon.CheckCircle : Icon.Clock,
tintColor: status?.protection_enabled ? Color.Green : Color.Orange,
source: status?.protection_enabled ? Icon.CheckCircle : remainingTime ? Icon.Clock : Icon.XMarkCircle,
tintColor: status?.protection_enabled ? Color.Green : remainingTime ? Color.Orange : Color.Red,
}}
accessories={[
{
Expand All @@ -125,8 +128,8 @@ export default function Command() {
? `Disabled (${remainingTime} remaining)`
: "Protection Disabled",
icon: {
source: status?.protection_enabled ? Icon.CheckCircle : Icon.Clock,
tintColor: status?.protection_enabled ? Color.Green : Color.Orange,
source: status?.protection_enabled ? Icon.CheckCircle : remainingTime ? Icon.Clock : Icon.XMarkCircle,
tintColor: status?.protection_enabled ? Color.Green : remainingTime ? Color.Orange : Color.Red,
},
},
]}
Expand Down
9 changes: 5 additions & 4 deletions extensions/adguard-home/src/toggle-protection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@ export default function Command() {
<List isLoading={isLoading}>
<List.Item
title="Protection Status"
subtitle={status?.protection_enabled ? "Protection is Active" : "Protection is Disabled"}
icon={{
source: status?.protection_enabled ? Icon.CheckCircle : Icon.Clock,
tintColor: status?.protection_enabled ? Color.Green : Color.Orange,
source: status?.protection_enabled ? Icon.CheckCircle : remainingTime ? Icon.Clock : Icon.XMarkCircle,
tintColor: status?.protection_enabled ? Color.Green : remainingTime ? Color.Orange : Color.Red,
}}
accessories={[
{
Expand All @@ -148,8 +149,8 @@ export default function Command() {
? `Disabled (${remainingTime} remaining)`
: "Protection Disabled",
icon: {
source: status?.protection_enabled ? Icon.CheckCircle : Icon.Clock,
tintColor: status?.protection_enabled ? Color.Green : Color.Orange,
source: status?.protection_enabled ? Icon.CheckCircle : remainingTime ? Icon.Clock : Icon.XMarkCircle,
tintColor: status?.protection_enabled ? Color.Green : remainingTime ? Color.Orange : Color.Red,
},
},
]}
Expand Down

0 comments on commit d2f9110

Please sign in to comment.