a select
parent
39ed9280e1
commit
60017a8d3a
38
report.tmpl
38
report.tmpl
|
|
@ -20,19 +20,20 @@
|
|||
allMessages.map((message) => {
|
||||
Object.keys(fieldsToOptions).map((field) => {fieldsToOptions[field][message[field]] = true});
|
||||
});
|
||||
Object.keys(fieldsToOptions).map((field) => {fieldsToOptions[field] = Object.keys(fieldsToOptions[field])});
|
||||
Object.keys(fieldsToOptions).map((field) => {fieldsToOptions[field] = Object.keys(fieldsToOptions[field]); fieldsToOptions[field].sort();});
|
||||
|
||||
document.getElementById("form").innerHTML = Object.keys(fieldsToOptions).map((field) => {
|
||||
}).join("");
|
||||
|
||||
console.log(fieldsToOptions);
|
||||
`
|
||||
<select name="filter1" multiple>
|
||||
<option selected>a</option>
|
||||
<option selected>b</option>
|
||||
</select>
|
||||
`
|
||||
return `
|
||||
<label for="${field}">${field}</label>
|
||||
<select name="${field}" multiple ${fieldsToOptions[field].length > 10 ? "size=10" : `size=${fieldsToOptions[field].length}`}>
|
||||
${fieldsToOptions[field].map((option) => `
|
||||
<option selected>${option}</option>
|
||||
`)}
|
||||
</select>
|
||||
`
|
||||
}).join("\n");
|
||||
}
|
||||
|
||||
function drawAll() {
|
||||
const messages = filterMessages(allMessages)
|
||||
drawEventVolumeByName(messages)
|
||||
|
|
@ -40,11 +41,20 @@
|
|||
drawEventVolumeByHour(messages)
|
||||
drawEventVolumeByAsset(messages)
|
||||
}
|
||||
|
||||
function filterMessages(messages) {
|
||||
const filters = document.getElementById("form");
|
||||
console.log(filters);
|
||||
return messages.map(() => {
|
||||
});
|
||||
}
|
||||
|
||||
function drawEventVolumeByName() {}
|
||||
|
||||
function drawEventVolumeByWeekday() {}
|
||||
|
||||
function drawEventVolumeByHour() {}
|
||||
|
||||
function drawEventVolumeByAsset() {}
|
||||
</script>
|
||||
<style>
|
||||
|
|
@ -61,10 +71,14 @@
|
|||
rows, columns { border: 1px solid red; }
|
||||
</style>
|
||||
</head>
|
||||
<body onload="fillForm()">
|
||||
<body onload="fillForm(); drawAll();">
|
||||
<h1>Report</h1>
|
||||
<columns>
|
||||
<form id="form" style="width: 10em; flex-shrink: 0;" onchange="drawAll()">
|
||||
<form style="width: 16em; flex-shrink: 0;" onsubmit="drawAll(); return false;">
|
||||
<columns>
|
||||
<button type="submit">Apply</button>
|
||||
</columns>
|
||||
<rows id="form"></rows>
|
||||
</form>
|
||||
<rows>
|
||||
<rows>
|
||||
|
|
|
|||
Loading…
Reference in New Issue