Skip to content
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
2 changes: 1 addition & 1 deletion web/vtadmin/src/components/App.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
display: grid;
grid-template-areas: 'nav content';
grid-template-rows: auto;
grid-template-columns: 240px auto;
grid-template-columns: 260px auto;
height: 100vh;
overflow: hidden;
position: relative;
Expand Down
24 changes: 21 additions & 3 deletions web/vtadmin/src/components/NavRail.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $navRailHoverTransition: background-color 0.1s ease-in-out;

&::after {
content: '';
background-color: var(--colorScaffolding);
background-color: var(--colorScaffoldingHighlight);
display: block;
height: 1px;
margin: 20px 24px;
Expand All @@ -65,8 +65,10 @@ a.navLink {
color: var(--textColorPrimary);
display: flex;
flex-wrap: nowrap;
font-size: 1.6rem;
font-weight: 500;
padding: 12px 24px 12px 20px;
outline: none;
padding: 13px 24px;
text-decoration: none;
transition: $navRailHoverTransition;

Expand All @@ -75,6 +77,7 @@ a.navLink {
color: var(--colorPrimary);
}

&:focus,
&:hover {
background: var(--backgroundSecondaryHighlight);
color: var(--colorPrimary);
Expand All @@ -86,14 +89,29 @@ a.navLink {
border-radius: 20px;
color: var(--textColorSecondary);
display: inline-block;
font-size: 1.2rem;
font-size: 1.4rem;
line-height: 1.9rem;
margin-left: auto;
padding: 2px 8px;
transition: $navRailHoverTransition;
}

a.navLinkActive .badge,
a.navLink:focus .badge,
a.navLink:hover .badge {
background-color: var(--backgroundPrimaryHighlight);
color: var(--colorPrimary);
}

.icon {
fill: var(--colorScaffoldingForeground);
height: 2rem;
margin-right: 1.2rem;
transition: $navRailHoverTransition;
}

a.navLinkActive .icon,
a.navLink:focus .icon,
a.navLink:hover .icon {
fill: var(--colorPrimary);
}
27 changes: 15 additions & 12 deletions web/vtadmin/src/components/NavRail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { Link, NavLink } from 'react-router-dom';
import style from './NavRail.module.scss';
import logo from '../img/vitess-icon-color.svg';
import { useTablets } from '../hooks/api';
import { Icon, Icons } from './Icon';

export const NavRail = () => {
const { data: tabletData } = useTablets();
Expand All @@ -32,58 +33,60 @@ export const NavRail = () => {
<div className={style.navLinks}>
<ul className={style.navList}>
<li>
<NavRailLink text="Dashboard" to="/dashboard" count={0} />
<NavRailLink icon={Icons.chart} text="Dashboard" to="/dashboard" count={0} />
</li>
<li>
<NavRailLink text="Workflows" to="/workflows" count={0} />
<NavRailLink icon={Icons.wrench} text="Workflows" to="/workflows" count={0} />
</li>
</ul>

<ul className={style.navList}>
<li>
<NavRailLink text="Clusters" to="/clusters" count={0} />
{/* FIXME replace this with a C when we have one */}
<NavRailLink icon={Icons.keyR} text="Clusters" to="/clusters" count={0} />
</li>
<li>
<NavRailLink text="Gates" to="/gates" count={0} />
<NavRailLink icon={Icons.keyG} text="Gates" to="/gates" count={0} />
</li>
<li>
<NavRailLink text="Keyspaces" to="/keyspaces" count={0} />
<NavRailLink icon={Icons.keyK} text="Keyspaces" to="/keyspaces" count={0} />
</li>
<li>
<NavRailLink text="Schemas" to="/schemas" count={0} />
<NavRailLink icon={Icons.keyS} text="Schemas" to="/schemas" count={0} />
</li>
<li>
<NavRailLink text="Tablets" to="/tablets" count={(tabletData || []).length} />
<NavRailLink icon={Icons.keyT} text="Tablets" to="/tablets" count={(tabletData || []).length} />
</li>
</ul>

<ul className={style.navList}>
<li>
<NavRailLink text="VTExplain" to="/vtexplain" />
<NavRailLink icon={Icons.runQuery} text="VTExplain" to="/vtexplain" />
</li>
<li>
<NavRailLink text="Settings" to="/settings" />
<NavRailLink icon={Icons.gear} text="Settings" to="/settings" />
</li>
</ul>
</div>

<div className={style.footerContainer}>
<ul className={style.navList}>
<li>
<NavRailLink text="Debug" to="/debug" />
<NavRailLink icon={Icons.bug} text="Debug" to="/debug" />
</li>
<li>
<NavRailLink text="Shortcuts" to="/shortcuts" />
<NavRailLink icon={Icons.keyboard} text="Shortcuts" to="/shortcuts" />
</li>
</ul>
</div>
</div>
);
};

const NavRailLink = ({ count, text, to }: { count?: number; text: string; to: string }) => {
const NavRailLink = ({ count, icon, text, to }: { count?: number; icon: Icons; text: string; to: string }) => {
return (
<NavLink activeClassName={style.navLinkActive} className={style.navLink} to={to}>
<Icon className={style.icon} icon={icon} />
<span>{text}</span>
{typeof count === 'number' && <div className={style.badge}>{count}</div>}
</NavLink>
Expand Down
6 changes: 4 additions & 2 deletions web/vtadmin/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
--colorPrimary: #3d5afe;
--colorPrimary50: #8187ff;
--colorPrimary200: #0031ca;
--colorScaffolding: var(--grey400);
--colorScaffoldingHighlight: var(--grey400);
--colorScaffoldingForeground: var(--grey600);
--tableBorderColor: var(--grey400);
--textColorPrimary: #17171b;
--textColorInverted: #fff;
Expand All @@ -92,7 +93,8 @@
--colorPrimary: #8187ff;
--colorPrimary50: #b6b7ff;
--colorPrimary200: #4a5acb;
--colorScaffolding: var(--grey600);
--colorScaffoldingHighlight: var(--grey600);
--colorScaffoldingForeground: var(--grey400);
--tableBorderColor: var(--grey800);
--textColorPrimary: #fff;
--textColorInverted: #17171b;
Expand Down