Adding paged loading of links.

This commit is contained in:
2021-08-12 15:48:02 +02:00
committed by dietrich
parent 2b276a5130
commit b11177a943
12 changed files with 156 additions and 21 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ impl UserDbOperations<Self> for User {
#[instrument()]
async fn toggle_admin(self, server_config: &ServerConfig) -> Result<(), ServerError> {
let new_role = match self.role {
r @ Role::NotAuthenticated | r @ Role::Disabled => r,
r @ (Role::NotAuthenticated | Role::Disabled) => r,
Role::Regular => Role::Admin,
Role::Admin => Role::Regular,
};
+1
View File
@@ -113,6 +113,7 @@ pub async fn list_all_allowed(
querystring.push_str(&generate_order_sql(&order));
}
querystring.push_str(&format!("\n LIMIT {}", parameters.amount));
querystring.push_str(&format!("\n OFFSET {}", parameters.offset));
info!("{}", querystring);
let links = sqlx::query(&querystring)
+15 -3
View File
@@ -8,21 +8,23 @@ form {
}
.center {
position: absolute;
position: fixed;
width: 600px;
max-width: 100%;
height: 400px;
height: 500px;
max-height: 100%;
top: 50%;
left: 50%;
margin-left: -300px;
margin-top: -200px;
margin-top: -250px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 30px;
color: #333;
overflow-y: scroll;
scrollbar-width: none;
}
.center input {
@@ -229,4 +231,14 @@ img.trashicon {
padding: 5px;
margin: 3px;
border-radius: 50%;
}
a.loadmore {
display: flex;
color: darkgray;
margin: auto;
justify-content: space-evenly;
align-items: center;
border: none;
border-radius: 15px;
}
+3
View File
@@ -0,0 +1,3 @@
<svg width="48" height="48" version="1.1" viewBox="0 0 12.7 12.7" xmlns="http://www.w3.org/2000/svg">
<path transform="rotate(220.03)" d="m-6.5691-4.5466c-1.7227-1.0829-3.96-0.86298-5.4388 0.53473-1.4788 1.3977-1.8246 3.619-0.84044 5.4 0.98412 1.781 3.0487 2.6705 5.019 2.1624 1.9704-0.50816 3.3472-2.2852 3.3472-4.32l-1.902 1.7128 1.902-1.7128 0.72362 2.5702" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.1607;stroke:#a8a8a8"/>
</svg>

After

Width:  |  Height:  |  Size: 467 B