+
+
+ {
+ const newGateways = [...templateGateways];
+ newGateways[index].description = e.target.value;
+ setTemplateGateways(newGateways);
+ }}
+ placeholder="Название gateway"
+ />
+
+
+
+
{
+ const newGateways = [...templateGateways];
+ newGateways[index].ip = e.target.value;
+ setTemplateGateways(newGateways);
+ }}
+ placeholder={gw.ipTemplate ? gw.ipTemplate.replace('{baseIp}', templateBaseIp || 'X.X.X') : 'IP адрес'}
+ />
+
+ Шаблон: {gw.ipTemplate || '—'}
+
+
+
+
+ {
+ const newGateways = [...templateGateways];
+ newGateways[index].country = e.target.value.toUpperCase().slice(0, 2);
+ setTemplateGateways(newGateways);
+ }}
+ placeholder="SE, FI, RU..."
+ maxLength={2}
+ />
+
+ {gw.type === 'recursive' && (
+
+
+
+ {(gw.parentGateways || []).map((parent, parentIndex) => {
+ const parentInfo = getParentGateway(parent.id);
+ return (
+
+
+ {
+ const newGateways = [...templateGateways];
+ if (!newGateways[index].parentGateways) {
+ newGateways[index].parentGateways = [];
+ }
+ newGateways[index].parentGateways[parentIndex] = { ...newGateways[index].parentGateways[parentIndex], id: val };
+ setTemplateGateways(newGateways);
+ }}
+ gateways={config.gateways}
+ interfaces={config.tunnelInterfaces}
+ placeholder="Выберите родительский gateway или интерфейс..."
+ />
+
+
+ {
+ const newGateways = [...templateGateways];
+ if (!newGateways[index].parentGateways) {
+ newGateways[index].parentGateways = [];
+ }
+ newGateways[index].parentGateways[parentIndex] = {
+ ...newGateways[index].parentGateways[parentIndex],
+ distance: e.target.value ? parseInt(e.target.value) : undefined
+ };
+ setTemplateGateways(newGateways);
+ }}
+ placeholder="Distance"
+ />
+
+
+
+ );
+ })}
+
+
+
+ )}
+