Skip to content

Commit

Permalink
fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
archeoss committed Mar 3, 2024
1 parent 0e1fa8c commit d5ddb9b
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 26 deletions.
7 changes: 0 additions & 7 deletions backend/src/services/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ use super::{auth::HttpClient, prelude::*};
// think of better method of returning info
// another thread that constantly updates info in period and cache the results?

// TODO: For methods, that requires information from all nodes (/disks/count, /nodes/rps, etc.),
// think of better method of returning info
// another thread that constantly updates info in period and cache the results?

/// Returns count of Physical Disks per status
#[cfg_attr(all(feature = "swagger", debug_assertions),
utoipa::path(
Expand Down Expand Up @@ -603,8 +599,6 @@ pub async fn raw_configuration_by_node(
))
}

<<<<<<< HEAD
=======
/// Get Detailed Information on Node
///
/// # Errors
Expand Down Expand Up @@ -736,7 +730,6 @@ pub async fn get_detailed_node_info(
Ok(result)
}

>>>>>>> 67e5cea (NodeListPage added)
async fn get_client_by_node(
client: &HttpBobClient,
node_name: NodeName,
Expand Down
5 changes: 0 additions & 5 deletions backend/src/services/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ use api::{
use auth::{login, logout, require_auth, AuthState, BobUser, HttpBobClient, InMemorySessionStore};
use prelude::*;

use self::api::{get_vdisk_info, get_vdisks_list};

type BobAuthState = AuthState<
BobUser,
Uuid,
Expand All @@ -60,14 +58,11 @@ pub fn api_router_v1(auth_state: BobAuthState) -> Result<Router<BobAuthState>, R
.api_route("/nodes/:node_name", &Method::GET, get_node_info)
.api_route("/vdisks/list", &Method::GET, get_vdisks_list)
.api_route("/vdisks/:vdisk_id", &Method::GET, get_vdisk_info)
<<<<<<< HEAD
=======
.api_route(
"/nodes/:node_name/detailed",
&Method::GET,
get_detailed_node_info,
)
>>>>>>> 67e5cea (NodeListPage added)
.api_route(
"/nodes/:node_name/metrics",
&Method::GET,
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@emotion/cache": "^11.11.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@hotwired/turbo": "^8.0.3",
"@mui/icons-material": "^5.14.19",
"@mui/material": "^5.15.7",
"@mui/styled-engine-sc": "^6.0.0-alpha.7",
Expand Down
31 changes: 18 additions & 13 deletions frontend/src/components/diskTable/diskTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const DotColor: Record<DiskStatusName, string> = {
Offline: style.reddot,
};

interface Space {
totalSpace: number;
usedSpace: number;
}

const columns: GridColDef[] = [
{
field: 'name',
Expand Down Expand Up @@ -49,11 +54,11 @@ const columns: GridColDef[] = [
align: 'center',
flex: 4,
headerAlign: 'center',
renderCell: (params: GridRenderCellParams<GridValidRowModel, SpaceInfo>) => {
renderCell: (params: GridRenderCellParams<GridValidRowModel, Space>) => {
return (
<div>
{formatBytes(params.value?.used_disk || 0)} /{' '}
<span className={style.totalspace}>{formatBytes(params.value?.total_disk || 0)}</span>
{formatBytes(params.value?.usedSpace || 0)} /{' '}
<span className={style.totalspace}>{formatBytes(params.value?.totalSpace || 0)}</span>
</div>
);
},
Expand All @@ -70,16 +75,16 @@ const columns: GridColDef[] = [
const DiskTable = ({ disks }: { disks: Disk[] }) => {
const data = disks
? disks
.map((disk, i) => {
return {
id: i,
name: disk.name,
ops: disk.iops,
status: disk.status,
usedspace: { totalSpace: disk.totalSpace, usedSpace: disk.usedSpace },
} as DiskTableCols;
})
.sort((a, b) => (a.name < b.name ? 1 : -1))
.map((disk, i) => {

Check failure on line 78 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`

Check failure on line 78 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`
return {

Check failure on line 79 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`

Check failure on line 79 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`
id: i,

Check failure on line 80 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Replace `····················` with `······················`

Check failure on line 80 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Replace `····················` with `······················`
name: disk.name,

Check failure on line 81 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`

Check failure on line 81 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`
ops: disk.iops,

Check failure on line 82 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`

Check failure on line 82 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`
status: disk.status,

Check failure on line 83 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`

Check failure on line 83 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`
usedspace: { totalSpace: disk.totalSpace, usedSpace: disk.usedSpace } as Space,

Check failure on line 84 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`

Check failure on line 84 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`
} as DiskTableCols;

Check failure on line 85 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`

Check failure on line 85 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`
})

Check failure on line 86 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`

Check failure on line 86 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`
.sort((a, b) => (a.name < b.name ? 1 : -1))

Check failure on line 87 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`

Check failure on line 87 in frontend/src/components/diskTable/diskTable.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Insert `··`
: [];
return (
<Box
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const { title } = Astro.props;
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap"
/>
<script>
import '../turbo-router.js';
</script>
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
<!-- <ViewTransitions /> -->
Expand All @@ -30,7 +33,9 @@ const { title } = Astro.props;
<!--Theme Registry doesn't work on nested components.
It needs to be used in *every* react component-->
<ThemeRegistry options={{ key: 'mui' }} client:only>
<Navbar logoutRedirectTo="/login" client:only />
<div data-turbo-permanent id="navbar">
<Navbar logoutRedirectTo="/login" client:only />
</div>
<slot />
</ThemeRegistry>
<style is:global>
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/turbo-router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import * as Turbo from '@hotwired/turbo';

Turbo.start();
5 changes: 5 additions & 0 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,11 @@
resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.1.tgz#16308cea045f0fc777b6ff20a9f25474dd8293d2"
integrity sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==

"@hotwired/turbo@^8.0.3":
version "8.0.3"
resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-8.0.3.tgz#338e07278f4b3c76921328d3c92dbc4831c209d0"
integrity sha512-qLgp7d6JaegKjMToTJahosrFxV3odfSbiekispQ3soOzE5jnU+iEMWlRvYRe/jvy5Q+JWoywtf9j3RD4ikVjIg==

"@humanwhocodes/config-array@^0.11.13":
version "0.11.14"
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b"
Expand Down

0 comments on commit d5ddb9b

Please sign in to comment.