1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-30 22:50:10 +03:00

B : Fix time schedule actions ()

(cherry picked from commit b448fa89a80fdab176df13d03c2e907132af3f51)
This commit is contained in:
Jorge Miguel Lobo Escalona 2023-11-28 16:38:42 +01:00 committed by Tino Vázquez
parent f0653a8b75
commit 6c902ce737
No known key found for this signature in database
GPG Key ID: 14201E424D02047E
2 changed files with 16 additions and 7 deletions
src/fireedge/src
client/components/Forms/Vm/CreateSchedActionForm
server/routes/entrypoints

@ -23,6 +23,7 @@ import {
PERIOD_TYPES,
REPEAT_VALUES,
SCHEDULE_TYPE,
SERVER_CONFIG,
T,
TEMPLATE_SCHEDULE_TYPE_STRING,
VM_ACTIONS_IN_CHARTER,
@ -67,13 +68,13 @@ const DAYS_OF_WEEK = [
T.Saturday,
]
const getNow = () => DateTime.now()
const getNow = () =>
SERVER_CONFIG?.currentTimeZone
? DateTime.now().setZone(SERVER_CONFIG.currentTimeZone)
: DateTime.now()
const getTomorrow = () => getNow().plus({ days: 1 })
const getTomorrowAtMidnight = () =>
getTomorrow().set({ hour: 12, minute: 0, second: 0 })
const getNextWeek = () => getNow().plus({ weeks: 1 })
const parseDateString = (_, originalValue) => {
@ -239,7 +240,7 @@ const TIME_FIELD = {
typeAction !== SCHEDULE_TYPE.RELATIVE ? schema.required() : schema
),
fieldProps: {
defaultValue: getTomorrowAtMidnight(),
defaultValue: getTomorrow(),
minDateTime: getNow(),
},
}

@ -49,13 +49,21 @@ const ensuredScriptValue = (value) =>
const router = Router()
const defaultConfig = {
currentTimeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
}
router.get('*', async (req, res) => {
const remoteJWT = {}
const APP_CONFIG = {
[defaultApps.provision.name]: getProvisionConfig() || {},
[defaultApps.provision.name]:
{ ...defaultConfig, ...getProvisionConfig() } || defaultConfig,
[defaultApps.sunstone.name]:
getSunstoneConfig({ includeProtectedConfig: false }) || {},
{
...defaultConfig,
...getSunstoneConfig({ includeProtectedConfig: false }),
} || defaultConfig,
}
const appConfig = getFireedgeConfig()