mirror of
https://github.com/lissy93/networking-toolbox.git
synced 2026-11-25 23:24:14 +03:00
Completed subnetting and cidr reviews
This commit is contained in:
1 parent
51b2a07270
commit
5154628d4a
15 files changed
+1582
-666
No files matched your search
@@ -52,12 +52,21 @@
|
||||
}
|
||||
|
||||
function getSubPages(href: string): (NavItem | NavGroup)[] {
|
||||
return SUB_NAV[href] || [];
|
||||
const pages = SUB_NAV[href] || [];
|
||||
// Sort so that NavGroups (sub-sections) come before NavItems (top-level pages)
|
||||
return pages.sort((a, b) => {
|
||||
const aIsGroup = isNavGroup(a);
|
||||
const bIsGroup = isNavGroup(b);
|
||||
if (aIsGroup && !bIsGroup) return -1; // Groups first
|
||||
if (!aIsGroup && bIsGroup) return 1; // Items second
|
||||
return 0; // Keep original order within same type
|
||||
});
|
||||
}
|
||||
|
||||
function isNavGroup(item: NavItem | NavGroup): item is NavGroup {
|
||||
return 'title' in item && 'items' in item;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<nav class="top-nav" aria-label="Primary navigation">
|
||||
@@ -324,8 +333,8 @@
|
||||
overflow: visible;
|
||||
|
||||
& + .nav-group {
|
||||
margin-top: 0.75rem;
|
||||
padding-top: 0.75rem;
|
||||
margin-top: var(--spacing-xs);
|
||||
padding-top: var(--spacing-xs);
|
||||
border-top: 1px solid var(--border-secondary);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
'calendar': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M144 288L144 368L232 368L232 288L144 288zM144 416L144 480C144 488.8 151.2 496 160 496L232 496L232 416L144 416zM280 288L280 368L360 368L360 288L280 288zM280 416L280 496L360 496L360 416L280 416zM408 288L408 368L496 368L496 288L408 288zM408 416L408 496L480 496C488.8 496 496 488.8 496 480L496 416L408 416z"/><path d="M216 64C229.3 64 240 74.7 240 88L240 128L400 128L400 88C400 74.7 410.7 64 424 64C437.3 64 448 74.7 448 88L448 128L480 128C515.3 128 544 156.7 544 192L544 480C544 515.3 515.3 544 480 544L160 544C124.7 544 96 515.3 96 480L96 192C96 156.7 124.7 128 160 128L192 128L192 88C192 74.7 202.7 64 216 64zM480 496C488.8 496 496 488.8 496 480L496 416L408 416L408 496L480 496zM496 368L496 288L408 288L408 368L496 368zM360 368L360 288L280 288L280 368L360 368zM232 368L232 288L144 288L144 368L232 368zM144 416L144 480C144 488.8 151.2 496 160 496L232 496L232 416L144 416zM280 416L280 496L360 496L360 416L280 416zM216 176L160 176C151.2 176 144 183.2 144 192L144 240L496 240L496 192C496 183.2 488.8 176 480 176L216 176z"/></svg>`,
|
||||
'case': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d=""/><path d="M112 232L112 336L240 336L240 232C240 201.1 214.9 176 184 176L168 176C137.1 176 112 201.1 112 232zM112 384L112 488C112 501.3 101.3 512 88 512C74.7 512 64 501.3 64 488L64 232C64 174.6 110.6 128 168 128L184 128C241.4 128 288 174.6 288 232L288 488C288 501.3 277.3 512 264 512C250.7 512 240 501.3 240 488L240 384L112 384zM456 304C425.1 304 400 329.1 400 360L400 408C400 438.9 425.1 464 456 464L472 464C502.9 464 528 438.9 528 408L528 360C528 329.1 502.9 304 472 304L456 304zM529 273C532 263.2 541.1 256 552 256C565.3 256 576 266.7 576 280L576 398.5C576 423.4 580 448.2 587.9 471.9L590.8 480.5C595 493.1 588.2 506.7 575.6 510.9C563 515.1 549.4 508.3 545.2 495.7L542.3 487.1C542.1 486.5 541.9 485.9 541.7 485.2C523.2 501.9 498.8 512.1 471.9 512.1L455.9 512.1C398.5 512.1 351.9 465.5 351.9 408.1L351.9 360.1C351.9 302.7 398.5 256.1 455.9 256.1L471.9 256.1C493 256.1 512.6 262.4 528.9 273.1z"/></svg>`,
|
||||
'certified': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M208 128C208 119.2 215.2 112 224 112L336 112L336 200C336 239.8 368.2 272 408 272L496 272L496 512C496 520.8 488.8 528 480 528L288 528L288 504.8C317.8 473.3 336 430.8 336 384C336 303.4 281.9 235.5 208 214.6L208 128z"/><path d="M224 112L336 112L336 200C336 239.8 368.2 272 408 272L496 272L496 512C496 520.8 488.8 528 480 528L288 528L288 576L480 576C515.3 576 544 547.3 544 512L544 250.5C544 233.5 537.3 217.2 525.3 205.2L402.7 82.7C390.7 70.7 374.5 64 357.5 64L224 64C188.7 64 160 92.7 160 128L160 208C176.6 208 192.7 210.3 208 214.6L208 128C208 119.2 215.2 112 224 112zM384 131.9L476.1 224L408 224C394.7 224 384 213.3 384 200L384 131.9zM288 384C288 313.3 230.7 256 160 256C89.3 256 32 313.3 32 384C32 424.4 50.7 460.5 80 483.9L80 589C80 599.5 88.5 608 99 608C102.3 608 105.5 607.1 108.4 605.5L160 576L211.6 605.5C214.5 607.1 217.7 608 221 608C231.5 608 240 599.5 240 589L240 483.9C269.3 460.4 288 424.4 288 384zM160 336C186.5 336 208 357.5 208 384C208 410.5 186.5 432 160 432C133.5 432 112 410.5 112 384C112 357.5 133.5 336 160 336z"/></svg>`,
|
||||
'check': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M112 320C112 434.9 205.1 528 320 528C434.9 528 528 434.9 528 320C528 205.1 434.9 112 320 112C205.1 112 112 205.1 112 320zM215.1 343.1C224.5 333.7 239.7 333.7 249 343.1L285 379.1L390.6 233.9C398.4 223.2 413.4 220.8 424.1 228.6C434.8 236.4 437.2 251.4 429.4 262.1L307.4 430.1C303.3 435.8 296.9 439.4 289.9 439.9C282.9 440.4 276 437.9 271.1 433L215.2 377.1C205.8 367.7 205.8 352.5 215.2 343.2z"/><path d="M320 576C178.6 576 64 461.4 64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576zM320 112C205.1 112 112 205.1 112 320C112 434.9 205.1 528 320 528C434.9 528 528 434.9 528 320C528 205.1 434.9 112 320 112zM390.7 233.9C398.5 223.2 413.5 220.8 424.2 228.6C434.9 236.4 437.3 251.4 429.5 262.1L307.4 430.1C303.3 435.8 296.9 439.4 289.9 439.9C282.9 440.4 276 437.9 271.1 433L215.2 377.1C205.8 367.7 205.8 352.5 215.2 343.2C224.6 333.9 239.8 333.8 249.1 343.2L285.1 379.2L390.7 234z"/></svg>`,
|
||||
'check-circle': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M112 320C112 434.9 205.1 528 320 528C434.9 528 528 434.9 528 320C528 205.1 434.9 112 320 112C205.1 112 112 205.1 112 320zM236.8 342.4C228.8 331.8 231 316.8 241.6 308.8C252.2 300.8 267.2 303 275.2 313.6L302.2 349.6L363.6 251.3C370.6 240.1 385.4 236.6 396.7 243.7C408 250.8 411.4 265.5 404.3 276.8L324.3 404.8C320.1 411.5 312.9 415.7 305 416.1C297.1 416.5 289.5 412.9 284.8 406.5L236.8 342.5z"/><path d="M320 112C434.9 112 528 205.1 528 320C528 434.9 434.9 528 320 528C205.1 528 112 434.9 112 320C112 205.1 205.1 112 320 112zM320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM404.4 276.7C411.4 265.5 408 250.7 396.8 243.6C385.6 236.5 370.8 240 363.7 251.2L302.3 349.5L275.3 313.5C267.3 302.9 252.3 300.7 241.7 308.7C231.1 316.7 228.9 331.7 236.9 342.3L284.9 406.3C289.6 412.6 297.2 416.2 305.1 415.9C313 415.6 320.2 411.4 324.4 404.6L404.4 276.6z"/></svg>`,
|
||||
'check': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d=""/><path d="M534 132.5C544.8 140.2 547.2 155.2 539.5 166L275.5 534C271.4 539.7 265 543.4 258 543.9C251 544.4 244 542 239 537L103 401C93.6 391.6 93.6 376.4 103 367.1C112.4 357.8 127.6 357.7 136.9 367.1L253 483L500.5 138C508.2 127.2 523.2 124.8 534 132.5z"/></svg>`,
|
||||
'check-circle': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M112 320C112 434.9 205.1 528 320 528C434.9 528 528 434.9 528 320C528 205.1 434.9 112 320 112C205.1 112 112 205.1 112 320zM215.1 343.1C224.5 333.7 239.7 333.7 249 343.1L285 379.1L390.6 233.9C398.4 223.2 413.4 220.8 424.1 228.6C434.8 236.4 437.2 251.4 429.4 262.1L307.4 430.1C303.3 435.8 296.9 439.4 289.9 439.9C282.9 440.4 276 437.9 271.1 433L215.2 377.1C205.8 367.7 205.8 352.5 215.2 343.2z"/><path d="M320 576C178.6 576 64 461.4 64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576zM320 112C205.1 112 112 205.1 112 320C112 434.9 205.1 528 320 528C434.9 528 528 434.9 528 320C528 205.1 434.9 112 320 112zM390.7 233.9C398.5 223.2 413.5 220.8 424.2 228.6C434.9 236.4 437.3 251.4 429.5 262.1L307.4 430.1C303.3 435.8 296.9 439.4 289.9 439.9C282.9 440.4 276 437.9 271.1 433L215.2 377.1C205.8 367.7 205.8 352.5 215.2 343.2C224.6 333.9 239.8 333.8 249.1 343.2L285.1 379.2L390.7 234z"/></svg>`,
|
||||
'chevron-down': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d=""/><path d="M303.5 473C312.9 482.4 328.1 482.4 337.4 473L537.4 273C546.8 263.6 546.8 248.4 537.4 239.1C528 229.8 512.8 229.7 503.5 239.1L320.5 422.1L137.5 239.1C128.1 229.7 112.9 229.7 103.6 239.1C94.3 248.5 94.2 263.7 103.6 273L303.6 473z"/></svg>`,
|
||||
'chevron-right': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d=""/><path d="M473.5 303C482.9 312.4 482.9 327.6 473.5 336.9L273.5 536.9C264.1 546.3 248.9 546.3 239.6 536.9C230.3 527.5 230.2 512.3 239.6 503L422.6 320L239.6 137C230.2 127.6 230.2 112.4 239.6 103.1C249 93.8 264.2 93.7 273.5 103.1L473.5 303.1z"/></svg>`,
|
||||
'chevron-up': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d=""/><path d="M303.5 167C312.9 157.6 328.1 157.6 337.4 167L537.4 367C546.8 376.4 546.8 391.6 537.4 400.9C528 410.2 512.8 410.3 503.5 400.9L320.5 217.9L137.5 400.9C128.1 410.3 112.9 410.3 103.6 400.9C94.3 391.5 94.2 376.3 103.6 367L303.6 167z"/></svg>`,
|
||||
@@ -147,6 +147,9 @@
|
||||
'key': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M112 449.9L112 528L176 528L176 488C176 474.7 186.7 464 200 464L240 464L240 424C240 410.7 250.7 400 264 400L318.1 400L347.3 370.8C353.2 364.9 361.8 362.5 369.9 364.4C379.5 366.7 389.6 368 400 368C470.7 368 528 310.7 528 240C528 169.3 470.7 112 400 112C329.3 112 272 169.3 272 240C272 250.4 273.2 260.5 275.6 270.1C277.6 278.2 275.2 286.8 269.2 292.7L112 449.9zM464 208C464 225.7 449.7 240 432 240C414.3 240 400 225.7 400 208C400 190.3 414.3 176 432 176C449.7 176 464 190.3 464 208z"/><path d="M272 240C272 169.3 329.3 112 400 112C470.7 112 528 169.3 528 240C528 310.7 470.7 368 400 368C389.6 368 379.5 366.8 369.9 364.4C361.8 362.4 353.2 364.9 347.3 370.8L318.1 400L264 400C250.7 400 240 410.7 240 424L240 464L200 464C186.7 464 176 474.7 176 488L176 528L112 528L112 449.9L269.2 292.7C275.1 286.8 277.5 278.2 275.6 270.1C273.3 260.5 272 250.4 272 240zM400 64C302.8 64 224 142.8 224 240C224 249.5 224.7 258.8 226.2 267.9L71 423C66.5 427.5 64 433.6 64 440L64 552C64 565.3 74.7 576 88 576L200 576C213.3 576 224 565.3 224 552L224 512L264 512C277.3 512 288 501.3 288 488L288 448L328 448C334.4 448 340.5 445.5 345 441L372.2 413.8C381.3 415.2 390.6 416 400.1 416C497.3 416 576.1 337.2 576.1 240C576.1 142.8 497.2 64 400 64zM432 240C449.7 240 464 225.7 464 208C464 190.3 449.7 176 432 176C414.3 176 400 190.3 400 208C400 225.7 414.3 240 432 240z"/></svg>
|
||||
|
||||
<!-- UI Icons-->`,
|
||||
'mask': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M48 128C48 129.1 48.1 129.9 48.2 130.8C49.5 138.3 56.1 144 64 144C72.8 144 80 136.8 80 128C80 120.1 74.3 113.5 66.8 112.2C65.9 112 65 112 64 112C55.2 112 48 119.2 48 128zM48.2 349.2C46.7 357.9 52.5 366.2 61.3 367.8C70 369.3 78.3 363.4 79.8 354.7C81.3 346 75.5 337.7 66.8 336.2C58 334.6 49.7 340.5 48.2 349.2zM240.2 509.2C239 514.9 241 520.9 245.4 524.7C249.9 528.5 256.1 529.6 261.5 527.5C267 525.4 270.9 520.5 271.7 514.7C272.9 509 270.9 503 266.5 499.2C262 495.4 255.8 494.3 250.4 496.4C244.9 498.5 241 503.4 240.2 509.2zM368 128C368 136.8 375.2 144 384 144C392.8 144 400 136.8 400 128C400 119.2 392.8 112 384 112C375.2 112 368 119.2 368 128zM368 352C368 360.8 375.2 368 384 368C392.8 368 400 360.8 400 352C400 343.2 392.8 336 384 336C375.2 336 368 343.2 368 352zM560 288C560 296.8 567.2 304 576 304C584.8 304 592 296.8 592 288C592 279.2 584.8 272 576 272C567.2 272 560 279.2 560 288zM560 512C560 520.8 567.2 528 576 528C584.8 528 592 520.8 592 512C592 503.2 584.8 496 576 496C567.2 496 560 503.2 560 512z"/><path d="M48.2 130.8C48.1 130 48 129.1 48 128.3L48 128.1C48 119.3 55.2 112.1 64 112.1C64.9 112.1 65.9 112.2 66.8 112.3C74.3 113.6 80 120.2 80 128.1C80 136.9 72.8 144.1 64 144.1C56.1 144.1 49.5 138.4 48.2 130.9zM0 128C0 154.9 16.5 177.9 40 187.3L40 292.6C16.5 302.1 0 325.1 0 351.9C0 387.2 28.7 415.9 64 415.9C90.9 415.9 113.9 399.4 123.3 375.9L324.6 375.9C334.1 399.4 357.1 415.9 383.9 415.9C419.2 415.9 447.9 387.2 447.9 351.9C447.9 325 431.4 302 407.9 292.6L407.9 187.3C431.4 177.8 447.9 154.8 447.9 128C447.9 92.7 419.2 64 383.9 64C357 64 334 80.5 324.6 104L123.3 104C113.9 80.5 90.9 64 64 64C28.7 64 0 92.7 0 128zM368 128C368 119.2 375.2 112 384 112C392.8 112 400 119.2 400 128C400 136.8 392.8 144 384 144C375.2 144 368 136.8 368 128zM324.7 152C331.2 168 344 180.9 360 187.3L360 292.6C344 299.1 331.1 311.9 324.7 327.9L123.4 327.9C116.9 311.9 104.1 299 88.1 292.6L88.1 187.3C104.1 180.8 117 168 123.4 152L324.7 152zM384 336C392.8 336 400 343.2 400 352C400 360.8 392.8 368 384 368C375.2 368 368 360.8 368 352C368 343.2 375.2 336 384 336zM80 352C80 359.9 74.3 366.5 66.8 367.8C66 367.9 65.1 368 64.3 368L64.1 368C55.3 368 48.1 360.8 48.1 352C48.1 351.1 48.2 350.1 48.3 349.2C49.6 341.7 56.2 336 64.1 336C72.9 336 80.1 343.2 80.1 352zM516.7 312C523.2 328 536 340.9 552 347.3L552 452.6C536 459.1 523.1 471.9 516.7 487.9L315.4 487.9C308.9 471.9 296.1 459 280.1 452.6L280.1 431.9L232.1 431.9L232.1 452.6C208.6 462.1 192.1 485.1 192.1 511.9C192.1 547.2 220.8 575.9 256.1 575.9C283 575.9 306 559.4 315.4 535.9L516.7 535.9C526.2 559.4 549.2 575.9 576 575.9C611.3 575.9 640 547.2 640 511.9C640 485 623.5 462 600 452.6L600 347.3C623.5 337.8 640 314.8 640 288C640 252.7 611.3 224 576 224C549.1 224 526.1 240.5 516.7 264L464 264L464 273.6C474.7 284.5 483.1 297.5 488.6 312L516.6 312zM576 304C567.2 304 560 296.8 560 288C560 279.2 567.2 272 576 272C584.8 272 592 279.2 592 288C592 296.8 584.8 304 576 304zM271.8 514.7C271 520.5 267.1 525.4 261.6 527.5C256.2 529.6 250 528.5 245.5 524.7C241.1 520.9 239.1 514.9 240.3 509.2C241.1 503.4 245 498.5 250.5 496.4C255.9 494.3 262.1 495.4 266.6 499.2C271 503 273 509 271.8 514.7zM573.3 527.7C565.8 526.4 560.1 519.8 560.1 511.9C560.1 503.1 567.3 495.9 576.1 495.9C584 495.9 590.6 501.6 591.9 509.1L591.9 509.2C592 510.1 592.1 511 592.1 511.9C592.1 520.7 584.9 527.9 576.1 527.9C575.2 527.9 574.2 527.8 573.3 527.7z"/></svg>`,
|
||||
'merge': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d=""/><path d="M64 152C64 138.7 74.7 128 88 128L188.3 128C218.3 128 246.5 142 264.7 165.8L349.5 277.1C358.6 289 372.7 296 387.7 296L494.1 296L455.1 257C445.7 247.6 445.7 232.4 455.1 223.1C464.5 213.8 479.7 213.7 489 223.1L569 303.1C578.4 312.5 578.4 327.7 569 337L489 417C479.6 426.4 464.4 426.4 455.1 417C445.8 407.6 445.7 392.4 455.1 383.1L494.1 344.1L387.7 344.1C372.7 344.1 358.6 351.1 349.5 363L264.7 474.2C246.5 498 218.3 512 188.3 512L88 512C74.7 512 64 501.3 64 488C64 474.7 74.7 464 88 464L188.3 464C203.3 464 217.4 457 226.5 445.1L311.3 333.8C315.2 328.7 319.5 324.1 324.2 320C319.5 315.9 315.2 311.2 311.3 306.2L226.5 194.9C217.4 183 203.3 176 188.3 176L88 176C74.7 176 64 165.3 64 152z"/></svg>`,
|
||||
'split': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d=""/><path d="M455 63C464.4 53.6 479.6 53.6 488.9 63L568.9 143C578.3 152.4 578.3 167.6 568.9 176.9L488.9 256.9C479.5 266.3 464.3 266.3 455 256.9C445.7 247.5 445.6 232.3 455 223L494 184L413.8 184C401.1 184 388.9 189.1 379.9 198.1L257.9 320L379.9 441.9C388.9 450.9 401.1 456 413.8 456L494 456L455 417C445.6 407.6 445.6 392.4 455 383.1C464.4 373.8 479.6 373.7 488.9 383.1L568.9 463.1C578.3 472.5 578.3 487.7 568.9 497L488.9 577C479.5 586.4 464.3 586.4 455 577C445.7 567.6 445.6 552.4 455 543.1L494 504.1L413.8 504.1C388.3 504.1 363.9 494 345.9 476L214.1 344L88 344C74.7 344 64 333.3 64 320C64 306.7 74.7 296 88 296L214.1 296L346 164.1C364 146.1 388.4 136 413.9 136L494.1 136L455.1 97C445.7 87.6 445.7 72.4 455.1 63.1z"/></svg>`,
|
||||
'layers': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M145.2 192L316.6 271.2C318.7 272.2 321.2 272.2 323.3 271.2L494.8 192L323.4 112.7C321.3 111.7 318.8 111.7 316.7 112.7L145.2 192z"/><path d="M323.4 112.7L494.8 192L323.4 271.2C321.3 272.2 318.8 272.2 316.7 271.2L145.2 192L316.6 112.7C318.7 111.7 321.2 111.7 323.3 112.7zM343.5 69.2C328.6 62.3 311.4 62.3 296.5 69.2L77.9 170.2C69.4 174.1 64 182.6 64 192C64 201.4 69.4 209.9 77.9 213.8L296.5 314.8C311.4 321.7 328.6 321.7 343.5 314.8L562.1 213.8C570.6 209.9 576 201.4 576 192C576 182.6 570.6 174.1 562.1 170.2L343.5 69.2zM112.1 282.4L77.9 298.2C69.4 302.1 64 310.6 64 320C64 329.4 69.4 337.9 77.9 341.8L296.5 442.8C311.4 449.7 328.6 449.7 343.5 442.8L562.1 341.8C570.6 337.9 576 329.4 576 320C576 310.6 570.6 302.1 562.1 298.2L528 282.4L470.8 308.8L494.9 319.9L323.5 399.1C321.4 400.1 318.9 400.1 316.8 399.1L145.2 320L169.3 308.9L112.1 282.4zM77.9 426.2C69.4 430.1 64 438.6 64 448C64 457.4 69.4 465.9 77.9 469.8L296.5 570.8C311.4 577.7 328.6 577.7 343.5 570.8L562.1 469.8C570.6 465.9 576 457.4 576 448C576 438.6 570.6 430.1 562.1 426.2L528 410.4L470.8 436.8L494.9 447.9L323.5 527.1C321.4 528.1 318.9 528.1 316.8 527.1L145.4 447.9L169.5 436.8L112.3 410.4L78.2 426.2z"/></svg>`,
|
||||
'layout': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M144 160L144 224L496 224L496 160C496 151.2 488.8 144 480 144L160 144C151.2 144 144 151.2 144 160zM144 272L144 480C144 488.8 151.2 496 160 496L208 496L208 272L144 272zM256 272L256 496L480 496C488.8 496 496 488.8 496 480L496 272L256 272z"/><path d="M480 144C488.8 144 496 151.2 496 160L496 224L144 224L144 160C144 151.2 151.2 144 160 144L480 144zM96 224L96 480C96 515.3 124.7 544 160 544L480 544C515.3 544 544 515.3 544 480L544 160C544 124.7 515.3 96 480 96L160 96C124.7 96 96 124.7 96 160L96 224zM496 480C496 488.8 488.8 496 480 496L256 496L256 272L496 272L496 480zM208 496L160 496C151.2 496 144 488.8 144 480L144 272L208 272L208 496z"/></svg>`,
|
||||
'lightbulb': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M176 256C176 294.4 191 329.2 215.5 355.1C236.8 377.5 260.4 409.1 268.8 448L371.2 448C379.6 409 403.2 377.5 424.5 355.1C449 329.2 464 294.4 464 256C464 176.5 399.5 112 320 112C240.5 112 176 176.5 176 256zM224 248C224 199.4 263.4 160 312 160C325.3 160 336 170.7 336 184C336 197.3 325.3 208 312 208C289.9 208 272 225.9 272 248C272 261.3 261.3 272 248 272C234.7 272 224 261.3 224 248z"/><path d="M424.5 355.1C449 329.2 464 294.4 464 256C464 176.5 399.5 112 320 112C240.5 112 176 176.5 176 256C176 294.4 191 329.2 215.5 355.1C236.8 377.5 260.4 409.1 268.8 448L371.2 448C379.6 409 403.2 377.5 424.5 355.1zM459.3 388.1C435.7 413 416 443.4 416 477.7L416 496C416 540.2 380.2 576 336 576L304 576C259.8 576 224 540.2 224 496L224 477.7C224 443.4 204.3 413 180.7 388.1C148 353.7 128 307.2 128 256C128 150 214 64 320 64C426 64 512 150 512 256C512 307.2 492 353.7 459.3 388.1zM272 248C272 261.3 261.3 272 248 272C234.7 272 224 261.3 224 248C224 199.4 263.4 160 312 160C325.3 160 336 170.7 336 184C336 197.3 325.3 208 312 208C289.9 208 272 225.9 272 248z"/></svg>`,
|
||||
@@ -158,7 +161,7 @@
|
||||
'maximize': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M144 144L220.1 144L144 220.1L144 144zM144 419.9L220.1 496L144 496L144 419.9zM419.9 144L496 144L496 220.1L419.9 144zM419.9 496L496 419.9L496 496L419.9 496z"/><path d="M220.1 144L144 144L144 220.1L220.1 144zM96 256L96 128C96 110.3 110.3 96 128 96L256 96C273.7 96 288 110.3 288 128L288 130.7C288 139.2 284.6 147.3 278.6 153.3L232.9 199L319.9 286L406.9 199L361.2 153.3C355.2 147.3 351.8 139.2 351.8 130.7L351.8 128C351.8 110.3 366.1 96 383.8 96L511.8 96C529.5 96 543.8 110.3 543.8 128L543.8 256C543.8 273.7 529.5 288 511.8 288L509.1 288C500.6 288 492.5 284.6 486.5 278.6L440.8 232.9L353.8 319.9L440.8 406.9L486.5 361.2C492.5 355.2 500.6 351.8 509.1 351.8L511.8 351.8C529.5 351.8 543.8 366.1 543.8 383.8L543.8 511.8C543.8 529.5 529.5 543.8 511.8 543.8L383.8 543.8C366.1 543.8 351.8 529.5 351.8 511.8L351.8 509.1C351.8 500.6 355.2 492.5 361.2 486.5L406.9 440.8L319.9 353.8L232.9 440.8L278.6 486.5C284.6 492.5 288 500.6 288 509.1L288 511.8C288 529.5 273.7 543.8 256 543.8L128 544C110.3 544 96 529.7 96 512L96 384C96 366.3 110.3 352 128 352L130.7 352C139.2 352 147.3 355.4 153.3 361.4L199 407.1L286 320.1L199 233.1L153.3 278.8C147.3 284.8 139.2 288.2 130.7 288.2L128 288C110.3 288 96 273.7 96 256zM419.9 496L496 496L496 419.9L419.9 496zM144 419.9L144 496L220.1 496L144 419.9zM419.9 144L496 220.1L496 144L419.9 144z"/></svg>`,
|
||||
'minus': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d=""/><path d="M96 320C96 306.7 106.7 296 120 296L520 296C533.3 296 544 306.7 544 320C544 333.3 533.3 344 520 344L120 344C106.7 344 96 333.3 96 320z"/></svg>`,
|
||||
'minus-circle': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M112 320C112 434.9 205.1 528 320 528C434.9 528 528 434.9 528 320C528 205.1 434.9 112 320 112C205.1 112 112 205.1 112 320zM208 320C208 306.7 218.7 296 232 296L408 296C421.3 296 432 306.7 432 320C432 333.3 421.3 344 408 344L232 344C218.7 344 208 333.3 208 320z"/><path d="M320 112C434.9 112 528 205.1 528 320C528 434.9 434.9 528 320 528C205.1 528 112 434.9 112 320C112 205.1 205.1 112 320 112zM320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM232 296C218.7 296 208 306.7 208 320C208 333.3 218.7 344 232 344L408 344C421.3 344 432 333.3 432 320C432 306.7 421.3 296 408 296L232 296z"/></svg>`,
|
||||
'network': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M40 368C40 381.3 50.7 392 64 392C77.3 392 88 381.3 88 368C88 354.7 77.3 344 64 344C50.7 344 40 354.7 40 368zM200 128C200 141.3 210.7 152 224 152C237.3 152 248 141.3 248 128C248 114.7 237.3 104 224 104C210.7 104 200 114.7 200 128zM240 368C240 421 283 464 336 464C389 464 432 421 432 368C432 315 389 272 336 272C283 272 240 315 240 368zM552 192C552 205.3 562.7 216 576 216C589.3 216 600 205.3 600 192C600 178.7 589.3 168 576 168C562.7 168 552 178.7 552 192zM552 512C552 525.3 562.7 536 576 536C589.3 536 600 525.3 600 512C600 498.7 589.3 488 576 488C562.7 488 552 498.7 552 512z"/><path d="M224 104C237.3 104 248 114.7 248 128C248 141.3 237.3 152 224 152C210.7 152 200 141.3 200 128C200 114.7 210.7 104 224 104zM224 192C225.1 192 226.2 192 227.3 191.9L254.2 249.5C222.9 271.2 200.5 304.9 194 344L123.4 344C113.9 320.5 90.9 304 64.1 304C28.8 304 .1 332.7 .1 368C.1 403.3 28.8 432 64.1 432C91 432 114 415.5 123.4 392L194 392C205.4 460.1 264.7 512 336 512C379.8 512 419 492.5 445.4 461.6L512.8 502C512.3 505.2 512 508.6 512 511.9C512 547.2 540.7 575.9 576 575.9C611.3 575.9 640 547.2 640 511.9C640 476.6 611.3 447.9 576 447.9C561.5 447.9 548.2 452.7 537.5 460.8L470.2 420.4C476.6 404.1 480.1 386.4 480.1 367.9C480.1 344.7 474.6 322.7 464.8 303.3L542.4 246.4C552.2 252.5 563.7 256 576.1 256C611.4 256 640.1 227.3 640.1 192C640.1 156.7 611.4 128 576.1 128C540.8 128 512.1 156.7 512.1 192C512.1 197.4 512.8 202.7 514 207.7L436.4 264.6C410.5 239.4 375.1 223.9 336.1 223.9C322.8 223.9 310 225.7 297.8 229.1L270.9 171.6C281.5 160.2 288 144.9 288 128C288 92.7 259.3 64 224 64C188.7 64 160 92.7 160 128C160 163.3 188.7 192 224 192zM576 168C589.3 168 600 178.7 600 192C600 205.3 589.3 216 576 216C562.7 216 552 205.3 552 192C552 178.7 562.7 168 576 168zM552 512C552 498.7 562.7 488 576 488C589.3 488 600 498.7 600 512C600 525.3 589.3 536 576 536C562.7 536 552 525.3 552 512zM64 344C77.3 344 88 354.7 88 368C88 381.3 77.3 392 64 392C50.7 392 40 381.3 40 368C40 354.7 50.7 344 64 344zM336 272C389 272 432 315 432 368C432 421 389 464 336 464C283 464 240 421 240 368C240 315 283 272 336 272z"/></svg>`,
|
||||
'network': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M112 272C112 289.7 126.3 304 144 304C161.7 304 176 289.7 176 272C176 254.3 161.7 240 144 240C126.3 240 112 254.3 112 272zM368 496C368 513.7 382.3 528 400 528C417.7 528 432 513.7 432 496C432 478.3 417.7 464 400 464C382.3 464 368 478.3 368 496zM432 144C432 161.7 446.3 176 464 176C481.7 176 496 161.7 496 144C496 126.3 481.7 112 464 112C446.3 112 432 126.3 432 144z"/><path d="M432 144C432 126.3 446.3 112 464 112C481.7 112 496 126.3 496 144C496 161.7 481.7 176 464 176C446.3 176 432 161.7 432 144zM402.1 194.6C408.9 202.9 417.3 209.8 426.8 214.8L390 416.6C378.5 418 367.8 421.9 358.3 427.7L217.3 304.2C221.6 294.3 224 283.5 224 272C224 270 223.9 267.9 223.8 265.9L402.1 194.6zM474 223.4C513.5 218.5 544 184.8 544 144C544 99.8 508.2 64 464 64C419.8 64 384 99.8 384 144C384 146 384.1 148.1 384.2 150.1L205.9 221.4C191.3 203.4 169 192 144 192C99.8 192 64 227.8 64 272C64 316.2 99.8 352 144 352C159.3 352 173.5 347.7 185.6 340.3L326.7 463.8C322.4 473.7 320 484.5 320 496C320 540.2 355.8 576 400 576C444.2 576 480 540.2 480 496C480 465.3 462.7 438.6 437.3 425.2L474 223.4zM368 496C368 478.3 382.3 464 400 464C417.7 464 432 478.3 432 496C432 513.7 417.7 528 400 528C382.3 528 368 513.7 368 496zM144 240C161.7 240 176 254.3 176 272C176 289.7 161.7 304 144 304C126.3 304 112 289.7 112 272C112 254.3 126.3 240 144 240z"/></svg>`,
|
||||
'network-classes': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M40 368C40 381.3 50.7 392 64 392C77.3 392 88 381.3 88 368C88 354.7 77.3 344 64 344C50.7 344 40 354.7 40 368zM200 128C200 141.3 210.7 152 224 152C237.3 152 248 141.3 248 128C248 114.7 237.3 104 224 104C210.7 104 200 114.7 200 128zM240 368C240 421 283 464 336 464C389 464 432 421 432 368C432 315 389 272 336 272C283 272 240 315 240 368zM552 192C552 205.3 562.7 216 576 216C589.3 216 600 205.3 600 192C600 178.7 589.3 168 576 168C562.7 168 552 178.7 552 192zM552 512C552 525.3 562.7 536 576 536C589.3 536 600 525.3 600 512C600 498.7 589.3 488 576 488C562.7 488 552 498.7 552 512z"/><path d="M224 104C237.3 104 248 114.7 248 128C248 141.3 237.3 152 224 152C210.7 152 200 141.3 200 128C200 114.7 210.7 104 224 104zM224 192C225.1 192 226.2 192 227.3 191.9L254.2 249.5C222.9 271.2 200.5 304.9 194 344L123.4 344C113.9 320.5 90.9 304 64.1 304C28.8 304 .1 332.7 .1 368C.1 403.3 28.8 432 64.1 432C91 432 114 415.5 123.4 392L194 392C205.4 460.1 264.7 512 336 512C379.8 512 419 492.5 445.4 461.6L512.8 502C512.3 505.2 512 508.6 512 511.9C512 547.2 540.7 575.9 576 575.9C611.3 575.9 640 547.2 640 511.9C640 476.6 611.3 447.9 576 447.9C561.5 447.9 548.2 452.7 537.5 460.8L470.2 420.4C476.6 404.1 480.1 386.4 480.1 367.9C480.1 344.7 474.6 322.7 464.8 303.3L542.4 246.4C552.2 252.5 563.7 256 576.1 256C611.4 256 640.1 227.3 640.1 192C640.1 156.7 611.4 128 576.1 128C540.8 128 512.1 156.7 512.1 192C512.1 197.4 512.8 202.7 514 207.7L436.4 264.6C410.5 239.4 375.1 223.9 336.1 223.9C322.8 223.9 310 225.7 297.8 229.1L270.9 171.6C281.5 160.2 288 144.9 288 128C288 92.7 259.3 64 224 64C188.7 64 160 92.7 160 128C160 163.3 188.7 192 224 192zM576 168C589.3 168 600 178.7 600 192C600 205.3 589.3 216 576 216C562.7 216 552 205.3 552 192C552 178.7 562.7 168 576 168zM552 512C552 498.7 562.7 488 576 488C589.3 488 600 498.7 600 512C600 525.3 589.3 536 576 536C562.7 536 552 525.3 552 512zM64 344C77.3 344 88 354.7 88 368C88 381.3 77.3 392 64 392C50.7 392 40 381.3 40 368C40 354.7 50.7 344 64 344zM336 272C389 272 432 315 432 368C432 421 389 464 336 464C283 464 240 421 240 368C240 315 283 272 336 272z"/></svg>`,
|
||||
'network-ping': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M155.2 321.2C138.2 341.5 140.8 371.8 161.1 388.9C165.7 392.7 171 395.8 177.1 397.7C254 422.5 331 447.2 407.9 472L222.8 315.2L218.9 312.3C198.8 298.6 171.2 302.1 155.2 321.2zM216 352C216 365.3 205.3 376 192 376C178.7 376 168 365.3 168 352C168 338.7 178.7 328 192 328C205.3 328 216 338.7 216 352zM400 192C400 218.5 421.5 240 448 240C474.5 240 496 218.5 496 192C496 165.5 474.5 144 448 144C421.5 144 400 165.5 400 192z"/><path d="M496 192C496 165.5 474.5 144 448 144C421.5 144 400 165.5 400 192C400 218.5 421.5 240 448 240C474.5 240 496 218.5 496 192zM448 96C501 96 544 139 544 192C544 245 501 288 448 288C395 288 352 245 352 192C352 139 395 96 448 96zM118.5 290.3C152.6 249.7 213.1 244.4 253.7 278.5L499.7 486.8L480 512L479.9 512.1L480 512.1L508 527.5L506.6 529.9C498.8 541.5 484 547.1 470.1 542.5L162.3 443.3C153.3 440.4 144.9 436.2 137.5 431L130.3 425.5C89.7 391.4 84.3 330.8 118.4 290.2zM480 512L499.7 486.8C512.2 496.6 515.5 513.9 508 527.4L480 512zM218.9 312.3C198.8 298.6 171.2 302.1 155.2 321.2C138.2 341.5 140.8 371.8 161.1 388.9L161.1 388.9C165.6 392.7 171 395.8 177.1 397.7L177.1 397.7L407.9 472L222.8 315.2L218.9 312.3zM192 328C205.3 328 216 338.7 216 352C216 365.3 205.3 376 192 376C178.7 376 168 365.3 168 352C168 338.7 178.7 328 192 328z"/></svg>`,
|
||||
'network-port': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M112 304L112 464L152 464L152 408C152 394.7 162.7 384 176 384C189.3 384 200 394.7 200 408L200 464L248 464L248 408C248 394.7 258.7 384 272 384C285.3 384 296 394.7 296 408L296 464L344 464L344 408C344 394.7 354.7 384 368 384C381.3 384 392 394.7 392 408L392 464L440 464L440 408C440 394.7 450.7 384 464 384C477.3 384 488 394.7 488 408L488 464L528 464L528 304L488 304C474.7 304 464 293.3 464 280L464 240L424 240C410.7 240 400 229.3 400 216L400 176L240 176L240 216C240 229.3 229.3 240 216 240L176 240L176 280C176 293.3 165.3 304 152 304L112 304z"/><path d="M192 160C192 142.3 206.3 128 224 128L416 128C433.7 128 448 142.3 448 160L448 192L480 192C497.7 192 512 206.3 512 224L512 256L544 256C561.7 256 576 270.3 576 288L576 480C576 497.7 561.7 512 544 512L96 512C78.3 512 64 497.7 64 480L64 288C64 270.3 78.3 256 96 256L128 256L128 224C128 206.3 142.3 192 160 192L192 192L192 160zM240 176L240 216C240 229.3 229.3 240 216 240L176 240L176 280C176 293.3 165.3 304 152 304L112 304L112 464L152 464L152 408C152 394.7 162.7 384 176 384C189.3 384 200 394.7 200 408L200 464L248 464L248 408C248 394.7 258.7 384 272 384C285.3 384 296 394.7 296 408L296 464L344 464L344 408C344 394.7 354.7 384 368 384C381.3 384 392 394.7 392 408L392 464L440 464L440 408C440 394.7 450.7 384 464 384C477.3 384 488 394.7 488 408L488 464L528 464L528 304L488 304C474.7 304 464 293.3 464 280L464 240L424 240C410.7 240 400 229.3 400 216L400 176L240 176z"/></svg>`,
|
||||
@@ -177,6 +180,9 @@
|
||||
'bookmark-add': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M128 128L128 544C128 555.5 134.2 566.2 144.2 571.8C154.2 577.4 166.5 577.3 176.4 571.4L320 485.3L463.5 571.4C473.4 577.3 485.7 577.5 495.7 571.8C505.7 566.1 512 555.5 512 544L512 128C512 92.7 483.3 64 448 64L192 64C156.7 64 128 92.7 128 128zM224 288C224 274.7 234.7 264 248 264L296 264L296 216C296 202.7 306.7 192 320 192C333.3 192 344 202.7 344 216L344 264L392 264C405.3 264 416 274.7 416 288C416 301.3 405.3 312 392 312L344 312L344 360C344 373.3 333.3 384 320 384C306.7 384 296 373.3 296 360L296 312L248 312C234.7 312 224 301.3 224 288z"/><path d="M344 216C344 202.7 333.3 192 320 192C306.7 192 296 202.7 296 216L296 264L248 264C234.7 264 224 274.7 224 288C224 301.3 234.7 312 248 312L296 312L296 360C296 373.3 306.7 384 320 384C333.3 384 344 373.3 344 360L344 312L392 312C405.3 312 416 301.3 416 288C416 274.7 405.3 264 392 264L344 264L344 216z"/></svg>`,
|
||||
'bookmark-remove': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M128 229.8L128 544C128 555.5 134.2 566.2 144.2 571.8C154.2 577.4 166.5 577.3 176.4 571.4L319.9 485.3L321.2 486.1L358.2 460.2L127.8 229.8z"/><path d="M39 39.1C48.4 29.7 63.6 29.7 72.9 39.1L134.2 100.4C144.5 78.9 166.5 64 192 64L448 64C483.3 64 512 92.7 512 128L512 478.2L601 567.2C610.4 576.6 610.4 591.8 601 601.1C591.6 610.4 576.4 610.5 567.1 601.1L39 73.1C29.7 63.7 29.7 48.5 39 39.1z"/></svg>`,
|
||||
'link': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M224 323.5C224 367.4 242.1 407.1 271.2 435.5C286.9 450.8 305.7 462.8 326.7 470.5C343.5 476.6 361.6 480 380.4 480C421.9 480 461.7 463.5 491 434.2L562.1 363.1C591.5 333.7 608 293.9 608 252.5C608 166 538 96 451.5 96C410.1 96 370.3 112.5 340.9 141.8L313.2 169.5C334.1 177.2 353 189.3 368.6 204.6L386.1 187.1C403.4 169.8 427 160 451.5 160C502.6 160 544 201.4 544 252.5C544 277 534.3 300.5 516.9 317.9L445.8 389C428.5 406.3 404.9 416.1 380.3 416.1C355.5 416.1 333 406.3 316.4 390.4C298.9 373.6 287.9 349.9 287.9 323.7C287.9 299.2 297.6 275.7 315 258.3L323.3 250C306.7 234.1 284.3 224.2 259.4 224.2C236.6 252.1 223.9 287.3 223.9 323.7z"/><path d="M194.2 251.1C211.5 233.8 235.1 224 259.6 224C310.5 224 352.1 265.7 352.1 316.9C352.1 341.1 342.5 364.4 325.5 381.4L316.6 390.3C333.2 406.2 355.7 416 380.4 416C403.4 388.3 416.1 353.1 416.1 316.9C416.1 230.6 346.2 160 259.6 160C218.1 160 178.3 176.5 149 205.8L77.8 276.9C48.5 306.3 32 346.1 32 387.5C32 474 102 544 188.5 544C229.9 544 269.7 527.5 299.1 498.2L326.7 470.6C305.7 462.9 286.9 450.9 271.2 435.6L253.8 453C236.5 470.3 212.9 480.1 188.4 480.1C137.3 480.1 95.9 438.7 95.9 387.6C95.9 363.1 105.6 339.6 123 322.2L194.1 251.1z"/></svg>`,
|
||||
'zoom-out': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M112 272C112 360.4 183.6 432 272 432C360.4 432 432 360.4 432 272C432 183.6 360.4 112 272 112C183.6 112 112 183.6 112 272zM176 272C176 258.7 186.7 248 200 248L344 248C357.3 248 368 258.7 368 272C368 285.3 357.3 296 344 296L200 296C186.7 296 176 285.3 176 272z"/><path d="M272 112C360.4 112 432 183.6 432 272C432 360.4 360.4 432 272 432C183.6 432 112 360.4 112 272C112 183.6 183.6 112 272 112zM272 480C320.8 480 365.7 463.2 401.1 435.1L535 569C544.4 578.4 559.6 578.4 568.9 569C578.2 559.6 578.3 544.4 568.9 535.1L435.1 401.1C463.2 365.7 480 320.8 480 272C480 157.1 386.9 64 272 64C157.1 64 64 157.1 64 272C64 386.9 157.1 480 272 480zM200 248C186.7 248 176 258.7 176 272C176 285.3 186.7 296 200 296L344 296C357.3 296 368 285.3 368 272C368 258.7 357.3 248 344 248L200 248z"/></svg>`,
|
||||
'zoom-in': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M112 272C112 360.4 183.6 432 272 432C360.4 432 432 360.4 432 272C432 183.6 360.4 112 272 112C183.6 112 112 183.6 112 272zM176 272C176 258.7 186.7 248 200 248L248 248L248 200C248 186.7 258.7 176 272 176C285.3 176 296 186.7 296 200L296 248L344 248C357.3 248 368 258.7 368 272C368 285.3 357.3 296 344 296L296 296L296 344C296 357.3 285.3 368 272 368C258.7 368 248 357.3 248 344L248 296L200 296C186.7 296 176 285.3 176 272z"/><path d="M272 112C360.4 112 432 183.6 432 272C432 360.4 360.4 432 272 432C183.6 432 112 360.4 112 272C112 183.6 183.6 112 272 112zM272 480C320.8 480 365.7 463.2 401.1 435.1L535 569C544.4 578.4 559.6 578.4 568.9 569C578.2 559.6 578.3 544.4 568.9 535.1L435.1 401.1C463.2 365.7 480 320.8 480 272C480 157.1 386.9 64 272 64C157.1 64 64 157.1 64 272C64 386.9 157.1 480 272 480zM272 176C258.7 176 248 186.7 248 200L248 248L200 248C186.7 248 176 258.7 176 272C176 285.3 186.7 296 200 296L248 296L248 344C248 357.3 258.7 368 272 368C285.3 368 296 357.3 296 344L296 296L344 296C357.3 296 368 285.3 368 272C368 258.7 357.3 248 344 248L296 248L296 200C296 186.7 285.3 176 272 176z"/></svg>`,
|
||||
'scissors': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d=""/><path d="M112 176C112 140.7 140.7 112 176 112C211.3 112 240 140.7 240 176C240 211.3 211.3 240 176 240C140.7 240 112 211.3 112 176zM288 176C288 114.1 237.9 64 176 64C114.1 64 64 114.1 64 176C64 237.9 114.1 288 176 288C200 288 222.3 280.4 240.5 267.6L297.8 320L240.5 372.4C222.3 359.6 200 352 176 352C114.1 352 64 402.1 64 464C64 525.9 114.1 576 176 576C237.9 576 288 525.9 288 464C288 443.5 282.5 424.4 272.9 407.8L568.2 137.7C578 128.8 578.7 113.6 569.7 103.8C560.7 94 545.6 93.3 535.8 102.3L333.4 287.5L272.9 232.2C282.5 215.7 288 196.5 288 176zM535.8 537.7C545.6 546.6 560.8 546 569.7 536.2C578.6 526.4 578 511.2 568.2 502.3L402.6 350.8L366.7 383L535.8 537.7zM112 464C112 428.7 140.7 400 176 400C211.3 400 240 428.7 240 464C240 499.3 211.3 528 176 528C140.7 528 112 499.3 112 464z"/></svg>`,
|
||||
|
||||
'ptr-generator': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M208 136L208 416L284.8 313.6C289.3 307.6 296.4 304 304 304L432 304L208 136z"/><path d="M198.4 68.8C191.1 63.3 181.4 62.5 173.3 66.5C165.2 70.5 160 78.9 160 88L160 488C160 498.3 166.6 507.5 176.4 510.8C186.2 514.1 197 510.7 203.2 502.4L299.9 373.4L394.5 562.7C400.4 574.6 414.8 579.4 426.7 573.4C438.6 567.4 443.4 553.1 437.4 541.2L342.7 351.9L503.9 351.9C514.2 351.9 523.4 345.3 526.7 335.5C530 325.7 526.6 314.9 518.3 308.7L198.4 68.8zM208 416L208 136L432 304L304 304C296.4 304 289.3 307.6 284.8 313.6L208 416z"/></svg>`,
|
||||
'random-ip': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M66.5 306.7C56.2 345.1 79 384.6 117.4 394.9L306.9 445.7C345.3 456 384.8 433.2 395.1 394.8L445.9 205.3C455.5 169.3 436.1 132.4 402 119.4L395 117.1L205.5 66.3L198.3 64.8C164.6 59.3 131.6 78.4 119.5 110.2L117.2 117.2L66.4 306.7zM186.9 296C193 305.9 193.2 318.4 187.5 328.5C181.8 338.6 171 344.8 159.3 344.7C147.7 344.6 137.1 338.2 131.5 328C125.4 318.1 125.2 305.6 130.9 295.5C136.6 285.4 147.4 279.2 159.1 279.3C170.7 279.4 181.3 285.8 186.9 296zM227.9 143C234 152.9 234.2 165.4 228.5 175.5C222.8 185.6 212 191.8 200.3 191.7C188.7 191.6 178.1 185.2 172.5 175C166.4 165.1 166.2 152.6 171.9 142.5C177.6 132.4 188.4 126.2 200.1 126.3C211.7 126.4 222.3 132.8 227.9 143zM283.9 240C290 249.9 290.2 262.4 284.5 272.5C278.8 282.6 268 288.8 256.3 288.7C244.7 288.6 234.1 282.2 228.5 272C222.4 262.1 222.2 249.6 227.9 239.5C233.6 229.4 244.4 223.2 256.1 223.3C267.7 223.4 278.3 229.8 283.9 240zM339.9 337C346 346.9 346.2 359.4 340.5 369.5C334.8 379.6 324 385.8 312.3 385.7C300.7 385.6 290.1 379.2 284.5 369C278.4 359.1 278.2 346.6 283.9 336.5C289.6 326.4 300.4 320.2 312.1 320.3C323.7 320.4 334.3 326.8 339.9 337zM380.9 184C387 193.9 387.2 206.4 381.5 216.5C375.8 226.6 365 232.8 353.3 232.7C341.7 232.6 331.1 226.2 325.5 216C319.4 206.1 319.2 193.6 324.9 183.5C330.6 173.4 341.4 167.2 353.1 167.3C364.7 167.4 375.3 173.8 380.9 184z"/><path d="M184.2 131.3C174 136.9 167.6 147.5 167.5 159.1C167.4 170.8 173.6 181.6 183.7 187.3C193.8 193 206.3 192.8 216.2 186.7C226.4 181.1 232.8 170.5 232.9 158.9C233 147.2 226.8 136.4 216.7 130.7C206.6 125 194.1 125.2 184.2 131.3zM369.2 227.7C379.4 222.1 385.8 211.5 385.9 199.9C386 188.2 379.8 177.4 369.7 171.7C359.6 166 347.1 166.2 337.2 172.3C327 177.9 320.6 188.5 320.5 200.1C320.4 211.8 326.6 222.6 336.7 228.3C346.8 234 359.3 233.8 369.2 227.7zM272.2 283.7C282.4 278.1 288.8 267.5 288.9 255.9C289 244.2 282.8 233.4 272.7 227.7C262.6 222 250.1 222.2 240.2 228.3C230 233.9 223.6 244.5 223.5 256.1C223.4 267.8 229.6 278.6 239.7 284.3C249.8 290 262.3 289.8 272.2 283.7zM175.2 339.7C185.4 334.1 191.8 323.5 191.9 311.9C192 300.2 185.8 289.4 175.7 283.7C165.6 278 153.1 278.2 143.2 284.3C133 289.9 126.6 300.5 126.5 312.1C126.4 323.8 132.6 334.6 142.7 340.3C152.8 346 165.3 345.8 175.2 339.7zM296.2 325.3C286 330.9 279.6 341.5 279.5 353.1C279.4 364.8 285.6 375.6 295.7 381.3C305.8 387 318.3 386.8 328.2 380.7C338.4 375.1 344.8 364.5 344.9 352.9C345 341.2 338.8 330.4 328.7 324.7C318.6 319 306.1 319.2 296.2 325.3zM256.2 481.8L256.2 512C256.2 547.3 284.9 576 320.2 576L512.2 576C547.5 576 576.2 547.3 576.2 512L576.2 320C576.2 284.7 547.5 256 512.2 256L482 256L441.5 407.2C424.9 469.2 362.6 506.8 300.5 493.5L294.5 492.1L256.2 481.8z"/></svg>`,
|
||||
@@ -265,8 +271,8 @@
|
||||
return iconMap[iconName];
|
||||
}
|
||||
|
||||
// Get the SVG content for the current icon
|
||||
const svgContent = getSvgContent(name);
|
||||
// Get the SVG content for the current icon (reactive to name changes)
|
||||
const svgContent = $derived(getSvgContent(name));
|
||||
</script>
|
||||
|
||||
<div class="icon {sizeClasses[size]} {animate ? `animate-${animate}` : ''}">
|
||||
|
||||
@@ -1,28 +1,158 @@
|
||||
<script lang="ts">
|
||||
import { checkCIDRAlignment, type AlignmentResult } from '$lib/utils/cidr-alignment.js';
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import '../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let inputText = $state('192.168.1.0/24\n10.0.0.0-10.0.0.255\n172.16.1.5');
|
||||
let targetPrefix = $state(24);
|
||||
let result = $state<AlignmentResult | null>(null);
|
||||
let isLoading = $state(false);
|
||||
let copiedStates = $state<Record<string, boolean>>({});
|
||||
let selectedExample = $state<string | null>(null);
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
let userModified = $state(false);
|
||||
let validationErrors = $state<string[]>([]);
|
||||
|
||||
const examples = [
|
||||
{
|
||||
label: 'Basic IPv4 Alignment',
|
||||
input: `192.168.1.0/24
|
||||
192.168.2.0/24
|
||||
192.168.3.0/24`,
|
||||
targetPrefix: 22
|
||||
},
|
||||
{
|
||||
label: 'Mixed IP Types',
|
||||
input: `10.0.0.0-10.0.0.255
|
||||
172.16.5.100
|
||||
192.168.1.0/25`,
|
||||
targetPrefix: 24
|
||||
},
|
||||
{
|
||||
label: 'Subnet Aggregation Check',
|
||||
input: `192.168.0.0/26
|
||||
192.168.0.64/26
|
||||
192.168.0.128/26
|
||||
192.168.0.192/26`,
|
||||
targetPrefix: 24
|
||||
},
|
||||
{
|
||||
label: 'Network Consolidation',
|
||||
input: `10.1.0.0/24
|
||||
10.1.1.0/24
|
||||
10.1.2.0/24
|
||||
10.1.3.0/24`,
|
||||
targetPrefix: 22
|
||||
},
|
||||
{
|
||||
label: 'VLAN Alignment Check',
|
||||
input: `172.16.10.0/24
|
||||
172.16.11.0/24
|
||||
172.16.15.0/24
|
||||
172.16.20.0/24`,
|
||||
targetPrefix: 20
|
||||
},
|
||||
{
|
||||
label: 'Point-to-Point Links',
|
||||
input: `192.168.100.0/30
|
||||
192.168.100.4/30
|
||||
192.168.100.8/30
|
||||
192.168.100.12/30`,
|
||||
targetPrefix: 28
|
||||
}
|
||||
];
|
||||
|
||||
function validateTargetPrefix(): string[] {
|
||||
const errors: string[] = [];
|
||||
|
||||
// Check if target prefix is a valid number
|
||||
if (isNaN(targetPrefix) || targetPrefix === null || targetPrefix === undefined) {
|
||||
errors.push('Target prefix length must be a valid number');
|
||||
return errors;
|
||||
}
|
||||
|
||||
// Check if target prefix is within basic bounds
|
||||
if (targetPrefix < 0 || targetPrefix > 128) {
|
||||
errors.push('Target prefix length must be between 0 and 128');
|
||||
return errors;
|
||||
}
|
||||
|
||||
// Check if inputs exist to validate against
|
||||
if (!inputText.trim()) {
|
||||
return errors;
|
||||
}
|
||||
|
||||
// Analyze input types to determine valid prefix ranges
|
||||
const inputs = inputText.split('\n').filter(line => line.trim());
|
||||
let hasIPv4 = false;
|
||||
let hasIPv6 = false;
|
||||
|
||||
for (const input of inputs) {
|
||||
const trimmed = input.trim();
|
||||
if (!trimmed) continue;
|
||||
|
||||
// Check for IPv6 (contains colons)
|
||||
if (trimmed.includes(':')) {
|
||||
hasIPv6 = true;
|
||||
}
|
||||
// Check for IPv4 patterns
|
||||
else if (trimmed.match(/^\d+\.\d+\.\d+\.\d+/) || trimmed.includes('-') || trimmed.includes('/')) {
|
||||
hasIPv4 = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Validate prefix length based on IP types present
|
||||
if (hasIPv4 && !hasIPv6 && targetPrefix > 32) {
|
||||
errors.push('Target prefix length cannot exceed 32 for IPv4 addresses');
|
||||
}
|
||||
|
||||
if (hasIPv6 && targetPrefix > 128) {
|
||||
errors.push('Target prefix length cannot exceed 128 for IPv6 addresses');
|
||||
}
|
||||
|
||||
// Additional practical validation
|
||||
if (targetPrefix === 0) {
|
||||
errors.push('Target prefix length of 0 is not practical for alignment checking');
|
||||
}
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
function checkAlignment() {
|
||||
// Reset validation errors
|
||||
validationErrors = [];
|
||||
|
||||
if (!inputText.trim()) {
|
||||
result = null;
|
||||
return;
|
||||
}
|
||||
|
||||
isLoading = true;
|
||||
|
||||
try {
|
||||
const inputs = inputText.split('\n').filter(line => line.trim());
|
||||
result = checkCIDRAlignment(inputs, targetPrefix);
|
||||
} catch (error) {
|
||||
|
||||
// Validate target prefix first
|
||||
const prefixErrors = validateTargetPrefix();
|
||||
if (prefixErrors.length > 0) {
|
||||
validationErrors = prefixErrors;
|
||||
result = {
|
||||
checks: [],
|
||||
summary: { totalInputs: 0, alignedInputs: 0, misalignedInputs: 0, alignmentRate: 0 },
|
||||
errors: [error instanceof Error ? error.message : 'Unknown error']
|
||||
errors: prefixErrors
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
isLoading = true;
|
||||
|
||||
try {
|
||||
const inputs = inputText.split('\n').filter(line => line.trim());
|
||||
result = checkCIDRAlignment(inputs, targetPrefix);
|
||||
validationErrors = []; // Clear validation errors on success
|
||||
} catch (error) {
|
||||
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
||||
validationErrors = [errorMessage];
|
||||
result = {
|
||||
checks: [],
|
||||
summary: { totalInputs: 0, alignedInputs: 0, misalignedInputs: 0, alignmentRate: 0 },
|
||||
errors: [errorMessage]
|
||||
};
|
||||
} finally {
|
||||
isLoading = false;
|
||||
@@ -57,8 +187,30 @@
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
function copyToClipboard(text: string) {
|
||||
navigator.clipboard.writeText(text);
|
||||
async function copyToClipboard(text: string, id: string) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
copiedStates[id] = true;
|
||||
setTimeout(() => {
|
||||
copiedStates[id] = false;
|
||||
}, 2000);
|
||||
} catch (err) {
|
||||
console.error('Failed to copy text: ', err);
|
||||
}
|
||||
}
|
||||
|
||||
function loadExample(example: typeof examples[0], index: number) {
|
||||
inputText = example.input;
|
||||
targetPrefix = example.targetPrefix;
|
||||
selectedExample = example.label;
|
||||
selectedExampleIndex = index;
|
||||
userModified = false;
|
||||
}
|
||||
|
||||
function handleInputChange() {
|
||||
userModified = true;
|
||||
selectedExample = null;
|
||||
selectedExampleIndex = null;
|
||||
}
|
||||
|
||||
// Auto-check when inputs change
|
||||
@@ -76,14 +228,44 @@
|
||||
<p>Check if IP addresses, ranges, and CIDR blocks align to specific prefix boundaries</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
<div class="card examples-card">
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>Quick Examples</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example, i}
|
||||
<button
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => loadExample(example, i)}
|
||||
>
|
||||
<div class="example-label">{example.label}</div>
|
||||
<div class="example-preview">
|
||||
Target: /{example.targetPrefix}
|
||||
</div>
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<div class="input-section">
|
||||
<div class="inputs-card">
|
||||
<h3>Network Inputs</h3>
|
||||
<h3 use:tooltip={"Enter IP addresses, CIDR blocks, or ranges to check alignment"}>Network Inputs</h3>
|
||||
<div class="input-group">
|
||||
<label for="inputs">IP Addresses, CIDRs, or Ranges</label>
|
||||
<label
|
||||
for="inputs"
|
||||
use:tooltip={"Enter one per line: CIDR blocks, IP ranges, or individual IP addresses"}
|
||||
>
|
||||
IP Addresses, CIDRs, or Ranges
|
||||
</label>
|
||||
<textarea
|
||||
id="inputs"
|
||||
bind:value={inputText}
|
||||
oninput={handleInputChange}
|
||||
placeholder="192.168.1.0/24 10.0.0.0-10.0.0.255 172.16.1.5 2001:db8::/32"
|
||||
rows="8"
|
||||
></textarea>
|
||||
@@ -93,18 +275,35 @@
|
||||
</div>
|
||||
|
||||
<div class="input-group">
|
||||
<label for="prefix">Target Prefix Length</label>
|
||||
<label
|
||||
for="prefix"
|
||||
use:tooltip={"The prefix length boundary to check alignment against (e.g., 24 for /24 boundaries)"}
|
||||
>
|
||||
Target Prefix Length
|
||||
</label>
|
||||
<input
|
||||
id="prefix"
|
||||
type="number"
|
||||
bind:value={targetPrefix}
|
||||
oninput={handleInputChange}
|
||||
min="0"
|
||||
max="128"
|
||||
placeholder="24"
|
||||
class:error={validationErrors.length > 0}
|
||||
/>
|
||||
<div class="input-help">
|
||||
Prefix length to check alignment against (0-32 for IPv4, 0-128 for IPv6)
|
||||
</div>
|
||||
{#if validationErrors.length > 0}
|
||||
<div class="validation-errors">
|
||||
{#each validationErrors as error}
|
||||
<div class="validation-error">
|
||||
<Icon name="alert-circle" size="xs" />
|
||||
{error}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -129,37 +328,37 @@
|
||||
|
||||
{#if result.checks.length > 0}
|
||||
<div class="summary">
|
||||
<h3>Alignment Summary</h3>
|
||||
<h3 use:tooltip={"Overview of alignment results across all inputs"}>Alignment Summary</h3>
|
||||
<div class="summary-stats">
|
||||
<div class="stat">
|
||||
<span class="stat-value">{result.summary.totalInputs}</span>
|
||||
<span class="stat-label">Total Inputs</span>
|
||||
<span class="stat-label" use:tooltip={"Total number of network inputs processed"}>Total Inputs</span>
|
||||
</div>
|
||||
<div class="stat aligned">
|
||||
<span class="stat-value">{result.summary.alignedInputs}</span>
|
||||
<span class="stat-label">Aligned</span>
|
||||
<span class="stat-label" use:tooltip={"Networks that align to the target prefix boundary"}>Aligned</span>
|
||||
</div>
|
||||
<div class="stat misaligned">
|
||||
<span class="stat-value">{result.summary.misalignedInputs}</span>
|
||||
<span class="stat-label">Misaligned</span>
|
||||
<span class="stat-label" use:tooltip={"Networks that do not align to the target prefix boundary"}>Misaligned</span>
|
||||
</div>
|
||||
<div class="stat">
|
||||
<span class="stat-value">{result.summary.alignmentRate}%</span>
|
||||
<span class="stat-label">Alignment Rate</span>
|
||||
<span class="stat-label" use:tooltip={"Percentage of inputs that align to the target boundary"}>Alignment Rate</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="checks">
|
||||
<div class="checks-header">
|
||||
<h3>Alignment Checks</h3>
|
||||
<h3 use:tooltip={"Detailed results for each network input"}>Alignment Checks</h3>
|
||||
<div class="export-buttons">
|
||||
<button onclick={() => exportResults('csv')}>
|
||||
<Icon name="download" />
|
||||
<Icon name="csv-file" />
|
||||
Export CSV
|
||||
</button>
|
||||
<button onclick={() => exportResults('json')}>
|
||||
<Icon name="download" />
|
||||
<Icon name="json-file" />
|
||||
Export JSON
|
||||
</button>
|
||||
</div>
|
||||
@@ -175,52 +374,71 @@
|
||||
</div>
|
||||
<div class="check-status">
|
||||
{#if check.isAligned}
|
||||
<Icon name="check-circle" />
|
||||
Aligned to /{check.targetPrefix}
|
||||
<Icon name="check-circle" size="sm" />
|
||||
<span class="status-text">Aligned to /{check.targetPrefix}</span>
|
||||
{:else}
|
||||
<Icon name="x-circle" />
|
||||
Not aligned to /{check.targetPrefix}
|
||||
<Icon name="x-circle" size="sm" />
|
||||
<span class="status-text">Not aligned to /{check.targetPrefix}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if check.alignedCIDR}
|
||||
<div class="aligned-cidr">
|
||||
<strong>Aligned CIDR:</strong>
|
||||
<button type="button" class="code-button" onclick={() => copyToClipboard(check.alignedCIDR!)} title="Click to copy">
|
||||
{check.alignedCIDR}
|
||||
</button>
|
||||
<span class="aligned-label" use:tooltip={"The CIDR block that properly aligns to the target prefix boundary"}>Aligned CIDR:</span>
|
||||
<div class="cidr-with-copy">
|
||||
<code class="aligned-code">{check.alignedCIDR}</code>
|
||||
<button
|
||||
type="button"
|
||||
class="copy-button {copiedStates[`cidr-${check.input}`] ? 'copied' : ''}"
|
||||
onclick={() => copyToClipboard(check.alignedCIDR!, `cidr-${check.input}`)}
|
||||
use:tooltip={"Copy aligned CIDR to clipboard"}
|
||||
>
|
||||
<Icon name={copiedStates[`cidr-${check.input}`] ? 'check' : 'copy'} size="xs" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if check.reason}
|
||||
<div class="reason">
|
||||
<strong>Reason:</strong> {check.reason}
|
||||
<span class="reason-label" use:tooltip={"Explanation of why this input aligns or doesn't align"}>Reason:</span>
|
||||
<span class="reason-text">{check.reason}</span>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if check.suggestions.length > 0}
|
||||
<div class="suggestions">
|
||||
<strong>Suggestions:</strong>
|
||||
<span class="suggestions-label" use:tooltip={"Alternative CIDR configurations that would align to the target boundary"}>Suggestions:</span>
|
||||
{#each check.suggestions as suggestion}
|
||||
<div class="suggestion">
|
||||
<div class="suggestion-type">
|
||||
{#if suggestion.type === 'larger'}
|
||||
<Icon name="zoom-out" />
|
||||
<Icon name="zoom-out" size="sm" />
|
||||
{:else if suggestion.type === 'smaller'}
|
||||
<Icon name="zoom-in" />
|
||||
<Icon name="zoom-in" size="sm" />
|
||||
{:else}
|
||||
<Icon name="scissors" />
|
||||
<Icon name="scissors" size="sm" />
|
||||
{/if}
|
||||
{suggestion.description}
|
||||
<span class="suggestion-description">{suggestion.description}</span>
|
||||
</div>
|
||||
<div class="suggestion-cidrs">
|
||||
{#each suggestion.cidrs as cidr}
|
||||
<button type="button" class="code-button" onclick={() => copyToClipboard(cidr)} title="Click to copy">{cidr}</button>
|
||||
{#each suggestion.cidrs as cidr, idx}
|
||||
<div class="suggestion-cidr">
|
||||
<code class="suggestion-code">{cidr}</code>
|
||||
<button
|
||||
type="button"
|
||||
class="copy-button {copiedStates[`suggestion-${check.input}-${idx}`] ? 'copied' : ''}"
|
||||
onclick={() => copyToClipboard(cidr, `suggestion-${check.input}-${idx}`)}
|
||||
use:tooltip={"Copy suggested CIDR to clipboard"}
|
||||
>
|
||||
<Icon name={copiedStates[`suggestion-${check.input}-${idx}`] ? 'check' : 'copy'} size="xs" />
|
||||
</button>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{#if suggestion.efficiency}
|
||||
<div class="suggestion-efficiency">
|
||||
<div class="suggestion-efficiency" use:tooltip={"Address space utilization efficiency of this suggestion"}>
|
||||
Efficiency: {suggestion.efficiency}%
|
||||
</div>
|
||||
{/if}
|
||||
@@ -292,6 +510,34 @@
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
.input-group input.error {
|
||||
border-color: var(--color-error);
|
||||
background: color-mix(in srgb, var(--color-error), transparent 95%);
|
||||
}
|
||||
|
||||
.validation-errors {
|
||||
margin-top: var(--spacing-xs);
|
||||
}
|
||||
|
||||
.validation-error {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-xs);
|
||||
color: var(--color-error);
|
||||
font-size: var(--font-size-xs);
|
||||
font-weight: 500;
|
||||
margin-bottom: var(--spacing-xs);
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
:global(.icon) {
|
||||
color: var(--color-error);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.input-group textarea {
|
||||
resize: vertical;
|
||||
min-height: 200px;
|
||||
@@ -432,6 +678,13 @@
|
||||
background: var(--color-primary-hover);
|
||||
}
|
||||
|
||||
.checks {
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.checks-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -469,8 +722,8 @@
|
||||
|
||||
.check-input {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-xs);
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.input-text {
|
||||
@@ -493,10 +746,14 @@
|
||||
.check-status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-xs);
|
||||
gap: var(--spacing-sm);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.status-text {
|
||||
font-size: var(--font-size-sm);
|
||||
}
|
||||
|
||||
.check-item.aligned .check-status {
|
||||
color: var(--color-success);
|
||||
}
|
||||
@@ -505,65 +762,157 @@
|
||||
color: var(--color-error);
|
||||
}
|
||||
|
||||
.aligned-cidr,
|
||||
.reason {
|
||||
margin-bottom: var(--spacing-sm);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
|
||||
.suggestions {
|
||||
border-top: 1px solid var(--border-primary);
|
||||
padding-top: var(--spacing-sm);
|
||||
margin-top: var(--spacing-md);
|
||||
}
|
||||
|
||||
.suggestion {
|
||||
.aligned-cidr {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-xs);
|
||||
margin-bottom: var(--spacing-sm);
|
||||
padding: var(--spacing-sm);
|
||||
background: var(--bg-secondary);
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
.aligned-label {
|
||||
font-weight: 600;
|
||||
/* color: var(--color-success-light); */
|
||||
font-size: var(--font-size-sm);
|
||||
}
|
||||
|
||||
.cidr-with-copy {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.aligned-code {
|
||||
font-family: var(--font-mono);
|
||||
font-weight: 600;
|
||||
font-size: var(--font-size-md);
|
||||
color: var(--color-success-light);
|
||||
background: var(--bg-tertiary);
|
||||
padding: var(--spacing-xs) var(--spacing-sm);
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--border-primary);
|
||||
}
|
||||
|
||||
.reason {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-xs);
|
||||
margin-bottom: var(--spacing-sm);
|
||||
padding: var(--spacing-sm);
|
||||
background: var(--bg-secondary);
|
||||
border-radius: var(--radius-md);
|
||||
border: 1px solid var(--border-secondary);
|
||||
}
|
||||
|
||||
.reason-label {
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
font-size: var(--font-size-sm);
|
||||
}
|
||||
|
||||
.reason-text {
|
||||
color: var(--text-secondary);
|
||||
font-size: var(--font-size-sm);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
|
||||
.suggestions {
|
||||
margin-top: var(--spacing-md);
|
||||
padding: var(--spacing-sm);
|
||||
background: var(--bg-secondary);
|
||||
border-radius: var(--radius-md);
|
||||
border: 1px solid var(--border-secondary);
|
||||
}
|
||||
|
||||
.suggestions-label {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
font-size: var(--font-size-sm);
|
||||
margin-bottom: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.suggestion {
|
||||
margin-bottom: var(--spacing-sm);
|
||||
padding: var(--spacing-md);
|
||||
background: var(--bg-tertiary);
|
||||
border-radius: var(--radius-md);
|
||||
border: 1px solid var(--border-primary);
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.suggestion-type {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-xs);
|
||||
margin-bottom: var(--spacing-xs);
|
||||
gap: var(--spacing-sm);
|
||||
margin-bottom: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.suggestion-description {
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
font-size: var(--font-size-sm);
|
||||
}
|
||||
|
||||
.suggestion-cidrs {
|
||||
margin-bottom: var(--spacing-xs);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-xs);
|
||||
margin-bottom: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.suggestion-cidr {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.suggestion-code {
|
||||
font-family: var(--font-mono);
|
||||
font-weight: 600;
|
||||
font-size: var(--font-size-sm);
|
||||
color: var(--color-info-light);
|
||||
background: var(--bg-primary);
|
||||
padding: var(--spacing-xs) var(--spacing-sm);
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--color-info);
|
||||
}
|
||||
|
||||
.suggestion-efficiency {
|
||||
font-size: var(--font-size-sm);
|
||||
color: var(--text-secondary);
|
||||
font-size: var(--font-size-xs);
|
||||
color: var(--color-warning-light);
|
||||
font-weight: 600;
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
|
||||
.code-button {
|
||||
background: var(--bg-code);
|
||||
.copy-button {
|
||||
background: none;
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: var(--spacing-xs) var(--spacing-sm);
|
||||
margin: 0 var(--spacing-xs) 0 0;
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-sm);
|
||||
color: var(--text-code);
|
||||
padding: var(--spacing-xs);
|
||||
color: var(--text-secondary);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
transition: all var(--transition-fast);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
&:hover {
|
||||
background: var(--bg-code-hover);
|
||||
background: var(--surface-hover);
|
||||
border-color: var(--color-primary);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
&:active {
|
||||
transform: translateY(1px);
|
||||
&.copied {
|
||||
color: var(--color-success);
|
||||
border-color: var(--color-success);
|
||||
background: color-mix(in srgb, var(--color-success), transparent 90%);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import '../../../styles/diagnostics-pages.scss';
|
||||
let pools = $state(`192.168.0.0/16
|
||||
10.0.0.0/20`);
|
||||
let requests = $state(`/24 - Office Network
|
||||
@@ -51,6 +52,7 @@
|
||||
} | null>(null);
|
||||
let copiedStates = $state<Record<string, boolean>>({});
|
||||
let selectedExample = $state<string | null>(null);
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
let userModified = $state(false);
|
||||
|
||||
const examples = [
|
||||
@@ -58,7 +60,7 @@
|
||||
label: 'Office Network Planning',
|
||||
pools: '192.168.0.0/16',
|
||||
requests: `/24 - Main Office
|
||||
/25 - Guest Network
|
||||
/25 - Guest Network
|
||||
/26 - Servers
|
||||
/27 - Management`,
|
||||
algorithm: 'best-fit' as const
|
||||
@@ -83,14 +85,55 @@
|
||||
/28 - Subnet E
|
||||
/28 - Subnet F`,
|
||||
algorithm: 'best-fit' as const
|
||||
},
|
||||
{
|
||||
label: 'Campus VLAN Allocation',
|
||||
pools: `10.0.0.0/16
|
||||
172.16.0.0/16`,
|
||||
requests: `/22 - Student Housing
|
||||
/23 - Academic Buildings
|
||||
/24 - Admin Offices
|
||||
/25 - Library Systems
|
||||
/26 - Lab Networks
|
||||
/28 - Printer VLANs`,
|
||||
algorithm: 'best-fit' as const
|
||||
},
|
||||
{
|
||||
label: 'Cloud Infrastructure',
|
||||
pools: `10.100.0.0/16
|
||||
10.200.0.0/16
|
||||
10.255.0.0/20`,
|
||||
requests: `/20 - Production Cluster
|
||||
/21 - Staging Environment
|
||||
/22 - Development Pods
|
||||
/24 - CI/CD Pipeline
|
||||
/25 - Database Tier
|
||||
/26 - Load Balancers
|
||||
/27 - Monitoring Stack`,
|
||||
algorithm: 'first-fit' as const
|
||||
},
|
||||
{
|
||||
label: 'ISP Customer Allocation',
|
||||
pools: `203.0.113.0/24
|
||||
198.51.100.0/24
|
||||
192.0.2.0/24`,
|
||||
requests: `/27 - Enterprise Customer A
|
||||
/28 - Small Business B
|
||||
/29 - Home Office C
|
||||
/30 - Point-to-Point Links
|
||||
/28 - Enterprise Customer D
|
||||
/29 - Remote Branch E
|
||||
/30 - Backup Connections`,
|
||||
algorithm: 'best-fit' as const
|
||||
}
|
||||
];
|
||||
|
||||
function loadExample(example: typeof examples[0]) {
|
||||
function loadExample(example: typeof examples[0], index: number) {
|
||||
pools = example.pools;
|
||||
requests = example.requests;
|
||||
algorithm = example.algorithm;
|
||||
selectedExample = example.label;
|
||||
selectedExampleIndex = index;
|
||||
userModified = false;
|
||||
performAllocation();
|
||||
}
|
||||
@@ -374,6 +417,7 @@
|
||||
function handleInputChange() {
|
||||
userModified = true;
|
||||
selectedExample = null;
|
||||
selectedExampleIndex = null;
|
||||
performAllocation();
|
||||
}
|
||||
|
||||
@@ -410,17 +454,18 @@
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
<section class="examples-section">
|
||||
<div class="card examples-card">
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="sm" />
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>Quick Examples</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example}
|
||||
{#each examples as example, i}
|
||||
<button
|
||||
class="example-card {selectedExample === example.label ? 'active' : ''}"
|
||||
onclick={() => loadExample(example)}
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => loadExample(example, i)}
|
||||
>
|
||||
<div class="example-label">{example.label}</div>
|
||||
<div class="example-preview">
|
||||
@@ -430,11 +475,11 @@
|
||||
{/each}
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Algorithm Selection -->
|
||||
<section class="algorithm-section">
|
||||
<h4>Allocation Algorithm</h4>
|
||||
<h4 use:tooltip={"Choose between first-fit (faster) and best-fit (more efficient packing) algorithms"}>Allocation Algorithm</h4>
|
||||
<div class="algorithm-options">
|
||||
<label class="algorithm-option">
|
||||
<input
|
||||
@@ -449,7 +494,7 @@
|
||||
First-Fit
|
||||
</div>
|
||||
<div class="option-description">
|
||||
Fast allocation - uses the first available block that fits
|
||||
Fast allocation - uses the first available block that fits (good for speed)
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
@@ -467,7 +512,7 @@
|
||||
Best-Fit
|
||||
</div>
|
||||
<div class="option-description">
|
||||
Optimal packing - uses the smallest available block that fits
|
||||
Optimal packing - uses the smallest available block that fits (reduces fragmentation)
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
@@ -522,7 +567,7 @@
|
||||
<!-- Summary -->
|
||||
<div class="allocation-summary">
|
||||
<div class="summary-header">
|
||||
<h3>Allocation Results</h3>
|
||||
<h3 use:tooltip={"Summary of subnet allocation requests and pool utilization"}>Allocation Results</h3>
|
||||
{#if result.summary.successfulAllocations > 0}
|
||||
<button
|
||||
class="copy-all-button {copiedStates['all-allocations'] ? 'copied' : ''}"
|
||||
@@ -590,7 +635,7 @@
|
||||
|
||||
<!-- Allocations -->
|
||||
<div class="allocations-section">
|
||||
<h4>Subnet Allocations</h4>
|
||||
<h4 use:tooltip={"Individual subnet allocation results with assigned CIDR blocks"}>Subnet Allocations</h4>
|
||||
<div class="allocations-list">
|
||||
{#each result.allocations as allocation}
|
||||
<div class="allocation-item {allocation.allocated ? 'success' : 'failed'}">
|
||||
@@ -639,7 +684,7 @@
|
||||
|
||||
<!-- Pool Utilization -->
|
||||
<div class="pools-section">
|
||||
<h4>Pool Utilization</h4>
|
||||
<h4 use:tooltip={"Detailed breakdown of how address space was used in each pool"}>Pool Utilization</h4>
|
||||
<div class="pools-grid">
|
||||
{#each result.pools as pool}
|
||||
<div class="pool-card">
|
||||
@@ -773,84 +818,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.examples-section {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.examples-details {
|
||||
background: var(--bg-tertiary);
|
||||
padding: var(--spacing-md);
|
||||
border-radius: var(--radius-lg);
|
||||
|
||||
&[open] {
|
||||
.examples-summary :global(.icon) {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.examples-summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-xs);
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
user-select: none;
|
||||
transition: all var(--transition-fast);
|
||||
|
||||
&::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:global(.icon) {
|
||||
transition: transform var(--transition-fast);
|
||||
}
|
||||
|
||||
h4 {
|
||||
margin: 0;
|
||||
font-size: var(--font-size-md);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.examples-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: var(--spacing-sm);
|
||||
margin-top: var(--spacing-md);
|
||||
}
|
||||
|
||||
.example-card {
|
||||
padding: var(--spacing-sm);
|
||||
background-color: var(--bg-secondary);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-fast);
|
||||
text-align: left;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--surface-hover);
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: var(--surface-hover);
|
||||
border-color: var(--color-primary);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
}
|
||||
|
||||
.example-label {
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: var(--spacing-xs);
|
||||
}
|
||||
|
||||
.example-preview {
|
||||
font-size: var(--font-size-xs);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.algorithm-section {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
@@ -1377,9 +1344,6 @@
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.examples-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.summary-grid {
|
||||
grid-template-columns: 1fr;
|
||||
@@ -1407,4 +1371,7 @@
|
||||
align-items: stretch;
|
||||
}
|
||||
}
|
||||
.examples-card {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import '../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let listA = $state(`192.168.0.0/16
|
||||
10.0.0.0/8
|
||||
@@ -27,6 +28,7 @@
|
||||
} | null>(null);
|
||||
let copiedStates = $state<Record<string, boolean>>({});
|
||||
let selectedExample = $state<string | null>(null);
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
let userModified = $state(false);
|
||||
|
||||
const examples = [
|
||||
@@ -57,13 +59,43 @@
|
||||
10.0.1.0/24
|
||||
172.16.2.0/24`,
|
||||
description: 'Swapped subnets'
|
||||
},
|
||||
{
|
||||
label: 'VLAN Reconfiguration',
|
||||
listA: `192.168.10.0/24
|
||||
192.168.20.0/24
|
||||
192.168.30.0/24`,
|
||||
listB: `192.168.10.0/24
|
||||
192.168.25.0/24
|
||||
192.168.35.0/24`,
|
||||
description: 'Replaced VLANs 20,30 with 25,35'
|
||||
},
|
||||
{
|
||||
label: 'Network Consolidation',
|
||||
listA: `10.1.0.0/24
|
||||
10.1.1.0/24
|
||||
10.1.2.0/24
|
||||
10.1.3.0/24`,
|
||||
listB: `10.1.0.0/22`,
|
||||
description: 'Merged 4 /24s into 1 /22'
|
||||
},
|
||||
{
|
||||
label: 'Branch Office Migration',
|
||||
listA: `172.16.1.0/24
|
||||
172.16.2.0/24
|
||||
192.168.100.0/24`,
|
||||
listB: `10.10.1.0/24
|
||||
10.10.2.0/24
|
||||
192.168.100.0/24`,
|
||||
description: 'Migrated 172.16.x.x to 10.10.x.x'
|
||||
}
|
||||
];
|
||||
|
||||
function loadExample(example: typeof examples[0]) {
|
||||
function loadExample(example: typeof examples[0], index: number) {
|
||||
listA = example.listA;
|
||||
listB = example.listB;
|
||||
selectedExample = example.label;
|
||||
selectedExampleIndex = index;
|
||||
userModified = false;
|
||||
performComparison();
|
||||
}
|
||||
@@ -219,6 +251,7 @@
|
||||
function handleInputChange() {
|
||||
userModified = true;
|
||||
selectedExample = null;
|
||||
selectedExampleIndex = null;
|
||||
performComparison();
|
||||
}
|
||||
|
||||
@@ -247,6 +280,7 @@
|
||||
listB = temp;
|
||||
userModified = true;
|
||||
selectedExample = null;
|
||||
selectedExampleIndex = null;
|
||||
performComparison();
|
||||
}
|
||||
|
||||
@@ -261,25 +295,31 @@
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
<section class="examples-section">
|
||||
<h4>Quick Examples</h4>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example}
|
||||
<button
|
||||
class="example-card {selectedExample === example.label ? 'active' : ''}"
|
||||
onclick={() => loadExample(example)}
|
||||
>
|
||||
<div class="example-label">{example.label}</div>
|
||||
<div class="example-preview">{example.description}</div>
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
</section>
|
||||
<div class="card examples-card">
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>Quick Examples</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example, i}
|
||||
<button
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => loadExample(example, i)}
|
||||
>
|
||||
<div class="example-label">{example.label}</div>
|
||||
<div class="example-preview">{example.description}</div>
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<!-- Input Section -->
|
||||
<section class="input-section">
|
||||
<div class="input-header">
|
||||
<h3>Network Lists</h3>
|
||||
<h3 use:tooltip={"Compare two network lists to identify additions, removals, and unchanged items"}>Network Lists</h3>
|
||||
<button
|
||||
class="swap-button"
|
||||
onclick={swapLists}
|
||||
@@ -333,7 +373,7 @@
|
||||
{#if result.success}
|
||||
<!-- Summary -->
|
||||
<div class="comparison-summary">
|
||||
<h3>Comparison Summary</h3>
|
||||
<h3 use:tooltip={"Overview of changes between the two network lists"}>Comparison Summary</h3>
|
||||
<div class="summary-grid">
|
||||
<div class="summary-card">
|
||||
<div class="summary-icon added">
|
||||
@@ -381,7 +421,7 @@
|
||||
<!-- Added -->
|
||||
<div class="change-category added">
|
||||
<div class="category-header">
|
||||
<h4>
|
||||
<h4 use:tooltip={"Networks present in List B but not in List A"}>
|
||||
<Icon name="plus-circle" size="sm" />
|
||||
Added Networks ({result.added.length})
|
||||
</h4>
|
||||
@@ -420,7 +460,7 @@
|
||||
<!-- Removed -->
|
||||
<div class="change-category removed">
|
||||
<div class="category-header">
|
||||
<h4>
|
||||
<h4 use:tooltip={"Networks present in List A but not in List B"}>
|
||||
<Icon name="minus-circle" size="sm" />
|
||||
Removed Networks ({result.removed.length})
|
||||
</h4>
|
||||
@@ -429,7 +469,7 @@
|
||||
class="copy-category {copiedStates['category-removed'] ? 'copied' : ''}"
|
||||
onclick={() => result && copyCategory(result.removed, 'removed')}
|
||||
>
|
||||
<Icon name={copiedStates['category-removed'] ? '192.168.0.0/16' : 'copy'} size="xs" />
|
||||
<Icon name={copiedStates['category-removed'] ? 'check-circle' : 'copy'} size="xs" />
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -459,7 +499,7 @@
|
||||
<!-- Unchanged -->
|
||||
<div class="change-category unchanged">
|
||||
<div class="category-header">
|
||||
<h4>
|
||||
<h4 use:tooltip={"Networks present in both List A and List B"}>
|
||||
<Icon name="check-circle" size="sm" />
|
||||
Unchanged Networks ({result.unchanged.length})
|
||||
</h4>
|
||||
@@ -508,52 +548,6 @@
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
.examples-section {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
|
||||
h4 {
|
||||
margin-bottom: var(--spacing-md);
|
||||
color: var(--color-info-light);
|
||||
}
|
||||
}
|
||||
|
||||
.examples-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.example-card {
|
||||
padding: var(--spacing-sm);
|
||||
background-color: var(--bg-secondary);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-fast);
|
||||
text-align: left;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--surface-hover);
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: var(--surface-hover);
|
||||
border-color: var(--color-primary);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
}
|
||||
|
||||
.example-label {
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: var(--spacing-xs);
|
||||
}
|
||||
|
||||
.example-preview {
|
||||
font-size: var(--font-size-xs);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.input-section {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
@@ -848,9 +842,6 @@
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.examples-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.summary-grid {
|
||||
grid-template-columns: 1fr;
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
let strictEquality = $state(false);
|
||||
let result = $state<ContainsResult | null>(null);
|
||||
let copiedStates = $state<Record<string, boolean>>({});
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
let userModified = $state(false);
|
||||
|
||||
const examples = [
|
||||
{
|
||||
@@ -43,12 +45,18 @@
|
||||
];
|
||||
|
||||
/* Set example */
|
||||
function setExample(example: typeof examples[0]) {
|
||||
function setExample(example: typeof examples[0], index: number) {
|
||||
setA = example.setA;
|
||||
setB = example.setB;
|
||||
selectedExampleIndex = index;
|
||||
userModified = false;
|
||||
performContainmentCheck();
|
||||
}
|
||||
|
||||
function handleInputChange() {
|
||||
userModified = true;
|
||||
}
|
||||
|
||||
/* Copy to clipboard */
|
||||
async function copyToClipboard(text: string, id: string) {
|
||||
try {
|
||||
@@ -209,6 +217,7 @@
|
||||
placeholder="192.168.0.0/16 10.0.0.0/8"
|
||||
class="input-textarea set-a"
|
||||
rows="6"
|
||||
oninput={handleInputChange}
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@@ -227,6 +236,7 @@
|
||||
placeholder="192.168.1.0/24 172.16.0.0/24"
|
||||
class="input-textarea set-b"
|
||||
rows="6"
|
||||
oninput={handleInputChange}
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@@ -244,19 +254,27 @@
|
||||
</div>
|
||||
|
||||
<!-- Examples -->
|
||||
<div class="examples-section">
|
||||
<h4>Quick Examples</h4>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example}
|
||||
<button
|
||||
type="button"
|
||||
class="example-btn"
|
||||
onclick={() => setExample(example)}
|
||||
>
|
||||
{example.label}
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
<div class="card examples-card">
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>Quick Examples</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example, i}
|
||||
<button
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i && !userModified}
|
||||
onclick={() => setExample(example, i)}
|
||||
>
|
||||
<div class="example-label">{example.label}</div>
|
||||
<div class="example-preview">
|
||||
{example.setA.split('\n')[0]}... ⊆ {example.setB.split('\n')[0]}...
|
||||
</div>
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -286,7 +304,7 @@
|
||||
class:copied={copiedStates['csv-export']}
|
||||
onclick={exportAsCSV}
|
||||
>
|
||||
<Icon name={copiedStates['csv-export'] ? 'check' : 'download'} size="sm" />
|
||||
<Icon name={copiedStates['csv-export'] ? 'check' : 'csv-file'} size="sm" />
|
||||
CSV
|
||||
</button>
|
||||
<button
|
||||
@@ -295,7 +313,7 @@
|
||||
class:copied={copiedStates['json-export']}
|
||||
onclick={exportAsJSON}
|
||||
>
|
||||
<Icon name={copiedStates['json-export'] ? 'check' : 'download'} size="sm" />
|
||||
<Icon name={copiedStates['json-export'] ? 'check' : 'json-file'} size="sm" />
|
||||
JSON
|
||||
</button>
|
||||
</div>
|
||||
@@ -500,31 +518,6 @@
|
||||
gap: var(--spacing-md);
|
||||
}
|
||||
|
||||
.checkbox-label {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: var(--spacing-sm);
|
||||
cursor: pointer;
|
||||
|
||||
input[type="checkbox"] {
|
||||
margin-top: 2px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.checkbox-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-xs);
|
||||
|
||||
:global(.tooltip-trigger) {
|
||||
color: var(--text-secondary);
|
||||
opacity: 0.7;
|
||||
&:hover { opacity: 1; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Input section */
|
||||
@@ -572,30 +565,91 @@
|
||||
}
|
||||
|
||||
/* Examples section */
|
||||
.examples-section {
|
||||
.examples-card {
|
||||
margin-top: var(--spacing-lg);
|
||||
|
||||
h4 { @extend %section-title; }
|
||||
|
||||
|
||||
.examples-details {
|
||||
summary {
|
||||
list-style: none;
|
||||
cursor: pointer;
|
||||
|
||||
&::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.examples-summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
padding: var(--spacing-sm);
|
||||
background-color: var(--bg-tertiary);
|
||||
border-radius: var(--radius-md);
|
||||
transition: all var(--transition-fast);
|
||||
|
||||
&:hover {
|
||||
background-color: var(--surface-hover);
|
||||
}
|
||||
|
||||
:global(svg) {
|
||||
transition: transform var(--transition-fast);
|
||||
}
|
||||
|
||||
h4 {
|
||||
margin: 0;
|
||||
font-size: var(--font-size-md);
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
}
|
||||
|
||||
&[open] .examples-summary :global(svg) {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
}
|
||||
|
||||
.examples-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: var(--spacing-sm);
|
||||
margin-top: var(--spacing-md);
|
||||
}
|
||||
|
||||
.example-btn {
|
||||
|
||||
.example-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: var(--spacing-sm);
|
||||
background-color: var(--bg-tertiary);
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border-secondary);
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: var(--font-size-sm);
|
||||
transition: all var(--transition-fast);
|
||||
|
||||
text-align: left;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--surface-hover);
|
||||
border-color: var(--color-primary);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
&.selected {
|
||||
border-color: var(--color-primary);
|
||||
border-width: 2px;
|
||||
background: color-mix(in srgb, var(--color-primary), transparent 95%);
|
||||
}
|
||||
|
||||
.example-label {
|
||||
font-weight: 600;
|
||||
font-size: var(--font-size-sm);
|
||||
color: var(--text-primary);
|
||||
margin-bottom: var(--spacing-xs);
|
||||
}
|
||||
|
||||
.example-preview {
|
||||
font-size: var(--font-size-xs);
|
||||
color: var(--text-secondary);
|
||||
font-family: var(--font-mono);
|
||||
line-height: 1.4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -705,10 +759,15 @@
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
&.status-inside { background-color: rgba(35, 134, 54, 0.05); }
|
||||
&.status-equal { background-color: rgba(59, 130, 246, 0.05); }
|
||||
&.status-partial { background-color: rgba(245, 158, 11, 0.05); }
|
||||
&.status-outside { background-color: rgba(239, 68, 68, 0.05); }
|
||||
&.status-inside { background-color: color-mix(in srgb, var(--color-success), transparent 90%); }
|
||||
&.status-equal { background-color: color-mix(in srgb, var(--color-info), transparent 90%); }
|
||||
&.status-partial { background-color: color-mix(in srgb, var(--color-warning), transparent 90%); }
|
||||
&.status-outside { background-color: color-mix(in srgb, var(--color-error), transparent 90%) }
|
||||
.col-gaps {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-xs);
|
||||
}
|
||||
}
|
||||
|
||||
.candidate-input {
|
||||
@@ -725,6 +784,8 @@
|
||||
gap: var(--spacing-xs);
|
||||
font-weight: 500;
|
||||
font-size: var(--font-size-sm);
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border-primary)
|
||||
}
|
||||
|
||||
.coverage-bar {
|
||||
@@ -898,21 +959,14 @@
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-xs);
|
||||
&.copied {
|
||||
color: var(--color-success);
|
||||
background-color: rgba(35, 134, 54, 0.1);
|
||||
border-color: var(--color-success);
|
||||
}
|
||||
|
||||
:global(.icon) {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
}
|
||||
|
||||
&.btn-xs :global(.icon) {
|
||||
width: 0.75rem;
|
||||
height: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import '../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let input = $state(`192.168.0.0/22
|
||||
10.0.0.0-10.0.0.255`);
|
||||
@@ -18,6 +19,7 @@
|
||||
} | null>(null);
|
||||
let copiedStates = $state<Record<string, boolean>>({});
|
||||
let selectedExample = $state<string | null>(null);
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
let userModified = $state(false);
|
||||
|
||||
const examples = [
|
||||
@@ -36,13 +38,33 @@
|
||||
input: `172.16.0.0/24
|
||||
172.16.2.0/25`,
|
||||
targetPrefix: 26
|
||||
},
|
||||
{
|
||||
label: 'Enterprise Campus to /25s',
|
||||
input: `10.10.0.0/16
|
||||
10.20.0.0/17`,
|
||||
targetPrefix: 25
|
||||
},
|
||||
{
|
||||
label: 'Data Center Racks to /29s',
|
||||
input: `192.168.100.0/24
|
||||
192.168.101.0-192.168.101.127`,
|
||||
targetPrefix: 29
|
||||
},
|
||||
{
|
||||
label: 'Service Provider to /30s',
|
||||
input: `203.0.113.0/26
|
||||
198.51.100.64/27
|
||||
198.51.100.96/28`,
|
||||
targetPrefix: 30
|
||||
}
|
||||
];
|
||||
|
||||
function loadExample(example: typeof examples[0]) {
|
||||
function loadExample(example: typeof examples[0], index: number) {
|
||||
input = example.input;
|
||||
targetPrefix = example.targetPrefix;
|
||||
selectedExample = example.label;
|
||||
selectedExampleIndex = index;
|
||||
userModified = false;
|
||||
performDeaggregation();
|
||||
}
|
||||
@@ -219,6 +241,7 @@
|
||||
function handleInputChange() {
|
||||
userModified = true;
|
||||
selectedExample = null;
|
||||
selectedExampleIndex = null;
|
||||
performDeaggregation();
|
||||
}
|
||||
|
||||
@@ -252,22 +275,28 @@
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
<section class="examples-section">
|
||||
<h4>Quick Examples</h4>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example}
|
||||
<button
|
||||
class="example-card {selectedExample === example.label ? 'active' : ''}"
|
||||
onclick={() => loadExample(example)}
|
||||
>
|
||||
<div class="example-label">{example.label}</div>
|
||||
<div class="example-preview">
|
||||
Target: /{example.targetPrefix}
|
||||
</div>
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
</section>
|
||||
<div class="card examples-card">
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>Quick Examples</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example, i}
|
||||
<button
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => loadExample(example, i)}
|
||||
>
|
||||
<div class="example-label">{example.label}</div>
|
||||
<div class="example-preview">
|
||||
Target: /{example.targetPrefix}
|
||||
</div>
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<!-- Input Section -->
|
||||
<section class="input-section">
|
||||
@@ -323,7 +352,7 @@
|
||||
<section class="results-section">
|
||||
{#if result.success}
|
||||
<div class="results-header">
|
||||
<h3>Deaggregated Subnets</h3>
|
||||
<h3 use:tooltip={"Generated uniform subnets from input networks and ranges"}>Deaggregated Subnets</h3>
|
||||
<div class="results-actions">
|
||||
<div class="results-summary">
|
||||
<span class="metric">
|
||||
@@ -350,20 +379,20 @@
|
||||
<!-- Input Summary -->
|
||||
<div class="input-summary">
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">Input:</span>
|
||||
<span class="summary-label" use:tooltip={"Original networks, ranges, and addresses provided"}>Input:</span>
|
||||
<span class="summary-value">
|
||||
{result.inputSummary.totalInputs} items, {result.inputSummary.totalInputAddresses.toLocaleString()} addresses
|
||||
</span>
|
||||
</div>
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">Output:</span>
|
||||
<span class="summary-label" use:tooltip={"Uniform subnets generated from input"}>Output:</span>
|
||||
<span class="summary-value">
|
||||
{result.totalSubnets} /{targetPrefix} subnets, {result.totalAddresses.toLocaleString()} addresses
|
||||
</span>
|
||||
</div>
|
||||
{#if result.totalAddresses !== result.inputSummary.totalInputAddresses}
|
||||
<div class="summary-item">
|
||||
<span class="summary-label">Note:</span>
|
||||
<span class="summary-label" use:tooltip={"Address count difference due to subnet boundary alignment"}>Note:</span>
|
||||
<span class="summary-value address-diff">
|
||||
{result.totalAddresses > result.inputSummary.totalInputAddresses ? 'Expanded' : 'Reduced'} by {Math.abs(result.totalAddresses - result.inputSummary.totalInputAddresses).toLocaleString()} addresses
|
||||
(due to alignment to /{targetPrefix} boundaries)
|
||||
@@ -421,53 +450,6 @@
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
.examples-section {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
|
||||
h4 {
|
||||
margin-bottom: var(--spacing-md);
|
||||
color: var(--color-info-light);
|
||||
}
|
||||
}
|
||||
|
||||
.examples-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.example-card {
|
||||
padding: var(--spacing-sm);
|
||||
background-color: var(--bg-secondary);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-fast);
|
||||
text-align: left;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--surface-hover);
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: var(--surface-hover);
|
||||
border-color: var(--color-primary);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
}
|
||||
|
||||
.example-label {
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: var(--spacing-xs);
|
||||
}
|
||||
|
||||
.example-preview {
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-xs);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.input-section {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
@@ -725,10 +707,6 @@
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.examples-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.subnets-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { splitCIDRByCount, splitCIDRByPrefix, type SplitResult } from '$lib/utils/cidr-split.js';
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Tooltip from '$lib/components/global/Tooltip.svelte';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import '../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let inputCIDR = $state('192.168.1.0/24');
|
||||
let splitMode = $state<'count' | 'prefix'>('count');
|
||||
@@ -10,6 +10,7 @@
|
||||
let targetPrefix = $state(26);
|
||||
let result = $state<SplitResult | null>(null);
|
||||
let copiedStates = $state<Record<string, boolean>>({});
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
|
||||
const modes = [
|
||||
{
|
||||
@@ -52,7 +53,7 @@
|
||||
];
|
||||
|
||||
/* Set example */
|
||||
function setExample(example: typeof examples[0]) {
|
||||
function setExample(example: typeof examples[0], index: number) {
|
||||
inputCIDR = example.cidr;
|
||||
splitMode = example.mode;
|
||||
if (example.mode === 'count') {
|
||||
@@ -60,15 +61,21 @@
|
||||
} else {
|
||||
targetPrefix = example.prefix!;
|
||||
}
|
||||
selectedExampleIndex = index;
|
||||
performSplit();
|
||||
}
|
||||
|
||||
/* Clear example selection when input changes */
|
||||
function clearExampleSelection() {
|
||||
selectedExampleIndex = null;
|
||||
}
|
||||
|
||||
/* Copy to clipboard */
|
||||
async function copyToClipboard(text: string, id: string) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
copiedStates[id] = true;
|
||||
setTimeout(() => copiedStates[id] = false, 3000);
|
||||
setTimeout(() => copiedStates[id] = false, 1500);
|
||||
} catch (err) {
|
||||
console.error('Failed to copy:', err);
|
||||
}
|
||||
@@ -134,11 +141,24 @@
|
||||
return `${subnet.cidr}\nRange: ${subnet.network} - ${subnet.broadcast}\nHosts: ${subnet.totalHosts}`;
|
||||
}
|
||||
|
||||
// Reactive split
|
||||
// Reactive split and example selection tracking
|
||||
$effect(() => {
|
||||
if (inputCIDR.trim()) {
|
||||
performSplit();
|
||||
}
|
||||
|
||||
// Check if current input matches any example
|
||||
const matchingIndex = examples.findIndex(example =>
|
||||
example.cidr === inputCIDR &&
|
||||
example.mode === splitMode &&
|
||||
(example.mode === 'count' ? example.count === subnetCount : example.prefix === targetPrefix)
|
||||
);
|
||||
|
||||
if (matchingIndex !== -1 && selectedExampleIndex !== matchingIndex) {
|
||||
selectedExampleIndex = matchingIndex;
|
||||
} else if (matchingIndex === -1 && selectedExampleIndex !== null) {
|
||||
selectedExampleIndex = null;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -153,16 +173,14 @@
|
||||
<h3>Split Mode</h3>
|
||||
<div class="tabs">
|
||||
{#each modes as modeOption}
|
||||
<button
|
||||
<button
|
||||
type="button"
|
||||
class="tab"
|
||||
class:active={splitMode === modeOption.value}
|
||||
onclick={() => splitMode = modeOption.value}
|
||||
use:tooltip={modeOption.description}
|
||||
>
|
||||
{modeOption.label}
|
||||
<Tooltip text={modeOption.description} position="top">
|
||||
<Icon name="help" size="sm" />
|
||||
</Tooltip>
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -172,11 +190,8 @@
|
||||
<div class="input-section">
|
||||
<h3>Parent Network</h3>
|
||||
<div class="form-group">
|
||||
<label for="input-cidr">
|
||||
<label for="input-cidr" use:tooltip={"Enter IPv4 or IPv6 network in CIDR notation (e.g., 192.168.1.0/24)"}>
|
||||
Parent CIDR block
|
||||
<Tooltip text="Enter IPv4 or IPv6 network in CIDR notation (e.g., 192.168.1.0/24)">
|
||||
<Icon name="help" size="sm" />
|
||||
</Tooltip>
|
||||
</label>
|
||||
<div class="input-wrapper">
|
||||
<input
|
||||
@@ -186,12 +201,13 @@
|
||||
placeholder="192.168.1.0/24"
|
||||
class="input-field"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-sm clear-btn"
|
||||
onclick={clearInput}
|
||||
use:tooltip={"Clear input"}
|
||||
>
|
||||
<Tooltip text="Clear input"><Icon name="trash" size="sm" /></Tooltip>
|
||||
<Icon name="trash" size="sm" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -199,11 +215,8 @@
|
||||
<!-- Split Parameters -->
|
||||
<div class="form-group">
|
||||
{#if splitMode === 'count'}
|
||||
<label for="subnet-count">
|
||||
<label for="subnet-count" use:tooltip={"How many equal subnets to create (will be rounded to nearest power of 2)"}>
|
||||
Number of subnets
|
||||
<Tooltip text="How many equal subnets to create">
|
||||
<Icon name="help" size="sm" />
|
||||
</Tooltip>
|
||||
</label>
|
||||
<input
|
||||
id="subnet-count"
|
||||
@@ -214,11 +227,8 @@
|
||||
class="input-field"
|
||||
/>
|
||||
{:else}
|
||||
<label for="target-prefix">
|
||||
<label for="target-prefix" use:tooltip={"The prefix length for child subnets (must be larger than parent prefix)"}>
|
||||
Target prefix length
|
||||
<Tooltip text="The prefix length for child subnets (must be larger than parent)">
|
||||
<Icon name="help" size="sm" />
|
||||
</Tooltip>
|
||||
</label>
|
||||
<input
|
||||
id="target-prefix"
|
||||
@@ -231,21 +241,29 @@
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<!-- Examples -->
|
||||
<div class="examples-section">
|
||||
<h4>Quick Examples</h4>
|
||||
</div>
|
||||
|
||||
<!-- Examples -->
|
||||
<div class="card examples-card">
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>Quick Examples</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example}
|
||||
<button
|
||||
type="button"
|
||||
class="example-btn"
|
||||
onclick={() => setExample(example)}
|
||||
{#each examples as example, i}
|
||||
<button
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => setExample(example, i)}
|
||||
use:tooltip={`${example.mode === 'count' ? 'Split into ' + example.count + ' subnets' : 'Split to /' + example.prefix + ' prefix'}`}
|
||||
>
|
||||
{example.label}
|
||||
<h5>{example.cidr}</h5>
|
||||
<p>{example.label}</p>
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<!-- Results Section -->
|
||||
@@ -261,7 +279,7 @@
|
||||
<div class="stats-section">
|
||||
<div class="summary-header">
|
||||
<h3>Split Results</h3>
|
||||
<button
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-sm"
|
||||
class:copied={copiedStates['all-subnets']}
|
||||
@@ -274,24 +292,24 @@
|
||||
|
||||
<div class="stats-grid">
|
||||
<div class="stat-card">
|
||||
<span class="stat-label">Parent Network</span>
|
||||
<span class="stat-label" use:tooltip={"The original network that was split"}>Parent Network</span>
|
||||
<span class="stat-value">{result.stats.parentCIDR}</span>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<span class="stat-label">Child Subnets</span>
|
||||
<span class="stat-label" use:tooltip={"Number of child subnets created"}>Child Subnets</span>
|
||||
<span class="stat-value">{result.stats.childCount}</span>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<span class="stat-label">Child Prefix</span>
|
||||
<span class="stat-label" use:tooltip={"Prefix length of each child subnet"}>Child Prefix</span>
|
||||
<span class="stat-value">/{result.stats.childPrefix}</span>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<span class="stat-label">Addresses per Child</span>
|
||||
<span class="stat-label" use:tooltip={"Total IP addresses in each child subnet"}>Addresses per Child</span>
|
||||
<span class="stat-value">{result.stats.addressesPerChild}</span>
|
||||
</div>
|
||||
{#if result.stats.utilizationPercent < 100}
|
||||
<div class="stat-card">
|
||||
<span class="stat-label">Utilization</span>
|
||||
<span class="stat-label" use:tooltip={"Percentage of parent network's address space used"}>Utilization</span>
|
||||
<span class="stat-value">{result.stats.utilizationPercent}%</span>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -320,7 +338,7 @@
|
||||
<div class="subnet-card">
|
||||
<div class="subnet-header">
|
||||
<code class="subnet-cidr">{subnet.cidr}</code>
|
||||
<button
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-icon btn-xs"
|
||||
class:copied={copiedStates[subnet.cidr]}
|
||||
@@ -408,30 +426,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.examples-section {
|
||||
margin-top: var(--spacing-md);
|
||||
|
||||
.examples-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.example-btn {
|
||||
padding: var(--spacing-sm);
|
||||
background-color: var(--bg-tertiary);
|
||||
border: 1px solid var(--border-secondary);
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: var(--font-size-sm);
|
||||
transition: all var(--transition-fast);
|
||||
|
||||
&:hover {
|
||||
background-color: var(--surface-hover);
|
||||
border-color: var(--color-primary);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.results-section {
|
||||
border-top: 2px solid var(--border-secondary);
|
||||
@@ -482,6 +476,10 @@
|
||||
font-size: var(--font-size-lg);
|
||||
font-weight: 600;
|
||||
color: var(--color-primary);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.visualization-section {
|
||||
@@ -558,6 +556,11 @@
|
||||
font-weight: 600;
|
||||
color: var(--color-primary);
|
||||
font-size: var(--font-size-md);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.subnet-details {
|
||||
@@ -582,6 +585,12 @@
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-sm);
|
||||
color: var(--text-primary);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 100%;
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
label {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { summarizeCIDRs, type SummarizationResult } from '$lib/utils/cidr-summarization-fixed.js';
|
||||
import Tooltip from '$lib/components/global/Tooltip.svelte';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import SvgIcon from '$lib/components/global/SvgIcon.svelte';
|
||||
|
||||
let inputText = $state(`192.168.1.1
|
||||
192.168.1.0/24
|
||||
@@ -11,6 +12,7 @@
|
||||
let mode = $state<'exact-merge' | 'minimal-cover'>('exact-merge');
|
||||
let result = $state<SummarizationResult | null>(null);
|
||||
let copiedStates = $state<Record<string, boolean>>({});
|
||||
let selectedExample = $state<string | null>(null);
|
||||
|
||||
const modes = [
|
||||
{
|
||||
@@ -68,6 +70,7 @@ fe80::/10`
|
||||
/* Set example content */
|
||||
function setExample(content: string) {
|
||||
inputText = content;
|
||||
selectedExample = content;
|
||||
performSummarization();
|
||||
}
|
||||
|
||||
@@ -76,7 +79,7 @@ fe80::/10`
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
copiedStates[id] = true;
|
||||
setTimeout(() => copiedStates[id] = false, 3000);
|
||||
setTimeout(() => copiedStates[id] = false, 2000);
|
||||
} catch (err) {
|
||||
console.error('Failed to copy:', err);
|
||||
}
|
||||
@@ -128,6 +131,13 @@ fe80::/10`
|
||||
performSummarization();
|
||||
}
|
||||
});
|
||||
|
||||
// Check if current input matches selected example
|
||||
$effect(() => {
|
||||
if (selectedExample && inputText.trim() !== selectedExample.trim()) {
|
||||
selectedExample = null;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="card">
|
||||
@@ -190,9 +200,10 @@ fe80::/10`
|
||||
<h4>Quick Examples</h4>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example}
|
||||
<button
|
||||
<button
|
||||
type="button"
|
||||
class="example-btn"
|
||||
class:selected={selectedExample === example.content}
|
||||
onclick={() => setExample(example.content)}
|
||||
>
|
||||
{example.label}
|
||||
@@ -219,15 +230,17 @@ fe80::/10`
|
||||
{#if result.ipv4.length > 0 || result.ipv6.length > 0}
|
||||
<div class="summary-header">
|
||||
<h3>Summarization Results</h3>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-sm"
|
||||
class:copied={copiedStates['all-results']}
|
||||
onclick={copyAllResults}
|
||||
>
|
||||
<Icon name={copiedStates['all-results'] ? 'check' : 'copy'} size="sm" />
|
||||
Copy All
|
||||
</button>
|
||||
<Tooltip text="Copy all IPv4 and IPv6 results to clipboard">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-sm"
|
||||
class:copied={copiedStates['all-results']}
|
||||
onclick={copyAllResults}
|
||||
>
|
||||
<SvgIcon icon={copiedStates['all-results'] ? 'check' : 'clipboard'} size="md" />
|
||||
Copy All
|
||||
</button>
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
||||
<div class="results-grid">
|
||||
@@ -236,27 +249,31 @@ fe80::/10`
|
||||
<div class="result-panel ipv4">
|
||||
<div class="panel-header">
|
||||
<h4>IPv4 CIDR Blocks ({result.ipv4.length})</h4>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-icon"
|
||||
class:copied={copiedStates['ipv4']}
|
||||
onclick={() => copyToClipboard((result?.ipv4 || []).join('\n'), 'ipv4')}
|
||||
>
|
||||
<Icon name={copiedStates['ipv4'] ? 'check' : 'copy'} size="sm" />
|
||||
</button>
|
||||
<Tooltip text="Copy all IPv4 CIDR blocks to clipboard">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-icon"
|
||||
class:copied={copiedStates['ipv4']}
|
||||
onclick={() => copyToClipboard((result?.ipv4 || []).join('\n'), 'ipv4')}
|
||||
>
|
||||
<SvgIcon icon={copiedStates['ipv4'] ? 'check' : 'clipboard'} size="md" />
|
||||
</button>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div class="cidr-list">
|
||||
{#each result.ipv4 as cidr}
|
||||
<div class="cidr-item">
|
||||
<code class="cidr-block">{cidr}</code>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-icon btn-xs"
|
||||
class:copied={copiedStates[cidr]}
|
||||
onclick={() => copyToClipboard(cidr, cidr)}
|
||||
>
|
||||
<Icon name={copiedStates[cidr] ? 'check' : 'copy'} size="xs" />
|
||||
</button>
|
||||
<Tooltip text="Copy this CIDR block to clipboard">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-icon btn-xs"
|
||||
class:copied={copiedStates[cidr]}
|
||||
onclick={() => copyToClipboard(cidr, cidr)}
|
||||
>
|
||||
<SvgIcon icon={copiedStates[cidr] ? 'check' : 'clipboard'} size="sm" />
|
||||
</button>
|
||||
</Tooltip>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -268,27 +285,31 @@ fe80::/10`
|
||||
<div class="result-panel ipv6">
|
||||
<div class="panel-header">
|
||||
<h4>IPv6 CIDR Blocks ({result.ipv6.length})</h4>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-icon"
|
||||
class:copied={copiedStates['ipv6']}
|
||||
onclick={() => copyToClipboard((result?.ipv6 || []).join('\n'), 'ipv6')}
|
||||
>
|
||||
<Icon name={copiedStates['ipv6'] ? 'check' : 'copy'} size="sm" />
|
||||
</button>
|
||||
<Tooltip text="Copy all IPv6 CIDR blocks to clipboard">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-icon"
|
||||
class:copied={copiedStates['ipv6']}
|
||||
onclick={() => copyToClipboard((result?.ipv6 || []).join('\n'), 'ipv6')}
|
||||
>
|
||||
<SvgIcon icon={copiedStates['ipv6'] ? 'check' : 'clipboard'} size="md" />
|
||||
</button>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div class="cidr-list">
|
||||
{#each result.ipv6 as cidr}
|
||||
<div class="cidr-item">
|
||||
<code class="cidr-block">{cidr}</code>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-icon btn-xs"
|
||||
class:copied={copiedStates[cidr]}
|
||||
onclick={() => copyToClipboard(cidr, cidr)}
|
||||
>
|
||||
<Icon name={copiedStates[cidr] ? 'check' : 'copy'} size="xs" />
|
||||
</button>
|
||||
<Tooltip text="Copy this CIDR block to clipboard">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-icon btn-xs"
|
||||
class:copied={copiedStates[cidr]}
|
||||
onclick={() => copyToClipboard(cidr, cidr)}
|
||||
>
|
||||
<SvgIcon icon={copiedStates[cidr] ? 'check' : 'clipboard'} size="sm" />
|
||||
</button>
|
||||
</Tooltip>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -301,23 +322,33 @@ fe80::/10`
|
||||
<h4>Summarization Statistics</h4>
|
||||
<div class="stats-grid">
|
||||
<div class="stat-card">
|
||||
<span class="stat-label">Original IPv4 Items</span>
|
||||
<Tooltip text="Number of individual IPv4 items in the original input">
|
||||
<span class="stat-label">Original IPv4 Items</span>
|
||||
</Tooltip>
|
||||
<span class="stat-value">{result.stats.originalIpv4Count}</span>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<span class="stat-label">Summarized IPv4 Blocks</span>
|
||||
<Tooltip text="Number of CIDR blocks after IPv4 summarization">
|
||||
<span class="stat-label">Summarized IPv4 Blocks</span>
|
||||
</Tooltip>
|
||||
<span class="stat-value">{result.stats.summarizedIpv4Count}</span>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<span class="stat-label">Original IPv6 Items</span>
|
||||
<Tooltip text="Number of individual IPv6 items in the original input">
|
||||
<span class="stat-label">Original IPv6 Items</span>
|
||||
</Tooltip>
|
||||
<span class="stat-value">{result.stats.originalIpv6Count}</span>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<span class="stat-label">Summarized IPv6 Blocks</span>
|
||||
<Tooltip text="Number of CIDR blocks after IPv6 summarization">
|
||||
<span class="stat-label">Summarized IPv6 Blocks</span>
|
||||
</Tooltip>
|
||||
<span class="stat-value">{result.stats.summarizedIpv6Count}</span>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<span class="stat-label">Total Addresses Covered</span>
|
||||
<Tooltip text="Total number of individual IP addresses covered by all summarized blocks">
|
||||
<span class="stat-label">Total Addresses Covered</span>
|
||||
</Tooltip>
|
||||
<span class="stat-value large">{result.stats.totalAddressesCovered}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -396,11 +427,32 @@ fe80::/10`
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: var(--font-size-sm);
|
||||
transition: all var(--transition-fast);
|
||||
position: relative;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--surface-hover);
|
||||
border-color: var(--color-primary);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
&.selected {
|
||||
background-color: color-mix(in srgb, var(--color-primary), transparent 90%);
|
||||
border-color: var(--color-primary);
|
||||
border-width: 2px;
|
||||
color: var(--color-primary);
|
||||
font-weight: 600;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: var(--spacing-xs);
|
||||
right: var(--spacing-xs);
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background-color: var(--color-primary);
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -538,17 +590,35 @@ fe80::/10`
|
||||
.btn {
|
||||
&.copied {
|
||||
color: var(--color-success);
|
||||
background-color: rgba(35, 134, 54, 0.1);
|
||||
background-color: color-mix(in srgb, var(--color-success), transparent 90%);
|
||||
border-color: var(--color-success);
|
||||
transform: scale(1.05);
|
||||
|
||||
:global(.icon) {
|
||||
animation: success-pulse 0.3s ease-out;
|
||||
}
|
||||
}
|
||||
|
||||
:global(.icon) {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
transition: transform var(--transition-fast);
|
||||
}
|
||||
|
||||
&.btn-xs :global(.icon) {
|
||||
width: 0.75rem;
|
||||
height: 0.75rem;
|
||||
}
|
||||
|
||||
&:hover:not(.copied) :global(.icon) {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes success-pulse {
|
||||
0% { transform: scale(1); }
|
||||
50% { transform: scale(1.2); }
|
||||
100% { transform: scale(1); }
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { computeCIDRDifference, type DiffResult } from '$lib/utils/cidr-diff.js';
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import '../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let pools = $state(`192.168.0.0/16
|
||||
10.0.0.0/8`);
|
||||
@@ -20,6 +21,7 @@
|
||||
} | null>(null);
|
||||
let copiedStates = $state<Record<string, boolean>>({});
|
||||
let selectedExample = $state<string | null>(null);
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
let userModified = $state(false);
|
||||
|
||||
const examples = [
|
||||
@@ -32,7 +34,7 @@
|
||||
targetPrefix: 24
|
||||
},
|
||||
{
|
||||
label: 'Large Pool Analysis',
|
||||
label: 'Large Pool Analysis',
|
||||
pools: '10.0.0.0/8',
|
||||
allocations: `10.0.0.0/16
|
||||
10.1.0.0/16
|
||||
@@ -46,14 +48,41 @@
|
||||
allocations: `172.16.1.0/24
|
||||
192.168.100.0/24`,
|
||||
targetPrefix: 28
|
||||
},
|
||||
{
|
||||
label: 'Campus Network Planning',
|
||||
pools: `10.10.0.0/16
|
||||
10.20.0.0/16`,
|
||||
allocations: `10.10.1.0/24
|
||||
10.10.5.0/24
|
||||
10.20.10.0/24`,
|
||||
targetPrefix: 25
|
||||
},
|
||||
{
|
||||
label: 'Data Center Allocation',
|
||||
pools: '172.20.0.0/14',
|
||||
allocations: `172.20.0.0/16
|
||||
172.21.0.0/16
|
||||
172.23.128.0/17`,
|
||||
targetPrefix: 20
|
||||
},
|
||||
{
|
||||
label: 'Service Provider Space',
|
||||
pools: `203.0.113.0/24
|
||||
198.51.100.0/24`,
|
||||
allocations: `203.0.113.0/26
|
||||
203.0.113.128/25
|
||||
198.51.100.64/26`,
|
||||
targetPrefix: 27
|
||||
}
|
||||
];
|
||||
|
||||
function loadExample(example: typeof examples[0]) {
|
||||
function loadExample(example: typeof examples[0], index: number) {
|
||||
pools = example.pools;
|
||||
allocations = example.allocations;
|
||||
targetPrefix = example.targetPrefix;
|
||||
selectedExample = example.label;
|
||||
selectedExampleIndex = index;
|
||||
userModified = false;
|
||||
calculateGaps();
|
||||
}
|
||||
@@ -128,6 +157,7 @@
|
||||
function handleInputChange() {
|
||||
userModified = true;
|
||||
selectedExample = null;
|
||||
selectedExampleIndex = null;
|
||||
calculateGaps();
|
||||
}
|
||||
|
||||
@@ -189,23 +219,29 @@
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
<section class="examples-section">
|
||||
<h4>Quick Examples</h4>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example}
|
||||
<button
|
||||
class="example-card {selectedExample === example.label ? 'active' : ''}"
|
||||
onclick={() => loadExample(example)}
|
||||
>
|
||||
<div class="example-label">{example.label}</div>
|
||||
<div class="example-preview">
|
||||
{example.pools.split('\n')[0]}
|
||||
{example.pools.includes('\n') ? '...' : ''}
|
||||
</div>
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
</section>
|
||||
<div class="card examples-card">
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>Quick Examples</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example, i}
|
||||
<button
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => loadExample(example, i)}
|
||||
>
|
||||
<div class="example-label">{example.label}</div>
|
||||
<div class="example-preview">
|
||||
{example.pools.split('\n')[0]}
|
||||
{example.pools.includes('\n') ? '...' : ''}
|
||||
</div>
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<!-- Input Section -->
|
||||
<section class="input-section">
|
||||
@@ -410,53 +446,6 @@
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
.examples-section {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
|
||||
h4 {
|
||||
margin-bottom: var(--spacing-md);
|
||||
color: var(--color-info-light);
|
||||
}
|
||||
}
|
||||
|
||||
.examples-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.example-card {
|
||||
padding: var(--spacing-sm);
|
||||
background-color: var(--bg-secondary);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-fast);
|
||||
text-align: left;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--surface-hover);
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: var(--surface-hover);
|
||||
border-color: var(--color-primary);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
}
|
||||
|
||||
.example-label {
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: var(--spacing-xs);
|
||||
}
|
||||
|
||||
.example-preview {
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-xs);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.input-section {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
@@ -787,10 +776,6 @@
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.examples-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.free-blocks-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
@@ -2,11 +2,59 @@
|
||||
import { convertWildcardMasks, type WildcardResult } from '$lib/utils/wildcard-mask.js';
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import '../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let inputText = $state('192.168.1.0/24\n10.0.0.0 255.255.255.0\n172.16.0.0 0.0.255.255');
|
||||
let result = $state<WildcardResult | null>(null);
|
||||
let isLoading = $state(false);
|
||||
let copiedStates = $state<Record<string, boolean>>({});
|
||||
let selectedExample = $state<string | null>(null);
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
let userModified = $state(false);
|
||||
|
||||
const examples = [
|
||||
{
|
||||
label: 'Basic CIDR to Wildcard',
|
||||
input: `192.168.1.0/24
|
||||
10.0.0.0/16
|
||||
172.16.0.0/20`,
|
||||
generateACL: false
|
||||
},
|
||||
{
|
||||
label: 'Subnet Mask Format',
|
||||
input: `192.168.1.0 255.255.255.0
|
||||
10.0.0.0 255.255.0.0
|
||||
172.16.0.0 255.255.240.0`,
|
||||
generateACL: false
|
||||
},
|
||||
{
|
||||
label: 'Wildcard Mask Input',
|
||||
input: `192.168.0.0 0.0.255.255
|
||||
10.0.0.0 0.255.255.255
|
||||
172.16.0.0 0.0.15.255`,
|
||||
generateACL: false
|
||||
},
|
||||
{
|
||||
label: 'Mixed Formats',
|
||||
input: `192.168.1.0/24
|
||||
10.0.0.0 255.255.0.0
|
||||
172.16.0.0 0.0.255.255`,
|
||||
generateACL: false
|
||||
},
|
||||
{
|
||||
label: 'Cisco ACL Generation',
|
||||
input: `192.168.1.0/24
|
||||
10.0.0.0/16`,
|
||||
generateACL: true
|
||||
},
|
||||
{
|
||||
label: 'Complex Network ACLs',
|
||||
input: `192.168.0.0/22
|
||||
10.1.0.0/20
|
||||
172.16.100.0/24`,
|
||||
generateACL: true
|
||||
}
|
||||
];
|
||||
|
||||
// ACL options
|
||||
let generateACL = $state(false);
|
||||
@@ -84,17 +132,39 @@
|
||||
if (!result) return;
|
||||
const rules = result.aclRules[type];
|
||||
if (rules.length > 0) {
|
||||
copyToClipboard(rules.join('\n'));
|
||||
copyToClipboard(rules.join('\n'), `acl-${type}`);
|
||||
}
|
||||
}
|
||||
|
||||
function loadExample(example: typeof examples[0], index: number) {
|
||||
inputText = example.input;
|
||||
generateACL = example.generateACL;
|
||||
selectedExample = example.label;
|
||||
selectedExampleIndex = index;
|
||||
userModified = false;
|
||||
}
|
||||
|
||||
function handleInputChange() {
|
||||
userModified = true;
|
||||
selectedExample = null;
|
||||
selectedExampleIndex = null;
|
||||
}
|
||||
|
||||
// Auto-convert when inputs change
|
||||
// Auto-convert when inputs or ACL settings change
|
||||
$effect(() => {
|
||||
if (inputText.trim()) {
|
||||
const timeoutId = setTimeout(convertMasks, 300);
|
||||
return () => clearTimeout(timeoutId);
|
||||
}
|
||||
});
|
||||
|
||||
// Update ACL when settings change
|
||||
$effect(() => {
|
||||
if (result && generateACL) {
|
||||
const timeoutId = setTimeout(convertMasks, 100);
|
||||
return () => clearTimeout(timeoutId);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="card">
|
||||
@@ -103,16 +173,44 @@
|
||||
<p>Convert between CIDR notation, subnet masks, and wildcard masks with ACL rule generation</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
<div class="card examples-card">
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>Quick Examples</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example, i}
|
||||
<button
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => loadExample(example, i)}
|
||||
>
|
||||
<div class="example-label">{example.label}</div>
|
||||
<div class="example-preview">
|
||||
{example.generateACL ? 'With ACL' : 'Conversion only'}
|
||||
</div>
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<div class="input-section">
|
||||
<div class="inputs-section">
|
||||
<h3>Network Inputs</h3>
|
||||
<h3 use:tooltip={"Enter networks in various formats for wildcard mask conversion"}>Network Inputs</h3>
|
||||
<div class="input-group">
|
||||
<label for="inputs" use:tooltip={{ text: 'Enter networks in CIDR, subnet mask, or wildcard mask format', position: 'top' }}>
|
||||
<label
|
||||
for="inputs"
|
||||
use:tooltip={"Enter networks in CIDR, subnet mask, or wildcard mask format"}
|
||||
>
|
||||
IP Addresses, CIDRs, or Ranges
|
||||
</label>
|
||||
<textarea
|
||||
id="inputs"
|
||||
bind:value={inputText}
|
||||
oninput={handleInputChange}
|
||||
placeholder="192.168.1.0/24 10.0.0.0 255.255.255.0 172.16.0.0 0.0.255.255"
|
||||
rows="6"
|
||||
></textarea>
|
||||
@@ -123,10 +221,13 @@
|
||||
</div>
|
||||
|
||||
<div class="acl-section">
|
||||
<h3>ACL Options</h3>
|
||||
<h3 use:tooltip={"Configure access control list rule generation for network devices"}>ACL Options</h3>
|
||||
<div class="checkbox-group">
|
||||
<label class="checkbox-label" use:tooltip={{ text: 'Generate access control list rules for network devices', position: 'top' }}>
|
||||
<input type="checkbox" bind:checked={generateACL} />
|
||||
<label
|
||||
class="checkbox-label"
|
||||
use:tooltip={"Generate access control list rules for network devices"}
|
||||
>
|
||||
<input type="checkbox" bind:checked={generateACL} onchange={handleInputChange} />
|
||||
<span class="checkbox-text">Generate ACL Rules</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -134,29 +235,46 @@
|
||||
{#if generateACL}
|
||||
<div class="acl-settings">
|
||||
<div class="input-group">
|
||||
<label for="acl-type" use:tooltip={{ text: 'Whether to permit or deny traffic matching this rule', position: 'top' }}>Action</label>
|
||||
<select id="acl-type" bind:value={aclType}>
|
||||
<label
|
||||
for="acl-type"
|
||||
use:tooltip={"Whether to permit or deny traffic matching this rule"}
|
||||
>
|
||||
Action
|
||||
</label>
|
||||
<select id="acl-type" bind:value={aclType} onchange={handleInputChange}>
|
||||
<option value="permit">Permit</option>
|
||||
<option value="deny">Deny</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="input-group">
|
||||
<label for="protocol" use:tooltip={{ text: 'Network protocol (ip, tcp, udp, etc.)', position: 'top' }}>Protocol</label>
|
||||
<label
|
||||
for="protocol"
|
||||
use:tooltip={"Network protocol (ip, tcp, udp, icmp, etc.)"}
|
||||
>
|
||||
Protocol
|
||||
</label>
|
||||
<input
|
||||
id="protocol"
|
||||
type="text"
|
||||
bind:value={protocol}
|
||||
oninput={handleInputChange}
|
||||
placeholder="ip"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="input-group">
|
||||
<label for="destination" use:tooltip={{ text: 'Destination network or "any" for all destinations', position: 'top' }}>Destination</label>
|
||||
<label
|
||||
for="destination"
|
||||
use:tooltip={"Destination network or 'any' for all destinations"}
|
||||
>
|
||||
Destination
|
||||
</label>
|
||||
<input
|
||||
id="destination"
|
||||
type="text"
|
||||
bind:value={destination}
|
||||
oninput={handleInputChange}
|
||||
placeholder="any"
|
||||
/>
|
||||
</div>
|
||||
@@ -185,33 +303,33 @@
|
||||
|
||||
{#if result.conversions.length > 0}
|
||||
<div class="summary">
|
||||
<h3>Conversion Summary</h3>
|
||||
<h3 use:tooltip={"Overview of wildcard mask conversion results"}>Conversion Summary</h3>
|
||||
<div class="summary-stats">
|
||||
<div class="stat">
|
||||
<span class="stat-value">{result.summary.totalInputs}</span>
|
||||
<span class="stat-label">Total Inputs</span>
|
||||
<span class="stat-label" use:tooltip={"Total number of network inputs processed"}>Total Inputs</span>
|
||||
</div>
|
||||
<div class="stat aligned">
|
||||
<span class="stat-value">{result.summary.validInputs}</span>
|
||||
<span class="stat-label">Valid</span>
|
||||
<span class="stat-label" use:tooltip={"Successfully converted network inputs"}>Valid</span>
|
||||
</div>
|
||||
<div class="stat misaligned">
|
||||
<span class="stat-value">{result.summary.invalidInputs}</span>
|
||||
<span class="stat-label">Invalid</span>
|
||||
<span class="stat-label" use:tooltip={"Network inputs that could not be converted"}>Invalid</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="conversions">
|
||||
<div class="conversions-header">
|
||||
<h3>Mask Conversions</h3>
|
||||
<h3 use:tooltip={"Detailed conversion results for each network input"}>Mask Conversions</h3>
|
||||
<div class="export-buttons">
|
||||
<button onclick={() => exportResults('csv')}>
|
||||
<Icon name="download" />
|
||||
<Icon name="csv-file" />
|
||||
Export CSV
|
||||
</button>
|
||||
<button onclick={() => exportResults('json')}>
|
||||
<Icon name="download" />
|
||||
<Icon name="json-file" />
|
||||
Export JSON
|
||||
</button>
|
||||
</div>
|
||||
@@ -239,7 +357,7 @@
|
||||
{#if conversion.isValid}
|
||||
<div class="conversion-details">
|
||||
<div class="detail-row">
|
||||
<span class="label">CIDR:</span>
|
||||
<span class="label" use:tooltip={"Classless Inter-Domain Routing notation"}>CIDR:</span>
|
||||
<div class="code-container">
|
||||
<code>{conversion.cidr}</code>
|
||||
<button
|
||||
@@ -255,7 +373,7 @@
|
||||
</div>
|
||||
|
||||
<div class="detail-row">
|
||||
<span class="label">Subnet Mask:</span>
|
||||
<span class="label" use:tooltip={"Standard subnet mask in dotted decimal notation"}>Subnet Mask:</span>
|
||||
<div class="code-container">
|
||||
<code>{conversion.subnetMask}</code>
|
||||
<button
|
||||
@@ -271,7 +389,7 @@
|
||||
</div>
|
||||
|
||||
<div class="detail-row">
|
||||
<span class="label">Wildcard Mask:</span>
|
||||
<span class="label" use:tooltip={"Inverse subnet mask used in Cisco ACLs and OSPF"}>Wildcard Mask:</span>
|
||||
<div class="code-container">
|
||||
<code>{conversion.wildcardMask}</code>
|
||||
<button
|
||||
@@ -289,19 +407,19 @@
|
||||
<div class="network-info">
|
||||
<div class="info-grid">
|
||||
<div>
|
||||
<span class="info-label">Network:</span>
|
||||
<span class="info-label" use:tooltip={"First address in the network range"}>Network:</span>
|
||||
<span class="info-value">{conversion.networkAddress}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="info-label">Broadcast:</span>
|
||||
<span class="info-label" use:tooltip={"Last address in the network range"}>Broadcast:</span>
|
||||
<span class="info-value">{conversion.broadcastAddress}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="info-label">Host Bits:</span>
|
||||
<span class="info-label" use:tooltip={"Number of bits available for host addresses"}>Host Bits:</span>
|
||||
<span class="info-value">{conversion.hostBits}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="info-label">Usable Hosts:</span>
|
||||
<span class="info-label" use:tooltip={"Total assignable host addresses (excluding network and broadcast)"}>Usable Hosts:</span>
|
||||
<span class="info-value">{conversion.usableHosts.toLocaleString()}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -319,16 +437,20 @@
|
||||
</div>
|
||||
|
||||
{#if generateACL && (result.aclRules.cisco.length > 0 || result.aclRules.juniper.length > 0 || result.aclRules.generic.length > 0)}
|
||||
<div class="card">
|
||||
<h3>Generated ACL Rules</h3>
|
||||
|
||||
<div class="acl-rules-container">
|
||||
<h3 use:tooltip={"Access control list rules generated for network devices"}>Generated ACL Rules</h3>
|
||||
|
||||
{#if result.aclRules.cisco.length > 0}
|
||||
<div class="acl-section">
|
||||
<div class="acl-header">
|
||||
<h4>Cisco ACL</h4>
|
||||
<button onclick={() => copyACLRules('cisco')} class="copy-btn">
|
||||
<Icon name="copy" />
|
||||
Copy
|
||||
<h4 use:tooltip={"Cisco IOS access control list format"}>Cisco ACL</h4>
|
||||
<button
|
||||
onclick={() => copyACLRules('cisco')}
|
||||
class="copy-btn {copiedStates['acl-cisco'] ? 'copied' : ''}"
|
||||
use:tooltip={"Copy all Cisco ACL rules to clipboard"}
|
||||
>
|
||||
<Icon name={copiedStates['acl-cisco'] ? 'check' : 'copy'} size="xs" />
|
||||
{copiedStates['acl-cisco'] ? 'Copied!' : 'Copy'}
|
||||
</button>
|
||||
</div>
|
||||
<div class="acl-code">
|
||||
@@ -342,10 +464,14 @@
|
||||
{#if result.aclRules.juniper.length > 0}
|
||||
<div class="acl-section">
|
||||
<div class="acl-header">
|
||||
<h4>Juniper ACL</h4>
|
||||
<button onclick={() => copyACLRules('juniper')} class="copy-btn">
|
||||
<Icon name="copy" />
|
||||
Copy
|
||||
<h4 use:tooltip={"Juniper JunOS firewall filter format"}>Juniper ACL</h4>
|
||||
<button
|
||||
onclick={() => copyACLRules('juniper')}
|
||||
class="copy-btn {copiedStates['acl-juniper'] ? 'copied' : ''}"
|
||||
use:tooltip={"Copy all Juniper ACL rules to clipboard"}
|
||||
>
|
||||
<Icon name={copiedStates['acl-juniper'] ? 'check' : 'copy'} size="xs" />
|
||||
{copiedStates['acl-juniper'] ? 'Copied!' : 'Copy'}
|
||||
</button>
|
||||
</div>
|
||||
<div class="acl-code">
|
||||
@@ -359,10 +485,14 @@
|
||||
{#if result.aclRules.generic.length > 0}
|
||||
<div class="acl-section">
|
||||
<div class="acl-header">
|
||||
<h4>Generic ACL</h4>
|
||||
<button onclick={() => copyACLRules('generic')} class="copy-btn">
|
||||
<Icon name="copy" />
|
||||
Copy
|
||||
<h4 use:tooltip={"Generic access control list format"}>Generic ACL</h4>
|
||||
<button
|
||||
onclick={() => copyACLRules('generic')}
|
||||
class="copy-btn {copiedStates['acl-generic'] ? 'copied' : ''}"
|
||||
use:tooltip={"Copy all generic ACL rules to clipboard"}
|
||||
>
|
||||
<Icon name={copiedStates['acl-generic'] ? 'check' : 'copy'} size="xs" />
|
||||
{copiedStates['acl-generic'] ? 'Copied!' : 'Copy'}
|
||||
</button>
|
||||
</div>
|
||||
<div class="acl-code">
|
||||
@@ -384,10 +514,8 @@
|
||||
display: grid;
|
||||
gap: var(--spacing-lg);
|
||||
margin-bottom: var(--spacing-lg);
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.input-section {
|
||||
@media (min-width: 768px) {
|
||||
grid-template-columns: 2fr 1fr;
|
||||
}
|
||||
}
|
||||
@@ -398,57 +526,51 @@
|
||||
border: 1px solid var(--border-secondary);
|
||||
border-radius: var(--radius-md);
|
||||
padding: var(--spacing-md);
|
||||
}
|
||||
|
||||
.inputs-section h3,
|
||||
.acl-section h3 {
|
||||
color: var(--text-primary);
|
||||
font-size: var(--font-size-lg);
|
||||
margin-bottom: var(--spacing-md);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.checkbox-group {
|
||||
margin-bottom: var(--spacing-md);
|
||||
}
|
||||
|
||||
.checkbox-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
cursor: pointer;
|
||||
padding: var(--spacing-sm);
|
||||
background-color: var(--bg-primary);
|
||||
border-radius: var(--radius-sm);
|
||||
transition: all var(--transition-fast);
|
||||
width: fit-content;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--surface-hover);
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
flex-shrink: 0;
|
||||
cursor: pointer;
|
||||
accent-color: var(--color-primary);
|
||||
}
|
||||
|
||||
.checkbox-text {
|
||||
h3 {
|
||||
color: var(--text-primary);
|
||||
font-size: var(--font-size-sm);
|
||||
line-height: 1.4;
|
||||
font-size: var(--font-size-lg);
|
||||
margin-bottom: var(--spacing-md);
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.acl-settings {
|
||||
padding-top: var(--spacing-md);
|
||||
border-top: 1px solid var(--border-primary);
|
||||
margin-top: var(--spacing-md);
|
||||
.checkbox-group {
|
||||
margin-bottom: var(--spacing-md);
|
||||
|
||||
.checkbox-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
cursor: pointer;
|
||||
padding: var(--spacing-sm);
|
||||
background-color: var(--bg-primary);
|
||||
border-radius: var(--radius-sm);
|
||||
transition: all var(--transition-fast);
|
||||
width: fit-content;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--surface-hover);
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
flex-shrink: 0;
|
||||
cursor: pointer;
|
||||
accent-color: var(--color-primary);
|
||||
}
|
||||
|
||||
.checkbox-text {
|
||||
color: var(--text-primary);
|
||||
font-size: var(--font-size-sm);
|
||||
line-height: 1.4;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.input-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -841,18 +963,113 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ACL Rules Container */
|
||||
.acl-rules-container {
|
||||
width: 100%;
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: var(--spacing-lg);
|
||||
margin-top: var(--spacing-lg);
|
||||
|
||||
h3 {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
color: var(--text-primary);
|
||||
font-size: var(--font-size-lg);
|
||||
}
|
||||
|
||||
.acl-section {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.acl-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: var(--spacing-sm);
|
||||
|
||||
h4 {
|
||||
color: var(--text-primary);
|
||||
font-size: var(--font-size-md);
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.copy-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-xs);
|
||||
padding: var(--spacing-xs) var(--spacing-sm);
|
||||
background: var(--bg-tertiary);
|
||||
color: var(--text-primary);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: var(--font-size-sm);
|
||||
cursor: pointer;
|
||||
transition: var(--transition-fast);
|
||||
|
||||
&:hover {
|
||||
background: var(--surface-hover);
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
&.copied {
|
||||
color: var(--color-success);
|
||||
border-color: var(--color-success);
|
||||
background: color-mix(in srgb, var(--color-success), transparent 90%);
|
||||
}
|
||||
}
|
||||
|
||||
.acl-code {
|
||||
background: var(--bg-tertiary);
|
||||
color: var(--text-primary);
|
||||
padding: var(--spacing-md);
|
||||
border-radius: var(--radius-sm);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font-size-sm);
|
||||
overflow-x: auto;
|
||||
border: 1px solid var(--border-primary);
|
||||
|
||||
.acl-line {
|
||||
margin-bottom: 0.25rem;
|
||||
white-space: nowrap;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
|
||||
.input-section {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
|
||||
.summary-stats {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
|
||||
.export-buttons {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.acl-rules-container {
|
||||
.acl-section {
|
||||
.acl-header {
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-sm);
|
||||
align-items: stretch;
|
||||
|
||||
.copy-btn {
|
||||
align-self: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,96 @@
|
||||
export const setOperationsContent = {
|
||||
title: "Set Operations Reference",
|
||||
description: "Mathematical set operations allow you to combine, analyze, and manipulate IP address ranges systematically. Each operation serves different network analysis and management purposes.",
|
||||
|
||||
operations: [
|
||||
{
|
||||
symbol: "A ∪ B",
|
||||
name: "Union",
|
||||
description: "Combines all addresses from both sets. Results in addresses that are in A OR B. Useful for merging address allocations or creating comprehensive allow-lists.",
|
||||
example: "192.168.1.0/24 ∪ 192.168.2.0/24 = both networks"
|
||||
},
|
||||
{
|
||||
symbol: "A ∩ B",
|
||||
name: "Intersection",
|
||||
description: "Finds common addresses between sets. Results in addresses that are in BOTH A AND B. Essential for identifying conflicts or overlapping allocations.",
|
||||
example: "192.168.0.0/16 ∩ 192.168.1.0/24 = 192.168.1.0/24"
|
||||
},
|
||||
{
|
||||
symbol: "A - B",
|
||||
name: "Difference",
|
||||
description: "Removes B's addresses from A. Results in addresses that are in A but NOT in B. Critical for calculating remaining capacity or excluding reserved ranges.",
|
||||
example: "192.168.1.0/24 - 192.168.1.128/25 = 192.168.1.0/25"
|
||||
},
|
||||
{
|
||||
symbol: "A ⊆ B",
|
||||
name: "Containment",
|
||||
description: "Tests if A is completely contained within B. Returns boolean result plus coverage analysis. Valuable for validating subnet hierarchies and allocation compliance.",
|
||||
example: "192.168.1.0/25 ⊆ 192.168.1.0/24 = true"
|
||||
}
|
||||
],
|
||||
|
||||
patterns: [
|
||||
{
|
||||
icon: "shield",
|
||||
title: "Firewall Management",
|
||||
items: [
|
||||
{ term: "Allow Lists", description: "Union of trusted networks" },
|
||||
{ term: "Conflicts", description: "Intersection of allow/deny rules" },
|
||||
{ term: "Exceptions", description: "Difference to exclude specific ranges" }
|
||||
]
|
||||
},
|
||||
{
|
||||
icon: "server",
|
||||
title: "IP Allocation",
|
||||
items: [
|
||||
{ term: "Available Space", description: "Difference from allocated ranges" },
|
||||
{ term: "Overlaps", description: "Intersection of allocation requests" },
|
||||
{ term: "Validation", description: "Containment within authorized blocks" }
|
||||
]
|
||||
},
|
||||
{
|
||||
icon: "supernet-calculator",
|
||||
title: "Network Analysis",
|
||||
items: [
|
||||
{ term: "Coverage", description: "Union of monitoring ranges" },
|
||||
{ term: "Gaps", description: "Difference to find unmonitored areas" },
|
||||
{ term: "Redundancy", description: "Intersection of backup networks" }
|
||||
]
|
||||
},
|
||||
{
|
||||
icon: "ip-validator",
|
||||
title: "Cloud Networks",
|
||||
items: [
|
||||
{ term: "VPC Planning", description: "Union of required address space" },
|
||||
{ term: "Peering", description: "Intersection analysis for conflicts" },
|
||||
{ term: "Segmentation", description: "Difference for isolation" }
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
notes: [
|
||||
{
|
||||
title: "IPv4 vs IPv6",
|
||||
content: "All operations process IPv4 and IPv6 addresses separately. You cannot perform set operations between different IP versions - they operate in distinct address spaces."
|
||||
},
|
||||
{
|
||||
title: "CIDR Optimization",
|
||||
content: "Results are automatically optimized into minimal CIDR representations. Complex operations may require multiple CIDR blocks to exactly represent the result."
|
||||
},
|
||||
{
|
||||
title: "Range Normalization",
|
||||
content: "Input ranges are normalized and merged before operations. Overlapping inputs within the same set are automatically combined for accurate results."
|
||||
},
|
||||
{
|
||||
title: "Performance Considerations",
|
||||
content: "Operations are optimized for network-sized ranges. Very large address spaces or numerous small ranges may require additional processing time."
|
||||
}
|
||||
],
|
||||
|
||||
bestPractices: [
|
||||
{ term: "Validate Inputs", description: "Always verify CIDR notation and IP formats before operations" },
|
||||
{ term: "Document Operations", description: "Export results and maintain records of set operations" },
|
||||
{ term: "Test in Stages", description: "For complex operations, break into smaller steps for verification" },
|
||||
{ term: "Monitor Results", description: "Use visualization to verify operations produce expected outcomes" }
|
||||
]
|
||||
};
|
||||
+130
-6
@@ -1,7 +1,131 @@
|
||||
export const cidrContent = {
|
||||
title: "CIDR Notation Explained",
|
||||
description: "Complete guide to CIDR notation - what it is, why it replaced IP classes, and how to read network prefixes.",
|
||||
|
||||
|
||||
coreConcepts: [
|
||||
{
|
||||
icon: 'network',
|
||||
title: 'CIDR Notation',
|
||||
description: 'The slash notation (like /24) tells you how many bits identify the network portion of an IP address.',
|
||||
example: '192.168.1.0/24 = 24 network bits, 8 host bits',
|
||||
color: 'var(--color-primary)'
|
||||
},
|
||||
{
|
||||
icon: 'mask',
|
||||
title: 'Subnet Masks',
|
||||
description: 'Binary masks that define which part of an IP address is network and which is host.',
|
||||
example: '/24 = 255.255.255.0 in decimal',
|
||||
color: 'var(--color-info)'
|
||||
},
|
||||
{
|
||||
icon: 'merge',
|
||||
title: 'Route Aggregation',
|
||||
description: 'Combining multiple networks into fewer, larger prefixes for efficient routing.',
|
||||
example: '192.168.0.0/24 + 192.168.1.0/24 = 192.168.0.0/23',
|
||||
color: 'var(--color-success)'
|
||||
},
|
||||
{
|
||||
icon: 'split',
|
||||
title: 'Network Division',
|
||||
description: 'Breaking larger networks into smaller subnets for better organization.',
|
||||
example: '10.0.0.0/16 can be split into 256 /24 subnets',
|
||||
color: 'var(--color-warning)'
|
||||
}
|
||||
],
|
||||
|
||||
aboutSection: {
|
||||
content: [
|
||||
"CIDR (Classless Inter-Domain Routing) revolutionized how we handle IP addresses. Before CIDR, networks were stuck with fixed class sizes (Class A, B, C). CIDR lets you create networks of any size by specifying exactly how many bits identify the network.",
|
||||
"The key insight: instead of wasting addresses with oversized networks or running out with undersized ones, you can right-size your networks to match your actual needs."
|
||||
],
|
||||
advantages: [
|
||||
{ title: 'Flexible Addressing', description: 'Create networks of any size, not limited to class boundaries' },
|
||||
{ title: 'Efficient Allocation', description: 'Reduce IP address waste with right-sized subnets' },
|
||||
{ title: 'Route Aggregation', description: 'Combine multiple routes into summaries for smaller routing tables' },
|
||||
{ title: 'Hierarchical Design', description: 'Build scalable network architectures with logical addressing' }
|
||||
]
|
||||
},
|
||||
|
||||
commonSizes: [
|
||||
{ cidr: '/8', mask: '255.0.0.0', hosts: '16,777,214', use: 'ISP allocations', color: 'var(--color-error)' },
|
||||
{ cidr: '/16', mask: '255.255.0.0', hosts: '65,534', use: 'Large organizations', color: 'var(--color-warning)' },
|
||||
{ cidr: '/24', mask: '255.255.255.0', hosts: '254', use: 'Department networks', color: 'var(--color-success)' },
|
||||
{ cidr: '/25', mask: '255.255.255.128', hosts: '126', use: 'Small offices', color: 'var(--color-info)' },
|
||||
{ cidr: '/26', mask: '255.255.255.192', hosts: '62', use: 'VLANs', color: 'var(--color-info)' },
|
||||
{ cidr: '/28', mask: '255.255.255.240', hosts: '14', use: 'Point-to-point', color: 'var(--color-primary)' },
|
||||
{ cidr: '/30', mask: '255.255.255.252', hosts: '2', use: 'Router links', color: 'var(--color-primary)' },
|
||||
{ cidr: '/31', mask: '255.255.255.254', hosts: '2*', use: 'P2P (RFC 3021)', color: 'var(--color-primary)' }
|
||||
],
|
||||
|
||||
howItWorks: [
|
||||
{
|
||||
type: 'success',
|
||||
title: 'Network vs Host Bits',
|
||||
content: 'A /24 network means the first 24 bits identify the network, leaving 8 bits for hosts. That gives you 2^8 = 256 total addresses, minus 2 for network and broadcast = 254 usable hosts.',
|
||||
example: {
|
||||
type: 'bit',
|
||||
networkBits: '11000000.10101000.00000001.',
|
||||
hostBits: '00000000',
|
||||
networkLabel: 'Network (24 bits)',
|
||||
hostLabel: 'Host (8 bits)'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
title: 'Route Summarization',
|
||||
content: 'Instead of advertising 4 separate /24 networks, you can summarize them into one /22. This reduces routing table size and improves network performance.',
|
||||
example: {
|
||||
type: 'summary',
|
||||
before: {
|
||||
title: 'Before: 4 routes',
|
||||
content: ['192.168.0.0/24, 192.168.1.0/24', '192.168.2.0/24, 192.168.3.0/24']
|
||||
},
|
||||
after: {
|
||||
title: 'After: 1 route',
|
||||
content: ['192.168.0.0/22', '(covers all 4 networks)']
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'warning',
|
||||
title: 'Subnet Planning',
|
||||
content: 'Always plan for growth and align to binary boundaries. A /25 gives you room to split into two /26s later, but a /27 doesn\'t divide evenly into /25s.',
|
||||
example: {
|
||||
type: 'tip',
|
||||
title: 'Pro tip:',
|
||||
content: 'Start with larger subnets and subdivide as needed. It\'s easier to split than to merge.'
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
quickReference: [
|
||||
{
|
||||
title: 'Binary to CIDR',
|
||||
items: [
|
||||
'Count consecutive 1s from the left',
|
||||
'11111111.11111111.11111111.00000000 = /24',
|
||||
'11111111.11111111.11111100.00000000 = /22'
|
||||
]
|
||||
},
|
||||
{
|
||||
title: 'Host Calculation',
|
||||
items: [
|
||||
'Host bits = 32 - CIDR prefix',
|
||||
'Total addresses = 2^(host bits)',
|
||||
'Usable hosts = Total - 2'
|
||||
]
|
||||
},
|
||||
{
|
||||
title: 'Common Patterns',
|
||||
items: [
|
||||
'/24 = 254 hosts (standard office)',
|
||||
'/30 = 2 hosts (point-to-point links)',
|
||||
'/16 = 65k hosts (large campus)'
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
// Legacy content for backward compatibility
|
||||
sections: {
|
||||
whatIs: {
|
||||
title: "What is CIDR?",
|
||||
@@ -14,7 +138,7 @@ For example, in 192.168.1.0/24, the "/24" means the first 24 bits identify the n
|
||||
title: "Why CIDR Replaced IP Classes",
|
||||
content: `The old class system (Class A, B, C) was too rigid and wasteful. It only allowed networks of fixed sizes:
|
||||
|
||||
- Class A: 16 million addresses (way too big for most needs)
|
||||
- Class A: 16 million addresses (way too big for most needs)
|
||||
- Class B: 65,536 addresses (often too big)
|
||||
- Class C: 256 addresses (often too small)
|
||||
|
||||
@@ -26,7 +150,7 @@ CIDR lets you create networks of any size by choosing exactly how many network b
|
||||
content: `The number after the slash is the "prefix length" - it counts the network bits from left to right:
|
||||
|
||||
- /8 = 8 network bits (24 host bits)
|
||||
- /16 = 16 network bits (16 host bits)
|
||||
- /16 = 16 network bits (16 host bits)
|
||||
- /24 = 24 network bits (8 host bits)
|
||||
- /30 = 30 network bits (2 host bits)`
|
||||
}
|
||||
@@ -39,13 +163,13 @@ CIDR lets you create networks of any size by choosing exactly how many network b
|
||||
hosts: "254 hosts"
|
||||
},
|
||||
{
|
||||
cidr: "10.0.0.0/8",
|
||||
cidr: "10.0.0.0/8",
|
||||
description: "Large private network - 16 million addresses",
|
||||
hosts: "16,777,214 hosts"
|
||||
},
|
||||
{
|
||||
cidr: "172.16.0.0/12",
|
||||
description: "Medium private network - 1 million addresses",
|
||||
description: "Medium private network - 1 million addresses",
|
||||
hosts: "1,048,574 hosts"
|
||||
},
|
||||
{
|
||||
@@ -73,4 +197,4 @@ CIDR lets you create networks of any size by choosing exactly how many network b
|
||||
"IPv6 commonly uses /64 for end-user networks",
|
||||
"CIDR allows efficient use of IP address space"
|
||||
]
|
||||
};
|
||||
};
|
||||
@@ -361,3 +361,64 @@ hr {
|
||||
color: var(--text-secondary);
|
||||
margin-left: var(--spacing-xs);
|
||||
}
|
||||
|
||||
// Checkbox styles
|
||||
.checkbox-label {
|
||||
display: flex;
|
||||
align-items: canter;
|
||||
gap: var(--spacing-sm);
|
||||
cursor: pointer;
|
||||
|
||||
input[type="checkbox"] {
|
||||
appearance: none;
|
||||
width: 0.75rem;
|
||||
height: 0.75rem;
|
||||
padding: 0.75rem;
|
||||
border: 2px solid var(--border-primary);
|
||||
border-radius: var(--radius-xs);
|
||||
background-color: var(--bg-primary);
|
||||
transition: all var(--transition-fast);
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
&:hover {
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
&:focus {
|
||||
outline: 2px solid color-mix(in srgb, var(--color-primary), transparent 70%);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
&:checked {
|
||||
background-color: var(--color-primary);
|
||||
border-color: var(--color-primary);
|
||||
|
||||
&::after {
|
||||
content: "✓";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
color: var(--bg-primary);
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
.checkbox-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-xs);
|
||||
|
||||
:global(.tooltip-trigger) {
|
||||
color: var(--text-secondary);
|
||||
opacity: 0.7;
|
||||
&:hover { opacity: 1; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,9 +75,9 @@
|
||||
/* Light theme */
|
||||
.theme-light, html[data-theme="light"] {
|
||||
/* Background colors */
|
||||
--bg-primary: #f9f9f9;
|
||||
--bg-primary: #f4f2fa;
|
||||
--bg-secondary: #fff; /* cards */
|
||||
--bg-tertiary: #eef2f6; /* subtle panels / code blocks */
|
||||
--bg-tertiary: #f6f2fc; /* subtle panels / code blocks */
|
||||
|
||||
/* Text colors (AA on light backgrounds) */
|
||||
--text-primary: #0b1220; /* ~19:1 on white */
|
||||
@@ -85,9 +85,9 @@
|
||||
--text-tertiary: #6b7280; /* ~12:1 on white */
|
||||
|
||||
/* Primary brand (use *-dark for filled buttons) */
|
||||
--color-primary: #267bff;
|
||||
--color-primary-hover: #1164e4;
|
||||
--color-primary-dark: #0f336b;
|
||||
--color-primary: #af55fc;
|
||||
--color-primary-hover: #c581ff;
|
||||
--color-primary-dark: #872bd5;
|
||||
|
||||
/* Action colors (chosen so white label text is AA) */
|
||||
--color-success: #15803d; /* white text ≥ 13:1 */
|
||||
|
||||
Reference in new issue
Block a user