mirror of https://github.com/portainer/portainer
feat(edge/updates): sync code changes from EE [EE-3023] (#8186)
* feat(edge/updates): add info about each field * feat(edge/update): add beta feature * fix(edge/update): add infopull/8218/head
parent
4bd6618fb9
commit
294d1668d4
|
@ -83,7 +83,7 @@ function sizeClassChildren(size?: Size) {
|
||||||
case 'medium':
|
case 'medium':
|
||||||
return 'col-sm-8 col-lg-9';
|
return 'col-sm-8 col-lg-9';
|
||||||
case 'xsmall':
|
case 'xsmall':
|
||||||
return 'col-sm-8';
|
return 'col-sm-10';
|
||||||
case 'vertical':
|
case 'vertical':
|
||||||
return '';
|
return '';
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -11,7 +11,7 @@ export function UpdateBadge() {
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'badge inline-flex items-center px-3 py-2 font-normal border-solid border border-transparent',
|
'badge inline-flex items-center px-[2px] font-normal border-solid border border-transparent rounded-xl',
|
||||||
'bg-blue-3 text-blue-8',
|
'bg-blue-3 text-blue-8',
|
||||||
'th-dark:bg-blue-8 th-dark:text-white',
|
'th-dark:bg-blue-8 th-dark:text-white',
|
||||||
'th-highcontrast:bg-transparent th-highcontrast:text-white th-highcontrast:border-white'
|
'th-highcontrast:bg-transparent th-highcontrast:text-white th-highcontrast:border-white'
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { PageHeader } from '@@/PageHeader';
|
||||||
import { Widget } from '@@/Widget';
|
import { Widget } from '@@/Widget';
|
||||||
import { LoadingButton } from '@@/buttons';
|
import { LoadingButton } from '@@/buttons';
|
||||||
import { TextTip } from '@@/Tip/TextTip';
|
import { TextTip } from '@@/Tip/TextTip';
|
||||||
|
import { Link } from '@@/Link';
|
||||||
|
|
||||||
import { ScheduleType } from '../types';
|
import { ScheduleType } from '../types';
|
||||||
import { useCreateMutation } from '../queries/create';
|
import { useCreateMutation } from '../queries/create';
|
||||||
|
@ -57,6 +58,12 @@ function CreateView() {
|
||||||
<Widget>
|
<Widget>
|
||||||
<Widget.Title title="Update & Rollback Scheduler" icon={Settings} />
|
<Widget.Title title="Update & Rollback Scheduler" icon={Settings} />
|
||||||
<Widget.Body>
|
<Widget.Body>
|
||||||
|
<TextTip color="blue">
|
||||||
|
Devices need to be allocated to an Edge group, visit the{' '}
|
||||||
|
<Link to="edge.groups">Edge Groups</Link> page to assign
|
||||||
|
environments and create groups.
|
||||||
|
</TextTip>
|
||||||
|
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { Widget } from '@@/Widget';
|
||||||
import { LoadingButton } from '@@/buttons';
|
import { LoadingButton } from '@@/buttons';
|
||||||
import { TextTip } from '@@/Tip/TextTip';
|
import { TextTip } from '@@/Tip/TextTip';
|
||||||
import { InformationPanel } from '@@/InformationPanel';
|
import { InformationPanel } from '@@/InformationPanel';
|
||||||
|
import { Link } from '@@/Link';
|
||||||
|
|
||||||
import { useItem } from '../queries/useItem';
|
import { useItem } from '../queries/useItem';
|
||||||
import { validation } from '../common/validation';
|
import { validation } from '../common/validation';
|
||||||
|
@ -83,6 +84,12 @@ function ItemView() {
|
||||||
<Widget>
|
<Widget>
|
||||||
<Widget.Title title="Update & Rollback Scheduler" icon={Settings} />
|
<Widget.Title title="Update & Rollback Scheduler" icon={Settings} />
|
||||||
<Widget.Body>
|
<Widget.Body>
|
||||||
|
<TextTip color="blue">
|
||||||
|
Devices need to be allocated to an Edge group, visit the{' '}
|
||||||
|
<Link to="edge.groups">Edge Groups</Link> page to assign
|
||||||
|
environments and create groups.
|
||||||
|
</TextTip>
|
||||||
|
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={
|
initialValues={
|
||||||
!isScheduleActive ? initialValues : initialValuesActive
|
!isScheduleActive ? initialValues : initialValuesActive
|
||||||
|
|
|
@ -14,6 +14,7 @@ import { useSearchBarState } from '@@/datatables/SearchBar';
|
||||||
import { useList } from '../queries/list';
|
import { useList } from '../queries/list';
|
||||||
import { EdgeUpdateSchedule, StatusType } from '../types';
|
import { EdgeUpdateSchedule, StatusType } from '../types';
|
||||||
import { useRemoveMutation } from '../queries/useRemoveMutation';
|
import { useRemoveMutation } from '../queries/useRemoveMutation';
|
||||||
|
import { BetaAlert } from '../common/BetaAlert';
|
||||||
|
|
||||||
import { columns } from './columns';
|
import { columns } from './columns';
|
||||||
import { createStore } from './datatable-store';
|
import { createStore } from './datatable-store';
|
||||||
|
@ -41,6 +42,8 @@ export function ListView() {
|
||||||
breadcrumbs="Update and rollback"
|
breadcrumbs="Update and rollback"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<BetaAlert />
|
||||||
|
|
||||||
<Datatable
|
<Datatable
|
||||||
dataset={listQuery.data}
|
dataset={listQuery.data}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { useEdgeGroups } from '@/react/edge/edge-groups/queries/useEdgeGroups';
|
||||||
|
|
||||||
import { FormControl } from '@@/form-components/FormControl';
|
import { FormControl } from '@@/form-components/FormControl';
|
||||||
import { Select } from '@@/form-components/ReactSelect';
|
import { Select } from '@@/form-components/ReactSelect';
|
||||||
|
import { TextTip } from '@@/Tip/TextTip';
|
||||||
|
|
||||||
import { FormValues } from './types';
|
import { FormValues } from './types';
|
||||||
|
|
||||||
|
@ -29,14 +30,23 @@ export function EdgeGroupsField({
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormControl label="Groups" required inputId="groups-select" errors={error}>
|
<>
|
||||||
|
<FormControl
|
||||||
|
label="Groups"
|
||||||
|
required
|
||||||
|
inputId="groups-select"
|
||||||
|
errors={error}
|
||||||
|
tooltip="Updates are done based on groups, allowing you to choose multiple devices at the same time and the ability to roll out progressively across all environments by scheduling them for different days."
|
||||||
|
>
|
||||||
<Select
|
<Select
|
||||||
name="groupIds"
|
name="groupIds"
|
||||||
onBlur={onBlur}
|
onBlur={onBlur}
|
||||||
value={selectedGroups}
|
value={selectedGroups}
|
||||||
inputId="groups-select"
|
inputId="groups-select"
|
||||||
placeholder="Select one or multiple group(s)"
|
placeholder="Select one or multiple group(s)"
|
||||||
onChange={(selectedGroups) => onChange(selectedGroups.map((g) => g.Id))}
|
onChange={(selectedGroups) =>
|
||||||
|
onChange(selectedGroups.map((g) => g.Id))
|
||||||
|
}
|
||||||
isMulti
|
isMulti
|
||||||
options={groupsQuery.data || []}
|
options={groupsQuery.data || []}
|
||||||
getOptionLabel={(group) => group.Name}
|
getOptionLabel={(group) => group.Name}
|
||||||
|
@ -45,5 +55,9 @@ export function EdgeGroupsField({
|
||||||
isDisabled={disabled}
|
isDisabled={disabled}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
<TextTip color="blue">
|
||||||
|
Select groups of Edge environments to update
|
||||||
|
</TextTip>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,13 @@ export function NameField() {
|
||||||
const [{ name }, { error }] = useField<FormValues['name']>('name');
|
const [{ name }, { error }] = useField<FormValues['name']>('name');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormControl label="Name" required inputId="name-input" errors={error}>
|
<FormControl
|
||||||
|
label="Name"
|
||||||
|
required
|
||||||
|
inputId="name-input"
|
||||||
|
errors={error}
|
||||||
|
tooltip="A descriptive name helps identify the update or roll back schedule when you have more than one"
|
||||||
|
>
|
||||||
<Field as={Input} name={name} id="name-input" />
|
<Field as={Input} name={name} id="name-input" />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue