Merge pull request #3440 from devsnd/fileman-improvements2

fileman: improve showing files in browser, was truncated before
pull/3450/head
thyttan 2024-06-10 00:32:06 +02:00 committed by GitHub
commit 81b860215b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 24 additions and 1 deletions

View File

@ -26,6 +26,25 @@
</tr>
</tbody>
</table>
<div v-if="fileContents">
<div class="modal active" id="modal-id">
<div class="modal-container" style="max-height: 95vh;">
<div class="modal-header">
<div class="modal-title h5">File Contents</div>
</div>
<div class="modal-body">
<div class="content">
<pre><code>
{{fileContents}}
</code></pre>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" v-on:click="hideFile()">Done</button>
</div>
</div>
</div>
</div>
</div>
<script>
@ -35,6 +54,7 @@
files: ['Click load files to see something'],
fileFilter: '',
stats: [['No stats', 'loaded']],
fileContents: null,
},
computed: {
filteredFiles: function () {
@ -68,8 +88,11 @@
},
showFile: function (file) {
Puck.eval(`require("Storage").read("${file}")`, (contents) => {
alert(contents);
this.fileContents = contents;
})
},
hideFile: function () {
this.fileContents = null;
}
}
})