🚨 Lint and prettier fix

This commit is contained in:
ajnart
2022-06-21 16:21:40 +02:00
parent 91a249d953
commit f0bae49830
5 changed files with 64 additions and 54 deletions

View File

@@ -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"

View File

@@ -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([]);
})
)

View File

@@ -30,12 +30,12 @@ export default function PingComponent(props: any) {
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={{

View File

@@ -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(

View File

@@ -55,8 +55,8 @@ export const StatusCodes = [
export const Targets = [
{ value: '_blank', label: 'New Tab' },
{value: '_top', label: 'Same Window'}
]
{ value: '_top', label: 'Same Window' },
];
export const ServiceTypeList = [
'Other',