mirror of
https://github.com/filegator/filegator.git
synced 2025-08-21 01:01:21 +02:00
lint tweaks
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
@@ -14,10 +12,9 @@ import '@fortawesome/fontawesome-free/css/fontawesome.css'
|
||||
//TODO: import './registerServiceWorker'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
Vue.config.baseURL =
|
||||
process.env.VUE_APP_API_ENDPOINT
|
||||
? process.env.VUE_APP_API_ENDPOINT
|
||||
: window.location.origin+window.location.pathname+'?r='
|
||||
|
||||
/* eslint-disable-next-line */
|
||||
Vue.config.baseURL = process.env.VUE_APP_API_ENDPOINT ? process.env.VUE_APP_API_ENDPOINT : window.location.origin+window.location.pathname+'?r='
|
||||
|
||||
axios.defaults.withCredentials = true
|
||||
axios.defaults.baseURL = Vue.config.baseURL
|
||||
@@ -33,7 +30,6 @@ Vue.mixin(shared)
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
render: h => h(App),
|
||||
created: function() {
|
||||
|
||||
api.getConfig()
|
||||
@@ -63,4 +59,5 @@ new Vue({
|
||||
})
|
||||
})
|
||||
},
|
||||
render: h => h(App),
|
||||
}).$mount('#app')
|
||||
|
@@ -39,15 +39,15 @@ const funcs = {
|
||||
return this.$store.getters.hasPermissions(permissions)
|
||||
},
|
||||
formatBytes(bytes, decimals = 2) {
|
||||
if (bytes === 0) return '0 Bytes';
|
||||
if (bytes === 0) return '0 Bytes'
|
||||
|
||||
const k = 1024;
|
||||
const dm = decimals < 0 ? 0 : decimals;
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
const k = 1024
|
||||
const dm = decimals < 0 ? 0 : decimals
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
||||
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k))
|
||||
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]
|
||||
},
|
||||
formatDate(timestamp) {
|
||||
return moment.unix(timestamp).format('YY/MM/DD hh:mm:ss')
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable no-console */
|
||||
/* eslint-disable */
|
||||
|
||||
import { register } from 'register-service-worker'
|
||||
|
||||
|
@@ -41,7 +41,7 @@
|
||||
</b-upload>
|
||||
</b-field>
|
||||
<a v-if="can(['read', 'write']) && ! checked.length" class="is-inline-block">
|
||||
<b-dropdown aria-role="list" :disabled="checked.length > 0">
|
||||
<b-dropdown :disabled="checked.length > 0" aria-role="list">
|
||||
<span slot="trigger">
|
||||
<b-icon icon="plus" size="is-small" /> {{ lang('New') }}
|
||||
</span>
|
||||
@@ -90,22 +90,22 @@
|
||||
checkable
|
||||
>
|
||||
<template slot-scope="props">
|
||||
<b-table-column field="data.name" :label="lang('Name')" :custom-sort="sortByName" sortable>
|
||||
<b-table-column :label="lang('Name')" :custom-sort="sortByName" field="data.name" sortable>
|
||||
<a class="is-block name" @click="itemClick(props.row)">
|
||||
{{ props.row.name }}
|
||||
</a>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column field="data.size" :label="lang('Size')" :custom-sort="sortBySize" sortable numeric width="150">
|
||||
<b-table-column :label="lang('Size')" :custom-sort="sortBySize" field="data.size" sortable numeric width="150">
|
||||
{{ props.row.type == 'back' || props.row.type == 'dir' ? lang('Folder') : formatBytes(props.row.size) }}
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column field="data.time" :label="lang('Time')" :custom-sort="sortByTime" sortable numeric width="200">
|
||||
<b-table-column :label="lang('Time')" :custom-sort="sortByTime" field="data.time" sortable numeric width="200">
|
||||
{{ props.row.time ? formatDate(props.row.time) : '' }}
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column class="action-padding" width="51">
|
||||
<b-dropdown v-if="props.row.type != 'back'" aria-role="list" position="is-bottom-left" :disabled="checked.length > 0">
|
||||
<b-dropdown v-if="props.row.type != 'back'" :disabled="checked.length > 0" aria-role="list" position="is-bottom-left">
|
||||
<button slot="trigger" class="button is-small">
|
||||
<b-icon icon="ellipsis-h" size="is-small" />
|
||||
</button>
|
||||
@@ -165,7 +165,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
dropZone: false,
|
||||
perPage: "",
|
||||
perPage: '',
|
||||
currentPage: 1,
|
||||
checked: [],
|
||||
isLoading: false,
|
||||
@@ -335,7 +335,7 @@ export default {
|
||||
})
|
||||
},
|
||||
getDownloadLink(item) {
|
||||
return Vue.config.baseURL+'/download/'+btoa(item.path);
|
||||
return Vue.config.baseURL+'/download/'+btoa(item.path)
|
||||
},
|
||||
download(item) {
|
||||
window.open(this.getDownloadLink(item), '_blank')
|
||||
@@ -386,7 +386,7 @@ export default {
|
||||
},
|
||||
onConfirm: (value) => {
|
||||
if (! value) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
this.isLoading = true
|
||||
api.zipItems({
|
||||
@@ -525,7 +525,7 @@ export default {
|
||||
z-index: 1000;
|
||||
top: 0;
|
||||
left: 0;
|
||||
user-drag: none;
|
||||
user-drag: none;
|
||||
user-select: none;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-drag: none;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<form @submit.prevent="login">
|
||||
<div class="box">
|
||||
<div class="has-text-centered">
|
||||
<img class="logo" :src="$store.state.config.logo">
|
||||
<img :src="$store.state.config.logo" class="logo">
|
||||
</div>
|
||||
<br>
|
||||
<b-field :label="lang('Username')">
|
||||
|
@@ -23,23 +23,23 @@
|
||||
:loading="isLoading"
|
||||
>
|
||||
<template slot-scope="props">
|
||||
<b-table-column field="name" :label="lang('Name')" sortable>
|
||||
<b-table-column :label="lang('Name')" field="name" sortable>
|
||||
<a @click="editUser(props.row)">
|
||||
{{ props.row.name }}
|
||||
</a>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column field="username" :label="lang('Username')" sortable>
|
||||
<b-table-column :label="lang('Username')" field="username" sortable>
|
||||
<a @click="editUser(props.row)">
|
||||
{{ props.row.username }}
|
||||
</a>
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column field="role" :label="lang('Permissions')">
|
||||
<b-table-column :label="lang('Permissions')" field="role">
|
||||
{{ permissions(props.row.permissions) }}
|
||||
</b-table-column>
|
||||
|
||||
<b-table-column field="role" :label="lang('Role')" sortable>
|
||||
<b-table-column :label="lang('Role')" field="role" sortable>
|
||||
{{ props.row.role }}
|
||||
</b-table-column>
|
||||
|
||||
@@ -65,7 +65,7 @@ export default {
|
||||
components: { Menu, Pagination },
|
||||
data() {
|
||||
return {
|
||||
perPage: "",
|
||||
perPage: '',
|
||||
currentPage: 1,
|
||||
isLoading: false,
|
||||
defaultSort: ['name', 'desc'],
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<img :src="this.$store.state.config.logo">
|
||||
</a>
|
||||
|
||||
<a role="button" :class="[navbarActive ? 'is-active' : '', 'navbar-burger burger']" aria-label="menu" aria-expanded="false" @click="navbarActive = !navbarActive">
|
||||
<a :class="[navbarActive ? 'is-active' : '', 'navbar-burger burger']" role="button" aria-label="menu" aria-expanded="false" @click="navbarActive = !navbarActive">
|
||||
<span aria-hidden="true" />
|
||||
<span aria-hidden="true" />
|
||||
<span aria-hidden="true" />
|
||||
|
@@ -18,7 +18,7 @@ import api from '../../api/api'
|
||||
import _ from 'lodash'
|
||||
|
||||
export default {
|
||||
name: "TreeNode",
|
||||
name: 'TreeNode',
|
||||
props: {
|
||||
node: {
|
||||
type: Object,
|
||||
@@ -73,7 +73,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
@@ -109,7 +109,7 @@ export default {
|
||||
type: 'is-danger',
|
||||
message: this.lang('Browser not supported.'),
|
||||
})
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
this.resumable.on('fileAdded', () => {
|
||||
|
Reference in New Issue
Block a user