Site > File > Add preview back and add message on server mode

This commit is contained in:
brunosimon
2017-12-25 22:16:48 +01:00
parent 8e35be2b83
commit 799d697362
2 changed files with 20 additions and 5 deletions
+5
View File
@@ -18,6 +18,11 @@ export default
computed:
{
serverConfig()
{
return this.$store.state.serverConfig
},
downloadUrl()
{
return `${this.$store.state.serverConfig.domain}/${this.$store.state.projects.current.slug}/files/${this.content.path.full}`
+15 -5
View File
@@ -6,10 +6,18 @@
<!-- Viewer / Code -->
<viewer :differences-active="differencesActive" v-if="isCode"></viewer>
<!-- Preview -->
<div class="preview" v-if="isImage">
<div class="inner">
<!-- <img :src="downloadUrl"> -->
<!-- Preview image no server -->
<div class="preview" v-if="isImage && !serverConfig.server">
<a :href="downloadUrl" class="inner" download>
<img :src="downloadUrl">
</a>
</div>
<!-- Can't read image server -->
<div class="cant-read" v-if="isImage && serverConfig.server">
<illustration name="sad-robot"></illustration>
<div class="text">
Sorry, preview isn't available in server mode
</div>
</div>
@@ -18,7 +26,9 @@
<illustration name="sad-robot"></illustration>
<div class="text">
Sorry, I can't read this file.
<!-- <br>But you can <a :href="downloadUrl" download class="download">download it</a>. -->
<div v-if="!serverConfig.server">
But you can <a :href="downloadUrl" download class="download">download it</a>.
</div>
</div>
</div>