renamed templates package to ui

This commit is contained in:
Erik Brakkee 2024-08-17 10:22:03 +02:00
parent 49912e02d0
commit c66be7775f
12 changed files with 15 additions and 15 deletions

View File

@ -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"
)

View File

@ -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)
}

View File

@ -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"

View File

@ -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

View File

@ -1,4 +1,4 @@
package templates
package ui
templ About() {
<div>

View File

@ -1,4 +1,4 @@
package templates
package ui
func active(actual int, active int) string {

View File

@ -1,4 +1,4 @@
package templates
package ui
type Shell string

View File

@ -1,4 +1,4 @@
package templates
package ui
templ Downloads() {

View File

@ -1,4 +1,4 @@
package templates
package ui
import "git.wamblee.org/converge/pkg/models"

View File

@ -1,4 +1,4 @@
package templates
package ui
import (
"git.wamblee.org/converge/pkg/models"

View File

@ -1,4 +1,4 @@
package templates
package ui
import "git.wamblee.org/converge/pkg/models"

View File

@ -1,4 +1,4 @@
package templates
package ui
import (
"fmt"