renamed templates package to ui
This commit is contained in:
parent
a12416cd21
commit
2b9821f967
@ -1,7 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
templates2 "git.wamblee.org/converge/pkg/server/templates"
|
||||
templates2 "git.wamblee.org/converge/pkg/server/ui"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
|
@ -2,7 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.wamblee.org/converge/pkg/server/templates"
|
||||
"git.wamblee.org/converge/pkg/server/ui"
|
||||
"github.com/gliderlabs/ssh"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
@ -32,7 +32,7 @@ func generateCLIExammple(w http.ResponseWriter, r *http.Request) {
|
||||
downloadCommand := r.FormValue("download-command")
|
||||
certificateValidation := r.FormValue("certificate-validation") != ""
|
||||
sshPublicKeys := strings.Split(keysString, "\n")
|
||||
usageInputs := templates.NewUsageInputs(id, sshPublicKeys, remoteShells, localShells, downloadCommand,
|
||||
usageInputs := ui.NewUsageInputs(id, sshPublicKeys, remoteShells, localShells, downloadCommand,
|
||||
certificateValidation)
|
||||
if generatedId {
|
||||
usageInputs.ErrorMessages = append(usageInputs.ErrorMessages, "rendez-vous id is randomly generated, changes on every page refresh")
|
||||
@ -64,7 +64,7 @@ func generateCLIExammple(w http.ResponseWriter, r *http.Request) {
|
||||
"No valid public keys configured. Without these the agent will not work.")
|
||||
}
|
||||
|
||||
err = templates.ShellUsage(access, usageInputs).Render(r.Context(), w)
|
||||
err = ui.ShellUsage(access, usageInputs).Render(r.Context(), w)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), 500)
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"git.wamblee.org/converge/pkg/comms"
|
||||
"git.wamblee.org/converge/pkg/models"
|
||||
templates2 "git.wamblee.org/converge/pkg/server/templates"
|
||||
templates2 "git.wamblee.org/converge/pkg/server/ui"
|
||||
"github.com/a-h/templ"
|
||||
"log"
|
||||
"math/rand"
|
||||
|
@ -3,7 +3,7 @@ package matchmaker
|
||||
import (
|
||||
"context"
|
||||
"git.wamblee.org/converge/pkg/models"
|
||||
"git.wamblee.org/converge/pkg/server/templates"
|
||||
"git.wamblee.org/converge/pkg/server/ui"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
@ -138,7 +138,7 @@ func (session *WebSession) WriteNotifications(location *time.Location, ctx conte
|
||||
|
||||
func (session *WebSession) writeNotificationToClient(location *time.Location, notification *models.State) bool {
|
||||
agents, clients := notification.Slices()
|
||||
err := templates.State(agents, clients, location).Render(context.Background(), session.conn)
|
||||
err := ui.State(agents, clients, location).Render(context.Background(), session.conn)
|
||||
if err != nil {
|
||||
log.Printf("WS connection closed: %v", err)
|
||||
return false
|
||||
|
@ -1,4 +1,4 @@
|
||||
package templates
|
||||
package ui
|
||||
|
||||
templ About() {
|
||||
<div>
|
@ -1,4 +1,4 @@
|
||||
package templates
|
||||
package ui
|
||||
|
||||
|
||||
func active(actual int, active int) string {
|
@ -1,4 +1,4 @@
|
||||
package templates
|
||||
package ui
|
||||
|
||||
type Shell string
|
||||
|
@ -1,4 +1,4 @@
|
||||
package templates
|
||||
package ui
|
||||
|
||||
|
||||
templ Downloads() {
|
@ -1,4 +1,4 @@
|
||||
package templates
|
||||
package ui
|
||||
|
||||
import "git.wamblee.org/converge/pkg/models"
|
||||
|
@ -1,4 +1,4 @@
|
||||
package templates
|
||||
package ui
|
||||
|
||||
import (
|
||||
"git.wamblee.org/converge/pkg/models"
|
@ -1,4 +1,4 @@
|
||||
package templates
|
||||
package ui
|
||||
|
||||
import "git.wamblee.org/converge/pkg/models"
|
||||
|
@ -1,4 +1,4 @@
|
||||
package templates
|
||||
package ui
|
||||
|
||||
import (
|
||||
"fmt"
|
Loading…
Reference in New Issue
Block a user