Merge branch 'main' into pr/2376
This commit is contained in:
commit
cdf83cb035
@ -41,6 +41,7 @@ widget:
|
||||
view: agenda
|
||||
maxEvents: 10 # optional - defaults to 10
|
||||
showTime: true # optional - show time for event happening today - defaults to false
|
||||
previousDays: 3 # optional - shows events since three days ago - defaults to 0
|
||||
integrations: # same as in Monthly view example
|
||||
```
|
||||
|
||||
|
||||
@ -352,6 +352,7 @@ export function cleanServiceGroups(groups) {
|
||||
integrations,
|
||||
maxEvents,
|
||||
showTime,
|
||||
previousDays,
|
||||
view,
|
||||
|
||||
// coinmarketcap
|
||||
@ -518,6 +519,7 @@ export function cleanServiceGroups(groups) {
|
||||
if (firstDayInWeek) cleanedService.widget.firstDayInWeek = firstDayInWeek;
|
||||
if (view) cleanedService.widget.view = view;
|
||||
if (maxEvents) cleanedService.widget.maxEvents = maxEvents;
|
||||
if (previousDays) cleanedService.widget.previousDays = previousDays;
|
||||
if (showTime) cleanedService.widget.showTime = showTime;
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,9 @@ export default function Agenda({ service, colorVariants, events, showDate }) {
|
||||
|
||||
const eventsArray = Object.keys(events)
|
||||
.filter(
|
||||
(eventKey) => showDate.startOf("day").toUnixInteger() <= events[eventKey].date?.startOf("day").toUnixInteger(),
|
||||
(eventKey) =>
|
||||
showDate.minus({ days: widget?.previousDays ?? 0 }).startOf("day").ts <=
|
||||
events[eventKey].date?.startOf("day").ts,
|
||||
)
|
||||
.map((eventKey) => events[eventKey])
|
||||
.sort((a, b) => a.date - b.date)
|
||||
|
||||
@ -23,27 +23,35 @@ export default function Integration({ config, params, setEvents, hideErrors = fa
|
||||
const physicalTitle = `${event.title} - ${t("calendar.physicalRelease")}`;
|
||||
const digitalTitle = `${event.title} - ${t("calendar.digitalRelease")}`;
|
||||
|
||||
if (event.inCinemas) {
|
||||
eventsToAdd[cinemaTitle] = {
|
||||
title: cinemaTitle,
|
||||
date: DateTime.fromISO(event.inCinemas),
|
||||
color: config?.color ?? "amber",
|
||||
isCompleted: event.isAvailable,
|
||||
isCompleted: event.hasFile,
|
||||
additional: "",
|
||||
};
|
||||
}
|
||||
|
||||
if (event.physicalRelease) {
|
||||
eventsToAdd[physicalTitle] = {
|
||||
title: physicalTitle,
|
||||
date: DateTime.fromISO(event.physicalRelease),
|
||||
color: config?.color ?? "cyan",
|
||||
isCompleted: event.isAvailable,
|
||||
isCompleted: event.hasFile,
|
||||
additional: "",
|
||||
};
|
||||
}
|
||||
|
||||
if (event.digitalRelease) {
|
||||
eventsToAdd[digitalTitle] = {
|
||||
title: digitalTitle,
|
||||
date: DateTime.fromISO(event.digitalRelease),
|
||||
color: config?.color ?? "emerald",
|
||||
isCompleted: event.isAvailable,
|
||||
isCompleted: event.hasFile,
|
||||
additional: "",
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
setEvents((prevEvents) => ({ ...prevEvents, ...eventsToAdd }));
|
||||
|
||||
@ -21,7 +21,7 @@ export default function Component({ service }) {
|
||||
return <Container service={service} error={statsError ?? statusError} />;
|
||||
}
|
||||
|
||||
if (statusData && statusData.status !== "running") {
|
||||
if (statusData && !(statusData.status.includes("running") || statusData.status.includes("partial"))) {
|
||||
return (
|
||||
<Container>
|
||||
<Block label={t("widget.status")} value={t("docker.offline")} />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user