🎨 Site > Improve URL
This commit is contained in:
@@ -47,6 +47,7 @@ export default
|
||||
|
||||
this.projectsSocket.on('update_projects', (data) =>
|
||||
{
|
||||
this.$store.commit('updateUrl', data.domain)
|
||||
this.$store.commit('updateProjects', data.all)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -13,9 +13,9 @@ export default
|
||||
|
||||
computed:
|
||||
{
|
||||
project()
|
||||
downloadUrl()
|
||||
{
|
||||
return this.$store.state.projects.current
|
||||
return `${this.$store.state.url}/${this.$store.state.projects.current.slug}/files/${this.content.path.full}`
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<header>
|
||||
<a href="#" @click.prevent="onDifferencesClick">Differences <span v-if="differencesActive">(on)</span></a>
|
||||
<a href="#" @click.prevent="onVersionsClick">Versions <span v-if="versionsActive">(on)</span></a>
|
||||
<a :href="`${project.slug}/files/${content.path.full}`" download>Download</a>
|
||||
<a :href="downloadUrl" download>Download</a>
|
||||
{{ content.path.directory }} {{ content.name }}
|
||||
</header>
|
||||
<versions :file="content" :content="content.versions" v-if="versionsActive"></versions>
|
||||
|
||||
@@ -19,6 +19,11 @@ export default
|
||||
|
||||
computed:
|
||||
{
|
||||
downloadUrl()
|
||||
{
|
||||
return `${this.$store.state.url}/${this.project.slug}/download`
|
||||
},
|
||||
|
||||
project()
|
||||
{
|
||||
return this.$store.state.projects.current
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div>
|
||||
{{ project.name }}
|
||||
<a :href="`${project.slug}/download`" download>Download</a>
|
||||
<a :href="downloadUrl" download>Download</a>
|
||||
|
||||
<files-tree></files-tree>
|
||||
<file v-if="file" :content="file"></file>
|
||||
|
||||
@@ -13,5 +13,18 @@ export default new Vuex.Store({
|
||||
chat: chatModule,
|
||||
projects: projectsModule,
|
||||
files: filesModule
|
||||
},
|
||||
|
||||
state:
|
||||
{
|
||||
url: ''
|
||||
},
|
||||
|
||||
mutations:
|
||||
{
|
||||
updateUrl(state, data)
|
||||
{
|
||||
state.url = data
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user