diff --git a/src/pages/cipp/super-admin/time-settings.js b/src/pages/cipp/super-admin/time-settings.js index df1c06b72749..f540db19363d 100644 --- a/src/pages/cipp/super-admin/time-settings.js +++ b/src/pages/cipp/super-admin/time-settings.js @@ -1,14 +1,14 @@ import { TabbedLayout } from '../../../layouts/TabbedLayout' import { Layout as DashboardLayout } from '../../../layouts/index.js' import { useForm } from 'react-hook-form' -import { Alert, Typography } from '@mui/material' import { Grid } from '@mui/system' import CippFormComponent from '../../../components/CippComponents/CippFormComponent' import { ApiGetCall } from '../../../api/ApiCall' -import { useEffect, useMemo } from 'react' +import { useEffect } from 'react' import CippFormPage from '../../../components/CippFormPages/CippFormPage' import { useTimezones } from '../../../hooks/use-timezones' import tabOptions from './tabOptions' +import { Alert, Typography } from '@mui/material' const Page = () => { const pageTitle = 'Time Settings' @@ -17,7 +17,6 @@ const Page = () => { mode: 'onChange', defaultValues: { Timezone: { label: 'UTC', value: 'UTC' }, - BusinessHoursStart: { label: '09:00', value: '09:00' }, }, }) @@ -28,21 +27,6 @@ const Page = () => { }) const { timezones, loading: timezonesLoading } = useTimezones() - const isFlexConsumption = backendInfo.data?.Results?.SKU === 'FlexConsumption' - const isLinuxConsumption = backendInfo.data?.Results?.OS === 'Linux' && !isFlexConsumption - - // Generate business hours options (00:00 to 23:00 in hourly increments) - const businessHoursOptions = useMemo(() => { - const hours = [] - for (let i = 0; i < 24; i++) { - const hour = i.toString().padStart(2, '0') - hours.push({ - label: `${hour}:00`, - value: `${hour}:00`, - }) - } - return hours - }, []) useEffect(() => { if (backendInfo.isSuccess && backendInfo.data) { @@ -53,19 +37,9 @@ const Page = () => { label: tzStr, value: tzStr, } - - const startStr = backendInfo.data?.Results?.BusinessHoursStart || '09:00' - const startOption = businessHoursOptions.find((o) => o.value === startStr) || { - label: startStr, - value: startStr, - } - - formControl.reset({ - Timezone: tzOption, - BusinessHoursStart: startOption, - }) + formControl.reset({ Timezone: tzOption }) } - }, [backendInfo.isSuccess, backendInfo.data, timezones, businessHoursOptions]) + }, [backendInfo.isSuccess, backendInfo.data, timezones]) return ( { > - - Configure the timezone for CIPP operations and scheduling. If you are using a Flex - Consumption App Service Plan, you can also configure business hours to optimize - performance and cost. - + + Configure the timezone for CIPP. This setting will determine which timezone is used when + background tasks run. If no timezone is selected, UTC will be used by default. + {!backendInfo.isSuccess && ( @@ -99,74 +72,18 @@ const Page = () => { )} {backendInfo.isSuccess && ( - <> - {isLinuxConsumption ? ( - - - - Timezone Not Supported - - The WEBSITE_TIME_ZONE setting is not supported on Linux - Consumption function apps. Timezone configuration is only available on Windows - plans, Premium Linux plans, and Flex Consumption plans. - - - ) : ( - - - - )} - - {isFlexConsumption && ( - <> - - - - Flex Consumption Business Hours - - Business hours are used to optimize Flex Consumption instance scheduling. Set - the start time for your business hours. CIPP will maintain higher instance - availability during a 10-hour window from the start time for better performance. - Outside of this window, instances may scale down to reduce costs. - - - - - - - - )} - - {!isFlexConsumption && ( - - - - App Service Plan: {backendInfo.data?.SKU || 'Unknown'} - - Business hours configuration is only available for Flex Consumption App Service - Plans. - - - )} - + + + )}