This repository was archived by the owner on Oct 6, 2022. It is now read-only.
forked from mdcfe/EssentialsX-Website
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate landing page from download component
- Loading branch information
Showing
5 changed files
with
123 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const landing = { | ||
html: ` | ||
<div id="landing" class="main content markdown-body"> | ||
<p><img src="https://camo.githubusercontent.com/9ad178e5cf76a372d6aaee8bbdf13485fbc1d51b/68747470733a2f2f692e696d6775722e636f6d2f435034535a70422e706e67"></img></p> | ||
<p><i>This is not an official EssentialsX site.</i></p> | ||
<section> | ||
<a class="big wiki" href="#/_Sidebar">Visit wiki</a> | ||
<a class="big download" href="#" @click="toggleDownloads"> | ||
<span v-if="showDownloads">Hide downloads</span> | ||
<span v-else>Show downloads</span> | ||
</a> | ||
</section> | ||
<DownloadPage v-if="showDownloads"></DownloadPage> | ||
</div> | ||
`, | ||
component: { | ||
components: { | ||
DownloadPage, | ||
}, | ||
data() { | ||
return { | ||
showDownloads: false, | ||
}; | ||
}, | ||
methods: { | ||
toggleDownloads() { | ||
this.showDownloads = !this.showDownloads; | ||
} | ||
} | ||
}, | ||
}; | ||
|
||
window.landing = landing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,14 @@ | |
<div id="app"></div> | ||
<script src="https://unpkg.com/docute@3/dist/docute.js"></script> | ||
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | ||
|
||
<script src="https://unpkg.com/[email protected]/components/prism-groovy.js"></script> | ||
<script src="https://unpkg.com/[email protected]/components/prism-java.js"></script> | ||
<script src="docute-wikilink.js"></script> | ||
|
||
<script src="vue-dlpage.js"></script> | ||
<script src="docute-landing.js"></script> | ||
<script src="docute-wikilink.js"></script> | ||
|
||
<script src="main.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,65 @@ | ||
const component = { | ||
html: ` | ||
<transition name="fadein"> | ||
<div id="landing" class="main content markdown-body"> | ||
<p><img src="https://camo.githubusercontent.com/9ad178e5cf76a372d6aaee8bbdf13485fbc1d51b/68747470733a2f2f692e696d6775722e636f6d2f435034535a70422e706e67"></img></p> | ||
<p><i>This is not an official EssentialsX site.</i></p> | ||
const DownloadPage = { | ||
template: ` | ||
<section> | ||
<h2>Download EssentialsX</h2> | ||
<section> | ||
<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.</p> | ||
<table v-if="buildNo"> | ||
<tr> | ||
<th>Plugin</th> | ||
<th>Main</th> | ||
<th>Mirror</th> | ||
</tr> | ||
<tr v-for="plugin in plugins" :key="plugin.name"> | ||
<td>{{ plugin.name }}</td> | ||
<td><a :href="plugin.main">Download</a></td> | ||
<td><a :href="plugin.mirror">Download</a></td> | ||
</tr> | ||
</table> | ||
<button @click="updateInfo">Update</button> | ||
</section> | ||
<h2>Help for EssentialsX</h2> | ||
<section> | ||
<router-link to="/Home">Go to EssentialsX Wiki</router-link> | ||
</section> | ||
</div> | ||
</transition> | ||
<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 visit the build server. | ||
</p> | ||
<table v-if="buildNo"> | ||
<tr> | ||
<th>Plugin</th> | ||
<th>Main</th> | ||
<th>Mirror</th> | ||
</tr> | ||
<tr v-for="plugin in plugins" :key="plugin.name"> | ||
<td>{{ plugin.name }}</td> | ||
<td><a :href="plugin.main">Download</a></td> | ||
<td><a :href="plugin.mirror">Download</a></td> | ||
</tr> | ||
</table> | ||
<button @click="updateInfo">Update</button> | ||
</section> | ||
`, | ||
component: { | ||
data() { | ||
return { | ||
buildNo: null, | ||
failed: null, | ||
plugins: [], | ||
}; | ||
}, | ||
computed: { | ||
build() { | ||
return this.buildNo ? `b${this.buildNo}` : "unknown"; | ||
}, | ||
data() { | ||
return { | ||
buildNo: null, | ||
failed: null, | ||
plugins: [], | ||
}; | ||
}, | ||
computed: { | ||
build() { | ||
return this.buildNo ? `b${this.buildNo}` : "unknown"; | ||
}, | ||
methods: { | ||
updateInfo() { | ||
axios.get("lastSuccessfulBuild/api/json") | ||
.then(response => { | ||
this.buildNo = response.data.id; | ||
this.plugins = response.data.artifacts.map(artifact => { | ||
return { | ||
name: `EssentialsX ${artifact.displayPath.match(/EssentialsX([A-Za-z]*)/)[1]}`, | ||
main: `${mainCI}lastSuccessfulBuild/artifact/${artifact.relativePath}`, | ||
mirror: `${mirrorCI}lastSuccessfulBuild/artifact/${artifact.relativePath}`, | ||
}; | ||
}); | ||
this.failed = null; | ||
}, error => { | ||
if (error.response) { | ||
this.failed = error.response.data; | ||
} else { | ||
this.failed = error.message; | ||
} | ||
}, | ||
methods: { | ||
updateInfo() { | ||
axios.get("lastSuccessfulBuild/api/json") | ||
.then(response => { | ||
this.buildNo = response.data.id; | ||
this.plugins = response.data.artifacts.map(artifact => { | ||
return { | ||
name: `EssentialsX ${artifact.displayPath.match(/EssentialsX([A-Za-z]*)/)[1]}`, | ||
main: `${mainCI}lastSuccessfulBuild/artifact/${artifact.relativePath}`, | ||
mirror: `${mirrorCI}lastSuccessfulBuild/artifact/${artifact.relativePath}`, | ||
}; | ||
}); | ||
this.failed = null; | ||
}, error => { | ||
if (error.response) { | ||
this.failed = error.response.data; | ||
} else { | ||
this.failed = error.message; | ||
} | ||
); | ||
} | ||
}, | ||
mounted: function () { | ||
this.updateInfo(); | ||
} | ||
); | ||
} | ||
}, | ||
mounted: function () { | ||
this.updateInfo(); | ||
} | ||
}; | ||
|
||
window.dlPage = component; | ||
window.DownloadPage = DownloadPage; |