@@ -1055,12 +1055,12 @@ function renderDocuments() {
|
|||||||
|
|
||||||
const DOC_FIELD_TEMPLATES = {
|
const DOC_FIELD_TEMPLATES = {
|
||||||
deployment: [
|
deployment: [
|
||||||
{ id: 'docTarget', label: 'Target System / Host', type: 'text', placeholder: 'e.g. web-server-01, firewall-cluster' },
|
{ id: 'docTarget', label: 'Target System / Host', type: 'network-node' },
|
||||||
{ id: 'docVersion', label: 'Version / Build', type: 'text', placeholder: 'e.g. v2.1.0, build 42' },
|
{ id: 'docVersion', label: 'Version / Build', type: 'text', placeholder: 'e.g. v2.1.0, build 42' },
|
||||||
{ id: 'docStatus', label: 'Status', type: 'select', options: ['Planned', 'In Progress', 'Completed', 'Rolled Back', 'Failed'] }
|
{ id: 'docStatus', label: 'Status', type: 'select', options: ['Planned', 'In Progress', 'Completed', 'Rolled Back', 'Failed'] }
|
||||||
],
|
],
|
||||||
attack: [
|
attack: [
|
||||||
{ id: 'docSource', label: 'Attack Source / IP', type: 'text', placeholder: 'e.g. 10.0.0.5, External C2' },
|
{ id: 'docSource', label: 'Attack Source / IP', type: 'network-node' },
|
||||||
{ id: 'docVector', label: 'Attack Vector', type: 'select', options: ['Phishing', 'Brute Force', 'Malware', 'DDoS', 'SQL Injection', 'XSS', 'Social Engineering', 'Physical', 'Other'] },
|
{ id: 'docVector', label: 'Attack Vector', type: 'select', options: ['Phishing', 'Brute Force', 'Malware', 'DDoS', 'SQL Injection', 'XSS', 'Social Engineering', 'Physical', 'Other'] },
|
||||||
{ id: 'docImpact', label: 'Impact', type: 'select', options: ['None', 'Low', 'Medium', 'High', 'Critical'] }
|
{ id: 'docImpact', label: 'Impact', type: 'select', options: ['None', 'Low', 'Medium', 'High', 'Critical'] }
|
||||||
],
|
],
|
||||||
@@ -1086,6 +1086,17 @@ function updateDocFormFields() {
|
|||||||
const container = document.getElementById('dynamicDocFields');
|
const container = document.getElementById('dynamicDocFields');
|
||||||
const templates = DOC_FIELD_TEMPLATES[docType] || [];
|
const templates = DOC_FIELD_TEMPLATES[docType] || [];
|
||||||
container.innerHTML = templates.map(f => {
|
container.innerHTML = templates.map(f => {
|
||||||
|
if (f.type === 'network-node') {
|
||||||
|
const opts = nodes.map(n => `<option value="${n.label} (${n.ip_address || 'no IP'})">${esc(n.label)} ${n.ip_address ? '(' + esc(n.ip_address) + ')' : ''}</option>`).join('');
|
||||||
|
return `
|
||||||
|
<div class="mb-2">
|
||||||
|
<label class="form-label small">${f.label}</label>
|
||||||
|
<select class="form-select form-select-sm" id="${f.id}">
|
||||||
|
<option value="">-- Select network node --</option>
|
||||||
|
${opts}
|
||||||
|
</select>
|
||||||
|
</div>`;
|
||||||
|
}
|
||||||
if (f.type === 'select') {
|
if (f.type === 'select') {
|
||||||
const opts = f.options.map(o => `<option value="${o}">${o}</option>`).join('');
|
const opts = f.options.map(o => `<option value="${o}">${o}</option>`).join('');
|
||||||
return `
|
return `
|
||||||
|
|||||||
Reference in New Issue
Block a user