mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
fix(app/edge): updater/rollback calendar visual issues (#8386)
This commit is contained in:
parent
9b53960906
commit
921e9cfc6e
5 changed files with 152 additions and 60 deletions
|
@ -12,6 +12,7 @@ import {
|
|||
|
||||
import { FormControl } from '@@/form-components/FormControl';
|
||||
import { Input } from '@@/form-components/Input';
|
||||
import { TextTip } from '@@/Tip/TextTip';
|
||||
|
||||
import { FormValues } from './types';
|
||||
|
||||
|
@ -30,23 +31,34 @@ export function ScheduledTimeField({ disabled }: Props) {
|
|||
}
|
||||
|
||||
return (
|
||||
<FormControl label="Schedule date & time" errors={error}>
|
||||
{!disabled ? (
|
||||
<DateTimePicker
|
||||
format="y-MM-dd HH:mm:ss"
|
||||
className="form-control [&>div]:border-0"
|
||||
onChange={(date) => setValue(isoDate(date.valueOf()))}
|
||||
name={name}
|
||||
value={dateValue}
|
||||
calendarIcon={<Calendar className="lucide" />}
|
||||
clearIcon={<X className="lucide" />}
|
||||
disableClock
|
||||
minDate={new Date(Date.now() - 24 * 60 * 60 * 1000)}
|
||||
/>
|
||||
) : (
|
||||
<Input defaultValue={value} disabled />
|
||||
<>
|
||||
<FormControl label="Schedule date & time" errors={error}>
|
||||
{!disabled ? (
|
||||
<DateTimePicker
|
||||
format="y-MM-dd HH:mm:ss"
|
||||
className="form-control [&>div]:border-0"
|
||||
onChange={(date) => {
|
||||
const dateToSave =
|
||||
date || new Date(Date.now() + 24 * 60 * 60 * 1000);
|
||||
setValue(isoDate(dateToSave.valueOf()));
|
||||
}}
|
||||
name={name}
|
||||
value={dateValue}
|
||||
calendarIcon={<Calendar className="lucide" />}
|
||||
clearIcon={<X className="lucide" />}
|
||||
disableClock
|
||||
minDate={new Date(Date.now() - 24 * 60 * 60 * 1000)}
|
||||
/>
|
||||
) : (
|
||||
<Input defaultValue={value} disabled />
|
||||
)}
|
||||
</FormControl>
|
||||
{!disabled && value && (
|
||||
<TextTip color="blue">
|
||||
If time zone is not set on edge agent then UTC+0 will be used.
|
||||
</TextTip>
|
||||
)}
|
||||
</FormControl>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue