Refactor usages for prettyBytes

pull/4870/head
Angel Fernando Quiroz Campos 1 year ago
parent f8339d1b2d
commit b73449f9ea
  1. 6
      assets/vue/main.js
  2. 4
      assets/vue/views/documents/DocumentForHtmlEditor.vue
  3. 3
      assets/vue/views/documents/DocumentsList.vue
  4. 4
      assets/vue/views/documents/ListQuasar.vue
  5. 4
      assets/vue/views/personalfile/List.vue
  6. 4
      assets/vue/views/personalfile/Shared.vue

@ -215,12 +215,6 @@ app.component("TinyEditor", Editor)
app.config.globalProperties.axios = axios app.config.globalProperties.axios = axios
app.config.globalProperties.window = window app.config.globalProperties.window = window
const prettyBytes = require("pretty-bytes")
app.config.globalProperties.$filters = {
prettyBytes,
}
window.Alpine = Alpine window.Alpine = Alpine
Alpine.start() Alpine.start()

@ -84,7 +84,7 @@
<template #body="slotProps"> <template #body="slotProps">
{{ {{
slotProps.data.resourceNode.resourceFile slotProps.data.resourceNode.resourceFile
? $filters.prettyBytes(slotProps.data.resourceNode.resourceFile.size) ? prettyBytes(slotProps.data.resourceNode.resourceFile.size)
: "" : ""
}} }}
</template> </template>
@ -157,6 +157,7 @@ import DocumentsFilterForm from "../../components/documents/Filter"
import { RESOURCE_LINK_PUBLISHED } from "../../components/resource_links/visibility" import { RESOURCE_LINK_PUBLISHED } from "../../components/resource_links/visibility"
import { useI18n } from "vue-i18n" import { useI18n } from "vue-i18n"
import { useFormatDate } from "../../composables/formatDate" import { useFormatDate } from "../../composables/formatDate"
import prettyBytes from "pretty-bytes"
export default { export default {
name: "DocumentForHtmlEditor", name: "DocumentForHtmlEditor",
@ -196,6 +197,7 @@ export default {
filters: {}, filters: {},
submitted: false, submitted: false,
relativeDatetime, relativeDatetime,
prettyBytes,
} }
return data return data

@ -112,7 +112,7 @@
<template #body="slotProps"> <template #body="slotProps">
{{ {{
slotProps.data.resourceNode.resourceFile slotProps.data.resourceNode.resourceFile
? $filters.prettyBytes(slotProps.data.resourceNode.resourceFile.size) ? prettyBytes(slotProps.data.resourceNode.resourceFile.size)
: "" : ""
}} }}
</template> </template>
@ -305,6 +305,7 @@ import BaseChart from "../../components/basecomponents/BaseChart.vue"
import DocumentAudioRecorder from "../../components/documents/DocumentAudioRecorder.vue" import DocumentAudioRecorder from "../../components/documents/DocumentAudioRecorder.vue"
import { useNotification } from "../../composables/notification" import { useNotification } from "../../composables/notification"
import { useSecurityStore } from "../../store/securityStore" import { useSecurityStore } from "../../store/securityStore"
import prettyBytes from "pretty-bytes"
const store = useStore() const store = useStore()
const route = useRoute() const route = useRoute()

@ -61,7 +61,7 @@
auto-width auto-width
> >
<span v-if="props.row.resourceNode.resourceFile"> <span v-if="props.row.resourceNode.resourceFile">
{{ $filters.prettyBytes(props.row.resourceNode.resourceFile.size) }} {{ prettyBytes(props.row.resourceNode.resourceFile.size) }}
</span> </span>
</q-td> </q-td>
</template> </template>
@ -89,6 +89,7 @@ import Toolbar from "../../components/Toolbar.vue"
import ResourceIcon from "../../components/documents/ResourceIcon.vue" import ResourceIcon from "../../components/documents/ResourceIcon.vue"
import { useRoute } from "vue-router" import { useRoute } from "vue-router"
import moment from "moment" import moment from "moment"
import prettyBytes from "pretty-bytes"
/*const servicePrefix = 'documents'; /*const servicePrefix = 'documents';
const { getters, actions } = list(servicePrefix);*/ const { getters, actions } = list(servicePrefix);*/
@ -120,6 +121,7 @@ export default {
selected: [], selected: [],
selectMode: "multi", selectMode: "multi",
isBusy: false, isBusy: false,
prettyBytes,
} }
}, },
created() { created() {

@ -87,7 +87,7 @@
<template #body="slotProps"> <template #body="slotProps">
{{ {{
slotProps.data.resourceNode.resourceFile slotProps.data.resourceNode.resourceFile
? $filters.prettyBytes(slotProps.data.resourceNode.resourceFile.size) ? prettyBytes(slotProps.data.resourceNode.resourceFile.size)
: "" : ""
}} }}
</template> </template>
@ -261,6 +261,7 @@ import isEmpty from "lodash/isEmpty"
import { RESOURCE_LINK_PUBLISHED } from "../../components/resource_links/visibility" import { RESOURCE_LINK_PUBLISHED } from "../../components/resource_links/visibility"
import { useI18n } from "vue-i18n" import { useI18n } from "vue-i18n"
import { useFormatDate } from "../../composables/formatDate" import { useFormatDate } from "../../composables/formatDate"
import prettyBytes from "pretty-bytes"
export default { export default {
name: "PersonalFileList", name: "PersonalFileList",
@ -316,6 +317,7 @@ export default {
item: {}, item: {},
filters: { shared: 0, loadNode: 1 }, filters: { shared: 0, loadNode: 1 },
submitted: false, submitted: false,
prettyBytes,
relativeDatetime relativeDatetime
} }

@ -49,7 +49,7 @@
<template #body="slotProps"> <template #body="slotProps">
{{ {{
slotProps.data.resourceNode.resourceFile slotProps.data.resourceNode.resourceFile
? $filters.prettyBytes(slotProps.data.resourceNode.resourceFile.size) ? prettyBytes(slotProps.data.resourceNode.resourceFile.size)
: "" : ""
}} }}
</template> </template>
@ -88,6 +88,7 @@ import ResourceFileLink from "../../components/documents/ResourceFileLink.vue"
import DataFilter from "../../components/DataFilter" import DataFilter from "../../components/DataFilter"
import isEmpty from "lodash/isEmpty" import isEmpty from "lodash/isEmpty"
import { useFormatDate } from "../../composables/formatDate" import { useFormatDate } from "../../composables/formatDate"
import prettyBytes from "pretty-bytes"
export default { export default {
name: "PersonalFileShared", name: "PersonalFileShared",
@ -124,6 +125,7 @@ export default {
filters: { shared: 1, loadNode: 0 }, filters: { shared: 1, loadNode: 0 },
submitted: false, submitted: false,
relativeDatetime, relativeDatetime,
prettyBytes,
} }
}, },
created() { created() {

Loading…
Cancel
Save