Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add folder size #1000

Merged
merged 3 commits into from
Jan 7, 2024
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
28 changes: 14 additions & 14 deletions docs.openc3.com/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@

/* You can override the default Infima variables here. */
:root {
--ifm-color-primary: #3578e5;
--ifm-color-primary-dark: #3477e5;
--ifm-color-primary-darker: #1a5ecb;
--ifm-color-primary-darkest: #14499e;
--ifm-color-primary-light: #6195eb;
--ifm-color-primary-lighter: #8eb4f0;
--ifm-color-primary-lightest: #bbd2f6;
--ifm-color-primary: #4dacff;
--ifm-color-primary-dark: #4dacff;
--ifm-color-primary-darker: #4dacff;
--ifm-color-primary-darkest: #4dacff;
--ifm-color-primary-light: #4dacff;
--ifm-color-primary-lighter: #4dacff;
--ifm-color-primary-lightest: #4dacff;
--ifm-code-font-size: 95%;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
}

/* For readability concerns, you should choose a lighter palette in dark mode. */
[data-theme='dark'] {
--ifm-color-primary: #3578e5;
--ifm-color-primary-dark: #3477e5;
--ifm-color-primary-darker: #1a5ecb;
--ifm-color-primary-darkest: #14499e;
--ifm-color-primary-light: #6195eb;
--ifm-color-primary-lighter: #8eb4f0;
--ifm-color-primary-lightest: #bbd2f6;
--ifm-color-primary: #4dacff;
--ifm-color-primary-dark: #4dacff;
--ifm-color-primary-darker: #4dacff;
--ifm-color-primary-darkest: #4dacff;
--ifm-color-primary-light: #4dacff;
--ifm-color-primary-lighter: #4dacff;
--ifm-color-primary-lightest: #4dacff;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<top-bar :title="title" />
<v-card width="100%">
<div style="padding-left: 5px; padding-top: 5px">
<span class="ma-2">Buckets:</span>
<span class="ma-2 font-size">Buckets:</span>
<v-chip
v-for="(bucket, index) in buckets"
:key="index"
Expand All @@ -36,7 +36,7 @@
</v-chip>
</div>
<div style="padding-left: 5px" v-if="volumes.length !== 0">
<span class="ma-2">Volumes:</span>
<span class="ma-2 font-size">Volumes:</span>
<v-chip
v-for="(volume, index) in volumes"
:key="index"
Expand Down Expand Up @@ -91,12 +91,14 @@
<v-btn icon>
<v-icon @click="backArrow">mdi-chevron-left-box-outline</v-icon>
</v-btn>
<span class=".text-body-1 ma-2" data-test="file-path"
<span class=".text-body-1 ma-2 font-size" data-test="file-path"
>/{{ path }}</span
>
<v-spacer />
<span class="pa-1 font-size">Folder: {{ folderTotal }}</span>
<v-spacer />
<div style="display: flex" v-if="mode === 'bucket'">
<span class="pa-1">Upload</span>
<span class="pa-1 font-size">Upload</span>
<v-file-input
v-model="file"
hide-input
Expand All @@ -112,6 +114,9 @@
<v-icon class="mr-2">{{ item.icon }}</v-icon
>{{ item.name }}
</template>
<template v-slot:item.size="{ item }">
{{ item.size ? item.size.toLocaleString() : '' }}
</template>
<template v-slot:item.action="{ item }">
<v-icon
class="mr-3"
Expand Down Expand Up @@ -160,6 +165,13 @@ export default {
],
}
},
computed: {
folderTotal() {
return this.files
.reduce((a, b) => a + (b.size ? b.size : 0), 0)
.toLocaleString()
},
},
created() {
Api.get('/openc3-api/storage/buckets').then((response) => {
this.buckets = response.data
Expand Down Expand Up @@ -356,6 +368,9 @@ export default {
</script>

<style scoped>
.font-size {
font-size: 1rem;
}
.file-input {
padding-top: 0px;
margin-top: 0px;
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion playwright/tests/bucket-explorer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ test('upload and delete', async ({ page, utils }) => {
await expect(page.locator('[data-test="file-path"]')).toHaveText(
'/DEFAULT/targets_modified/',
)
await utils.sleep(300) // Ensure the table is rendered before getting the count
await utils.sleep(1000) // Ensure the table is rendered before getting the count
let count = await page.locator('tbody > tr').count()

// Note that Promise.all prevents a race condition
Expand Down
Loading