-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9da69f5
Showing
5 changed files
with
299 additions
and
0 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,102 @@ | ||
{ | ||
"owner": { | ||
"type": "text", | ||
"hint": "Benutzerkennung" | ||
}, | ||
"group": { | ||
"type": "select", | ||
"hint": "Organisationseinheit", | ||
"options": [ | ||
"bio", | ||
"fb1", | ||
"fb3", | ||
"geo", | ||
"igb", | ||
"ikw", | ||
"inf", | ||
"math", | ||
"psycho", | ||
"rz", | ||
"rz-net", | ||
"ub", | ||
"usf", | ||
"virtuos", | ||
"wiwi" | ||
] | ||
}, | ||
"name": { | ||
"type": "text", | ||
"hint": "Hostname" | ||
}, | ||
"cpus": { | ||
"hint": "Anzahl der CPUs", | ||
"type": "select", | ||
"options": [ | ||
1, | ||
2, | ||
4, | ||
6, | ||
8, | ||
12, | ||
16, | ||
32 | ||
] | ||
}, | ||
"mem": { | ||
"hint": "Hauptspeicher", | ||
"type": "select", | ||
"options": [ | ||
"2GiB", | ||
"4GiB", | ||
"6GiB", | ||
"8GiB", | ||
"10GiB", | ||
"12GiB", | ||
"16GiB", | ||
"32GiB" | ||
] | ||
}, | ||
"disksize": { | ||
"hint": "Plattengr\u00f6\u00dfe", | ||
"type": "select", | ||
"options": [ | ||
"32GiB", | ||
"64GiB", | ||
"128GiB", | ||
"256GiB", | ||
"512GiB", | ||
"1024GiB" | ||
] | ||
}, | ||
"net": { | ||
"type": "select", | ||
"hint": "Netzanschluss", | ||
"options": [ | ||
"131.173.22.0/23", | ||
"172.17.22.0/23" | ||
] | ||
}, | ||
"os": { | ||
"hint": "Betriebssystem", | ||
"type": "select", | ||
"options": [ | ||
"bionic", | ||
"bullseye", | ||
"buster", | ||
"centos", | ||
"cs8", | ||
"cs9", | ||
"debian", | ||
"debian-10", | ||
"debian-11", | ||
"focal", | ||
"jammy", | ||
"other", | ||
"sl7", | ||
"ubuntu", | ||
"ubuntu-18", | ||
"ubuntu-20", | ||
"ubuntu-22" | ||
] | ||
} | ||
} |
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,86 @@ | ||
owner: | ||
type: text | ||
hint: Benutzerkennung | ||
group: | ||
type: select | ||
hint: Organisationseinheit | ||
options: | ||
- bio | ||
- fb1 | ||
- fb3 | ||
- geo | ||
- igb | ||
- ikw | ||
- inf | ||
- math | ||
- psycho | ||
- rz | ||
- rz-net | ||
- ub | ||
- usf | ||
- virtuos | ||
- wiwi | ||
name: | ||
type: text | ||
hint: Hostname | ||
cpus: | ||
hint: Anzahl der CPUs | ||
type: select | ||
options: | ||
- 1 | ||
- 2 | ||
- 4 | ||
- 6 | ||
- 8 | ||
- 12 | ||
- 16 | ||
- 32 | ||
mem: | ||
hint: Hauptspeicher | ||
type: select | ||
options: | ||
- 2GiB | ||
- 4GiB | ||
- 6GiB | ||
- 8GiB | ||
- 10GiB | ||
- 12GiB | ||
- 16GiB | ||
- 32GiB | ||
disksize: | ||
hint: Plattengröße | ||
type: select | ||
options: | ||
- 32GiB | ||
- 64GiB | ||
- 128GiB | ||
- 256GiB | ||
- 512GiB | ||
- 1024GiB | ||
net: | ||
type: select | ||
hint: Netzanschluss | ||
options: | ||
- 131.173.22.0/23 | ||
- 172.17.22.0/23 | ||
os: | ||
hint: Betriebssystem | ||
type: select | ||
options: | ||
- bionic | ||
- bullseye | ||
- buster | ||
- centos | ||
- cs8 | ||
- cs9 | ||
- debian | ||
- debian-10 | ||
- debian-11 | ||
- focal | ||
- jammy | ||
- other | ||
- sl7 | ||
- ubuntu | ||
- ubuntu-18 | ||
- ubuntu-20 | ||
- ubuntu-22 |
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,22 @@ | ||
body { | ||
font-family: sans; | ||
width: 750px; | ||
margin: 0 auto; | ||
} | ||
|
||
.buttons { | ||
text-align: right; | ||
margin: 15px 0; | ||
} | ||
|
||
#selector { | ||
display: grid; | ||
grid-template-columns: 200px auto; | ||
} | ||
|
||
#order { | ||
background-color: #ddd; | ||
border: 1px solid #666; | ||
border-radius: 5px; | ||
padding: 10px; | ||
} |
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 @@ | ||
<!DOCTYPE html> | ||
<html lang=en> | ||
<head> | ||
<meta http-equiv=content-type content="text/html; charset=utf-8" /> | ||
<meta name=author content="Lars Kiesow" /> | ||
<meta name=viewport content="width=device-width, initial-scale=1"> | ||
<link rel=stylesheet type=text/css href=index.css /> | ||
<script type=application/javascript src=index.js></script> | ||
|
||
<title>Lars Kiesow :: Home</title> | ||
</head> | ||
<body onload="load_config()"> | ||
|
||
<header> | ||
<h1>VM Selector</h1> | ||
</header> | ||
|
||
<div id=selector> | ||
</div> | ||
|
||
<div class=buttons> | ||
<button onclick="add_vm()">Hinzufügen</button> | ||
</div> | ||
|
||
<pre id=order> | ||
</pre> | ||
|
||
<div class=buttons> | ||
<button onclick="copy()">🗎 Kopieren</button> | ||
</div> | ||
|
||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
fields = [] | ||
|
||
function load_config() { | ||
fetch('config.json') | ||
.then((response) => response.json()) | ||
.then((data) => build_ui(data)); | ||
} | ||
|
||
function build_ui(config) { | ||
const selector = document.getElementById('selector'); | ||
for (const key in config) { | ||
const field = config[key]; | ||
fields.push(key); | ||
const label = document.createElement('label'); | ||
label.setAttribute('for', key); | ||
label.innerText = field.hint; | ||
selector.appendChild(label); | ||
if (field.type === 'text') { | ||
const input = document.createElement('input'); | ||
input.setAttribute('type', field.type); | ||
input.setAttribute('id', key); | ||
input.setAttribute('name', key); | ||
selector.appendChild(input); | ||
} else if (field.type === 'select') { | ||
const input = document.createElement('select'); | ||
input.setAttribute('id', key); | ||
input.setAttribute('name', key); | ||
for (const value of field.options) { | ||
const option = document.createElement('option'); | ||
option.setAttribute('value', value); | ||
option.innerText = value; | ||
input.appendChild(option); | ||
} | ||
selector.appendChild(input); | ||
} | ||
} | ||
} | ||
|
||
function add_vm() { | ||
let args = ''; | ||
for (field of fields) { | ||
const value = document.getElementById(field).value; | ||
if (!value) { | ||
alert(`${field} must not be empty`); | ||
return; | ||
} | ||
args += `${value} `; | ||
} | ||
const order = document.getElementById('order'); | ||
order.innerText = `${order.innerText}\n${args}`.trim(); | ||
} | ||
|
||
function copy() { | ||
const order = document.getElementById('order'); | ||
navigator.clipboard.writeText(order.innerText); | ||
} |