Modify upload function to accept only yml files on folder upload. Adding breadcrumbs, adding feature to create folder
This commit is contained in:
parent
fe715360a5
commit
16c4455d8d
@ -11,6 +11,19 @@
|
|||||||
<span>{{ $t("sidebar.myFiles") }}</span>
|
<span>{{ $t("sidebar.myFiles") }}</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
|
<div v-if="user.perm.create">
|
||||||
|
<button
|
||||||
|
@click="$store.commit('showHover', 'newDir')"
|
||||||
|
class="action"
|
||||||
|
:aria-label="$t('sidebar.newFolder')"
|
||||||
|
:title="$t('sidebar.newFolder')"
|
||||||
|
>
|
||||||
|
<i class="material-icons">create_new_folder</i>
|
||||||
|
<span>{{ $t("sidebar.newFolder") }}</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div v-if="user.perm.create">
|
<div v-if="user.perm.create">
|
||||||
<button
|
<button
|
||||||
@click="$store.commit('showHover', 'newFile')"
|
@click="$store.commit('showHover', 'newFile')"
|
||||||
|
|||||||
@ -112,7 +112,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-top: 64px;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#listing.list .item {
|
#listing.list .item {
|
||||||
|
|||||||
@ -101,10 +101,15 @@ export function scanFiles(dt) {
|
|||||||
|
|
||||||
export function handleFiles(files, base, overwrite = false) {
|
export function handleFiles(files, base, overwrite = false) {
|
||||||
for (let i = 0; i < files.length; i++) {
|
for (let i = 0; i < files.length; i++) {
|
||||||
|
|
||||||
let id = store.state.upload.id;
|
let id = store.state.upload.id;
|
||||||
let path = base;
|
let path = base;
|
||||||
let file = files[i];
|
let file = files[i];
|
||||||
|
console.log(file);
|
||||||
|
var re = /(?:\.([^.]+))?$/;
|
||||||
|
console.log(re.exec(file.name)[1]);
|
||||||
|
if (re.exec(file.name)[1] === 'yml') {
|
||||||
|
console.log('Is yml file')
|
||||||
if (file.fullPath !== undefined) {
|
if (file.fullPath !== undefined) {
|
||||||
path += url.encodePath(file.fullPath);
|
path += url.encodePath(file.fullPath);
|
||||||
} else {
|
} else {
|
||||||
@ -125,3 +130,4 @@ export function handleFiles(files, base, overwrite = false) {
|
|||||||
store.dispatch("upload/upload", item);
|
store.dispatch("upload/upload", item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<header-bar v-if="error || req.type == null" showMenu showLogo />
|
<header-bar v-if="error || req.type == null" showMenu showLogo />
|
||||||
|
<breadcrumbs base="/files" />
|
||||||
<errors v-if="error" :errorCode="error.message" />
|
<errors v-if="error" :errorCode="error.message" />
|
||||||
<component v-else-if="currentView" :is="currentView"></component>
|
<component v-else-if="currentView" :is="currentView"></component>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user