diff options
Diffstat (limited to 'src/site')
34 files changed, 188 insertions, 180 deletions
diff --git a/src/site/components/album/AlbumDetails.vue b/src/site/components/album/AlbumDetails.vue index 4067853..f81e257 100644 --- a/src/site/components/album/AlbumDetails.vue +++ b/src/site/components/album/AlbumDetails.vue @@ -119,12 +119,12 @@ import { mapState, mapActions } from 'vuex'; export default { props: { albumId: { - type: Number, - default: 0 + 'type': Number, + 'default': 0 }, details: { - type: Object, - default: () => ({}) + 'type': Object, + 'default': () => ({}) } }, data() { @@ -175,7 +175,7 @@ export default { } catch (e) { this.alert({ text: e.message, error: true }); } finally { - this.isDeletingLinks = this.isDeletingLinks.filter((e) => e !== identifier); + this.isDeletingLinks = this.isDeletingLinks.filter(e => e !== identifier); } }, async createLink(albumId) { @@ -207,7 +207,7 @@ export default { maxlength: 10 }, trapFocus: true, - onConfirm: (value) => this.$handler.executeAction('albums/createCustomLink', { albumId, value }) + onConfirm: value => this.$handler.executeAction('albums/createCustomLink', { albumId, value }) }); }, isDeleting(identifier) { diff --git a/src/site/components/album/AlbumEntry.vue b/src/site/components/album/AlbumEntry.vue index 1e1b2cf..18633c4 100644 --- a/src/site/components/album/AlbumEntry.vue +++ b/src/site/components/album/AlbumEntry.vue @@ -53,7 +53,7 @@ <AlbumDetails v-if="isExpanded" :details="getDetails(album.id)" - :albumId="album.id" /> + :album-id="album.id" /> </div> </template> @@ -67,8 +67,8 @@ export default { }, props: { album: { - type: Object, - default: () => ({}) + 'type': Object, + 'default': () => ({}) } }, computed: { diff --git a/src/site/components/footer/Footer.vue b/src/site/components/footer/Footer.vue index b409cf5..aa54dce 100644 --- a/src/site/components/footer/Footer.vue +++ b/src/site/components/footer/Footer.vue @@ -54,6 +54,8 @@ </div> <div class="column"> <a href="https://github.com/weebdev/lolisafe">GitHub</a> + <a href="https://patreon.com/pitu">Patreon</a> + <a href="https://discord.gg/5g6vgwn">Discord</a> </div> <div class="column"> <a @@ -79,9 +81,9 @@ export default { computed: { ...mapGetters({ loggedIn: 'auth/isLoggedIn' }), ...mapState({ - version: (state) => state.config.version, - serviceName: (state) => state.config.serviceName, - token: (state) => state.auth.token + version: state => state.config.version, + serviceName: state => state.config.serviceName, + token: state => state.auth.token }) }, methods: { diff --git a/src/site/components/grid/Grid.vue b/src/site/components/grid/Grid.vue index ea568f0..0693c77 100644 --- a/src/site/components/grid/Grid.vue +++ b/src/site/components/grid/Grid.vue @@ -23,10 +23,10 @@ <template v-if="!images.showList"> <Waterfall - :gutterWidth="10" - :gutterHeight="4" + :gutter-width="10" + :gutter-height="4" :options="{fitWidth: true}" - :itemWidth="width" + :item-width="width" :items="gridFiles"> <template v-slot="{item}"> <template v-if="isPublic"> @@ -165,32 +165,32 @@ export default { }, props: { files: { - type: Array, - default: () => [] + 'type': Array, + 'default': () => [] }, total: { - type: Number, - default: 0 + 'type': Number, + 'default': 0 }, fixed: { - type: Boolean, - default: false + 'type': Boolean, + 'default': false }, isPublic: { - type: Boolean, - default: false + 'type': Boolean, + 'default': false }, width: { - type: Number, - default: 150 + 'type': Number, + 'default': 150 }, enableSearch: { - type: Boolean, - default: true + 'type': Boolean, + 'default': true }, enableToolbar: { - type: Boolean, - default: true + 'type': Boolean, + 'default': true } }, data() { @@ -212,16 +212,16 @@ export default { }, computed: { ...mapState({ - user: (state) => state.auth.user, - albums: (state) => state.albums.tinyDetails, - images: (state) => state.images + user: state => state.auth.user, + albums: state => state.albums.tinyDetails, + images: state => state.images }), blank() { // eslint-disable-next-line global-require, import/no-unresolved return require('@/assets/images/blank.png'); }, gridFiles() { - return (this.files || []).filter((v) => !v.hideFromList); + return (this.files || []).filter(v => !v.hideFromList); } }, watch: { @@ -259,8 +259,8 @@ export default { }, isAlbumSelected(id) { if (!this.showingModalForFile) return false; - const found = this.showingModalForFile.albums.find((el) => el.id === id); - return !!(found && found.id); + const found = this.showingModalForFile.albums.find(el => el.id === id); + return Boolean(found && found.id); }, async openAlbumModal(file) { const { id } = file; diff --git a/src/site/components/grid/waterfall/Waterfall.vue b/src/site/components/grid/waterfall/Waterfall.vue index af2af3f..5a4c569 100644 --- a/src/site/components/grid/waterfall/Waterfall.vue +++ b/src/site/components/grid/waterfall/Waterfall.vue @@ -24,24 +24,24 @@ export default { }, props: { options: { - type: Object, - default: () => {} + 'type': Object, + 'default': () => {} }, items: { - type: Array, - default: () => [] + 'type': Array, + 'default': () => [] }, itemWidth: { - type: Number, - default: 150 + 'type': Number, + 'default': 150 }, gutterWidth: { - type: Number, - default: 10 + 'type': Number, + 'default': 10 }, gutterHeight: { - type: Number, - default: 4 + 'type': Number, + 'default': 4 } }, mounted() { @@ -84,20 +84,20 @@ export default { this.masonry.layout(); }, diffDomChildren() { - const oldChildren = this.domChildren.filter((element) => !!element.parentNode); + const oldChildren = this.domChildren.filter(element => Boolean(element.parentNode)); const newChildren = this.getNewDomChildren(); - const removed = oldChildren.filter((oldChild) => !newChildren.includes(oldChild)); - const domDiff = newChildren.filter((newChild) => !oldChildren.includes(newChild)); + const removed = oldChildren.filter(oldChild => !newChildren.includes(oldChild)); + const domDiff = newChildren.filter(newChild => !oldChildren.includes(newChild)); const prepended = domDiff.filter((newChild, index) => newChildren[index] === newChild); - const appended = domDiff.filter((el) => !prepended.includes(el)); + const appended = domDiff.filter(el => !prepended.includes(el)); let moved = []; if (removed.length === 0) { moved = oldChildren.filter((child, index) => index !== newChildren.indexOf(child)); } this.domChildren = newChildren; return { - old: oldChildren, - new: newChildren, + 'old': oldChildren, + 'new': newChildren, removed, appended, prepended, @@ -120,15 +120,10 @@ export default { getNewDomChildren() { const node = this.$refs.waterfall; const children = this.options && this.options.itemSelector - ? node.querySelectorAll(this.options.itemSelector) : node.children; + ? node.querySelectorAll(this.options.itemSelector) + : node.children; return Array.prototype.slice.call(children); } } }; </script> - -<style lang="scss" scoped> -.wfi { - -} -</style> diff --git a/src/site/components/image-modal/AlbumInfo.vue b/src/site/components/image-modal/AlbumInfo.vue index 17c375a..8aeb02e 100644 --- a/src/site/components/image-modal/AlbumInfo.vue +++ b/src/site/components/image-modal/AlbumInfo.vue @@ -24,22 +24,20 @@ </template> <script> -import { mapState } from 'vuex'; - export default { name: 'Albuminfo', props: { imageId: { - type: Number, - default: 0 + 'type': Number, + 'default': 0 }, imageAlbums: { - type: Array, - default: () => [] + 'type': Array, + 'default': () => [] }, albums: { - type: Array, - default: () => [] + 'type': Array, + 'default': () => [] } }, data() { @@ -52,7 +50,7 @@ export default { this.orderedAlbums = this.getOrderedAlbums(); // we're sorting here instead of computed because we want sort on creation // then the array's values should be frozen - this.selectedOptions = this.imageAlbums.map((e) => e.id); + this.selectedOptions = this.imageAlbums.map(e => e.id); }, methods: { getOrderedAlbums() { @@ -70,8 +68,8 @@ export default { }, isAlbumSelected(id) { if (!this.showingModalForFile) return false; - const found = this.showingModalForFile.albums.find((el) => el.id === id); - return !!(found && found.id); + const found = this.showingModalForFile.albums.find(el => el.id === id); + return Boolean(found && found.id); }, async handleClick(id) { // here the album should be already removed from the selected list diff --git a/src/site/components/image-modal/ImageInfo.vue b/src/site/components/image-modal/ImageInfo.vue index 73b6339..07c87b5 100644 --- a/src/site/components/image-modal/ImageInfo.vue +++ b/src/site/components/image-modal/ImageInfo.vue @@ -97,12 +97,12 @@ <div class="divider is-lolisafe has-text-light"> Tags </div> - <Taginfo :imageId="file.id" :imageTags="tags" /> + <Taginfo :image-id="file.id" :image-tags="tags" /> <div class="divider is-lolisafe has-text-light"> Albums </div> - <Albuminfo :imageId="file.id" :imageAlbums="albums" :albums="tinyDetails" /> + <Albuminfo :image-id="file.id" :image-albums="albums" :albums="tinyDetails" /> </div> </div> </div> @@ -122,21 +122,21 @@ export default { }, props: { file: { - type: Object, - default: () => ({}) + 'type': Object, + 'default': () => ({}) }, albums: { - type: Array, - default: () => ([]) + 'type': Array, + 'default': () => ([]) }, tags: { - type: Array, - default: () => ([]) + 'type': Array, + 'default': () => ([]) } }, computed: mapState({ - images: (state) => state.images, - tinyDetails: (state) => state.albums.tinyDetails + images: state => state.images, + tinyDetails: state => state.albums.tinyDetails }), methods: { formatBytes(bytes, decimals = 2) { @@ -148,6 +148,7 @@ export default { const i = Math.floor(Math.log(bytes) / Math.log(k)); + // eslint-disable-next-line no-mixed-operators return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`; }, isVideo(type) { diff --git a/src/site/components/image-modal/TagInfo.vue b/src/site/components/image-modal/TagInfo.vue index 59d01f5..756a32d 100644 --- a/src/site/components/image-modal/TagInfo.vue +++ b/src/site/components/image-modal/TagInfo.vue @@ -22,12 +22,12 @@ export default { name: 'Taginfo', props: { imageId: { - type: Number, - default: 0 + 'type': Number, + 'default': 0 }, imageTags: { - type: Array, - default: () => [] + 'type': Array, + 'default': () => [] } }, data() { @@ -37,14 +37,14 @@ export default { }, computed: { ...mapState({ - tags: (state) => state.tags.tagsList + tags: state => state.tags.tagsList }), - selectedTags() { return this.imageTags.map((e) => e.name); }, - lowercaseTags() { return this.imageTags.map((e) => e.name.toLowerCase()); } + selectedTags() { return this.imageTags.map(e => e.name); }, + lowercaseTags() { return this.imageTags.map(e => e.name.toLowerCase()); } }, methods: { getFilteredTags(str) { - this.filteredTags = this.tags.map((e) => e.name).filter((e) => { + this.filteredTags = this.tags.map(e => e.name).filter(e => { // check if the search string matches any of the tags const sanitezedTag = e.toString().toLowerCase(); const matches = sanitezedTag.indexOf(str.toLowerCase()) >= 0; diff --git a/src/site/components/loading/CubeShadow.vue b/src/site/components/loading/CubeShadow.vue index 71b5da5..7aeed65 100644 --- a/src/site/components/loading/CubeShadow.vue +++ b/src/site/components/loading/CubeShadow.vue @@ -8,16 +8,16 @@ export default { props: { size: { - type: String, - default: '60px' + 'type': String, + 'default': '60px' }, background: { - type: String, - default: '#9C27B0' + 'type': String, + 'default': '#9C27B0' }, duration: { - type: String, - default: '1.8s' + 'type': String, + 'default': '1.8s' } }, computed: { diff --git a/src/site/components/loading/Origami.vue b/src/site/components/loading/Origami.vue index 59c5d8f..1c7a4c3 100644 --- a/src/site/components/loading/Origami.vue +++ b/src/site/components/loading/Origami.vue @@ -19,8 +19,8 @@ export default { props: { size: { - type: String, - default: '40px' + 'type': String, + 'default': '40px' } }, computed: { diff --git a/src/site/components/loading/PingPong.vue b/src/site/components/loading/PingPong.vue index c04ae72..bab33d5 100644 --- a/src/site/components/loading/PingPong.vue +++ b/src/site/components/loading/PingPong.vue @@ -18,8 +18,8 @@ export default { props: { size: { - type: String, - default: '60px' + 'type': String, + 'default': '60px' } }, computed: { diff --git a/src/site/components/loading/RotateSquare.vue b/src/site/components/loading/RotateSquare.vue index 7bc9bb0..b7967ec 100644 --- a/src/site/components/loading/RotateSquare.vue +++ b/src/site/components/loading/RotateSquare.vue @@ -8,8 +8,8 @@ export default { props: { size: { - type: String, - default: '40px' + 'type': String, + 'default': '40px' } }, computed: { diff --git a/src/site/components/navbar/Navbar.vue b/src/site/components/navbar/Navbar.vue index 22d41d4..c0b8668 100644 --- a/src/site/components/navbar/Navbar.vue +++ b/src/site/components/navbar/Navbar.vue @@ -72,8 +72,8 @@ import { mapState, mapGetters } from 'vuex'; export default { props: { isWhite: { - type: Boolean, - default: false + 'type': Boolean, + 'default': false } }, data() { diff --git a/src/site/components/search-input/SearchInput.vue b/src/site/components/search-input/SearchInput.vue index 1c5b983..10728a0 100644 --- a/src/site/components/search-input/SearchInput.vue +++ b/src/site/components/search-input/SearchInput.vue @@ -89,12 +89,12 @@ export default { props: { value: [Number, String], data: { - type: Array, - default: () => [] + 'type': Array, + 'default': () => [] }, field: { - type: String, - default: 'value' + 'type': String, + 'default': 'value' }, keepFirst: Boolean, clearOnSelect: Boolean, @@ -105,8 +105,8 @@ export default { clearable: Boolean, maxHeight: [String, Number], dropdownPosition: { - type: String, - default: 'auto' + 'type': String, + 'default': 'auto' }, iconRight: String, iconRightClickable: Boolean, @@ -159,25 +159,25 @@ export default { * Check if exists default slot */ hasDefaultSlot() { - return !!this.$scopedSlots.default; + return Boolean(this.$scopedSlots.default); }, /** * Check if exists "empty" slot */ hasEmptySlot() { - return !!this.$slots.empty; + return Boolean(this.$slots.empty); }, /** * Check if exists "header" slot */ hasHeaderSlot() { - return !!this.$slots.header; + return Boolean(this.$slots.header); }, /** * Check if exists "footer" slot */ hasFooterSlot() { - return !!this.$slots.footer; + return Boolean(this.$slots.footer); }, /** * Apply dropdownPosition property @@ -202,7 +202,8 @@ export default { // eslint-disable-next-line no-nested-ternary maxHeight: this.maxHeight === undefined // eslint-disable-next-line no-restricted-globals - ? null : (isNaN(this.maxHeight) ? this.maxHeight : `${this.maxHeight}px`) + ? null + : (isNaN(this.maxHeight) ? this.maxHeight : `${this.maxHeight}px`) }; } }, @@ -239,7 +240,7 @@ export default { } // Close dropdown if input is clear or else open it if (this.hasFocus && (!this.openOnFocus || value)) { - this.isActive = !!value; + this.isActive = Boolean(value); } }, /** @@ -378,8 +379,8 @@ export default { * reached it's end. */ checkIfReachedTheEndOfScroll(list) { - if (list.clientHeight !== list.scrollHeight - && list.scrollTop + list.clientHeight >= list.scrollHeight) { + if (list.clientHeight !== list.scrollHeight && + list.scrollTop + list.clientHeight >= list.scrollHeight) { this.$emit('infinite-scroll'); } }, @@ -396,9 +397,9 @@ export default { if (this.$refs.dropdown === undefined) return; const rect = this.$refs.dropdown.getBoundingClientRect(); this.isListInViewportVertically = ( - rect.top >= 0 - && rect.bottom <= (window.innerHeight - || document.documentElement.clientHeight) + rect.top >= 0 && + rect.bottom <= (window.innerHeight || + document.documentElement.clientHeight) ); if (this.appendToBody) { this.updateAppendToBody(); @@ -425,9 +426,9 @@ export default { list.scrollTop = element.offsetTop; } else if (element.offsetTop >= visMax) { list.scrollTop = ( - element.offsetTop - - list.clientHeight - + element.clientHeight + element.offsetTop - + list.clientHeight + + element.clientHeight ); } } else { @@ -487,7 +488,7 @@ export default { if (dropdownMenu && trigger) { // update wrapper dropdown const root = this.$data._bodyEl; - root.classList.forEach((item) => root.classList.remove(item)); + root.classList.forEach(item => root.classList.remove(item)); root.classList.add('autocomplete'); root.classList.add('control'); if (this.expandend) { @@ -496,10 +497,10 @@ export default { const rect = trigger.getBoundingClientRect(); let top = rect.top + window.scrollY; const left = rect.left + window.scrollX; - if (!this.isOpenedTop) { - top += trigger.clientHeight; - } else { + if (this.isOpenedTop) { top -= dropdownMenu.clientHeight; + } else { + top += trigger.clientHeight; } this.style = { position: 'absolute', diff --git a/src/site/components/search/Search.vue b/src/site/components/search/Search.vue index 778474c..2c4e3bc 100644 --- a/src/site/components/search/Search.vue +++ b/src/site/components/search/Search.vue @@ -6,7 +6,7 @@ ref="autocomplete" v-model="query" :data="filteredHints" - :customSelector="handleSelect" + :custom-selector="handleSelect" field="name" class="lolisafe-input search" placeholder="Search" @@ -40,8 +40,8 @@ export default { }, props: { hiddenHints: { - type: Array, - default: () => [] + 'type': Array, + 'default': () => [] } }, data() { @@ -49,34 +49,34 @@ export default { query: '', hints: [ { - 'name': 'tag', - 'valueFormat': 'name', - 'hint': '' + name: 'tag', + valueFormat: 'name', + hint: '' }, { - 'name': 'album', - 'valueFormat': 'name', - 'hint': '' + name: 'album', + valueFormat: 'name', + hint: '' }, { - 'name': 'before', - 'valueFormat': 'specific date', - 'hint': '' + name: 'before', + valueFormat: 'specific date', + hint: '' }, { - 'name': 'during', - 'valueFormat': 'specific date', - 'hint': '' + name: 'during', + valueFormat: 'specific date', + hint: '' }, { - 'name': 'after', - 'valueFormat': 'specific date', - 'hint': '' + name: 'after', + valueFormat: 'specific date', + hint: '' }, { - 'name': 'file', - 'valueFormat': 'generated name', - 'hint': '' + name: 'file', + valueFormat: 'generated name', + hint: '' } ], filteredHints: [] @@ -98,13 +98,22 @@ export default { // get the last word or group of words let lastWord = (qry.match(/("[^"]*")|[^\s]+/g) || ['']).pop().toLowerCase(); // if there's an open/unbalanced quote, don't autosuggest - if (/^[^"]*("[^"]*"[^"]*)*(")[^"]*$/.test(qry)) { this.filteredHints = []; return; } + if (/^[^"]*("[^"]*"[^"]*)*(")[^"]*$/.test(qry)) { + this.filteredHints = []; + return; + } // don't autosuggest if we have an open query but no text yet - if (/:\s+$/gi.test(qry)) { this.filteredHints = []; return; } + if (/:\s+$/gi.test(qry)) { + this.filteredHints = []; + return; + } // if the above query didn't match (all quotes are balanced // and the previous tag has value // check if we're about to start a new tag - if (/\s+$/gi.test(qry)) { this.filteredHints = this.hints; return; } + if (/\s+$/gi.test(qry)) { + this.filteredHints = this.hints; + return; + } // ignore starting `-` from lastword, because - is used to // exclude something, so -alb should autosuggest album @@ -112,7 +121,7 @@ export default { // if we got here, then we handled all special cases // now take last word, and check if we can autosuggest a tag - this.filteredHints = this.hints.filter((hint) => hint.name + this.filteredHints = this.hints.filter(hint => hint.name .toString() .toLowerCase() .indexOf(lastWord) === 0); diff --git a/src/site/components/sidebar/Sidebar.vue b/src/site/components/sidebar/Sidebar.vue index e0c8fa2..8d96712 100644 --- a/src/site/components/sidebar/Sidebar.vue +++ b/src/site/components/sidebar/Sidebar.vue @@ -48,7 +48,7 @@ import { mapState } from 'vuex'; export default { computed: mapState({ - user: (state) => state.auth.user + user: state => state.auth.user }), methods: { isRouteActive(id) { diff --git a/src/site/components/uploader/Uploader.vue b/src/site/components/uploader/Uploader.vue index 2740bee..94d4003 100644 --- a/src/site/components/uploader/Uploader.vue +++ b/src/site/components/uploader/Uploader.vue @@ -93,8 +93,8 @@ export default { }, computed: { ...mapState({ - config: (state) => state.config, - albums: (state) => state.albums.tinyDetails + config: state => state.config, + albums: state => state.albums.tinyDetails }), ...mapGetters({ loggedIn: 'auth/isLoggedIn', token: 'auth/getToken' }) }, diff --git a/src/site/layouts/default.vue b/src/site/layouts/default.vue index 3fa7ebd..b2b2633 100644 --- a/src/site/layouts/default.vue +++ b/src/site/layouts/default.vue @@ -3,7 +3,7 @@ v-bar class="scroll-area"> <div class="default-body"> - <Navbar :isWhite="true" /> + <Navbar :is-white="true" /> <nuxt-child id="app" class="nuxt-app is-height-max-content" /> @@ -23,7 +23,7 @@ export default { }, computed: mapState(['config', 'alert']), created() { - this.$store.watch((state) => state.alert.message, () => { + this.$store.watch(state => state.alert.message, () => { const { message, type, snackbar } = this.alert; if (!message) return; diff --git a/src/site/layouts/error.vue b/src/site/layouts/error.vue index 77d188f..28f3036 100644 --- a/src/site/layouts/error.vue +++ b/src/site/layouts/error.vue @@ -10,7 +10,7 @@ <template> <section class="hero is-fullheight"> - <Navbar :isWhite="true" /> + <Navbar :is-white="true" /> <div class="hero-body"> <div class="container"> <h2>404エラ</h2> diff --git a/src/site/middleware/admin.js b/src/site/middleware/admin.js index 1a94b75..9a99153 100644 --- a/src/site/middleware/admin.js +++ b/src/site/middleware/admin.js @@ -1,4 +1,4 @@ -export default function ({ store, redirect }) { +export default function({ store, redirect }) { // If the user is not authenticated if (!store.state.auth.user) return redirect('/login'); if (!store.state.auth.user.isAdmin) return redirect('/dashboard'); diff --git a/src/site/middleware/auth.js b/src/site/middleware/auth.js index b2ecc68..020326f 100644 --- a/src/site/middleware/auth.js +++ b/src/site/middleware/auth.js @@ -1,4 +1,4 @@ -export default function ({ store, redirect }) { +export default function({ store, redirect }) { // If the user is not authenticated if (!store.state.auth.loggedIn) { return redirect('/login'); diff --git a/src/site/pages/a/_identifier.vue b/src/site/pages/a/_identifier.vue index 0c6261a..c1e6179 100644 --- a/src/site/pages/a/_identifier.vue +++ b/src/site/pages/a/_identifier.vue @@ -36,10 +36,10 @@ <Grid v-if="files && files.length" :files="files" - :isPublic="true" + :is-public="true" :width="200" - :enableSearch="false" - :enableToolbar="false" /> + :enable-search="false" + :enable-toolbar="false" /> </div> </template> <template v-else> diff --git a/src/site/pages/dashboard/account.vue b/src/site/pages/dashboard/account.vue index 5610495..8a8249d 100644 --- a/src/site/pages/dashboard/account.vue +++ b/src/site/pages/dashboard/account.vue @@ -115,9 +115,9 @@ export default { }; }, computed: { - ...mapGetters({ 'apiKey': 'auth/getApiKey' }), + ...mapGetters({ apiKey: 'auth/getApiKey' }), ...mapState({ - user: (state) => state.auth.user + user: state => state.auth.user }) }, metaInfo() { diff --git a/src/site/pages/dashboard/admin/file/_id.vue b/src/site/pages/dashboard/admin/file/_id.vue index d54bf54..135d066 100644 --- a/src/site/pages/dashboard/admin/file/_id.vue +++ b/src/site/pages/dashboard/admin/file/_id.vue @@ -168,6 +168,7 @@ export default { const i = Math.floor(Math.log(bytes) / Math.log(k)); + // eslint-disable-next-line no-mixed-operators return `${parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`; } } diff --git a/src/site/pages/dashboard/admin/settings.vue b/src/site/pages/dashboard/admin/settings.vue index c6a9ade..0ec235c 100644 --- a/src/site/pages/dashboard/admin/settings.vue +++ b/src/site/pages/dashboard/admin/settings.vue @@ -145,7 +145,7 @@ export default { return { title: 'Settings' }; }, computed: mapState({ - settings: (state) => state.admin.settings + settings: state => state.admin.settings }), methods: { promptRestartService() { diff --git a/src/site/pages/dashboard/admin/user/_id.vue b/src/site/pages/dashboard/admin/user/_id.vue index 484d986..0ed3e86 100644 --- a/src/site/pages/dashboard/admin/user/_id.vue +++ b/src/site/pages/dashboard/admin/user/_id.vue @@ -92,7 +92,7 @@ export default { }; }, computed: mapState({ - user: (state) => state.admin.user + user: state => state.admin.user }), methods: { promptDisableUser() { diff --git a/src/site/pages/dashboard/admin/users.vue b/src/site/pages/dashboard/admin/users.vue index a13564c..e52476a 100644 --- a/src/site/pages/dashboard/admin/users.vue +++ b/src/site/pages/dashboard/admin/users.vue @@ -102,8 +102,8 @@ export default { } }], computed: mapState({ - users: (state) => state.admin.users, - config: (state) => state.config + users: state => state.admin.users, + config: state => state.config }), metaInfo() { return { title: 'Uploads' }; diff --git a/src/site/pages/dashboard/albums/index.vue b/src/site/pages/dashboard/albums/index.vue index 896d134..4f2f3e1 100644 --- a/src/site/pages/dashboard/albums/index.vue +++ b/src/site/pages/dashboard/albums/index.vue @@ -74,7 +74,7 @@ export default { }, methods: { ...mapActions({ - 'alert': 'alert/set' + alert: 'alert/set' }), async createAlbum() { if (!this.newAlbumName || this.newAlbumName === '') return; diff --git a/src/site/pages/dashboard/index.vue b/src/site/pages/dashboard/index.vue index 41605f9..0b60cdc 100644 --- a/src/site/pages/dashboard/index.vue +++ b/src/site/pages/dashboard/index.vue @@ -27,7 +27,7 @@ <Grid v-if="totalFiles && !isLoading" :files="images.files" - :enableSearch="false" + :enable-search="false" class="grid"> <template v-slot:pagination> <b-pagination @@ -112,6 +112,7 @@ export default { this.search = query; const sanitizedQ = this.sanitizeQuery(query); + // eslint-disable-next-line no-negated-condition if (!sanitizedQ.length) { this.current = 1; await this.fetch(this.current); diff --git a/src/site/plugins/axios.js b/src/site/plugins/axios.js index 98bec5c..e252425 100644 --- a/src/site/plugins/axios.js +++ b/src/site/plugins/axios.js @@ -1,13 +1,13 @@ -export default function ({ $axios, store }) { +export default function({ $axios, store }) { $axios.setHeader('accept', 'application/vnd.lolisafe.json'); - $axios.onRequest((config) => { + $axios.onRequest(config => { if (store.state.auth.token) { config.headers.common.Authorization = `bearer ${store.state.auth.token}`; } }); - $axios.onError((error) => { + $axios.onError(error => { if (process.env.NODE_ENV !== 'production') console.error('[AXIOS Error]', error); if (process.browser) { if (process.env.NODE_ENV !== 'production') { diff --git a/src/site/plugins/flexsearch.js b/src/site/plugins/flexsearch.js index 1c06c8d..2e1df36 100644 --- a/src/site/plugins/flexsearch.js +++ b/src/site/plugins/flexsearch.js @@ -6,11 +6,11 @@ const search = new FlexSearch('speed'); // https://github.com/nextapps-de/flexsearch Vue.prototype.$search = { - items: async (items) => { + 'items': async items => { await search.clear(); await search.add(items); }, - do: async (term, field) => { + 'do': async (term, field) => { const results = await search.search(term, { field }); return results; } diff --git a/src/site/plugins/nuxt-client-init.js b/src/site/plugins/nuxt-client-init.js index 01f33ff..4b10dcd 100644 --- a/src/site/plugins/nuxt-client-init.js +++ b/src/site/plugins/nuxt-client-init.js @@ -1,3 +1,3 @@ -export default async (ctx) => { +export default async ctx => { await ctx.store.dispatch('nuxtClientInit', ctx); }; diff --git a/src/site/store/albums.js b/src/site/store/albums.js index 4f796a1..8be0230 100644 --- a/src/site/store/albums.js +++ b/src/site/store/albums.js @@ -9,8 +9,8 @@ export const state = () => ({ }); export const getters = { - isExpanded: (state) => (id) => state.expandedAlbums.indexOf(id) > -1, - getDetails: (state) => (id) => state.albumDetails[id] || {} + isExpanded: state => id => state.expandedAlbums.indexOf(id) > -1, + getDetails: state => id => state.albumDetails[id] || {} }; export const actions = { diff --git a/src/site/store/auth.js b/src/site/store/auth.js index 85e3a39..51a79d6 100644 --- a/src/site/store/auth.js +++ b/src/site/store/auth.js @@ -11,9 +11,9 @@ const getDefaultState = () => ({ export const state = getDefaultState; export const getters = { - isLoggedIn: (state) => state.loggedIn, - getApiKey: (state) => state.user?.apiKey, - getToken: (state) => state.token + isLoggedIn: state => state.loggedIn, + getApiKey: state => state.user?.apiKey, + getToken: state => state.token }; export const actions = { |