🔀 Merge branch 'dev' into improve-dns-hole-stats-layout
This commit is contained in:
@@ -10,6 +10,8 @@ export const getFrontendConfig = async (name: string): Promise<ConfigType> => {
|
||||
let config = getConfig(name);
|
||||
let shouldMigrateConfig = false;
|
||||
|
||||
config = migrateAppConfigs(config);
|
||||
|
||||
const anyWeatherWidgetWithStringLocation = config.widgets.some(
|
||||
(widget) => widget.type === 'weather' && typeof widget.properties.location === 'string'
|
||||
);
|
||||
@@ -129,3 +131,18 @@ const migratePiholeIntegrationField = (config: BackendConfigType) => {
|
||||
}),
|
||||
};
|
||||
};
|
||||
|
||||
const migrateAppConfigs = (config: BackendConfigType) => {
|
||||
return {
|
||||
...config,
|
||||
apps: config.apps.map((app) => ({
|
||||
...app,
|
||||
appearance: {
|
||||
...app.appearance,
|
||||
appNameStatus: app.appearance.appNameStatus?? 'normal',
|
||||
positionAppName: app.appearance.positionAppName?? 'column',
|
||||
lineClampAppName: app.appearance.lineClampAppName?? 1,
|
||||
}
|
||||
}))
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const adGuardApiStatsResponseSchema = z.object({
|
||||
time_units: z.enum(['hours']),
|
||||
time_units: z.enum(['hours', 'days']),
|
||||
top_queried_domains: z.array(z.record(z.string(), z.number())),
|
||||
top_clients: z.array(z.record(z.string(), z.number())),
|
||||
top_blocked_domains: z.array(z.record(z.string(), z.number())),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { z } from 'zod';
|
||||
import { trimStringEnding } from '../../../shared/strings';
|
||||
import {
|
||||
adGuardApiFilteringStatusSchema,
|
||||
@@ -77,19 +78,4 @@ export class AdGuard {
|
||||
}
|
||||
}
|
||||
|
||||
export type AdGuardStatsType = {
|
||||
time_units: string;
|
||||
top_queried_domains: { [key: string]: number }[];
|
||||
top_clients: { [key: string]: number }[];
|
||||
top_blocked_domains: { [key: string]: number }[];
|
||||
dns_queries: number[];
|
||||
blocked_filtering: number[];
|
||||
replaced_safebrowsing: number[];
|
||||
replaced_parental: number[];
|
||||
num_dns_queries: number;
|
||||
num_blocked_filtering: number;
|
||||
num_replaced_safebrowsing: number;
|
||||
num_replaced_safesearch: number;
|
||||
num_replaced_parental: number;
|
||||
avg_processing_time: number;
|
||||
};
|
||||
export type AdGuardStatsType = z.infer<typeof adGuardApiStatsResponseSchema>;
|
||||
|
||||
Reference in New Issue
Block a user