mirror of
https://github.com/okieselbach/AutopilotMonitor.git
synced 2026-10-24 20:53:06 +00:00
added Timezone autoset option in agent settings
This commit is contained in:
@@ -58,6 +58,8 @@ interface TenantConfigContextValue {
|
||||
setRebootDelaySeconds: (v: number) => void;
|
||||
enableGeoLocation: boolean;
|
||||
setEnableGeoLocation: (v: boolean) => void;
|
||||
enableTimezoneAutoSet: boolean;
|
||||
setEnableTimezoneAutoSet: (v: boolean) => void;
|
||||
enableImeMatchLog: boolean;
|
||||
setEnableImeMatchLog: (v: boolean) => void;
|
||||
logLevel: string;
|
||||
@@ -234,6 +236,7 @@ export function TenantConfigProvider({ children }: { children: React.ReactNode }
|
||||
const [rebootOnComplete, setRebootOnComplete] = useState(false);
|
||||
const [rebootDelaySeconds, setRebootDelaySeconds] = useState(10);
|
||||
const [enableGeoLocation, setEnableGeoLocation] = useState(true);
|
||||
const [enableTimezoneAutoSet, setEnableTimezoneAutoSet] = useState(false);
|
||||
const [enableImeMatchLog, setEnableImeMatchLog] = useState(false);
|
||||
const [logLevel, setLogLevel] = useState("Info");
|
||||
const [showScriptOutput, setShowScriptOutput] = useState(true);
|
||||
@@ -302,6 +305,7 @@ export function TenantConfigProvider({ children }: { children: React.ReactNode }
|
||||
setRebootOnComplete(data.rebootOnComplete ?? false);
|
||||
setRebootDelaySeconds(data.rebootDelaySeconds ?? 10);
|
||||
setEnableGeoLocation(data.enableGeoLocation ?? true);
|
||||
setEnableTimezoneAutoSet(data.enableTimezoneAutoSet ?? false);
|
||||
setEnableImeMatchLog(data.enableImeMatchLog ?? false);
|
||||
setLogLevel(data.logLevel ?? "Info");
|
||||
setShowScriptOutput(data.showScriptOutput ?? true);
|
||||
@@ -491,6 +495,7 @@ export function TenantConfigProvider({ children }: { children: React.ReactNode }
|
||||
rebootOnComplete,
|
||||
rebootDelaySeconds,
|
||||
enableGeoLocation,
|
||||
enableTimezoneAutoSet,
|
||||
enableImeMatchLog,
|
||||
logLevel,
|
||||
showScriptOutput,
|
||||
@@ -552,7 +557,7 @@ export function TenantConfigProvider({ children }: { children: React.ReactNode }
|
||||
manufacturerWhitelist, modelWhitelist, validateAutopilotDevice, validateCorporateIdentifier,
|
||||
dataRetentionDays, sessionTimeoutHours, enablePerformanceCollector, performanceCollectorInterval,
|
||||
helloWaitTimeoutSeconds, selfDestructOnComplete, keepLogFile, rebootOnComplete, rebootDelaySeconds,
|
||||
enableGeoLocation, enableImeMatchLog, logLevel, showScriptOutput, showEnrollmentSummary,
|
||||
enableGeoLocation, enableTimezoneAutoSet, enableImeMatchLog, logLevel, showScriptOutput, showEnrollmentSummary,
|
||||
enrollmentSummaryTimeoutSeconds, enrollmentSummaryBrandingImageUrl, enrollmentSummaryLaunchRetrySeconds,
|
||||
webhookProviderType, webhookUrl, webhookNotifyOnSuccess, webhookNotifyOnFailure,
|
||||
diagnosticsBlobSasUrl, diagnosticsUploadMode, tenantDiagPaths,
|
||||
@@ -710,6 +715,7 @@ export function TenantConfigProvider({ children }: { children: React.ReactNode }
|
||||
setRebootOnComplete(config.rebootOnComplete ?? false);
|
||||
setRebootDelaySeconds(config.rebootDelaySeconds ?? 10);
|
||||
setEnableGeoLocation(config.enableGeoLocation ?? true);
|
||||
setEnableTimezoneAutoSet(config.enableTimezoneAutoSet ?? false);
|
||||
setEnableImeMatchLog(config.enableImeMatchLog ?? false);
|
||||
setLogLevel(config.logLevel ?? "Info");
|
||||
setShowScriptOutput(config.showScriptOutput ?? true);
|
||||
@@ -1040,6 +1046,7 @@ export function TenantConfigProvider({ children }: { children: React.ReactNode }
|
||||
rebootOnComplete, setRebootOnComplete,
|
||||
rebootDelaySeconds, setRebootDelaySeconds,
|
||||
enableGeoLocation, setEnableGeoLocation,
|
||||
enableTimezoneAutoSet, setEnableTimezoneAutoSet,
|
||||
enableImeMatchLog, setEnableImeMatchLog,
|
||||
logLevel, setLogLevel,
|
||||
showScriptOutput, setShowScriptOutput,
|
||||
|
||||
@@ -14,6 +14,7 @@ export function SectionAgentSettings() {
|
||||
rebootOnComplete, setRebootOnComplete,
|
||||
rebootDelaySeconds, setRebootDelaySeconds,
|
||||
enableGeoLocation, setEnableGeoLocation,
|
||||
enableTimezoneAutoSet, setEnableTimezoneAutoSet,
|
||||
enableImeMatchLog, setEnableImeMatchLog,
|
||||
logLevel, setLogLevel,
|
||||
showScriptOutput, setShowScriptOutput,
|
||||
@@ -45,6 +46,8 @@ export function SectionAgentSettings() {
|
||||
setRebootDelaySeconds={setRebootDelaySeconds}
|
||||
enableGeoLocation={enableGeoLocation}
|
||||
setEnableGeoLocation={setEnableGeoLocation}
|
||||
enableTimezoneAutoSet={enableTimezoneAutoSet}
|
||||
setEnableTimezoneAutoSet={setEnableTimezoneAutoSet}
|
||||
enableImeMatchLog={enableImeMatchLog}
|
||||
setEnableImeMatchLog={setEnableImeMatchLog}
|
||||
logLevel={logLevel}
|
||||
|
||||
@@ -19,6 +19,8 @@ interface AgentSettingsSectionProps {
|
||||
setRebootDelaySeconds: (value: number) => void;
|
||||
enableGeoLocation: boolean;
|
||||
setEnableGeoLocation: (value: boolean) => void;
|
||||
enableTimezoneAutoSet: boolean;
|
||||
setEnableTimezoneAutoSet: (value: boolean) => void;
|
||||
enableImeMatchLog: boolean;
|
||||
setEnableImeMatchLog: (value: boolean) => void;
|
||||
logLevel: string;
|
||||
@@ -55,6 +57,8 @@ export default function AgentSettingsSection({
|
||||
setRebootDelaySeconds,
|
||||
enableGeoLocation,
|
||||
setEnableGeoLocation,
|
||||
enableTimezoneAutoSet,
|
||||
setEnableTimezoneAutoSet,
|
||||
enableImeMatchLog,
|
||||
setEnableImeMatchLog,
|
||||
logLevel,
|
||||
@@ -160,6 +164,20 @@ export default function AgentSettingsSection({
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Timezone Auto-Set (sub-toggle of Geo-Location) */}
|
||||
{enableGeoLocation && (
|
||||
<div className="flex items-center justify-between p-4 rounded-lg border border-gray-200 hover:border-violet-200 transition-colors ml-4">
|
||||
<div>
|
||||
<p className="font-medium text-gray-900">Set Timezone Automatically</p>
|
||||
<p className="text-sm text-gray-500">Set the device timezone based on IP geolocation result (uses tzutil /s)</p>
|
||||
</div>
|
||||
<button onClick={() => setEnableTimezoneAutoSet(!enableTimezoneAutoSet)}
|
||||
className={`relative inline-flex h-6 w-11 flex-shrink-0 items-center rounded-full transition-colors ${enableTimezoneAutoSet ? 'bg-violet-500' : 'bg-gray-300'}`}>
|
||||
<span className={`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${enableTimezoneAutoSet ? 'translate-x-6' : 'translate-x-1'}`} />
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* IME Match Log */}
|
||||
<div className="flex items-center justify-between p-4 rounded-lg border border-gray-200 hover:border-violet-200 transition-colors">
|
||||
<div>
|
||||
|
||||
@@ -26,6 +26,7 @@ export interface TenantConfiguration {
|
||||
rebootOnComplete?: boolean;
|
||||
rebootDelaySeconds?: number;
|
||||
enableGeoLocation?: boolean;
|
||||
enableTimezoneAutoSet?: boolean;
|
||||
enableImeMatchLog?: boolean;
|
||||
logLevel?: string;
|
||||
// Teams notifications (legacy)
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user