@@ -10,9 +10,9 @@ use std::{sync::Arc, time::Duration};
10
10
11
11
use components:: {
12
12
icon:: {
13
- IconAdjustmentsHorizontal , IconChartBarSquare , IconClock , IconDocumentChartBar , IconKey ,
14
- IconLockClosed , IconQueueList , IconShieldCheck , IconSignal , IconSquare2x2 , IconUserGroup ,
15
- IconWrench ,
13
+ IconAdjustmentsHorizontal , IconBeaker , IconChartBarSquare , IconClock , IconDocumentChartBar ,
14
+ IconKey , IconLockClosed , IconQueueList , IconShieldCheck , IconSignal , IconSquare2x2 ,
15
+ IconUserGroup , IconWrench ,
16
16
} ,
17
17
layout:: MenuItem ,
18
18
} ;
@@ -33,7 +33,10 @@ use pages::{
33
33
tracing:: { display:: SpanDisplay , list:: SpanList , live:: LiveTracing } ,
34
34
undelete:: UndeleteList ,
35
35
} ,
36
- manage:: spam:: { SpamTest , SpamTrain } ,
36
+ manage:: {
37
+ spam:: { SpamTest , SpamTrain } ,
38
+ troubleshoot:: { TroubleshootDelivery , TroubleshootDmarc } ,
39
+ } ,
37
40
} ;
38
41
39
42
pub static VERSION_NAME : & str = concat ! ( "Stalwart Management UI v" , env!( "CARGO_PKG_VERSION" ) , ) ;
@@ -419,6 +422,28 @@ pub fn App() -> impl IntoView {
419
422
}
420
423
/>
421
424
425
+ <ProtectedRoute
426
+ path="/troubleshoot/delivery"
427
+ view=TroubleshootDelivery
428
+ redirect_path="/login"
429
+ condition=move || {
430
+ permissions
431
+ . get( )
432
+ . map_or( false , |p| { p. has_access( Permission :: Troubleshoot ) } )
433
+ }
434
+ />
435
+
436
+ <ProtectedRoute
437
+ path="/troubleshoot/dmarc"
438
+ view=TroubleshootDmarc
439
+ redirect_path="/login"
440
+ condition=move || {
441
+ permissions
442
+ . get( )
443
+ . map_or( false , |p| { p. has_access( Permission :: Troubleshoot ) } )
444
+ }
445
+ />
446
+
422
447
</ProtectedRoute >
423
448
<ProtectedRoute
424
449
path="/settings"
@@ -653,6 +678,15 @@ impl LayoutBuilder {
653
678
. route ( "/spam/test" )
654
679
. insert ( true )
655
680
. insert ( permissions. has_access ( Permission :: SieveRun ) )
681
+ . create ( "Troubleshoot" )
682
+ . icon ( view ! { <IconBeaker /> } )
683
+ . create ( "E-mail Delivery" )
684
+ . route ( "/troubleshoot/delivery" )
685
+ . insert ( true )
686
+ . create ( "DMARC" )
687
+ . route ( "/troubleshoot/dmarc" )
688
+ . insert ( true )
689
+ . insert ( permissions. has_access ( Permission :: Troubleshoot ) )
656
690
. create ( "Settings" )
657
691
. icon ( view ! { <IconAdjustmentsHorizontal /> } )
658
692
. raw_route ( DEFAULT_SETTINGS_URL )
@@ -717,6 +751,7 @@ pub fn build_schemas() -> Arc<Schemas> {
717
751
. build_mfa ( )
718
752
. build_app_passwords ( )
719
753
. build_live_tracing ( )
754
+ . build_troubleshoot ( )
720
755
. build ( )
721
756
. into ( )
722
757
}
0 commit comments