forked from OpenCloud/opencloud
Browse Source
Fixed: Container destroy did not remove zone files Changed: golang-114 is current Added some debug messages Added simple pod list commandmaster

10 changed files with 186 additions and 24 deletions
@ -0,0 +1,27 @@
|
||||
package podadm |
||||
|
||||
import ( |
||||
"os" |
||||
|
||||
"github.com/olekukonko/tablewriter" |
||||
"github.com/spf13/cobra" |
||||
) |
||||
|
||||
var listCmd = &cobra.Command{ |
||||
Use: "list", |
||||
Short: "List all containers", |
||||
Long: `List all containers on this host`, |
||||
Run: func(cmd *cobra.Command, args []string) { |
||||
containers := h.Containers() |
||||
table := tablewriter.NewWriter(os.Stdout) |
||||
table.SetHeader([]string{"UUID", "Name", "Status"}) |
||||
for _, container := range containers { |
||||
table.Append([]string{container.UUID.String(), container.Name, container.Status().String()}) |
||||
} |
||||
table.Render() |
||||
}, |
||||
} |
||||
|
||||
func init() { |
||||
RootCmd.AddCommand(listCmd) |
||||
} |
@ -1,32 +1,98 @@
|
||||
import React from 'react'; |
||||
import styled from "styled-components"; |
||||
import {Tree} from 'primereact/tree'; |
||||
import TreeNode from "primereact/components/treenode/TreeNode"; |
||||
|
||||
type ItemProps = { |
||||
name: string; |
||||
} |
||||
|
||||
const SidebarItemElem = styled.div` |
||||
const SidebarItem = styled.div` |
||||
|
||||
`;
|
||||
|
||||
function SidebarItem(props: ItemProps){ |
||||
return <SidebarItemElem> |
||||
{props.name} |
||||
</SidebarItemElem> |
||||
} |
||||
|
||||
const SidebarGrid = styled.div` |
||||
display: grid; |
||||
grid-area: sidebar; |
||||
padding-left: 10px; |
||||
`;
|
||||
|
||||
const data: TreeNode[] = [ |
||||
{ |
||||
"key": "0", |
||||
"label": "Documents", |
||||
"data": "Documents Folder", |
||||
"icon": "pi pi-fw pi-inbox", |
||||
"children": [ |
||||
{ |
||||
"key": "0-0", |
||||
"label": "Work", |
||||
"data": "Work Folder", |
||||
"icon": "pi pi-fw pi-cog", |
||||
"children": [ |
||||
{ "key": "0-0-0", "label": "Expenses.doc", "icon": "pi pi-fw pi-file", "data": "Expenses Document", children: [] }, |
||||
{ "key": "0-0-1", "label": "Resume.doc", "icon": "pi pi-fw pi-file", "data": "Resume Document", children: [] } |
||||
] |
||||
}, |
||||
{ |
||||
"key": "0-1", |
||||
"label": "Home", |
||||
"data": "Home Folder", |
||||
"icon": "pi pi-fw pi-home", |
||||
"children": [ |
||||
{ "key": "0-1-0", "label": "Invoices.txt", "icon": "pi pi-fw pi-file", "data": "Invoices for this month", children: [] } |
||||
] |
||||
} |
||||
] |
||||
}, |
||||
{ |
||||
"key": "1", |
||||
"label": "Events", |
||||
"data": "Events Folder", |
||||
"icon": "pi pi-fw pi-calendar", |
||||
"children": [ |
||||
{ "key": "1-0", "label": "Meeting", "icon": "pi pi-fw pi-calendar-plus", "data": "Meeting", children: [] }, |
||||
{ "key": "1-1", "label": "Product Launch", "icon": "pi pi-fw pi-calendar-plus", "data": "Product Launch", children: [] }, |
||||
{ "key": "1-2", "label": "Report Review", "icon": "pi pi-fw pi-calendar-plus", "data": "Report Review", children: [] } |
||||
] |
||||
}, |
||||
{ |
||||
"key": "2", |
||||
"label": "Movies", |
||||
"data": "Movies Folder", |
||||
"icon": "pi pi-fw pi-star", |
||||
"children": [ |
||||
{ |
||||
"key": "2-0", |
||||
"icon": "pi pi-fw pi-star", |
||||
"label": "Al Pacino", |
||||
"data": "Pacino Movies", |
||||
"children": [ |
||||
{ "key": "2-0-0", "label": "Scarface", "icon": "pi pi-fw pi-video", "data": "Scarface Movie", children: [] }, |
||||
{ "key": "2-0-1", "label": "Serpico", "icon": "pi pi-fw pi-video", "data": "Serpico Movie", children: [] } |
||||
] |
||||
}, |
||||
{ |
||||
"key": "2-1", |
||||
"label": "Robert De Niro", |
||||
"icon": "pi pi-fw pi-star", |
||||
"data": "De Niro Movies", |
||||
"children": [ |
||||
{ "key": "2-1-0", "label": "Goodfellas", "icon": "pi pi-fw pi-video", "data": "Goodfellas Movie", children: [] }, |
||||
{ "key": "2-1-1", "label": "Untouchables", "icon": "pi pi-fw pi-video", "data": "Untouchables Movie", children: [] } |
||||
] |
||||
} |
||||
] |
||||
} |
||||
]; |
||||
|
||||
export default class Sidebar extends React.Component<any, any> { |
||||
|
||||
render(){ |
||||
return ( |
||||
<SidebarGrid> |
||||
<SidebarItem name="Item1" /> |
||||
<SidebarItem> |
||||
<Tree value={data} expandedKeys={{ |
||||
"0": true, |
||||
"2": true, |
||||
}} /> |
||||
</SidebarItem> |
||||
</SidebarGrid> |
||||
) |
||||
} |
||||
|
Loading…
Reference in new issue