chore: update buefy to 0.9

This commit is contained in:
Zephyrrus 2020-11-12 22:58:34 +02:00
parent 443e63d05a
commit 4a3fef2b99
4 changed files with 123 additions and 121 deletions

2
TODO
View File

@ -9,5 +9,3 @@
- Add an stats page that displays statistics about the server like free space, free/used memory, etc
- Add statistics of total disk space used by a specific user (?)
- Page that lists all files ordered by size, useful to find big files
- Admins should be able to add custom URLs to their albums, as long as it's not conflicting with another id

View File

@ -5,46 +5,49 @@
<b-table
:data="details.links || []"
:mobile-cards="true">
<template slot-scope="props">
<b-table-column
field="identifier"
label="Link"
centered>
<a
:href="`${config.URL}/a/${props.row.identifier}`"
target="_blank">
{{ props.row.identifier }}
</a>
</b-table-column>
<b-table-column
v-slot="props"
field="identifier"
label="Link"
centered>
<a
:href="`${config.URL}/a/${props.row.identifier}`"
target="_blank">
{{ props.row.identifier }}
</a>
</b-table-column>
<b-table-column
field="views"
label="Views"
centered>
{{ props.row.views }}
</b-table-column>
<b-table-column
v-slot="props"
field="views"
label="Views"
centered>
{{ props.row.views }}
</b-table-column>
<b-table-column
field="enableDownload"
label="Allow download"
centered>
<b-switch
v-model="props.row.enableDownload"
@input="updateLinkOptions(albumId, props.row)" />
</b-table-column>
<b-table-column
v-slot="props"
field="enableDownload"
label="Allow download"
centered>
<b-switch
v-model="props.row.enableDownload"
@input="updateLinkOptions(albumId, props.row)" />
</b-table-column>
<b-table-column
v-slot="props"
field="enabled"
numeric>
<button
:class="{ 'is-loading': isDeleting(props.row.identifier) }"
class="button is-danger"
:disabled="isDeleting(props.row.identifier)"
@click="promptDeleteAlbumLink(albumId, props.row.identifier)">
Delete link
</button>
</b-table-column>
<b-table-column
field="enabled"
numeric>
<button
:class="{ 'is-loading': isDeleting(props.row.identifier) }"
class="button is-danger"
:disabled="isDeleting(props.row.identifier)"
@click="promptDeleteAlbumLink(albumId, props.row.identifier)">
Delete link
</button>
</b-table-column>
</template>
<template slot="empty">
<div class="has-text-centered">
<i class="icon-misc-mood-sad" />

View File

@ -92,48 +92,45 @@
</template>
<div v-else>
<b-table :data="gridFiles || []" :mobile-cards="true">
<template slot-scope="props">
<template v-if="!props.row.hideFromList">
<b-table-column field="url" label="URL">
<a :href="props.row.url" target="_blank">{{ props.row.url }}</a>
</b-table-column>
<b-table-column v-slot="props" field="url" label="URL">
<a :href="props.row.url" target="_blank">{{ props.row.url }}</a>
</b-table-column>
<b-table-column field="albums" label="Albums" centered>
<template v-for="(album, index) in props.row.albums">
<nuxt-link :key="index" :to="`/dashboard/albums/${album.id}`">
{{ album.name }}
</nuxt-link>
<template v-if="index < props.row.albums.length - 1">
,
</template>
</template>
{{ props.row.username }}
</b-table-column>
<b-table-column field="uploaded" label="Uploaded" centered>
<span><timeago :since="props.row.createdAt" /></span>
</b-table-column>
<b-table-column field="purge" centered>
<b-tooltip label="Edit" position="is-top">
<a class="btn" @click="handleFileModal(props.row)">
<i class="mdi mdi-pencil" />
</a>
</b-tooltip>
<b-tooltip label="Delete" position="is-top" class="is-danger">
<a class="is-danger" @click="deleteFile(props.row)">
<i class="mdi mdi-delete" />
</a>
</b-tooltip>
<b-tooltip v-if="user && user.isAdmin" label="More info" position="is-top" class="more">
<nuxt-link :to="`/dashboard/admin/file/${props.row.id}`">
<i class="mdi mdi-dots-horizontal" />
</nuxt-link>
</b-tooltip>
</b-table-column>
<b-table-column v-slot="props" field="albums" label="Albums" centered>
<template v-for="(album, index) in props.row.albums">
<nuxt-link :key="index" :to="`/dashboard/albums/${album.id}`">
{{ album.name }}
</nuxt-link>
<template v-if="index < props.row.albums.length - 1">
,
</template>
</template>
</template>
{{ props.row.username }}
</b-table-column>
<b-table-column v-slot="props" field="uploaded" label="Uploaded" centered>
<span><timeago :since="props.row.createdAt" /></span>
</b-table-column>
<b-table-column v-slot="props" field="purge" centered>
<b-tooltip label="Edit" position="is-top">
<a class="btn" @click="handleFileModal(props.row)">
<i class="mdi mdi-pencil" />
</a>
</b-tooltip>
<b-tooltip label="Delete" position="is-top" class="is-danger">
<a class="is-danger" @click="deleteFile(props.row)">
<i class="mdi mdi-delete" />
</a>
</b-tooltip>
<b-tooltip v-if="user && user.isAdmin" label="More info" position="is-top" class="more">
<nuxt-link :to="`/dashboard/admin/file/${props.row.id}`">
<i class="mdi mdi-dots-horizontal" />
</nuxt-link>
</b-tooltip>
</b-table-column>
<template slot="empty">
<div class="has-text-centered">
<i class="icon-misc-mood-sad" />
@ -226,7 +223,7 @@ export default {
return require('@/assets/images/blank.png');
},
gridFiles() {
return this.files;
return (this.files || []).filter((v) => !v.hideFromList);
},
},
created() {

View File

@ -15,51 +15,55 @@
<b-table
:data="users"
:mobile-cards="true">
<template slot-scope="props">
<b-table-column
field="id"
label="Id"
centered>
{{ props.row.id }}
</b-table-column>
<b-table-column
v-slot="props"
field="id"
label="Id"
centered>
{{ props.row.id }}
</b-table-column>
<b-table-column
field="username"
label="Username"
centered>
<nuxt-link :to="`/dashboard/admin/user/${props.row.id}`">
{{ props.row.username }}
</nuxt-link>
</b-table-column>
<b-table-column
v-slot="props"
field="username"
label="Username"
centered>
<nuxt-link :to="`/dashboard/admin/user/${props.row.id}`">
{{ props.row.username }}
</nuxt-link>
</b-table-column>
<b-table-column
field="enabled"
label="Enabled"
centered>
<b-switch
:value="props.row.enabled"
@input="changeEnabledStatus(props.row)" />
</b-table-column>
<b-table-column
v-slot="props"
field="enabled"
label="Enabled"
centered>
<b-switch
:value="props.row.enabled"
@input="changeEnabledStatus(props.row)" />
</b-table-column>
<b-table-column
field="isAdmin"
label="Admin"
centered>
<b-switch
:value="props.row.isAdmin"
@input="changeIsAdmin(props.row)" />
</b-table-column>
<b-table-column
v-slot="props"
field="isAdmin"
label="Admin"
centered>
<b-switch
:value="props.row.isAdmin"
@input="changeIsAdmin(props.row)" />
</b-table-column>
<b-table-column
v-slot="props"
field="purge"
centered>
<b-button
type="is-danger"
@click="promptPurgeFiles(props.row)">
Purge files
</b-button>
</b-table-column>
<b-table-column
field="purge"
centered>
<b-button
type="is-danger"
@click="promptPurgeFiles(props.row)">
Purge files
</b-button>
</b-table-column>
</template>
<template slot="empty">
<div class="has-text-centered">
<i class="icon-misc-mood-sad" />