This commit is contained in:
Telesphoreo 2022-06-23 02:29:38 -05:00
parent 845ae56573
commit 3135f86014
3 changed files with 23 additions and 10 deletions

View File

@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000"/>
<meta
name="description"
content="The official website for the minecraft server software, Scissors, which aims to patch creative mode exploits"
content="The official website for the Minecraft server software, Scissors, which aims to patch creative mode exploits"
/>
<!-- <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png"/>-->
<!--

View File

@ -4,10 +4,12 @@ import { Build, getBuilds, getJobs, Job } from "../util/Jenkins";
import "../css/DownloadPage.css"
import { Button } from "react-bootstrap";
import { Alert } from "react-bootstrap";
import { Container } from "react-bootstrap";
const DownloadPage = () => {
const [ jobs, setJobs ] = useState(new Map<Job, Build[]>())
const [ version, setVersion ] = useState("")
const [jobs, setJobs] = useState(new Map<Job, Build[]>())
const [ version, setVersion ] = useState("1.19")
useEffect(() => {
doJobs().then(value => {
})
@ -38,10 +40,20 @@ const DownloadPage = () => {
}
return (
<Fragment>
<Container fluid className="p-4">
<Alert variant="secondary">
<Alert.Heading>Scissors Downloads</Alert.Heading>
<p>
You may download builds of Scissors from here. Select the version you would like below. If the downloads page is not working, please use our <a href="https://ci.scissors.gg/job/Scissors">CI Server</a> instead.
</p>
<hr />
<p className="mb-0">
P.S. If you know React, PLEASE help us make this look better. Our code is <a href="https://github.com/AtlasMediaGroup/Scissors-Website/tree/master">here</a>.
</p>
</Alert>
<ul className={"versions"}>
{Array.from(jobs.keys()).map(value => {
return <li className={version == value.name ? "selected" : "selectable"}
return <li className={version === value.name ? "selected" : "selectable"}
onClick={onClick}>{value.name}</li>
})}
</ul>
@ -58,7 +70,7 @@ const DownloadPage = () => {
</li>
})}
</ul>
</Fragment>
</Container >
);
}

View File

@ -20,9 +20,10 @@ export type BuildChange = {
comment: string,
id: string,
}
export function getJobs(): Promise<Job[]> {
let jobs: Job[] = []
let request = axios.get(`${JENKINS_URL}/${ARTIFACT_NAME}/api/json`)
let request = axios.get(`${JENKINS_URL}/${ARTIFACT_NAME}/api/json?pretty=true`)
return new Promise((resolve, reject) => {
request.then(value => {
@ -34,14 +35,14 @@ export function getJobs(): Promise<Job[]> {
export function getBuilds(version: string): Promise<Build[]> {
let builds: Build[] = []
let request = axios.get(`${JENKINS_URL}/${ARTIFACT_NAME}/job/${version}/api/json`)
let request = axios.get(`${JENKINS_URL}/${ARTIFACT_NAME}/job/${version}/api/json?pretty=true`)
return new Promise((resolve, reject) => {
request.then(value => {
builds = value.data.builds as Build[]
let count = 0;
for (let build of builds) {
axios.get(`${JENKINS_URL}/${ARTIFACT_NAME}/job/${version}/${build.number}/api/json`).then(value1 => {
axios.get(`${JENKINS_URL}/${ARTIFACT_NAME}/job/${version}/${build.number}/api/json?pretty=true`).then(value1 => {
build.timestamp = value1.data.timestamp
let changeSet: any[] = value1.data.changeSets
if (changeSet.length > 0) {