Exemple #1
0
func Files() string {

	api := GetApi("", "", "")
	_, file_list := api.FilesList()
	table := CreateTable()
	table.Name = "Files Table"
	table.Id = "files_table"
	table.Title = "Files Table"
	table.HeaderFields = []string{"Name", "Path", "IsDir"}
	for id := range file_list {

		file := file_list[id]
		row := Row{}
		row.Fields = []string{file.Name, file.Path, fmt.Sprintf("%v", file.IsDir)}
		table.Rows = append(table.Rows, row)

	}
	return table.Render()

}
Exemple #2
0
func Hosts() string {

	api := GetApi("", "", "")
	_, hosts_list := api.HostsList()
	table := CreateTable()
	table.Name = "Hosts Table"
	table.Id = "hosts_table"
	table.Title = "Hosts Table"
	table.HeaderFields = []string{"ID"}
	for id := range hosts_list {

		host := hosts_list[id]
		row := Row{}
		row.Fields = []string{host.Id}
		table.Rows = append(table.Rows, row)

	}
	return table.Render()

}
Exemple #3
0
func Actions() string {

	api := GetApi("", "", "")
	_, action_list := api.ActionsList()
	table := CreateTable()
	table.Name = "Actions Table"
	table.Id = "actions_table"
	table.Title = "Actions Table"
	table.HeaderFields = []string{"Name", "Command"}
	for id := range action_list {

		action := action_list[id]
		row := Row{}
		row.Fields = []string{action.Name, action.Command}
		table.Rows = append(table.Rows, row)

	}
	return table.Render()

}