1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-04 21:35:23 +02:00

fix(edge/templates): fix issues with git templates [EE-6357] (#10679)

This commit is contained in:
Chaim Lev-Ari 2023-12-04 08:46:44 +02:00 committed by GitHub
parent 974378c9b5
commit 2a18c9f215
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 201 additions and 116 deletions

View file

@ -35,7 +35,7 @@ export function RelativePathFieldset({
const { errors } = useValidation(value);
const { enableFsPath0, enableFsPath1, toggleFsPath } = useEnableFsPath();
const { enableFsPath0, enableFsPath1, toggleFsPath } = useEnableFsPath(value);
const pathTip0 =
'For relative path volumes use with Docker Swarm, you must have a network filesystem which all of your nodes can access.';

View file

@ -1,7 +1,11 @@
import { useState } from 'react';
export function useEnableFsPath() {
const [state, setState] = useState<number[]>([]);
import { RelativePathModel } from './types';
export function useEnableFsPath(initialValue: RelativePathModel) {
const [state, setState] = useState<number[]>(() =>
initialValue.SupportPerDeviceConfigs ? [1] : []
);
const enableFsPath0 = state.length && state[0] === 0;
const enableFsPath1 = state.length && state[0] === 1;