completed migration of file view to generic model list

This commit is contained in:
vabene1111
2021-10-14 11:20:30 +02:00
parent 92f0f44a3d
commit 54a2a45959
15 changed files with 130 additions and 188 deletions

View File

@@ -0,0 +1,16 @@
<template>
<b-alert show variant="warning">
<b-badge>BETA</b-badge>
{{ $t('warning_feature_beta') }}
</b-alert>
</template>
<script>
export default {
name: "BetaWarning"
}
</script>
<style scoped>
</style>

View File

@@ -28,7 +28,11 @@
<b-dropdown-item :href="resolveDjangoUrl('list_automation')">
<i class="fas fa-robot fa-fw"></i> {{ Models['AUTOMATION'].name }}
</b-dropdown-item>
</b-dropdown-item>
<b-dropdown-item :href="resolveDjangoUrl('list_user_file')">
<i class="fas fa-file fa-fw"></i> {{ Models['USERFILE'].name }}
</b-dropdown-item>
</b-dropdown>
</span>

View File

@@ -0,0 +1,51 @@
<template>
<div>
<div v-if="max_file_size_mb === -1">
<b-alert show variant="warning">
{{ $t('file_upload_disabled') }}
</b-alert>
</div>
<b-progress :max="progress_max" v-else>
<b-progress-bar :value="current_file_size_mb" style="text-align: center">
<span><strong class="text-dark ">{{ current_file_size_mb.toFixed(2) }} / {{ display_max }} MB</strong></span>
</b-progress-bar>
</b-progress>
</div>
</template>
<script>
export default {
name: "StorageQuota",
props: {},
computed: {
progress_max() {
if (this.max_file_size_mb === 0) {
return this.current_file_size_mb * 4
}
return this.max_file_size_mb
},
display_max(){
if (this.max_file_size_mb === 0) {
return '∞'
}
return this.max_file_size_mb
}
},
data: function () {
return {
current_file_size_mb: window.CURRENT_FILE_SIZE_MB,
max_file_size_mb: window.MAX_FILE_SIZE_MB
}
},
mounted() {
},
}
</script>
<style scoped>
</style>