Fix version creation, remove obsolete download counters, dep fix (#357)
This commit is contained in:
parent
b8b942cdae
commit
de0e30de57
@ -332,12 +332,6 @@
|
|||||||
:href="findPrimary(version).url"
|
:href="findPrimary(version).url"
|
||||||
class="download"
|
class="download"
|
||||||
:title="`Download ${version.name}`"
|
:title="`Download ${version.name}`"
|
||||||
@click.prevent="
|
|
||||||
downloadFile(
|
|
||||||
findPrimary(version).hashes.sha1,
|
|
||||||
findPrimary(version).url
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<DownloadIcon aria-hidden="true" />
|
<DownloadIcon aria-hidden="true" />
|
||||||
</a>
|
</a>
|
||||||
@ -419,7 +413,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="key">Project ID</div>
|
<div class="key">Project ID</div>
|
||||||
<div class="value">
|
<div class="value lowercase">
|
||||||
{{ project.id }}
|
{{ project.id }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -679,14 +673,6 @@ export default {
|
|||||||
|
|
||||||
return file
|
return file
|
||||||
},
|
},
|
||||||
async downloadFile(hash, url) {
|
|
||||||
await this.$axios.get(`version_file/${hash}/download`)
|
|
||||||
|
|
||||||
const elem = document.createElement('a')
|
|
||||||
elem.download = hash
|
|
||||||
elem.href = url
|
|
||||||
elem.click()
|
|
||||||
},
|
|
||||||
async clearMessage() {
|
async clearMessage() {
|
||||||
this.$nuxt.$loading.start()
|
this.$nuxt.$loading.start()
|
||||||
|
|
||||||
@ -987,6 +973,10 @@ export default {
|
|||||||
.value {
|
.value {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
|
|
||||||
|
&.lowercase {
|
||||||
|
text-transform: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.uppercase {
|
.uppercase {
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
|
|||||||
@ -86,9 +86,6 @@
|
|||||||
:href="primaryFile.url"
|
:href="primaryFile.url"
|
||||||
class="action iconified-button brand-button-colors"
|
class="action iconified-button brand-button-colors"
|
||||||
:title="`Download ${primaryFile.filename}`"
|
:title="`Download ${primaryFile.filename}`"
|
||||||
@click.prevent="
|
|
||||||
$parent.downloadFile(primaryFile.hashes.sha1, primaryFile.url)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<DownloadIcon aria-hidden="true" />
|
<DownloadIcon aria-hidden="true" />
|
||||||
Download
|
Download
|
||||||
@ -353,6 +350,9 @@
|
|||||||
Version {{ dependency.version.version_number }} is
|
Version {{ dependency.version.version_number }} is
|
||||||
{{ dependency.dependency_type }}
|
{{ dependency.dependency_type }}
|
||||||
</p>
|
</p>
|
||||||
|
<p v-else>
|
||||||
|
{{ dependency.dependency_type }}
|
||||||
|
</p>
|
||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<button
|
<button
|
||||||
@ -417,10 +417,10 @@
|
|||||||
Primary
|
Primary
|
||||||
</div>
|
</div>
|
||||||
<a
|
<a
|
||||||
|
:href="file.url"
|
||||||
class="action iconified-button"
|
class="action iconified-button"
|
||||||
:title="`Download ${file.filename}`"
|
:title="`Download ${file.filename}`"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
@click.prevent="$parent.downloadFile(file.hashes.sha1, file.url)"
|
|
||||||
>
|
>
|
||||||
<DownloadIcon aria-hidden="true" />
|
<DownloadIcon aria-hidden="true" />
|
||||||
Download
|
Download
|
||||||
@ -822,12 +822,16 @@ export default {
|
|||||||
})
|
})
|
||||||
).data
|
).data
|
||||||
|
|
||||||
this.$emit('update:project', this.versions.concat([data]))
|
const newProject = JSON.parse(JSON.stringify(this.project))
|
||||||
|
newProject.versions = newProject.versions.concat([data])
|
||||||
|
|
||||||
|
await this.$emit('update:project', newProject)
|
||||||
|
await this.$emit('update:versions', this.versions.concat([data]))
|
||||||
|
|
||||||
await this.$router.push(
|
await this.$router.push(
|
||||||
`/${this.project.project_type}/${
|
`/${this.project.project_type}/${
|
||||||
this.project.slug ? this.project.slug : data.project_id
|
this.project.slug ? this.project.slug : this.project.project_id
|
||||||
}/version/${encodeURIComponent(data.version_number)}`
|
}/version/${encodeURIComponent(this.version.version_number)}`
|
||||||
)
|
)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.$notify({
|
this.$notify({
|
||||||
@ -942,12 +946,16 @@ section {
|
|||||||
.dependencies {
|
.dependencies {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
column-gap: 2rem;
|
||||||
|
row-gap: 1rem;
|
||||||
|
|
||||||
.dependency {
|
.dependency {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-basis: 33.333333%;
|
|
||||||
margin-bottom: 0.5rem;
|
@media screen and (min-width: 800px) {
|
||||||
|
flex-basis: 30%;
|
||||||
|
}
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
width: 3rem;
|
width: 3rem;
|
||||||
|
|||||||
@ -24,12 +24,6 @@
|
|||||||
:href="$parent.findPrimary(version).url"
|
:href="$parent.findPrimary(version).url"
|
||||||
class="download-button"
|
class="download-button"
|
||||||
:title="`Download ${version.name}`"
|
:title="`Download ${version.name}`"
|
||||||
@click.prevent="
|
|
||||||
$parent.downloadFile(
|
|
||||||
$parent.findPrimary(version).hashes.sha1,
|
|
||||||
$parent.findPrimary(version).url
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<DownloadIcon aria-hidden="true" />
|
<DownloadIcon aria-hidden="true" />
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user