Recursive tree version

This commit is contained in:
Magnus Åhall 2026-02-24 17:21:55 +01:00
parent 42c5d43610
commit 97058d036d
8 changed files with 599 additions and 134 deletions

View file

@ -1,3 +1,19 @@
:root {
--line-color: #ccc;
--line-color-record: #eee;
--type-background: #ddd;
--type-foreground: #000;
--label-first: #800033;
--label-rest: #666;
--label-background: #f8f8f8;
--label-border: #ccc;
--copy-color: #d48700;
}
html {
box-sizing: border-box;
}
@ -14,102 +30,151 @@ html {
body {
font-family: sans-serif;
font-size: 12pt;
margin-left: 32px;
}
.records-tree {
display: grid;
grid-template-columns: min-content min-content 1fr;
#records-tree {
white-space: nowrap;
.show {
display: block !important;
}
.folder {
padding-left: 32px;
.top,
.record,
.type,
.value {
display: none;
border-bottom: 1px solid #ccc;
padding: 4px 0px;
}
.top {
font-weight: bold;
background-color: #f8f8f8;
user-select: none;
grid-template-columns: repeat(3, min-content);
align-items: center;
&.top-most {
padding-left: 0px;
}
&.open {
.folder.open {
display: inline-block;
&>.label>img.open {
display: block;
}
.folder.closed {
}
&.closed {
&>.label>img.closed {
display: block;
}
&>.subfolders {
display: none;
}
&>.records {
display: none;
}
}
&:not(.open) {
.folder.open {
&>.label {
display: grid;
grid-template-columns: min-content min-content 1fr;
align-items: center;
padding: 5px 0px;
cursor: pointer;
user-select: none;
/*
background-color: var(--label-background);
width: min-content;
padding: 4px 8px;
border-radius: 4px;
border: 1px solid var(--label-border);
margin-top: 8px;
margin-bottom: 8px;
*/
img {
height: 20px;
margin-right: 6px;
display: none;
}
.folder.closed {
display: inline-block;
}
&>.subfolders {
border-left: 1px solid var(--line-color);
margin-left: 10px;
}
&>.records {
padding-left: 30px;
margin-left: 10px;
display: grid;
grid-template-columns: repeat(3, min-content) 1fr;
grid-gap: 4px 10px;
align-items: center;
border-left: 1px solid var(--line-color);
&>img {
display: block;
padding-left: 4px;
}
.copy {
color: var(--copy-color) !important;
span {
color: var(--copy-color) !important;
}
}
.fqdn {
cursor: pointer;
user-select: none;
.first-label {
color: var(--label-first);
}
.rest-label {
color: var(--label-rest);
}
}
.type {
background-color: var(--type-background);
color: var(--type-foreground);
padding: 4px 8px;
border-radius: 4px;
margin-top: 2px;
margin-bottom: 2px;
width: min-content;
font-weight: bold;
font-size: 0.85em;
}
.value {
cursor: pointer;
user-select: none;
}
.separator {
grid-column: 1 / -1;
&:not(:last-child) {
border-bottom: 1px solid var(--line-color-record);
}
}
}
img {
height: 16px;
display: none;
margin-right: 4px;
}
span:first-child {
color: #800033;
}
span:last-child {
color: #444;
font-weight: normal;
}
}
.top+.type,
.top+.type+.value {
background-color: #f8f8f8;
}
.top-most,
.top-most + .type,
.top-most + .type + .value
{
display:grid;
}
.record {
display: none;
font-weight: normal;
color: #444;
span:first-child {
color: #800033;
}
span:last-child {
color: #888;
}
}
.record+.type,
.record+.type+.value {
display: none;
padding-left: 16px;
}
.record+.type+.value {
color: #800033;
}
}
#record-dialog {
display: grid;
grid-template-columns: min-content 1fr;
grid-gap: 8px;
align-items: center;
.buttons {
grid-column: 1 / -1;
text-align: right;
}
}
input, select, button {
font-size: 1em;
padding: 4px 8px;
}