()
| 163 | } |
| 164 | |
| 165 | export function buildSettingSourcesProperties(): Property[] { |
| 166 | const enabledSources = getEnabledSettingSources(); |
| 167 | |
| 168 | // Filter to only sources that actually have settings loaded |
| 169 | const sourcesWithSettings = enabledSources.filter(source => { |
| 170 | const settings = getSettingsForSource(source); |
| 171 | return settings !== null && Object.keys(settings).length > 0; |
| 172 | }); |
| 173 | |
| 174 | // Map internal names to user-friendly names |
| 175 | // For policySettings, distinguish between remote and local (or skip if neither exists) |
| 176 | const sourceNames = sourcesWithSettings |
| 177 | .map(source => { |
| 178 | if (source === 'policySettings') { |
| 179 | const origin = getPolicySettingsOrigin(); |
| 180 | if (origin === null) { |
| 181 | return null; // Skip - no policy settings exist |
| 182 | } |
| 183 | switch (origin) { |
| 184 | case 'remote': |
| 185 | return 'Enterprise managed settings (remote)'; |
| 186 | case 'plist': |
| 187 | return 'Enterprise managed settings (plist)'; |
| 188 | case 'hklm': |
| 189 | return 'Enterprise managed settings (HKLM)'; |
| 190 | case 'file': { |
| 191 | const { hasBase, hasDropIns } = getManagedFileSettingsPresence(); |
| 192 | if (hasBase && hasDropIns) { |
| 193 | return 'Enterprise managed settings (file + drop-ins)'; |
| 194 | } |
| 195 | if (hasDropIns) { |
| 196 | return 'Enterprise managed settings (drop-ins)'; |
| 197 | } |
| 198 | return 'Enterprise managed settings (file)'; |
| 199 | } |
| 200 | case 'hkcu': |
| 201 | return 'Enterprise managed settings (HKCU)'; |
| 202 | } |
| 203 | } |
| 204 | return getSettingSourceDisplayNameCapitalized(source); |
| 205 | }) |
| 206 | .filter((name): name is string => name !== null); |
| 207 | |
| 208 | return [ |
| 209 | { |
| 210 | label: 'Setting sources', |
| 211 | value: sourceNames, |
| 212 | }, |
| 213 | ]; |
| 214 | } |
| 215 | |
| 216 | export async function buildInstallationDiagnostics(): Promise<Diagnostic[]> { |
| 217 | const installWarnings = await checkInstall(); |
no test coverage detected