Matthew Stobbs
9c35be1fcf
- made multiple components for reuse in templ - going to start on actual data displaying templates
163 lines
5.0 KiB
Go
163 lines
5.0 KiB
Go
package view
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
|
|
"git.staur.ca/stobbsm/clustvirt/view/components"
|
|
)
|
|
|
|
// HomePage is the homepage, generated via templ components
|
|
func HomePage(w http.ResponseWriter, r *http.Request) {
|
|
defer r.Body.Close()
|
|
ibWhatIsThis := components.InfoBox(
|
|
components.InfoBoxConfig{
|
|
ColourClass: "aro",
|
|
InFlex: true,
|
|
FlexBasis: "basis-1/3",
|
|
},
|
|
"What is this?",
|
|
components.ContentP(
|
|
`Clustvirt (work in progress name) aims to be the agnostic
|
|
cluster controller for libvirtd. The server component is
|
|
used to display both the WebUI and run the REST API used to
|
|
control one to many libvirtd hosts to manage virual machines,
|
|
LXC containers (through libvirtd), gather information about
|
|
each host, and monitor each host.`,
|
|
),
|
|
)
|
|
|
|
ibWhy := components.InfoBox(
|
|
components.InfoBoxConfig{
|
|
ColourClass: "dracula",
|
|
InFlex: true,
|
|
FlexBasis: "basis-2/3",
|
|
},
|
|
"Why?",
|
|
components.ContentList(
|
|
"informational",
|
|
[]string{
|
|
"Broadcom buying VMWare, and VMWare losing a free teir for homelabbers pissed me off",
|
|
"Vendor lock-in pisses me off",
|
|
"Even good open source Hyperconverged systems (Proxmox, as an example) exhibit a form of vendor lock-in",
|
|
"Libvirt is terrific, has the functionality for everything those other providers do, but there really is not a great option for those dipping their toes into Open Source",
|
|
"Its fun to build things that solve a need",
|
|
"I really want to do it",
|
|
},
|
|
),
|
|
)
|
|
|
|
ibProjectGoals := components.InfoBox(
|
|
components.InfoBoxConfig{
|
|
ColourClass: "blade",
|
|
InFlex: true,
|
|
FlexBasis: "basis-7/12",
|
|
},
|
|
"Project Goals",
|
|
components.ContentList(
|
|
"accepted",
|
|
[]string{
|
|
"Open source, currently on the MIT license",
|
|
"Base OS Agnostic. If it can run libvirtd, this should be able to control it on some level",
|
|
"Control the Virtual Machine life cycle on one or more libvirtd hosts",
|
|
"Add clusting capabilities to libvirtd host, including;",
|
|
"Migration of VMs",
|
|
"Syncronizing secrets",
|
|
"Syncronizing VLANs, bridges, host only networking",
|
|
"Sharing HA storage availability",
|
|
"Locking shared resources like disks",
|
|
"Starting VMs marked for HA on another host when one goes down",
|
|
"Manage a library of Cloud-init resources and templates to build new VMs quickly",
|
|
"Local Storage management, including local directory, lvm, zfs (if installed)",
|
|
"Advanced Storage management, such as Ceph, glusterfs, drbd, iscsi, nfs",
|
|
"Storage syncronization of local disks between hosts (zfs snapshots, lvm snapshots, rsync)",
|
|
"Backup scheduling, creation, restoration",
|
|
},
|
|
),
|
|
)
|
|
|
|
ibStretchGoals := components.InfoBox(
|
|
components.InfoBoxConfig{
|
|
ColourClass: "cullen",
|
|
InFlex: true,
|
|
FlexBasis: "basis-5/12",
|
|
},
|
|
"Stretch Goals",
|
|
components.ContentList(
|
|
"possible",
|
|
[]string{
|
|
"Install the OS which libvirtd is running on",
|
|
"Install/provision libvirtd on a host that does not have it installed",
|
|
"Tools to move from one vendor to clustvirt/libvirtd",
|
|
"VM templates for common aspects of VM creation and management, like appliances",
|
|
"External tool access that can be used to manage things that are not managed here (cephadm dashboard, for instance)",
|
|
},
|
|
),
|
|
)
|
|
|
|
ibRedditRequested := components.InfoBox(
|
|
components.InfoBoxConfig{
|
|
ColourClass: "morbius",
|
|
InFlex: true,
|
|
FlexBasis: "basis-8/12",
|
|
},
|
|
"Reddit Requested Features",
|
|
components.ContentList(
|
|
"possible",
|
|
[]string{
|
|
"Search/Filter on hosts/vms - @Lopsided_Speaker_553",
|
|
"Balance on resource usage per host/Automattically migrate to least used host - @Lopsided_Speaker_553",
|
|
"Support inter-vm only commmunication (VxLAN style) - @Lopsided_Speaker_553",
|
|
"Deploy VMs using only API - @Lopsided_Speaker_553",
|
|
"Well documented, first class API - @kasperlitheater",
|
|
"Bootstrap service to configure a new server - @phatpappa_",
|
|
"For the love of kitten, don't use XML as configuration files - @pascalbrax",
|
|
"Expose the Cluster Manager functionalities as API - @raven2611",
|
|
"CPU architecture awareness for migrations - @raven2611",
|
|
"Inter VM Communications via VXLAN/EVPN - @raven2611",
|
|
},
|
|
),
|
|
)
|
|
|
|
ibNeverHappening := components.InfoBox(
|
|
components.InfoBoxConfig{
|
|
ColourClass: "marcelin",
|
|
InFlex: true,
|
|
FlexBasis: "basis-4/12",
|
|
},
|
|
"Never Going to Happen",
|
|
components.ContentList(
|
|
"never",
|
|
[]string{
|
|
"Kubernetes",
|
|
"Application container management (docker, podman, etc)",
|
|
"Become an OS",
|
|
"Have a paywall",
|
|
"Vendor lock-in",
|
|
"Become a commercial entity (even indirectly)",
|
|
"Anything that does not have an Open Source standard behind it",
|
|
"Directly control a guest Operating System",
|
|
},
|
|
),
|
|
)
|
|
|
|
idx := components.Index(
|
|
components.FlexRow(
|
|
true,
|
|
ibWhatIsThis,
|
|
ibWhy,
|
|
),
|
|
components.FlexRow(
|
|
true,
|
|
ibProjectGoals,
|
|
ibStretchGoals,
|
|
),
|
|
components.FlexRow(
|
|
true,
|
|
ibRedditRequested,
|
|
ibNeverHappening,
|
|
),
|
|
)
|
|
idx.Render(context.Background(), w)
|
|
}
|