mirror of
				https://github.com/aykhans/slash-e.git
				synced 2025-10-30 08:29:58 +00:00 
			
		
		
		
	chore: move frontend package
This commit is contained in:
		| @@ -100,7 +100,6 @@ func (s *APIV2Service) GetCollectionByName(ctx context.Context, request *apiv1pb | |||||||
| 	response := &apiv1pb.GetCollectionByNameResponse{ | 	response := &apiv1pb.GetCollectionByNameResponse{ | ||||||
| 		Collection: convertCollectionFromStore(collection), | 		Collection: convertCollectionFromStore(collection), | ||||||
| 	} | 	} | ||||||
| 	metric.Enqueue("collection view") |  | ||||||
| 	return response, nil | 	return response, nil | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| package server | package frontend | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
| 	"context" | 	"context" | ||||||
| @@ -12,6 +12,7 @@ import ( | |||||||
| 
 | 
 | ||||||
| 	"github.com/yourselfhosted/slash/internal/util" | 	"github.com/yourselfhosted/slash/internal/util" | ||||||
| 	storepb "github.com/yourselfhosted/slash/proto/gen/store" | 	storepb "github.com/yourselfhosted/slash/proto/gen/store" | ||||||
|  | 	"github.com/yourselfhosted/slash/server/metric" | ||||||
| 	"github.com/yourselfhosted/slash/server/profile" | 	"github.com/yourselfhosted/slash/server/profile" | ||||||
| 	"github.com/yourselfhosted/slash/store" | 	"github.com/yourselfhosted/slash/store" | ||||||
| ) | ) | ||||||
| @@ -63,6 +64,7 @@ func (s *FrontendService) registerRoutes(e *echo.Echo) { | |||||||
| 			return c.HTML(http.StatusOK, rawIndexHTML) | 			return c.HTML(http.StatusOK, rawIndexHTML) | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | 		metric.Enqueue("shortcut view") | ||||||
| 		// Inject shortcut metadata into `index.html`. | 		// Inject shortcut metadata into `index.html`. | ||||||
| 		indexHTML := strings.ReplaceAll(rawIndexHTML, headerMetadataPlaceholder, generateShortcutMetadata(shortcut).String()) | 		indexHTML := strings.ReplaceAll(rawIndexHTML, headerMetadataPlaceholder, generateShortcutMetadata(shortcut).String()) | ||||||
| 		return c.HTML(http.StatusOK, indexHTML) | 		return c.HTML(http.StatusOK, indexHTML) | ||||||
| @@ -81,6 +83,7 @@ func (s *FrontendService) registerRoutes(e *echo.Echo) { | |||||||
| 			return c.HTML(http.StatusOK, rawIndexHTML) | 			return c.HTML(http.StatusOK, rawIndexHTML) | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | 		metric.Enqueue("collection view") | ||||||
| 		// Inject collection metadata into `index.html`. | 		// Inject collection metadata into `index.html`. | ||||||
| 		indexHTML := strings.ReplaceAll(rawIndexHTML, headerMetadataPlaceholder, generateCollectionMetadata(collection).String()) | 		indexHTML := strings.ReplaceAll(rawIndexHTML, headerMetadataPlaceholder, generateCollectionMetadata(collection).String()) | ||||||
| 		return c.HTML(http.StatusOK, indexHTML) | 		return c.HTML(http.StatusOK, indexHTML) | ||||||
| @@ -16,6 +16,7 @@ import ( | |||||||
| 	"github.com/yourselfhosted/slash/server/metric" | 	"github.com/yourselfhosted/slash/server/metric" | ||||||
| 	"github.com/yourselfhosted/slash/server/profile" | 	"github.com/yourselfhosted/slash/server/profile" | ||||||
| 	apiv1 "github.com/yourselfhosted/slash/server/route/api/v1" | 	apiv1 "github.com/yourselfhosted/slash/server/route/api/v1" | ||||||
|  | 	"github.com/yourselfhosted/slash/server/route/frontend" | ||||||
| 	"github.com/yourselfhosted/slash/server/service/license" | 	"github.com/yourselfhosted/slash/server/service/license" | ||||||
| 	"github.com/yourselfhosted/slash/server/service/resource" | 	"github.com/yourselfhosted/slash/server/service/resource" | ||||||
| 	"github.com/yourselfhosted/slash/store" | 	"github.com/yourselfhosted/slash/store" | ||||||
| @@ -50,7 +51,7 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	// Serve frontend. | 	// Serve frontend. | ||||||
| 	frontendService := NewFrontendService(profile, store) | 	frontendService := frontend.NewFrontendService(profile, store) | ||||||
| 	frontendService.Serve(ctx, e) | 	frontendService.Serve(ctx, e) | ||||||
|  |  | ||||||
| 	// In dev mode, we'd like to set the const secret key to make signin session persistence. | 	// In dev mode, we'd like to set the const secret key to make signin session persistence. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Steven
					Steven