...
 
Commits (3)
......@@ -89,6 +89,10 @@ a:hover, a:focus {
transition: background-color .1s ease;
}
.el-drawer__header {
margin-bottom: 10px;
}
/* welcome and 404 page */
.container-center {
display: flex;
......
......@@ -99,7 +99,7 @@
<el-table :data="entries" style="max-width: 1280px;width: 100%" height="100%" empty-text="Folder is emtpy" :default-sort="{ prop: 'filePath', order: 'descending' }" @row-click="open">
<el-table-column prop="previewUrl" label="Type" width="100px" sortable>
<template slot-scope="scope">
<img v-bind:src="scope.row.previewUrl" class="list-icon" height="32px" width="32px" style="object-fit: cover;"/>
<el-image v-bind:src="scope.row.previewUrl" class="list-icon" style="width: 32px; height: 32px" fit="cover"></el-image>
</template>
</el-table-column>
<el-table-column prop="filePath" label="Name" sortable>
......@@ -121,6 +121,18 @@
</center>
</div>
<el-drawer :title="activeEntry.filePath":with-header="false" :visible.sync="previewDrawerVisible" direction="rtl" size="50%">
<div style="display: flex; flex-direction: column; height: 100%;">
<iframe :src="activeEntry.fullPath" style="width: 100%; height: 100%; border: none; margin: 10px;"></iframe>
<center>
<el-button size="small" icon="el-icon-download" style="margin: 10px;" @click.stop="onDownload(activeEntry)">Download</el-button>
<a :href="activeEntry.fullPath" target="_blank">
<el-button size="small" icon="el-icon-link" style="margin: 10px;">Open</el-button>
</a>
</center>
</div>
</el-drawer>
</el-main>
<el-footer v-show="uploadStatus.busy">
<el-row v-if="uploadStatus.uploadListCount">
......
......@@ -135,7 +135,7 @@ function loadDirectory(filePath) {
});
}
function open(row, event, column) {
function open(row, column, event) {
// ignore item open on row clicks if we are renaming this entry
if (row.rename) return;
......@@ -146,7 +146,11 @@ function open(row, event, column) {
return;
}
window.open(encode(path));
app.activeEntry = row;
app.activeEntry.fullPath = encode(sanitize(app.path + '/' + row.filePath));
app.previewDrawerVisible = true
// window.open(encode(path));
}
function uploadFiles(files) {
......@@ -280,6 +284,8 @@ var app = new Vue({
password: '',
busy: false
},
previewDrawerVisible: false,
activeEntry: {},
entries: [],
accessTokens: [],
accessTokensDialogVisible: false
......