🌐 AI搜索 & 代理 主页
Skip to content

Commit 79d0a74

Browse files
committed
make owl a font, default breadcrumb start is home, remove bc on mobile
1 parent c1664d1 commit 79d0a74

File tree

9 files changed

+47
-14
lines changed

9 files changed

+47
-14
lines changed

pgml-dashboard/src/components/breadcrumbs/template.html

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<nav>
22
<nav aria-label="breadcrumb z-1">
33
<ol class="breadcrumb">
4-
<!-- not quite ready for this yet -->
5-
<!-- <li class="breadcrumb-item body-regular-text <% if links.is_empty() {%>active<% } %>">
6-
<a class="d-flex" href="/deployments">
7-
<span class="material-symbols-outlined">
8-
roofing
9-
</span>
4+
<li class="breadcrumb-item body-regular-text <% if links.is_empty() {%>active<% } %>">
5+
<a class="d-flex gap-2 align-items-center" href="/deployments">
6+
<span class="icon-owl"></span>
7+
Home
108
</a>
11-
</li> -->
9+
</li>
10+
11+
<% if !links.is_empty() {%>
12+
<div class="vr my-1 mx-2"></div>
13+
<% } %>
14+
1215
<% for link in links {
1316
let active = if link.active {
1417
"active"

pgml-dashboard/src/components/navigation/navbar/web_app/template.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
<div class="controls">
1313
<!-- Toggles items that come from left nav -->
1414
<button class="navbar-toggler collapsed top-nav-controls" type="button" data-bs-toggle="collapse" data-bs-target="#leftNavItems" aria-controls="LeftNavItems" aria-expanded="false" aria-label="Toggle navigation">
15-
<div class="mobile-left-nav-controls rounded-1">
16-
<img class="m-2" src="/dashboard/static/images/owl_white.webp" alt="postgresml_owl" width="12" height="16">
15+
16+
<div class="mobile-left-nav-controls rounded-1 p-2 d-flex">
17+
<span class="icon-owl text-white mx-1"></span>
1718
</div>
1819
</button>
1920

@@ -130,9 +131,7 @@
130131
<a
131132
class="py-2 text-white w-100 text-center d-flex gap-2 ps-4 justify-content-center <% if link.disabled { %> disabled <% } %> <% if link.active { %> active <% } %>"
132133
href="<% if !link.disabled { %> <%= link.href %> <% } %>">
133-
<span class="d-flex align-items-center h-100">
134-
<img src="/dashboard/static/images/owl_white.webp" alt="postgresml_owl" width="12" height="16">
135-
</span>
134+
<span class="icon-owl" style="line-height: unset;"></span>
136135
<%= link.name %>
137136
</a>
138137
</li>

pgml-dashboard/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ pub async fn uploaded_index(cluster: ConnectedCluster<'_>, table_name: &str) ->
570570
pub async fn dashboard(cluster: ConnectedCluster<'_>, tab: Option<&str>, id: Option<i64>) -> Result<ResponseOk, Error> {
571571
let mut layout = crate::templates::WebAppBase::new("Dashboard", &cluster.inner.context);
572572

573-
let mut breadcrumbs = vec![NavLink::new("Dashboard", "/dashboard")];
573+
let mut breadcrumbs = vec![];
574574

575575
let tab = tab.unwrap_or("Notebooks");
576576

pgml-dashboard/static/css/scss/base/_font.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,16 @@
152152
font-display: swap;
153153
}
154154

155+
@font-face {
156+
font-family: 'icomoon';
157+
src: url('/dashboard/static/fonts/.eot?fqmls6');
158+
src: url('/dashboard/static/fonts/icomoon.eot?fqmls6#iefix') format('embedded-opentype'),
159+
url('fonts/icomoon.ttf?fqmls6') format('truetype'),
160+
url('/dashboard/static/fonts/icomoon.woff?fqmls6') format('woff'),
161+
url('/dashboard/static/fonts/icomoon.svg?fqmls6#icomoon') format('svg');
162+
font-weight: normal;
163+
font-style: normal;
164+
font-display: block;
165+
}
166+
155167
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&family=Roboto+Mono:wght@100;300;400;500;700&display=swap');

pgml-dashboard/static/css/scss/components/_icon.scss

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,22 @@
154154
top: 5px;
155155
right: 0;
156156
}
157+
158+
[class^="icon-"], [class*=" icon-"] {
159+
/* use !important to prevent issues with browser extensions that change fonts */
160+
font-family: 'icomoon' !important;
161+
speak: never;
162+
font-style: normal;
163+
font-weight: normal;
164+
font-variant: normal;
165+
text-transform: none;
166+
line-height: 1;
167+
168+
/* Better Font Rendering =========== */
169+
-webkit-font-smoothing: antialiased;
170+
-moz-osx-font-smoothing: grayscale;
171+
}
172+
173+
.icon-owl:before {
174+
content: "\e900";
175+
}
1.55 KB
Binary file not shown.
1.39 KB
Binary file not shown.
1.46 KB
Binary file not shown.

pgml-dashboard/templates/layout/web_app_base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<%+ WebAppLeftNav::new( upper_left_nav.clone()).id(&upper_left_nav.unique_id()) %>
2121

2222
<div class="clear-from-under-navbar flex-grow-1 min-vw-0 web-app-content-area">
23-
<div class="px-4 px-sm-5 py-3" style="position: absolute">
23+
<div class="px-4 px-sm-5 py-3 d-none d-lg-flex" style="position: absolute">
2424
<%- Breadcrumbs::render( breadcrumbs ) %>
2525
</div>
2626

0 commit comments

Comments
 (0)