From 364d160f24740a2723e86383ae14b56d7f252250 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Thu, 31 Oct 2024 21:24:37 +0100 Subject: [PATCH] Some improvement for IT doc --- samples/it_v2/schemas/_index.json | 81 ++++++++++++++++++++ samples/it_v2/schemas_builder/objects/_index | 1 + samples/it_v2/templates/backups.pug | 11 +-- samples/it_v2/templates/ms365sharepoint.pug | 7 +- samples/it_v2/templates/updates.pug | 4 +- src/core/jsondoc.js | 3 + 6 files changed, 95 insertions(+), 12 deletions(-) diff --git a/samples/it_v2/schemas/_index.json b/samples/it_v2/schemas/_index.json index cfb9ee2..4cca9cb 100644 --- a/samples/it_v2/schemas/_index.json +++ b/samples/it_v2/schemas/_index.json @@ -62,6 +62,87 @@ } } }, + "backups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "anyOf": [ + { "type": "string" }, + { "enum": [ + "''", + "'none'", + "'hypervisor'", + "'windowsbackup'" + ]} + ] + }, + "method": { + "anyOf": [ + { "type": "string" }, + { "enum": [ + "''", + "'auto'", + "'manual'" + ]} + ] + }, + "frequency": { + "anyOf": [ + { "type": "string" }, + { "enum": [ + "''", + "'daily'", + "'weekly'", + "'monthly'", + "'quarterly'", + "'halfyearly'", + "'yearly'", + "'monday'", + "'tuesday'", + "'wednesday'", + "'thursday'", + "'friday'", + "'saturday'", + "'sonday'" + ]} + ] + }, + "target": { + "anyOf": [ + {"type": "string"}, + {"enum": [ + "''", + "'usb'", + "'pbs'", + "'share'", + "'iscsi'", + "'cloud'" + ]} + ] + }, + "time": { + "anyOf": [ + {"type": "string"}, + {"enum": [ + "''", + "'auto'" + ]} + ] + }, + "duration": { + "anyOf": [ + { "type": "string" }, + { "type": "integer" }, + {"enum": [ + "''" + ]} + ] + } + } + } + }, "headfiles": { "type": "array", "items": { diff --git a/samples/it_v2/schemas_builder/objects/_index b/samples/it_v2/schemas_builder/objects/_index index ba861a3..49905e7 100644 --- a/samples/it_v2/schemas_builder/objects/_index +++ b/samples/it_v2/schemas_builder/objects/_index @@ -4,4 +4,5 @@ title book toc templates +maintenance_backups files diff --git a/samples/it_v2/templates/backups.pug b/samples/it_v2/templates/backups.pug index 73244ac..912c6e4 100644 --- a/samples/it_v2/templates/backups.pug +++ b/samples/it_v2/templates/backups.pug @@ -2,10 +2,11 @@ div#HEADFILES - const backups = [] const readNode = (curNode) => { - if(curNode?.data?.backups?.length > 0) { + if(curNode?.backups?.length > 0) { const nodeItem = { - name: curNode.data.name, - backups: curNode.data.backups, + name: curNode.title, + url: curNode.url, + backups: curNode.backups, } backups.push(nodeItem) } @@ -27,8 +28,8 @@ div#HEADFILES table thead - th Devices - th Types + th Object + th Type th Content th Frequency th Time diff --git a/samples/it_v2/templates/ms365sharepoint.pug b/samples/it_v2/templates/ms365sharepoint.pug index 712b814..1191a2b 100644 --- a/samples/it_v2/templates/ms365sharepoint.pug +++ b/samples/it_v2/templates/ms365sharepoint.pug @@ -1,11 +1,8 @@ div#HEADFILES each itm in node.items - table - tr - td.bold=itm.data.name - tr - td=itm.data.url + div.bold=itm.data.name + a(href=itm.data.url, target="_blank")=itm.data.url div#FILES div#FOOTFILES diff --git a/samples/it_v2/templates/updates.pug b/samples/it_v2/templates/updates.pug index 0797cc3..0151772 100644 --- a/samples/it_v2/templates/updates.pug +++ b/samples/it_v2/templates/updates.pug @@ -27,8 +27,8 @@ div#HEADFILES table thead - th Devices - th Types + th Object + th Type th Method th Frequency th Time diff --git a/src/core/jsondoc.js b/src/core/jsondoc.js index 96779a2..feb5622 100644 --- a/src/core/jsondoc.js +++ b/src/core/jsondoc.js @@ -27,6 +27,7 @@ const load = (yamlFile) => { node: '@node', items: '@item', }, + bakups: [], parent: null, nodes: [], items: [], @@ -67,6 +68,7 @@ const load = (yamlFile) => { node: '@node', items: '@item', }, + bakups: [], parent: parentNode, nodes: [], items: [], @@ -87,6 +89,7 @@ const load = (yamlFile) => { if(yamlNode.book == false) node.book = yamlNode.book if(yamlNode?.templates?.node) node.templates.node = yamlNode.templates.node if(yamlNode?.templates?.items) node.templates.items = yamlNode.templates.items + if(yamlNode.backups) node.backups = yamlNode.backups if(yamlNode.headfiles) node.headfiles = yamlNode.headfiles if(yamlNode.files) node.files = yamlNode.files if(yamlNode.footfiles) node.footfiles = yamlNode.footfiles