mirror of
https://github.com/kopia/kopia.git
synced 2026-10-26 08:08:53 -04:00
htmlui: added experimental HTML-based UI
This is enabled by `kopia server --ui` and can be viewed in a browser at http://localhost:51515/ Right now it can only list snapshots and policies (barely).
This commit is contained in:
1 parent
945708c5c5
commit
e8a1eaa9ee
33 files changed
+15128
-51
No files matched your search
@@ -16,6 +16,7 @@ var (
|
||||
|
||||
serverStartCommand = serverCommands.Command("start", "Start Kopia server").Default()
|
||||
serverStartHTMLPath = serverStartCommand.Flag("html", "Server the provided HTML at the root URL").ExistingDir()
|
||||
serverStartUI = serverStartCommand.Flag("ui", "Start the server with HTML UI (EXPERIMENTAL)").Bool()
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -36,6 +37,8 @@ func runServer(ctx context.Context, rep *repo.Repository) error {
|
||||
if *serverStartHTMLPath != "" {
|
||||
fileServer := http.FileServer(http.Dir(*serverStartHTMLPath))
|
||||
http.Handle("/", fileServer)
|
||||
} else if *serverStartUI {
|
||||
http.Handle("/", http.FileServer(server.AssetFile()))
|
||||
}
|
||||
return http.ListenAndServe(*serverAddress, nil)
|
||||
}
|
||||
Reference in new issue
Block a user