Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Commit

Permalink
Update download page component
Browse files Browse the repository at this point in the history
Now shows loading message and links to new breakdown page
  • Loading branch information
mdcfe committed Jun 18, 2019
1 parent 84d5f66 commit 5c04b45
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions vue-dlpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ const DownloadPage = {
<section>
<h2>Download EssentialsX</h2>
<p class="tip">
Not sure what the different jars do? See the <a href="http://wiki.mc-ess.net/wiki/Breakdown">breakdown page</a>.
Not sure what the different jars do? See the <a href="/#/Downloading-EssentialsX">downloads guide</a>.
</p>
<p v-if="buildNo">The latest version of EssentialsX is <b>{{build}}</b>.</p>
<p v-if="failed" class="warning">
Could not retrieve information about the latest version.
Click <a href="https://ci.ender.zone/job/EssentialsX">here</a> to view builds on Jenkins.
</p>
<p v-if="loading"><i>Currently loading downloads, please wait...</i></p>
<p v-if="buildNo">The latest version of EssentialsX is <b>{{build}}</b>.</p>
<table v-if="buildNo">
<tr>
<th>Plugin</th>
Expand All @@ -20,13 +21,14 @@ const DownloadPage = {
<td><a :href="plugin.main">Download</a> <a v-if="plugin.mirror" :href="plugin.mirror">(mirror)</a></td>
</tr>
</table>
<button @click="updateInfo">Update</button>
<button v-if="!loading" @click="updateInfo">Refresh</button>
</section>
`,
data() {
return {
buildNo: null,
failed: null,
loading: null,
plugins: [],
};
},
Expand All @@ -37,6 +39,7 @@ const DownloadPage = {
},
methods: {
updateInfo() {
this.loading = true;
axios.get("lastSuccessfulBuild/api/json")
.then(response => {
this.buildNo = getVersionFromArtifact(response.data.artifacts[0].displayPath);;
Expand All @@ -48,12 +51,14 @@ const DownloadPage = {
};
});
this.failed = null;
this.loading = false;
}, error => {
if (error.response) {
this.failed = error.response.data;
} else {
this.failed = error.message;
}
this.loading = false;
}
);
}
Expand Down

0 comments on commit 5c04b45

Please sign in to comment.