feat: port, instance bulk
This commit is contained in:
parent
dadaabcd3a
commit
0abe7386d0
@ -1,8 +1,6 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { User } from "../../type/UserType";
|
|
||||||
import { Tp } from "../../type/TpType";
|
|
||||||
|
|
||||||
function BulkUsers() {
|
function BulkUsers() {
|
||||||
const [userData, setUserData] = useState([]);
|
const [userData, setUserData] = useState([]);
|
||||||
@ -33,7 +31,11 @@ function BulkUsers() {
|
|||||||
const formattedData = rows.map((row) => ({
|
const formattedData = rows.map((row) => ({
|
||||||
name: row[0],
|
name: row[0],
|
||||||
email: row[1],
|
email: row[1],
|
||||||
// Add other fields as necessary
|
password: row[2],
|
||||||
|
instance_name: row[3],
|
||||||
|
instance_ssh: row[4],
|
||||||
|
instance_port: row[5],
|
||||||
|
instance_pwd: row[6],
|
||||||
}));
|
}));
|
||||||
setUserData(formattedData);
|
setUserData(formattedData);
|
||||||
};
|
};
|
||||||
@ -67,6 +69,11 @@ function BulkUsers() {
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Email</th>
|
<th>Email</th>
|
||||||
|
<th>Password</th>
|
||||||
|
<th>Instance name</th>
|
||||||
|
<th>Instance ssh</th>
|
||||||
|
<th>Instance port</th>
|
||||||
|
<th>Instance pwd</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -74,6 +81,11 @@ function BulkUsers() {
|
|||||||
<tr key={index}>
|
<tr key={index}>
|
||||||
<td>{user.name}</td>
|
<td>{user.name}</td>
|
||||||
<td>{user.email}</td>
|
<td>{user.email}</td>
|
||||||
|
<td>{user.password}</td>
|
||||||
|
<td>{user.instance_name}</td>
|
||||||
|
<td>{user.instance_ssh}</td>
|
||||||
|
<td>{user.instance_port}</td>
|
||||||
|
<td>{user.instance_pwd}</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -86,11 +98,11 @@ function BulkUsers() {
|
|||||||
<select
|
<select
|
||||||
name="practical"
|
name="practical"
|
||||||
value={practical}
|
value={practical}
|
||||||
onChange={() => handlePracticalChange}
|
onChange={handlePracticalChange}
|
||||||
className="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
|
className="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||||
>
|
>
|
||||||
return <option value="0">Empty</option>;
|
return <option value="0">Empty</option>;
|
||||||
{tps.map((tp: Tp) => {
|
{tps.map((tp: TpType.Tp) => {
|
||||||
return <option value={tp.id}>{tp.name}</option>;
|
return <option value={tp.id}>{tp.name}</option>;
|
||||||
})}
|
})}
|
||||||
</select>
|
</select>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user