fix browse, rename and preview
This commit is contained in:
parent
d758062ff4
commit
1be302c295
2
.gitignore
vendored
2
.gitignore
vendored
@ -94,3 +94,5 @@ sw.*
|
||||
master.m3u8
|
||||
tv-media
|
||||
tv-media/
|
||||
Videos
|
||||
Videos/
|
||||
|
@ -7,7 +7,8 @@ export default {
|
||||
*/
|
||||
head: {
|
||||
title: process.env.npm_package_name || '',
|
||||
meta: [{
|
||||
meta: [
|
||||
{
|
||||
charset: 'utf-8'
|
||||
},
|
||||
{
|
||||
@ -20,11 +21,13 @@ export default {
|
||||
content: process.env.npm_package_description || ''
|
||||
}
|
||||
],
|
||||
link: [{
|
||||
rel: 'icon',
|
||||
type: 'image/x-icon',
|
||||
href: '/favicon.ico'
|
||||
}]
|
||||
link: [
|
||||
{
|
||||
rel: 'icon',
|
||||
type: 'image/x-icon',
|
||||
href: '/favicon.ico'
|
||||
}
|
||||
]
|
||||
},
|
||||
/*
|
||||
** Customize the progress-bar color
|
||||
@ -35,9 +38,7 @@ export default {
|
||||
/*
|
||||
** Global CSS
|
||||
*/
|
||||
css: [
|
||||
'@/assets/css/bootstrap.min.css'
|
||||
],
|
||||
css: ['@/assets/css/bootstrap.min.css'],
|
||||
/*
|
||||
** Plugins to load before mounting the App
|
||||
*/
|
||||
@ -85,17 +86,11 @@ export default {
|
||||
locales: ['en', 'de'],
|
||||
defaultLocale: 'en',
|
||||
defaultTimeZone: 'Europe/Berlin',
|
||||
plugins: [
|
||||
'utc',
|
||||
'timezone'
|
||||
]
|
||||
plugins: ['utc', 'timezone']
|
||||
},
|
||||
|
||||
styleResources: {
|
||||
scss: [
|
||||
'@/assets/css/_variables.scss',
|
||||
'@/assets/scss/globals.scss'
|
||||
]
|
||||
scss: ['@/assets/css/_variables.scss', '@/assets/scss/globals.scss']
|
||||
},
|
||||
|
||||
bootstrapVue: {
|
||||
@ -110,14 +105,14 @@ export default {
|
||||
/*
|
||||
** You can extend webpack config here
|
||||
*/
|
||||
extend(config, ctx) {},
|
||||
extend (config, ctx) {},
|
||||
babel: { compact: true },
|
||||
loaders: {
|
||||
sass: {
|
||||
implementation: require('sass'),
|
||||
implementation: require('sass')
|
||||
},
|
||||
scss: {
|
||||
implementation: require('sass'),
|
||||
implementation: require('sass')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,7 @@
|
||||
{{ file }}
|
||||
</b-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-link>
|
||||
</b-col>
|
||||
@ -90,12 +90,12 @@
|
||||
<span class="duration">{{ file.duration | toMin }}</span>
|
||||
</b-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-link>
|
||||
</b-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-link>
|
||||
</b-col>
|
||||
@ -468,8 +468,7 @@ export default {
|
||||
this.$root.$emit('bv::show::modal', 'preview-modal')
|
||||
},
|
||||
|
||||
showRenameModal (path, file) {
|
||||
this.renamePath = path
|
||||
showRenameModal (file) {
|
||||
this.renameOldName = file
|
||||
this.renameNewName = file
|
||||
this.$root.$emit('bv::show::modal', 'rename-modal')
|
||||
@ -478,12 +477,10 @@ export default {
|
||||
async renameFile (evt) {
|
||||
evt.preventDefault()
|
||||
|
||||
await this.$axios.patch(
|
||||
'api/player/media/op/', {
|
||||
path: this.renamePath.replace(/^\/\//g, '/'),
|
||||
oldname: this.renameOldName,
|
||||
newname: this.renameNewName,
|
||||
channel: this.configGui[this.configID].id
|
||||
await this.$axios.post(
|
||||
`api/file/${this.configGui[this.configID].id}/rename/`, {
|
||||
source: `/${this.folderTree.parent}/${this.folderTree.source}/${this.renameOldName}`.replace('//', '/'),
|
||||
target: `/${this.folderTree.parent}/${this.folderTree.source}/${this.renameNewName}`.replace('//', '/')
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -25,21 +25,20 @@ export const actions = {
|
||||
`api/file/${channel}/browse/`, { source: path })
|
||||
|
||||
if (response.data) {
|
||||
console.log(response.data)
|
||||
const pathArr = response.data.source.split('/')
|
||||
|
||||
console.log(pathArr)
|
||||
console.log('path', path)
|
||||
const pathStr = 'Home/' + response.data.source
|
||||
const pathArr = pathStr.split('/')
|
||||
|
||||
if (path) {
|
||||
for (const crumb of pathArr) {
|
||||
if (crumb) {
|
||||
if (crumb === 'Home') {
|
||||
crumbs.push({ text: crumb, path: root })
|
||||
} else if (crumb) {
|
||||
root += crumb + '/'
|
||||
crumbs.push({ text: crumb, path: root })
|
||||
}
|
||||
}
|
||||
} else {
|
||||
crumbs.push({ text: pathArr[0], path: '' })
|
||||
crumbs.push({ text: 'Home', path: '' })
|
||||
}
|
||||
|
||||
commit('UPDATE_CURRENT_PATH', path)
|
||||
|
Loading…
x
Reference in New Issue
Block a user