@@ -2,7 +2,6 @@ use rocket::route::Route;
22use sailfish:: TemplateOnce ;
33
44use crate :: {
5- guards:: Cluster ,
65 guards:: ConnectedCluster ,
76 responses:: { Error , ResponseOk } ,
87} ;
@@ -17,8 +16,8 @@ use std::collections::HashMap;
1716
1817// Returns snapshots page
1918#[ get( "/snapshots" ) ]
20- pub async fn snapshots ( cluster : & Cluster ) ->Result < ResponseOk , Error > {
21- let mut layout =crate :: templates:: WebAppBase :: new ( "Dashboard" , & cluster) ;
19+ pub async fn snapshots ( cluster : ConnectedCluster < ' _ > ) ->Result < ResponseOk , Error > {
20+ let mut layout =crate :: templates:: WebAppBase :: new ( "Dashboard" , & cluster. inner . context ) ;
2221 layout. breadcrumbs ( vec ! [ NavLink :: new( "Snapshots" , & urls:: deployment_snapshots( ) ) . active( ) ] ) ;
2322
2423let tabs =vec ! [ tabs:: Tab {
@@ -28,15 +27,15 @@ pub async fn snapshots(cluster: &Cluster) -> Result<ResponseOk, Error> {
2827
2928let nav_tabs = tabs:: Tabs :: new ( tabs, Some ( "Snapshots" ) , Some ( "Snapshots" ) ) ?;
3029
31- Ok ( ResponseOk ( layout. render ( templates:: Dashboard :: new ( nav_tabs) ) ) )
30+ Ok ( ResponseOk ( layout. render ( templates:: Dashboard { tabs : nav_tabs} ) ) )
3231}
3332
3433// Returns the specific snapshot page
3534#[ get( "/snapshots/<snapshot_id>" ) ]
36- pub async fn snapshot ( cluster : & Cluster , snapshot_id : i64 ) ->Result < ResponseOk , Error > {
35+ pub async fn snapshot ( cluster : ConnectedCluster < ' _ > , snapshot_id : i64 ) ->Result < ResponseOk , Error > {
3736let snapshot = models:: Snapshot :: get_by_id ( cluster. pool ( ) , snapshot_id) . await ?;
3837
39- let mut layout =crate :: templates:: WebAppBase :: new ( "Dashboard" , & cluster) ;
38+ let mut layout =crate :: templates:: WebAppBase :: new ( "Dashboard" , & cluster. inner . context ) ;
4039 layout. breadcrumbs ( vec ! [
4140NavLink :: new( "Snapshots" , & urls:: deployment_snapshots( ) ) ,
4241NavLink :: new( & snapshot. relation_name, & urls:: deployment_snapshot_by_id( snapshot. id) ) . active( ) ,
@@ -49,7 +48,7 @@ pub async fn snapshot(cluster: &Cluster, snapshot_id: i64) -> Result<ResponseOk,
4948
5049let nav_tabs = tabs:: Tabs :: new ( tabs, Some ( "Snapshots" ) , Some ( "Snapshots" ) ) ?;
5150
52- Ok ( ResponseOk ( layout. render ( templates:: Dashboard :: new ( nav_tabs) ) ) )
51+ Ok ( ResponseOk ( layout. render ( templates:: Dashboard { tabs : nav_tabs} ) ) )
5352}
5453
5554// Returns all snapshots for the deployment in a turboframe.