feat: ui improves the login experience (#182)

close #157 #158
This commit is contained in:
sigoden
2023-02-21 12:42:40 +08:00
committed by GitHub
parent a61fda6e80
commit 6d9758c71d
6 changed files with 164 additions and 34 deletions

View File

@@ -72,6 +72,10 @@ impl AccessControl {
Ok(Self { rules })
}
pub fn valid(&self) -> bool {
!self.rules.is_empty()
}
pub fn guard(
&self,
path: &str,
@@ -134,6 +138,9 @@ impl GuardType {
pub fn is_reject(&self) -> bool {
*self == GuardType::Reject
}
pub fn is_readwrite(&self) -> bool {
*self == GuardType::ReadWrite
}
}
fn sanitize_path(path: &str, uri_prefix: &str) -> String {