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: computed:
{ {
serverConfig()
{
return this.$store.state.serverConfig
},
downloadUrl() downloadUrl()
{ {
return `${this.$store.state.serverConfig.domain}/${this.$store.state.projects.current.slug}/files/${this.content.path.full}` 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 / Code -->
<viewer :differences-active="differencesActive" v-if="isCode"></viewer> <viewer :differences-active="differencesActive" v-if="isCode"></viewer>
<!-- Preview --> <!-- Preview image no server -->
<div class="preview" v-if="isImage"> <div class="preview" v-if="isImage && !serverConfig.server">
<div class="inner"> <a :href="downloadUrl" class="inner" download>
<!-- <img :src="downloadUrl"> --> <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>
</div> </div>
@@ -18,7 +26,9 @@
<illustration name="sad-robot"></illustration> <illustration name="sad-robot"></illustration>
<div class="text"> <div class="text">
Sorry, I can't read this file. 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>
</div> </div>