Skip to content

Commit 9c478fa

Browse files
authored
Merge pull request #6 from shiftstack/fix-port-valid
fix port valid
2 parents 789572f + d7a5f04 commit 9c478fa

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

src/App.jsx

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,11 @@ export default function HcpCliAssistant() {
179179
if (form.additionalPorts) {
180180
try {
181181
const ports = JSON.parse(form.additionalPorts);
182-
// Only validate ports that have a networkId entered
183-
const portsWithNetworkId = ports.filter(port => port.networkId && port.networkId.trim() !== "");
184-
return portsWithNetworkId.length === 0 ||
185-
portsWithNetworkId.every(port => port.networkId && port.networkId.trim() !== "");
182+
if (ports.length === 0) {
183+
return true;
184+
}
185+
// Every port must have a networkId
186+
return ports.every(port => port.networkId && port.networkId.trim() !== "");
186187
} catch (e) {
187188
console.error("Error parsing additionalPorts:", e);
188189
return false;
@@ -392,18 +393,6 @@ export default function HcpCliAssistant() {
392393
className="mr-2"
393394
/>
394395
OS_CLOUD is set in the environment
395-
<span
396-
className="ml-2 text-gray-500 cursor-help relative inline-block"
397-
onMouseEnter={(e) => e.target.querySelector('div').style.display = 'block'}
398-
onMouseLeave={(e) => e.target.querySelector('div').style.display = 'none'}
399-
>
400-
<svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5 inline-block" viewBox="0 0 20 20" fill="currentColor">
401-
<path fillRule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z" clipRule="evenodd" />
402-
</svg>
403-
<div className="absolute right-0 z-10 p-2 mt-1 text-sm bg-gray-800 text-white rounded shadow-lg w-64" style={{display: 'none'}}>
404-
Check this if you have the OS_CLOUD environment variable set. Otherwise, you'll need to provide a credentials file.
405-
</div>
406-
</span>
407396
</label>
408397

409398
{!form.osCloudSet && (
@@ -474,7 +463,7 @@ export default function HcpCliAssistant() {
474463
<path fillRule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z" clipRule="evenodd" />
475464
</svg>
476465
<div className="absolute right-0 z-10 p-2 mt-1 text-sm bg-gray-800 text-white rounded shadow-lg w-64" style={{display: 'none'}}>
477-
Configure additional network ports for the nodes in your cluster. Useful for multi-network setups or SR-IOV configurations.
466+
Attach additional ports to nodes. Params: Neutron Network ID, VNIC type, Port Security and Allowed Address Pairs.
478467
</div>
479468
</span>
480469
</h3>

0 commit comments

Comments
 (0)