Skip to content

Commit

Permalink
Dstack version on UI (#1742)
Browse files Browse the repository at this point in the history
* Added showing dstack version on the UI

* Added showing dstack version on the UI

* Added showing dstack version on the UI
  • Loading branch information
olgenn authored Sep 30, 2024
1 parent fccc8dd commit f21021e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
9 changes: 9 additions & 0 deletions frontend/src/layouts/AppLayout/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ import { useCheckAvailableProjectPermission } from 'pages/Project/hooks/useCheck

import { DISCORD_URL, DOCS_URL } from '../../consts';
import { goToUrl } from '../../libs';
import { useGetServerInfoQuery } from '../../services/server';

export const useSideNavigation = () => {
const { t } = useTranslation();
const userName = useAppSelector(selectUserName) ?? '';
const { pathname } = useLocation();
const { selectedProject, projectsDropdownList } = useProjectDropdown();
const [isAvailableAdministrationLinks] = usePermissionGuard({ allowedGlobalRoles: [GlobalUserRole.ADMIN] });
const { data: serverInfoData } = useGetServerInfoQuery();

const isPoolDetails = Boolean(useMatch(ROUTES.FLEETS.DETAILS.TEMPLATE));

Expand Down Expand Up @@ -109,6 +111,13 @@ export const useSideNavigation = () => {
},
],
},

{ type: 'divider' },

{
type: 'link',
text: `dstack version: ${serverInfoData?.server_version}`,
},
].filter(Boolean) as SideNavigationProps['items'];

const activeHref = useMemo(() => {
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/layouts/AppLayout/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
}
}

[class^='awsui_navigation'] {
[class^='awsui_list']:last-child {
[class^='awsui_list-item']:last-child {
a {
pointer-events: none;
color: awsui.$color-text-status-inactive !important;
}
}
}
}

.appHeader {
height: 48px;
@media (screen and min-width: 913px) {
Expand Down
1 change: 0 additions & 1 deletion frontend/src/layouts/AppLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
TopNavigation,
} from 'components';

import { DISCORD_URL, DOCS_URL } from 'consts';
import { useAppDispatch, useAppSelector } from 'hooks';
import { goToUrl } from 'libs';
import { ROUTES } from 'routes';
Expand Down

0 comments on commit f21021e

Please sign in to comment.