From 30519a4d241747eedb2be2f778f1ede089ea61f2 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 27 Apr 2024 23:27:29 +0200 Subject: [PATCH] Update schemas and templates --- samples/it_v1/schemas/computer.json | 8 +++++++ samples/it_v1/schemas/netdev.json | 8 +++++++ samples/it_v1/schemas/printer.json | 8 +++++++ samples/it_v1/schemas/server.json | 8 +++++++ samples/it_v1/schemas/software.json | 8 +++++++ samples/it_v1/schemas/voipdev.json | 8 +++++++ .../it_v1/schemas_builder/objects/computer | 1 + samples/it_v1/schemas_builder/objects/netdev | 1 + samples/it_v1/schemas_builder/objects/printer | 1 + samples/it_v1/schemas_builder/objects/server | 1 + .../it_v1/schemas_builder/objects/software | 1 + samples/it_v1/schemas_builder/objects/voipdev | 1 + .../schemas_builder/parts/maintainer.json | 13 +++++++++++ samples/it_v1/templates/adadmins.pug | 13 +++++++++++ samples/it_v1/templates/backups.pug | 2 +- samples/it_v1/templates/cloudadmins.pug | 13 +++++++++++ samples/it_v1/templates/ipam.pug | 2 +- samples/it_v1/templates/ms365admins.pug | 2 ++ samples/it_v1/templates/todos.pug | 23 ++++++++++++------- samples/it_v1/templates/updates.pug | 2 +- samples/it_v1/templates/webdomains.pug | 18 +++++++++++++++ 21 files changed, 131 insertions(+), 11 deletions(-) create mode 100644 samples/it_v1/schemas_builder/parts/maintainer.json create mode 100644 samples/it_v1/templates/adadmins.pug create mode 100644 samples/it_v1/templates/cloudadmins.pug create mode 100644 samples/it_v1/templates/webdomains.pug diff --git a/samples/it_v1/schemas/computer.json b/samples/it_v1/schemas/computer.json index f5851af..2613ee4 100644 --- a/samples/it_v1/schemas/computer.json +++ b/samples/it_v1/schemas/computer.json @@ -38,6 +38,14 @@ ]} ] }, + "maintainer": { + "oneOf": [ + {"type": "string"}, + {"enum": [ + "''" + ]} + ] + }, "type": { "type": "string", "anyOf": [ diff --git a/samples/it_v1/schemas/netdev.json b/samples/it_v1/schemas/netdev.json index fed7001..a294829 100644 --- a/samples/it_v1/schemas/netdev.json +++ b/samples/it_v1/schemas/netdev.json @@ -38,6 +38,14 @@ ]} ] }, + "maintainer": { + "oneOf": [ + {"type": "string"}, + {"enum": [ + "''" + ]} + ] + }, "type": { "type": "string", "anyOf": [ diff --git a/samples/it_v1/schemas/printer.json b/samples/it_v1/schemas/printer.json index 30cf807..b143ef8 100644 --- a/samples/it_v1/schemas/printer.json +++ b/samples/it_v1/schemas/printer.json @@ -38,6 +38,14 @@ ]} ] }, + "maintainer": { + "oneOf": [ + {"type": "string"}, + {"enum": [ + "''" + ]} + ] + }, "type": { "type": "string", "anyOf": [ diff --git a/samples/it_v1/schemas/server.json b/samples/it_v1/schemas/server.json index c3223d3..346d1fd 100644 --- a/samples/it_v1/schemas/server.json +++ b/samples/it_v1/schemas/server.json @@ -38,6 +38,14 @@ ]} ] }, + "maintainer": { + "oneOf": [ + {"type": "string"}, + {"enum": [ + "''" + ]} + ] + }, "type": { "type": "string", "anyOf": [ diff --git a/samples/it_v1/schemas/software.json b/samples/it_v1/schemas/software.json index 0195ee0..06322a2 100644 --- a/samples/it_v1/schemas/software.json +++ b/samples/it_v1/schemas/software.json @@ -38,6 +38,14 @@ ]} ] }, + "maintainer": { + "oneOf": [ + {"type": "string"}, + {"enum": [ + "''" + ]} + ] + }, "publisher": { "oneOf": [ {"type": "string"}, diff --git a/samples/it_v1/schemas/voipdev.json b/samples/it_v1/schemas/voipdev.json index fe23f9c..5a58e5b 100644 --- a/samples/it_v1/schemas/voipdev.json +++ b/samples/it_v1/schemas/voipdev.json @@ -38,6 +38,14 @@ ]} ] }, + "maintainer": { + "oneOf": [ + {"type": "string"}, + {"enum": [ + "''" + ]} + ] + }, "type": { "type": "string", "anyOf": [ diff --git a/samples/it_v1/schemas_builder/objects/computer b/samples/it_v1/schemas_builder/objects/computer index 6c85be1..4260345 100644 --- a/samples/it_v1/schemas_builder/objects/computer +++ b/samples/it_v1/schemas_builder/objects/computer @@ -1,5 +1,6 @@ todo name +maintainer computer_type # computer_roles model diff --git a/samples/it_v1/schemas_builder/objects/netdev b/samples/it_v1/schemas_builder/objects/netdev index 083fccc..ace2015 100644 --- a/samples/it_v1/schemas_builder/objects/netdev +++ b/samples/it_v1/schemas_builder/objects/netdev @@ -1,5 +1,6 @@ todo name +maintainer netdev_type netdev_roles model diff --git a/samples/it_v1/schemas_builder/objects/printer b/samples/it_v1/schemas_builder/objects/printer index 6fd926b..eec5ff7 100644 --- a/samples/it_v1/schemas_builder/objects/printer +++ b/samples/it_v1/schemas_builder/objects/printer @@ -1,5 +1,6 @@ todo name +maintainer printer_type model location diff --git a/samples/it_v1/schemas_builder/objects/server b/samples/it_v1/schemas_builder/objects/server index a08845f..c4ae0fd 100644 --- a/samples/it_v1/schemas_builder/objects/server +++ b/samples/it_v1/schemas_builder/objects/server @@ -1,5 +1,6 @@ todo name +maintainer server_type server_roles model diff --git a/samples/it_v1/schemas_builder/objects/software b/samples/it_v1/schemas_builder/objects/software index 6db1bf4..c89544e 100644 --- a/samples/it_v1/schemas_builder/objects/software +++ b/samples/it_v1/schemas_builder/objects/software @@ -1,5 +1,6 @@ todo name +maintainer software urls files diff --git a/samples/it_v1/schemas_builder/objects/voipdev b/samples/it_v1/schemas_builder/objects/voipdev index 8e0f79d..ccdd3ee 100644 --- a/samples/it_v1/schemas_builder/objects/voipdev +++ b/samples/it_v1/schemas_builder/objects/voipdev @@ -1,5 +1,6 @@ todo name +maintainer voipdev_type model location diff --git a/samples/it_v1/schemas_builder/parts/maintainer.json b/samples/it_v1/schemas_builder/parts/maintainer.json new file mode 100644 index 0000000..97805d4 --- /dev/null +++ b/samples/it_v1/schemas_builder/parts/maintainer.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "maintainer": { + "oneOf": [ + {"type": "string"}, + {"enum": [ + "''" + ]} + ] + } + } +} diff --git a/samples/it_v1/templates/adadmins.pug b/samples/it_v1/templates/adadmins.pug new file mode 100644 index 0000000..90d90cf --- /dev/null +++ b/samples/it_v1/templates/adadmins.pug @@ -0,0 +1,13 @@ +div#HEADFILES + +table + thead + th Account + th Notes + each itm in node.items + tr + td=itm.data.name + td=itm.data.notes + +div#FILES +div#FOOTFILES diff --git a/samples/it_v1/templates/backups.pug b/samples/it_v1/templates/backups.pug index a38ebdd..73244ac 100644 --- a/samples/it_v1/templates/backups.pug +++ b/samples/it_v1/templates/backups.pug @@ -13,7 +13,7 @@ div#HEADFILES if(itm?.data?.backups?.length > 0) { const nodeItem = { name: itm.data.name, - url: curNode.url + '?itm=' + itm.data.name, + url: curNode.url + '?itm=' + itm.name, backups: itm.data.backups, } backups.push(nodeItem) diff --git a/samples/it_v1/templates/cloudadmins.pug b/samples/it_v1/templates/cloudadmins.pug new file mode 100644 index 0000000..90d90cf --- /dev/null +++ b/samples/it_v1/templates/cloudadmins.pug @@ -0,0 +1,13 @@ +div#HEADFILES + +table + thead + th Account + th Notes + each itm in node.items + tr + td=itm.data.name + td=itm.data.notes + +div#FILES +div#FOOTFILES diff --git a/samples/it_v1/templates/ipam.pug b/samples/it_v1/templates/ipam.pug index 8fd35d0..9abf2b3 100644 --- a/samples/it_v1/templates/ipam.pug +++ b/samples/it_v1/templates/ipam.pug @@ -42,7 +42,7 @@ if dhcpRanges.length > 0 td=rng.from td=rng.to if ipNodes.length > 0 - h3 Fixed IPs + h3 Static IPs table thead th IP diff --git a/samples/it_v1/templates/ms365admins.pug b/samples/it_v1/templates/ms365admins.pug index ffa5714..90d90cf 100644 --- a/samples/it_v1/templates/ms365admins.pug +++ b/samples/it_v1/templates/ms365admins.pug @@ -3,9 +3,11 @@ div#HEADFILES table thead th Account + th Notes each itm in node.items tr td=itm.data.name + td=itm.data.notes div#FILES div#FOOTFILES diff --git a/samples/it_v1/templates/todos.pug b/samples/it_v1/templates/todos.pug index 3cc127d..eebd68e 100644 --- a/samples/it_v1/templates/todos.pug +++ b/samples/it_v1/templates/todos.pug @@ -17,7 +17,7 @@ div#HEADFILES itm.data.todo.forEach((todo) => { const nodeItem = { name: itm.data.name, - url: curNode.url + '?itm=' + itm.data.name, + url: curNode.url + '?itm=' + itm.name, todo: todo, } todos.push(nodeItem) @@ -41,7 +41,7 @@ div#HEADFILES if(itm?.data?.todo?.length > 0) { const nodeItem = { name: itm.data.name, - url: curNode.url + '?itm=' + itm.data.name, + url: curNode.url + '?itm=' + itm.name, todos: itm.data.todo, } todos.push(nodeItem) @@ -54,7 +54,7 @@ div#HEADFILES readNode(doc) todos = todos.sort((x, y) => { - return (x.todo.priority - y.todo.priority) + return (y.todo.priority - x.todo.priority) }) table @@ -63,11 +63,18 @@ table th Object th Message each itm in todos - tr - td=itm.todo.priority - td - a(href=itm.url)=itm.name - td=itm.todo.msg + if itm.todo.priority >= 10 + tr.alert + td=itm.todo.priority + td + a.alert(href=itm.url)=itm.name + td=itm.todo.msg + else + tr + td=itm.todo.priority + td + a(href=itm.url)=itm.name + td=itm.todo.msg div#FILES div#FOOTFILES diff --git a/samples/it_v1/templates/updates.pug b/samples/it_v1/templates/updates.pug index a3106fe..f9679ed 100644 --- a/samples/it_v1/templates/updates.pug +++ b/samples/it_v1/templates/updates.pug @@ -13,7 +13,7 @@ div#HEADFILES if(itm?.data?.updates?.length > 0) { const nodeItem = { name: itm.data.name, - url: curNode.url + '?itm=' + itm.data.name, + url: curNode.url + '?itm=' + itm.name, updates: itm.data.updates, } updates.push(nodeItem) diff --git a/samples/it_v1/templates/webdomains.pug b/samples/it_v1/templates/webdomains.pug new file mode 100644 index 0000000..b4f186b --- /dev/null +++ b/samples/it_v1/templates/webdomains.pug @@ -0,0 +1,18 @@ +div#HEADFILES + +table + thead + th Name + th Notes + each itm in node.items + tr + td=itm.data.name + td=itm.data.notes + if itm.data.aliases + each alias in itm.data.aliases + tr + td=alias.name + td=alias.notes + +div#FILES +div#FOOTFILES