-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding status badge for node and initial models for lxc
- Loading branch information
Showing
4 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* File to define components for using with Nodes | ||
*/ | ||
import React from "react"; | ||
import {NodeStatus} from "../../models/proxmox/Node"; | ||
|
||
/** | ||
* Function to render a Status Badge for a proxmox Node | ||
* @param status | ||
* @constructor | ||
*/ | ||
export default function NodeStatusBadge(status: NodeStatus) { | ||
if (status === NodeStatus.online) { | ||
return <span className="badge text-bg-success">{status}</span> | ||
} else { | ||
return <span className="badge text-bg-danger">{status}</span> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Defintions of Objects around LXC in proxmox | ||
* @author: ooemperor | ||
*/ | ||
|
||
/** | ||
* enum of status of proxmox lxc | ||
*/ | ||
export enum LXCStatus { | ||
stopped = "stopped", | ||
running = "running" | ||
} | ||
|
||
/** | ||
* Data defintion for a lxc in proxmox | ||
*/ | ||
export interface LXC { | ||
vmid: number, | ||
status: LXCStatus, | ||
cpus: number | null, | ||
disk: number | null, | ||
diskread: number | null, | ||
diskwrite: number | null, | ||
lock: string | null, | ||
maxdisk: number | null, | ||
maxmem: number | null, | ||
maxswap: number | null, | ||
name: string | null, | ||
netin: number | null, | ||
netout: number | null, | ||
tags: string | null, | ||
template: boolean | null, | ||
uptime: number | null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters