feat(ServerModal, serverUtils): implement conditional tunnel selection based on server type; add needsTunnel utility function for improved server configuration
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m41s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m41s
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
makeGateway,
|
||||
normalizeGateways,
|
||||
needsGateways as NEEDS_GATEWAYS,
|
||||
needsTunnel as NEEDS_TUNNEL,
|
||||
SERVER_TYPE_OPTIONS,
|
||||
TUNNEL_TYPES
|
||||
} from '../../utils/serverUtils.js';
|
||||
@@ -417,7 +418,7 @@ function ServerModal({ show, mode = 'add', server, onSave, onClose, error: exter
|
||||
)}
|
||||
|
||||
{/* Тип сервера */}
|
||||
<div className="col-md-6">
|
||||
<div className={NEEDS_TUNNEL(localServer.type) ? "col-md-6" : "col-12"}>
|
||||
<label className="form-label required">Тип сервера</label>
|
||||
<select
|
||||
className="form-select"
|
||||
@@ -433,20 +434,22 @@ function ServerModal({ show, mode = 'add', server, onSave, onClose, error: exter
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{/* Тип туннеля */}
|
||||
<div className="col-md-6">
|
||||
<label className="form-label required">Тип туннеля</label>
|
||||
<select
|
||||
className="form-select"
|
||||
value={localServer.tunnel || 'GRE'}
|
||||
onChange={(e) => handleFieldChange('tunnel', e.target.value)}
|
||||
required
|
||||
>
|
||||
{TUNNEL_TYPES.map((t) => (
|
||||
<option key={t} value={t}>{t}</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
{/* Тип туннеля - только для типов, которым он нужен */}
|
||||
{NEEDS_TUNNEL(localServer.type) && (
|
||||
<div className="col-md-6">
|
||||
<label className="form-label required">Тип туннеля</label>
|
||||
<select
|
||||
className="form-select"
|
||||
value={localServer.tunnel || 'GRE'}
|
||||
onChange={(e) => handleFieldChange('tunnel', e.target.value)}
|
||||
required
|
||||
>
|
||||
{TUNNEL_TYPES.map((t) => (
|
||||
<option key={t} value={t}>{t}</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Основной шлюз (текстовое поле для совместимости) */}
|
||||
<div className="col-12">
|
||||
|
||||
Reference in New Issue
Block a user