forked from BLC/sgeUpdated
Add cityID in creation and update and edit some graphics in the map
This commit is contained in:
@@ -20,15 +20,14 @@ const DataCenter = () => {
|
||||
const getAllPhysicalMachines = (dataCenter) => {
|
||||
// Physical machines are directly in the dataCenter object, not in projects
|
||||
const pms = dataCenter.physicalMachines || [];
|
||||
console.log(`Physical machines for ${dataCenter.dataCenter}:`, pms);
|
||||
return pms;
|
||||
};
|
||||
|
||||
// Table columns following your pattern
|
||||
const initialColumns = [
|
||||
{
|
||||
name: "Number",
|
||||
selector: (row) => row.number,
|
||||
name: "External ID",
|
||||
selector: (row) => row.externalId,
|
||||
sortable: true,
|
||||
minWidth: "100px",
|
||||
},
|
||||
@@ -39,32 +38,32 @@ const DataCenter = () => {
|
||||
minWidth: "200px",
|
||||
},
|
||||
// Projects - Based on API response, this field might not exist or be structured differently
|
||||
{
|
||||
name: "Projects",
|
||||
selector: (row) => row.projects?.length || 0,
|
||||
sortable: true,
|
||||
minWidth: "200px",
|
||||
cell: (row) => (
|
||||
<div>
|
||||
{row.projects && row.projects.length > 0 ? (
|
||||
<div className="d-flex flex-column">
|
||||
{row.projects.map((project, index) => (
|
||||
<div
|
||||
key={project.id}
|
||||
className={`badge badge-light-primary ${
|
||||
index > 0 ? "mt-1" : ""
|
||||
}`}
|
||||
>
|
||||
{project.name}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<span className="text-muted">-</span>
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
// {
|
||||
// name: "Projects",
|
||||
// selector: (row) => row.projects?.length || 0,
|
||||
// sortable: true,
|
||||
// minWidth: "200px",
|
||||
// cell: (row) => (
|
||||
// <div>
|
||||
// {row.projects && row.projects.length > 0 ? (
|
||||
// <div className="d-flex flex-column">
|
||||
// {row.projects.map((project, index) => (
|
||||
// <div
|
||||
// key={project.id}
|
||||
// className={`badge badge-light-primary ${
|
||||
// index > 0 ? "mt-1" : ""
|
||||
// }`}
|
||||
// >
|
||||
// {project.name}
|
||||
// </div>
|
||||
// ))}
|
||||
// </div>
|
||||
// ) : (
|
||||
// <span className="text-muted">-</span>
|
||||
// )}
|
||||
// </div>
|
||||
// ),
|
||||
// },
|
||||
// Physical Machines
|
||||
{
|
||||
name: "Physical Machines",
|
||||
|
||||
Reference in New Issue
Block a user