Skip to content

Commit

Permalink
fix(dashboard): make charts look better in portrait mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenclaw900 committed Nov 27, 2021
1 parent 592cdfd commit 0773943
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
Binary file modified src/frontend/.yarn/install-state.gz
Binary file not shown.
21 changes: 8 additions & 13 deletions src/frontend/src/pages/Home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@
},
};
let portrait = window.innerHeight > window.innerWidth;
let portrait;
$: portrait = window.innerHeight > window.innerWidth;
let ramData, swapData, diskData;
Expand Down Expand Up @@ -201,7 +202,12 @@
: ' md:flex-row'} flex-grow"
>
<Card header="System Diagnostics">
<div id="chartWrapper">
<div
id="chartWrapper"
class={portrait
? "w-70vw min-w-full h-50vh"
: "max-w-full h-70vh max-h-95%"}
>
<canvas bind:this={canvas} />
</div>
</Card>
Expand Down Expand Up @@ -232,14 +238,3 @@
</Card>
{/if}
</main>

<style>
#chartWrapper {
max-width: 100%;
min-width: 0;
width: 85vw;
max-height: 95%;
min-height: 0;
height: 70vh;
}
</style>

0 comments on commit 0773943

Please sign in to comment.