style: auto-fix lint and format
This commit is contained in:
1 parent
d0709a684c
commit
525eda3cbb
8 files changed
+20
-27
No files matched your search
@@ -66,20 +66,12 @@ export function InstanceCard({ instance, options, isTiny, widgetKey }: InstanceC
|
||||
</Badge>
|
||||
)}
|
||||
{options.showApplications && (
|
||||
<Badge
|
||||
variant="dot"
|
||||
color={getBadgeColor(runningApps, applications.length)}
|
||||
size="xs"
|
||||
>
|
||||
<Badge variant="dot" color={getBadgeColor(runningApps, applications.length)} size="xs">
|
||||
{runningApps}/{applications.length}
|
||||
</Badge>
|
||||
)}
|
||||
{options.showServices && (
|
||||
<Badge
|
||||
variant="dot"
|
||||
color={getBadgeColor(runningServices, services.length)}
|
||||
size="xs"
|
||||
>
|
||||
<Badge variant="dot" color={getBadgeColor(runningServices, services.length)} size="xs">
|
||||
{runningServices}/{services.length}
|
||||
</Badge>
|
||||
)}
|
||||
@@ -100,9 +92,7 @@ export function InstanceCard({ instance, options, isTiny, widgetKey }: InstanceC
|
||||
{options.showApplications && (
|
||||
<ApplicationsSection applications={applications} baseUrl={baseUrl} isTiny={isTiny} />
|
||||
)}
|
||||
{options.showServices && (
|
||||
<ServicesSection services={services} baseUrl={baseUrl} isTiny={isTiny} />
|
||||
)}
|
||||
{options.showServices && <ServicesSection services={services} baseUrl={baseUrl} isTiny={isTiny} />}
|
||||
</Accordion>
|
||||
|
||||
<Group justify="space-between" p={4} style={{ borderTop: "1px solid var(--mantine-color-dark-4)" }}>
|
||||
|
||||
@@ -70,9 +70,7 @@ export function SingleInstanceLayout({ instance, options, isTiny, widgetKey }: S
|
||||
{options.showApplications && (
|
||||
<ApplicationsSection applications={applications} baseUrl={baseUrl} isTiny={isTiny} />
|
||||
)}
|
||||
{options.showServices && (
|
||||
<ServicesSection services={services} baseUrl={baseUrl} isTiny={isTiny} />
|
||||
)}
|
||||
{options.showServices && <ServicesSection services={services} baseUrl={baseUrl} isTiny={isTiny} />}
|
||||
</Accordion>
|
||||
|
||||
<Group
|
||||
|
||||
@@ -104,7 +104,9 @@ export default function DownloadClientsWidget({
|
||||
const [quickFilters, setQuickFilters] = useState<QuickFilter>({ integrationKinds: [], statuses: [] });
|
||||
const availableStatuses = useMemo<QuickFilter["statuses"]>(() => {
|
||||
//Redefine list of available statuses from current items
|
||||
const statuses = Array.from(new Set(currentItems.flatMap(({ data }) => (data.items ?? []).map(({ state }) => state))));
|
||||
const statuses = Array.from(
|
||||
new Set(currentItems.flatMap(({ data }) => (data.items ?? []).map(({ state }) => state))),
|
||||
);
|
||||
//Reset user filters accordingly to remove unavailable statuses
|
||||
setQuickFilters(({ integrationKinds: names, statuses: prevStatuses }) => {
|
||||
return { integrationKinds: names, statuses: prevStatuses.filter((status) => statuses.includes(status)) };
|
||||
|
||||
@@ -54,10 +54,7 @@ export const ClusterHealthMonitoring = ({
|
||||
const usedMem = nodes.reduce((sum, item) => (item.isRunning ? item.memory.used + sum : sum), 0);
|
||||
const maxMem = nodes.reduce((sum, item) => (item.isRunning ? item.memory.total + sum : sum), 0);
|
||||
const maxCpu = nodes.reduce((sum, item) => (item.isRunning ? item.cpu.cores + sum : sum), 0);
|
||||
const usedCpu = nodes.reduce(
|
||||
(sum, item) => (item.isRunning ? item.cpu.utilization * item.cpu.cores + sum : sum),
|
||||
0,
|
||||
);
|
||||
const usedCpu = nodes.reduce((sum, item) => (item.isRunning ? item.cpu.utilization * item.cpu.cores + sum : sum), 0);
|
||||
const uptime = nodes.reduce((sum, { uptime }) => (sum > uptime ? sum : uptime), 0);
|
||||
|
||||
const cpuPercent = maxCpu ? (usedCpu / maxCpu) * 100 : 0;
|
||||
|
||||
@@ -43,7 +43,8 @@ export default function MediaServerWidget({
|
||||
const board = useRequiredBoard();
|
||||
|
||||
if (!requestStats) return <WidgetEmptyState />;
|
||||
if ((requestStats.users ?? []).length === 0 && (requestStats.stats ?? []).length === 0) throw new NoIntegrationDataError();
|
||||
if ((requestStats.users ?? []).length === 0 && (requestStats.stats ?? []).length === 0)
|
||||
throw new NoIntegrationDataError();
|
||||
|
||||
const data = [
|
||||
{
|
||||
|
||||
@@ -32,7 +32,9 @@ export default function SpeedtestTrackerWidget({ options, integrationIds }: Widg
|
||||
);
|
||||
|
||||
const twelveHoursAgo = Date.now() - 12 * 60 * 60 * 1000;
|
||||
const recentFiltered = combined.recentResults.filter((result) => new Date(result.created_at).getTime() > twelveHoursAgo);
|
||||
const recentFiltered = combined.recentResults.filter(
|
||||
(result) => new Date(result.created_at).getTime() > twelveHoursAgo,
|
||||
);
|
||||
|
||||
const hasStatSection =
|
||||
(options.showLatestResult && combined.latestResult !== null) || (options.showStats && combined.stats !== null);
|
||||
|
||||
@@ -40,7 +40,7 @@ function buildXAxisTicks(data: { ts: number }[]): XAxisTicks {
|
||||
|
||||
return {
|
||||
midnightTs: foundMidnight,
|
||||
xTicks: Array.from(tickSet).sort((tsA, tsB) => tsA - tsB),
|
||||
xTicks: Array.from(tickSet).toSorted((tsA, tsB) => tsA - tsB),
|
||||
topDateTicks: topTicks,
|
||||
};
|
||||
}
|
||||
@@ -161,7 +161,7 @@ function SpeedHistoryChart({ results, height }: { results: SpeedtestTrackerResul
|
||||
const data = useMemo(
|
||||
() =>
|
||||
[...results]
|
||||
.sort((resultA, resultB) => new Date(resultA.created_at).getTime() - new Date(resultB.created_at).getTime())
|
||||
.toSorted((resultA, resultB) => new Date(resultA.created_at).getTime() - new Date(resultB.created_at).getTime())
|
||||
.filter((result) => (result.download_bits ?? 0) > 0)
|
||||
.map((result) => ({
|
||||
ts: new Date(result.created_at).getTime(),
|
||||
@@ -273,7 +273,7 @@ function PingHistoryChart({ results, height }: { results: SpeedtestTrackerResult
|
||||
const data = useMemo(
|
||||
() =>
|
||||
[...results]
|
||||
.sort((resultA, resultB) => new Date(resultA.created_at).getTime() - new Date(resultB.created_at).getTime())
|
||||
.toSorted((resultA, resultB) => new Date(resultA.created_at).getTime() - new Date(resultB.created_at).getTime())
|
||||
.map((result) =>
|
||||
result.ping === null
|
||||
? null
|
||||
|
||||
@@ -37,7 +37,10 @@ function TracearrContent({ integrationIds, options, width }: TracearrContentProp
|
||||
const { stats, streams, violations, recentActivity } = item.dashboard;
|
||||
const vData = violations ?? { data: [], meta: { total: 0, page: 1, pageSize: 5 } };
|
||||
const aData = recentActivity ?? { data: [], meta: { total: 0, page: 1, pageSize: 5 } };
|
||||
const sData = streams ?? { data: [], summary: { total: 0, transcodes: 0, directStreams: 0, directPlays: 0, totalBitrate: "0", byServer: [] } };
|
||||
const sData = streams ?? {
|
||||
data: [],
|
||||
summary: { total: 0, transcodes: 0, directStreams: 0, directPlays: 0, totalBitrate: "0", byServer: [] },
|
||||
};
|
||||
|
||||
return {
|
||||
stats: {
|
||||
|
||||
Reference in new issue
Block a user