feat: expand advanced widget experiences
This commit is contained in:
1 parent
9437d211c8
commit
c099a8eef6
119 files changed
+3624
-844
No files matched your search
@@ -0,0 +1,22 @@
|
||||
export const BESZEL_ALERTS_ADVANCED_MIN_HISTORY_ITEMS = 50;
|
||||
const BESZEL_ALERTS_MAX_HISTORY_ITEMS = 100;
|
||||
|
||||
interface BeszelAlertsDisplayOptions {
|
||||
showHistory: boolean;
|
||||
maxHistoryItems: number;
|
||||
}
|
||||
|
||||
export const getBeszelAlertsQueryInput = (
|
||||
integrationIds: string[],
|
||||
options: BeszelAlertsDisplayOptions,
|
||||
isAdvanced: boolean,
|
||||
) => ({
|
||||
integrationIds,
|
||||
includeHistory: isAdvanced || options.showHistory,
|
||||
maxHistoryItems: isAdvanced
|
||||
? Math.min(
|
||||
BESZEL_ALERTS_MAX_HISTORY_ITEMS,
|
||||
Math.max(BESZEL_ALERTS_ADVANCED_MIN_HISTORY_ITEMS, options.maxHistoryItems),
|
||||
)
|
||||
: options.maxHistoryItems,
|
||||
});
|
||||
Reference in new issue
Block a user