@@ -2,6 +2,7 @@ use rocket::route::Route;
22use sailfish:: TemplateOnce ;
33
44use crate :: {
5+ guards:: Cluster ,
56 guards:: ConnectedCluster ,
67 responses:: { Error , ResponseOk } ,
78} ;
@@ -16,8 +17,8 @@ use std::collections::HashMap;
1617
1718// Returns snapshots page
1819#[ get( "/snapshots" ) ]
19- pub async fn snapshots ( cluster : ConnectedCluster < ' _ > ) ->Result < ResponseOk , Error > {
20- let mut layout =crate :: templates:: WebAppBase :: new ( "Dashboard" , & cluster. inner . context ) ;
20+ pub async fn snapshots ( cluster : & Cluster ) ->Result < ResponseOk , Error > {
21+ let mut layout =crate :: templates:: WebAppBase :: new ( "Dashboard" , & cluster) ;
2122 layout. breadcrumbs ( vec ! [ NavLink :: new( "Snapshots" , & urls:: deployment_snapshots( ) ) . active( ) ] ) ;
2223
2324let tabs =vec ! [ tabs:: Tab {
@@ -27,15 +28,15 @@ pub async fn snapshots(cluster: ConnectedCluster<'_>) -> Result<ResponseOk, Erro
2728
2829let nav_tabs = tabs:: Tabs :: new ( tabs, Some ( "Snapshots" ) , Some ( "Snapshots" ) ) ?;
2930
30- Ok ( ResponseOk ( layout. render ( templates:: Dashboard { tabs : nav_tabs} ) ) )
31+ Ok ( ResponseOk ( layout. render ( templates:: Dashboard :: new ( nav_tabs) ) ) )
3132}
3233
3334// Returns the specific snapshot page
3435#[ get( "/snapshots/<snapshot_id>" ) ]
35- pub async fn snapshot ( cluster : ConnectedCluster < ' _ > , snapshot_id : i64 ) ->Result < ResponseOk , Error > {
36+ pub async fn snapshot ( cluster : & Cluster , snapshot_id : i64 ) ->Result < ResponseOk , Error > {
3637let snapshot = models:: Snapshot :: get_by_id ( cluster. pool ( ) , snapshot_id) . await ?;
3738
38- let mut layout =crate :: templates:: WebAppBase :: new ( "Dashboard" , & cluster. inner . context ) ;
39+ let mut layout =crate :: templates:: WebAppBase :: new ( "Dashboard" , & cluster) ;
3940 layout. breadcrumbs ( vec ! [
4041NavLink :: new( "Snapshots" , & urls:: deployment_snapshots( ) ) ,
4142NavLink :: new( & snapshot. relation_name, & urls:: deployment_snapshot_by_id( snapshot. id) ) . active( ) ,
@@ -48,7 +49,7 @@ pub async fn snapshot(cluster: ConnectedCluster<'_>, snapshot_id: i64) -> Result
4849
4950let nav_tabs = tabs:: Tabs :: new ( tabs, Some ( "Snapshots" ) , Some ( "Snapshots" ) ) ?;
5051
51- Ok ( ResponseOk ( layout. render ( templates:: Dashboard { tabs : nav_tabs} ) ) )
52+ Ok ( ResponseOk ( layout. render ( templates:: Dashboard :: new ( nav_tabs) ) ) )
5253}
5354
5455// Returns all snapshots for the deployment in a turboframe.