mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 15:35:55 +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([]);
|
||||
})
|
||||
)
|
||||
|
||||
@@ -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={{
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user