Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

404 rather than 500 on missisng pool, add comment#1525

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
chillenberger merged 2 commits intomasterfromdan-patch
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes fromall 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 deletionspgml-dashboard/src/api/deployment/deployment_models.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,7 @@ use std::collections::HashMap;

// Returns models page
#[get("/models")]
pub async fn deployment_models(cluster: &Cluster) -> Result<ResponseOk, Error> {
pub async fn deployment_models(cluster: &Cluster, _connected: ConnectedCluster<'_>) -> 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) -> Result<ResponseOk, Error> {

// Returns models page
#[get("/models/<model_id>")]
pub async fn model(cluster: &Cluster, model_id: i64) -> Result<ResponseOk, Error> {
pub async fn model(cluster: &Cluster, model_id: i64, _connected: ConnectedCluster<'_>) -> 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: 6 additions & 2 deletionspgml-dashboard/src/api/deployment/notebooks.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@ use crate::utils::urls;

// Returns notebook page
#[get("/notebooks")]
pub async fn notebooks(cluster: &Cluster) -> Result<ResponseOk, Error> {
pub async fn notebooks(cluster: &Cluster, _connected: ConnectedCluster<'_>) -> 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,7 +36,11 @@ pub async fn notebooks(cluster: &Cluster) -> Result<ResponseOk, Error> {

// Returns the specified notebook page.
#[get("/notebooks/<notebook_id>")]
pub async fn notebook(cluster: &Cluster, notebook_id: i64) -> Result<ResponseOk, Error> {
pub async fn notebook(
cluster: &Cluster,
notebook_id: i64,
_connected: ConnectedCluster<'_>,
) -> 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: 6 additions & 2 deletionspgml-dashboard/src/api/deployment/projects.rs
View file
Open in desktop
Original file line numberDiff line numberDiff 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) -> Result<ResponseOk, Error> {
pub async fn projects(cluster: &Cluster, _connected: ConnectedCluster<'_>) -> 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,7 +32,11 @@ pub async fn projects(cluster: &Cluster) -> Result<ResponseOk, Error> {

// Return the specified project page.
#[get("/projects/<project_id>")]
pub async fn project(cluster: &Cluster, project_id: i64) -> Result<ResponseOk, Error> {
pub async fn project(
cluster: &Cluster,
project_id: i64,
_connected: ConnectedCluster<'_>,
) -> 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: 6 additions & 2 deletionspgml-dashboard/src/api/deployment/snapshots.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,7 @@ use std::collections::HashMap;

// Returns snapshots page
#[get("/snapshots")]
pub async fn snapshots(cluster: &Cluster) -> Result<ResponseOk, Error> {
pub async fn snapshots(cluster: &Cluster, _connected: ConnectedCluster<'_>) -> 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,7 +33,11 @@ pub async fn snapshots(cluster: &Cluster) -> Result<ResponseOk, Error> {

// Returns the specific snapshot page
#[get("/snapshots/<snapshot_id>")]
pub async fn snapshot(cluster: &Cluster, snapshot_id: i64) -> Result<ResponseOk, Error> {
pub async fn snapshot(
cluster: &Cluster,
snapshot_id: i64,
_connected: ConnectedCluster<'_>,
) -> 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 deletionpgml-dashboard/src/api/deployment/uploader.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,7 +19,7 @@ use crate::utils::urls;

// Returns the uploader page.
#[get("/uploader")]
pub async fn uploader(cluster: &Cluster) -> Result<ResponseOk, Error> {
pub async fn uploader(cluster: &Cluster, _connected: ConnectedCluster<'_>) -> 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: 1 addition & 0 deletionspgml-dashboard/src/guards.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -82,6 +82,7 @@ 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

[8]ページ先頭

©2009-2025 Movatter.jp