Skip to content

Dan product notifications #1524

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 13 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add top level notices to layout
  • Loading branch information
chillenberger committed Jun 12, 2024
commit c5b99321790bf28d73736846fdd7ccd18236aaa7
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 @@ -29,7 +29,7 @@ pub async fn deployment_models(cluster: &Cluster) -> Result<ResponseOk, Error> {

let nav_tabs = tabs::Tabs::new(tabs, Some("Models"), Some("Models"))?;

Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs, cluster))))
Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs))))
}

// Returns models page
Expand All @@ -52,7 +52,7 @@ pub async fn model(cluster: &Cluster, model_id: i64) -> Result<ResponseOk, Error

let nav_tabs = tabs::Tabs::new(tabs, Some("Models"), Some("Models"))?;

Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs, cluster))))
Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs))))
}

#[get("/models_turboframe")]
Expand Down
4 changes: 2 additions & 2 deletions pgml-dashboard/src/api/deployment/notebooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub async fn notebooks(cluster: &Cluster) -> Result<ResponseOk, Error> {

let nav_tabs = tabs::Tabs::new(tabs, Some("Notebooks"), Some("Notebooks"))?;

Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs, cluster))))
Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs))))
}

// Returns the specified notebook page.
Expand All @@ -52,7 +52,7 @@ pub async fn notebook(cluster: &Cluster, notebook_id: i64) -> Result<ResponseOk,

let nav_tabs = tabs::Tabs::new(tabs, Some("Notebooks"), Some("Notebooks"))?;

Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs, cluster))))
Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs))))
}

// Returns all the notebooks for a deployment in a turbo frame.
Expand Down
4 changes: 2 additions & 2 deletions pgml-dashboard/src/api/deployment/projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub async fn projects(cluster: &Cluster) -> Result<ResponseOk, Error> {

let nav_tabs = tabs::Tabs::new(tabs, Some("Notebooks"), Some("Projects"))?;

Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs, cluster))))
Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs))))
}

// Return the specified project page.
Expand All @@ -48,7 +48,7 @@ pub async fn project(cluster: &Cluster, project_id: i64) -> Result<ResponseOk, E

let nav_tabs = tabs::Tabs::new(tabs, Some("Projects"), Some("Projects"))?;

Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs, cluster))))
Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs))))
}

// Returns all the deployments for the project in a turbo frame.
Expand Down
4 changes: 2 additions & 2 deletions pgml-dashboard/src/api/deployment/snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub async fn snapshots(cluster: &Cluster) -> Result<ResponseOk, Error> {

let nav_tabs = tabs::Tabs::new(tabs, Some("Snapshots"), Some("Snapshots"))?;

Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs, cluster))))
Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs))))
}

// Returns the specific snapshot page
Expand All @@ -49,7 +49,7 @@ pub async fn snapshot(cluster: &Cluster, snapshot_id: i64) -> Result<ResponseOk,

let nav_tabs = tabs::Tabs::new(tabs, Some("Snapshots"), Some("Snapshots"))?;

Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs, cluster))))
Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs))))
}

// Returns all snapshots for the deployment in a turboframe.
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 @@ -30,7 +30,7 @@ pub async fn uploader(cluster: &Cluster) -> Result<ResponseOk, Error> {

let nav_tabs = tabs::Tabs::new(tabs, Some("Upload Data"), Some("Upload Data"))?;

Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs, cluster))))
Ok(ResponseOk(layout.render(templates::Dashboard::new(nav_tabs))))
}

// Returns uploader module in a turboframe.
Expand Down
18 changes: 9 additions & 9 deletions pgml-dashboard/src/templates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ pub struct WebAppBase<'a> {
pub product_left_nav: StaticNav,
pub body_components: Vec<Component>,
pub cluster: Cluster,
pub product_banner: ProductBanner,
pub product_banner_high: ProductBanner,
pub product_banner_medium: ProductBanner,
}

impl<'a> WebAppBase<'a> {
Expand All @@ -135,10 +136,14 @@ impl<'a> WebAppBase<'a> {
cluster,
dropdown_nav: context.context.dropdown_nav.clone(),
product_left_nav: context.context.product_left_nav.clone(),
product_banner: ProductBanner::from_notification(Notification::next_product_of_level(
product_banner_high: ProductBanner::from_notification(Notification::next_product_of_level(
context,
NotificationLevel::ProductHigh,
)),
product_banner_medium: ProductBanner::from_notification(Notification::next_product_of_level(
context,
NotificationLevel::ProductMedium,
)),
..Default::default()
}
}
Expand Down Expand Up @@ -469,16 +474,11 @@ pub struct Uploaded {
#[template(path = "content/dashboard/dashboard.html")]
pub struct Dashboard<'a> {
pub tabs: tabs::Tabs<'a>,
pub notification: ProductBanner,
}

impl Dashboard<'_> {
pub fn new<'a>(tabs: tabs::Tabs<'a>, context: &'a crate::guards::Cluster) -> Dashboard<'a> {
let notification = ProductBanner::from_notification(Notification::next_product_of_level(
context,
NotificationLevel::ProductMedium,
));
Dashboard { tabs, notification }
pub fn new<'a>(tabs: tabs::Tabs<'a>) -> Dashboard<'a> {
Dashboard { tabs }
}
}

Expand Down
1 change: 0 additions & 1 deletion pgml-dashboard/templates/content/dashboard/dashboard.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<%+ notification %>
<turbo-frame id="dashboard">
<% for tab in tabs.tabs.into_iter() { %>
<div>
Expand Down
3 changes: 2 additions & 1 deletion pgml-dashboard/templates/layout/web_app_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@

<div class="px-xs-2 px-md-5 overflow-hidden" style="padding-top: 57px;">
<div class="webapp-content-max-width-container pt-4">
<%+ product_banner %>
<%+ product_banner_high %>
<%+ product_banner_medium %>
<%- content.unwrap_or_default() %>
</div>
</div>
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