-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow admins to disable scraping package managers
- Loading branch information
1 parent
cae5193
commit b218217
Showing
9 changed files
with
113 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// SPDX-FileCopyrightText: 2023 - 2024 Dusan Mijatovic (Netherlands eScience Center) | ||
// SPDX-FileCopyrightText: 2023 - 2024 Netherlands eScience Center | ||
// SPDX-FileCopyrightText: 2024 Ewan Cahen (Netherlands eScience Center) <[email protected]> | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
@@ -35,6 +36,7 @@ export default function PackageManagerServices() { | |
last_error={service.download_count_last_error} | ||
url={service.url} | ||
platform={null} | ||
scraping_disabled_reason={service.download_count_scraping_disabled_reason} | ||
/> | ||
: null | ||
} | ||
|
@@ -46,6 +48,7 @@ export default function PackageManagerServices() { | |
last_error={service.reverse_dependency_count_last_error} | ||
url={service.url} | ||
platform={null} | ||
scraping_disabled_reason={service.reverse_dependency_count_scraping_disabled_reason} | ||
/> | ||
: null | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// SPDX-FileCopyrightText: 2023 - 2024 Dusan Mijatovic (Netherlands eScience Center) | ||
// SPDX-FileCopyrightText: 2023 - 2024 Netherlands eScience Center | ||
// SPDX-FileCopyrightText: 2024 Ewan Cahen (Netherlands eScience Center) <[email protected]> | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
@@ -20,9 +21,10 @@ type ServiceInfoListItemProps={ | |
last_error: string|null | ||
url: string|null | ||
platform: CodePlatform|null | ||
scraping_disabled_reason: string|null | ||
} | ||
|
||
export function ServiceInfoListItem({title,scraped_at,last_error,url,platform}:ServiceInfoListItemProps){ | ||
export function ServiceInfoListItem({title,scraped_at,last_error,url,platform,scraping_disabled_reason}:ServiceInfoListItemProps){ | ||
let status:'error'|'success'|'not_active'|'scheduled'|'not_supported' = 'not_active' | ||
|
||
// set service status | ||
|
@@ -38,6 +40,7 @@ export function ServiceInfoListItem({title,scraped_at,last_error,url,platform}:S | |
if (status==='not_active') color='warning.main' | ||
|
||
function getStatusIcon(){ | ||
if (scraping_disabled_reason !== null) return <DoDisturbOnIcon sx={{width:'2.5rem',height:'2.5rem'}} /> | ||
if (status === 'error') return <ErrorIcon sx={{width:'2.5rem',height:'2.5rem'}} /> | ||
if (status === 'success') return <CheckCircleIcon sx={{width:'2.5rem',height:'2.5rem'}} /> | ||
if (status === 'scheduled') return <ScheduleIcon sx={{width:'2.5rem',height:'2.5rem'}} /> | ||
|
@@ -46,6 +49,10 @@ export function ServiceInfoListItem({title,scraped_at,last_error,url,platform}:S | |
} | ||
|
||
function getStatusMsg(){ | ||
if (scraping_disabled_reason !== null) { | ||
return (<span className="text-error">{`This harvester was disabled by the admins for the following reason: ${scraping_disabled_reason}`}</span>) | ||
} | ||
|
||
if (last_error) return ( | ||
<span className="text-error">{last_error}</span> | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters