mirror of
https://github.com/MatMoul/dokytree.git
synced 2025-11-21 06:52:05 +00:00
Add TODO to node + Sample IT_V2
This commit is contained in:
15
samples/it_v2/templates/acls.pug
Normal file
15
samples/it_v2/templates/acls.pug
Normal file
@@ -0,0 +1,15 @@
|
||||
div#HEADFILES
|
||||
|
||||
each srv in node.items
|
||||
h3=srv.data.name
|
||||
each fld in srv.data.folders
|
||||
div.itemvmargin
|
||||
div=fld.path
|
||||
table
|
||||
each acl in fld.acls
|
||||
tr
|
||||
td=acl.name
|
||||
td=acl.access
|
||||
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
13
samples/it_v2/templates/adadmins.pug
Normal file
13
samples/it_v2/templates/adadmins.pug
Normal file
@@ -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
|
||||
46
samples/it_v2/templates/backups.pug
Normal file
46
samples/it_v2/templates/backups.pug
Normal file
@@ -0,0 +1,46 @@
|
||||
div#HEADFILES
|
||||
-
|
||||
const backups = []
|
||||
const readNode = (curNode) => {
|
||||
if(curNode?.data?.backups?.length > 0) {
|
||||
const nodeItem = {
|
||||
name: curNode.data.name,
|
||||
backups: curNode.data.backups,
|
||||
}
|
||||
backups.push(nodeItem)
|
||||
}
|
||||
curNode.items.forEach((itm) => {
|
||||
if(itm?.data?.backups?.length > 0) {
|
||||
const nodeItem = {
|
||||
name: itm.data.name,
|
||||
url: curNode.url + '?itm=' + itm.name,
|
||||
backups: itm.data.backups,
|
||||
}
|
||||
backups.push(nodeItem)
|
||||
}
|
||||
})
|
||||
curNode.nodes.forEach((childNode) => {
|
||||
readNode(childNode)
|
||||
})
|
||||
}
|
||||
readNode(doc)
|
||||
|
||||
table
|
||||
thead
|
||||
th Devices
|
||||
th Types
|
||||
th Content
|
||||
th Frequency
|
||||
th Time
|
||||
th Duration
|
||||
th Target
|
||||
each itm in backups
|
||||
each backup in itm.backups
|
||||
tr
|
||||
td
|
||||
a(href=itm.url)=itm.name
|
||||
each key in Object.keys(backup)
|
||||
td=backup[key]
|
||||
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
13
samples/it_v2/templates/cloudadmins.pug
Normal file
13
samples/it_v2/templates/cloudadmins.pug
Normal file
@@ -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
|
||||
23
samples/it_v2/templates/computers.pug
Normal file
23
samples/it_v2/templates/computers.pug
Normal file
@@ -0,0 +1,23 @@
|
||||
div#HEADFILES
|
||||
table
|
||||
thead
|
||||
th Name
|
||||
th OS
|
||||
th IPs
|
||||
th Emplacement
|
||||
each computer in node.items
|
||||
tr
|
||||
td
|
||||
a(href=computer.url)=computer.data.name
|
||||
if (computer.data.os.substr(0,1) == '!')
|
||||
td.alert=computer.data.os
|
||||
else
|
||||
td=computer.data.os
|
||||
td
|
||||
if computer.data.interfaces
|
||||
each interface in computer.data.interfaces
|
||||
if interface.ip
|
||||
div=interface.ip
|
||||
td=computer.data.location
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
34
samples/it_v2/templates/dfs.pug
Normal file
34
samples/it_v2/templates/dfs.pug
Normal file
@@ -0,0 +1,34 @@
|
||||
div#HEADFILES
|
||||
|
||||
each itm in node.items
|
||||
table.itemvmargin
|
||||
tr
|
||||
td.bold Name
|
||||
td.bold=itm.data.name
|
||||
tr
|
||||
td Path
|
||||
td=itm.data.path
|
||||
tr
|
||||
td Targets
|
||||
td
|
||||
if (itm.data.targets)
|
||||
each target in itm.data.targets
|
||||
div=target
|
||||
if (itm.data.folders)
|
||||
tr
|
||||
td Folders
|
||||
td
|
||||
table
|
||||
thead
|
||||
th Name
|
||||
th Targets
|
||||
each fld in itm.data.folders
|
||||
tr
|
||||
td=fld.name
|
||||
td
|
||||
if (fld.targets)
|
||||
each target in fld.targets
|
||||
div=target
|
||||
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
28
samples/it_v2/templates/domains.pug
Normal file
28
samples/it_v2/templates/domains.pug
Normal file
@@ -0,0 +1,28 @@
|
||||
div#HEADFILES
|
||||
|
||||
table
|
||||
thead
|
||||
th Name
|
||||
th DC
|
||||
th FSMO
|
||||
th Members
|
||||
each itm in node.items
|
||||
tr
|
||||
td=itm.name
|
||||
td
|
||||
if (itm.data)
|
||||
each dc in itm.data.dc
|
||||
div
|
||||
a(href="/devices/servers?itm="+dc.name)=dc.name
|
||||
td
|
||||
if (itm.data)
|
||||
each dc in itm.data.dc
|
||||
div=dc.fsmo
|
||||
td
|
||||
if (itm.data)
|
||||
each srv in itm.data.servers
|
||||
div
|
||||
a(href="/devices/servers?itm="+srv.name)=srv.name
|
||||
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
72
samples/it_v2/templates/ipam.pug
Normal file
72
samples/it_v2/templates/ipam.pug
Normal file
@@ -0,0 +1,72 @@
|
||||
div#HEADFILES
|
||||
-
|
||||
let dhcpRanges = []
|
||||
node.parent.getNode('subnets').items.forEach((itm) => {
|
||||
itm?.data?.dhcp?.ranges?.forEach((rng) => {
|
||||
dhcpRanges.push({
|
||||
from: rng.from,
|
||||
to: rng.to,
|
||||
server: itm.data.dhcp.server,
|
||||
name: itm.data.name,
|
||||
})
|
||||
})
|
||||
})
|
||||
dhcpRanges = dhcpRanges.sort((a,b)=>{return compareIP(a.from, b.from)})
|
||||
let ipNodes = []
|
||||
node.parent.parent.getNode('devices')?.nodes?.forEach((nd) => {
|
||||
nd.items.forEach((itm) => {
|
||||
if(itm.data.interfaces) {
|
||||
itm.data.interfaces.forEach((nic) => {
|
||||
if(nic.ip) ipNodes.push({
|
||||
ip: nic.ip,
|
||||
node: nd,
|
||||
item: itm,
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
ipNodes = ipNodes.sort((a,b)=>{return compareIP(a.ip, b.ip)})
|
||||
if dhcpRanges.length > 0
|
||||
h3 DHCP ranges
|
||||
table
|
||||
thead
|
||||
th Subnet
|
||||
th Server
|
||||
th From
|
||||
th To
|
||||
each rng in dhcpRanges
|
||||
tr
|
||||
td=rng.name
|
||||
td=rng.server
|
||||
td=rng.from
|
||||
td=rng.to
|
||||
if ipNodes.length > 0
|
||||
h3 Static IPs
|
||||
table
|
||||
thead
|
||||
th IP
|
||||
th Name
|
||||
th Model
|
||||
th OS
|
||||
each nd in ipNodes
|
||||
tr
|
||||
td=nd.ip
|
||||
td
|
||||
a(href=nd.item.url)=nd.item.data.name
|
||||
if (nd.item.data.model)
|
||||
if (nd.item.data.model.substr(0,1) == '!')
|
||||
td.alert=nd.item.data.model
|
||||
else
|
||||
td=nd.item.data.model
|
||||
else
|
||||
td
|
||||
if (nd.item.data.os)
|
||||
if (nd.item.data.os.substr(0,1) == '!')
|
||||
td.alert=nd.item.data.os
|
||||
else
|
||||
td=nd.item.data.os
|
||||
else
|
||||
td
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
56
samples/it_v2/templates/maintenances.pug
Normal file
56
samples/it_v2/templates/maintenances.pug
Normal file
@@ -0,0 +1,56 @@
|
||||
div#HEADFILES
|
||||
-
|
||||
const maintenances = []
|
||||
let fulltime = 0
|
||||
const readNode = (curNode) => {
|
||||
if(curNode?.data?.maintenances?.length > 0) {
|
||||
const nodeItem = {
|
||||
name: curNode.data.name,
|
||||
maintenances: curNode.data.maintenances,
|
||||
}
|
||||
maintenances.push(nodeItem)
|
||||
}
|
||||
curNode.items.forEach((itm) => {
|
||||
if(itm?.data?.maintenances?.length > 0) {
|
||||
const nodeItem = {
|
||||
name: itm.data.name,
|
||||
maintenances: itm.data.maintenances,
|
||||
}
|
||||
nodeItem?.maintenances?.forEach((maintenance) => {
|
||||
if(maintenance.yearlytime) fulltime += maintenance.yearlytime
|
||||
})
|
||||
maintenances.push(nodeItem)
|
||||
}
|
||||
})
|
||||
curNode.nodes.forEach((childNode) => {
|
||||
readNode(childNode)
|
||||
})
|
||||
}
|
||||
readNode(doc)
|
||||
table
|
||||
each itm in maintenances
|
||||
tr
|
||||
td=itm.name
|
||||
td
|
||||
table
|
||||
thead
|
||||
th Type
|
||||
th Frequency
|
||||
th Yearly time
|
||||
th Todo
|
||||
each maintenance in itm.maintenances
|
||||
tr
|
||||
td=maintenance.type
|
||||
td=maintenance.frequency
|
||||
if typeof maintenance.yearlytime === 'number'
|
||||
td=maintenance.yearlytime + ' min'
|
||||
else
|
||||
td
|
||||
td=maintenance.action
|
||||
table
|
||||
tr
|
||||
td Yearly time :
|
||||
td=((fulltime / 60) + '').split('.')[0] + ' hour'
|
||||
td=((fulltime / 60) + '').split('.')[0] * 130 + ':' + ((fulltime / 60) + '').split('.')[0] * 100 + ' / Years'
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
13
samples/it_v2/templates/ms365admins.pug
Normal file
13
samples/it_v2/templates/ms365admins.pug
Normal file
@@ -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
|
||||
11
samples/it_v2/templates/ms365sharepoint.pug
Normal file
11
samples/it_v2/templates/ms365sharepoint.pug
Normal file
@@ -0,0 +1,11 @@
|
||||
div#HEADFILES
|
||||
|
||||
each itm in node.items
|
||||
table
|
||||
tr
|
||||
td.bold=itm.data.name
|
||||
tr
|
||||
td=itm.data.url
|
||||
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
17
samples/it_v2/templates/ms365users.pug
Normal file
17
samples/it_v2/templates/ms365users.pug
Normal file
@@ -0,0 +1,17 @@
|
||||
div#HEADFILES
|
||||
|
||||
table
|
||||
thead
|
||||
th Name
|
||||
th E-Mail
|
||||
th Password
|
||||
th License
|
||||
each itm in node.items
|
||||
tr
|
||||
td=itm.data.name
|
||||
td=itm.data.email
|
||||
td=itm.data.password
|
||||
td=itm.data.license
|
||||
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
20
samples/it_v2/templates/netdevs.pug
Normal file
20
samples/it_v2/templates/netdevs.pug
Normal file
@@ -0,0 +1,20 @@
|
||||
div#HEADFILES
|
||||
table
|
||||
thead
|
||||
th Name
|
||||
th Model
|
||||
th IPs
|
||||
th Location
|
||||
each netdev in node.items
|
||||
tr
|
||||
td
|
||||
a(href=netdev.url)=netdev.data.name
|
||||
td=netdev.data.model
|
||||
td
|
||||
if netdev.data.interfaces
|
||||
each interface in netdev.data.interfaces
|
||||
if interface.ip
|
||||
div=interface.ip
|
||||
td=netdev.data.location
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
22
samples/it_v2/templates/printers.pug
Normal file
22
samples/it_v2/templates/printers.pug
Normal file
@@ -0,0 +1,22 @@
|
||||
div#HEADFILES
|
||||
table
|
||||
thead
|
||||
th Name
|
||||
th Type
|
||||
th Model
|
||||
th IPs
|
||||
th Location
|
||||
each printer in node.items
|
||||
tr
|
||||
td
|
||||
a(href=printer.url)=printer.data.name
|
||||
td=printer.data.type
|
||||
td=printer.data.model
|
||||
td
|
||||
if printer.data.interfaces
|
||||
each interface in printer.data.interfaces
|
||||
if interface.ip
|
||||
div=interface.ip
|
||||
td=printer.data.location
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
16
samples/it_v2/templates/ran.pug
Normal file
16
samples/it_v2/templates/ran.pug
Normal file
@@ -0,0 +1,16 @@
|
||||
div#HEADFILES
|
||||
table
|
||||
thead
|
||||
th Name
|
||||
th Type
|
||||
th Model
|
||||
th Location
|
||||
each ran in node.items
|
||||
tr
|
||||
td
|
||||
a(href=ran.url)=ran.data.name
|
||||
td=ran.data.type
|
||||
td=ran.data.model
|
||||
td=ran.data.location
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
31
samples/it_v2/templates/secrets.pug
Normal file
31
samples/it_v2/templates/secrets.pug
Normal file
@@ -0,0 +1,31 @@
|
||||
div#HEADFILES
|
||||
table
|
||||
tr
|
||||
th
|
||||
th Type
|
||||
th User
|
||||
th Password
|
||||
each item in node.items
|
||||
- var i=0
|
||||
each secret in item.data.secrets
|
||||
tr
|
||||
if i == 0
|
||||
td(style='font-weight:bold')=item.data.name
|
||||
else
|
||||
td
|
||||
if secret.port
|
||||
td=secret.type+' ('+secret.port+')'
|
||||
else
|
||||
td=secret.type
|
||||
td=secret.user
|
||||
td=secret.password
|
||||
if secret.mfa
|
||||
each mfa in secret.mfa
|
||||
tr
|
||||
td
|
||||
td mfa (#{mfa.type})
|
||||
td(colspan=2)=mfa.value
|
||||
|
||||
- i+=1
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
28
samples/it_v2/templates/servers.pug
Normal file
28
samples/it_v2/templates/servers.pug
Normal file
@@ -0,0 +1,28 @@
|
||||
div#HEADFILES
|
||||
table
|
||||
thead
|
||||
th Name
|
||||
th Roles
|
||||
th OS
|
||||
th IPs
|
||||
th Location
|
||||
each server in node.items
|
||||
tr
|
||||
td
|
||||
a(href=server.url)=server.data.name
|
||||
td
|
||||
if server.data.roles
|
||||
each role in server.data.roles
|
||||
div=role
|
||||
if (server.data.os.substr(0,1) == '!')
|
||||
td.alert=server.data.os
|
||||
else
|
||||
td=server.data.os
|
||||
td
|
||||
if server.data.interfaces
|
||||
each interface in server.data.interfaces
|
||||
if interface.ip
|
||||
div=interface.ip
|
||||
td=server.data.location
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
17
samples/it_v2/templates/shares.pug
Normal file
17
samples/it_v2/templates/shares.pug
Normal file
@@ -0,0 +1,17 @@
|
||||
div#HEADFILES
|
||||
|
||||
each srv in node.items
|
||||
h3=srv.data.name
|
||||
h4 Folders
|
||||
table
|
||||
each fileshare in srv.data.fileshares
|
||||
tr
|
||||
td=fileshare.path
|
||||
h4 Printers
|
||||
table
|
||||
each printshare in srv.data.printshares
|
||||
tr
|
||||
td=printshare.path
|
||||
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
14
samples/it_v2/templates/softwares.pug
Normal file
14
samples/it_v2/templates/softwares.pug
Normal file
@@ -0,0 +1,14 @@
|
||||
div#HEADFILES
|
||||
table
|
||||
thead
|
||||
th Name
|
||||
th Publisher
|
||||
th Licenses
|
||||
each software in node.items
|
||||
tr
|
||||
td
|
||||
a(href=software.url)=software.data.name
|
||||
td=software.data.publisher
|
||||
td=software.data.licenses
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
25
samples/it_v2/templates/subnets.pug
Normal file
25
samples/it_v2/templates/subnets.pug
Normal file
@@ -0,0 +1,25 @@
|
||||
div#HEADFILES
|
||||
table
|
||||
thead
|
||||
th Name
|
||||
th Subnet
|
||||
th Gateway
|
||||
th DNS
|
||||
th VLANS
|
||||
each subnet in node.items
|
||||
tr
|
||||
td=subnet.data.name
|
||||
td=subnet.data.subnet
|
||||
td=subnet.data.gw
|
||||
td
|
||||
if subnet.data.dns
|
||||
each dns in subnet.data.dns
|
||||
div=dns
|
||||
td
|
||||
if subnet.data.vlans
|
||||
-var array = []
|
||||
each vlan in subnet.data.vlans
|
||||
-array.push(vlan)
|
||||
div=array
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
59
samples/it_v2/templates/todos.pug
Normal file
59
samples/it_v2/templates/todos.pug
Normal file
@@ -0,0 +1,59 @@
|
||||
div#HEADFILES
|
||||
-
|
||||
let todos = []
|
||||
const readNode = (curNode) => {
|
||||
if(curNode?.todo?.length > 0) {
|
||||
curNode.todo.forEach((itm) => {
|
||||
const nodeItem = {
|
||||
name: curNode.name,
|
||||
url: curNode.url,
|
||||
todo: itm,
|
||||
}
|
||||
todos.push(nodeItem)
|
||||
})
|
||||
}
|
||||
|
||||
curNode.items.forEach((itm) => {
|
||||
if(itm?.data?.todo?.length > 0) {
|
||||
itm.data.todo.forEach((todo) => {
|
||||
const nodeItem = {
|
||||
name: itm.data.name,
|
||||
url: curNode.url + '?itm=' + itm.name,
|
||||
todo: todo,
|
||||
}
|
||||
todos.push(nodeItem)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
curNode.nodes.forEach((childNode) => {
|
||||
readNode(childNode)
|
||||
})
|
||||
}
|
||||
|
||||
readNode(doc)
|
||||
todos = todos.sort((x, y) => {
|
||||
return (y.todo.priority - x.todo.priority)
|
||||
})
|
||||
|
||||
table
|
||||
thead
|
||||
th Priority
|
||||
th Object
|
||||
th Message
|
||||
each itm in todos
|
||||
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
|
||||
45
samples/it_v2/templates/updates.pug
Normal file
45
samples/it_v2/templates/updates.pug
Normal file
@@ -0,0 +1,45 @@
|
||||
div#HEADFILES
|
||||
-
|
||||
const updates = []
|
||||
const readNode = (curNode) => {
|
||||
if(curNode?.data?.updates?.length > 0) {
|
||||
const nodeItem = {
|
||||
name: curNode.data.name,
|
||||
updates: curNode.data.updates,
|
||||
}
|
||||
updates.push(nodeItem)
|
||||
}
|
||||
curNode.items.forEach((itm) => {
|
||||
if(itm?.data?.updates?.length > 0) {
|
||||
const nodeItem = {
|
||||
name: itm.data.name,
|
||||
url: curNode.url + '?itm=' + itm.name,
|
||||
updates: itm.data.updates,
|
||||
}
|
||||
updates.push(nodeItem)
|
||||
}
|
||||
})
|
||||
curNode.nodes.forEach((childNode) => {
|
||||
readNode(childNode)
|
||||
})
|
||||
}
|
||||
readNode(doc)
|
||||
|
||||
table
|
||||
thead
|
||||
th Devices
|
||||
th Types
|
||||
th Method
|
||||
th Frequency
|
||||
th Time
|
||||
th Duration
|
||||
each itm in updates
|
||||
each update in itm.updates
|
||||
tr
|
||||
td
|
||||
a(href=itm.url)=itm.name
|
||||
each key in Object.keys(update)
|
||||
td=update[key]
|
||||
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
11
samples/it_v2/templates/usergroups.pug
Normal file
11
samples/it_v2/templates/usergroups.pug
Normal file
@@ -0,0 +1,11 @@
|
||||
div#HEADFILES
|
||||
|
||||
each dom in node.items
|
||||
h3=dom.data.name
|
||||
table
|
||||
each usergroup in dom.data.usergroups
|
||||
tr
|
||||
td=usergroup.name
|
||||
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
18
samples/it_v2/templates/webdomains.pug
Normal file
18
samples/it_v2/templates/webdomains.pug
Normal file
@@ -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
|
||||
13
samples/it_v2/templates/wifis.pug
Normal file
13
samples/it_v2/templates/wifis.pug
Normal file
@@ -0,0 +1,13 @@
|
||||
div#HEADFILES
|
||||
table
|
||||
thead
|
||||
th Subnet
|
||||
th SSID
|
||||
th Key
|
||||
each wifi in node.items
|
||||
tr
|
||||
td=wifi.data.name
|
||||
td=wifi.data.ssid
|
||||
td=wifi.data.key
|
||||
div#FILES
|
||||
div#FOOTFILES
|
||||
Reference in New Issue
Block a user