fix browse, rename and preview

This commit is contained in:
jb-alvarado 2022-07-03 21:23:34 +02:00
parent d758062ff4
commit 1be302c295
4 changed files with 31 additions and 38 deletions

2
.gitignore vendored
View File

@ -94,3 +94,5 @@ sw.*
master.m3u8 master.m3u8
tv-media tv-media
tv-media/ tv-media/
Videos
Videos/

View File

@ -7,7 +7,8 @@ export default {
*/ */
head: { head: {
title: process.env.npm_package_name || '', title: process.env.npm_package_name || '',
meta: [{ meta: [
{
charset: 'utf-8' charset: 'utf-8'
}, },
{ {
@ -20,11 +21,13 @@ export default {
content: process.env.npm_package_description || '' content: process.env.npm_package_description || ''
} }
], ],
link: [{ link: [
rel: 'icon', {
type: 'image/x-icon', rel: 'icon',
href: '/favicon.ico' type: 'image/x-icon',
}] href: '/favicon.ico'
}
]
}, },
/* /*
** Customize the progress-bar color ** Customize the progress-bar color
@ -35,9 +38,7 @@ export default {
/* /*
** Global CSS ** Global CSS
*/ */
css: [ css: ['@/assets/css/bootstrap.min.css'],
'@/assets/css/bootstrap.min.css'
],
/* /*
** Plugins to load before mounting the App ** Plugins to load before mounting the App
*/ */
@ -85,17 +86,11 @@ export default {
locales: ['en', 'de'], locales: ['en', 'de'],
defaultLocale: 'en', defaultLocale: 'en',
defaultTimeZone: 'Europe/Berlin', defaultTimeZone: 'Europe/Berlin',
plugins: [ plugins: ['utc', 'timezone']
'utc',
'timezone'
]
}, },
styleResources: { styleResources: {
scss: [ scss: ['@/assets/css/_variables.scss', '@/assets/scss/globals.scss']
'@/assets/css/_variables.scss',
'@/assets/scss/globals.scss'
]
}, },
bootstrapVue: { bootstrapVue: {
@ -110,14 +105,14 @@ export default {
/* /*
** You can extend webpack config here ** You can extend webpack config here
*/ */
extend(config, ctx) {}, extend (config, ctx) {},
babel: { compact: true }, babel: { compact: true },
loaders: { loaders: {
sass: { sass: {
implementation: require('sass'), implementation: require('sass')
}, },
scss: { scss: {
implementation: require('sass'), implementation: require('sass')
} }
} }
} }

View File

@ -82,7 +82,7 @@
{{ file }} {{ file }}
</b-col> </b-col>
<b-col cols="1" class="browser-play-col"> <b-col cols="1" class="browser-play-col">
<b-link title="Preview" @click="showPreviewModal(`/${folderTree.source}/${file}`)"> <b-link title="Preview" @click="showPreviewModal(`/${folderTree.parent}/${folderTree.source}/${file}`)">
<b-icon-play-fill /> <b-icon-play-fill />
</b-link> </b-link>
</b-col> </b-col>
@ -90,12 +90,12 @@
<span class="duration">{{ file.duration | toMin }}</span> <span class="duration">{{ file.duration | toMin }}</span>
</b-col> </b-col>
<b-col cols="1" class="small-col"> <b-col cols="1" class="small-col">
<b-link title="Rename File" @click="showRenameModal(`/${folderTree.source}/`, file)"> <b-link title="Rename File" @click="showRenameModal(file)">
<b-icon-pencil-square /> <b-icon-pencil-square />
</b-link> </b-link>
</b-col> </b-col>
<b-col cols="1" class="small-col"> <b-col cols="1" class="small-col">
<b-link title="Delete File" @click="showDeleteModal('File', `/${folderTree.source}/${file}`)"> <b-link title="Delete File" @click="showDeleteModal('File', `/${folderTree.parent}/${folderTree.source}/${file}`)">
<b-icon-x-circle-fill /> <b-icon-x-circle-fill />
</b-link> </b-link>
</b-col> </b-col>
@ -468,8 +468,7 @@ export default {
this.$root.$emit('bv::show::modal', 'preview-modal') this.$root.$emit('bv::show::modal', 'preview-modal')
}, },
showRenameModal (path, file) { showRenameModal (file) {
this.renamePath = path
this.renameOldName = file this.renameOldName = file
this.renameNewName = file this.renameNewName = file
this.$root.$emit('bv::show::modal', 'rename-modal') this.$root.$emit('bv::show::modal', 'rename-modal')
@ -478,12 +477,10 @@ export default {
async renameFile (evt) { async renameFile (evt) {
evt.preventDefault() evt.preventDefault()
await this.$axios.patch( await this.$axios.post(
'api/player/media/op/', { `api/file/${this.configGui[this.configID].id}/rename/`, {
path: this.renamePath.replace(/^\/\//g, '/'), source: `/${this.folderTree.parent}/${this.folderTree.source}/${this.renameOldName}`.replace('//', '/'),
oldname: this.renameOldName, target: `/${this.folderTree.parent}/${this.folderTree.source}/${this.renameNewName}`.replace('//', '/')
newname: this.renameNewName,
channel: this.configGui[this.configID].id
} }
) )

View File

@ -25,21 +25,20 @@ export const actions = {
`api/file/${channel}/browse/`, { source: path }) `api/file/${channel}/browse/`, { source: path })
if (response.data) { if (response.data) {
console.log(response.data) const pathStr = 'Home/' + response.data.source
const pathArr = response.data.source.split('/') const pathArr = pathStr.split('/')
console.log(pathArr)
console.log('path', path)
if (path) { if (path) {
for (const crumb of pathArr) { for (const crumb of pathArr) {
if (crumb) { if (crumb === 'Home') {
crumbs.push({ text: crumb, path: root })
} else if (crumb) {
root += crumb + '/' root += crumb + '/'
crumbs.push({ text: crumb, path: root }) crumbs.push({ text: crumb, path: root })
} }
} }
} else { } else {
crumbs.push({ text: pathArr[0], path: '' }) crumbs.push({ text: 'Home', path: '' })
} }
commit('UPDATE_CURRENT_PATH', path) commit('UPDATE_CURRENT_PATH', path)