mirror of
https://github.com/filegator/filegator.git
synced 2025-09-01 12:52:44 +02:00
vue linter
This commit is contained in:
@@ -5,33 +5,32 @@
|
||||
<img :src="this.$store.state.config.logo">
|
||||
</a>
|
||||
|
||||
<a @click="navbarActive = !navbarActive" role="button" :class="[navbarActive ? 'is-active' : '', 'navbar-burger burger']" aria-label="menu" aria-expanded="false">
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
<a role="button" :class="[navbarActive ? 'is-active' : '', 'navbar-burger burger']" aria-label="menu" aria-expanded="false" @click="navbarActive = !navbarActive">
|
||||
<span aria-hidden="true" />
|
||||
<span aria-hidden="true" />
|
||||
<span aria-hidden="true" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div :class="[navbarActive ? 'is-active' : '', 'navbar-menu']">
|
||||
<div class="navbar-end">
|
||||
<a @click="$router.push('/')" v-if="is('admin')" class="navbar-item">
|
||||
<a v-if="is('admin')" class="navbar-item" @click="$router.push('/')">
|
||||
{{ lang('Files') }}
|
||||
</a>
|
||||
<a @click="$router.push('/users')" v-if="is('admin')" class="navbar-item">
|
||||
<a v-if="is('admin')" class="navbar-item" @click="$router.push('/users')">
|
||||
{{ lang('Users') }}
|
||||
</a>
|
||||
<a @click="login" v-if="is('guest')" class="navbar-item">
|
||||
<a v-if="is('guest')" class="navbar-item" @click="login">
|
||||
{{ lang('Login') }}
|
||||
</a>
|
||||
<a @click="profile" v-if="!is('guest')" class="navbar-item">
|
||||
<a v-if="!is('guest')" class="navbar-item" @click="profile">
|
||||
{{ lang('Profile') }}
|
||||
</a>
|
||||
<a @click="logout" v-if="!is('guest')" class="navbar-item">
|
||||
<a v-if="!is('guest')" class="navbar-item" @click="logout">
|
||||
{{ lang('Logout') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
|
@@ -1,11 +1,19 @@
|
||||
<template>
|
||||
<div>
|
||||
<b-select :value="perpage" @input="$emit('selected', $event)" size="is-small">
|
||||
<option value="">{{ lang('No pagination') }}</option>
|
||||
<option value="5">{{ lang('Per page', 5) }}</option>
|
||||
<option value="10">{{ lang('Per page', 10) }}</option>
|
||||
<option value="15">{{ lang('Per page', 15) }}</option>
|
||||
</b-select>
|
||||
<b-select :value="perpage" size="is-small" @input="$emit('selected', $event)">
|
||||
<option value="">
|
||||
{{ lang('No pagination') }}
|
||||
</option>
|
||||
<option value="5">
|
||||
{{ lang('Per page', 5) }}
|
||||
</option>
|
||||
<option value="10">
|
||||
{{ lang('Per page', 10) }}
|
||||
</option>
|
||||
<option value="15">
|
||||
{{ lang('Per page', 15) }}
|
||||
</option>
|
||||
</b-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@@ -1,22 +1,28 @@
|
||||
<template>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">{{ $store.state.user.name }}</p>
|
||||
<p class="modal-card-title">
|
||||
{{ $store.state.user.name }}
|
||||
</p>
|
||||
</header>
|
||||
<section class="modal-card-body">
|
||||
<form @submit="save">
|
||||
<b-field :label="lang('Old password')" :type="formErrors.oldpassword ? 'is-danger' : ''" :message="formErrors.oldpassword">
|
||||
<b-input v-model="oldpassword" @keydown.native="formErrors.oldpassword = ''" password-reveal required></b-input>
|
||||
<b-input v-model="oldpassword" password-reveal required @keydown.native="formErrors.oldpassword = ''" />
|
||||
</b-field>
|
||||
|
||||
<b-field :label="lang('New password')" :type="formErrors.newpassword ? 'is-danger' : ''" :message="formErrors.newpassword">
|
||||
<b-input v-model="newpassword" @keydown.native="formErrors.newpassword = ''" password-reveal required></b-input>
|
||||
<b-input v-model="newpassword" password-reveal required @keydown.native="formErrors.newpassword = ''" />
|
||||
</b-field>
|
||||
</form>
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<button class="button" type="button" @click="$parent.close()">{{ lang('Close') }}</button>
|
||||
<button class="button is-primary" type="button" @click="save">{{ lang('Save') }}</button>
|
||||
<button class="button" type="button" @click="$parent.close()">
|
||||
{{ lang('Close') }}
|
||||
</button>
|
||||
<button class="button is-primary" type="button" @click="save">
|
||||
{{ lang('Save') }}
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
</template>
|
||||
|
@@ -1,17 +1,21 @@
|
||||
<template>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">{{ lang('Select Folder') }}</p>
|
||||
<p class="modal-card-title">
|
||||
{{ lang('Select Folder') }}
|
||||
</p>
|
||||
</header>
|
||||
<section class="modal-card-body">
|
||||
<div class="tree">
|
||||
<ul class="tree-list">
|
||||
<TreeNode @selected="$emit('selected', $event) && $parent.close()" :node="$store.state.tree"></TreeNode>
|
||||
<TreeNode :node="$store.state.tree" @selected="$emit('selected', $event) && $parent.close()" />
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<button class="button" type="button" @click="$parent.close()">{{ lang('Close') }}</button>
|
||||
<button class="button" type="button" @click="$parent.close()">
|
||||
{{ lang('Close') }}
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
</template>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<a @click="$emit('selected', node)">{{ node.name }}</a>
|
||||
|
||||
<ul v-if="node.children && node.children.length">
|
||||
<TreeNode v-for="(child, index) in node.children" :node="child" :key="index" @selected="$emit('selected', $event)"></TreeNode>
|
||||
<TreeNode v-for="(child, index) in node.children" :key="index" :node="child" @selected="$emit('selected', $event)" />
|
||||
</ul>
|
||||
</li>
|
||||
</template>
|
||||
@@ -26,12 +26,6 @@ export default {
|
||||
button_type: 'is-primary'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.node.path == '/') {
|
||||
this.$store.commit('resetTree')
|
||||
this.toggleButton(this.node)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
icon() {
|
||||
return {
|
||||
@@ -42,6 +36,12 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (this.node.path == '/') {
|
||||
this.$store.commit('resetTree')
|
||||
this.toggleButton(this.node)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggleButton(node) {
|
||||
if (! this.active) {
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<div class="is-flex is-justify-between">
|
||||
<div class="is-flex">
|
||||
<a @click="toggleWindow">
|
||||
<b-icon :icon="progressVisible ? 'angle-down' : 'angle-up'"></b-icon>
|
||||
<b-icon :icon="progressVisible ? 'angle-down' : 'angle-up'" />
|
||||
</a>
|
||||
<span v-if="activeUploads">
|
||||
{{ lang('Uploading files', Math.round(resumable.progress()*100), formatBytes(resumable.getSize())) }}
|
||||
@@ -20,10 +20,10 @@
|
||||
</div>
|
||||
<div class="is-flex">
|
||||
<a v-if="activeUploads" @click="togglePause()">
|
||||
<b-icon :icon="paused ? 'play-circle' : 'pause-circle'"></b-icon>
|
||||
<b-icon :icon="paused ? 'play-circle' : 'pause-circle'" />
|
||||
</a>
|
||||
<a @click="closeWindow()" class="progress-icon">
|
||||
<b-icon icon="times"></b-icon>
|
||||
<a class="progress-icon" @click="closeWindow()">
|
||||
<b-icon icon="times" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -34,12 +34,12 @@
|
||||
<div>
|
||||
<div>{{ file.relativePath != '/' ? file.relativePath : '' }}/{{ file.fileName }}</div>
|
||||
<div class="is-flex is-justify-between">
|
||||
<progress :class="[file.file.uploadingError ? 'is-danger' : 'is-primary', 'progress is-large']" :value="file.progress()*100" max="100"></progress>
|
||||
<a v-if="! file.isUploading() && file.file.uploadingError" @click="file.retry()" class="progress-icon">
|
||||
<b-icon icon="redo" type="is-danger"></b-icon>
|
||||
<progress :class="[file.file.uploadingError ? 'is-danger' : 'is-primary', 'progress is-large']" :value="file.progress()*100" max="100" />
|
||||
<a v-if="! file.isUploading() && file.file.uploadingError" class="progress-icon" @click="file.retry()">
|
||||
<b-icon icon="redo" type="is-danger" />
|
||||
</a>
|
||||
<a v-else @click="file.cancel()" class="progress-icon">
|
||||
<b-icon :icon="file.isComplete() ? 'check' : 'times'"></b-icon>
|
||||
<a v-else class="progress-icon" @click="file.cancel()">
|
||||
<b-icon :icon="file.isComplete() ? 'check' : 'times'" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -69,6 +69,11 @@ export default {
|
||||
progress: 0,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
activeUploads() {
|
||||
return this.resumable.files.length && this.resumable.progress() < 1
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'files' (files) {
|
||||
this.visible = true
|
||||
@@ -132,11 +137,6 @@ export default {
|
||||
file.file.uploadingError = true
|
||||
})
|
||||
},
|
||||
computed: {
|
||||
activeUploads() {
|
||||
return this.resumable.files.length && this.resumable.progress() < 1
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
closeWindow() {
|
||||
if (this.activeUploads) {
|
||||
|
@@ -1,36 +1,39 @@
|
||||
<template>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">{{ user.name }}</p>
|
||||
<p class="modal-card-title">
|
||||
{{ user.name }}
|
||||
</p>
|
||||
</header>
|
||||
<section class="modal-card-body">
|
||||
<form @submit.prevent="save">
|
||||
|
||||
<div v-if="user.role == 'user' || user.role == 'admin'" class="field">
|
||||
|
||||
<b-field :label="lang('Role')">
|
||||
<b-select v-model="formFields.role" :placeholder="lang('Role')" expanded required>
|
||||
<option value="user" key="user">{{ lang('User') }}</option>
|
||||
<option value="admin" key="admin">{{ lang('Admin') }}</option>
|
||||
<option key="user" value="user">
|
||||
{{ lang('User') }}
|
||||
</option>
|
||||
<option key="admin" value="admin">
|
||||
{{ lang('Admin') }}
|
||||
</option>
|
||||
</b-select>
|
||||
</b-field>
|
||||
|
||||
<b-field :label="lang('Username')" :type="formErrors.username ? 'is-danger' : ''" :message="formErrors.username">
|
||||
<b-input v-model="formFields.username" @keydown.native="formErrors.username = ''"></b-input>
|
||||
<b-input v-model="formFields.username" @keydown.native="formErrors.username = ''" />
|
||||
</b-field>
|
||||
|
||||
<b-field :label="lang('Name')" :type="formErrors.name ? 'is-danger' : ''" :message="formErrors.name">
|
||||
<b-input v-model="formFields.name" @keydown.native="formErrors.name = ''"></b-input>
|
||||
<b-input v-model="formFields.name" @keydown.native="formErrors.name = ''" />
|
||||
</b-field>
|
||||
|
||||
<b-field :label="lang('Password')" :type="formErrors.password ? 'is-danger' : ''" :message="formErrors.password">
|
||||
<b-input v-model="formFields.password" @keydown.native="formErrors.password = ''" :placeholder="action == 'edit' ? lang('Leave blank for no change') : ''" password-reveal></b-input>
|
||||
<b-input v-model="formFields.password" :placeholder="action == 'edit' ? lang('Leave blank for no change') : ''" password-reveal @keydown.native="formErrors.password = ''" />
|
||||
</b-field>
|
||||
|
||||
</div>
|
||||
|
||||
<b-field :label="lang('Homedir')" :type="formErrors.homedir ? 'is-danger' : ''" :message="formErrors.homedir">
|
||||
<b-input v-model="formFields.homedir" @focus="selectDir"></b-input>
|
||||
<b-input v-model="formFields.homedir" @focus="selectDir" />
|
||||
</b-field>
|
||||
|
||||
<b-field :label="lang('Permissions')">
|
||||
@@ -55,12 +58,15 @@
|
||||
</b-checkbox>
|
||||
</div>
|
||||
</b-field>
|
||||
|
||||
</form>
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<button class="button" type="button" @click="$parent.close()">{{ lang('Close') }}</button>
|
||||
<button class="button is-primary" type="button" @click="confirmSave">{{ lang('Save') }}</button>
|
||||
<button class="button" type="button" @click="$parent.close()">
|
||||
{{ lang('Close') }}
|
||||
</button>
|
||||
<button class="button is-primary" type="button" @click="confirmSave">
|
||||
{{ lang('Save') }}
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
</template>
|
||||
@@ -73,8 +79,6 @@ import _ from 'lodash'
|
||||
export default {
|
||||
name: 'UserEdit',
|
||||
props: [ 'user', 'action' ],
|
||||
computed: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formFields: {
|
||||
@@ -95,6 +99,8 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
'permissions.read' (val) {
|
||||
if (!val) {
|
||||
|
Reference in New Issue
Block a user