1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +02:00

fix(ui): tidy up Edge Devices configuration EE-3604 (#7797)

This commit is contained in:
matias-portainer 2022-11-10 16:13:20 -03:00 committed by GitHub
parent e1e81731b9
commit 30e23ea5b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 57 additions and 17 deletions

View file

@ -4,7 +4,7 @@ import { r2a } from '@/react-tools/react2angular';
import { useSettings } from '@/react/portainer/settings/queries';
import { withReactQuery } from '@/react-tools/withReactQuery';
import { FormControl } from '@@/form-components/FormControl';
import { FormControl, Size } from '@@/form-components/FormControl';
import { Select } from '@@/form-components/Input';
interface Props {
@ -14,6 +14,7 @@ interface Props {
label?: string;
tooltip?: string;
readonly?: boolean;
size?: Size;
}
export const checkinIntervalOptions = [
@ -42,11 +43,17 @@ export function EdgeCheckinIntervalField({
isDefaultHidden = false,
label = 'Poll frequency',
tooltip = 'Interval used by this Edge agent to check in with the Portainer instance. Affects Edge environment management and Edge compute features.',
size = 'small',
}: Props) {
const options = useOptions(isDefaultHidden);
return (
<FormControl inputId="edge_checkin" label={label} tooltip={tooltip}>
<FormControl
inputId="edge_checkin"
label={label}
tooltip={tooltip}
size={size}
>
<Select
value={value}
onChange={(e) => {
@ -61,7 +68,15 @@ export function EdgeCheckinIntervalField({
export const EdgeCheckinIntervalFieldAngular = r2a(
withReactQuery(EdgeCheckinIntervalField),
['value', 'onChange', 'isDefaultHidden', 'tooltip', 'label', 'readonly']
[
'value',
'onChange',
'isDefaultHidden',
'tooltip',
'label',
'readonly',
'size',
]
);
function useOptions(isDefaultHidden: boolean) {