Skip to content

Commit

Permalink
pull request fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Stafford committed May 4, 2021
1 parent 222c0a0 commit d29bc32
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 22 deletions.
8 changes: 4 additions & 4 deletions models/tenant_pod.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions portal-ui/src/screens/Console/Tenants/ListTenants/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ export interface IPool {
label?: string;
}

export interface IPod {
export interface IPodListElement {
name: string;
status: string;
timecreated: string;
podip: string;
timeCreated: string;
podIP: string;
restarts: number;
node: string;
time: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import AddPoolModal from "./AddPoolModal";
import AddBucket from "../../Buckets/ListBuckets/AddBucket";
import ReplicationSetup from "./ReplicationSetup";
import api from "../../../../common/api";
import { IPool, ITenant, IPod } from "../ListTenants/types";
import { IPool, ITenant, IPodListElement } from "../ListTenants/types";
import PageHeader from "../../Common/PageHeader/PageHeader";
import UsageBarWrapper from "../../Common/UsageBarWrapper/UsageBarWrapper";
import UpdateTenantModal from "./UpdateTenantModal";
Expand Down Expand Up @@ -179,7 +179,7 @@ const TenantDetails = ({
const [capacity, setCapacity] = useState<number>(0);
const [poolCount, setPoolCount] = useState<number>(0);
const [pools, setPools] = useState<IPool[]>([]);
const [pods, setPods] = useState<IPod[]>([]);
const [pods, setPods] = useState<IPodListElement[]>([]);
const [instances, setInstances] = useState<number>(0);
const [volumes, setVolumes] = useState<number>(0);
const [addPoolOpen, setAddPool] = useState<boolean>(false);
Expand Down Expand Up @@ -308,14 +308,12 @@ const TenantDetails = ({
"GET",
`/api/v1/namespaces/${tenantNamespace}/tenants/${tenantName}/pods`
)
.then((result: IPod[]) => {
.then((result: IPodListElement[]) => {
for (let i = 0; i < result.length; i++) {
let currentTime = new Date().getSeconds();
console.log(currentTime);
result[i].time = niceDays(
(currentTime - parseInt(result[i].timecreated)).toString()
(currentTime - parseInt(result[i].timeCreated)).toString()
);
console.log(result[i]);
}
setPods(result);
})
Expand Down Expand Up @@ -686,7 +684,7 @@ const TenantDetails = ({
{ label: "Name", elementKey: "name" },
{ label: "Status", elementKey: "status" },
{ label: "Age", elementKey: "time" },
{ label: "Pod IP", elementKey: "podip" },
{ label: "Pod IP", elementKey: "podIP" },
{
label: "Restarts",
elementKey: "restarts",
Expand Down
4 changes: 2 additions & 2 deletions restapi/admin_tenants.go
Original file line number Diff line number Diff line change
Expand Up @@ -1335,8 +1335,8 @@ func getTenantPodsResponse(session *models.Principal, params admin_api.GetTenant
restarts := int64(pods.Items[i].Status.ContainerStatuses[0].RestartCount)
retval = append(retval, &models.TenantPod{Name: &pods.Items[i].ObjectMeta.Name,
Status: string(pods.Items[i].Status.Phase),
Timecreated: pods.Items[i].CreationTimestamp.Unix(),
Podip: pods.Items[i].Status.PodIP,
TimeCreated: pods.Items[i].CreationTimestamp.Unix(),
PodIP: pods.Items[i].Status.PodIP,
Restarts: restarts,
Node: pods.Items[i].Spec.NodeName})
}
Expand Down
8 changes: 4 additions & 4 deletions restapi/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3709,9 +3709,9 @@ definitions:
status:
type:
string
timecreated:
timeCreated:
type: integer
podip:
podIP:
type: string
restarts:
type: integer
Expand Down

0 comments on commit d29bc32

Please sign in to comment.