mirror of
https://github.com/Noratrieb/cargo-bisect-rustc-service.git
synced 2026-01-16 09:05:01 +01:00
make into form
This commit is contained in:
parent
ae9f992ef8
commit
80c6b2a8a2
1 changed files with 56 additions and 38 deletions
94
index.html
94
index.html
|
|
@ -32,12 +32,16 @@
|
||||||
<body>
|
<body>
|
||||||
<h1>Bisect rustc</h1>
|
<h1>Bisect rustc</h1>
|
||||||
|
|
||||||
<textarea
|
<form name="bisect" id="bisect-form">
|
||||||
id="code"
|
<label for="code">Code</label>
|
||||||
rows="30"
|
<br />
|
||||||
cols="80"
|
<textarea
|
||||||
placeholder="// Rust code goes here..."
|
id="code"
|
||||||
>
|
rows="30"
|
||||||
|
cols="80"
|
||||||
|
placeholder="// Rust code goes here..."
|
||||||
|
name="code"
|
||||||
|
>
|
||||||
struct Struct<T>(T);
|
struct Struct<T>(T);
|
||||||
|
|
||||||
impl<T> Struct<T> {
|
impl<T> Struct<T> {
|
||||||
|
|
@ -46,25 +50,27 @@ impl<T> Struct<T> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
</textarea
|
</textarea
|
||||||
>
|
>
|
||||||
<br />
|
<br />
|
||||||
<label for="start">Start</label>
|
<label for="start">Start</label>
|
||||||
<input id="start" value="2022-01-01" />
|
<input id="start" value="2022-01-01" name="start" />
|
||||||
<label for="end">End (optional)</label>
|
|
||||||
<input id="end" value="2022-06-01" />
|
|
||||||
<label for="kind">Regression Kind</label>
|
|
||||||
<select id="kind">
|
|
||||||
<option>error</option>
|
|
||||||
<option>success</option>
|
|
||||||
<option selected="selected">ice</option>
|
|
||||||
<option>non-ice</option>
|
|
||||||
<option>non-error</option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<br />
|
<label for="end">End (optional)</label>
|
||||||
<br />
|
<input id="end" value="2022-06-01" name="end" />
|
||||||
|
|
||||||
<button class="bisect-btn" onclick="bisect()">Bisect!</button>
|
<label for="kind">Regression Kind</label>
|
||||||
|
<select id="kind" name="select">
|
||||||
|
<option>error</option>
|
||||||
|
<option>success</option>
|
||||||
|
<option selected="selected">ice</option>
|
||||||
|
<option>non-ice</option>
|
||||||
|
<option>non-error</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<input type="submit" class="bisect-btn" value="Bisect!" />
|
||||||
|
</form>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
|
|
@ -80,12 +86,8 @@ impl<T> Struct<T> {
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const BASE_URL = `${document.location}`;
|
const BASE_URL = `${document.location}`;
|
||||||
const htmlCode = document.getElementById("code");
|
|
||||||
const htmlStatus = document.getElementById("status");
|
const htmlStatus = document.getElementById("status");
|
||||||
const htmlResult = document.getElementById("result");
|
const htmlResult = document.getElementById("result");
|
||||||
const htmlStart = document.getElementById("start");
|
|
||||||
const htmlEnd = document.getElementById("end");
|
|
||||||
const htmlKind = document.getElementById("kind");
|
|
||||||
|
|
||||||
let bisecting = false;
|
let bisecting = false;
|
||||||
|
|
||||||
|
|
@ -97,13 +99,31 @@ impl<T> Struct<T> {
|
||||||
bisecting = false;
|
bisecting = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function bisect() {
|
function submitForm() {
|
||||||
if (bisecting) {
|
const form = document.forms.bisect;
|
||||||
|
const options = {
|
||||||
|
code: form.code.value,
|
||||||
|
start: form.start.value?.trim(),
|
||||||
|
end: form.end.value?.trim(),
|
||||||
|
kind: form.kind.value,
|
||||||
|
};
|
||||||
|
console.log("Options", options);
|
||||||
|
|
||||||
|
if (!options.start) {
|
||||||
|
fatal("Must provide a start");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!htmlStart.value.trim()) {
|
bisect(options);
|
||||||
fatal("Must provide a start");
|
}
|
||||||
|
|
||||||
|
document.getElementById("bisect-form").addEventListener("submit", (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
submitForm();
|
||||||
|
});
|
||||||
|
|
||||||
|
async function bisect(options) {
|
||||||
|
if (bisecting) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -116,16 +136,14 @@ impl<T> Struct<T> {
|
||||||
|
|
||||||
const params = new URLSearchParams();
|
const params = new URLSearchParams();
|
||||||
|
|
||||||
params.append("start", htmlStart.value.trim());
|
params.append("start", options.start);
|
||||||
params.append("kind", htmlKind.value);
|
params.append("kind", options.kind);
|
||||||
|
|
||||||
if (htmlEnd.value.trim()) {
|
if (options.end) {
|
||||||
params.append("end", htmlEnd.value.trim());
|
params.append("end", options.end);
|
||||||
}
|
}
|
||||||
|
|
||||||
const body = htmlCode.value;
|
const body = options.code;
|
||||||
|
|
||||||
console.log("Bisecting", body);
|
|
||||||
|
|
||||||
let jobId;
|
let jobId;
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue