mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 23:45:48 +01:00
🚨 Lint and prettier fix
This commit is contained in:
@@ -20,11 +20,7 @@ export default function AppShelfMenu(props: any) {
|
||||
onClose={() => setOpened(false)}
|
||||
title="Modify a service"
|
||||
>
|
||||
<AddAppShelfItemForm
|
||||
setOpened={setOpened}
|
||||
{...service}
|
||||
message="Save service"
|
||||
/>
|
||||
<AddAppShelfItemForm setOpened={setOpened} {...service} message="Save service" />
|
||||
</Modal>
|
||||
<Menu
|
||||
position="right"
|
||||
|
||||
@@ -71,9 +71,11 @@ export default function CalendarComponent(props: any) {
|
||||
const currentSonarrMedias: any[] = [];
|
||||
Promise.all(
|
||||
sonarrServices.map((service) =>
|
||||
getMedias(service, 'sonarr').then((res) => {
|
||||
getMedias(service, 'sonarr')
|
||||
.then((res) => {
|
||||
currentSonarrMedias.push(...res.data);
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
currentSonarrMedias.push([]);
|
||||
})
|
||||
)
|
||||
@@ -83,9 +85,11 @@ export default function CalendarComponent(props: any) {
|
||||
const currentRadarrMedias: any[] = [];
|
||||
Promise.all(
|
||||
radarrServices.map((service) =>
|
||||
getMedias(service, 'radarr').then((res) => {
|
||||
getMedias(service, 'radarr')
|
||||
.then((res) => {
|
||||
currentRadarrMedias.push(...res.data);
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
currentRadarrMedias.push([]);
|
||||
})
|
||||
)
|
||||
@@ -95,9 +99,11 @@ export default function CalendarComponent(props: any) {
|
||||
const currentLidarrMedias: any[] = [];
|
||||
Promise.all(
|
||||
lidarrServices.map((service) =>
|
||||
getMedias(service, 'lidarr').then((res) => {
|
||||
getMedias(service, 'lidarr')
|
||||
.then((res) => {
|
||||
currentLidarrMedias.push(...res.data);
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
currentLidarrMedias.push([]);
|
||||
})
|
||||
)
|
||||
@@ -107,9 +113,11 @@ export default function CalendarComponent(props: any) {
|
||||
const currentReadarrMedias: any[] = [];
|
||||
Promise.all(
|
||||
readarrServices.map((service) =>
|
||||
getMedias(service, 'readarr').then((res) => {
|
||||
getMedias(service, 'readarr')
|
||||
.then((res) => {
|
||||
currentReadarrMedias.push(...res.data);
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
currentReadarrMedias.push([]);
|
||||
})
|
||||
)
|
||||
|
||||
@@ -23,19 +23,19 @@ export default function PingComponent(props: any) {
|
||||
const exists = config.modules?.[PingModule.title]?.enabled ?? false;
|
||||
|
||||
function statusCheck(response: AxiosResponse) {
|
||||
const { status }: {status: string[]} = props;
|
||||
const { status }: { status: string[] } = props;
|
||||
//Default Status
|
||||
let acceptableStatus = ['200'];
|
||||
if (status !== undefined && status.length) {
|
||||
acceptableStatus = status;
|
||||
}
|
||||
// Checks if reported status is in acceptable status array
|
||||
if (acceptableStatus.indexOf((response.status).toString()) >= 0) {
|
||||
if (acceptableStatus.indexOf(response.status.toString()) >= 0) {
|
||||
setOnline('online');
|
||||
setResponse(response.status);
|
||||
} else {
|
||||
setOnline('down');
|
||||
setResponse(response.status)
|
||||
setResponse(response.status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,13 @@ export default function PingComponent(props: any) {
|
||||
<Tooltip
|
||||
radius="lg"
|
||||
style={{ position: 'absolute', bottom: 20, right: 20 }}
|
||||
label={isOnline === 'loading' ? 'Loading...' : isOnline === 'online' ? `Online - ${response}` : `Offline - ${response}`}
|
||||
label={
|
||||
isOnline === 'loading'
|
||||
? 'Loading...'
|
||||
: isOnline === 'online'
|
||||
? `Online - ${response}`
|
||||
: `Offline - ${response}`
|
||||
}
|
||||
>
|
||||
<motion.div
|
||||
animate={{
|
||||
|
||||
@@ -44,9 +44,9 @@ async function Post(req: NextApiRequest, res: NextApiResponse) {
|
||||
});
|
||||
}
|
||||
// Get the origin URL
|
||||
var { href: origin } = new URL(service.url);
|
||||
if (origin.endsWith("/")) {
|
||||
origin = origin.slice(0, -1)
|
||||
let { href: origin } = new URL(service.url);
|
||||
if (origin.endsWith('/')) {
|
||||
origin = origin.slice(0, -1);
|
||||
}
|
||||
const pined = `${origin}${url?.url}?apiKey=${service.apiKey}&end=${nextMonth}&start=${lastMonth}`;
|
||||
const data = await axios.get(
|
||||
|
||||
@@ -33,30 +33,30 @@ interface ConfigModule {
|
||||
}
|
||||
|
||||
export const StatusCodes = [
|
||||
{value: '200', label: '200 - OK', group:'Sucessful responses'},
|
||||
{value: '204', label: '204 - No Content', group:'Sucessful responses'},
|
||||
{value: '301', label: '301 - Moved Permanently', group:'Redirection responses'},
|
||||
{value: '302', label: '302 - Found / Moved Temporarily', group:'Redirection responses'},
|
||||
{value: '304', label: '304 - Not Modified', group:'Redirection responses'},
|
||||
{value: '307', label: '307 - Temporary Redirect', group:'Redirection responses'},
|
||||
{value: '308', label: '308 - Permanent Redirect', group:'Redirection responses'},
|
||||
{value: '400', label: '400 - Bad Request', group:'Client error responses'},
|
||||
{value: '401', label: '401 - Unauthorized', group:'Client error responses'},
|
||||
{value: '403', label: '403 - Forbidden', group:'Client error responses'},
|
||||
{value: '404', label: '404 - Not Found', group:'Client error responses'},
|
||||
{value: '408', label: '408 - Request Timeout', group:'Client error responses'},
|
||||
{value: '410', label: '410 - Gone', group:'Client error responses'},
|
||||
{value: '429', label: '429 - Too Many Requests', group:'Client error responses'},
|
||||
{value: '500', label: '500 - Internal Server Error', group:'Server error responses'},
|
||||
{value: '502', label: '502 - Bad Gateway', group:'Server error responses'},
|
||||
{value: '503', label: '503 - Service Unavailable', group:'Server error responses'},
|
||||
{value: '054', label: '504 - Gateway Timeout Error', group:'Server error responses'},
|
||||
];
|
||||
{ value: '200', label: '200 - OK', group: 'Sucessful responses' },
|
||||
{ value: '204', label: '204 - No Content', group: 'Sucessful responses' },
|
||||
{ value: '301', label: '301 - Moved Permanently', group: 'Redirection responses' },
|
||||
{ value: '302', label: '302 - Found / Moved Temporarily', group: 'Redirection responses' },
|
||||
{ value: '304', label: '304 - Not Modified', group: 'Redirection responses' },
|
||||
{ value: '307', label: '307 - Temporary Redirect', group: 'Redirection responses' },
|
||||
{ value: '308', label: '308 - Permanent Redirect', group: 'Redirection responses' },
|
||||
{ value: '400', label: '400 - Bad Request', group: 'Client error responses' },
|
||||
{ value: '401', label: '401 - Unauthorized', group: 'Client error responses' },
|
||||
{ value: '403', label: '403 - Forbidden', group: 'Client error responses' },
|
||||
{ value: '404', label: '404 - Not Found', group: 'Client error responses' },
|
||||
{ value: '408', label: '408 - Request Timeout', group: 'Client error responses' },
|
||||
{ value: '410', label: '410 - Gone', group: 'Client error responses' },
|
||||
{ value: '429', label: '429 - Too Many Requests', group: 'Client error responses' },
|
||||
{ value: '500', label: '500 - Internal Server Error', group: 'Server error responses' },
|
||||
{ value: '502', label: '502 - Bad Gateway', group: 'Server error responses' },
|
||||
{ value: '503', label: '503 - Service Unavailable', group: 'Server error responses' },
|
||||
{ value: '054', label: '504 - Gateway Timeout Error', group: 'Server error responses' },
|
||||
];
|
||||
|
||||
export const Targets = [
|
||||
{value: '_blank', label: 'New Tab'},
|
||||
{value: '_top', label: 'Same Window'}
|
||||
]
|
||||
{ value: '_blank', label: 'New Tab' },
|
||||
{ value: '_top', label: 'Same Window' },
|
||||
];
|
||||
|
||||
export const ServiceTypeList = [
|
||||
'Other',
|
||||
|
||||
Reference in New Issue
Block a user