🐛 Fix corrupt zip and remove project download on server

This commit is contained in:
brunosimon
2017-12-25 17:49:53 +01:00
parent 3d93205750
commit 2620b00ffe
23 changed files with 148 additions and 60 deletions
@@ -19,6 +19,11 @@ export default
computed:
{
serverConfig()
{
return this.$store.state.serverConfig
},
project()
{
return this.$store.state.projects.current
+18 -14
View File
@@ -5,21 +5,25 @@
<!-- Favicon -->
<favicon></favicon>
<!-- Header -->
<a class="application-header" href="#" @click.prevent="onHeaderClick">
<img class="element background" src="../../../static/svg/header-background.svg" alt="">
<span class="element robot-container">
<img class="element robot" src="../../../static/svg/header-robot.svg" alt="">
</span>
<img class="element title" src="../../../static/svg/keppler-title.svg" alt="">
</a>
<div v-if="serverConfig">
<!-- Popin -->
<popin></popin>
<!-- Header -->
<a class="application-header" href="#" @click.prevent="onHeaderClick">
<img class="element background" src="../../../static/svg/header-background.svg" alt="">
<span class="element robot-container">
<img class="element robot" src="../../../static/svg/header-robot.svg" alt="">
</span>
<img class="element title" src="../../../static/svg/keppler-title.svg" alt="">
</a>
<!-- Projects -->
<projects-hub></projects-hub>
<!-- Popin -->
<popin></popin>
<!-- Project -->
<project v-if="project"></project>
<!-- Projects -->
<projects-hub></projects-hub>
<!-- Project -->
<project v-if="project"></project>
</div>
</div>
+6 -2
View File
@@ -40,14 +40,18 @@ export default
const projectsUrl = `${process.env.NODE_ENV === 'production' ? '' : 'http://localhost:1571'}/projects`
this.projectsSocket = socketIoClient(projectsUrl)
this.projectsSocket.on('connect', () =>
this.projectsSocket.on('connect', (data) =>
{
// console.log('projects connected')
})
this.projectsSocket.on('config', (data) =>
{
this.$store.commit('updateServerConfig', data)
})
this.projectsSocket.on('update_projects', (data) =>
{
this.$store.commit('updateUrl', data.domain)
this.$store.commit('updateProjects', data.all)
})
},
+1 -1
View File
@@ -20,7 +20,7 @@ export default
{
downloadUrl()
{
return `${this.$store.state.url}/${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}`
},
downloadDataUri()
+1 -1
View File
@@ -30,7 +30,7 @@ export default
quote: () => quotes[Math.floor(quotes.length * Math.random())],
url()
{
return this.$store.state.url
return this.$store.state.serverConfig.domain
}
},
+1 -1
View File
@@ -21,7 +21,7 @@ export default
{
downloadUrl()
{
return `${this.$store.state.url}/${this.project.slug}/download`
return `${this.$store.state.serverConfig.domain}/${this.project.slug}/download`
},
project()
+6 -1
View File
@@ -11,6 +11,11 @@ export default
computed:
{
serverConfig()
{
return this.$store.state.serverConfig
},
projects()
{
return this.$store.state.projects.all
@@ -34,7 +39,7 @@ export default
return ''
}
return `${this.$store.state.url}/${this.currentProject.slug}/download`
return `${this.$store.state.serverConfig.domain}/${this.currentProject.slug}/download`
}
},
@@ -18,7 +18,7 @@
</div>
</div>
<a class="download" :href="downloadUrl" download>
<a v-if="!serverConfig.server" class="download" :href="downloadUrl" download="test.zip">
<img class="icon default" src="../../../static/svg/download.svg" alt="">
<img class="icon hover" src="../../../static/svg/download-hover.svg" alt="">
<tooltip position="right">Download the whole project</tooltip>
+3 -3
View File
@@ -17,15 +17,15 @@ export default new Vuex.Store({
state:
{
url: '',
serverConfig: null,
scrollbarWidth: 0
},
mutations:
{
updateUrl(state, data)
updateServerConfig(state, data)
{
state.url = data
state.serverConfig = data
},
updateScrollbarWidth(state, data)