feat: add windows API model
This commit is contained in:
@@ -180,3 +180,31 @@ export function buildProxiFyreConfig(profiles, targets, options = {}) {
|
||||
excludes: [],
|
||||
};
|
||||
}
|
||||
|
||||
export function summarizeProfiles(profiles, targets, options = {}) {
|
||||
const normalizedTargets = normalizeProxyTargets(targets);
|
||||
const targetById = new Map(
|
||||
normalizedTargets.map((target) => [target.id, target]),
|
||||
);
|
||||
return normalizeWindowsProfiles(profiles).map((profile) => {
|
||||
const resolvedItems = resolveProfileItems(profile.items, options);
|
||||
const target =
|
||||
targetById.get(profile.proxyTargetId) || targetById.get("local-singbox");
|
||||
return {
|
||||
...profile,
|
||||
target,
|
||||
resolvedCount: resolvedItems.length,
|
||||
resolvedItems,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export function createActivityEntry(type, message, details = {}) {
|
||||
return {
|
||||
id: `${Date.now()}-${Math.random().toString(16).slice(2)}`,
|
||||
ts: new Date().toISOString(),
|
||||
type,
|
||||
message,
|
||||
details,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user