Skip to content

Revert "404 rather than 500 on missing pool, add comment" #1532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pgml-dashboard/src/api/deployment/deployment_models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use std::collections::HashMap;

// Returns models page
#[get("/models")]
pub async fn deployment_models(cluster: &Cluster, _connected: ConnectedCluster<'_>) -> Result<ResponseOk, Error> {
pub async fn deployment_models(cluster: &Cluster) -> Result<ResponseOk, Error> {
let mut layout = crate::templates::WebAppBase::new("Dashboard", &cluster);
layout.breadcrumbs(vec![NavLink::new("Models", &urls::deployment_models()).active()]);

Expand All @@ -34,7 +34,7 @@ pub async fn deployment_models(cluster: &Cluster, _connected: ConnectedCluster<'

// Returns models page
#[get("/models/<model_id>")]
pub async fn model(cluster: &Cluster, model_id: i64, _connected: ConnectedCluster<'_>) -> Result<ResponseOk, Error> {
pub async fn model(cluster: &Cluster, model_id: i64) -> Result<ResponseOk, Error> {
let model = models::Model::get_by_id(cluster.pool(), model_id).await?;
let project = models::Project::get_by_id(cluster.pool(), model.project_id).await?;

Expand Down
8 changes: 2 additions & 6 deletions pgml-dashboard/src/api/deployment/notebooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::utils::urls;

// Returns notebook page
#[get("/notebooks")]
pub async fn notebooks(cluster: &Cluster, _connected: ConnectedCluster<'_>) -> Result<ResponseOk, Error> {
pub async fn notebooks(cluster: &Cluster) -> Result<ResponseOk, Error> {
let mut layout = crate::templates::WebAppBase::new("Dashboard", &cluster);
layout.breadcrumbs(vec![NavLink::new("Notebooks", &urls::deployment_notebooks()).active()]);

Expand All @@ -36,11 +36,7 @@ pub async fn notebooks(cluster: &Cluster, _connected: ConnectedCluster<'_>) -> R

// Returns the specified notebook page.
#[get("/notebooks/<notebook_id>")]
pub async fn notebook(
cluster: &Cluster,
notebook_id: i64,
_connected: ConnectedCluster<'_>,
) -> Result<ResponseOk, Error> {
pub async fn notebook(cluster: &Cluster, notebook_id: i64) -> Result<ResponseOk, Error> {
let notebook = models::Notebook::get_by_id(cluster.pool(), notebook_id).await?;

let mut layout = crate::templates::WebAppBase::new("Dashboard", &cluster);
Expand Down
8 changes: 2 additions & 6 deletions pgml-dashboard/src/api/deployment/projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::utils::urls;

// Returns the deployments projects page.
#[get("/projects")]
pub async fn projects(cluster: &Cluster, _connected: ConnectedCluster<'_>) -> Result<ResponseOk, Error> {
pub async fn projects(cluster: &Cluster) -> Result<ResponseOk, Error> {
let mut layout = crate::templates::WebAppBase::new("Dashboard", &cluster);
layout.breadcrumbs(vec![NavLink::new("Projects", &urls::deployment_projects()).active()]);

Expand All @@ -32,11 +32,7 @@ pub async fn projects(cluster: &Cluster, _connected: ConnectedCluster<'_>) -> Re

// Return the specified project page.
#[get("/projects/<project_id>")]
pub async fn project(
cluster: &Cluster,
project_id: i64,
_connected: ConnectedCluster<'_>,
) -> Result<ResponseOk, Error> {
pub async fn project(cluster: &Cluster, project_id: i64) -> Result<ResponseOk, Error> {
let project = models::Project::get_by_id(cluster.pool(), project_id).await?;

let mut layout = crate::templates::WebAppBase::new("Dashboard", &cluster);
Expand Down
8 changes: 2 additions & 6 deletions pgml-dashboard/src/api/deployment/snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::collections::HashMap;

// Returns snapshots page
#[get("/snapshots")]
pub async fn snapshots(cluster: &Cluster, _connected: ConnectedCluster<'_>) -> Result<ResponseOk, Error> {
pub async fn snapshots(cluster: &Cluster) -> Result<ResponseOk, Error> {
let mut layout = crate::templates::WebAppBase::new("Dashboard", &cluster);
layout.breadcrumbs(vec![NavLink::new("Snapshots", &urls::deployment_snapshots()).active()]);

Expand All @@ -33,11 +33,7 @@ pub async fn snapshots(cluster: &Cluster, _connected: ConnectedCluster<'_>) -> R

// Returns the specific snapshot page
#[get("/snapshots/<snapshot_id>")]
pub async fn snapshot(
cluster: &Cluster,
snapshot_id: i64,
_connected: ConnectedCluster<'_>,
) -> Result<ResponseOk, Error> {
pub async fn snapshot(cluster: &Cluster, snapshot_id: i64) -> Result<ResponseOk, Error> {
let snapshot = models::Snapshot::get_by_id(cluster.pool(), snapshot_id).await?;

let mut layout = crate::templates::WebAppBase::new("Dashboard", &cluster);
Expand Down
2 changes: 1 addition & 1 deletion pgml-dashboard/src/api/deployment/uploader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::utils::urls;

// Returns the uploader page.
#[get("/uploader")]
pub async fn uploader(cluster: &Cluster, _connected: ConnectedCluster<'_>) -> Result<ResponseOk, Error> {
pub async fn uploader(cluster: &Cluster) -> Result<ResponseOk, Error> {
let mut layout = crate::templates::WebAppBase::new("Dashboard", &cluster);
layout.breadcrumbs(vec![NavLink::new("Upload Data", &urls::deployment_uploader()).active()]);

Expand Down
1 change: 0 additions & 1 deletion pgml-dashboard/src/guards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ pub struct ConnectedCluster<'a> {
pub inner: &'a Cluster,
}

// 404 rather than 500 if the cluster is not connected.
#[rocket::async_trait]
impl<'r> FromRequest<'r> for ConnectedCluster<'r> {
type Error = ();
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy