Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

admin: calm console restyle with light and dark themes (#12568)

Chris Lub924ffabf1c0
diff --git a/weed/admin/dash/dashboard_metrics.go b/weed/admin/dash/dashboard_metrics.go
index 19032a3029..bd59b72b9c 100644
--- a/weed/admin/dash/dashboard_metrics.go
+++ b/weed/admin/dash/dashboard_metrics.go
@@ -105,16 +105,16 @@ func (s *AdminServer) GetDashboardTrends() DashboardTrends {
tasks := series(func(s dashSample) float64 { return s.tasks })
workers := series(func(s dashSample) float64 { return s.workers })
- // Sparkline colors match the existing cards' border colors.
+ // Sparkline colors follow the data palette.
return DashboardTrends{
Samples: len(samples),
- Volumes: sparklineSVG(series(func(s dashSample) float64 { return s.volumes }), "#1cc88a"), // success
- Chunks: sparklineSVG(series(func(s dashSample) float64 { return s.chunks }), "#36b9cc"), // info
- DiskUsed: sparklineSVG(series(func(s dashSample) float64 { return s.diskUsed }), "#f6c23e"), // warning
- EcShards: sparklineSVG(series(func(s dashSample) float64 { return s.ecShards }), "#5a5c69"), // dark
- Tasks: sparklineSVG(tasks, "#36b9cc"),
+ Volumes: sparklineSVG(series(func(s dashSample) float64 { return s.volumes }), "#5552e0"),
+ Chunks: sparklineSVG(series(func(s dashSample) float64 { return s.chunks }), "#00897a"),
+ DiskUsed: sparklineSVG(series(func(s dashSample) float64 { return s.diskUsed }), "#c2541a"),
+ EcShards: sparklineSVG(series(func(s dashSample) float64 { return s.ecShards }), "#9a45c2"),
+ Tasks: sparklineSVG(tasks, "#8f6d10"),
TasksValue: trendCount(last(tasks)),
- Workers: sparklineSVG(workers, "#4e73df"),
+ Workers: sparklineSVG(workers, "#5552e0"),
WorkersValue: trendCount(last(workers)),
}
}
diff --git a/weed/admin/static/css/admin.css b/weed/admin/static/css/admin.css
index 35a0071220..9a3a16f7f3 100644
--- a/weed/admin/static/css/admin.css
+++ b/weed/admin/static/css/admin.css
@@ -1,7 +1,187 @@
-/* SeaweedFS Dashboard Custom Styles */
+/* SeaweedFS Admin styles: a calm console on Bootstrap 5.3.
+ Chrome is greys with ink actions; color carries meaning (status, data, the current page). */
-:root {
+:root,
+[data-bs-theme=light] {
--navbar-height: 56px;
+ --sidebar-width: 240px;
+
+ --k-canvas: #f5f5f7;
+ --k-sheet: #ffffff;
+ --k-sidebar: #ffffff;
+ --k-raised: #f2f2f5;
+ --k-popover: #ffffff;
+ --k-label: #1d1d1f;
+ --k-secondary: #6e6e73;
+ --k-tertiary: rgba(60, 60, 67, .36);
+ --k-separator: rgba(0, 0, 0, .08);
+ --k-fill: rgba(120, 120, 128, .12);
+ --k-ink: #1d1d1f;
+ --k-on-ink: #ffffff;
+ --k-indigo: #5552e0;
+ --k-indigo-rgb: 85, 82, 224;
+ --k-nav-current: rgba(85, 82, 224, .09);
+ --k-nav-current-icon: #5552e0;
+ --k-good-rgb: 36, 138, 61;
+ --k-warning-rgb: 201, 52, 0;
+ --k-critical-rgb: 215, 0, 21;
+ --k-info-rgb: 85, 82, 224;
+ --k-neutral-rgb: 110, 110, 115;
+ --k-spectrum: linear-gradient(90deg, #6366f1, #a855f7, #ec4899, #f97316, #eab308);
+ --k-sheet-shadow: 0 1px 2px rgba(0, 0, 0, .04);
+ --k-popover-shadow: 0 12px 40px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .08);
+ --k-sidebar-shadow: 1px 0 0 var(--k-separator), 4px 0 16px rgba(0, 0, 0, .03);
+
+ --bs-body-font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
+ --bs-body-font-size: .875rem;
+ --bs-body-bg: var(--k-sheet);
+ --bs-body-bg-rgb: 255, 255, 255;
+ --bs-body-color: var(--k-label);
+ --bs-body-color-rgb: 29, 29, 31;
+ --bs-emphasis-color: var(--k-label);
+ --bs-emphasis-color-rgb: 29, 29, 31;
+ --bs-secondary-color: var(--k-secondary);
+ --bs-secondary-color-rgb: 110, 110, 115;
+ --bs-tertiary-color: var(--k-tertiary);
+ --bs-secondary-bg: var(--k-raised);
+ --bs-tertiary-bg: var(--k-raised);
+ --bs-tertiary-bg-rgb: 242, 242, 245;
+ --bs-border-color: var(--k-separator);
+ --bs-border-color-translucent: var(--k-separator);
+ --bs-border-radius: .5rem;
+ --bs-border-radius-sm: .4375rem;
+ --bs-border-radius-lg: .75rem;
+ --bs-link-color: var(--k-ink);
+ --bs-link-color-rgb: 29, 29, 31;
+ --bs-link-hover-color: var(--k-ink);
+ --bs-link-hover-color-rgb: 29, 29, 31;
+ --bs-focus-ring-color: rgba(29, 29, 31, .55);
+ --bs-heading-color: var(--k-label);
+
+ --bs-primary-rgb: var(--k-indigo-rgb);
+ --bs-success-rgb: var(--k-good-rgb);
+ --bs-warning-rgb: var(--k-warning-rgb);
+ --bs-danger-rgb: var(--k-critical-rgb);
+ --bs-info-rgb: var(--k-info-rgb);
+ --bs-secondary-rgb: var(--k-neutral-rgb);
+ --bs-dark-rgb: 29, 29, 31;
+ --bs-light-rgb: 242, 242, 245;
+
+ --bs-primary-text-emphasis: rgb(var(--k-info-rgb));
+ --bs-success-text-emphasis: rgb(var(--k-good-rgb));
+ --bs-warning-text-emphasis: rgb(var(--k-warning-rgb));
+ --bs-danger-text-emphasis: rgb(var(--k-critical-rgb));
+ --bs-info-text-emphasis: rgb(var(--k-info-rgb));
+ --bs-secondary-text-emphasis: var(--k-secondary);
+ --bs-primary-bg-subtle: rgba(var(--k-info-rgb), .08);
+ --bs-success-bg-subtle: rgba(var(--k-good-rgb), .08);
+ --bs-warning-bg-subtle: rgba(var(--k-warning-rgb), .08);
+ --bs-danger-bg-subtle: rgba(var(--k-critical-rgb), .08);
+ --bs-info-bg-subtle: rgba(var(--k-info-rgb), .08);
+ --bs-secondary-bg-subtle: var(--k-raised);
+ --bs-light-bg-subtle: var(--k-raised);
+ --bs-primary-border-subtle: rgba(var(--k-info-rgb), .2);
+ --bs-success-border-subtle: rgba(var(--k-good-rgb), .2);
+ --bs-warning-border-subtle: rgba(var(--k-warning-rgb), .2);
+ --bs-danger-border-subtle: rgba(var(--k-critical-rgb), .2);
+ --bs-info-border-subtle: rgba(var(--k-info-rgb), .2);
+ --bs-secondary-border-subtle: var(--k-separator);
+}
+
+[data-bs-theme=dark] {
+ color-scheme: dark;
+
+ --k-canvas: #0e0e10;
+ --k-sheet: #1c1c1e;
+ --k-sidebar: #161618;
+ --k-raised: #2c2c2e;
+ --k-popover: #2c2c2e;
+ --k-label: #f5f5f7;
+ --k-secondary: #98989f;
+ --k-tertiary: rgba(235, 235, 245, .32);
+ --k-separator: rgba(255, 255, 255, .08);
+ --k-fill: rgba(120, 120, 128, .24);
+ --k-ink: #f5f5f7;
+ --k-on-ink: #1d1d1f;
+ --k-indigo: #8f8cff;
+ --k-indigo-rgb: 143, 140, 255;
+ --k-nav-current: rgba(143, 140, 255, .13);
+ --k-nav-current-icon: #8f8cff;
+ --k-good-rgb: 48, 209, 88;
+ --k-warning-rgb: 255, 159, 10;
+ --k-critical-rgb: 255, 69, 58;
+ --k-info-rgb: 109, 106, 242;
+ --k-neutral-rgb: 152, 152, 159;
+ --k-sheet-shadow: none;
+ --k-popover-shadow: 0 12px 40px rgba(0, 0, 0, .55), 0 0 0 .5px rgba(255, 255, 255, .1);
+ --k-sidebar-shadow: 1px 0 0 var(--k-separator), 4px 0 16px rgba(0, 0, 0, .25);
+
+ --bs-body-bg-rgb: 28, 28, 30;
+ --bs-body-color-rgb: 245, 245, 247;
+ --bs-emphasis-color-rgb: 245, 245, 247;
+ --bs-secondary-color-rgb: 152, 152, 159;
+ --bs-tertiary-bg-rgb: 44, 44, 46;
+ --bs-link-color-rgb: 245, 245, 247;
+ --bs-link-hover-color-rgb: 245, 245, 247;
+ --bs-focus-ring-color: rgba(245, 245, 247, .55);
+ --bs-dark-rgb: 245, 245, 247;
+ --bs-light-rgb: 44, 44, 46;
+}
+
+/* Base */
+body {
+ background-color: var(--k-canvas);
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+a {
+ text-underline-offset: .15em;
+}
+
+a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):hover {
+ text-decoration: underline;
+}
+
+h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
+ letter-spacing: -.01em;
+}
+
+.text-muted {
+ color: var(--k-secondary) !important;
+}
+
+.text-dark,
+.text-gray-800 {
+ color: var(--k-label) !important;
+}
+
+.text-gray-300 {
+ color: var(--k-tertiary) !important;
+}
+
+.text-xs {
+ font-size: .75rem;
+}
+
+.font-weight-bold {
+ font-weight: 600 !important;
+}
+
+.bg-light {
+ background-color: var(--k-raised) !important;
+}
+
+code {
+ color: var(--k-label);
+ background-color: var(--k-fill);
+ border-radius: .3rem;
+ padding: .05rem .3rem;
+}
+
+pre code {
+ background: none;
+ padding: 0;
}
/* Icon sizing and animation helpers used by the admin templates. */
@@ -32,72 +212,271 @@
}
}
-/* Link colors - muted */
-a {
- color: #5b7c99;
+/* Toolbar */
+.admin-toolbar {
+ --bs-navbar-color: var(--k-secondary);
+ --bs-navbar-hover-color: var(--k-label);
+ --bs-navbar-active-color: var(--k-label);
+ --bs-navbar-brand-color: var(--k-label);
+ --bs-navbar-brand-hover-color: var(--k-label);
+ min-height: var(--navbar-height);
+ background-color: var(--k-canvas);
+ border-bottom: 1px solid var(--k-separator);
+ z-index: 1030;
+}
+
+.admin-toolbar .navbar-brand {
+ display: flex;
+ align-items: center;
+ gap: .625rem;
+ font-size: .9375rem;
+ font-weight: 600;
+}
+
+.brand-mark {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 1.75rem;
+ height: 1.75rem;
+ border-radius: .5rem;
+ background: var(--k-ink);
+ color: var(--k-on-ink);
+ font-size: .875rem;
+}
+
+.admin-toolbar .navbar-toggler {
+ border: 0;
+ color: var(--k-secondary);
+}
+
+.admin-toolbar .navbar-toggler:not(:focus-visible) {
+ box-shadow: none;
+}
+
+.admin-toolbar .navbar-toggler-icon {
+ --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28110, 110, 115, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
+}
+
+.admin-toolbar .nav-link {
+ display: flex;
+ align-items: center;
+ border-radius: .5rem;
+ padding: .375rem .625rem !important;
+ font-weight: 500;
+}
+
+.admin-toolbar .nav-link:hover {
+ background-color: var(--k-fill);
}
-a:hover {
- color: #4a6a88;
+.theme-toggle {
+ background: none;
+ border: 0;
+ width: 2rem;
+ height: 2rem;
+ border-radius: .5rem;
+ color: var(--k-secondary);
}
-/* Sidebar Styles */
+.theme-toggle:hover {
+ background-color: var(--k-fill);
+ color: var(--k-label);
+}
+
+.theme-toggle .theme-icon {
+ display: none;
+}
+
+[data-theme-choice=auto] .theme-toggle .theme-icon-auto,
+[data-theme-choice=light] .theme-toggle .theme-icon-light,
+[data-theme-choice=dark] .theme-toggle .theme-icon-dark {
+ display: inline;
+}
+
+/* Sidebar */
.sidebar {
position: fixed;
top: var(--navbar-height);
bottom: 0;
left: 0;
z-index: 100;
- padding: 48px 0 0;
- box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
+ width: var(--sidebar-width);
+ padding: .25rem 0 1.5rem;
+ background-color: var(--k-sidebar) !important;
+ box-shadow: var(--k-sidebar-shadow);
overflow-y: auto;
+ scrollbar-width: thin;
+ scrollbar-color: var(--k-fill) transparent;
+}
+
+.sidebar .position-sticky {
+ padding-top: 0 !important;
}
.sidebar-heading {
- font-size: .75rem;
+ margin: 1.125rem 0 .25rem !important;
+ padding: 0 1.25rem !important;
+ font-size: .6875rem;
+ font-weight: 600;
+ letter-spacing: .04em;
text-transform: uppercase;
+ color: var(--k-secondary) !important;
}
.sidebar .nav-link {
+ display: flex;
+ align-items: center;
+ margin: 1px .625rem;
+ padding: .375rem .625rem;
+ border-radius: .5rem;
+ font-size: .8125rem;
font-weight: 500;
- color: #333;
+ color: var(--k-label);
+ transition: background-color .12s ease;
+}
+
+.sidebar .nav-link > i:first-child {
+ font-size: 1rem;
+ width: 1.25rem;
+ color: var(--k-secondary);
}
.sidebar .nav-link:hover {
- color: #5b7c99;
+ background-color: var(--k-fill);
+ color: var(--k-label);
+}
+
+.sidebar .nav-link:hover > i:first-child {
+ color: var(--k-label);
}
.sidebar .nav-link.active {
- color: #5b7c99;
+ background-color: var(--k-nav-current);
+ color: var(--k-label);
+}
+
+.sidebar .nav-link.active > i:first-child {
+ color: var(--k-nav-current-icon);
+}
+
+.sidebar .nav-link .bi-chevron-down {
+ font-size: .6875rem;
+ color: var(--k-tertiary);
+ transition: transform .2s ease;
+}
+
+.sidebar .nav-link[aria-expanded="true"] .bi-chevron-down {
+ transform: rotate(180deg);
}
-.sidebar .nav-link:hover .feather,
-.sidebar .nav-link.active .feather {
- color: inherit;
+.sidebar .nav .nav {
+ margin: 0 0 .25rem 0 !important;
+ border: 0;
}
-/* Main content area */
+.sidebar .nav .nav .nav-link {
+ padding-top: .3125rem !important;
+ padding-bottom: .3125rem !important;
+ padding-left: 2.5rem;
+ font-weight: 400;
+}
+
+.sidebar .nav .nav .nav-link > i:first-child {
+ font-size: .875rem;
+}
+
+/* Layout */
main {
- margin-left: 240px;
+ margin-left: var(--sidebar-width);
+}
+
+@media (min-width: 768px) {
+ .admin-toolbar {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ padding-left: var(--sidebar-width);
+ background-color: rgba(245, 245, 247, .9);
+ }
+
+ [data-bs-theme=dark] .admin-toolbar {
+ background-color: rgba(14, 14, 16, .9);
+ }
+
+ .admin-toolbar .navbar-brand {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: var(--sidebar-width);
+ height: var(--navbar-height);
+ margin: 0;
+ padding: 0 1.25rem;
+ background-color: var(--k-sidebar);
+ box-shadow: var(--k-sidebar-shadow);
+ z-index: 101;
+ }
+
+ .sidebar {
+ z-index: 1031;
+ }
+
+ .row > main[class*="col-"] {
+ flex: 0 0 auto;
+ width: calc(100% - var(--sidebar-width));
+ margin-left: var(--sidebar-width) !important;
+ padding-top: var(--navbar-height);
+ }
+
+ .footer {
+ margin-left: var(--sidebar-width);
+ }
}
@media (max-width: 767.98px) {
.sidebar {
- top: var(--navbar-height);
- padding-top: 0;
- width: 240px;
- background-color: #f8f9fa !important;
z-index: 1050;
}
+
.sidebar.show ~ .sidebar-backdrop {
display: block;
}
+
main {
margin-left: 0;
}
}
-/* Sidebar backdrop for mobile overlay */
+main > .pt-3 {
+ padding-top: 1.5rem !important;
+ padding-bottom: 2rem;
+ max-width: 1600px;
+}
+
+/* Page header: title on the left, actions on the right */
+main .border-bottom:has(h1) {
+ border-bottom: 0 !important;
+ padding-top: 0 !important;
+ margin-bottom: 1.25rem !important;
+}
+
+main h1.h2,
+main h1.h3,
+main h2.h3,
+main h2:has(> .bi:first-child) {
+ font-size: 1.5rem;
+ font-weight: 650;
+ letter-spacing: -.02em;
+ margin-bottom: 0;
+}
+
+main h1 > i:first-child,
+main h2:has(> .bi:first-child) > .bi:first-child {
+ font-size: .8em;
+ color: var(--k-secondary);
+}
+
.sidebar-backdrop {
display: none;
position: fixed;
@@ -105,262 +484,541 @@ main {
left: 0;
right: 0;
bottom: 0;
- background-color: rgba(0, 0, 0, 0.5);
+ background-color: rgba(0, 0, 0, .3);
z-index: 1040;
}
-/* Custom card styles */
-.border-left-primary {
- border-left: 0.25rem solid #6b8caf !important;
+.footer {
+ background: transparent !important;
+ font-size: .75rem;
}
-.border-left-success {
- border-left: 0.25rem solid #5a8a72 !important;
+.footer a {
+ color: var(--k-secondary);
}
-.border-left-info {
- border-left: 0.25rem solid #6a9aaa !important;
+/* Sheets */
+.card {
+ --bs-card-bg: var(--k-sheet);
+ --bs-card-border-color: var(--k-separator);
+ --bs-card-border-radius: .75rem;
+ --bs-card-inner-border-radius: calc(.75rem - 1px);
+ --bs-card-cap-bg: transparent;
+ --bs-card-cap-padding-y: .75rem;
+ --bs-card-cap-padding-x: 1.25rem;
+ box-shadow: var(--k-sheet-shadow) !important;
}
-.border-left-warning {
- border-left: 0.25rem solid #b8995e !important;
+.shadow,
+.shadow-sm {
+ box-shadow: var(--k-sheet-shadow) !important;
}
-.border-left-danger {
- border-left: 0.25rem solid #a5615c !important;
+.card-header {
+ border-bottom: 1px solid var(--k-separator);
}
-/* Status badges */
-.badge {
- font-size: 0.875em;
+.card-header h5,
+.card-header h6,
+.card-header .h5,
+.card-header .h6 {
+ font-size: .9375rem;
+ font-weight: 600 !important;
+ color: var(--k-label) !important;
}
-/* Muted badge colors - override Bootstrap defaults */
-.badge.bg-primary,
-.bg-primary {
- background-color: #6b8caf !important;
+.card-header .text-primary {
+ color: var(--k-label) !important;
}
-.badge.bg-success,
-.bg-success {
- background-color: #5a8a72 !important;
+.card-header .bi {
+ color: var(--k-secondary);
}
-.badge.bg-info,
-.bg-info {
- background-color: #6a9aaa !important;
+/* Stat tiles: a quiet label over a large value */
+.card[class*="border-left-"],
+.card.border-primary,
+.card.border-secondary,
+.card.border-success,
+.card.border-info,
+.card.border-warning,
+.card.border-danger,
+.card.text-bg-primary,
+.card.text-bg-success,
+.card.text-bg-info,
+.card.text-bg-warning,
+.card.text-bg-danger {
+ border: 1px solid var(--k-separator) !important;
+ background-color: var(--k-sheet) !important;
+ color: var(--k-label) !important;
+ padding-top: 0 !important;
+ padding-bottom: 0 !important;
}
-.badge.bg-warning,
-.bg-warning {
- background-color: #b8995e !important;
+.card[class*="border-left-"] .text-uppercase,
+.card[class*="border-"] > .card-body > .text-uppercase,
+.card[class*="text-bg-"] .card-title {
+ font-size: .8125rem;
+ font-weight: 500 !important;
+ text-transform: none !important;
+ letter-spacing: 0;
+ color: var(--k-secondary) !important;
}
-.badge.bg-danger,
-.bg-danger {
- background-color: #a5615c !important;
+.card[class*="border-left-"] .h5,
+.card[class*="border-"] > .card-body > h4,
+.card[class*="text-bg-"] h4,
+.card[class*="text-bg-"] h3 {
+ font-family: ui-rounded, "SF Pro Rounded", var(--bs-body-font-family);
+ font-size: 1.375rem;
+ overflow-wrap: anywhere;
+ font-weight: 600 !important;
+ letter-spacing: -.02em;
+ font-variant-numeric: tabular-nums;
+ color: var(--k-label) !important;
}
-.badge.bg-secondary,
-.bg-secondary {
- background-color: #7a7d85 !important;
+.card[class*="border-left-"] .icon-2x,
+.card[class*="text-bg-"] .icon-2x {
+ font-size: 1.25rem;
+ color: var(--k-tertiary) !important;
}
-/* Muted card background colors for text-bg-* utility classes */
-.text-bg-primary,
-.card.text-bg-primary {
- background-color: #6b8caf !important;
- color: #fff !important;
+.card[class*="text-bg-"] .text-white,
+.card[class*="text-bg-"] small {
+ color: var(--k-secondary) !important;
}
-.text-bg-success,
-.card.text-bg-success {
- background-color: #5a8a72 !important;
- color: #fff !important;
+.health-dot {
+ font-size: .5rem;
+ vertical-align: middle;
}
-.text-bg-info,
-.card.text-bg-info {
- background-color: #6a9aaa !important;
- color: #fff !important;
+.cluster-count {
+ padding: .5rem .25rem;
+ border-radius: 8px;
+ color: var(--k-label);
+ text-decoration: none;
}
-.text-bg-warning,
-.card.text-bg-warning {
- background-color: #b8995e !important;
- color: #fff !important;
+.cluster-count .h5 {
+ font-variant-numeric: tabular-nums;
+ font-weight: 600;
}
-.text-bg-danger,
-.card.text-bg-danger {
- background-color: #a5615c !important;
- color: #fff !important;
+a.cluster-count:hover {
+ background-color: var(--k-raised);
+ color: var(--k-label);
}
-/* Muted text color utilities */
-.text-primary {
- color: #6b8caf !important;
+/* Tables: dense rows, hairlines, tabular numbers */
+.table {
+ --bs-table-bg: transparent;
+ --bs-table-color: var(--k-label);
+ --bs-table-border-color: var(--k-separator);
+ --bs-table-striped-bg: rgba(120, 120, 128, .04);
+ --bs-table-hover-bg: var(--k-raised);
+ --bs-table-hover-color: var(--k-label);
+ font-size: .8125rem;
+ font-variant-numeric: tabular-nums;
+ margin-bottom: 0;
}
-.text-success {
- color: #5a8a72 !important;
+.table > :not(caption) > * > * {
+ padding: .625rem .75rem;
+ vertical-align: middle;
}
-.text-info {
- color: #6a9aaa !important;
+.table thead th,
+.table > thead > tr > th {
+ font-size: .75rem;
+ font-weight: 500;
+ color: var(--k-secondary);
+ background-color: transparent;
+ border-bottom: 1px solid var(--k-separator);
+ white-space: nowrap;
+}
+
+.table-light,
+.table-dark {
+ --bs-table-bg: transparent;
+ --bs-table-color: var(--k-secondary);
+ --bs-table-border-color: var(--k-separator);
+}
+
+.table-bordered > :not(caption) > * > * {
+ border-width: 0 0 1px;
+}
+
+.table-bordered > :not(caption) > * {
+ border-width: 0;
+}
+
+.table > tbody > tr:last-child > * {
+ border-bottom: 0;
+}
+
+/* Buttons: ink for the primary action, quiet outlines for the rest */
+.btn {
+ --bs-btn-font-weight: 500;
+ --bs-btn-border-radius: .5rem;
+ --bs-btn-focus-box-shadow: 0 0 0 2px var(--bs-focus-ring-color);
+}
+
+.btn-sm,
+.btn-group-sm > .btn {
+ --bs-btn-border-radius: .4375rem;
+ --bs-btn-padding-y: .2rem;
+ --bs-btn-padding-x: .55rem;
+ --bs-btn-font-size: .8125rem;
+}
+
+.btn-primary,
+.btn-dark {
+ --bs-btn-color: var(--k-on-ink);
+ --bs-btn-bg: var(--k-ink);
+ --bs-btn-border-color: var(--k-ink);
+ --bs-btn-hover-color: var(--k-on-ink);
+ --bs-btn-hover-bg: color-mix(in srgb, var(--k-ink) 85%, var(--k-canvas));
+ --bs-btn-hover-border-color: color-mix(in srgb, var(--k-ink) 85%, var(--k-canvas));
+ --bs-btn-active-color: var(--k-on-ink);
+ --bs-btn-active-bg: color-mix(in srgb, var(--k-ink) 75%, var(--k-canvas));
+ --bs-btn-active-border-color: color-mix(in srgb, var(--k-ink) 75%, var(--k-canvas));
+ --bs-btn-disabled-color: var(--k-on-ink);
+ --bs-btn-disabled-bg: var(--k-ink);
+ --bs-btn-disabled-border-color: var(--k-ink);
+}
+
+.btn-outline-primary,
+.btn-outline-secondary,
+.btn-outline-dark,
+.btn-outline-info,
+.btn-secondary,
+.btn-light {
+ --bs-btn-color: var(--k-label);
+ --bs-btn-bg: var(--k-sheet);
+ --bs-btn-border-color: var(--k-separator);
+ --bs-btn-hover-color: var(--k-label);
+ --bs-btn-hover-bg: var(--k-raised);
+ --bs-btn-hover-border-color: var(--k-separator);
+ --bs-btn-active-color: var(--k-label);
+ --bs-btn-active-bg: var(--k-fill);
+ --bs-btn-active-border-color: var(--k-separator);
+ --bs-btn-disabled-color: var(--k-tertiary);
+ --bs-btn-disabled-bg: var(--k-sheet);
+ --bs-btn-disabled-border-color: var(--k-separator);
+ box-shadow: 0 1px 1px rgba(0, 0, 0, .03);
+}
+
+.btn-check:checked + .btn-outline-primary,
+.btn-check:checked + .btn-outline-secondary,
+.btn-outline-primary.active,
+.btn-outline-secondary.active {
+ background-color: var(--k-ink);
+ border-color: var(--k-ink);
+ color: var(--k-on-ink);
+}
+
+.btn-danger {
+ --bs-btn-color: var(--k-on-ink);
+ --bs-btn-hover-color: var(--k-on-ink);
+ --bs-btn-active-color: var(--k-on-ink);
+ --bs-btn-bg: rgb(var(--k-critical-rgb));
+ --bs-btn-border-color: rgb(var(--k-critical-rgb));
+ --bs-btn-hover-bg: color-mix(in srgb, rgb(var(--k-critical-rgb)) 88%, var(--k-ink));
+ --bs-btn-hover-border-color: color-mix(in srgb, rgb(var(--k-critical-rgb)) 88%, var(--k-ink));
+ --bs-btn-active-bg: color-mix(in srgb, rgb(var(--k-critical-rgb)) 80%, var(--k-ink));
+ --bs-btn-active-border-color: color-mix(in srgb, rgb(var(--k-critical-rgb)) 80%, var(--k-ink));
+}
+
+.btn-outline-danger {
+ --bs-btn-color: rgb(var(--k-critical-rgb));
+ --bs-btn-bg: var(--k-sheet);
+ --bs-btn-border-color: var(--k-separator);
+ --bs-btn-hover-color: var(--k-on-ink);
+ --bs-btn-hover-bg: rgb(var(--k-critical-rgb));
+ --bs-btn-hover-border-color: rgb(var(--k-critical-rgb));
+ --bs-btn-active-color: var(--k-on-ink);
+ --bs-btn-active-bg: rgb(var(--k-critical-rgb));
+ --bs-btn-active-border-color: rgb(var(--k-critical-rgb));
+}
+
+.btn-success {
+ --bs-btn-color: var(--k-on-ink);
+ --bs-btn-hover-color: var(--k-on-ink);
+ --bs-btn-active-color: var(--k-on-ink);
+ --bs-btn-bg: rgb(var(--k-good-rgb));
+ --bs-btn-border-color: rgb(var(--k-good-rgb));
+ --bs-btn-hover-bg: color-mix(in srgb, rgb(var(--k-good-rgb)) 88%, var(--k-ink));
+ --bs-btn-hover-border-color: color-mix(in srgb, rgb(var(--k-good-rgb)) 88%, var(--k-ink));
+}
+
+.btn-outline-success,
+.btn-outline-warning {
+ --bs-btn-bg: var(--k-sheet);
+ --bs-btn-border-color: var(--k-separator);
+}
+
+.btn-close {
+ --bs-btn-close-focus-shadow: 0 0 0 2px var(--bs-focus-ring-color);
+}
+
+[data-bs-theme=dark] .btn-close {
+ filter: invert(1) grayscale(100%) brightness(200%);
+}
+
+/* Status pills: a 12% tint with full-strength text */
+.badge {
+ font-size: .75rem;
+ font-weight: 500;
+ padding: .25em .6em;
+ border-radius: 999px;
+ font-variant-numeric: tabular-nums;
+}
+
+.badge.bg-primary,
+.badge.bg-info,
+.badge.text-bg-primary,
+.badge.text-bg-info {
+ background-color: rgba(var(--k-info-rgb), .12) !important;
+ color: rgb(var(--k-info-rgb)) !important;
+}
+
+.badge.bg-success,
+.badge.text-bg-success {
+ background-color: rgba(var(--k-good-rgb), .12) !important;
+ color: rgb(var(--k-good-rgb)) !important;
+}
+
+.badge.bg-warning,
+.badge.text-bg-warning {
+ background-color: rgba(var(--k-warning-rgb), .12) !important;
+ color: rgb(var(--k-warning-rgb)) !important;
}
-.text-warning {
- color: #b8995e !important;
+.badge.bg-danger,
+.badge.text-bg-danger {
+ background-color: rgba(var(--k-critical-rgb), .12) !important;
+ color: rgb(var(--k-critical-rgb)) !important;
}
-.text-danger {
- color: #a5615c !important;
+.badge.bg-secondary,
+.badge.bg-light,
+.badge.bg-dark,
+.badge.text-bg-secondary,
+.badge.text-bg-light,
+.badge.text-bg-dark {
+ background-color: var(--k-fill) !important;
+ color: var(--k-label) !important;
}
-/* Progress bars */
+/* Meters: the spectrum below the warning threshold, status colors above it */
.progress {
- background-color: #f8f9fc;
- border: 1px solid #e3e6f0;
+ --bs-progress-bg: var(--k-fill);
+ --bs-progress-border-radius: 999px;
+ --bs-progress-bar-bg: rgb(var(--k-info-rgb));
+ border: 0;
}
.progress-bar {
- font-size: 0.75rem;
- font-weight: 700;
- color: #fff;
- text-align: center;
+ font-size: .6875rem;
+ font-weight: 600;
}
-/* Tables */
-.table {
- color: #5a5c69;
+.progress-bar:not([class*="bg-"]),
+.progress-bar.bg-primary,
+.progress-bar.bg-info {
+ background: var(--k-spectrum) !important;
}
-.table thead th {
- vertical-align: bottom;
- border-bottom: 1px solid #e3e6f0;
- font-weight: 700;
- color: #5a5c69;
- background-color: #f8f9fc;
+/* Forms */
+.form-control,
+.form-select {
+ background-color: var(--k-sheet);
+ border-color: var(--k-separator);
+ border-radius: .5rem;
}
-.table-bordered {
- border: 1px solid #e3e6f0;
+.form-control:focus,
+.form-select:focus,
+.form-check-input:focus {
+ border-color: var(--k-separator);
+ box-shadow: 0 0 0 2px var(--bs-focus-ring-color);
}
-.table-bordered th,
-.table-bordered td {
- border: 1px solid #e3e6f0;
+.form-control::placeholder {
+ color: var(--k-tertiary);
}
-/* Cards */
-.card {
- box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15) !important;
- border: 1px solid #e3e6f0;
+.form-label {
+ font-size: .8125rem;
+ font-weight: 500;
}
-.card-header {
- background-color: #f8f9fc;
- border-bottom: 1px solid #e3e6f0;
+.form-check-input:checked {
+ background-color: var(--k-ink);
+ border-color: var(--k-ink);
}
-/* Buttons */
-.btn-primary {
- background-color: #6b8caf;
- border-color: #6b8caf;
+[data-bs-theme=dark] .form-check-input:checked[type=checkbox] {
+ --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%231d1d1f' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}
-.btn-primary:hover {
- background-color: #5b7c99;
- border-color: #5b7c99;
+[data-bs-theme=dark] .form-check-input:checked[type=radio] {
+ --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%231d1d1f'/%3e%3c/svg%3e");
}
-/* Text utilities */
-.text-gray-800 {
- color: #5a5c69 !important;
+[data-bs-theme=dark] .form-switch .form-check-input:checked {
+ --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%231d1d1f'/%3e%3c/svg%3e");
}
-.text-gray-300 {
- color: #dddfeb !important;
+.input-group-text {
+ background-color: var(--k-raised);
+ border-color: var(--k-separator);
+ color: var(--k-secondary);
}
-/* Animation for HTMX updates */
-.htmx-indicator {
- opacity: 0;
- transition: opacity 500ms ease-in;
+/* Overlays */
+.dropdown-menu {
+ --bs-dropdown-bg: var(--k-popover);
+ --bs-dropdown-border-color: transparent;
+ --bs-dropdown-border-radius: .625rem;
+ --bs-dropdown-link-hover-bg: var(--k-fill);
+ --bs-dropdown-link-active-bg: var(--k-ink);
+ --bs-dropdown-link-active-color: var(--k-on-ink);
+ --bs-dropdown-font-size: .8125rem;
+ padding: .3125rem;
+ box-shadow: var(--k-popover-shadow);
}
-.htmx-request .htmx-indicator {
- opacity: 1;
+.dropdown-item {
+ border-radius: .375rem;
}
-.htmx-request.htmx-indicator {
- opacity: 1;
+.modal-content {
+ --bs-modal-bg: var(--k-popover);
+ --bs-modal-border-color: transparent;
+ --bs-modal-border-radius: .875rem;
+ --bs-modal-header-border-color: var(--k-separator);
+ --bs-modal-footer-border-color: var(--k-separator);
+ box-shadow: var(--k-popover-shadow);
}
-/* Loading spinner */
-.spinner-border-sm {
- width: 1rem;
- height: 1rem;
+.modal-backdrop {
+ --bs-backdrop-bg: #000;
+ --bs-backdrop-opacity: .3;
}
-/* Custom utilities */
-.bg-gradient-primary {
- background: linear-gradient(180deg, #6b8caf 10%, #5b7c99 100%);
+[data-bs-theme=dark] .modal-backdrop {
+ --bs-backdrop-opacity: .5;
}
-.shadow {
- box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15) !important;
+.toast {
+ --bs-toast-bg: var(--k-popover);
+ --bs-toast-border-color: transparent;
+ box-shadow: var(--k-popover-shadow);
}
-/* Navbar user icon color */
-.navbar-toggler .bi-person {
- color: rgba(255, 255, 255, 0.75);
+.alert {
+ --bs-alert-border-radius: .625rem;
+ font-size: .8125rem;
}
-/* Collapsible menu styles */
-.nav-link[data-bs-toggle="collapse"] {
- position: relative;
+.list-group {
+ --bs-list-group-bg: var(--k-sheet);
+ --bs-list-group-border-color: var(--k-separator);
+ --bs-list-group-action-hover-bg: var(--k-raised);
+ --bs-list-group-active-bg: var(--k-ink);
+ --bs-list-group-active-border-color: var(--k-ink);
+ --bs-list-group-active-color: var(--k-on-ink);
}
-.nav-link[data-bs-toggle="collapse"] .bi-chevron-down {
- transition: transform 0.2s ease;
+.nav-tabs {
+ --bs-nav-tabs-border-color: var(--k-separator);
+ --bs-nav-tabs-link-active-bg: transparent;
+ --bs-nav-tabs-link-active-border-color: transparent transparent var(--k-ink);
+ --bs-nav-tabs-link-hover-border-color: transparent;
}
-.nav-link[data-bs-toggle="collapse"][aria-expanded="true"] .bi-chevron-down {
- transform: rotate(180deg);
+.nav-tabs .nav-link {
+ border-width: 0 0 2px;
+ color: var(--k-secondary);
+ font-weight: 500;
}
-.nav-link[data-bs-toggle="collapse"]:not(.collapsed) {
- color: #5b7c99;
+.nav-tabs .nav-link.active {
+ color: var(--k-label);
}
-.nav-link[data-bs-toggle="collapse"]:not(.collapsed) .bi-chevron-down {
- color: #5b7c99;
+.nav-pills {
+ --bs-nav-pills-link-active-bg: var(--k-ink);
+ --bs-nav-pills-link-active-color: var(--k-on-ink);
}
-/* Submenu styles */
-.nav .nav {
- border-left: 1px solid #e3e6f0;
- margin-left: 0.5rem;
+.pagination {
+ --bs-pagination-color: var(--k-label);
+ --bs-pagination-bg: var(--k-sheet);
+ --bs-pagination-border-color: var(--k-separator);
+ --bs-pagination-hover-color: var(--k-label);
+ --bs-pagination-hover-bg: var(--k-raised);
+ --bs-pagination-hover-border-color: var(--k-separator);
+ --bs-pagination-focus-box-shadow: 0 0 0 2px var(--bs-focus-ring-color);
+ --bs-pagination-active-bg: var(--k-ink);
+ --bs-pagination-active-border-color: var(--k-ink);
+ --bs-pagination-active-color: var(--k-on-ink);
+ --bs-pagination-disabled-bg: var(--k-sheet);
+ --bs-pagination-disabled-border-color: var(--k-separator);
+ --bs-pagination-font-size: .8125rem;
}
-.nav .nav .nav-link {
- font-size: 0.875rem;
- padding-left: 1rem;
+/* Animation for HTMX updates */
+.htmx-indicator {
+ opacity: 0;
+ transition: opacity 500ms ease-in;
}
-.nav .nav .nav-link:hover {
- background-color: #f8f9fc;
+.htmx-request .htmx-indicator {
+ opacity: 1;
+}
+
+.htmx-request.htmx-indicator {
+ opacity: 1;
+}
+
+.spinner-border-sm {
+ width: 1rem;
+ height: 1rem;
+}
+
+/* Sign-in: the one place for atmosphere */
+.login-page {
+ min-height: 100vh;
+ background:
+ radial-gradient(60rem 30rem at 15% -10%, rgba(99, 102, 241, .14), transparent 60%),
+ radial-gradient(50rem 30rem at 110% 110%, rgba(236, 72, 153, .10), transparent 60%),
+ var(--k-canvas);
+}
+
+.login-page .card {
+ border-radius: 1rem;
+ box-shadow: var(--k-popover-shadow) !important;
+}
+
+.login-page .brand-mark {
+ width: 3rem;
+ height: 3rem;
+ border-radius: .875rem;
+ font-size: 1.375rem;
+}
+
+.login-page .login-spectrum {
+ height: 3px;
+ border-radius: 999px;
+ background: var(--k-spectrum);
}
-/* Responsive adjustments */
@media (max-width: 576px) {
.card-body {
padding: 1rem;
}
-
- .h5 {
- font-size: 1rem;
- }
}
diff --git a/weed/admin/static/js/admin.js b/weed/admin/static/js/admin.js
index ebabb25a32..5ecb422e48 100644
--- a/weed/admin/static/js/admin.js
+++ b/weed/admin/static/js/admin.js
@@ -573,52 +573,6 @@ function refreshBuckets() {
location.reload();
}
-// Export bucket list
-function exportBucketList() {
- // Get table data
- const table = document.getElementById('bucketsTable');
- if (!table) return;
-
- const rows = Array.from(table.querySelectorAll('tbody tr'));
- const data = rows.map(row => {
- const cells = row.querySelectorAll('td');
- if (cells.length < 5) return null; // Skip empty state row
-
- return {
- name: cells[0].textContent.trim(),
- owner: cells[1].textContent.trim(),
- created: cells[2].textContent.trim(),
- logicalSize: cells[3].textContent.trim(),
- physicalSize: cells[4].textContent.trim(),
- quota: cells[5].textContent.trim()
- };
- }).filter(item => item !== null);
-
- // Convert to CSV
- const csv = [
- ['Name', 'Owner', 'Created', 'Logical Size', 'Physical Size', 'Quota'].join(','),
- ...data.map(row => [
- row.name,
- row.owner,
- row.created,
- row.logicalSize,
- row.physicalSize,
- row.quota
- ].join(','))
- ].join('\n');
-
- // Download CSV
- const blob = new Blob([csv], { type: 'text/csv' });
- const url = window.URL.createObjectURL(blob);
- const a = document.createElement('a');
- a.href = url;
- a.download = `seaweedfs-buckets-${new Date().toISOString().split('T')[0]}.csv`;
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
- window.URL.revokeObjectURL(url);
-}
-
// showAlert is provided by modal-alerts.js with signature: showAlert(message, type)
// Format date for display
@@ -871,19 +825,18 @@ function exportUsers() {
return;
}
- let csvContent = 'Username,Email,Access Key,Status,Created,Last Login\n';
+ let csvContent = 'Username,Email,Access Key\n';
rows.forEach(row => {
const cells = row.querySelectorAll('td');
- if (cells.length >= 6) {
- const username = cells[0].textContent.trim();
+ if (cells.length >= 3) {
+ const username = (cells[0].querySelector('strong') || cells[0]).textContent.trim();
const email = cells[1].textContent.trim();
const accessKey = cells[2].textContent.trim();
- const status = cells[3].textContent.trim();
- const created = cells[4].textContent.trim();
- const lastLogin = cells[5].textContent.trim();
- csvContent += `"${username}","${email}","${accessKey}","${status}","${created}","${lastLogin}"\n`;
+ csvContent += [username, email, accessKey]
+ .map(value => `"${value.replace(/"/g, '""')}"`)
+ .join(',') + '\n';
}
});
diff --git a/weed/admin/static/js/theme.js b/weed/admin/static/js/theme.js
new file mode 100644
index 0000000000..79b5ce21f7
--- /dev/null
+++ b/weed/admin/static/js/theme.js
@@ -0,0 +1,43 @@
+// Applies the saved color theme (auto, light or dark) before the page paints.
+(function () {
+ var storageKey = 'admin-theme';
+ var choices = ['auto', 'light', 'dark'];
+ var media = window.matchMedia ? window.matchMedia('(prefers-color-scheme: dark)') : null;
+ var root = document.documentElement;
+
+ function savedChoice() {
+ try {
+ var value = localStorage.getItem(storageKey);
+ return choices.indexOf(value) >= 0 ? value : 'auto';
+ } catch (e) {
+ return 'auto';
+ }
+ }
+
+ function apply(choice) {
+ var dark = choice === 'dark' || (choice === 'auto' && media && media.matches);
+ root.setAttribute('data-bs-theme', dark ? 'dark' : 'light');
+ root.setAttribute('data-theme-choice', choice);
+ }
+
+ var current = savedChoice();
+ apply(current);
+
+ if (media && media.addEventListener) {
+ media.addEventListener('change', function () {
+ apply(current);
+ });
+ }
+
+ document.addEventListener('click', function (event) {
+ var toggle = event.target.closest && event.target.closest('[data-theme-toggle]');
+ if (!toggle) {
+ return;
+ }
+ current = choices[(choices.indexOf(current) + 1) % choices.length];
+ try {
+ localStorage.setItem(storageKey, current);
+ } catch (e) {}
+ apply(current);
+ });
+})();
diff --git a/weed/admin/static_gz/css/admin.css.gz b/weed/admin/static_gz/css/admin.css.gz
index 6f9cf739fb..3fb31cb0fd 100644
Binary files a/weed/admin/static_gz/css/admin.css.gz and b/weed/admin/static_gz/css/admin.css.gz differ
diff --git a/weed/admin/static_gz/js/admin.js.gz b/weed/admin/static_gz/js/admin.js.gz
index 328f9f92f0..4e0b72368a 100644
Binary files a/weed/admin/static_gz/js/admin.js.gz and b/weed/admin/static_gz/js/admin.js.gz differ
diff --git a/weed/admin/static_gz/js/theme.js.gz b/weed/admin/static_gz/js/theme.js.gz
new file mode 100644
index 0000000000..4b18d0dc25
Binary files /dev/null and b/weed/admin/static_gz/js/theme.js.gz differ
diff --git a/weed/admin/view/app/admin.templ b/weed/admin/view/app/admin.templ
index d2c2a3db33..7062d69981 100644
--- a/weed/admin/view/app/admin.templ
+++ b/weed/admin/view/app/admin.templ
@@ -7,16 +7,18 @@ import (
templ Admin(data dash.AdminData) {
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
- <h1 class="h2">
- <i class="bi bi-speedometer2 me-2"></i>Dashboard
- </h1>
- <div class="btn-toolbar mb-2 mb-md-0">
- <div class="btn-group me-2">
- <a href={ dash.PUrl(ctx, "/object-store/buckets") } class="btn btn-sm btn-primary">
- <i class="bi bi-box me-1"></i>Object Store Buckets
- </a>
-
- </div>
+ <div>
+ <h1 class="h2">
+ <i class="bi bi-speedometer2 me-2"></i>Dashboard
+ </h1>
+ <p class="mb-0 text-muted">
+ if len(clusterHealthIssues(data)) == 0 {
+ <i class="bi bi-circle-fill text-success health-dot me-2"></i>
+ } else {
+ <i class="bi bi-circle-fill text-warning health-dot me-2"></i>
+ }
+ { clusterHealthSummary(data) }
+ </p>
</div>
</div>
@@ -40,18 +42,21 @@ templ Admin(data dash.AdminData) {
<!-- Summary Cards — each carries an inline sparkline of recent history
from the admin's own snapshots (no Prometheus required). -->
- <div class="row mb-4">
- <div class="col-xl-3 col-md-6 mb-4">
+ <div class="row mb-2">
+ <div class="col-xl-2 col-md-4 mb-4">
<div class="card border-left-success shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">
- Total Volumes
+ Volumes
</div>
- <div class="h5 mb-0 font-weight-bold text-body-emphasis">
+ <div class="h5 mb-0 font-weight-bold text-gray-800">
{fmt.Sprintf("%d", data.TotalVolumes)}
</div>
+ <div class="text-xs text-muted">
+ {fmt.Sprintf("%s limit", formatBytes(int64(data.VolumeSizeLimitMB)*1024*1024))}
+ </div>
</div>
<div class="col-auto">
<i class="bi bi-database icon-2x text-gray-300"></i>
@@ -62,34 +67,13 @@ templ Admin(data dash.AdminData) {
</div>
</div>
- <div class="col-xl-3 col-md-6 mb-4">
- <div class="card border-left-info shadow h-100 py-2">
- <div class="card-body">
- <div class="row no-gutters align-items-center">
- <div class="col mr-2">
- <div class="text-xs font-weight-bold text-info text-uppercase mb-1" title="Chunks stored in volumes. A file is split into one or more chunks, so this is not the number of files.">
- Total Chunks
- </div>
- <div class="h5 mb-0 font-weight-bold text-gray-800">
- {formatNumber(data.TotalChunks)}
- </div>
- </div>
- <div class="col-auto">
- <i class="bi bi-boxes icon-2x text-gray-300"></i>
- </div>
- </div>
- @templ.Raw(data.Trends.Chunks)
- </div>
- </div>
- </div>
-
- <div class="col-xl-3 col-md-6 mb-4">
+ <div class="col-xl-2 col-md-4 mb-4">
<div class="card border-left-warning shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-warning text-uppercase mb-1">
- Disk Usage
+ Disk usage
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">
{formatBytes(data.DiskUsage)}
@@ -109,60 +93,43 @@ templ Admin(data dash.AdminData) {
</div>
</div>
- <div class="col-xl-3 col-md-6 mb-4">
- <div class="card border-left-primary shadow h-100 py-2">
+ <div class="col-xl-2 col-md-4 mb-4">
+ <div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
- <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
- Volume Size Limit
+ <div class="text-xs font-weight-bold text-info text-uppercase mb-1" title="Chunks stored in volumes. A file is split into one or more chunks, so this is not the number of files.">
+ Chunks
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">
- {fmt.Sprintf("%d MB", data.VolumeSizeLimitMB)}
+ {formatNumber(data.TotalChunks)}
</div>
</div>
<div class="col-auto">
- <i class="bi bi-gear-wide-connected icon-2x text-gray-300"></i>
+ <i class="bi bi-boxes icon-2x text-gray-300"></i>
</div>
</div>
+ @templ.Raw(data.Trends.Chunks)
</div>
</div>
</div>
- </div>
- <!-- Second Row for EC Shards Information -->
- <div class="row mb-4">
- <div class="col-xl-3 col-md-6 mb-4">
+ <div class="col-xl-2 col-md-4 mb-4">
<div class="card border-left-secondary shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-secondary text-uppercase mb-1">
- EC Volumes
- </div>
- <div class="h5 mb-0 font-weight-bold text-gray-800">
- {fmt.Sprintf("%d", data.TotalEcVolumes)}
- </div>
- </div>
- <div class="col-auto">
- <i class="bi bi-layers icon-2x text-gray-300"></i>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <div class="col-xl-3 col-md-6 mb-4">
- <div class="card border-left-dark shadow h-100 py-2">
- <div class="card-body">
- <div class="row no-gutters align-items-center">
- <div class="col mr-2">
- <div class="text-xs font-weight-bold text-dark text-uppercase mb-1">
- EC Shards
+ EC shards
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">
{fmt.Sprintf("%d", data.TotalEcShards)}
</div>
+ if data.TotalEcVolumes > 0 {
+ <div class="text-xs text-muted">
+ {fmt.Sprintf("in %s", countNoun(data.TotalEcVolumes, "EC volume"))}
+ </div>
+ }
</div>
<div class="col-auto">
<i class="bi bi-puzzle icon-2x text-gray-300"></i>
@@ -173,13 +140,13 @@ templ Admin(data dash.AdminData) {
</div>
</div>
- <div class="col-xl-3 col-md-6 mb-4">
+ <div class="col-xl-2 col-md-4 mb-4">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
- Active Tasks
+ Active tasks
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">
{ data.Trends.TasksValue }
@@ -194,7 +161,7 @@ templ Admin(data dash.AdminData) {
</div>
</div>
- <div class="col-xl-3 col-md-6 mb-4">
+ <div class="col-xl-2 col-md-4 mb-4">
<div class="card border-left-primary shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
@@ -254,7 +221,7 @@ templ Admin(data dash.AdminData) {
<td>{fmt.Sprintf("%d", tier.VolumeCount)}</td>
<td>
if tier.IsRemote {
- <span class="text-muted">-</span>
+ <span class="text-muted">–</span>
} else {
{fmt.Sprintf("%d", tier.EcShardCount)}
}
@@ -262,21 +229,21 @@ templ Admin(data dash.AdminData) {
<td>{formatBytes(tier.DataSize)}</td>
<td>
if tier.IsRemote || tier.DiskUsed == 0 {
- <span class="text-muted">-</span>
+ <span class="text-muted">–</span>
} else {
{formatBytes(tier.DiskUsed)}
}
</td>
<td>
if tier.IsRemote {
- <span class="text-muted">-</span>
+ <span class="text-muted">–</span>
} else {
{formatBytes(tier.DiskCapacity)}
}
</td>
<td>
if tier.IsRemote {
- <span class="text-muted">-</span>
+ <span class="text-muted">–</span>
} else {
<div class="d-flex align-items-center">
<div class="progress flex-grow-1" style="height: 20px; min-width: 48px;">
@@ -299,31 +266,6 @@ templ Admin(data dash.AdminData) {
</div>
}
- <!-- Mount Clients -->
- <div class="row mb-4">
- <div class="col-12">
- <div class="card shadow mb-4">
- <div class="card-header py-3 d-flex justify-content-between align-items-center">
- <h6 class="m-0 font-weight-bold text-primary">
- <i class="bi bi-plug me-2"></i>Mount Clients
- </h6>
- <a href={ dash.PUrl(ctx, "/cluster/mount-clients") } class="btn btn-sm btn-outline-primary">
- View Details <i class="bi bi-arrow-right ms-1"></i>
- </a>
- </div>
- <div class="card-body">
- <div class="d-flex align-items-center">
- <i class="bi bi-plug icon-2x text-gray-300 me-3"></i>
- <div>
- <div class="h4 mb-0 font-weight-bold text-gray-800">{fmt.Sprintf("%d", data.TotalMountClients)}</div>
- <div class="text-xs text-muted text-uppercase">Connected FUSE/VFS mount clients</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
-
<!-- Master Nodes Status -->
<div class="row mb-4">
<div class="col-lg-4">
@@ -376,79 +318,44 @@ templ Admin(data dash.AdminData) {
</h6>
</div>
<div class="card-body text-center">
- <div class="row">
- <div class="col">
- <div class="card bg-light">
- <div class="card-body">
- <h5>{fmt.Sprintf("%d", len(data.MasterNodes))}</h5>
- <small class="text-muted">Masters</small>
- </div>
- </div>
- </div>
- <div class="col">
- <div class="card bg-light">
- <div class="card-body">
- <h5>{fmt.Sprintf("%d", len(data.VolumeServers))}</h5>
- <small class="text-muted">Volume Servers</small>
- </div>
- </div>
- </div>
- <div class="col">
- <div class="card bg-light">
- <div class="card-body">
- <h5>{fmt.Sprintf("%d", len(data.FilerNodes))}</h5>
- <small class="text-muted">Filers</small>
- </div>
- </div>
- </div>
- <div class="col">
- <div class="card bg-light">
- <div class="card-body">
- <h5>{fmt.Sprintf("%d", len(data.S3Nodes))}</h5>
- <small class="text-muted">S3 Servers</small>
- </div>
- </div>
- </div>
- <div class="col">
- <div class="card bg-light">
- <div class="card-body">
- <h5>{fmt.Sprintf("%d", len(data.MessageBrokers))}</h5>
- <small class="text-muted">Message Brokers</small>
- </div>
- </div>
- </div>
- <div class="col">
- <div class="card bg-light">
- <div class="card-body">
- if data.VersionSummary.Uniform {
- <h5 class="text-truncate" title={data.VersionSummary.Version}>{data.VersionSummary.Version}</h5>
- <small class="text-muted">Version</small>
- } else if data.VersionSummary.Mixed() {
- <h5 class="text-warning">
- <i class="bi bi-exclamation-triangle-fill"></i>
- </h5>
- <small class="text-muted">Mixed Versions</small>
- } else {
- <h5 class="text-truncate">—</h5>
- <small class="text-muted">Version</small>
- }
- </div>
- </div>
+ <div class="row g-0">
+ <a class="col cluster-count" href={ dash.PUrl(ctx, "/cluster/masters") }>
+ <div class="h5 mb-0">{fmt.Sprintf("%d", len(data.MasterNodes))}</div>
+ <small class="text-muted">Masters</small>
+ </a>
+ <a class="col cluster-count" href={ dash.PUrl(ctx, "/cluster/volume-servers") }>
+ <div class="h5 mb-0">{fmt.Sprintf("%d", len(data.VolumeServers))}</div>
+ <small class="text-muted">Volume servers</small>
+ </a>
+ <a class="col cluster-count" href={ dash.PUrl(ctx, "/cluster/filers") }>
+ <div class="h5 mb-0">{fmt.Sprintf("%d", len(data.FilerNodes))}</div>
+ <small class="text-muted">Filers</small>
+ </a>
+ <a class="col cluster-count" href={ dash.PUrl(ctx, "/cluster/s3") }>
+ <div class="h5 mb-0">{fmt.Sprintf("%d", len(data.S3Nodes))}</div>
+ <small class="text-muted">S3 servers</small>
+ </a>
+ <a class="col cluster-count" href={ dash.PUrl(ctx, "/cluster/mount-clients") }>
+ <div class="h5 mb-0">{fmt.Sprintf("%d", data.TotalMountClients)}</div>
+ <small class="text-muted">Mount clients</small>
+ </a>
+ <a class="col cluster-count" href={ dash.PUrl(ctx, "/mq/brokers") }>
+ <div class="h5 mb-0">{fmt.Sprintf("%d", len(data.MessageBrokers))}</div>
+ <small class="text-muted">Message brokers</small>
+ </a>
+ <div class="col cluster-count">
+ if data.VersionSummary.Uniform {
+ <div class="h5 mb-0 text-truncate" title={data.VersionSummary.Version}>{data.VersionSummary.Version}</div>
+ <small class="text-muted">Version</small>
+ } else if data.VersionSummary.Mixed() {
+ <div class="h5 mb-0 text-warning"><i class="bi bi-exclamation-triangle-fill"></i></div>
+ <small class="text-muted">Mixed versions</small>
+ } else {
+ <div class="h5 mb-0">–</div>
+ <small class="text-muted">Version</small>
+ }
</div>
</div>
- if data.VersionSummary.Mixed() {
- <div class="row mt-3">
- <div class="col-12 text-start">
- <small class="text-muted text-uppercase fw-bold">Node Versions</small>
- for _, nt := range data.VersionSummary.NodeTypes {
- <div class="d-flex justify-content-between border-bottom py-1">
- <span>{nt.Type}</span>
- <span>{nt.Spread()}</span>
- </div>
- }
- </div>
- </div>
- }
</div>
</div>
</div>
@@ -462,16 +369,9 @@ templ Admin(data dash.AdminData) {
<h6 class="m-0 font-weight-bold text-primary">
<i class="bi bi-database me-2"></i>Volume Servers
</h6>
- <div class="dropdown no-arrow">
- <a class="dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
- <i class="bi bi-three-dots-vertical icon-sm icon-fixed-width text-gray-400"></i>
- </a>
- <div class="dropdown-menu dropdown-menu-right shadow animated--fade-in">
- <div class="dropdown-header">Actions:</div>
- <a class="dropdown-item" href={ dash.PUrl(ctx, "/volumes") }>View Details</a>
- <a class="dropdown-item" href={ dash.PUrl(ctx, "/cluster") }>Topology View</a>
- </div>
- </div>
+ <a href={ dash.PUrl(ctx, "/cluster/volume-servers") } class="btn btn-sm btn-outline-primary">
+ View all <i class="bi bi-arrow-right ms-1"></i>
+ </a>
</div>
<div class="card-body">
<div class="table-responsive">
@@ -518,7 +418,7 @@ templ Admin(data dash.AdminData) {
<small class="text-muted">({fmt.Sprintf("%d vol", vs.EcVolumes)})</small>
}
} else {
- <span class="text-muted">-</span>
+ <span class="text-muted">–</span>
}
</td>
<td>
@@ -554,16 +454,9 @@ templ Admin(data dash.AdminData) {
<h6 class="m-0 font-weight-bold text-primary">
<i class="bi bi-folder me-2"></i>Filer Nodes
</h6>
- <div class="dropdown no-arrow">
- <a class="dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
- <i class="bi bi-three-dots-vertical icon-sm icon-fixed-width text-gray-400"></i>
- </a>
- <div class="dropdown-menu dropdown-menu-right shadow animated--fade-in">
- <div class="dropdown-header">Actions:</div>
- <a class="dropdown-item" href={ dash.PUrl(ctx, "/filer") }>File Browser</a>
- <a class="dropdown-item" href={ dash.PUrl(ctx, "/cluster") }>Topology View</a>
- </div>
- </div>
+ <a href={ dash.PUrl(ctx, "/cluster/filers") } class="btn btn-sm btn-outline-primary">
+ View all <i class="bi bi-arrow-right ms-1"></i>
+ </a>
</div>
<div class="card-body">
<div class="table-responsive">
@@ -616,15 +509,9 @@ templ Admin(data dash.AdminData) {
<h6 class="m-0 font-weight-bold text-primary">
<i class="bi bi-cloud me-2"></i>S3 Servers
</h6>
- <div class="dropdown no-arrow">
- <a class="dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
- <i class="bi bi-three-dots-vertical icon-sm icon-fixed-width text-gray-400"></i>
- </a>
- <div class="dropdown-menu dropdown-menu-right shadow animated--fade-in">
- <div class="dropdown-header">Actions:</div>
- <a class="dropdown-item" href={ dash.PUrl(ctx, "/cluster/s3") }>View Details</a>
- </div>
- </div>
+ <a href={ dash.PUrl(ctx, "/cluster/s3") } class="btn btn-sm btn-outline-primary">
+ View all <i class="bi bi-arrow-right ms-1"></i>
+ </a>
</div>
<div class="card-body">
<div class="table-responsive">
diff --git a/weed/admin/view/app/admin_render_test.go b/weed/admin/view/app/admin_render_test.go
index 76cf2be4b8..bd4318a4bb 100644
--- a/weed/admin/view/app/admin_render_test.go
+++ b/weed/admin/view/app/admin_render_test.go
@@ -23,7 +23,7 @@ func TestAdminDashboardShowsDiskUsage(t *testing.T) {
t.Fatalf("render: %v", err)
}
got := buf.String()
- for _, want := range []string{"Disk Usage", "348.0 TB", "of 1000.0 TB (34%)"} {
+ for _, want := range []string{"Disk usage", "348.0 TB", "of 1000.0 TB (34%)"} {
if !strings.Contains(got, want) {
t.Errorf("dashboard is missing %q", want)
}
@@ -39,3 +39,28 @@ func TestCalculatePercent64PetabyteScale(t *testing.T) {
t.Errorf("100 of 200 PiB = %d%%, want 50%%", got)
}
}
+
+func TestClusterHealthSummary(t *testing.T) {
+ healthy := dash.AdminData{
+ MasterNodes: []dash.MasterNode{{Address: "m1:9333", IsLeader: true}},
+ VolumeServers: []dash.VolumeServer{{ID: "v1"}, {ID: "v2"}},
+ FilerNodes: []dash.FilerNode{{Address: "f1:8888"}},
+ DiskUsage: 50,
+ DiskCapacity: 100,
+ }
+ if got, want := clusterHealthSummary(healthy), "Healthy. 2 volume servers and 1 filer reporting, 1 master configured."; got != want {
+ t.Errorf("healthy summary = %q, want %q", got, want)
+ }
+
+ degraded := healthy
+ degraded.MasterNodes = []dash.MasterNode{{Address: "m1:9333"}}
+ degraded.DiskUsage = 95
+ want := "Needs attention: no master leader, disks 95% full. 2 volume servers and 1 filer reporting, 1 master configured."
+ if got := clusterHealthSummary(degraded); got != want {
+ t.Errorf("degraded summary = %q, want %q", got, want)
+ }
+
+ if got := clusterHealthIssues(dash.AdminData{}); strings.Join(got, ", ") != "no master reachable, no volume servers" {
+ t.Errorf("empty cluster issues = %q", got)
+ }
+}
diff --git a/weed/admin/view/app/admin_templ.go b/weed/admin/view/app/admin_templ.go
index d343502f89..c1bd3297fc 100644
--- a/weed/admin/view/app/admin_templ.go
+++ b/weed/admin/view/app/admin_templ.go
@@ -31,157 +31,160 @@ func Admin(data dash.AdminData) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom\"><h1 class=\"h2\"><i class=\"bi bi-speedometer2 me-2\"></i>Dashboard</h1><div class=\"btn-toolbar mb-2 mb-md-0\"><div class=\"btn-group me-2\"><a href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom\"><div><h1 class=\"h2\"><i class=\"bi bi-speedometer2 me-2\"></i>Dashboard</h1><p class=\"mb-0 text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+ if len(clusterHealthIssues(data)) == 0 {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "<i class=\"bi bi-circle-fill text-success health-dot me-2\"></i> ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ } else {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<i class=\"bi bi-circle-fill text-warning health-dot me-2\"></i> ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
var templ_7745c5c3_Var2 string
- templ_7745c5c3_Var2, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/object-store/buckets")).ResolveURL(ctx)
+ templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(clusterHealthSummary(data))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 15, Col: 70}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 20, Col: 44}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var2)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\" class=\"btn btn-sm btn-primary\"><i class=\"bi bi-box me-1\"></i>Object Store Buckets</a></div></div></div><div id=\"dashboard-content\"><!-- Version mismatch warning: nodes reporting different binary versions\n usually means an upgrade did not reach every server. -->")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</p></div></div><div id=\"dashboard-content\"><!-- Version mismatch warning: nodes reporting different binary versions\n usually means an upgrade did not reach every server. -->")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if data.VersionSummary.Mixed() {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<div class=\"alert alert-warning d-flex align-items-start\" role=\"alert\"><i class=\"bi bi-exclamation-triangle-fill me-2 mt-1\"></i><div><strong>Mixed cluster versions detected.</strong> Not all servers are running the same SeaweedFS version — some servers may not have been upgraded.<ul class=\"mb-0 mt-1\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<div class=\"alert alert-warning d-flex align-items-start\" role=\"alert\"><i class=\"bi bi-exclamation-triangle-fill me-2 mt-1\"></i><div><strong>Mixed cluster versions detected.</strong> Not all servers are running the same SeaweedFS version — some servers may not have been upgraded.<ul class=\"mb-0 mt-1\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, nt := range data.VersionSummary.NodeTypes {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "<li>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "<li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(nt.Type)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 34, Col: 40}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 36, Col: 40}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, ": ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, ": ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(nt.Spread())
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 34, Col: 55}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 36, Col: 55}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</li>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</ul></div></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</ul></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<!-- Summary Cards — each carries an inline sparkline of recent history\n from the admin's own snapshots (no Prometheus required). --><div class=\"row mb-4\"><div class=\"col-xl-3 col-md-6 mb-4\"><div class=\"card border-left-success shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-success text-uppercase mb-1\">Total Volumes</div><div class=\"h5 mb-0 font-weight-bold text-body-emphasis\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<!-- Summary Cards — each carries an inline sparkline of recent history\n from the admin's own snapshots (no Prometheus required). --><div class=\"row mb-2\"><div class=\"col-xl-2 col-md-4 mb-4\"><div class=\"card border-left-success shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-success text-uppercase mb-1\">Volumes</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", data.TotalVolumes))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 53, Col: 73}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 55, Col: 73}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</div></div><div class=\"col-auto\"><i class=\"bi bi-database icon-2x text-gray-300\"></i></div></div>")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templ.Raw(data.Trends.Volumes).Render(ctx, templ_7745c5c3_Buffer)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</div></div></div><div class=\"col-xl-3 col-md-6 mb-4\"><div class=\"card border-left-info shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-info text-uppercase mb-1\" title=\"Chunks stored in volumes. A file is split into one or more chunks, so this is not the number of files.\">Total Chunks</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</div><div class=\"text-xs text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
- templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(formatNumber(data.TotalChunks))
+ templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%s limit", formatBytes(int64(data.VolumeSizeLimitMB)*1024*1024)))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 74, Col: 67}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 58, Col: 114}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</div></div><div class=\"col-auto\"><i class=\"bi bi-boxes icon-2x text-gray-300\"></i></div></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "</div></div><div class=\"col-auto\"><i class=\"bi bi-database icon-2x text-gray-300\"></i></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templ.Raw(data.Trends.Chunks).Render(ctx, templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = templ.Raw(data.Trends.Volumes).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "</div></div></div><div class=\"col-xl-3 col-md-6 mb-4\"><div class=\"card border-left-warning shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-warning text-uppercase mb-1\">Disk Usage</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "</div></div></div><div class=\"col-xl-2 col-md-4 mb-4\"><div class=\"card border-left-warning shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-warning text-uppercase mb-1\">Disk usage</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(data.DiskUsage))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 95, Col: 64}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 79, Col: 64}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "</div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if data.DiskCapacity > 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<div class=\"text-xs text-muted\">of ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "<div class=\"text-xs text-muted\">of ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(data.DiskCapacity))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 99, Col: 74}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 83, Col: 74}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, " (")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, " (")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d%%", calculatePercent64(data.DiskUsage, data.DiskCapacity)))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 99, Col: 152}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 83, Col: 152}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, ")</div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, ")</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</div><div class=\"col-auto\"><i class=\"bi bi-device-hdd icon-2x text-gray-300\"></i></div></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</div><div class=\"col-auto\"><i class=\"bi bi-device-hdd icon-2x text-gray-300\"></i></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -189,46 +192,64 @@ func Admin(data dash.AdminData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</div></div></div><div class=\"col-xl-3 col-md-6 mb-4\"><div class=\"card border-left-primary shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-primary text-uppercase mb-1\">Volume Size Limit</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</div></div></div><div class=\"col-xl-2 col-md-4 mb-4\"><div class=\"card border-left-info shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-info text-uppercase mb-1\" title=\"Chunks stored in volumes. A file is split into one or more chunks, so this is not the number of files.\">Chunks</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
- templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d MB", data.VolumeSizeLimitMB))
+ templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(formatNumber(data.TotalChunks))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 121, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 105, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</div></div><div class=\"col-auto\"><i class=\"bi bi-gear-wide-connected icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Second Row for EC Shards Information --><div class=\"row mb-4\"><div class=\"col-xl-3 col-md-6 mb-4\"><div class=\"card border-left-secondary shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-secondary text-uppercase mb-1\">EC Volumes</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "</div></div><div class=\"col-auto\"><i class=\"bi bi-boxes icon-2x text-gray-300\"></i></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var11 string
- templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", data.TotalEcVolumes))
+ templ_7745c5c3_Err = templ.Raw(data.Trends.Chunks).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 144, Col: 75}
+ return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</div></div></div><div class=\"col-xl-2 col-md-4 mb-4\"><div class=\"card border-left-secondary shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-secondary text-uppercase mb-1\">EC shards</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "</div></div><div class=\"col-auto\"><i class=\"bi bi-layers icon-2x text-gray-300\"></i></div></div></div></div></div><div class=\"col-xl-3 col-md-6 mb-4\"><div class=\"card border-left-dark shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-dark text-uppercase mb-1\">EC Shards</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
+ var templ_7745c5c3_Var11 string
+ templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", data.TotalEcShards))
if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 126, Col: 74}
}
- var templ_7745c5c3_Var12 string
- templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", data.TotalEcShards))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 164, Col: 74}
+ return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</div></div><div class=\"col-auto\"><i class=\"bi bi-puzzle icon-2x text-gray-300\"></i></div></div>")
+ if data.TotalEcVolumes > 0 {
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<div class=\"text-xs text-muted\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var12 string
+ templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("in %s", countNoun(data.TotalEcVolumes, "EC volume")))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 130, Col: 106}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</div>")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "</div><div class=\"col-auto\"><i class=\"bi bi-puzzle icon-2x text-gray-300\"></i></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -236,20 +257,20 @@ func Admin(data dash.AdminData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</div></div></div><div class=\"col-xl-3 col-md-6 mb-4\"><div class=\"card border-left-info shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-info text-uppercase mb-1\">Active Tasks</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "</div></div></div><div class=\"col-xl-2 col-md-4 mb-4\"><div class=\"card border-left-info shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-info text-uppercase mb-1\">Active tasks</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(data.Trends.TasksValue)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 185, Col: 60}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 152, Col: 60}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "</div></div><div class=\"col-auto\"><i class=\"bi bi-list-check icon-2x text-gray-300\"></i></div></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</div></div><div class=\"col-auto\"><i class=\"bi bi-list-check icon-2x text-gray-300\"></i></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -257,20 +278,20 @@ func Admin(data dash.AdminData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</div></div></div><div class=\"col-xl-3 col-md-6 mb-4\"><div class=\"card border-left-primary shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-primary text-uppercase mb-1\">Workers</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "</div></div></div><div class=\"col-xl-2 col-md-4 mb-4\"><div class=\"card border-left-primary shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-primary text-uppercase mb-1\">Workers</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(data.Trends.WorkersValue)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 206, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 173, Col: 62}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "</div></div><div class=\"col-auto\"><i class=\"bi bi-people-fill icon-2x text-gray-300\"></i></div></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "</div></div><div class=\"col-auto\"><i class=\"bi bi-people-fill icon-2x text-gray-300\"></i></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -278,72 +299,72 @@ func Admin(data dash.AdminData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "</div></div></div></div><!-- Storage Tiers -->")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "</div></div></div></div><!-- Storage Tiers -->")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if len(data.TierStats) > 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "<div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-layers me-2\"></i>Storage Tiers</h6></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\"><thead><tr><th>Tier</th><th>Volumes</th><th>EC Shards</th><th>Data Size</th><th>Disk Used</th><th>Capacity</th><th>Usage</th></tr></thead> <tbody>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "<div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-layers me-2\"></i>Storage Tiers</h6></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\"><thead><tr><th>Tier</th><th>Volumes</th><th>EC Shards</th><th>Data Size</th><th>Disk Used</th><th>Capacity</th><th>Usage</th></tr></thead> <tbody>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, tier := range data.TierStats {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "<tr><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "<tr><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if tier.IsRemote {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<i class=\"bi bi-cloud me-1 text-info\"></i>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "<i class=\"bi bi-cloud me-1 text-info\"></i>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(tier.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 248, Col: 108}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 215, Col: 108}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, " <span class=\"badge bg-info text-white ms-1\">remote</span>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, " <span class=\"badge bg-info text-white ms-1\">remote</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "<i class=\"bi bi-device-hdd me-1 text-muted\"></i>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "<i class=\"bi bi-device-hdd me-1 text-muted\"></i>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(tier.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 251, Col: 114}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 218, Col: 114}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", tier.VolumeCount))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 254, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 221, Col: 88}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if tier.IsRemote {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "<span class=\"text-muted\">-</span>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "<span class=\"text-muted\">–</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -351,32 +372,32 @@ func Admin(data dash.AdminData) templ.Component {
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", tier.EcShardCount))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 259, Col: 93}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 226, Col: 93}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(tier.DataSize))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 262, Col: 79}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 229, Col: 79}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if tier.IsRemote || tier.DiskUsed == 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "<span class=\"text-muted\">-</span>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "<span class=\"text-muted\">–</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -384,19 +405,19 @@ func Admin(data dash.AdminData) templ.Component {
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(tier.DiskUsed))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 267, Col: 83}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 234, Col: 83}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if tier.IsRemote {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "<span class=\"text-muted\">-</span>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "<span class=\"text-muted\">–</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -404,794 +425,787 @@ func Admin(data dash.AdminData) templ.Component {
var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(tier.DiskCapacity))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 274, Col: 87}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 241, Col: 87}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if tier.IsRemote {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "<span class=\"text-muted\">-</span>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<span class=\"text-muted\">–</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "<div class=\"d-flex align-items-center\"><div class=\"progress flex-grow-1\" style=\"height: 20px; min-width: 48px;\"><div class=\"progress-bar\" role=\"progressbar\" style=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "<div class=\"d-flex align-items-center\"><div class=\"progress flex-grow-1\" style=\"height: 20px; min-width: 48px;\"><div class=\"progress-bar\" role=\"progressbar\" style=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var22 string
templ_7745c5c3_Var22, templ_7745c5c3_Err = templruntime.SanitizeStyleAttributeValues(fmt.Sprintf("width: %d%%", tier.UsagePercent()))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 284, Col: 123}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 251, Col: 123}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "\"></div></div><span class=\"ms-2 text-nowrap\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "\"></div></div><span class=\"ms-2 text-nowrap\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d%%", tier.UsagePercent()))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 287, Col: 132}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 254, Col: 132}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "</span></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "</span></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "</td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "</tbody></table></div></div></div></div></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "</tbody></table></div></div></div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "<!-- Mount Clients --><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3 d-flex justify-content-between align-items-center\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-plug me-2\"></i>Mount Clients</h6><a href=\"")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var24 string
- templ_7745c5c3_Var24, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/cluster/mount-clients")).ResolveURL(ctx)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 310, Col: 74}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "\" class=\"btn btn-sm btn-outline-primary\">View Details <i class=\"bi bi-arrow-right ms-1\"></i></a></div><div class=\"card-body\"><div class=\"d-flex align-items-center\"><i class=\"bi bi-plug icon-2x text-gray-300 me-3\"></i><div><div class=\"h4 mb-0 font-weight-bold text-gray-800\">")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var25 string
- templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", data.TotalMountClients))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 318, Col: 126}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "</div><div class=\"text-xs text-muted text-uppercase\">Connected FUSE/VFS mount clients</div></div></div></div></div></div></div><!-- Master Nodes Status --><div class=\"row mb-4\"><div class=\"col-lg-4\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-server me-2\"></i>Master Nodes</h6></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-bordered\" width=\"100%\" cellspacing=\"0\"><thead><tr><th>Address</th><th>Role</th></tr></thead> <tbody>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "<!-- Master Nodes Status --><div class=\"row mb-4\"><div class=\"col-lg-4\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-server me-2\"></i>Master Nodes</h6></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-bordered\" width=\"100%\" cellspacing=\"0\"><thead><tr><th>Address</th><th>Role</th></tr></thead> <tbody>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, master := range data.MasterNodes {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "<tr><td><a href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "<tr><td><a href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var26 string
- templ_7745c5c3_Var26, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(fmt.Sprintf("//%s/ui/index.html", master.Address))).ResolveURL(ctx)
+ var templ_7745c5c3_Var24 string
+ templ_7745c5c3_Var24, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(fmt.Sprintf("//%s/ui/index.html", master.Address))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 349, Col: 121}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 291, Col: 121}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var26)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "\" target=\"_blank\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "\" target=\"_blank\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var27 string
- templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(master.Address)
+ var templ_7745c5c3_Var25 string
+ templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(master.Address)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 350, Col: 67}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 292, Col: 67}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, " <i class=\"bi bi-box-arrow-up-right ms-1 text-muted\"></i></a></td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, " <i class=\"bi bi-box-arrow-up-right ms-1 text-muted\"></i></a></td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if master.IsLeader {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "<span class=\"badge bg-primary\">Leader</span>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "<span class=\"badge bg-primary\">Leader</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "<span class=\"badge bg-secondary\">Follower</span>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "<span class=\"badge bg-secondary\">Follower</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "</td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "</tbody></table></div></div></div></div><!-- System Health --><div class=\"col-lg-8\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-pie-chart me-2\"></i>Cluster</h6></div><div class=\"card-body text-center\"><div class=\"row\"><div class=\"col\"><div class=\"card bg-light\"><div class=\"card-body\"><h5>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "</tbody></table></div></div></div></div><!-- System Health --><div class=\"col-lg-8\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-pie-chart me-2\"></i>Cluster</h6></div><div class=\"card-body text-center\"><div class=\"row g-0\"><a class=\"col cluster-count\" href=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var26 string
+ templ_7745c5c3_Var26, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/cluster/masters")).ResolveURL(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 322, Col: 98}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var26)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "\"><div class=\"h5 mb-0\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var27 string
+ templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.MasterNodes)))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 323, Col: 94}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "</div><small class=\"text-muted\">Masters</small></a> <a class=\"col cluster-count\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var28 string
- templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.MasterNodes)))
+ templ_7745c5c3_Var28, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/cluster/volume-servers")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 383, Col: 85}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 326, Col: 105}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var28)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "</h5><small class=\"text-muted\">Masters</small></div></div></div><div class=\"col\"><div class=\"card bg-light\"><div class=\"card-body\"><h5>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "\"><div class=\"h5 mb-0\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var29 string
templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.VolumeServers)))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 391, Col: 87}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 327, Col: 96}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "</h5><small class=\"text-muted\">Volume Servers</small></div></div></div><div class=\"col\"><div class=\"card bg-light\"><div class=\"card-body\"><h5>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "</div><small class=\"text-muted\">Volume servers</small></a> <a class=\"col cluster-count\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var30 string
- templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.FilerNodes)))
+ templ_7745c5c3_Var30, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/cluster/filers")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 399, Col: 84}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 330, Col: 97}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var30)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "</h5><small class=\"text-muted\">Filers</small></div></div></div><div class=\"col\"><div class=\"card bg-light\"><div class=\"card-body\"><h5>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "\"><div class=\"h5 mb-0\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var31 string
- templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.S3Nodes)))
+ templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.FilerNodes)))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 407, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 331, Col: 93}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "</h5><small class=\"text-muted\">S3 Servers</small></div></div></div><div class=\"col\"><div class=\"card bg-light\"><div class=\"card-body\"><h5>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "</div><small class=\"text-muted\">Filers</small></a> <a class=\"col cluster-count\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var32 string
- templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.MessageBrokers)))
+ templ_7745c5c3_Var32, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/cluster/s3")).ResolveURL(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 334, Col: 93}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var32)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "\"><div class=\"h5 mb-0\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var33 string
+ templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.S3Nodes)))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 335, Col: 90}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "</div><small class=\"text-muted\">S3 servers</small></a> <a class=\"col cluster-count\" href=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var34 string
+ templ_7745c5c3_Var34, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/cluster/mount-clients")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 415, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 338, Col: 104}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var34)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "</h5><small class=\"text-muted\">Message Brokers</small></div></div></div><div class=\"col\"><div class=\"card bg-light\"><div class=\"card-body\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "\"><div class=\"h5 mb-0\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var35 string
+ templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", data.TotalMountClients))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 339, Col: 95}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "</div><small class=\"text-muted\">Mount clients</small></a> <a class=\"col cluster-count\" href=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var36 string
+ templ_7745c5c3_Var36, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/mq/brokers")).ResolveURL(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 342, Col: 93}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var36)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "\"><div class=\"h5 mb-0\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var37 string
+ templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.MessageBrokers)))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 343, Col: 97}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "</div><small class=\"text-muted\">Message brokers</small></a><div class=\"col cluster-count\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if data.VersionSummary.Uniform {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "<h5 class=\"text-truncate\" title=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "<div class=\"h5 mb-0 text-truncate\" title=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var33 string
- templ_7745c5c3_Var33, templ_7745c5c3_Err = templruntime.NewAttributeExpression(data.VersionSummary.Version).Resolve(ctx)
+ var templ_7745c5c3_Var38 string
+ templ_7745c5c3_Var38, templ_7745c5c3_Err = templruntime.NewAttributeExpression(data.VersionSummary.Version).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 424, Col: 104}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 348, Col: 105}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var33)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var38)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var34 string
- templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(data.VersionSummary.Version)
+ var templ_7745c5c3_Var39 string
+ templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(data.VersionSummary.Version)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 424, Col: 134}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 348, Col: 135}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "</h5><small class=\"text-muted\">Version</small>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "</div><small class=\"text-muted\">Version</small>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else if data.VersionSummary.Mixed() {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "<h5 class=\"text-warning\"><i class=\"bi bi-exclamation-triangle-fill\"></i></h5><small class=\"text-muted\">Mixed Versions</small>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, "<div class=\"h5 mb-0 text-warning\"><i class=\"bi bi-exclamation-triangle-fill\"></i></div><small class=\"text-muted\">Mixed versions</small>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "<h5 class=\"text-truncate\">—</h5><small class=\"text-muted\">Version</small>")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "</div></div></div></div>")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- if data.VersionSummary.Mixed() {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "<div class=\"row mt-3\"><div class=\"col-12 text-start\"><small class=\"text-muted text-uppercase fw-bold\">Node Versions</small> ")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- for _, nt := range data.VersionSummary.NodeTypes {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "<div class=\"d-flex justify-content-between border-bottom py-1\"><span>")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var35 string
- templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(nt.Type)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 445, Col: 58}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "</span> <span>")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var36 string
- templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(nt.Spread())
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 446, Col: 62}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "</span></div>")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "</div></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, "<div class=\"h5 mb-0\">–</div><small class=\"text-muted\">Version</small>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "</div></div></div></div><!-- Volume Servers --><div class=\"row\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3 d-flex flex-row align-items-center justify-content-between\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-database me-2\"></i>Volume Servers</h6><div class=\"dropdown no-arrow\"><a class=\"dropdown-toggle\" href=\"#\" role=\"button\" data-bs-toggle=\"dropdown\"><i class=\"bi bi-three-dots-vertical icon-sm icon-fixed-width text-gray-400\"></i></a><div class=\"dropdown-menu dropdown-menu-right shadow animated--fade-in\"><div class=\"dropdown-header\">Actions:</div><a class=\"dropdown-item\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, "</div></div></div></div></div></div><!-- Volume Servers --><div class=\"row\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3 d-flex flex-row align-items-center justify-content-between\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-database me-2\"></i>Volume Servers</h6><a href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var37 string
- templ_7745c5c3_Var37, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/volumes")).ResolveURL(ctx)
+ var templ_7745c5c3_Var40 string
+ templ_7745c5c3_Var40, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/cluster/volume-servers")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 471, Col: 90}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 372, Col: 75}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var37)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var40)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, "\">View Details</a> <a class=\"dropdown-item\" href=\"")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var38 string
- templ_7745c5c3_Var38, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/cluster")).ResolveURL(ctx)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 472, Col: 90}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var38)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, "\">Topology View</a></div></div></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\"><thead><tr><th>ID</th><th>Address</th><th>Data Center</th><th>Rack</th><th>Version</th><th>Volumes</th><th>EC Shards</th><th>Usage / Capacity</th></tr></thead> <tbody>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, "\" class=\"btn btn-sm btn-outline-primary\">View all <i class=\"bi bi-arrow-right ms-1\"></i></a></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\"><thead><tr><th>ID</th><th>Address</th><th>Data Center</th><th>Rack</th><th>Version</th><th>Volumes</th><th>EC Shards</th><th>Usage / Capacity</th></tr></thead> <tbody>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, vs := range data.VolumeServers {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, "<tr><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, "<tr><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var39 string
- templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(vs.ID)
+ var templ_7745c5c3_Var41 string
+ templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(vs.ID)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 494, Col: 54}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 394, Col: 54}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, "</td><td><a href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, "</td><td><a href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var40 string
- templ_7745c5c3_Var40, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(fmt.Sprintf("//%s/ui/index.html", vs.GetDisplayAddress()))).ResolveURL(ctx)
+ var templ_7745c5c3_Var42 string
+ templ_7745c5c3_Var42, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(fmt.Sprintf("//%s/ui/index.html", vs.GetDisplayAddress()))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 496, Col: 129}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 396, Col: 129}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var40)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var42)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, "\" target=\"_blank\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, "\" target=\"_blank\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var41 string
- templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(vs.GetDisplayAddress())
+ var templ_7745c5c3_Var43 string
+ templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(vs.GetDisplayAddress())
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 497, Col: 75}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 397, Col: 75}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, " <i class=\"bi bi-box-arrow-up-right ms-1 text-muted\"></i></a></td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, " <i class=\"bi bi-box-arrow-up-right ms-1 text-muted\"></i></a></td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var42 string
- templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs(vs.DataCenter)
+ var templ_7745c5c3_Var44 string
+ templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinStringErrs(vs.DataCenter)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 501, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 401, Col: 62}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var43 string
- templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(vs.Rack)
+ var templ_7745c5c3_Var45 string
+ templ_7745c5c3_Var45, templ_7745c5c3_Err = templ.JoinStringErrs(vs.Rack)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 502, Col: 56}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 402, Col: 56}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var45))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, "</td><td title=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, "</td><td title=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var44 string
- templ_7745c5c3_Var44, templ_7745c5c3_Err = templruntime.NewAttributeExpression(vs.Version).Resolve(ctx)
+ var templ_7745c5c3_Var46 string
+ templ_7745c5c3_Var46, templ_7745c5c3_Err = templruntime.NewAttributeExpression(vs.Version).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 503, Col: 65}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 403, Col: 65}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var44)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var46)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, "\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 84, "\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var45 string
- templ_7745c5c3_Var45, templ_7745c5c3_Err = templ.JoinStringErrs(dash.ShortVersion(vs.Version))
+ var templ_7745c5c3_Var47 string
+ templ_7745c5c3_Var47, templ_7745c5c3_Err = templ.JoinStringErrs(dash.ShortVersion(vs.Version))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 503, Col: 97}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 403, Col: 97}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var45))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var47))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, "</td><td><div class=\"d-flex align-items-center\"><div class=\"progress flex-grow-1\" style=\"height: 20px; min-width: 48px;\"><div class=\"progress-bar\" role=\"progressbar\" style=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 85, "</td><td><div class=\"d-flex align-items-center\"><div class=\"progress flex-grow-1\" style=\"height: 20px; min-width: 48px;\"><div class=\"progress-bar\" role=\"progressbar\" style=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var46 string
- templ_7745c5c3_Var46, templ_7745c5c3_Err = templruntime.SanitizeStyleAttributeValues(fmt.Sprintf("width: %d%%", calculatePercent(vs.Volumes, vs.MaxVolumes)))
+ var templ_7745c5c3_Var48 string
+ templ_7745c5c3_Var48, templ_7745c5c3_Err = templruntime.SanitizeStyleAttributeValues(fmt.Sprintf("width: %d%%", calculatePercent(vs.Volumes, vs.MaxVolumes)))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 508, Col: 139}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 408, Col: 139}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var46))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var48))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 84, "\"></div></div><span class=\"ms-2 text-nowrap\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 86, "\"></div></div><span class=\"ms-2 text-nowrap\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var47 string
- templ_7745c5c3_Var47, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d/%d", vs.Volumes, vs.MaxVolumes))
+ var templ_7745c5c3_Var49 string
+ templ_7745c5c3_Var49, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d/%d", vs.Volumes, vs.MaxVolumes))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 511, Col: 131}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 411, Col: 131}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var47))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var49))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 85, "</span></div></td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 87, "</span></div></td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if vs.EcShards > 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 86, "<span class=\"badge bg-info text-white me-1\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 88, "<span class=\"badge bg-info text-white me-1\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var48 string
- templ_7745c5c3_Var48, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", vs.EcShards))
+ var templ_7745c5c3_Var50 string
+ templ_7745c5c3_Var50, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", vs.EcShards))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 516, Col: 127}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 416, Col: 127}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var48))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var50))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 87, "</span> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, "</span> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if vs.EcVolumes > 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 88, "<small class=\"text-muted\">(")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 90, "<small class=\"text-muted\">(")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var49 string
- templ_7745c5c3_Var49, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d vol", vs.EcVolumes))
+ var templ_7745c5c3_Var51 string
+ templ_7745c5c3_Var51, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d vol", vs.EcVolumes))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 518, Col: 119}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 418, Col: 119}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var49))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var51))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, ")</small>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 91, ")</small>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 90, "<span class=\"text-muted\">-</span>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 92, "<span class=\"text-muted\">–</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 91, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 93, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var50 string
- templ_7745c5c3_Var50, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(vs.DiskUsage))
+ var templ_7745c5c3_Var52 string
+ templ_7745c5c3_Var52, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(vs.DiskUsage))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 525, Col: 74}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 425, Col: 74}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var50))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var52))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 92, " / ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 94, " / ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var51 string
- templ_7745c5c3_Var51, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(vs.DiskCapacity))
+ var templ_7745c5c3_Var53 string
+ templ_7745c5c3_Var53, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(vs.DiskCapacity))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 525, Col: 107}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 425, Col: 107}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var51))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var53))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 93, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 95, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if vs.RemoteSize > 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 94, "<br><small class=\"text-muted\"><i class=\"bi bi-cloud me-1\"></i>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 96, "<br><small class=\"text-muted\"><i class=\"bi bi-cloud me-1\"></i>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var52 string
- templ_7745c5c3_Var52, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(vs.RemoteSize))
+ var templ_7745c5c3_Var54 string
+ templ_7745c5c3_Var54, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(vs.RemoteSize))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 528, Col: 137}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 428, Col: 137}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var52))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var54))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 95, " remote</small>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 97, " remote</small>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 96, "</td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 98, "</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if len(data.VolumeServers) == 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 97, "<tr><td colspan=\"8\" class=\"text-center text-muted py-4\"><i class=\"bi bi-info-circle me-2\"></i> No volume servers found</td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 99, "<tr><td colspan=\"8\" class=\"text-center text-muted py-4\"><i class=\"bi bi-info-circle me-2\"></i> No volume servers found</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 98, "</tbody></table></div></div></div></div></div><!-- Filer Nodes --><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3 d-flex flex-row align-items-center justify-content-between\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-folder me-2\"></i>Filer Nodes</h6><div class=\"dropdown no-arrow\"><a class=\"dropdown-toggle\" href=\"#\" role=\"button\" data-bs-toggle=\"dropdown\"><i class=\"bi bi-three-dots-vertical icon-sm icon-fixed-width text-gray-400\"></i></a><div class=\"dropdown-menu dropdown-menu-right shadow animated--fade-in\"><div class=\"dropdown-header\">Actions:</div><a class=\"dropdown-item\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 100, "</tbody></table></div></div></div></div></div><!-- Filer Nodes --><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3 d-flex flex-row align-items-center justify-content-between\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-folder me-2\"></i>Filer Nodes</h6><a href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var53 string
- templ_7745c5c3_Var53, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/filer")).ResolveURL(ctx)
+ var templ_7745c5c3_Var55 string
+ templ_7745c5c3_Var55, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/cluster/filers")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 563, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 457, Col: 67}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var53)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var55)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 99, "\">File Browser</a> <a class=\"dropdown-item\" href=\"")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var54 string
- templ_7745c5c3_Var54, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/cluster")).ResolveURL(ctx)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 564, Col: 90}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var54)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 100, "\">Topology View</a></div></div></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\"><thead><tr><th>Address</th><th>Data Center</th><th>Rack</th><th>Version</th><th>Last Updated</th></tr></thead> <tbody>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 101, "\" class=\"btn btn-sm btn-outline-primary\">View all <i class=\"bi bi-arrow-right ms-1\"></i></a></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\"><thead><tr><th>Address</th><th>Data Center</th><th>Rack</th><th>Version</th><th>Last Updated</th></tr></thead> <tbody>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, filer := range data.FilerNodes {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 101, "<tr><td><a href=\"")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var55 string
- templ_7745c5c3_Var55, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(fmt.Sprintf("//%s", filer.Address))).ResolveURL(ctx)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 584, Col: 106}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var55)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 102, "\" target=\"_blank\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 102, "<tr><td><a href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var56 string
- templ_7745c5c3_Var56, templ_7745c5c3_Err = templ.JoinStringErrs(filer.Address)
+ templ_7745c5c3_Var56, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(fmt.Sprintf("//%s", filer.Address))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 585, Col: 66}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 477, Col: 106}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var56))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var56)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 103, " <i class=\"bi bi-box-arrow-up-right ms-1 text-muted\"></i></a></td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 103, "\" target=\"_blank\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var57 string
- templ_7745c5c3_Var57, templ_7745c5c3_Err = templ.JoinStringErrs(filer.DataCenter)
+ templ_7745c5c3_Var57, templ_7745c5c3_Err = templ.JoinStringErrs(filer.Address)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 589, Col: 65}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 478, Col: 66}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var57))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 104, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 104, " <i class=\"bi bi-box-arrow-up-right ms-1 text-muted\"></i></a></td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var58 string
- templ_7745c5c3_Var58, templ_7745c5c3_Err = templ.JoinStringErrs(filer.Rack)
+ templ_7745c5c3_Var58, templ_7745c5c3_Err = templ.JoinStringErrs(filer.DataCenter)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 590, Col: 59}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 482, Col: 65}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var58))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 105, "</td><td title=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 105, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var59 string
- templ_7745c5c3_Var59, templ_7745c5c3_Err = templruntime.NewAttributeExpression(filer.Version).Resolve(ctx)
+ templ_7745c5c3_Var59, templ_7745c5c3_Err = templ.JoinStringErrs(filer.Rack)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 591, Col: 68}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 483, Col: 59}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var59)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var59))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 106, "\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 106, "</td><td title=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var60 string
- templ_7745c5c3_Var60, templ_7745c5c3_Err = templ.JoinStringErrs(dash.ShortVersion(filer.Version))
+ templ_7745c5c3_Var60, templ_7745c5c3_Err = templruntime.NewAttributeExpression(filer.Version).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 591, Col: 103}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 484, Col: 68}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var60))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var60)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 107, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 107, "\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var61 string
- templ_7745c5c3_Var61, templ_7745c5c3_Err = templ.JoinStringErrs(filer.LastUpdated.Format("2006-01-02 15:04:05"))
+ templ_7745c5c3_Var61, templ_7745c5c3_Err = templ.JoinStringErrs(dash.ShortVersion(filer.Version))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 592, Col: 96}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 484, Col: 103}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var61))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 108, "</td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 108, "</td><td>")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var62 string
+ templ_7745c5c3_Var62, templ_7745c5c3_Err = templ.JoinStringErrs(filer.LastUpdated.Format("2006-01-02 15:04:05"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 485, Col: 96}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var62))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 109, "</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if len(data.FilerNodes) == 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 109, "<tr><td colspan=\"5\" class=\"text-center text-muted py-4\"><i class=\"bi bi-info-circle me-2\"></i> No filer nodes found</td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 110, "<tr><td colspan=\"5\" class=\"text-center text-muted py-4\"><i class=\"bi bi-info-circle me-2\"></i> No filer nodes found</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 110, "</tbody></table></div></div></div></div></div><!-- S3 Servers --><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3 d-flex flex-row align-items-center justify-content-between\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-cloud me-2\"></i>S3 Servers</h6><div class=\"dropdown no-arrow\"><a class=\"dropdown-toggle\" href=\"#\" role=\"button\" data-bs-toggle=\"dropdown\"><i class=\"bi bi-three-dots-vertical icon-sm icon-fixed-width text-gray-400\"></i></a><div class=\"dropdown-menu dropdown-menu-right shadow animated--fade-in\"><div class=\"dropdown-header\">Actions:</div><a class=\"dropdown-item\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 111, "</tbody></table></div></div></div></div></div><!-- S3 Servers --><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3 d-flex flex-row align-items-center justify-content-between\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-cloud me-2\"></i>S3 Servers</h6><a href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var62 string
- templ_7745c5c3_Var62, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/cluster/s3")).ResolveURL(ctx)
+ var templ_7745c5c3_Var63 string
+ templ_7745c5c3_Var63, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, "/cluster/s3")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 625, Col: 93}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 512, Col: 63}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var62)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var63)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 111, "\">View Details</a></div></div></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\"><thead><tr><th>Address</th><th>Data Center</th><th>Version</th><th>Last Updated</th></tr></thead> <tbody>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 112, "\" class=\"btn btn-sm btn-outline-primary\">View all <i class=\"bi bi-arrow-right ms-1\"></i></a></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\"><thead><tr><th>Address</th><th>Data Center</th><th>Version</th><th>Last Updated</th></tr></thead> <tbody>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, s3Node := range data.S3Nodes {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 112, "<tr><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 113, "<tr><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var63 string
- templ_7745c5c3_Var63, templ_7745c5c3_Err = templ.JoinStringErrs(s3Node.Address)
+ var templ_7745c5c3_Var64 string
+ templ_7745c5c3_Var64, templ_7745c5c3_Err = templ.JoinStringErrs(s3Node.Address)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 643, Col: 63}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 530, Col: 63}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var63))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var64))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 113, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 114, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var64 string
- templ_7745c5c3_Var64, templ_7745c5c3_Err = templ.JoinStringErrs(s3Node.DataCenter)
+ var templ_7745c5c3_Var65 string
+ templ_7745c5c3_Var65, templ_7745c5c3_Err = templ.JoinStringErrs(s3Node.DataCenter)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 644, Col: 66}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 531, Col: 66}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var64))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var65))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 114, "</td><td title=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 115, "</td><td title=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var65 string
- templ_7745c5c3_Var65, templ_7745c5c3_Err = templruntime.NewAttributeExpression(s3Node.Version).Resolve(ctx)
+ var templ_7745c5c3_Var66 string
+ templ_7745c5c3_Var66, templ_7745c5c3_Err = templruntime.NewAttributeExpression(s3Node.Version).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 645, Col: 69}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 532, Col: 69}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var65)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var66)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 115, "\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 116, "\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var66 string
- templ_7745c5c3_Var66, templ_7745c5c3_Err = templ.JoinStringErrs(dash.ShortVersion(s3Node.Version))
+ var templ_7745c5c3_Var67 string
+ templ_7745c5c3_Var67, templ_7745c5c3_Err = templ.JoinStringErrs(dash.ShortVersion(s3Node.Version))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 645, Col: 105}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 532, Col: 105}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var66))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var67))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 116, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 117, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var67 string
- templ_7745c5c3_Var67, templ_7745c5c3_Err = templ.JoinStringErrs(s3Node.LastUpdated.Format("2006-01-02 15:04:05"))
+ var templ_7745c5c3_Var68 string
+ templ_7745c5c3_Var68, templ_7745c5c3_Err = templ.JoinStringErrs(s3Node.LastUpdated.Format("2006-01-02 15:04:05"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 646, Col: 97}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 533, Col: 97}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var67))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var68))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 117, "</td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 118, "</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if len(data.S3Nodes) == 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 118, "<tr><td colspan=\"4\" class=\"text-center text-muted py-4\"><i class=\"bi bi-info-circle me-2\"></i> No S3 servers found</td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 119, "<tr><td colspan=\"4\" class=\"text-center text-muted py-4\"><i class=\"bi bi-info-circle me-2\"></i> No S3 servers found</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 119, "</tbody></table></div></div></div></div></div><!-- Last Updated --><div class=\"row\"><div class=\"col-12\"><small class=\"text-muted\"><i class=\"bi bi-clock me-1\"></i> Last updated: ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 120, "</tbody></table></div></div></div></div></div><!-- Last Updated --><div class=\"row\"><div class=\"col-12\"><small class=\"text-muted\"><i class=\"bi bi-clock me-1\"></i> Last updated: ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var68 string
- templ_7745c5c3_Var68, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))
+ var templ_7745c5c3_Var69 string
+ templ_7745c5c3_Var69, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 670, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 557, Col: 81}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var68))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var69))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 120, "</small></div></div></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 121, "</small></div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/weed/admin/view/app/cluster_brokers.templ b/weed/admin/view/app/cluster_brokers.templ
index 6b40c4d9fd..e54d04585a 100644
--- a/weed/admin/view/app/cluster_brokers.templ
+++ b/weed/admin/view/app/cluster_brokers.templ
@@ -45,11 +45,6 @@ templ ClusterBrokers(data dash.ClusterBrokersData) {
<!-- Brokers Table -->
<div class="card shadow mb-4">
- <div class="card-header py-3">
- <h6 class="m-0 font-weight-bold text-primary">
- <i class="bi bi-chat-dots me-2"></i>Message Brokers
- </h6>
- </div>
<div class="card-body">
if len(data.Brokers) > 0 {
<div class="table-responsive">
diff --git a/weed/admin/view/app/cluster_brokers_templ.go b/weed/admin/view/app/cluster_brokers_templ.go
index 4e22b2d5f2..79d5cdada4 100644
--- a/weed/admin/view/app/cluster_brokers_templ.go
+++ b/weed/admin/view/app/cluster_brokers_templ.go
@@ -44,7 +44,7 @@ func ClusterBrokers(data dash.ClusterBrokersData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</div></div><div class=\"col-auto\"><i class=\"bi bi-chat-dots icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Brokers Table --><div class=\"card shadow mb-4\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-chat-dots me-2\"></i>Message Brokers</h6></div><div class=\"card-body\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</div></div><div class=\"col-auto\"><i class=\"bi bi-chat-dots icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Brokers Table --><div class=\"card shadow mb-4\"><div class=\"card-body\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -61,7 +61,7 @@ func ClusterBrokers(data dash.ClusterBrokersData) templ.Component {
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(broker.Address)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_brokers.templ`, Line: 70, Col: 27}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_brokers.templ`, Line: 65, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
@@ -74,7 +74,7 @@ func ClusterBrokers(data dash.ClusterBrokersData) templ.Component {
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(broker.Version)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_brokers.templ`, Line: 73, Col: 66}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_brokers.templ`, Line: 68, Col: 66}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
@@ -87,7 +87,7 @@ func ClusterBrokers(data dash.ClusterBrokersData) templ.Component {
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(broker.DataCenter)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_brokers.templ`, Line: 76, Col: 69}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_brokers.templ`, Line: 71, Col: 69}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
@@ -100,7 +100,7 @@ func ClusterBrokers(data dash.ClusterBrokersData) templ.Component {
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(broker.Rack)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_brokers.templ`, Line: 79, Col: 63}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_brokers.templ`, Line: 74, Col: 63}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
@@ -114,7 +114,7 @@ func ClusterBrokers(data dash.ClusterBrokersData) templ.Component {
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(broker.CreatedAt.Format("2006-01-02 15:04:05"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_brokers.templ`, Line: 83, Col: 60}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_brokers.templ`, Line: 78, Col: 60}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
@@ -148,7 +148,7 @@ func ClusterBrokers(data dash.ClusterBrokersData) templ.Component {
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_brokers.templ`, Line: 108, Col: 67}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_brokers.templ`, Line: 103, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
diff --git a/weed/admin/view/app/cluster_filers.templ b/weed/admin/view/app/cluster_filers.templ
index f28cda10e4..4e259e8b30 100644
--- a/weed/admin/view/app/cluster_filers.templ
+++ b/weed/admin/view/app/cluster_filers.templ
@@ -45,11 +45,6 @@ templ ClusterFilers(data dash.ClusterFilersData) {
<!-- Filers Table -->
<div class="card shadow mb-4">
- <div class="card-header py-3">
- <h6 class="m-0 font-weight-bold text-primary">
- <i class="bi bi-folder2-open me-2"></i>Filers
- </h6>
- </div>
<div class="card-body">
if len(data.Filers) > 0 {
<div class="table-responsive">
diff --git a/weed/admin/view/app/cluster_filers_templ.go b/weed/admin/view/app/cluster_filers_templ.go
index 4f27e9a417..4c4e4bd808 100644
--- a/weed/admin/view/app/cluster_filers_templ.go
+++ b/weed/admin/view/app/cluster_filers_templ.go
@@ -44,7 +44,7 @@ func ClusterFilers(data dash.ClusterFilersData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</div></div><div class=\"col-auto\"><i class=\"bi bi-folder2-open icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Filers Table --><div class=\"card shadow mb-4\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-folder2-open me-2\"></i>Filers</h6></div><div class=\"card-body\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</div></div><div class=\"col-auto\"><i class=\"bi bi-folder2-open icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Filers Table --><div class=\"card shadow mb-4\"><div class=\"card-body\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -61,7 +61,7 @@ func ClusterFilers(data dash.ClusterFilersData) templ.Component {
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(fmt.Sprintf("//%s", filer.Address))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 71, Col: 70}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 66, Col: 70}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3)
if templ_7745c5c3_Err != nil {
@@ -74,7 +74,7 @@ func ClusterFilers(data dash.ClusterFilersData) templ.Component {
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(filer.Address)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 72, Col: 27}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 67, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
@@ -87,7 +87,7 @@ func ClusterFilers(data dash.ClusterFilersData) templ.Component {
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(filer.Version)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 77, Col: 65}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 72, Col: 65}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
@@ -100,7 +100,7 @@ func ClusterFilers(data dash.ClusterFilersData) templ.Component {
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(filer.DataCenter)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 80, Col: 68}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 75, Col: 68}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
@@ -113,7 +113,7 @@ func ClusterFilers(data dash.ClusterFilersData) templ.Component {
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(filer.Rack)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 83, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 78, Col: 62}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
@@ -127,7 +127,7 @@ func ClusterFilers(data dash.ClusterFilersData) templ.Component {
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(filer.CreatedAt.Format("2006-01-02 15:04:05"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 87, Col: 59}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 82, Col: 59}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
@@ -146,7 +146,7 @@ func ClusterFilers(data dash.ClusterFilersData) templ.Component {
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templruntime.NewAttributeExpression(filer.Address).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 94, Col: 149}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 89, Col: 149}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
if templ_7745c5c3_Err != nil {
@@ -174,7 +174,7 @@ func ClusterFilers(data dash.ClusterFilersData) templ.Component {
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 119, Col: 67}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_filers.templ`, Line: 114, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
diff --git a/weed/admin/view/app/cluster_masters.templ b/weed/admin/view/app/cluster_masters.templ
index 7688ba0cfa..b206362ddb 100644
--- a/weed/admin/view/app/cluster_masters.templ
+++ b/weed/admin/view/app/cluster_masters.templ
@@ -89,11 +89,6 @@ templ ClusterMasters(data dash.ClusterMastersData) {
<!-- Masters Table -->
<div class="card shadow mb-4">
- <div class="card-header py-3">
- <h6 class="m-0 font-weight-bold text-primary">
- <i class="bi bi-award me-2"></i>Masters
- </h6>
- </div>
<div class="card-body">
if len(data.Masters) > 0 {
<div class="table-responsive">
diff --git a/weed/admin/view/app/cluster_masters_templ.go b/weed/admin/view/app/cluster_masters_templ.go
index fd41781748..991aded324 100644
--- a/weed/admin/view/app/cluster_masters_templ.go
+++ b/weed/admin/view/app/cluster_masters_templ.go
@@ -72,7 +72,7 @@ func ClusterMasters(data dash.ClusterMastersData) templ.Component {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</div></div><div class=\"col-auto\"><i class=\"bi bi-activity icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Masters Table --><div class=\"card shadow mb-4\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-award me-2\"></i>Masters</h6></div><div class=\"card-body\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</div></div><div class=\"col-auto\"><i class=\"bi bi-activity icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Masters Table --><div class=\"card shadow mb-4\"><div class=\"card-body\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -89,7 +89,7 @@ func ClusterMasters(data dash.ClusterMastersData) templ.Component {
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(fmt.Sprintf("//%s", master.Address))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_masters.templ`, Line: 113, Col: 71}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_masters.templ`, Line: 108, Col: 71}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var4)
if templ_7745c5c3_Err != nil {
@@ -102,7 +102,7 @@ func ClusterMasters(data dash.ClusterMastersData) templ.Component {
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(master.Address)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_masters.templ`, Line: 114, Col: 28}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_masters.templ`, Line: 109, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
@@ -135,7 +135,7 @@ func ClusterMasters(data dash.ClusterMastersData) templ.Component {
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(master.Suffrage)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_masters.templ`, Line: 132, Col: 30}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_masters.templ`, Line: 127, Col: 30}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
@@ -158,7 +158,7 @@ func ClusterMasters(data dash.ClusterMastersData) templ.Component {
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templruntime.NewAttributeExpression(master.Address).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_masters.templ`, Line: 143, Col: 41}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_masters.templ`, Line: 138, Col: 41}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7)
if templ_7745c5c3_Err != nil {
@@ -171,7 +171,7 @@ func ClusterMasters(data dash.ClusterMastersData) templ.Component {
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%t", master.IsLeader)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_masters.templ`, Line: 144, Col: 60}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_masters.templ`, Line: 139, Col: 60}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8)
if templ_7745c5c3_Err != nil {
@@ -184,7 +184,7 @@ func ClusterMasters(data dash.ClusterMastersData) templ.Component {
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templruntime.NewAttributeExpression(master.Suffrage).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_masters.templ`, Line: 145, Col: 43}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_masters.templ`, Line: 140, Col: 43}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
if templ_7745c5c3_Err != nil {
@@ -212,7 +212,7 @@ func ClusterMasters(data dash.ClusterMastersData) templ.Component {
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_masters.templ`, Line: 169, Col: 67}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_masters.templ`, Line: 164, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
diff --git a/weed/admin/view/app/cluster_s3_servers.templ b/weed/admin/view/app/cluster_s3_servers.templ
index 066629e725..3190a4a017 100644
--- a/weed/admin/view/app/cluster_s3_servers.templ
+++ b/weed/admin/view/app/cluster_s3_servers.templ
@@ -45,11 +45,6 @@ templ ClusterS3Servers(data dash.ClusterS3ServersData) {
<!-- S3 Servers Table -->
<div class="card shadow mb-4">
- <div class="card-header py-3">
- <h6 class="m-0 font-weight-bold text-primary">
- <i class="bi bi-cloud me-2"></i>S3 Servers
- </h6>
- </div>
<div class="card-body">
if len(data.S3Servers) > 0 {
<div class="table-responsive">
diff --git a/weed/admin/view/app/cluster_s3_servers_templ.go b/weed/admin/view/app/cluster_s3_servers_templ.go
index abf8699522..cde93497b6 100644
--- a/weed/admin/view/app/cluster_s3_servers_templ.go
+++ b/weed/admin/view/app/cluster_s3_servers_templ.go
@@ -44,7 +44,7 @@ func ClusterS3Servers(data dash.ClusterS3ServersData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</div></div><div class=\"col-auto\"><i class=\"bi bi-cloud icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- S3 Servers Table --><div class=\"card shadow mb-4\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-cloud me-2\"></i>S3 Servers</h6></div><div class=\"card-body\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</div></div><div class=\"col-auto\"><i class=\"bi bi-cloud icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- S3 Servers Table --><div class=\"card shadow mb-4\"><div class=\"card-body\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -61,7 +61,7 @@ func ClusterS3Servers(data dash.ClusterS3ServersData) templ.Component {
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(s3Server.Address)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_s3_servers.templ`, Line: 69, Col: 29}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_s3_servers.templ`, Line: 64, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
@@ -74,7 +74,7 @@ func ClusterS3Servers(data dash.ClusterS3ServersData) templ.Component {
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(s3Server.Version)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_s3_servers.templ`, Line: 72, Col: 68}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_s3_servers.templ`, Line: 67, Col: 68}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
@@ -87,7 +87,7 @@ func ClusterS3Servers(data dash.ClusterS3ServersData) templ.Component {
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(s3Server.DataCenter)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_s3_servers.templ`, Line: 75, Col: 71}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_s3_servers.templ`, Line: 70, Col: 71}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
@@ -101,7 +101,7 @@ func ClusterS3Servers(data dash.ClusterS3ServersData) templ.Component {
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(s3Server.CreatedAt.Format("2006-01-02 15:04:05"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_s3_servers.templ`, Line: 79, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_s3_servers.templ`, Line: 74, Col: 62}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
@@ -135,7 +135,7 @@ func ClusterS3Servers(data dash.ClusterS3ServersData) templ.Component {
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_s3_servers.templ`, Line: 104, Col: 67}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_s3_servers.templ`, Line: 99, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
diff --git a/weed/admin/view/app/cluster_volume_servers.templ b/weed/admin/view/app/cluster_volume_servers.templ
index 5b4f61997c..2ef1f08f35 100644
--- a/weed/admin/view/app/cluster_volume_servers.templ
+++ b/weed/admin/view/app/cluster_volume_servers.templ
@@ -87,11 +87,6 @@ templ ClusterVolumeServers(data dash.ClusterVolumeServersData) {
<!-- Hosts Table -->
<div class="card shadow mb-4">
- <div class="card-header py-3">
- <h6 class="m-0 font-weight-bold text-primary">
- <i class="bi bi-server me-2"></i>Volume Servers
- </h6>
- </div>
<div class="card-body">
if len(data.VolumeServers) > 0 {
<div class="table-responsive">
diff --git a/weed/admin/view/app/cluster_volume_servers_templ.go b/weed/admin/view/app/cluster_volume_servers_templ.go
index 029c82a504..4a0d52cc4e 100644
--- a/weed/admin/view/app/cluster_volume_servers_templ.go
+++ b/weed/admin/view/app/cluster_volume_servers_templ.go
@@ -70,7 +70,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</div></div><div class=\"col-auto\"><i class=\"bi bi-device-hdd icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Hosts Table --><div class=\"card shadow mb-4\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-server me-2\"></i>Volume Servers</h6></div><div class=\"card-body\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</div></div><div class=\"col-auto\"><i class=\"bi bi-device-hdd icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Hosts Table --><div class=\"card shadow mb-4\"><div class=\"card-body\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -92,7 +92,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(fmt.Sprintf("//%s/ui/index.html", host.PublicURL))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 118, Col: 121}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 113, Col: 121}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var5)
if templ_7745c5c3_Err != nil {
@@ -105,7 +105,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(host.Address)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 119, Col: 65}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 114, Col: 65}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
@@ -123,7 +123,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(fmt.Sprintf("//%s/ui/index.html", host.Address))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 123, Col: 119}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 118, Col: 119}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7)
if templ_7745c5c3_Err != nil {
@@ -136,7 +136,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(host.Address)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 124, Col: 65}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 119, Col: 65}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
@@ -154,7 +154,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(host.DataCenter)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 130, Col: 99}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 125, Col: 99}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
@@ -167,7 +167,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(host.Rack)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 133, Col: 93}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 128, Col: 93}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
@@ -180,7 +180,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templruntime.NewAttributeExpression(host.Version).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 135, Col: 63}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 130, Col: 63}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11)
if templ_7745c5c3_Err != nil {
@@ -193,7 +193,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(dash.ShortVersion(host.Version))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 136, Col: 76}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 131, Col: 76}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
@@ -206,7 +206,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templruntime.SanitizeStyleAttributeValues(fmt.Sprintf("width: %d%%", calculatePercent(host.Volumes, host.MaxVolumes)))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 142, Col: 139}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 137, Col: 139}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
@@ -219,7 +219,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", host.Volumes))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 145, Col: 111}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 140, Col: 111}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
@@ -232,7 +232,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", host.MaxVolumes))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 149, Col: 112}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 144, Col: 112}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
@@ -250,7 +250,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", host.EcShards))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 155, Col: 129}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 150, Col: 129}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
@@ -268,7 +268,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d EC volumes", host.EcVolumes))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 160, Col: 127}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 155, Col: 127}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
@@ -292,7 +292,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(host.DiskCapacity))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 167, Col: 75}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 162, Col: 75}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
@@ -305,7 +305,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templruntime.SanitizeStyleAttributeValues(fmt.Sprintf("width: %d%%", calculatePercent64(host.DiskUsage, host.DiskCapacity)))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 172, Col: 145}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 167, Col: 145}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil {
@@ -318,7 +318,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(host.DiskUsage))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 175, Col: 83}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 170, Col: 83}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
@@ -336,7 +336,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(host.RemoteSize))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 179, Col: 139}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 174, Col: 139}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil {
@@ -359,7 +359,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var22 string
templ_7745c5c3_Var22, templ_7745c5c3_Err = templruntime.NewAttributeExpression(host.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 189, Col: 72}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 184, Col: 72}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var22)
if templ_7745c5c3_Err != nil {
@@ -372,7 +372,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templruntime.NewAttributeExpression(host.Address).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 190, Col: 82}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 185, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var23)
if templ_7745c5c3_Err != nil {
@@ -385,7 +385,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templruntime.NewAttributeExpression(host.PublicURL).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 191, Col: 87}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 186, Col: 87}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24)
if templ_7745c5c3_Err != nil {
@@ -398,7 +398,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templruntime.NewAttributeExpression(host.DataCenter).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 192, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 187, Col: 88}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var25)
if templ_7745c5c3_Err != nil {
@@ -411,7 +411,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templruntime.NewAttributeExpression(host.Rack).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 193, Col: 76}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 188, Col: 76}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var26)
if templ_7745c5c3_Err != nil {
@@ -424,7 +424,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", host.Volumes)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 194, Col: 101}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 189, Col: 101}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var27)
if templ_7745c5c3_Err != nil {
@@ -437,7 +437,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var28 string
templ_7745c5c3_Var28, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", host.MaxVolumes)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 195, Col: 108}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 190, Col: 108}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var28)
if templ_7745c5c3_Err != nil {
@@ -450,7 +450,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var29 string
templ_7745c5c3_Var29, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", host.DiskUsage)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 196, Col: 106}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 191, Col: 106}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var29)
if templ_7745c5c3_Err != nil {
@@ -463,7 +463,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", host.DiskCapacity)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 197, Col: 112}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 192, Col: 112}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var30)
if templ_7745c5c3_Err != nil {
@@ -476,7 +476,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", host.RemoteSize)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 198, Col: 108}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 193, Col: 108}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var31)
if templ_7745c5c3_Err != nil {
@@ -489,7 +489,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", host.EcVolumes)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 199, Col: 106}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 194, Col: 106}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var32)
if templ_7745c5c3_Err != nil {
@@ -502,7 +502,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var33 string
templ_7745c5c3_Var33, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", host.EcShards)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 200, Col: 104}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 195, Col: 104}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var33)
if templ_7745c5c3_Err != nil {
@@ -515,7 +515,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var34 string
templ_7745c5c3_Var34, templ_7745c5c3_Err = templruntime.NewAttributeExpression(host.LastHeartbeat.Format("2006-01-02 15:04:05")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 201, Col: 125}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 196, Col: 125}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var34)
if templ_7745c5c3_Err != nil {
@@ -533,7 +533,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var35 string
templ_7745c5c3_Var35, templ_7745c5c3_Err = templruntime.NewAttributeExpression(host.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 209, Col: 72}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 204, Col: 72}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var35)
if templ_7745c5c3_Err != nil {
@@ -546,7 +546,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var36 string
templ_7745c5c3_Var36, templ_7745c5c3_Err = templruntime.NewAttributeExpression(host.Address).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 210, Col: 82}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 205, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var36)
if templ_7745c5c3_Err != nil {
@@ -559,7 +559,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var37 string
templ_7745c5c3_Var37, templ_7745c5c3_Err = templruntime.NewAttributeExpression(host.Address).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 211, Col: 85}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 206, Col: 85}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var37)
if templ_7745c5c3_Err != nil {
@@ -572,7 +572,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var38 string
templ_7745c5c3_Var38, templ_7745c5c3_Err = templruntime.NewAttributeExpression(host.DataCenter).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 212, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 207, Col: 88}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var38)
if templ_7745c5c3_Err != nil {
@@ -585,7 +585,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var39 string
templ_7745c5c3_Var39, templ_7745c5c3_Err = templruntime.NewAttributeExpression(host.Rack).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 213, Col: 76}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 208, Col: 76}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var39)
if templ_7745c5c3_Err != nil {
@@ -598,7 +598,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var40 string
templ_7745c5c3_Var40, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", host.Volumes)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 214, Col: 101}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 209, Col: 101}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var40)
if templ_7745c5c3_Err != nil {
@@ -611,7 +611,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var41 string
templ_7745c5c3_Var41, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", host.MaxVolumes)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 215, Col: 108}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 210, Col: 108}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var41)
if templ_7745c5c3_Err != nil {
@@ -624,7 +624,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var42 string
templ_7745c5c3_Var42, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", host.DiskUsage)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 216, Col: 106}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 211, Col: 106}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var42)
if templ_7745c5c3_Err != nil {
@@ -637,7 +637,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var43 string
templ_7745c5c3_Var43, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", host.DiskCapacity)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 217, Col: 112}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 212, Col: 112}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var43)
if templ_7745c5c3_Err != nil {
@@ -650,7 +650,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var44 string
templ_7745c5c3_Var44, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", host.RemoteSize)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 218, Col: 108}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 213, Col: 108}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var44)
if templ_7745c5c3_Err != nil {
@@ -663,7 +663,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var45 string
templ_7745c5c3_Var45, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", host.EcVolumes)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 219, Col: 106}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 214, Col: 106}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var45)
if templ_7745c5c3_Err != nil {
@@ -676,7 +676,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var46 string
templ_7745c5c3_Var46, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", host.EcShards)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 220, Col: 104}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 215, Col: 104}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var46)
if templ_7745c5c3_Err != nil {
@@ -689,7 +689,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var47 string
templ_7745c5c3_Var47, templ_7745c5c3_Err = templruntime.NewAttributeExpression(host.LastHeartbeat.Format("2006-01-02 15:04:05")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 221, Col: 125}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 216, Col: 125}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var47)
if templ_7745c5c3_Err != nil {
@@ -722,7 +722,7 @@ func ClusterVolumeServers(data dash.ClusterVolumeServersData) templ.Component {
var templ_7745c5c3_Var48 string
templ_7745c5c3_Var48, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 246, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/cluster_volume_servers.templ`, Line: 241, Col: 81}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var48))
if templ_7745c5c3_Err != nil {
diff --git a/weed/admin/view/app/cluster_volumes.templ b/weed/admin/view/app/cluster_volumes.templ
index ea3526b003..4b6192c0b3 100644
--- a/weed/admin/view/app/cluster_volumes.templ
+++ b/weed/admin/view/app/cluster_volumes.templ
@@ -316,7 +316,7 @@ templ ClusterVolumes(data dash.ClusterVolumesData) {
for _, volume := range data.Volumes {
<tr>
<td>
- <code class="volume-id-link" style="cursor: pointer; text-decoration: underline; color: #0d6efd;"
+ <code class="volume-id-link" style="cursor: pointer; text-decoration: underline;"
data-volume-id={fmt.Sprintf("%d", volume.Id)}
title="Click to view volume details">
{fmt.Sprintf("%d", volume.Id)}
@@ -354,7 +354,7 @@ templ ClusterVolumes(data dash.ClusterVolumesData) {
<td>{formatBytes(int64(volume.Size))}</td>
<td>
<div class="d-flex align-items-center">
- <div class="progress me-2" style="width: 80px; height: 16px; background-color: #e9ecef;">
+ <div class="progress me-2" style="width: 80px; height: 16px;">
<!-- Active data (green) -->
<div class="progress-bar bg-success" role="progressbar"
style={fmt.Sprintf("width: %.1f%%",
diff --git a/weed/admin/view/app/cluster_volumes_templ.go b/weed/admin/view/app/cluster_volumes_templ.go
index 292fd96d97..f372bc3000 100644
--- a/weed/admin/view/app/cluster_volumes_templ.go
+++ b/weed/admin/view/app/cluster_volumes_templ.go
@@ -462,7 +462,7 @@ func ClusterVolumes(data dash.ClusterVolumesData) templ.Component {
return templ_7745c5c3_Err
}
for _, volume := range data.Volumes {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "<tr><td><code class=\"volume-id-link\" style=\"cursor: pointer; text-decoration: underline; color: #0d6efd;\" data-volume-id=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "<tr><td><code class=\"volume-id-link\" style=\"cursor: pointer; text-decoration: underline;\" data-volume-id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -629,7 +629,7 @@ func ClusterVolumes(data dash.ClusterVolumesData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "</td><td><div class=\"d-flex align-items-center\"><div class=\"progress me-2\" style=\"width: 80px; height: 16px; background-color: #e9ecef;\"><!-- Active data (green) --><div class=\"progress-bar bg-success\" role=\"progressbar\" style=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "</td><td><div class=\"d-flex align-items-center\"><div class=\"progress me-2\" style=\"width: 80px; height: 16px;\"><!-- Active data (green) --><div class=\"progress-bar bg-success\" role=\"progressbar\" style=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/weed/admin/view/app/dashboard_health.go b/weed/admin/view/app/dashboard_health.go
new file mode 100644
index 0000000000..17a671363f
--- /dev/null
+++ b/weed/admin/view/app/dashboard_health.go
@@ -0,0 +1,59 @@
+package app
+
+import (
+ "fmt"
+ "strings"
+
+ "github.com/seaweedfs/seaweedfs/weed/admin/dash"
+)
+
+const diskFullWarnPercent = 90
+
+func clusterHealthIssues(data dash.AdminData) []string {
+ var issues []string
+ if len(data.MasterNodes) == 0 {
+ issues = append(issues, "no master reachable")
+ } else if !hasMasterLeader(data.MasterNodes) {
+ issues = append(issues, "no master leader")
+ }
+ if len(data.VolumeServers) == 0 {
+ issues = append(issues, "no volume servers")
+ }
+ if data.DiskCapacity > 0 {
+ if p := calculatePercent64(data.DiskUsage, data.DiskCapacity); p >= diskFullWarnPercent {
+ issues = append(issues, fmt.Sprintf("disks %d%% full", p))
+ }
+ }
+ if data.VersionSummary.Mixed() {
+ issues = append(issues, "mixed server versions")
+ }
+ return issues
+}
+
+func clusterHealthSummary(data dash.AdminData) string {
+ nodes := fmt.Sprintf("%s and %s reporting, %s configured.",
+ countNoun(len(data.VolumeServers), "volume server"),
+ countNoun(len(data.FilerNodes), "filer"),
+ countNoun(len(data.MasterNodes), "master"))
+ issues := clusterHealthIssues(data)
+ if len(issues) == 0 {
+ return "Healthy. " + nodes
+ }
+ return "Needs attention: " + strings.Join(issues, ", ") + ". " + nodes
+}
+
+func hasMasterLeader(masters []dash.MasterNode) bool {
+ for _, m := range masters {
+ if m.IsLeader {
+ return true
+ }
+ }
+ return false
+}
+
+func countNoun(n int, noun string) string {
+ if n == 1 {
+ return "1 " + noun
+ }
+ return fmt.Sprintf("%d %ss", n, noun)
+}
diff --git a/weed/admin/view/app/empty_value.templ b/weed/admin/view/app/empty_value.templ
new file mode 100644
index 0000000000..b7b2e50c57
--- /dev/null
+++ b/weed/admin/view/app/empty_value.templ
@@ -0,0 +1,5 @@
+package app
+
+templ emptyValue(label string) {
+ <span class="text-muted" title={ label }>–<span class="visually-hidden">{ label }</span></span>
+}
diff --git a/weed/admin/view/app/empty_value_templ.go b/weed/admin/view/app/empty_value_templ.go
new file mode 100644
index 0000000000..0fafe846ea
--- /dev/null
+++ b/weed/admin/view/app/empty_value_templ.go
@@ -0,0 +1,63 @@
+// Code generated by templ - DO NOT EDIT.
+
+// templ: version: v0.3.1100
+
+package app
+
+//lint:file-ignore SA4006 This context is only used if a nested component is present.
+
+import "github.com/a-h/templ"
+import templruntime "github.com/a-h/templ/runtime"
+
+func emptyValue(label string) templ.Component {
+ return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
+ templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
+ if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
+ return templ_7745c5c3_CtxErr
+ }
+ templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
+ if !templ_7745c5c3_IsBuffer {
+ defer func() {
+ templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
+ if templ_7745c5c3_Err == nil {
+ templ_7745c5c3_Err = templ_7745c5c3_BufErr
+ }
+ }()
+ }
+ ctx = templ.InitializeContext(ctx)
+ ctx = templ.ClearChildren(ctx)
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<span class=\"text-muted\" title=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var2 string
+ templ_7745c5c3_Var2, templ_7745c5c3_Err = templruntime.NewAttributeExpression(label).Resolve(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/empty_value.templ`, Line: 4, Col: 39}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var2)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\">–<span class=\"visually-hidden\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var3 string
+ templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(label)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/empty_value.templ`, Line: 4, Col: 82}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</span></span>")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ return nil
+ })
+}
+
+var _ = templruntime.GeneratedTemplate
diff --git a/weed/admin/view/app/groups.templ b/weed/admin/view/app/groups.templ
index 683b4a5137..d6cd29ed24 100644
--- a/weed/admin/view/app/groups.templ
+++ b/weed/admin/view/app/groups.templ
@@ -68,9 +68,6 @@ templ Groups(data dash.GroupsPageData) {
<!-- Groups Table -->
<div class="card shadow mb-4">
- <div class="card-header py-3">
- <h6 class="m-0 font-weight-bold text-primary">Groups</h6>
- </div>
<div class="card-body">
if len(data.Groups) == 0 {
<div class="text-center py-5 text-muted">
diff --git a/weed/admin/view/app/groups_templ.go b/weed/admin/view/app/groups_templ.go
index e354ff0312..a55d8d2e64 100644
--- a/weed/admin/view/app/groups_templ.go
+++ b/weed/admin/view/app/groups_templ.go
@@ -57,7 +57,7 @@ func Groups(data dash.GroupsPageData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</div></div><div class=\"col-auto\"><i class=\"bi bi-check-circle icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Groups Table --><div class=\"card shadow mb-4\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\">Groups</h6></div><div class=\"card-body\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</div></div><div class=\"col-auto\"><i class=\"bi bi-check-circle icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Groups Table --><div class=\"card shadow mb-4\"><div class=\"card-body\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -79,7 +79,7 @@ func Groups(data dash.GroupsPageData) templ.Component {
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(group.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 96, Col: 63}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 93, Col: 63}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
@@ -92,7 +92,7 @@ func Groups(data dash.GroupsPageData) templ.Component {
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", group.MemberCount))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 99, Col: 109}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 96, Col: 109}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
@@ -105,7 +105,7 @@ func Groups(data dash.GroupsPageData) templ.Component {
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", group.PolicyCount))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 102, Col: 114}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 99, Col: 114}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
@@ -133,7 +133,7 @@ func Groups(data dash.GroupsPageData) templ.Component {
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templruntime.NewAttributeExpression(group.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 113, Col: 79}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 110, Col: 79}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7)
if templ_7745c5c3_Err != nil {
@@ -146,7 +146,7 @@ func Groups(data dash.GroupsPageData) templ.Component {
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templruntime.NewAttributeExpression("View group " + group.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 115, Col: 90}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 112, Col: 90}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8)
if templ_7745c5c3_Err != nil {
@@ -159,7 +159,7 @@ func Groups(data dash.GroupsPageData) templ.Component {
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templruntime.NewAttributeExpression("View " + group.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 116, Col: 79}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 113, Col: 79}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
if templ_7745c5c3_Err != nil {
@@ -172,7 +172,7 @@ func Groups(data dash.GroupsPageData) templ.Component {
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templruntime.NewAttributeExpression(group.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 120, Col: 79}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 117, Col: 79}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
if templ_7745c5c3_Err != nil {
@@ -185,7 +185,7 @@ func Groups(data dash.GroupsPageData) templ.Component {
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templruntime.NewAttributeExpression("Delete group " + group.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 122, Col: 92}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 119, Col: 92}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11)
if templ_7745c5c3_Err != nil {
@@ -198,7 +198,7 @@ func Groups(data dash.GroupsPageData) templ.Component {
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templruntime.NewAttributeExpression("Delete " + group.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 123, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 120, Col: 81}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12)
if templ_7745c5c3_Err != nil {
@@ -226,7 +226,7 @@ func Groups(data dash.GroupsPageData) templ.Component {
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templruntime.NewAttributeExpression(user).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 189, Col: 67}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 186, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13)
if templ_7745c5c3_Err != nil {
@@ -239,7 +239,7 @@ func Groups(data dash.GroupsPageData) templ.Component {
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(user)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 189, Col: 74}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 186, Col: 74}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
@@ -262,7 +262,7 @@ func Groups(data dash.GroupsPageData) templ.Component {
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templruntime.NewAttributeExpression(policy).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 206, Col: 69}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 203, Col: 69}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var15)
if templ_7745c5c3_Err != nil {
@@ -275,7 +275,7 @@ func Groups(data dash.GroupsPageData) templ.Component {
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(policy)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 206, Col: 78}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/groups.templ`, Line: 203, Col: 78}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
diff --git a/weed/admin/view/app/mount_clients.templ b/weed/admin/view/app/mount_clients.templ
index aaffb18bed..79ab82a4f7 100644
--- a/weed/admin/view/app/mount_clients.templ
+++ b/weed/admin/view/app/mount_clients.templ
@@ -45,11 +45,6 @@ templ MountClients(data dash.MountClientsData) {
<!-- Mount Clients Table -->
<div class="card shadow mb-4">
- <div class="card-header py-3">
- <h6 class="m-0 font-weight-bold text-primary">
- <i class="bi bi-plug me-2"></i>Mount Clients
- </h6>
- </div>
<div class="card-body">
if len(data.MountClients) > 0 {
<div class="table-responsive">
diff --git a/weed/admin/view/app/mount_clients_templ.go b/weed/admin/view/app/mount_clients_templ.go
index 5b4b89aebd..19cd37c477 100644
--- a/weed/admin/view/app/mount_clients_templ.go
+++ b/weed/admin/view/app/mount_clients_templ.go
@@ -44,7 +44,7 @@ func MountClients(data dash.MountClientsData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</div></div><div class=\"col-auto\"><i class=\"bi bi-plug icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Mount Clients Table --><div class=\"card shadow mb-4\"><div class=\"card-header py-3\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-plug me-2\"></i>Mount Clients</h6></div><div class=\"card-body\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</div></div><div class=\"col-auto\"><i class=\"bi bi-plug icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Mount Clients Table --><div class=\"card shadow mb-4\"><div class=\"card-body\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -61,7 +61,7 @@ func MountClients(data dash.MountClientsData) templ.Component {
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(c.Address)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/mount_clients.templ`, Line: 70, Col: 31}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/mount_clients.templ`, Line: 65, Col: 31}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
@@ -74,7 +74,7 @@ func MountClients(data dash.MountClientsData) templ.Component {
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(c.ClientType)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/mount_clients.templ`, Line: 72, Col: 63}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/mount_clients.templ`, Line: 67, Col: 63}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
@@ -87,7 +87,7 @@ func MountClients(data dash.MountClientsData) templ.Component {
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(c.PathPrefix)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/mount_clients.templ`, Line: 74, Col: 34}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/mount_clients.templ`, Line: 69, Col: 34}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
@@ -100,7 +100,7 @@ func MountClients(data dash.MountClientsData) templ.Component {
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", c.ClientId))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/mount_clients.templ`, Line: 75, Col: 45}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/mount_clients.templ`, Line: 70, Col: 45}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
@@ -114,7 +114,7 @@ func MountClients(data dash.MountClientsData) templ.Component {
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(c.ConnectedAt.Format("2006-01-02 15:04:05"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/mount_clients.templ`, Line: 78, Col: 57}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/mount_clients.templ`, Line: 73, Col: 57}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
@@ -133,7 +133,7 @@ func MountClients(data dash.MountClientsData) templ.Component {
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(c.FilerAddress)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/mount_clients.templ`, Line: 84, Col: 66}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/mount_clients.templ`, Line: 79, Col: 66}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
@@ -161,7 +161,7 @@ func MountClients(data dash.MountClientsData) templ.Component {
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/mount_clients.templ`, Line: 106, Col: 67}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/mount_clients.templ`, Line: 101, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
diff --git a/weed/admin/view/app/object_store_users.templ b/weed/admin/view/app/object_store_users.templ
index ec11b29633..3af9bb9dbd 100644
--- a/weed/admin/view/app/object_store_users.templ
+++ b/weed/admin/view/app/object_store_users.templ
@@ -16,6 +16,9 @@ templ ObjectStoreUsers(data dash.ObjectStoreUsersData) {
<p class="mb-0 text-muted">Manage S3 API users and their access credentials</p>
</div>
<div class="d-flex gap-2">
+ <button type="button" class="btn btn-outline-primary" onclick="exportUsers()">
+ <i class="bi bi-download me-1"></i>Export
+ </button>
<button type="button" class="btn btn-primary"
data-bs-toggle="modal"
data-bs-target="#createUserModal">
@@ -45,68 +48,12 @@ templ ObjectStoreUsers(data dash.ObjectStoreUsersData) {
</div>
</div>
</div>
-
- <div class="col-xl-3 col-md-6 mb-4">
- <div class="card border-left-success shadow h-100 py-2">
- <div class="card-body">
- <div class="row no-gutters align-items-center">
- <div class="col mr-2">
- <div class="text-xs font-weight-bold text-success text-uppercase mb-1">
- Total Users
- </div>
- <div class="h5 mb-0 font-weight-bold text-gray-800">
- {fmt.Sprintf("%d", len(data.Users))}
- </div>
- </div>
- <div class="col-auto">
- <i class="bi bi-person-check icon-2x text-gray-300"></i>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <div class="col-xl-3 col-md-6 mb-4">
- <div class="card border-left-info shadow h-100 py-2">
- <div class="card-body">
- <div class="row no-gutters align-items-center">
- <div class="col mr-2">
- <div class="text-xs font-weight-bold text-info text-uppercase mb-1">
- Last Updated
- </div>
- <div class="h6 mb-0 font-weight-bold text-gray-800">
- {data.LastUpdated.Format("15:04")}
- </div>
- </div>
- <div class="col-auto">
- <i class="bi bi-clock icon-2x text-gray-300"></i>
- </div>
- </div>
- </div>
- </div>
- </div>
</div>
<!-- Users Table -->
<div class="row">
<div class="col-12">
<div class="card shadow mb-4">
- <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
- <h6 class="m-0 font-weight-bold text-primary">
- <i class="bi bi-people me-2"></i>Object Store Users
- </h6>
- <div class="dropdown no-arrow">
- <a class="dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
- <i class="bi bi-three-dots-vertical icon-sm icon-fixed-width text-gray-400"></i>
- </a>
- <div class="dropdown-menu dropdown-menu-right shadow animated--fade-in">
- <div class="dropdown-header">Actions:</div>
- <a class="dropdown-item" href="#" onclick="exportUsers()">
- <i class="bi bi-download me-2"></i>Export List
- </a>
- </div>
- </div>
- </div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover" width="100%" cellspacing="0" id="usersTable">
diff --git a/weed/admin/view/app/object_store_users_templ.go b/weed/admin/view/app/object_store_users_templ.go
index f627657a48..d6201ce8bc 100644
--- a/weed/admin/view/app/object_store_users_templ.go
+++ b/weed/admin/view/app/object_store_users_templ.go
@@ -31,213 +31,187 @@ func ObjectStoreUsers(data dash.ObjectStoreUsersData) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"container-fluid\"><!-- Page Header --><div class=\"d-sm-flex align-items-center justify-content-between mb-4\"><div><h1 class=\"h3 mb-0 text-gray-800\"><i class=\"bi bi-people me-2\"></i>Object Store Users</h1><p class=\"mb-0 text-muted\">Manage S3 API users and their access credentials</p></div><div class=\"d-flex gap-2\"><button type=\"button\" class=\"btn btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#createUserModal\"><i class=\"bi bi-plus me-1\"></i>Create User</button></div></div><!-- Summary Cards --><div class=\"row mb-4\"><div class=\"col-xl-3 col-md-6 mb-4\"><div class=\"card border-left-primary shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-primary text-uppercase mb-1\">Total Users</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"container-fluid\"><!-- Page Header --><div class=\"d-sm-flex align-items-center justify-content-between mb-4\"><div><h1 class=\"h3 mb-0 text-gray-800\"><i class=\"bi bi-people me-2\"></i>Object Store Users</h1><p class=\"mb-0 text-muted\">Manage S3 API users and their access credentials</p></div><div class=\"d-flex gap-2\"><button type=\"button\" class=\"btn btn-outline-primary\" onclick=\"exportUsers()\"><i class=\"bi bi-download me-1\"></i>Export</button> <button type=\"button\" class=\"btn btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#createUserModal\"><i class=\"bi bi-plus me-1\"></i>Create User</button></div></div><!-- Summary Cards --><div class=\"row mb-4\"><div class=\"col-xl-3 col-md-6 mb-4\"><div class=\"card border-left-primary shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-primary text-uppercase mb-1\">Total Users</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", data.TotalUsers))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 38, Col: 71}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 41, Col: 71}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</div></div><div class=\"col-auto\"><i class=\"bi bi-people icon-2x text-gray-300\"></i></div></div></div></div></div><div class=\"col-xl-3 col-md-6 mb-4\"><div class=\"card border-left-success shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-success text-uppercase mb-1\">Total Users</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var3 string
- templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.Users)))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 58, Col: 71}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</div></div><div class=\"col-auto\"><i class=\"bi bi-person-check icon-2x text-gray-300\"></i></div></div></div></div></div><div class=\"col-xl-3 col-md-6 mb-4\"><div class=\"card border-left-info shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-info text-uppercase mb-1\">Last Updated</div><div class=\"h6 mb-0 font-weight-bold text-gray-800\">")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var4 string
- templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("15:04"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 78, Col: 69}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</div></div><div class=\"col-auto\"><i class=\"bi bi-clock icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Users Table --><div class=\"row\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3 d-flex flex-row align-items-center justify-content-between\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-people me-2\"></i>Object Store Users</h6><div class=\"dropdown no-arrow\"><a class=\"dropdown-toggle\" href=\"#\" role=\"button\" data-bs-toggle=\"dropdown\"><i class=\"bi bi-three-dots-vertical icon-sm icon-fixed-width text-gray-400\"></i></a><div class=\"dropdown-menu dropdown-menu-right shadow animated--fade-in\"><div class=\"dropdown-header\">Actions:</div><a class=\"dropdown-item\" href=\"#\" onclick=\"exportUsers()\"><i class=\"bi bi-download me-2\"></i>Export List</a></div></div></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\" id=\"usersTable\"><thead><tr><th>Username</th><th>Email</th><th>Access Key</th><th>Actions</th></tr></thead> <tbody>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</div></div><div class=\"col-auto\"><i class=\"bi bi-people icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Users Table --><div class=\"row\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\" id=\"usersTable\"><thead><tr><th>Username</th><th>Email</th><th>Access Key</th><th>Actions</th></tr></thead> <tbody>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, user := range data.Users {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<tr><td><div class=\"d-flex align-items-center\"><i class=\"bi bi-person me-2 text-muted\"></i> <strong>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<tr><td><div class=\"d-flex align-items-center\"><i class=\"bi bi-person me-2 text-muted\"></i> <strong>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var5 string
- templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(user.Username)
+ var templ_7745c5c3_Var3 string
+ templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(user.Username)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 127, Col: 74}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 74, Col: 74}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</strong> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</strong> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if user.IsStatic {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "<span class=\"badge bg-secondary ms-2\" title=\"Loaded from config file (read-only)\">static</span>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<span class=\"badge bg-secondary ms-2\" title=\"Loaded from config file (read-only)\">static</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</div></td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</div></td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var6 string
- templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(user.Email)
+ var templ_7745c5c3_Var4 string
+ templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(user.Email)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 133, Col: 59}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 80, Col: 59}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</td><td><code class=\"text-muted\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</td><td><code class=\"text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var7 string
- templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(user.AccessKey)
+ var templ_7745c5c3_Var5 string
+ templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(user.AccessKey)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 135, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 82, Col: 88}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</code></td><td><div class=\"btn-group btn-group-sm\" role=\"group\"><button type=\"button\" class=\"btn btn-outline-info\" data-action=\"show-user-details\" data-username=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</code></td><td><div class=\"btn-group btn-group-sm\" role=\"group\"><button type=\"button\" class=\"btn btn-outline-info\" data-action=\"show-user-details\" data-username=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var8 string
- templ_7745c5c3_Var8, templ_7745c5c3_Err = templruntime.NewAttributeExpression(user.Username).Resolve(ctx)
+ var templ_7745c5c3_Var6 string
+ templ_7745c5c3_Var6, templ_7745c5c3_Err = templruntime.NewAttributeExpression(user.Username).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 140, Col: 121}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 87, Col: 121}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "\"><i class=\"bi bi-info-circle\"></i></button> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\"><i class=\"bi bi-info-circle\"></i></button> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !user.IsStatic {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "<button type=\"button\" class=\"btn btn-outline-primary\" data-action=\"edit-user\" data-username=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<button type=\"button\" class=\"btn btn-outline-primary\" data-action=\"edit-user\" data-username=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var9 string
- templ_7745c5c3_Var9, templ_7745c5c3_Err = templruntime.NewAttributeExpression(user.Username).Resolve(ctx)
+ var templ_7745c5c3_Var7 string
+ templ_7745c5c3_Var7, templ_7745c5c3_Err = templruntime.NewAttributeExpression(user.Username).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 145, Col: 117}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 92, Col: 117}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\"><i class=\"bi bi-pencil-square\"></i></button> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "\"><i class=\"bi bi-pencil-square\"></i></button> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if user.Username != "anonymous" && !user.IsStatic {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<button type=\"button\" class=\"btn btn-outline-secondary\" data-action=\"manage-access-keys\" data-username=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "<button type=\"button\" class=\"btn btn-outline-secondary\" data-action=\"manage-access-keys\" data-username=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var10 string
- templ_7745c5c3_Var10, templ_7745c5c3_Err = templruntime.NewAttributeExpression(user.Username).Resolve(ctx)
+ var templ_7745c5c3_Var8 string
+ templ_7745c5c3_Var8, templ_7745c5c3_Err = templruntime.NewAttributeExpression(user.Username).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 151, Col: 126}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 98, Col: 126}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "\"><i class=\"bi bi-key\"></i></button> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\"><i class=\"bi bi-key\"></i></button> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if !user.IsStatic {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<button type=\"button\" class=\"btn btn-outline-danger\" data-action=\"delete-user\" data-username=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<button type=\"button\" class=\"btn btn-outline-danger\" data-action=\"delete-user\" data-username=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var11 string
- templ_7745c5c3_Var11, templ_7745c5c3_Err = templruntime.NewAttributeExpression(user.Username).Resolve(ctx)
+ var templ_7745c5c3_Var9 string
+ templ_7745c5c3_Var9, templ_7745c5c3_Err = templruntime.NewAttributeExpression(user.Username).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 157, Col: 119}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 104, Col: 119}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "\"><i class=\"bi bi-trash\"></i></button>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "\"><i class=\"bi bi-trash\"></i></button>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</div></td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "</div></td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if len(data.Users) == 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "<tr><td colspan=\"4\" class=\"text-center text-muted py-4\"><i class=\"bi bi-people icon-3x mb-3 text-muted\"></i><div><h5>No users found</h5><p>Create your first object store user to get started.</p></div></td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "<tr><td colspan=\"4\" class=\"text-center text-muted py-4\"><i class=\"bi bi-people icon-3x mb-3 text-muted\"></i><div><h5>No users found</h5><p>Create your first object store user to get started.</p></div></td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "</tbody></table></div></div></div></div></div><!-- Last Updated --><div class=\"row\"><div class=\"col-12\"><small class=\"text-muted\"><i class=\"bi bi-clock me-1\"></i> Last updated: ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</tbody></table></div></div></div></div></div><!-- Last Updated --><div class=\"row\"><div class=\"col-12\"><small class=\"text-muted\"><i class=\"bi bi-clock me-1\"></i> Last updated: ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var12 string
- templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))
+ var templ_7745c5c3_Var10 string
+ templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 189, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/object_store_users.templ`, Line: 136, Col: 81}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</small></div></div></div><!-- Create User Modal --><div class=\"modal fade\" id=\"createUserModal\" tabindex=\"-1\" role=\"dialog\"><div class=\"modal-dialog\" role=\"document\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\"><i class=\"bi bi-person-plus me-2\"></i>Create New User</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\"></button></div><div class=\"modal-body\"><form id=\"createUserForm\"><div class=\"mb-3\"><label for=\"username\" class=\"form-label\">Username *</label> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</small></div></div></div><!-- Create User Modal --><div class=\"modal fade\" id=\"createUserModal\" tabindex=\"-1\" role=\"dialog\"><div class=\"modal-dialog\" role=\"document\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\"><i class=\"bi bi-person-plus me-2\"></i>Create New User</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\"></button></div><div class=\"modal-body\"><form id=\"createUserForm\"><div class=\"mb-3\"><label for=\"username\" class=\"form-label\">Username *</label> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !data.HasAnonymousUser {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "<div class=\"input-group\"><input type=\"text\" class=\"form-control\" id=\"username\" name=\"username\" required><div class=\"input-group-text\"><input class=\"form-check-input mt-0 me-1\" type=\"checkbox\" id=\"anonymousCheck\" onchange=\"toggleAnonymousUser()\"> <label class=\"form-check-label small\" for=\"anonymousCheck\">Anonymous</label></div></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<div class=\"input-group\"><input type=\"text\" class=\"form-control\" id=\"username\" name=\"username\" required><div class=\"input-group-text\"><input class=\"form-check-input mt-0 me-1\" type=\"checkbox\" id=\"anonymousCheck\" onchange=\"toggleAnonymousUser()\"> <label class=\"form-check-label small\" for=\"anonymousCheck\">Anonymous</label></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<input type=\"text\" class=\"form-control\" id=\"username\" name=\"username\" required>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "<input type=\"text\" class=\"form-control\" id=\"username\" name=\"username\" required>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</div><div class=\"mb-3\"><label for=\"email\" class=\"form-label\">Email</label> <input type=\"email\" class=\"form-control\" id=\"email\" name=\"email\"></div><div class=\"mb-3\"><label for=\"actions\" class=\"form-label\">Permissions</label> <select multiple class=\"form-control\" id=\"actions\" name=\"actions\" size=\"10\"><option value=\"Admin\">Admin (Full Access)</option> <option value=\"Read\">Read</option> <option value=\"Write\">Write</option> <option value=\"List\">List</option> <option value=\"Tagging\">Tagging</option> <option value=\"ReadAcp\" title=\"Needed for GET ?acl on buckets and objects\">Read ACL (ReadAcp)</option> <option value=\"WriteAcp\" title=\"Needed for PUT ?acl and for uploads that send x-amz-acl or x-amz-grant-* headers\">Write ACL (WriteAcp)</option> <optgroup label=\"Object Lock Permissions\"><option value=\"BypassGovernanceRetention\">Bypass Governance Retention</option> <option value=\"GetObjectRetention\">Get Object Retention</option> <option value=\"PutObjectRetention\">Put Object Retention</option> <option value=\"GetObjectLegalHold\">Get Object Legal Hold</option> <option value=\"PutObjectLegalHold\">Put Object Legal Hold</option> <option value=\"GetBucketObjectLockConfiguration\">Get Bucket Object Lock Configuration</option> <option value=\"PutBucketObjectLockConfiguration\">Put Bucket Object Lock Configuration</option></optgroup> <optgroup label=\"Bucket Policy Permissions\"><option value=\"PutBucketPolicy\">Put Bucket Policy</option> <option value=\"DeleteBucketPolicy\">Delete Bucket Policy</option></optgroup> <optgroup label=\"Bucket Configuration Permissions\"><option value=\"PutBucketCors\">Put Bucket CORS</option> <option value=\"DeleteBucketCors\">Delete Bucket CORS</option> <option value=\"PutBucketVersioning\">Put Bucket Versioning</option></optgroup> <optgroup label=\"S3 Tables Permissions\"><option value=\"S3TablesAdmin\">S3 Tables Admin (Full Access)</option> <option value=\"CreateTableBucket\">Create Table Bucket</option> <option value=\"GetTableBucket\">Get Table Bucket</option> <option value=\"ListTableBuckets\">List Table Buckets</option> <option value=\"DeleteTableBucket\">Delete Table Bucket</option> <option value=\"PutTableBucketPolicy\">Put Table Bucket Policy</option> <option value=\"GetTableBucketPolicy\">Get Table Bucket Policy</option> <option value=\"DeleteTableBucketPolicy\">Delete Table Bucket Policy</option> <option value=\"CreateNamespace\">Create Namespace</option> <option value=\"GetNamespace\">Get Namespace</option> <option value=\"ListNamespaces\">List Namespaces</option> <option value=\"DeleteNamespace\">Delete Namespace</option> <option value=\"CreateTable\">Create Table</option> <option value=\"GetTable\">Get Table</option> <option value=\"ListTables\">List Tables</option> <option value=\"DeleteTable\">Delete Table</option> <option value=\"PutTablePolicy\">Put Table Policy</option> <option value=\"GetTablePolicy\">Get Table Policy</option> <option value=\"DeleteTablePolicy\">Delete Table Policy</option> <option value=\"TagResource\">Tag Resource</option> <option value=\"ListTagsForResource\">List Tags</option> <option value=\"UntagResource\">Untag Resource</option></optgroup></select> <small class=\"form-text text-muted\">Hold Ctrl/Cmd to select multiple permissions</small></div><div class=\"mb-3\"><label class=\"form-label\">Bucket Scope</label> <small class=\"form-text text-muted d-block mb-2\">Apply selected permissions to specific buckets or all buckets</small><div class=\"form-check mb-2\"><input class=\"form-check-input\" type=\"radio\" name=\"bucketScope\" id=\"allBuckets\" value=\"all\" checked onchange=\"toggleBucketList()\"> <label class=\"form-check-label\" for=\"allBuckets\">All Buckets</label></div><div class=\"form-check mb-2\"><input class=\"form-check-input\" type=\"radio\" name=\"bucketScope\" id=\"specificBuckets\" value=\"specific\" onchange=\"toggleBucketList()\"> <label class=\"form-check-label\" for=\"specificBuckets\">Specific Buckets</label></div><div id=\"bucketSelectionList\" class=\"mt-2\" style=\"display: none;\"><select multiple class=\"form-select\" id=\"selectedBuckets\" size=\"5\"><!-- Options loaded dynamically --></select> <small class=\"form-text text-muted\">Hold Ctrl/Cmd to select multiple buckets</small></div></div><div class=\"mb-3\"><label for=\"policies\" class=\"form-label\">Attached Policies</label> <select multiple class=\"form-control\" id=\"policies\" name=\"policies\" size=\"5\"><!-- Options loaded dynamically --></select> <small class=\"form-text text-muted\">Hold Ctrl/Cmd to select multiple policies</small></div><div class=\"mb-3 form-check\"><input type=\"checkbox\" class=\"form-check-input\" id=\"generateKey\" name=\"generateKey\" checked> <label class=\"form-check-label\" for=\"generateKey\">Generate access key automatically</label></div></form></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-primary\" onclick=\"handleCreateUser()\">Create User</button></div></div></div></div><!-- Edit User Modal --><div class=\"modal fade\" id=\"editUserModal\" tabindex=\"-1\" role=\"dialog\"><div class=\"modal-dialog\" role=\"document\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\"><i class=\"bi bi-person-gear me-2\"></i>Edit User</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\"></button></div><div class=\"modal-body\"><form id=\"editUserForm\"><input type=\"hidden\" id=\"editUsername\" name=\"username\"><div class=\"mb-3\"><label for=\"editEmail\" class=\"form-label\">Email</label> <input type=\"email\" class=\"form-control\" id=\"editEmail\" name=\"email\"></div><div class=\"mb-3\"><label for=\"editActions\" class=\"form-label\">Permissions</label> <select multiple class=\"form-control\" id=\"editActions\" name=\"actions\" size=\"10\"><option value=\"Admin\">Admin (Full Access)</option> <option value=\"Read\">Read</option> <option value=\"Write\">Write</option> <option value=\"List\">List</option> <option value=\"Tagging\">Tagging</option> <option value=\"ReadAcp\" title=\"Needed for GET ?acl on buckets and objects\">Read ACL (ReadAcp)</option> <option value=\"WriteAcp\" title=\"Needed for PUT ?acl and for uploads that send x-amz-acl or x-amz-grant-* headers\">Write ACL (WriteAcp)</option> <optgroup label=\"Object Lock Permissions\"><option value=\"BypassGovernanceRetention\">Bypass Governance Retention</option> <option value=\"GetObjectRetention\">Get Object Retention</option> <option value=\"PutObjectRetention\">Put Object Retention</option> <option value=\"GetObjectLegalHold\">Get Object Legal Hold</option> <option value=\"PutObjectLegalHold\">Put Object Legal Hold</option> <option value=\"GetBucketObjectLockConfiguration\">Get Bucket Object Lock Configuration</option> <option value=\"PutBucketObjectLockConfiguration\">Put Bucket Object Lock Configuration</option></optgroup> <optgroup label=\"Bucket Policy Permissions\"><option value=\"PutBucketPolicy\">Put Bucket Policy</option> <option value=\"DeleteBucketPolicy\">Delete Bucket Policy</option></optgroup> <optgroup label=\"Bucket Configuration Permissions\"><option value=\"PutBucketCors\">Put Bucket CORS</option> <option value=\"DeleteBucketCors\">Delete Bucket CORS</option> <option value=\"PutBucketVersioning\">Put Bucket Versioning</option></optgroup> <optgroup label=\"S3 Tables Permissions\"><option value=\"S3TablesAdmin\">S3 Tables Admin (Full Access)</option> <option value=\"CreateTableBucket\">Create Table Bucket</option> <option value=\"GetTableBucket\">Get Table Bucket</option> <option value=\"ListTableBuckets\">List Table Buckets</option> <option value=\"DeleteTableBucket\">Delete Table Bucket</option> <option value=\"PutTableBucketPolicy\">Put Table Bucket Policy</option> <option value=\"GetTableBucketPolicy\">Get Table Bucket Policy</option> <option value=\"DeleteTableBucketPolicy\">Delete Table Bucket Policy</option> <option value=\"CreateNamespace\">Create Namespace</option> <option value=\"GetNamespace\">Get Namespace</option> <option value=\"ListNamespaces\">List Namespaces</option> <option value=\"DeleteNamespace\">Delete Namespace</option> <option value=\"CreateTable\">Create Table</option> <option value=\"GetTable\">Get Table</option> <option value=\"ListTables\">List Tables</option> <option value=\"DeleteTable\">Delete Table</option> <option value=\"PutTablePolicy\">Put Table Policy</option> <option value=\"GetTablePolicy\">Get Table Policy</option> <option value=\"DeleteTablePolicy\">Delete Table Policy</option> <option value=\"TagResource\">Tag Resource</option> <option value=\"ListTagsForResource\">List Tags</option> <option value=\"UntagResource\">Untag Resource</option></optgroup></select></div><div class=\"mb-3\"><label class=\"form-label\">Bucket Scope</label> <small class=\"form-text text-muted d-block mb-2\">Apply selected permissions to specific buckets or all buckets</small><div class=\"form-check mb-2\"><input class=\"form-check-input\" type=\"radio\" name=\"editBucketScope\" id=\"editAllBuckets\" value=\"all\" checked onchange=\"toggleBucketList('edit')\"> <label class=\"form-check-label\" for=\"editAllBuckets\">All Buckets</label></div><div class=\"form-check mb-2\"><input class=\"form-check-input\" type=\"radio\" name=\"editBucketScope\" id=\"editSpecificBuckets\" value=\"specific\" onchange=\"toggleBucketList('edit')\"> <label class=\"form-check-label\" for=\"editSpecificBuckets\">Specific Buckets</label></div><div id=\"editBucketSelectionList\" class=\"mt-2\" style=\"display: none;\"><select multiple class=\"form-select\" id=\"editSelectedBuckets\" size=\"5\"><!-- Options loaded dynamically --></select> <small class=\"form-text text-muted\">Hold Ctrl/Cmd to select multiple buckets</small></div></div><div class=\"mb-3\" id=\"editUnshownActionsGroup\" style=\"display: none;\"><label class=\"form-label\">Other Bucket Permissions</label> <small class=\"form-text text-muted d-block mb-2\">Grants the permission and bucket pickers above cannot show. Uncheck a grant to remove it.</small><div id=\"editUnshownActions\"></div></div><div class=\"mb-3\"><label for=\"editPolicies\" class=\"form-label\">Attached Policies</label> <select multiple class=\"form-control\" id=\"editPolicies\" name=\"policies\" size=\"5\"><!-- Options loaded dynamically --></select></div><div class=\"mb-3\"><label class=\"form-label\">Groups</label><div id=\"editUserGroups\"><!-- Groups loaded dynamically --></div><div class=\"input-group mt-2\"><select class=\"form-select\" id=\"editGroupSelect\"><option value=\"\">Add to group...</option></select> <button class=\"btn btn-outline-primary\" type=\"button\" onclick=\"addUserToGroupFromEdit()\" aria-label=\"Add user to group\" title=\"Add user to group\"><i class=\"bi bi-plus\"></i></button></div></div></form></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-primary\" onclick=\"handleUpdateUser()\">Update User</button></div></div></div></div><!-- User Details Modal --><div class=\"modal fade\" id=\"userDetailsModal\" tabindex=\"-1\" role=\"dialog\"><div class=\"modal-dialog modal-lg\" role=\"document\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\"><i class=\"bi bi-person me-2\"></i>User Details</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\"></button></div><div class=\"modal-body\" id=\"userDetailsContent\"><!-- Content will be loaded dynamically --></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Close</button></div></div></div></div><!-- Access Keys Management Modal --><div class=\"modal fade\" id=\"accessKeysModal\" tabindex=\"-1\" role=\"dialog\"><div class=\"modal-dialog modal-lg\" role=\"document\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\"><i class=\"bi bi-key me-2\"></i>Manage Access Keys</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\"></button></div><div class=\"modal-body\"><div class=\"d-flex justify-content-between align-items-center mb-3\"><h6>Access Keys for <span id=\"accessKeysUsername\"></span></h6><button type=\"button\" class=\"btn btn-primary btn-sm\" onclick=\"toggleCreateKeyForm()\"><i class=\"bi bi-plus me-1\"></i>Create New Key</button></div><div id=\"createKeyForm\" class=\"card mb-3\" style=\"display: none;\"><div class=\"card-body\"><p class=\"text-muted small mb-2\">Leave blank to auto-generate.</p><div class=\"mb-2\"><label for=\"newAccessKeyInput\" class=\"form-label form-label-sm\">Access Key</label> <input type=\"text\" class=\"form-control form-control-sm\" id=\"newAccessKeyInput\" placeholder=\"Auto-generated if empty\" minlength=\"4\" maxlength=\"128\"></div><div class=\"mb-2\"><label for=\"newSecretKeyInput\" class=\"form-label form-label-sm\">Secret Key</label><div class=\"input-group input-group-sm\"><input type=\"password\" class=\"form-control form-control-sm\" id=\"newSecretKeyInput\" placeholder=\"Auto-generated if empty\" minlength=\"8\" maxlength=\"128\"> <button class=\"btn btn-outline-secondary\" type=\"button\" onclick=\"toggleSecretKeyVisibility()\" aria-label=\"Toggle secret key visibility\"><i class=\"bi bi-eye\" id=\"secretKeyToggleIcon\"></i></button></div></div><div class=\"d-flex gap-2\"><button type=\"button\" class=\"btn btn-primary btn-sm\" onclick=\"createAccessKey()\">Create</button> <button type=\"button\" class=\"btn btn-secondary btn-sm\" onclick=\"toggleCreateKeyForm()\">Cancel</button></div></div></div><div id=\"accessKeysContent\"><!-- Content will be loaded dynamically --></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Close</button></div></div></div></div><!-- JavaScript for user management --><script>\n // Access key status constants\n const STATUS_ACTIVE = 'Active';\n const STATUS_INACTIVE = 'Inactive';\n\n // Use basePath() from admin.js for -urlPrefix; it is loaded in the layout footer before DOMContentLoaded fires.\n document.addEventListener('DOMContentLoaded', function() {\n\n // Event delegation for user action buttons\n document.addEventListener('click', function(e) {\n const button = e.target.closest('[data-action]');\n if (!button) return;\n\n const action = button.getAttribute('data-action');\n const username = button.getAttribute('data-username');\n\n switch (action) {\n case 'show-user-details':\n showUserDetails(username);\n break;\n case 'edit-user':\n editUser(username);\n break;\n case 'manage-access-keys':\n manageAccessKeys(username);\n break;\n case 'delete-user':\n deleteUser(username);\n break;\n }\n });\n\n // Event delegation for delete access key buttons\n document.addEventListener('click', function(e) {\n const deleteBtn = e.target.closest('.delete-access-key-btn');\n if (deleteBtn) {\n const username = deleteBtn.getAttribute('data-username');\n const accessKey = deleteBtn.getAttribute('data-access-key');\n deleteAccessKey(username, accessKey);\n }\n });\n\n // Event delegation for access key status changes\n document.addEventListener('change', function(e) {\n const statusSelect = e.target.closest('.access-key-status-select');\n if (statusSelect) {\n const username = statusSelect.getAttribute('data-username');\n const accessKey = statusSelect.getAttribute('data-access-key');\n const newStatus = statusSelect.value;\n updateAccessKeyStatus(username, accessKey, newStatus);\n }\n });\n\n // Load policies for dropdowns\n loadPolicies();\n\n // Load buckets for bucket permissions\n loadBuckets();\n });\n\n // Global variable to store available buckets\n var availableBuckets = [];\n var bucketPermissionCounter = 0;\n const s3TablesPermissions = new Set([\n 'CreateTableBucket',\n 'GetTableBucket',\n 'ListTableBuckets',\n 'DeleteTableBucket',\n 'PutTableBucketPolicy',\n 'GetTableBucketPolicy',\n 'DeleteTableBucketPolicy',\n 'CreateNamespace',\n 'GetNamespace',\n 'ListNamespaces',\n 'DeleteNamespace',\n 'CreateTable',\n 'GetTable',\n 'ListTables',\n 'DeleteTable',\n 'PutTablePolicy',\n 'GetTablePolicy',\n 'DeleteTablePolicy',\n 'TagResource',\n 'ListTagsForResource',\n 'UntagResource'\n ]);\n function isS3TablesPermission(permission) {\n return permission === 'S3TablesAdmin' || s3TablesPermissions.has(permission);\n }\n\n // Load buckets\n async function loadBuckets() {\n try {\n const response = await fetch(basePath('/api/s3/buckets'));\n if (response.ok) {\n const data = await response.json();\n availableBuckets = (data.buckets || []).map(bucket => ({ name: bucket.name, type: 's3' }));\n console.log('Loaded', availableBuckets.length, 'buckets');\n } else {\n console.warn('Failed to load buckets');\n availableBuckets = [];\n }\n } catch (error) {\n console.error('Error loading buckets:', error);\n availableBuckets = [];\n }\n try {\n const response = await fetch(basePath('/api/s3tables/buckets'));\n if (response.ok) {\n const data = await response.json();\n const tableBuckets = (data.buckets || data.tableBuckets || []).map(bucket => ({ name: bucket.name, type: 's3tables' }));\n availableBuckets = availableBuckets.concat(tableBuckets);\n } else {\n console.warn('Failed to load table buckets');\n }\n } catch (error) {\n console.warn('Error loading table buckets:', error);\n }\n // Populate bucket selection dropdowns\n populateBucketSelections();\n }\n\n // Load policies\n async function loadPolicies() {\n try {\n const response = await fetch(basePath('/api/object-store/policies'));\n if (response.ok) {\n const data = await response.json();\n const policies = data.policies || [];\n\n const createSelect = document.getElementById('policies');\n const editSelect = document.getElementById('editPolicies');\n\n // Check if elements exist\n if (!createSelect || !editSelect) {\n console.warn('Policy select elements not found');\n return;\n }\n\n // Clear existing options\n createSelect.innerHTML = '';\n editSelect.innerHTML = '';\n\n if (policies && policies.length > 0) {\n policies.forEach(policy => {\n const option = document.createElement('option');\n option.value = policy.name;\n option.textContent = policy.name;\n createSelect.appendChild(option);\n editSelect.appendChild(option.cloneNode(true));\n });\n } else {\n const emptyOption = document.createElement('option');\n emptyOption.disabled = true;\n emptyOption.textContent = 'No policies available';\n createSelect.appendChild(emptyOption);\n editSelect.appendChild(emptyOption.cloneNode(true));\n }\n } else {\n const error = await response.json().catch(() => ({}));\n showAlert('Failed to load policies: ' + (error.error || 'Unknown error'), 'error');\n }\n } catch (error) {\n console.error('Error loading policies:', error);\n showAlert('Failed to load policies: ' + error.message, 'error');\n }\n }\n\n // Toggle bucket permission fields when Admin checkbox changes\n function toggleBucketPermissionFields(mode) {\n mode = mode || 'create';\n const adminCheckbox = document.getElementById(mode === 'edit' ? 'editBucketAdmin' : 'bucketAdmin');\n const permissionFields = document.getElementById(mode === 'edit' ? 'editBucketPermissionFields' : 'bucketPermissionFields');\n\n if (adminCheckbox && permissionFields) {\n permissionFields.style.display = adminCheckbox.checked ? 'none' : 'block';\n }\n }\n\n // Toggle bucket list visibility when bucket scope changes\n function toggleBucketList(mode) {\n mode = mode || 'create';\n const specificRadio = document.getElementById(mode === 'edit' ? 'editSpecificBuckets' : 'specificBuckets');\n const bucketList = document.getElementById(mode === 'edit' ? 'editBucketSelectionList' : 'bucketSelectionList');\n\n if (specificRadio && bucketList) {\n bucketList.style.display = specificRadio.checked ? 'block' : 'none';\n }\n }\n\n // Toggle anonymous user checkbox\n function toggleAnonymousUser() {\n const checkbox = document.getElementById('anonymousCheck');\n const usernameInput = document.getElementById('username');\n const generateKey = document.getElementById('generateKey');\n if (checkbox.checked) {\n usernameInput.value = 'anonymous';\n usernameInput.readOnly = true;\n generateKey.checked = false;\n generateKey.disabled = true;\n } else {\n usernameInput.value = '';\n usernameInput.readOnly = false;\n generateKey.disabled = false;\n generateKey.checked = true;\n }\n }\n\n // Populate bucket selection dropdowns\n function populateBucketSelections() {\n const createSelect = document.getElementById('selectedBuckets');\n const editSelect = document.getElementById('editSelectedBuckets');\n\n [createSelect, editSelect].forEach(select => {\n if (select) {\n select.innerHTML = '';\n availableBuckets.forEach(bucket => {\n const option = document.createElement('option');\n option.value = bucket.type + ':' + bucket.name;\n option.textContent = bucket.type === 's3tables' ? `Table: ${bucket.name}` : bucket.name;\n select.appendChild(option);\n });\n }\n });\n }\n\n // Parse bucket permissions from actions array for new UI\n function parseBucketPermissions(actions) {\n const result = {\n isAdmin: false,\n permissions: [],\n applyToAll: false,\n specificBuckets: [],\n unshownActions: []\n };\n\n // Separate bucket-scoped from global actions\n const bucketActions = [];\n const globalBucketPerms = [];\n\n actions.forEach(action => {\n if (action.startsWith('s3tables:')) {\n const actionValue = action.slice('s3tables:'.length);\n if (actionValue === '*') {\n globalBucketPerms.push({ permission: 'S3TablesAdmin', action: action });\n return;\n }\n const parts = actionValue.split(':');\n const perm = parts[0];\n const bucket = parts.length > 1 ? parts.slice(1).join(':') : '';\n if (bucket) {\n bucketActions.push({ permission: perm, bucketId: 's3tables:' + bucket, action: action });\n } else {\n globalBucketPerms.push({ permission: perm, action: action });\n }\n } else if (action.includes(':')) {\n const parts = action.split(':');\n const perm = parts[0];\n const bucket = parts.slice(1).join(':');\n bucketActions.push({ permission: perm, bucketId: 's3:' + bucket, action: action });\n } else {\n globalBucketPerms.push({ permission: action, action: action });\n }\n });\n\n const listed = globalBucketPerms.filter(gp => hasPickerOption('editActions', gp.permission));\n const unlisted = globalBucketPerms.filter(gp => !listed.includes(gp)).map(gp => gp.action);\n\n if (actions.includes('Admin')) {\n result.isAdmin = true;\n result.permissions = listed.map(gp => gp.permission);\n result.unshownActions = unlisted.concat(bucketActions.map(ba => ba.action));\n return result;\n }\n\n // If we have global bucket permissions (no colon), they apply to all buckets\n if (globalBucketPerms.length > 0) {\n result.permissions = listed.map(gp => gp.permission);\n result.applyToAll = true;\n result.unshownActions = unlisted.concat(bucketActions.map(ba => ba.action));\n } else if (bucketActions.length > 0) {\n // The form saves every permission on every selected bucket, so it can\n // show the grants only when they cover that full product with listed options.\n const perms = [...new Set(bucketActions.map(ba => ba.permission))];\n const buckets = [...new Set(bucketActions.map(ba => ba.bucketId))];\n const pairs = new Set(bucketActions.map(ba => JSON.stringify([ba.permission, ba.bucketId])));\n const allListed = perms.every(perm => hasPickerOption('editActions', perm)) &&\n buckets.every(bucketId => hasPickerOption('editSelectedBuckets', bucketId));\n\n if (allListed && pairs.size === perms.length * buckets.length) {\n result.permissions = perms;\n result.specificBuckets = buckets;\n } else {\n result.unshownActions = bucketActions.map(ba => ba.action);\n }\n }\n\n return result;\n }\n\n function hasPickerOption(selectId, value) {\n const select = document.getElementById(selectId);\n return !!select && Array.from(select.options).some(option => option.value === value);\n }\n\n function parseBucketOptionValue(value) {\n if (value.startsWith('s3tables:')) {\n return { type: 's3tables', name: value.slice('s3tables:'.length) };\n }\n if (value.startsWith('s3:')) {\n return { type: 's3', name: value.slice('s3:'.length) };\n }\n return { type: 's3', name: value };\n }\n\n function renderUnshownActions(actions) {\n const container = document.getElementById('editUnshownActions');\n container.replaceChildren();\n actions.forEach((action, i) => {\n const wrapper = document.createElement('div');\n wrapper.className = 'form-check';\n const input = document.createElement('input');\n input.className = 'form-check-input';\n input.type = 'checkbox';\n input.id = 'editUnshownAction' + i;\n input.value = action;\n input.checked = true;\n const label = document.createElement('label');\n label.className = 'form-check-label';\n label.htmlFor = input.id;\n label.textContent = action;\n wrapper.append(input, label);\n container.appendChild(wrapper);\n });\n document.getElementById('editUnshownActionsGroup').style.display = actions.length > 0 ? '' : 'none';\n }\n\n function selectedUnshownActions() {\n return Array.from(document.querySelectorAll('#editUnshownActions input:checked')).map(input => input.value);\n }\n\n // Build bucket permission action strings using original permissions dropdown\n /**\n * Builds bucket permission strings based on selected permissions and bucket scope.\n * @param {string} mode - The operation mode, either 'create' or 'edit'.\n * @returns {string[]|null} Array of permission strings (e.g., ['Read:bucket1']) or null if validation fails (specific scope selected but no buckets).\n */\n function buildBucketPermissions(mode) {\n mode = mode || 'create';\n const selectId = mode === 'edit' ? 'editActions' : 'actions';\n const permSelect = document.getElementById(selectId);\n\n if (!permSelect) return [];\n\n // Get selected permissions from the original multi-select\n const selectedPerms = Array.from(permSelect.selectedOptions).map(opt => opt.value);\n\n const hasAdmin = selectedPerms.includes('Admin');\n const hasS3TablesAdmin = selectedPerms.includes('S3TablesAdmin');\n\n if (selectedPerms.length === 0) {\n return [];\n }\n\n // Check if applying to all buckets or specific ones\n // Use querySelector to find the checked radio button by name group\n const scopeName = mode === 'edit' ? 'editBucketScope' : 'bucketScope';\n\n // Try multiple methods to find the checked radio\n let checkedRadio = document.querySelector(`input[name=\"${scopeName}\"]:checked`);\n\n // Fallback: check both radio buttons explicitly\n if (!checkedRadio) {\n const allBucketsId = mode === 'edit' ? 'editAllBuckets' : 'allBuckets';\n const specificBucketsId = mode === 'edit' ? 'editSpecificBuckets' : 'specificBuckets';\n\n const allBucketsRadio = document.getElementById(allBucketsId);\n const specificBucketsRadio = document.getElementById(specificBucketsId);\n\n if (specificBucketsRadio && specificBucketsRadio.checked) {\n checkedRadio = specificBucketsRadio;\n } else if (allBucketsRadio && allBucketsRadio.checked) {\n checkedRadio = allBucketsRadio;\n }\n }\n\n // Default to 'all' if nothing is checked (shouldn't happen) or if 'all' is checked\n const applyToAll = !checkedRadio || checkedRadio.value === 'all';\n\n if (applyToAll) {\n // Return global permissions (no bucket specification)\n const actions = [];\n if (hasAdmin) {\n actions.push('Admin');\n }\n if (hasS3TablesAdmin) {\n actions.push('s3tables:*');\n }\n selectedPerms.forEach(perm => {\n if (perm === 'Admin' || perm === 'S3TablesAdmin') {\n return;\n }\n if (isS3TablesPermission(perm)) {\n actions.push('s3tables:' + perm);\n } else {\n actions.push(perm);\n }\n });\n return actions;\n } else {\n // Get selected specific buckets\n const bucketSelect = document.getElementById(mode === 'edit' ? 'editSelectedBuckets' : 'selectedBuckets');\n if (!bucketSelect) return null;\n\n const selectedBuckets = [...new Set(Array.from(bucketSelect.selectedOptions).map(opt => opt.value))];\n\n // Return null to signal validation failure if no buckets selected\n if (selectedBuckets.length === 0) {\n return null;\n }\n\n // Build bucket-scoped permissions\n const actions = [];\n if (hasAdmin) {\n selectedBuckets.forEach((bucket) => {\n const bucketInfo = parseBucketOptionValue(bucket);\n actions.push(\"Admin:\" + bucketInfo.name);\n });\n }\n if (hasS3TablesAdmin) {\n actions.push('s3tables:*');\n }\n selectedPerms.forEach(perm => {\n if (perm === 'Admin' || perm === 'S3TablesAdmin') {\n return;\n }\n selectedBuckets.forEach(bucket => {\n const bucketInfo = parseBucketOptionValue(bucket);\n if (isS3TablesPermission(perm)) {\n if (bucketInfo.type === 's3tables') {\n actions.push('s3tables:' + perm + ':' + bucketInfo.name);\n }\n } else if (bucketInfo.type === 's3') {\n actions.push(perm + ':' + bucketInfo.name);\n }\n });\n });\n\n return [...new Set(actions)];\n }\n }\n\n // Show user details modal\n async function showUserDetails(username) {\n try {\n const encodedUsername = encodeURIComponent(username);\n const response = await fetch(basePath(`/api/users/${encodedUsername}`));\n if (response.ok) {\n const user = await response.json();\n document.getElementById('userDetailsContent').innerHTML = createUserDetailsContent(user);\n const modal = new bootstrap.Modal(document.getElementById('userDetailsModal'));\n modal.show();\n } else {\n showAlert('Failed to load user details', 'error');\n }\n } catch (error) {\n console.error('Error loading user details:', error);\n showAlert('Failed to load user details', 'error');\n }\n }\n\n // Edit user function\n async function editUser(username) {\n try {\n const encodedUsername = encodeURIComponent(username);\n const response = await fetch(basePath(`/api/users/${encodedUsername}`));\n if (response.ok) {\n const user = await response.json();\n\n // Populate edit form\n renderUnshownActions([]);\n document.getElementById('editAllBuckets').checked = true;\n Array.from(document.getElementById('editSelectedBuckets').options).forEach(option => {\n option.selected = false;\n });\n toggleBucketList('edit');\n document.getElementById('editUsername').value = username;\n document.getElementById('editEmail').value = user.email || '';\n\n // Set selected actions\n const actionsSelect = document.getElementById('editActions');\n Array.from(actionsSelect.options).forEach(option => {\n option.selected = user.actions && user.actions.includes(option.value);\n });\n\n // Set selected policies\n const policiesSelect = document.getElementById('editPolicies');\n if (policiesSelect) {\n Array.from(policiesSelect.options).forEach(option => {\n option.selected = user.policy_names && user.policy_names.includes(option.value);\n });\n }\n\n // Populate bucket permissions using original permissions dropdown\n if (user.actions && user.actions.length > 0) {\n const bucketPerms = parseBucketPermissions(user.actions);\n renderUnshownActions(bucketPerms.unshownActions);\n\n // Set permissions in the original multi-select\n const actionsSelect = document.getElementById('editActions');\n if (actionsSelect) {\n Array.from(actionsSelect.options).forEach(option => {\n if (bucketPerms.permissions.includes(option.value)) {\n option.selected = true;\n }\n });\n }\n\n // Set bucket scope (all or specific)\n const allBucketsRadio = document.getElementById('editAllBuckets');\n const specificBucketsRadio = document.getElementById('editSpecificBuckets');\n\n if (!bucketPerms.isAdmin) {\n if (bucketPerms.applyToAll) {\n if (allBucketsRadio) allBucketsRadio.checked = true;\n } else if (bucketPerms.specificBuckets.length > 0) {\n if (specificBucketsRadio) specificBucketsRadio.checked = true;\n toggleBucketList('edit');\n\n // Select specific buckets\n const bucketSelect = document.getElementById('editSelectedBuckets');\n if (bucketSelect) {\n Array.from(bucketSelect.options).forEach(option => {\n option.selected = bucketPerms.specificBuckets.includes(option.value);\n });\n }\n }\n }\n }\n\n // Populate groups\n await populateEditUserGroups(username);\n\n // Show modal\n const modal = new bootstrap.Modal(document.getElementById('editUserModal'));\n modal.show();\n } else {\n showAlert('Failed to load user details', 'error');\n }\n } catch (error) {\n console.error('Error loading user:', error);\n showAlert('Failed to load user details', 'error');\n }\n }\n\n // Manage access keys function\n async function manageAccessKeys(username) {\n try {\n const encodedUsername = encodeURIComponent(username);\n const response = await fetch(basePath(`/api/users/${encodedUsername}`));\n if (response.ok) {\n const user = await response.json();\n document.getElementById('accessKeysUsername').textContent = username;\n document.getElementById('accessKeysContent').innerHTML = createAccessKeysContent(user);\n const modal = new bootstrap.Modal(document.getElementById('accessKeysModal'));\n modal.show();\n } else {\n showAlert('Failed to load access keys', 'error');\n }\n } catch (error) {\n console.error('Error loading access keys:', error);\n showAlert('Failed to load access keys', 'error');\n }\n }\n\n // Delete user function\n async function deleteUser(username) {\n showDeleteConfirm(username, async function() {\n try {\n const encodedUsername = encodeURIComponent(username);\n const response = await fetch(basePath(`/api/users/${encodedUsername}`), {\n method: 'DELETE'\n });\n\n if (response.ok) {\n showSuccessMessage('User deleted successfully');\n setTimeout(() => window.location.reload(), 1000);\n } else {\n const error = await response.json();\n showErrorMessage('Failed to delete user: ' + (error.error || 'Unknown error'));\n }\n } catch (error) {\n console.error('Error deleting user:', error);\n showErrorMessage('Failed to delete user: ' + error.message);\n }\n }, 'Are you sure you want to delete this user? This action cannot be undone.');\n }\n\n // Handle create user form submission\n async function handleCreateUser() {\n const form = document.getElementById('createUserForm');\n const formData = new FormData(form);\n\n // Get permissions with bucket scope applied\n const allActions = buildBucketPermissions('create');\n\n if (allActions === null) {\n showAlert('Please select at least one bucket when using specific bucket permissions', 'error');\n return;\n }\n\n if (!allActions || allActions.length === 0) {\n showAlert('At least one permission must be selected', 'error');\n return;\n }\n\n const userData = {\n username: formData.get('username'),\n email: formData.get('email'),\n actions: allActions,\n policy_names: Array.from(document.getElementById('policies').selectedOptions).map(option => option.value),\n generate_key: document.getElementById('generateKey').checked\n };\n\n try {\n const response = await fetch(basePath('/api/users'), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(userData)\n });\n\n if (response.ok) {\n const result = await response.json();\n showSuccessMessage('User created successfully');\n\n // Show the created access key if generated\n if (result.user && result.user.access_key) {\n showNewAccessKeyModal(result.user);\n }\n\n // Close modal and refresh page\n const modal = bootstrap.Modal.getInstance(document.getElementById('createUserModal'));\n modal.hide();\n form.reset();\n document.getElementById('username').readOnly = false;\n document.getElementById('generateKey').disabled = false;\n setTimeout(() => window.location.reload(), 1000);\n } else {\n const error = await response.json();\n showAlert('Failed to create user: ' + (error.error || 'Unknown error'), 'error');\n }\n } catch (error) {\n console.error('Error creating user:', error);\n showAlert('Failed to create user: ' + error.message, 'error');\n }\n }\n\n\n // Populate groups in the edit user modal\n async function populateEditUserGroups(username) {\n const container = document.getElementById('editUserGroups');\n const groupSelect = document.getElementById('editGroupSelect');\n container.innerHTML = '';\n groupSelect.innerHTML = '<option value=\"\">Add to group...</option>';\n\n try {\n // Fetch all groups\n const groupsResp = await fetch(basePath('/api/groups'));\n if (!groupsResp.ok) return;\n const groupsData = await groupsResp.json();\n const allGroups = groupsData.groups || [];\n\n // Fetch user details to get current groups\n const userResp = await fetch(basePath(`/api/users/${encodeURIComponent(username)}`));\n if (!userResp.ok) return;\n const user = await userResp.json();\n const userGroups = user.groups || [];\n\n // Show current group badges with remove button\n if (userGroups.length > 0) {\n userGroups.forEach(function(group) {\n const badge = document.createElement('span');\n badge.className = 'badge bg-primary me-1 mb-1';\n badge.textContent = group + ' ';\n const removeIcon = document.createElement('i');\n removeIcon.className = 'bi bi-x ms-1';\n removeIcon.style.cursor = 'pointer';\n removeIcon.setAttribute('aria-label', 'Remove from group ' + group);\n removeIcon.setAttribute('title', 'Remove from group');\n removeIcon.addEventListener('click', function() {\n removeUserFromGroupInEdit(group);\n });\n badge.appendChild(removeIcon);\n container.appendChild(badge);\n });\n } else {\n container.innerHTML = '<span class=\"text-muted\">No groups</span>';\n }\n\n // Populate dropdown with groups the user is NOT in\n allGroups.forEach(function(g) {\n if (!userGroups.includes(g.name)) {\n const opt = document.createElement('option');\n opt.value = g.name;\n opt.textContent = g.name;\n groupSelect.appendChild(opt);\n }\n });\n } catch (error) {\n console.error('Error loading groups:', error);\n }\n }\n\n // Add user to group from edit modal\n async function addUserToGroupFromEdit() {\n const username = document.getElementById('editUsername').value;\n const groupSelect = document.getElementById('editGroupSelect');\n const groupName = groupSelect.value;\n if (!groupName) return;\n\n try {\n const response = await fetch(basePath(`/api/groups/${encodeURIComponent(groupName)}/members`), {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ username: username })\n });\n if (response.ok) {\n await populateEditUserGroups(username);\n } else {\n const error = await response.json();\n showAlert('Failed to add to group: ' + (error.error || 'Unknown error'), 'error');\n }\n } catch (error) {\n showAlert('Failed to add to group: ' + error.message, 'error');\n }\n }\n\n // Remove user from group in edit modal\n async function removeUserFromGroupInEdit(groupName) {\n const username = document.getElementById('editUsername').value;\n try {\n const response = await fetch(basePath(`/api/groups/${encodeURIComponent(groupName)}/members/${encodeURIComponent(username)}`), {\n method: 'DELETE'\n });\n if (response.ok) {\n await populateEditUserGroups(username);\n } else {\n const error = await response.json();\n showAlert('Failed to remove from group: ' + (error.error || 'Unknown error'), 'error');\n }\n } catch (error) {\n showAlert('Failed to remove from group: ' + error.message, 'error');\n }\n }\n\n // Handle update user form submission\n async function handleUpdateUser() {\n const username = document.getElementById('editUsername').value;\n if (!username) {\n showAlert('Username is required', 'error');\n return;\n }\n\n // Get permissions with bucket scope applied\n const allActions = buildBucketPermissions('edit');\n\n // Check for null (validation failure from buildBucketPermissions)\n if (allActions === null) {\n showAlert('Please select at least one bucket when using specific bucket permissions', 'error');\n return;\n }\n\n const actions = [...new Set([...allActions, ...selectedUnshownActions()])];\n if (actions.length === 0) {\n showAlert('At least one permission must be selected', 'error');\n return;\n }\n\n const userData = {\n email: document.getElementById('editEmail').value,\n actions: actions,\n policy_names: Array.from(document.getElementById('editPolicies').selectedOptions).map(option => option.value)\n };\n\n try {\n const encodedUsername = encodeURIComponent(username);\n const response = await fetch(basePath(`/api/users/${encodedUsername}`), {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(userData)\n });\n\n if (response.ok) {\n showSuccessMessage('User updated successfully');\n\n // Close modal and refresh page\n const modal = bootstrap.Modal.getInstance(document.getElementById('editUserModal'));\n modal.hide();\n setTimeout(() => window.location.reload(), 1000);\n } else {\n const error = await response.json();\n showAlert('Failed to update user: ' + (error.error || 'Unknown error'), 'error');\n }\n } catch (error) {\n console.error('Error updating user:', error);\n showAlert('Failed to update user: ' + error.message, 'error');\n }\n }\n\n\n // Create user details content\n function createUserDetailsContent(user) {\n var detailsHtml = '<div class=\"row\">';\n detailsHtml += '<div class=\"col-md-6\">';\n detailsHtml += '<h6 class=\"text-muted\">Basic Information</h6>';\n detailsHtml += '<table class=\"table table-sm\">';\n detailsHtml += '<tr><td><strong>Username:</strong></td><td>' + escapeHtml(user.username) + '</td></tr>';\n detailsHtml += '<tr><td><strong>Email:</strong></td><td>' + escapeHtml(user.email || 'Not set') + '</td></tr>';\n detailsHtml += '</table>';\n detailsHtml += '</div>';\n detailsHtml += '<div class=\"col-md-6\">';\n detailsHtml += '<h6 class=\"text-muted\">Permissions</h6>';\n detailsHtml += '<div class=\"mb-3\">';\n if (user.actions && user.actions.length > 0) {\n detailsHtml += user.actions.map(function(action) {\n return '<span class=\"badge bg-info me-1\">' + escapeHtml(action) + '</span>';\n }).join('');\n } else {\n detailsHtml += '<span class=\"text-muted\">No permissions assigned</span>';\n }\n detailsHtml += '</div>';\n detailsHtml += '<h6 class=\"text-muted\">Attached Policy Names</h6>';\n detailsHtml += '<div class=\"mb-3\">';\n if (user.policy_names && user.policy_names.length > 0) {\n detailsHtml += user.policy_names.map(function(policy) {\n return '<span class=\"badge bg-secondary me-1\">' + escapeHtml(policy) + '</span>';\n }).join('');\n } else {\n detailsHtml += '<span class=\"text-muted\">No policies attached</span>';\n }\n detailsHtml += '</div>';\n detailsHtml += '<h6 class=\"text-muted\">Groups</h6>';\n detailsHtml += '<div class=\"mb-3\">';\n if (user.groups && user.groups.length > 0) {\n detailsHtml += user.groups.map(function(group) {\n return '<span class=\"badge bg-primary me-1\">' + escapeHtml(group) + '</span>';\n }).join('');\n } else {\n detailsHtml += '<span class=\"text-muted\">No groups</span>';\n }\n detailsHtml += '</div>';\n detailsHtml += '<h6 class=\"text-muted\">Access Keys</h6>';\n if (user.access_keys && user.access_keys.length > 0) {\n detailsHtml += '<div class=\"mb-2\">';\n user.access_keys.forEach(function(key) {\n detailsHtml += '<div><code class=\"text-muted\">' + escapeHtml(key.access_key) + '</code></div>';\n });\n detailsHtml += '</div>';\n } else {\n detailsHtml += '<p class=\"text-muted\">No access keys</p>';\n }\n detailsHtml += '</div>';\n detailsHtml += '</div>';\n return detailsHtml;\n }\n\n // Create access keys content\n function createAccessKeysContent(user) {\n if (!user.access_keys || user.access_keys.length === 0) {\n return '<p class=\"text-muted\">No access keys available</p>';\n }\n\n var keysHtml = '<div class=\"table-responsive\">';\n keysHtml += '<table class=\"table table-sm\">';\n keysHtml += '<thead><tr><th>Access Key</th><th>Status</th><th>Actions</th></tr></thead>';\n keysHtml += '<tbody>';\n\n user.access_keys.forEach(function(key) {\n keysHtml += '<tr>';\n keysHtml += '<td><code>' + escapeHtml(key.access_key) + '</code></td>';\n keysHtml += '<td>';\n keysHtml += '<select class=\"form-select form-select-sm access-key-status-select\" data-username=\"' + escapeHtml(user.username) + '\" data-access-key=\"' + escapeHtml(key.access_key) + '\" style=\"width: 110px;\">';\n keysHtml += '<option value=\"' + STATUS_ACTIVE + '\" ' + (key.status === STATUS_ACTIVE || !key.status ? 'selected' : '') + '>' + STATUS_ACTIVE + '</option>';\n keysHtml += '<option value=\"' + STATUS_INACTIVE + '\" ' + (key.status === STATUS_INACTIVE ? 'selected' : '') + '>' + STATUS_INACTIVE + '</option>';\n keysHtml += '</select>';\n keysHtml += '</td>';\n keysHtml += '<td>';\n // Add \"View Secret\" button with data attributes\n keysHtml += '<button class=\"btn btn-outline-secondary btn-sm me-2 view-secret-btn\" data-access-key=\"' + escapeHtml(key.access_key) + '\" data-secret-key=\"' + escapeHtml(key.secret_key) + '\">';\n keysHtml += '<i class=\"bi bi-eye\"></i> View Secret';\n keysHtml += '</button>';\n // Delete button\n keysHtml += '<button class=\"btn btn-outline-danger btn-sm delete-access-key-btn\" data-username=\"' + escapeHtml(user.username) + '\" data-access-key=\"' + escapeHtml(key.access_key) + '\">';\n keysHtml += '<i class=\"bi bi-trash\"></i> Delete';\n keysHtml += '</button>';\n keysHtml += '</td>';\n keysHtml += '</tr>';\n });\n\n keysHtml += '</tbody>';\n keysHtml += '</table>';\n keysHtml += '</div>';\n\n // Add delegated event listener for view secret buttons\n setTimeout(() => {\n document.querySelectorAll('.view-secret-btn').forEach(btn => {\n btn.addEventListener('click', function() {\n const accessKey = this.getAttribute('data-access-key');\n const secretKey = this.getAttribute('data-secret-key');\n showSecretKey(accessKey, secretKey);\n });\n });\n }, 100);\n\n return keysHtml;\n }\n\n // Refresh access keys list content\n async function refreshAccessKeysList(username) {\n try {\n const encodedUsername = encodeURIComponent(username);\n const response = await fetch(basePath(`/api/users/${encodedUsername}`));\n if (response.ok) {\n const user = await response.json();\n document.getElementById('accessKeysContent').innerHTML = createAccessKeysContent(user);\n }\n } catch (error) {\n console.error('Error refreshing access keys:', error);\n }\n }\n\n // Update access key status\n async function updateAccessKeyStatus(username, accessKey, status) {\n try {\n const response = await fetch(basePath(`/api/users/${encodeURIComponent(username)}/access-keys/${encodeURIComponent(accessKey)}/status`), {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ status: status })\n });\n\n if (response.ok) {\n showSuccessMessage('Access key status updated successfully');\n // Refresh access keys display without toggling modal\n refreshAccessKeysList(username);\n } else {\n const error = await response.json();\n showAlert('Failed to update access key status: ' + (error.error || 'Unknown error'), 'error');\n refreshAccessKeysList(username);\n }\n } catch (error) {\n console.error('Error updating access key status:', error);\n showAlert('Failed to update access key status: ' + error.message, 'error');\n refreshAccessKeysList(username);\n }\n }\n\n // Reset and hide the create key form\n function resetCreateKeyForm() {\n document.getElementById('createKeyForm').style.display = 'none';\n document.getElementById('newAccessKeyInput').value = '';\n document.getElementById('newSecretKeyInput').value = '';\n document.getElementById('newSecretKeyInput').type = 'password';\n document.getElementById('secretKeyToggleIcon').className = 'bi bi-eye';\n }\n\n // Toggle create key form visibility\n function toggleCreateKeyForm() {\n const form = document.getElementById('createKeyForm');\n if (form.style.display === 'none') {\n form.style.display = 'block';\n } else {\n resetCreateKeyForm();\n }\n }\n\n // Toggle secret key input visibility\n function toggleSecretKeyVisibility() {\n const input = document.getElementById('newSecretKeyInput');\n const icon = document.getElementById('secretKeyToggleIcon');\n if (input.type === 'password') {\n input.type = 'text';\n icon.className = 'bi bi-eye-slash';\n } else {\n input.type = 'password';\n icon.className = 'bi bi-eye';\n }\n }\n\n // Reset form when modal is dismissed\n document.getElementById('accessKeysModal').addEventListener('hidden.bs.modal', resetCreateKeyForm);\n\n // Create new access key\n var isCreatingKey = false;\n async function createAccessKey() {\n if (isCreatingKey) return;\n\n const username = document.getElementById('accessKeysUsername').textContent;\n const accessKeyInput = document.getElementById('newAccessKeyInput');\n const secretKeyInput = document.getElementById('newSecretKeyInput');\n if ((accessKeyInput.value.trim() && !accessKeyInput.reportValidity()) ||\n (secretKeyInput.value.trim() && !secretKeyInput.reportValidity())) {\n return;\n }\n const accessKey = accessKeyInput.value.trim();\n const secretKey = secretKeyInput.value.trim();\n\n const body = {};\n if (accessKey) body.access_key = accessKey;\n if (secretKey) body.secret_key = secretKey;\n\n isCreatingKey = true;\n const createBtn = document.querySelector('#createKeyForm .btn-primary');\n const cancelBtn = document.querySelector('#createKeyForm .btn-secondary');\n if (createBtn) createBtn.disabled = true;\n if (cancelBtn) cancelBtn.disabled = true;\n\n try {\n const encodedUsername = encodeURIComponent(username);\n const response = await fetch(basePath(`/api/users/${encodedUsername}/access-keys`), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body)\n });\n\n if (response.ok) {\n const result = await response.json();\n\n // Show the new access key details\n if (result.access_key) {\n showNewAccessKeyModal(result.access_key);\n }\n\n showSuccessMessage('Access key created successfully');\n resetCreateKeyForm();\n\n // Refresh access keys display\n refreshAccessKeysList(username);\n } else {\n const error = await response.json();\n showAlert('Failed to create access key: ' + (error.error || 'Unknown error'), 'error');\n }\n } catch (error) {\n console.error('Error creating access key:', error);\n showAlert('Failed to create access key: ' + error.message, 'error');\n } finally {\n isCreatingKey = false;\n if (createBtn) createBtn.disabled = false;\n if (cancelBtn) cancelBtn.disabled = false;\n }\n }\n\n // Delete access key\n async function deleteAccessKey(username, accessKey) {\n showDeleteConfirm(accessKey, async function() {\n try {\n const encodedUsername = encodeURIComponent(username);\n const encodedAccessKey = encodeURIComponent(accessKey);\n const response = await fetch(basePath(`/api/users/${encodedUsername}/access-keys/${encodedAccessKey}`), {\n method: 'DELETE'\n });\n\n if (response.ok) {\n showSuccessMessage('Access key deleted successfully');\n\n // Refresh access keys display\n refreshAccessKeysList(username);\n } else {\n const error = await response.json();\n showErrorMessage('Failed to delete access key: ' + (error.error || 'Unknown error'));\n }\n } catch (error) {\n console.error('Error deleting access key:', error);\n showErrorMessage('Failed to delete access key: ' + error.message);\n }\n }, 'Are you sure you want to delete this access key?');\n }\n\n\n // Utility functions\n function showSuccessMessage(message) {\n // Simple implementation - could be enhanced with toast notifications\n alert('Success: ' + message);\n }\n\n function showErrorMessage(message) {\n showAlert(message, 'error');\n }\n\n function escapeHtml(text) {\n if (!text) return '';\n const div = document.createElement('div');\n div.textContent = text;\n return div.innerHTML;\n }\n </script>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</div><div class=\"mb-3\"><label for=\"email\" class=\"form-label\">Email</label> <input type=\"email\" class=\"form-control\" id=\"email\" name=\"email\"></div><div class=\"mb-3\"><label for=\"actions\" class=\"form-label\">Permissions</label> <select multiple class=\"form-control\" id=\"actions\" name=\"actions\" size=\"10\"><option value=\"Admin\">Admin (Full Access)</option> <option value=\"Read\">Read</option> <option value=\"Write\">Write</option> <option value=\"List\">List</option> <option value=\"Tagging\">Tagging</option> <option value=\"ReadAcp\" title=\"Needed for GET ?acl on buckets and objects\">Read ACL (ReadAcp)</option> <option value=\"WriteAcp\" title=\"Needed for PUT ?acl and for uploads that send x-amz-acl or x-amz-grant-* headers\">Write ACL (WriteAcp)</option> <optgroup label=\"Object Lock Permissions\"><option value=\"BypassGovernanceRetention\">Bypass Governance Retention</option> <option value=\"GetObjectRetention\">Get Object Retention</option> <option value=\"PutObjectRetention\">Put Object Retention</option> <option value=\"GetObjectLegalHold\">Get Object Legal Hold</option> <option value=\"PutObjectLegalHold\">Put Object Legal Hold</option> <option value=\"GetBucketObjectLockConfiguration\">Get Bucket Object Lock Configuration</option> <option value=\"PutBucketObjectLockConfiguration\">Put Bucket Object Lock Configuration</option></optgroup> <optgroup label=\"Bucket Policy Permissions\"><option value=\"PutBucketPolicy\">Put Bucket Policy</option> <option value=\"DeleteBucketPolicy\">Delete Bucket Policy</option></optgroup> <optgroup label=\"Bucket Configuration Permissions\"><option value=\"PutBucketCors\">Put Bucket CORS</option> <option value=\"DeleteBucketCors\">Delete Bucket CORS</option> <option value=\"PutBucketVersioning\">Put Bucket Versioning</option></optgroup> <optgroup label=\"S3 Tables Permissions\"><option value=\"S3TablesAdmin\">S3 Tables Admin (Full Access)</option> <option value=\"CreateTableBucket\">Create Table Bucket</option> <option value=\"GetTableBucket\">Get Table Bucket</option> <option value=\"ListTableBuckets\">List Table Buckets</option> <option value=\"DeleteTableBucket\">Delete Table Bucket</option> <option value=\"PutTableBucketPolicy\">Put Table Bucket Policy</option> <option value=\"GetTableBucketPolicy\">Get Table Bucket Policy</option> <option value=\"DeleteTableBucketPolicy\">Delete Table Bucket Policy</option> <option value=\"CreateNamespace\">Create Namespace</option> <option value=\"GetNamespace\">Get Namespace</option> <option value=\"ListNamespaces\">List Namespaces</option> <option value=\"DeleteNamespace\">Delete Namespace</option> <option value=\"CreateTable\">Create Table</option> <option value=\"GetTable\">Get Table</option> <option value=\"ListTables\">List Tables</option> <option value=\"DeleteTable\">Delete Table</option> <option value=\"PutTablePolicy\">Put Table Policy</option> <option value=\"GetTablePolicy\">Get Table Policy</option> <option value=\"DeleteTablePolicy\">Delete Table Policy</option> <option value=\"TagResource\">Tag Resource</option> <option value=\"ListTagsForResource\">List Tags</option> <option value=\"UntagResource\">Untag Resource</option></optgroup></select> <small class=\"form-text text-muted\">Hold Ctrl/Cmd to select multiple permissions</small></div><div class=\"mb-3\"><label class=\"form-label\">Bucket Scope</label> <small class=\"form-text text-muted d-block mb-2\">Apply selected permissions to specific buckets or all buckets</small><div class=\"form-check mb-2\"><input class=\"form-check-input\" type=\"radio\" name=\"bucketScope\" id=\"allBuckets\" value=\"all\" checked onchange=\"toggleBucketList()\"> <label class=\"form-check-label\" for=\"allBuckets\">All Buckets</label></div><div class=\"form-check mb-2\"><input class=\"form-check-input\" type=\"radio\" name=\"bucketScope\" id=\"specificBuckets\" value=\"specific\" onchange=\"toggleBucketList()\"> <label class=\"form-check-label\" for=\"specificBuckets\">Specific Buckets</label></div><div id=\"bucketSelectionList\" class=\"mt-2\" style=\"display: none;\"><select multiple class=\"form-select\" id=\"selectedBuckets\" size=\"5\"><!-- Options loaded dynamically --></select> <small class=\"form-text text-muted\">Hold Ctrl/Cmd to select multiple buckets</small></div></div><div class=\"mb-3\"><label for=\"policies\" class=\"form-label\">Attached Policies</label> <select multiple class=\"form-control\" id=\"policies\" name=\"policies\" size=\"5\"><!-- Options loaded dynamically --></select> <small class=\"form-text text-muted\">Hold Ctrl/Cmd to select multiple policies</small></div><div class=\"mb-3 form-check\"><input type=\"checkbox\" class=\"form-check-input\" id=\"generateKey\" name=\"generateKey\" checked> <label class=\"form-check-label\" for=\"generateKey\">Generate access key automatically</label></div></form></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-primary\" onclick=\"handleCreateUser()\">Create User</button></div></div></div></div><!-- Edit User Modal --><div class=\"modal fade\" id=\"editUserModal\" tabindex=\"-1\" role=\"dialog\"><div class=\"modal-dialog\" role=\"document\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\"><i class=\"bi bi-person-gear me-2\"></i>Edit User</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\"></button></div><div class=\"modal-body\"><form id=\"editUserForm\"><input type=\"hidden\" id=\"editUsername\" name=\"username\"><div class=\"mb-3\"><label for=\"editEmail\" class=\"form-label\">Email</label> <input type=\"email\" class=\"form-control\" id=\"editEmail\" name=\"email\"></div><div class=\"mb-3\"><label for=\"editActions\" class=\"form-label\">Permissions</label> <select multiple class=\"form-control\" id=\"editActions\" name=\"actions\" size=\"10\"><option value=\"Admin\">Admin (Full Access)</option> <option value=\"Read\">Read</option> <option value=\"Write\">Write</option> <option value=\"List\">List</option> <option value=\"Tagging\">Tagging</option> <option value=\"ReadAcp\" title=\"Needed for GET ?acl on buckets and objects\">Read ACL (ReadAcp)</option> <option value=\"WriteAcp\" title=\"Needed for PUT ?acl and for uploads that send x-amz-acl or x-amz-grant-* headers\">Write ACL (WriteAcp)</option> <optgroup label=\"Object Lock Permissions\"><option value=\"BypassGovernanceRetention\">Bypass Governance Retention</option> <option value=\"GetObjectRetention\">Get Object Retention</option> <option value=\"PutObjectRetention\">Put Object Retention</option> <option value=\"GetObjectLegalHold\">Get Object Legal Hold</option> <option value=\"PutObjectLegalHold\">Put Object Legal Hold</option> <option value=\"GetBucketObjectLockConfiguration\">Get Bucket Object Lock Configuration</option> <option value=\"PutBucketObjectLockConfiguration\">Put Bucket Object Lock Configuration</option></optgroup> <optgroup label=\"Bucket Policy Permissions\"><option value=\"PutBucketPolicy\">Put Bucket Policy</option> <option value=\"DeleteBucketPolicy\">Delete Bucket Policy</option></optgroup> <optgroup label=\"Bucket Configuration Permissions\"><option value=\"PutBucketCors\">Put Bucket CORS</option> <option value=\"DeleteBucketCors\">Delete Bucket CORS</option> <option value=\"PutBucketVersioning\">Put Bucket Versioning</option></optgroup> <optgroup label=\"S3 Tables Permissions\"><option value=\"S3TablesAdmin\">S3 Tables Admin (Full Access)</option> <option value=\"CreateTableBucket\">Create Table Bucket</option> <option value=\"GetTableBucket\">Get Table Bucket</option> <option value=\"ListTableBuckets\">List Table Buckets</option> <option value=\"DeleteTableBucket\">Delete Table Bucket</option> <option value=\"PutTableBucketPolicy\">Put Table Bucket Policy</option> <option value=\"GetTableBucketPolicy\">Get Table Bucket Policy</option> <option value=\"DeleteTableBucketPolicy\">Delete Table Bucket Policy</option> <option value=\"CreateNamespace\">Create Namespace</option> <option value=\"GetNamespace\">Get Namespace</option> <option value=\"ListNamespaces\">List Namespaces</option> <option value=\"DeleteNamespace\">Delete Namespace</option> <option value=\"CreateTable\">Create Table</option> <option value=\"GetTable\">Get Table</option> <option value=\"ListTables\">List Tables</option> <option value=\"DeleteTable\">Delete Table</option> <option value=\"PutTablePolicy\">Put Table Policy</option> <option value=\"GetTablePolicy\">Get Table Policy</option> <option value=\"DeleteTablePolicy\">Delete Table Policy</option> <option value=\"TagResource\">Tag Resource</option> <option value=\"ListTagsForResource\">List Tags</option> <option value=\"UntagResource\">Untag Resource</option></optgroup></select></div><div class=\"mb-3\"><label class=\"form-label\">Bucket Scope</label> <small class=\"form-text text-muted d-block mb-2\">Apply selected permissions to specific buckets or all buckets</small><div class=\"form-check mb-2\"><input class=\"form-check-input\" type=\"radio\" name=\"editBucketScope\" id=\"editAllBuckets\" value=\"all\" checked onchange=\"toggleBucketList('edit')\"> <label class=\"form-check-label\" for=\"editAllBuckets\">All Buckets</label></div><div class=\"form-check mb-2\"><input class=\"form-check-input\" type=\"radio\" name=\"editBucketScope\" id=\"editSpecificBuckets\" value=\"specific\" onchange=\"toggleBucketList('edit')\"> <label class=\"form-check-label\" for=\"editSpecificBuckets\">Specific Buckets</label></div><div id=\"editBucketSelectionList\" class=\"mt-2\" style=\"display: none;\"><select multiple class=\"form-select\" id=\"editSelectedBuckets\" size=\"5\"><!-- Options loaded dynamically --></select> <small class=\"form-text text-muted\">Hold Ctrl/Cmd to select multiple buckets</small></div></div><div class=\"mb-3\" id=\"editUnshownActionsGroup\" style=\"display: none;\"><label class=\"form-label\">Other Bucket Permissions</label> <small class=\"form-text text-muted d-block mb-2\">Grants the permission and bucket pickers above cannot show. Uncheck a grant to remove it.</small><div id=\"editUnshownActions\"></div></div><div class=\"mb-3\"><label for=\"editPolicies\" class=\"form-label\">Attached Policies</label> <select multiple class=\"form-control\" id=\"editPolicies\" name=\"policies\" size=\"5\"><!-- Options loaded dynamically --></select></div><div class=\"mb-3\"><label class=\"form-label\">Groups</label><div id=\"editUserGroups\"><!-- Groups loaded dynamically --></div><div class=\"input-group mt-2\"><select class=\"form-select\" id=\"editGroupSelect\"><option value=\"\">Add to group...</option></select> <button class=\"btn btn-outline-primary\" type=\"button\" onclick=\"addUserToGroupFromEdit()\" aria-label=\"Add user to group\" title=\"Add user to group\"><i class=\"bi bi-plus\"></i></button></div></div></form></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-primary\" onclick=\"handleUpdateUser()\">Update User</button></div></div></div></div><!-- User Details Modal --><div class=\"modal fade\" id=\"userDetailsModal\" tabindex=\"-1\" role=\"dialog\"><div class=\"modal-dialog modal-lg\" role=\"document\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\"><i class=\"bi bi-person me-2\"></i>User Details</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\"></button></div><div class=\"modal-body\" id=\"userDetailsContent\"><!-- Content will be loaded dynamically --></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Close</button></div></div></div></div><!-- Access Keys Management Modal --><div class=\"modal fade\" id=\"accessKeysModal\" tabindex=\"-1\" role=\"dialog\"><div class=\"modal-dialog modal-lg\" role=\"document\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\"><i class=\"bi bi-key me-2\"></i>Manage Access Keys</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\"></button></div><div class=\"modal-body\"><div class=\"d-flex justify-content-between align-items-center mb-3\"><h6>Access Keys for <span id=\"accessKeysUsername\"></span></h6><button type=\"button\" class=\"btn btn-primary btn-sm\" onclick=\"toggleCreateKeyForm()\"><i class=\"bi bi-plus me-1\"></i>Create New Key</button></div><div id=\"createKeyForm\" class=\"card mb-3\" style=\"display: none;\"><div class=\"card-body\"><p class=\"text-muted small mb-2\">Leave blank to auto-generate.</p><div class=\"mb-2\"><label for=\"newAccessKeyInput\" class=\"form-label form-label-sm\">Access Key</label> <input type=\"text\" class=\"form-control form-control-sm\" id=\"newAccessKeyInput\" placeholder=\"Auto-generated if empty\" minlength=\"4\" maxlength=\"128\"></div><div class=\"mb-2\"><label for=\"newSecretKeyInput\" class=\"form-label form-label-sm\">Secret Key</label><div class=\"input-group input-group-sm\"><input type=\"password\" class=\"form-control form-control-sm\" id=\"newSecretKeyInput\" placeholder=\"Auto-generated if empty\" minlength=\"8\" maxlength=\"128\"> <button class=\"btn btn-outline-secondary\" type=\"button\" onclick=\"toggleSecretKeyVisibility()\" aria-label=\"Toggle secret key visibility\"><i class=\"bi bi-eye\" id=\"secretKeyToggleIcon\"></i></button></div></div><div class=\"d-flex gap-2\"><button type=\"button\" class=\"btn btn-primary btn-sm\" onclick=\"createAccessKey()\">Create</button> <button type=\"button\" class=\"btn btn-secondary btn-sm\" onclick=\"toggleCreateKeyForm()\">Cancel</button></div></div></div><div id=\"accessKeysContent\"><!-- Content will be loaded dynamically --></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Close</button></div></div></div></div><!-- JavaScript for user management --><script>\n // Access key status constants\n const STATUS_ACTIVE = 'Active';\n const STATUS_INACTIVE = 'Inactive';\n\n // Use basePath() from admin.js for -urlPrefix; it is loaded in the layout footer before DOMContentLoaded fires.\n document.addEventListener('DOMContentLoaded', function() {\n\n // Event delegation for user action buttons\n document.addEventListener('click', function(e) {\n const button = e.target.closest('[data-action]');\n if (!button) return;\n\n const action = button.getAttribute('data-action');\n const username = button.getAttribute('data-username');\n\n switch (action) {\n case 'show-user-details':\n showUserDetails(username);\n break;\n case 'edit-user':\n editUser(username);\n break;\n case 'manage-access-keys':\n manageAccessKeys(username);\n break;\n case 'delete-user':\n deleteUser(username);\n break;\n }\n });\n\n // Event delegation for delete access key buttons\n document.addEventListener('click', function(e) {\n const deleteBtn = e.target.closest('.delete-access-key-btn');\n if (deleteBtn) {\n const username = deleteBtn.getAttribute('data-username');\n const accessKey = deleteBtn.getAttribute('data-access-key');\n deleteAccessKey(username, accessKey);\n }\n });\n\n // Event delegation for access key status changes\n document.addEventListener('change', function(e) {\n const statusSelect = e.target.closest('.access-key-status-select');\n if (statusSelect) {\n const username = statusSelect.getAttribute('data-username');\n const accessKey = statusSelect.getAttribute('data-access-key');\n const newStatus = statusSelect.value;\n updateAccessKeyStatus(username, accessKey, newStatus);\n }\n });\n\n // Load policies for dropdowns\n loadPolicies();\n\n // Load buckets for bucket permissions\n loadBuckets();\n });\n\n // Global variable to store available buckets\n var availableBuckets = [];\n var bucketPermissionCounter = 0;\n const s3TablesPermissions = new Set([\n 'CreateTableBucket',\n 'GetTableBucket',\n 'ListTableBuckets',\n 'DeleteTableBucket',\n 'PutTableBucketPolicy',\n 'GetTableBucketPolicy',\n 'DeleteTableBucketPolicy',\n 'CreateNamespace',\n 'GetNamespace',\n 'ListNamespaces',\n 'DeleteNamespace',\n 'CreateTable',\n 'GetTable',\n 'ListTables',\n 'DeleteTable',\n 'PutTablePolicy',\n 'GetTablePolicy',\n 'DeleteTablePolicy',\n 'TagResource',\n 'ListTagsForResource',\n 'UntagResource'\n ]);\n function isS3TablesPermission(permission) {\n return permission === 'S3TablesAdmin' || s3TablesPermissions.has(permission);\n }\n\n // Load buckets\n async function loadBuckets() {\n try {\n const response = await fetch(basePath('/api/s3/buckets'));\n if (response.ok) {\n const data = await response.json();\n availableBuckets = (data.buckets || []).map(bucket => ({ name: bucket.name, type: 's3' }));\n console.log('Loaded', availableBuckets.length, 'buckets');\n } else {\n console.warn('Failed to load buckets');\n availableBuckets = [];\n }\n } catch (error) {\n console.error('Error loading buckets:', error);\n availableBuckets = [];\n }\n try {\n const response = await fetch(basePath('/api/s3tables/buckets'));\n if (response.ok) {\n const data = await response.json();\n const tableBuckets = (data.buckets || data.tableBuckets || []).map(bucket => ({ name: bucket.name, type: 's3tables' }));\n availableBuckets = availableBuckets.concat(tableBuckets);\n } else {\n console.warn('Failed to load table buckets');\n }\n } catch (error) {\n console.warn('Error loading table buckets:', error);\n }\n // Populate bucket selection dropdowns\n populateBucketSelections();\n }\n\n // Load policies\n async function loadPolicies() {\n try {\n const response = await fetch(basePath('/api/object-store/policies'));\n if (response.ok) {\n const data = await response.json();\n const policies = data.policies || [];\n\n const createSelect = document.getElementById('policies');\n const editSelect = document.getElementById('editPolicies');\n\n // Check if elements exist\n if (!createSelect || !editSelect) {\n console.warn('Policy select elements not found');\n return;\n }\n\n // Clear existing options\n createSelect.innerHTML = '';\n editSelect.innerHTML = '';\n\n if (policies && policies.length > 0) {\n policies.forEach(policy => {\n const option = document.createElement('option');\n option.value = policy.name;\n option.textContent = policy.name;\n createSelect.appendChild(option);\n editSelect.appendChild(option.cloneNode(true));\n });\n } else {\n const emptyOption = document.createElement('option');\n emptyOption.disabled = true;\n emptyOption.textContent = 'No policies available';\n createSelect.appendChild(emptyOption);\n editSelect.appendChild(emptyOption.cloneNode(true));\n }\n } else {\n const error = await response.json().catch(() => ({}));\n showAlert('Failed to load policies: ' + (error.error || 'Unknown error'), 'error');\n }\n } catch (error) {\n console.error('Error loading policies:', error);\n showAlert('Failed to load policies: ' + error.message, 'error');\n }\n }\n\n // Toggle bucket permission fields when Admin checkbox changes\n function toggleBucketPermissionFields(mode) {\n mode = mode || 'create';\n const adminCheckbox = document.getElementById(mode === 'edit' ? 'editBucketAdmin' : 'bucketAdmin');\n const permissionFields = document.getElementById(mode === 'edit' ? 'editBucketPermissionFields' : 'bucketPermissionFields');\n\n if (adminCheckbox && permissionFields) {\n permissionFields.style.display = adminCheckbox.checked ? 'none' : 'block';\n }\n }\n\n // Toggle bucket list visibility when bucket scope changes\n function toggleBucketList(mode) {\n mode = mode || 'create';\n const specificRadio = document.getElementById(mode === 'edit' ? 'editSpecificBuckets' : 'specificBuckets');\n const bucketList = document.getElementById(mode === 'edit' ? 'editBucketSelectionList' : 'bucketSelectionList');\n\n if (specificRadio && bucketList) {\n bucketList.style.display = specificRadio.checked ? 'block' : 'none';\n }\n }\n\n // Toggle anonymous user checkbox\n function toggleAnonymousUser() {\n const checkbox = document.getElementById('anonymousCheck');\n const usernameInput = document.getElementById('username');\n const generateKey = document.getElementById('generateKey');\n if (checkbox.checked) {\n usernameInput.value = 'anonymous';\n usernameInput.readOnly = true;\n generateKey.checked = false;\n generateKey.disabled = true;\n } else {\n usernameInput.value = '';\n usernameInput.readOnly = false;\n generateKey.disabled = false;\n generateKey.checked = true;\n }\n }\n\n // Populate bucket selection dropdowns\n function populateBucketSelections() {\n const createSelect = document.getElementById('selectedBuckets');\n const editSelect = document.getElementById('editSelectedBuckets');\n\n [createSelect, editSelect].forEach(select => {\n if (select) {\n select.innerHTML = '';\n availableBuckets.forEach(bucket => {\n const option = document.createElement('option');\n option.value = bucket.type + ':' + bucket.name;\n option.textContent = bucket.type === 's3tables' ? `Table: ${bucket.name}` : bucket.name;\n select.appendChild(option);\n });\n }\n });\n }\n\n // Parse bucket permissions from actions array for new UI\n function parseBucketPermissions(actions) {\n const result = {\n isAdmin: false,\n permissions: [],\n applyToAll: false,\n specificBuckets: [],\n unshownActions: []\n };\n\n // Separate bucket-scoped from global actions\n const bucketActions = [];\n const globalBucketPerms = [];\n\n actions.forEach(action => {\n if (action.startsWith('s3tables:')) {\n const actionValue = action.slice('s3tables:'.length);\n if (actionValue === '*') {\n globalBucketPerms.push({ permission: 'S3TablesAdmin', action: action });\n return;\n }\n const parts = actionValue.split(':');\n const perm = parts[0];\n const bucket = parts.length > 1 ? parts.slice(1).join(':') : '';\n if (bucket) {\n bucketActions.push({ permission: perm, bucketId: 's3tables:' + bucket, action: action });\n } else {\n globalBucketPerms.push({ permission: perm, action: action });\n }\n } else if (action.includes(':')) {\n const parts = action.split(':');\n const perm = parts[0];\n const bucket = parts.slice(1).join(':');\n bucketActions.push({ permission: perm, bucketId: 's3:' + bucket, action: action });\n } else {\n globalBucketPerms.push({ permission: action, action: action });\n }\n });\n\n const listed = globalBucketPerms.filter(gp => hasPickerOption('editActions', gp.permission));\n const unlisted = globalBucketPerms.filter(gp => !listed.includes(gp)).map(gp => gp.action);\n\n if (actions.includes('Admin')) {\n result.isAdmin = true;\n result.permissions = listed.map(gp => gp.permission);\n result.unshownActions = unlisted.concat(bucketActions.map(ba => ba.action));\n return result;\n }\n\n // If we have global bucket permissions (no colon), they apply to all buckets\n if (globalBucketPerms.length > 0) {\n result.permissions = listed.map(gp => gp.permission);\n result.applyToAll = true;\n result.unshownActions = unlisted.concat(bucketActions.map(ba => ba.action));\n } else if (bucketActions.length > 0) {\n // The form saves every permission on every selected bucket, so it can\n // show the grants only when they cover that full product with listed options.\n const perms = [...new Set(bucketActions.map(ba => ba.permission))];\n const buckets = [...new Set(bucketActions.map(ba => ba.bucketId))];\n const pairs = new Set(bucketActions.map(ba => JSON.stringify([ba.permission, ba.bucketId])));\n const allListed = perms.every(perm => hasPickerOption('editActions', perm)) &&\n buckets.every(bucketId => hasPickerOption('editSelectedBuckets', bucketId));\n\n if (allListed && pairs.size === perms.length * buckets.length) {\n result.permissions = perms;\n result.specificBuckets = buckets;\n } else {\n result.unshownActions = bucketActions.map(ba => ba.action);\n }\n }\n\n return result;\n }\n\n function hasPickerOption(selectId, value) {\n const select = document.getElementById(selectId);\n return !!select && Array.from(select.options).some(option => option.value === value);\n }\n\n function parseBucketOptionValue(value) {\n if (value.startsWith('s3tables:')) {\n return { type: 's3tables', name: value.slice('s3tables:'.length) };\n }\n if (value.startsWith('s3:')) {\n return { type: 's3', name: value.slice('s3:'.length) };\n }\n return { type: 's3', name: value };\n }\n\n function renderUnshownActions(actions) {\n const container = document.getElementById('editUnshownActions');\n container.replaceChildren();\n actions.forEach((action, i) => {\n const wrapper = document.createElement('div');\n wrapper.className = 'form-check';\n const input = document.createElement('input');\n input.className = 'form-check-input';\n input.type = 'checkbox';\n input.id = 'editUnshownAction' + i;\n input.value = action;\n input.checked = true;\n const label = document.createElement('label');\n label.className = 'form-check-label';\n label.htmlFor = input.id;\n label.textContent = action;\n wrapper.append(input, label);\n container.appendChild(wrapper);\n });\n document.getElementById('editUnshownActionsGroup').style.display = actions.length > 0 ? '' : 'none';\n }\n\n function selectedUnshownActions() {\n return Array.from(document.querySelectorAll('#editUnshownActions input:checked')).map(input => input.value);\n }\n\n // Build bucket permission action strings using original permissions dropdown\n /**\n * Builds bucket permission strings based on selected permissions and bucket scope.\n * @param {string} mode - The operation mode, either 'create' or 'edit'.\n * @returns {string[]|null} Array of permission strings (e.g., ['Read:bucket1']) or null if validation fails (specific scope selected but no buckets).\n */\n function buildBucketPermissions(mode) {\n mode = mode || 'create';\n const selectId = mode === 'edit' ? 'editActions' : 'actions';\n const permSelect = document.getElementById(selectId);\n\n if (!permSelect) return [];\n\n // Get selected permissions from the original multi-select\n const selectedPerms = Array.from(permSelect.selectedOptions).map(opt => opt.value);\n\n const hasAdmin = selectedPerms.includes('Admin');\n const hasS3TablesAdmin = selectedPerms.includes('S3TablesAdmin');\n\n if (selectedPerms.length === 0) {\n return [];\n }\n\n // Check if applying to all buckets or specific ones\n // Use querySelector to find the checked radio button by name group\n const scopeName = mode === 'edit' ? 'editBucketScope' : 'bucketScope';\n\n // Try multiple methods to find the checked radio\n let checkedRadio = document.querySelector(`input[name=\"${scopeName}\"]:checked`);\n\n // Fallback: check both radio buttons explicitly\n if (!checkedRadio) {\n const allBucketsId = mode === 'edit' ? 'editAllBuckets' : 'allBuckets';\n const specificBucketsId = mode === 'edit' ? 'editSpecificBuckets' : 'specificBuckets';\n\n const allBucketsRadio = document.getElementById(allBucketsId);\n const specificBucketsRadio = document.getElementById(specificBucketsId);\n\n if (specificBucketsRadio && specificBucketsRadio.checked) {\n checkedRadio = specificBucketsRadio;\n } else if (allBucketsRadio && allBucketsRadio.checked) {\n checkedRadio = allBucketsRadio;\n }\n }\n\n // Default to 'all' if nothing is checked (shouldn't happen) or if 'all' is checked\n const applyToAll = !checkedRadio || checkedRadio.value === 'all';\n\n if (applyToAll) {\n // Return global permissions (no bucket specification)\n const actions = [];\n if (hasAdmin) {\n actions.push('Admin');\n }\n if (hasS3TablesAdmin) {\n actions.push('s3tables:*');\n }\n selectedPerms.forEach(perm => {\n if (perm === 'Admin' || perm === 'S3TablesAdmin') {\n return;\n }\n if (isS3TablesPermission(perm)) {\n actions.push('s3tables:' + perm);\n } else {\n actions.push(perm);\n }\n });\n return actions;\n } else {\n // Get selected specific buckets\n const bucketSelect = document.getElementById(mode === 'edit' ? 'editSelectedBuckets' : 'selectedBuckets');\n if (!bucketSelect) return null;\n\n const selectedBuckets = [...new Set(Array.from(bucketSelect.selectedOptions).map(opt => opt.value))];\n\n // Return null to signal validation failure if no buckets selected\n if (selectedBuckets.length === 0) {\n return null;\n }\n\n // Build bucket-scoped permissions\n const actions = [];\n if (hasAdmin) {\n selectedBuckets.forEach((bucket) => {\n const bucketInfo = parseBucketOptionValue(bucket);\n actions.push(\"Admin:\" + bucketInfo.name);\n });\n }\n if (hasS3TablesAdmin) {\n actions.push('s3tables:*');\n }\n selectedPerms.forEach(perm => {\n if (perm === 'Admin' || perm === 'S3TablesAdmin') {\n return;\n }\n selectedBuckets.forEach(bucket => {\n const bucketInfo = parseBucketOptionValue(bucket);\n if (isS3TablesPermission(perm)) {\n if (bucketInfo.type === 's3tables') {\n actions.push('s3tables:' + perm + ':' + bucketInfo.name);\n }\n } else if (bucketInfo.type === 's3') {\n actions.push(perm + ':' + bucketInfo.name);\n }\n });\n });\n\n return [...new Set(actions)];\n }\n }\n\n // Show user details modal\n async function showUserDetails(username) {\n try {\n const encodedUsername = encodeURIComponent(username);\n const response = await fetch(basePath(`/api/users/${encodedUsername}`));\n if (response.ok) {\n const user = await response.json();\n document.getElementById('userDetailsContent').innerHTML = createUserDetailsContent(user);\n const modal = new bootstrap.Modal(document.getElementById('userDetailsModal'));\n modal.show();\n } else {\n showAlert('Failed to load user details', 'error');\n }\n } catch (error) {\n console.error('Error loading user details:', error);\n showAlert('Failed to load user details', 'error');\n }\n }\n\n // Edit user function\n async function editUser(username) {\n try {\n const encodedUsername = encodeURIComponent(username);\n const response = await fetch(basePath(`/api/users/${encodedUsername}`));\n if (response.ok) {\n const user = await response.json();\n\n // Populate edit form\n renderUnshownActions([]);\n document.getElementById('editAllBuckets').checked = true;\n Array.from(document.getElementById('editSelectedBuckets').options).forEach(option => {\n option.selected = false;\n });\n toggleBucketList('edit');\n document.getElementById('editUsername').value = username;\n document.getElementById('editEmail').value = user.email || '';\n\n // Set selected actions\n const actionsSelect = document.getElementById('editActions');\n Array.from(actionsSelect.options).forEach(option => {\n option.selected = user.actions && user.actions.includes(option.value);\n });\n\n // Set selected policies\n const policiesSelect = document.getElementById('editPolicies');\n if (policiesSelect) {\n Array.from(policiesSelect.options).forEach(option => {\n option.selected = user.policy_names && user.policy_names.includes(option.value);\n });\n }\n\n // Populate bucket permissions using original permissions dropdown\n if (user.actions && user.actions.length > 0) {\n const bucketPerms = parseBucketPermissions(user.actions);\n renderUnshownActions(bucketPerms.unshownActions);\n\n // Set permissions in the original multi-select\n const actionsSelect = document.getElementById('editActions');\n if (actionsSelect) {\n Array.from(actionsSelect.options).forEach(option => {\n if (bucketPerms.permissions.includes(option.value)) {\n option.selected = true;\n }\n });\n }\n\n // Set bucket scope (all or specific)\n const allBucketsRadio = document.getElementById('editAllBuckets');\n const specificBucketsRadio = document.getElementById('editSpecificBuckets');\n\n if (!bucketPerms.isAdmin) {\n if (bucketPerms.applyToAll) {\n if (allBucketsRadio) allBucketsRadio.checked = true;\n } else if (bucketPerms.specificBuckets.length > 0) {\n if (specificBucketsRadio) specificBucketsRadio.checked = true;\n toggleBucketList('edit');\n\n // Select specific buckets\n const bucketSelect = document.getElementById('editSelectedBuckets');\n if (bucketSelect) {\n Array.from(bucketSelect.options).forEach(option => {\n option.selected = bucketPerms.specificBuckets.includes(option.value);\n });\n }\n }\n }\n }\n\n // Populate groups\n await populateEditUserGroups(username);\n\n // Show modal\n const modal = new bootstrap.Modal(document.getElementById('editUserModal'));\n modal.show();\n } else {\n showAlert('Failed to load user details', 'error');\n }\n } catch (error) {\n console.error('Error loading user:', error);\n showAlert('Failed to load user details', 'error');\n }\n }\n\n // Manage access keys function\n async function manageAccessKeys(username) {\n try {\n const encodedUsername = encodeURIComponent(username);\n const response = await fetch(basePath(`/api/users/${encodedUsername}`));\n if (response.ok) {\n const user = await response.json();\n document.getElementById('accessKeysUsername').textContent = username;\n document.getElementById('accessKeysContent').innerHTML = createAccessKeysContent(user);\n const modal = new bootstrap.Modal(document.getElementById('accessKeysModal'));\n modal.show();\n } else {\n showAlert('Failed to load access keys', 'error');\n }\n } catch (error) {\n console.error('Error loading access keys:', error);\n showAlert('Failed to load access keys', 'error');\n }\n }\n\n // Delete user function\n async function deleteUser(username) {\n showDeleteConfirm(username, async function() {\n try {\n const encodedUsername = encodeURIComponent(username);\n const response = await fetch(basePath(`/api/users/${encodedUsername}`), {\n method: 'DELETE'\n });\n\n if (response.ok) {\n showSuccessMessage('User deleted successfully');\n setTimeout(() => window.location.reload(), 1000);\n } else {\n const error = await response.json();\n showErrorMessage('Failed to delete user: ' + (error.error || 'Unknown error'));\n }\n } catch (error) {\n console.error('Error deleting user:', error);\n showErrorMessage('Failed to delete user: ' + error.message);\n }\n }, 'Are you sure you want to delete this user? This action cannot be undone.');\n }\n\n // Handle create user form submission\n async function handleCreateUser() {\n const form = document.getElementById('createUserForm');\n const formData = new FormData(form);\n\n // Get permissions with bucket scope applied\n const allActions = buildBucketPermissions('create');\n\n if (allActions === null) {\n showAlert('Please select at least one bucket when using specific bucket permissions', 'error');\n return;\n }\n\n if (!allActions || allActions.length === 0) {\n showAlert('At least one permission must be selected', 'error');\n return;\n }\n\n const userData = {\n username: formData.get('username'),\n email: formData.get('email'),\n actions: allActions,\n policy_names: Array.from(document.getElementById('policies').selectedOptions).map(option => option.value),\n generate_key: document.getElementById('generateKey').checked\n };\n\n try {\n const response = await fetch(basePath('/api/users'), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(userData)\n });\n\n if (response.ok) {\n const result = await response.json();\n showSuccessMessage('User created successfully');\n\n // Show the created access key if generated\n if (result.user && result.user.access_key) {\n showNewAccessKeyModal(result.user);\n }\n\n // Close modal and refresh page\n const modal = bootstrap.Modal.getInstance(document.getElementById('createUserModal'));\n modal.hide();\n form.reset();\n document.getElementById('username').readOnly = false;\n document.getElementById('generateKey').disabled = false;\n setTimeout(() => window.location.reload(), 1000);\n } else {\n const error = await response.json();\n showAlert('Failed to create user: ' + (error.error || 'Unknown error'), 'error');\n }\n } catch (error) {\n console.error('Error creating user:', error);\n showAlert('Failed to create user: ' + error.message, 'error');\n }\n }\n\n\n // Populate groups in the edit user modal\n async function populateEditUserGroups(username) {\n const container = document.getElementById('editUserGroups');\n const groupSelect = document.getElementById('editGroupSelect');\n container.innerHTML = '';\n groupSelect.innerHTML = '<option value=\"\">Add to group...</option>';\n\n try {\n // Fetch all groups\n const groupsResp = await fetch(basePath('/api/groups'));\n if (!groupsResp.ok) return;\n const groupsData = await groupsResp.json();\n const allGroups = groupsData.groups || [];\n\n // Fetch user details to get current groups\n const userResp = await fetch(basePath(`/api/users/${encodeURIComponent(username)}`));\n if (!userResp.ok) return;\n const user = await userResp.json();\n const userGroups = user.groups || [];\n\n // Show current group badges with remove button\n if (userGroups.length > 0) {\n userGroups.forEach(function(group) {\n const badge = document.createElement('span');\n badge.className = 'badge bg-primary me-1 mb-1';\n badge.textContent = group + ' ';\n const removeIcon = document.createElement('i');\n removeIcon.className = 'bi bi-x ms-1';\n removeIcon.style.cursor = 'pointer';\n removeIcon.setAttribute('aria-label', 'Remove from group ' + group);\n removeIcon.setAttribute('title', 'Remove from group');\n removeIcon.addEventListener('click', function() {\n removeUserFromGroupInEdit(group);\n });\n badge.appendChild(removeIcon);\n container.appendChild(badge);\n });\n } else {\n container.innerHTML = '<span class=\"text-muted\">No groups</span>';\n }\n\n // Populate dropdown with groups the user is NOT in\n allGroups.forEach(function(g) {\n if (!userGroups.includes(g.name)) {\n const opt = document.createElement('option');\n opt.value = g.name;\n opt.textContent = g.name;\n groupSelect.appendChild(opt);\n }\n });\n } catch (error) {\n console.error('Error loading groups:', error);\n }\n }\n\n // Add user to group from edit modal\n async function addUserToGroupFromEdit() {\n const username = document.getElementById('editUsername').value;\n const groupSelect = document.getElementById('editGroupSelect');\n const groupName = groupSelect.value;\n if (!groupName) return;\n\n try {\n const response = await fetch(basePath(`/api/groups/${encodeURIComponent(groupName)}/members`), {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ username: username })\n });\n if (response.ok) {\n await populateEditUserGroups(username);\n } else {\n const error = await response.json();\n showAlert('Failed to add to group: ' + (error.error || 'Unknown error'), 'error');\n }\n } catch (error) {\n showAlert('Failed to add to group: ' + error.message, 'error');\n }\n }\n\n // Remove user from group in edit modal\n async function removeUserFromGroupInEdit(groupName) {\n const username = document.getElementById('editUsername').value;\n try {\n const response = await fetch(basePath(`/api/groups/${encodeURIComponent(groupName)}/members/${encodeURIComponent(username)}`), {\n method: 'DELETE'\n });\n if (response.ok) {\n await populateEditUserGroups(username);\n } else {\n const error = await response.json();\n showAlert('Failed to remove from group: ' + (error.error || 'Unknown error'), 'error');\n }\n } catch (error) {\n showAlert('Failed to remove from group: ' + error.message, 'error');\n }\n }\n\n // Handle update user form submission\n async function handleUpdateUser() {\n const username = document.getElementById('editUsername').value;\n if (!username) {\n showAlert('Username is required', 'error');\n return;\n }\n\n // Get permissions with bucket scope applied\n const allActions = buildBucketPermissions('edit');\n\n // Check for null (validation failure from buildBucketPermissions)\n if (allActions === null) {\n showAlert('Please select at least one bucket when using specific bucket permissions', 'error');\n return;\n }\n\n const actions = [...new Set([...allActions, ...selectedUnshownActions()])];\n if (actions.length === 0) {\n showAlert('At least one permission must be selected', 'error');\n return;\n }\n\n const userData = {\n email: document.getElementById('editEmail').value,\n actions: actions,\n policy_names: Array.from(document.getElementById('editPolicies').selectedOptions).map(option => option.value)\n };\n\n try {\n const encodedUsername = encodeURIComponent(username);\n const response = await fetch(basePath(`/api/users/${encodedUsername}`), {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(userData)\n });\n\n if (response.ok) {\n showSuccessMessage('User updated successfully');\n\n // Close modal and refresh page\n const modal = bootstrap.Modal.getInstance(document.getElementById('editUserModal'));\n modal.hide();\n setTimeout(() => window.location.reload(), 1000);\n } else {\n const error = await response.json();\n showAlert('Failed to update user: ' + (error.error || 'Unknown error'), 'error');\n }\n } catch (error) {\n console.error('Error updating user:', error);\n showAlert('Failed to update user: ' + error.message, 'error');\n }\n }\n\n\n // Create user details content\n function createUserDetailsContent(user) {\n var detailsHtml = '<div class=\"row\">';\n detailsHtml += '<div class=\"col-md-6\">';\n detailsHtml += '<h6 class=\"text-muted\">Basic Information</h6>';\n detailsHtml += '<table class=\"table table-sm\">';\n detailsHtml += '<tr><td><strong>Username:</strong></td><td>' + escapeHtml(user.username) + '</td></tr>';\n detailsHtml += '<tr><td><strong>Email:</strong></td><td>' + escapeHtml(user.email || 'Not set') + '</td></tr>';\n detailsHtml += '</table>';\n detailsHtml += '</div>';\n detailsHtml += '<div class=\"col-md-6\">';\n detailsHtml += '<h6 class=\"text-muted\">Permissions</h6>';\n detailsHtml += '<div class=\"mb-3\">';\n if (user.actions && user.actions.length > 0) {\n detailsHtml += user.actions.map(function(action) {\n return '<span class=\"badge bg-info me-1\">' + escapeHtml(action) + '</span>';\n }).join('');\n } else {\n detailsHtml += '<span class=\"text-muted\">No permissions assigned</span>';\n }\n detailsHtml += '</div>';\n detailsHtml += '<h6 class=\"text-muted\">Attached Policy Names</h6>';\n detailsHtml += '<div class=\"mb-3\">';\n if (user.policy_names && user.policy_names.length > 0) {\n detailsHtml += user.policy_names.map(function(policy) {\n return '<span class=\"badge bg-secondary me-1\">' + escapeHtml(policy) + '</span>';\n }).join('');\n } else {\n detailsHtml += '<span class=\"text-muted\">No policies attached</span>';\n }\n detailsHtml += '</div>';\n detailsHtml += '<h6 class=\"text-muted\">Groups</h6>';\n detailsHtml += '<div class=\"mb-3\">';\n if (user.groups && user.groups.length > 0) {\n detailsHtml += user.groups.map(function(group) {\n return '<span class=\"badge bg-primary me-1\">' + escapeHtml(group) + '</span>';\n }).join('');\n } else {\n detailsHtml += '<span class=\"text-muted\">No groups</span>';\n }\n detailsHtml += '</div>';\n detailsHtml += '<h6 class=\"text-muted\">Access Keys</h6>';\n if (user.access_keys && user.access_keys.length > 0) {\n detailsHtml += '<div class=\"mb-2\">';\n user.access_keys.forEach(function(key) {\n detailsHtml += '<div><code class=\"text-muted\">' + escapeHtml(key.access_key) + '</code></div>';\n });\n detailsHtml += '</div>';\n } else {\n detailsHtml += '<p class=\"text-muted\">No access keys</p>';\n }\n detailsHtml += '</div>';\n detailsHtml += '</div>';\n return detailsHtml;\n }\n\n // Create access keys content\n function createAccessKeysContent(user) {\n if (!user.access_keys || user.access_keys.length === 0) {\n return '<p class=\"text-muted\">No access keys available</p>';\n }\n\n var keysHtml = '<div class=\"table-responsive\">';\n keysHtml += '<table class=\"table table-sm\">';\n keysHtml += '<thead><tr><th>Access Key</th><th>Status</th><th>Actions</th></tr></thead>';\n keysHtml += '<tbody>';\n\n user.access_keys.forEach(function(key) {\n keysHtml += '<tr>';\n keysHtml += '<td><code>' + escapeHtml(key.access_key) + '</code></td>';\n keysHtml += '<td>';\n keysHtml += '<select class=\"form-select form-select-sm access-key-status-select\" data-username=\"' + escapeHtml(user.username) + '\" data-access-key=\"' + escapeHtml(key.access_key) + '\" style=\"width: 110px;\">';\n keysHtml += '<option value=\"' + STATUS_ACTIVE + '\" ' + (key.status === STATUS_ACTIVE || !key.status ? 'selected' : '') + '>' + STATUS_ACTIVE + '</option>';\n keysHtml += '<option value=\"' + STATUS_INACTIVE + '\" ' + (key.status === STATUS_INACTIVE ? 'selected' : '') + '>' + STATUS_INACTIVE + '</option>';\n keysHtml += '</select>';\n keysHtml += '</td>';\n keysHtml += '<td>';\n // Add \"View Secret\" button with data attributes\n keysHtml += '<button class=\"btn btn-outline-secondary btn-sm me-2 view-secret-btn\" data-access-key=\"' + escapeHtml(key.access_key) + '\" data-secret-key=\"' + escapeHtml(key.secret_key) + '\">';\n keysHtml += '<i class=\"bi bi-eye\"></i> View Secret';\n keysHtml += '</button>';\n // Delete button\n keysHtml += '<button class=\"btn btn-outline-danger btn-sm delete-access-key-btn\" data-username=\"' + escapeHtml(user.username) + '\" data-access-key=\"' + escapeHtml(key.access_key) + '\">';\n keysHtml += '<i class=\"bi bi-trash\"></i> Delete';\n keysHtml += '</button>';\n keysHtml += '</td>';\n keysHtml += '</tr>';\n });\n\n keysHtml += '</tbody>';\n keysHtml += '</table>';\n keysHtml += '</div>';\n\n // Add delegated event listener for view secret buttons\n setTimeout(() => {\n document.querySelectorAll('.view-secret-btn').forEach(btn => {\n btn.addEventListener('click', function() {\n const accessKey = this.getAttribute('data-access-key');\n const secretKey = this.getAttribute('data-secret-key');\n showSecretKey(accessKey, secretKey);\n });\n });\n }, 100);\n\n return keysHtml;\n }\n\n // Refresh access keys list content\n async function refreshAccessKeysList(username) {\n try {\n const encodedUsername = encodeURIComponent(username);\n const response = await fetch(basePath(`/api/users/${encodedUsername}`));\n if (response.ok) {\n const user = await response.json();\n document.getElementById('accessKeysContent').innerHTML = createAccessKeysContent(user);\n }\n } catch (error) {\n console.error('Error refreshing access keys:', error);\n }\n }\n\n // Update access key status\n async function updateAccessKeyStatus(username, accessKey, status) {\n try {\n const response = await fetch(basePath(`/api/users/${encodeURIComponent(username)}/access-keys/${encodeURIComponent(accessKey)}/status`), {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ status: status })\n });\n\n if (response.ok) {\n showSuccessMessage('Access key status updated successfully');\n // Refresh access keys display without toggling modal\n refreshAccessKeysList(username);\n } else {\n const error = await response.json();\n showAlert('Failed to update access key status: ' + (error.error || 'Unknown error'), 'error');\n refreshAccessKeysList(username);\n }\n } catch (error) {\n console.error('Error updating access key status:', error);\n showAlert('Failed to update access key status: ' + error.message, 'error');\n refreshAccessKeysList(username);\n }\n }\n\n // Reset and hide the create key form\n function resetCreateKeyForm() {\n document.getElementById('createKeyForm').style.display = 'none';\n document.getElementById('newAccessKeyInput').value = '';\n document.getElementById('newSecretKeyInput').value = '';\n document.getElementById('newSecretKeyInput').type = 'password';\n document.getElementById('secretKeyToggleIcon').className = 'bi bi-eye';\n }\n\n // Toggle create key form visibility\n function toggleCreateKeyForm() {\n const form = document.getElementById('createKeyForm');\n if (form.style.display === 'none') {\n form.style.display = 'block';\n } else {\n resetCreateKeyForm();\n }\n }\n\n // Toggle secret key input visibility\n function toggleSecretKeyVisibility() {\n const input = document.getElementById('newSecretKeyInput');\n const icon = document.getElementById('secretKeyToggleIcon');\n if (input.type === 'password') {\n input.type = 'text';\n icon.className = 'bi bi-eye-slash';\n } else {\n input.type = 'password';\n icon.className = 'bi bi-eye';\n }\n }\n\n // Reset form when modal is dismissed\n document.getElementById('accessKeysModal').addEventListener('hidden.bs.modal', resetCreateKeyForm);\n\n // Create new access key\n var isCreatingKey = false;\n async function createAccessKey() {\n if (isCreatingKey) return;\n\n const username = document.getElementById('accessKeysUsername').textContent;\n const accessKeyInput = document.getElementById('newAccessKeyInput');\n const secretKeyInput = document.getElementById('newSecretKeyInput');\n if ((accessKeyInput.value.trim() && !accessKeyInput.reportValidity()) ||\n (secretKeyInput.value.trim() && !secretKeyInput.reportValidity())) {\n return;\n }\n const accessKey = accessKeyInput.value.trim();\n const secretKey = secretKeyInput.value.trim();\n\n const body = {};\n if (accessKey) body.access_key = accessKey;\n if (secretKey) body.secret_key = secretKey;\n\n isCreatingKey = true;\n const createBtn = document.querySelector('#createKeyForm .btn-primary');\n const cancelBtn = document.querySelector('#createKeyForm .btn-secondary');\n if (createBtn) createBtn.disabled = true;\n if (cancelBtn) cancelBtn.disabled = true;\n\n try {\n const encodedUsername = encodeURIComponent(username);\n const response = await fetch(basePath(`/api/users/${encodedUsername}/access-keys`), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body)\n });\n\n if (response.ok) {\n const result = await response.json();\n\n // Show the new access key details\n if (result.access_key) {\n showNewAccessKeyModal(result.access_key);\n }\n\n showSuccessMessage('Access key created successfully');\n resetCreateKeyForm();\n\n // Refresh access keys display\n refreshAccessKeysList(username);\n } else {\n const error = await response.json();\n showAlert('Failed to create access key: ' + (error.error || 'Unknown error'), 'error');\n }\n } catch (error) {\n console.error('Error creating access key:', error);\n showAlert('Failed to create access key: ' + error.message, 'error');\n } finally {\n isCreatingKey = false;\n if (createBtn) createBtn.disabled = false;\n if (cancelBtn) cancelBtn.disabled = false;\n }\n }\n\n // Delete access key\n async function deleteAccessKey(username, accessKey) {\n showDeleteConfirm(accessKey, async function() {\n try {\n const encodedUsername = encodeURIComponent(username);\n const encodedAccessKey = encodeURIComponent(accessKey);\n const response = await fetch(basePath(`/api/users/${encodedUsername}/access-keys/${encodedAccessKey}`), {\n method: 'DELETE'\n });\n\n if (response.ok) {\n showSuccessMessage('Access key deleted successfully');\n\n // Refresh access keys display\n refreshAccessKeysList(username);\n } else {\n const error = await response.json();\n showErrorMessage('Failed to delete access key: ' + (error.error || 'Unknown error'));\n }\n } catch (error) {\n console.error('Error deleting access key:', error);\n showErrorMessage('Failed to delete access key: ' + error.message);\n }\n }, 'Are you sure you want to delete this access key?');\n }\n\n\n // Utility functions\n function showSuccessMessage(message) {\n // Simple implementation - could be enhanced with toast notifications\n alert('Success: ' + message);\n }\n\n function showErrorMessage(message) {\n showAlert(message, 'error');\n }\n\n function escapeHtml(text) {\n if (!text) return '';\n const div = document.createElement('div');\n div.textContent = text;\n return div.innerHTML;\n }\n </script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/weed/admin/view/app/plugin.templ b/weed/admin/view/app/plugin.templ
index f0518c95bc..cd0730ae50 100644
--- a/weed/admin/view/app/plugin.templ
+++ b/weed/admin/view/app/plugin.templ
@@ -546,7 +546,7 @@ templ Plugin(page string, initialJob string, lane string) {
}
.plugin-form-root .card {
- border: 1px solid #dee2e6;
+ border: 1px solid var(--bs-border-color);
}
.plugin-form-root textarea {
min-height: 12rem;
@@ -566,11 +566,11 @@ templ Plugin(page string, initialJob string, lane string) {
}
.plugin-detection-item {
- border: 1px solid #dee2e6;
+ border: 1px solid var(--bs-border-color);
border-radius: 6px;
padding: 0.5rem 0.75rem;
margin-bottom: 0.5rem;
- background: #fbfcfd;
+ background: var(--bs-tertiary-bg);
}
.plugin-job-link {
@@ -580,8 +580,8 @@ templ Plugin(page string, initialJob string, lane string) {
.plugin-job-detail-json {
max-height: 220px;
overflow: auto;
- background: #f8f9fa;
- border: 1px solid #dee2e6;
+ background: var(--bs-tertiary-bg);
+ border: 1px solid var(--bs-border-color);
border-radius: 6px;
padding: 0.5rem;
margin-bottom: 0;
diff --git a/weed/admin/view/app/plugin_templ.go b/weed/admin/view/app/plugin_templ.go
index 3bbe948181..3dab45b538 100644
--- a/weed/admin/view/app/plugin_templ.go
+++ b/weed/admin/view/app/plugin_templ.go
@@ -109,7 +109,7 @@ func Plugin(page string, initialJob string, lane string) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "<div class=\"plugin-section plugin-section-overview\"><div class=\"row mb-4\"><div class=\"col-md-3 mb-3\"><div class=\"card border-info h-100\"><div class=\"card-body text-center\"><div class=\"text-uppercase text-muted small mb-1\">Workers</div><h4 class=\"mb-0\" id=\"plugin-status-workers\">0</h4></div></div></div><div class=\"col-md-3 mb-3\"><div class=\"card border-warning h-100\"><div class=\"card-body text-center\"><div class=\"text-uppercase text-muted small mb-1\">Active Jobs</div><h4 class=\"mb-0\" id=\"plugin-status-active-jobs\">0</h4></div></div></div><div class=\"col-md-3 mb-3\"><div class=\"card border-success h-100\"><div class=\"card-body text-center\"><div class=\"text-uppercase text-muted small mb-1\">Activities (recent)</div><h4 class=\"mb-0\" id=\"plugin-status-activities\">0</h4></div></div></div><div class=\"col-md-3 mb-3\"><div class=\"card border-secondary h-100\"><div class=\"card-body text-center\"><div class=\"text-uppercase text-muted small mb-1\">Next scheduled check</div><h4 class=\"mb-0 plugin-scheduler-next-run\">-</h4><div class=\"text-muted small plugin-scheduler-next-run-meta\"></div></div></div></div></div><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow-sm\"><div class=\"card-header\"><h5 class=\"mb-0\"><i class=\"bi bi-bar-chart me-2\"></i>Per Job Type Summary</h5></div><div class=\"card-body p-0\"><div class=\"table-responsive\"><table class=\"table table-sm table-hover mb-0\"><thead class=\"table-light\"><tr><th>Job Type</th><th>Active Jobs</th><th>Recent Activities</th></tr></thead> <tbody id=\"plugin-jobtype-summary-body\"><tr><td colspan=\"3\" class=\"text-muted text-center py-3\">Loading...</td></tr></tbody></table></div></div></div></div></div><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow-sm\"><div class=\"card-header d-flex justify-content-between align-items-center flex-wrap gap-2\"><h5 class=\"mb-0\"><i class=\"bi bi-clock me-2\"></i>Scheduler State</h5><small class=\"text-muted\">Sequential scheduler with per-job runtime limits</small></div><div class=\"card-body p-0\"><div class=\"table-responsive\"><table class=\"table table-sm table-hover mb-0\"><thead class=\"table-light\"><tr><th>Job Type</th><th>Enabled</th><th>Detector</th><th>In Flight</th><th>Max Runtime</th><th>Exec Global</th><th>Exec/Worker</th><th>Executor Workers</th><th>Effective Exec</th><th>Last Run</th></tr></thead> <tbody id=\"plugin-scheduler-table-body\"><tr><td colspan=\"10\" class=\"text-muted text-center py-3\">Loading...</td></tr></tbody></table></div></div></div></div></div><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow-sm\"><div class=\"card-header\"><h5 class=\"mb-0\"><i class=\"bi bi-people me-2\"></i>Workers</h5></div><div class=\"card-body p-0\"><div class=\"table-responsive\" style=\"max-height: 560px; overflow-y: auto;\"><table class=\"table table-sm table-hover mb-0\"><thead class=\"table-light sticky-top\"><tr><th>Worker</th><th>Address</th><th>Capabilities</th><th>Load</th></tr></thead> <tbody id=\"plugin-workers-table-body\"><tr><td colspan=\"4\" class=\"text-muted text-center py-3\">Loading...</td></tr></tbody></table></div></div></div></div></div></div><div class=\"plugin-section plugin-section-configuration\"><div class=\"row mb-4\"><div class=\"col-lg-8 mb-3\"><div class=\"card shadow-sm h-100\"><div class=\"card-header d-flex justify-content-between align-items-center\"><h5 class=\"mb-0\"><i class=\"bi bi-sliders me-2\"></i>Job Type Configuration</h5><small class=\"text-muted\" id=\"plugin-config-updated-at\">Not loaded</small></div><div class=\"card-body\"><div class=\"mb-3\"><div class=\"small text-muted\">Selected Job Type</div><div class=\"fw-semibold\" id=\"plugin-selected-job-type\">-</div></div><div class=\"mb-3\"><div class=\"d-flex justify-content-between align-items-center mb-2\"><h6 class=\"mb-0\">Descriptor</h6><button type=\"button\" class=\"btn btn-sm btn-outline-secondary\" id=\"plugin-refresh-schema-btn\"><i class=\"bi bi-cloud-download me-1\"></i>Refresh Schema</button></div><div class=\"alert alert-light border\" id=\"plugin-descriptor-summary\">Select a job type to load schema and config.</div></div><div class=\"mb-3\"><h6>Admin Config Form</h6><div id=\"plugin-admin-config-form\" class=\"plugin-form-root\"><div class=\"text-muted\">No admin form loaded.</div></div></div><div class=\"mb-3\"><h6>Worker Config Form</h6><div id=\"plugin-worker-config-form\" class=\"plugin-form-root\"><div class=\"text-muted\">No worker form loaded.</div></div></div><div class=\"d-flex flex-wrap gap-2\"><button type=\"button\" class=\"btn btn-primary\" id=\"plugin-save-config-btn\"><i class=\"bi bi-floppy me-1\"></i>Save Config</button> <button type=\"button\" class=\"btn btn-outline-primary\" id=\"plugin-trigger-detection-btn\"><i class=\"bi bi-search me-1\"></i>Run Detection</button> <button type=\"button\" class=\"btn btn-outline-success\" id=\"plugin-run-workflow-btn\"><i class=\"bi bi-play me-1\"></i>Run Detect + Execute</button></div></div></div></div><div class=\"col-lg-4 mb-3\"><div class=\"card shadow-sm\"><div class=\"card-header\"><h5 class=\"mb-0\"><i class=\"bi bi-gear-wide-connected me-2\"></i>Job Scheduling Settings</h5></div><div class=\"card-body\"><div class=\"row g-2\" id=\"plugin-admin-settings-form\"><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-enabled\">Enabled</label><div class=\"form-check form-switch mt-1\"><input class=\"form-check-input\" type=\"checkbox\" id=\"plugin-admin-enabled\"></div></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-detection-interval\">Scheduled detection interval (min)</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-detection-interval\" min=\"0\"><div class=\"form-text\">How often to check for new work.</div></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-detection-timeout\">Detection Timeout (s)</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-detection-timeout\" min=\"0\"></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-execution-timeout\">Execution Timeout (s)</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-execution-timeout\" min=\"0\"><div class=\"form-text\">Per-attempt deadline for one job. Size-aware tasks may extend this automatically.</div></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-max-runtime\">Job Type Max Runtime (s)</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-max-runtime\" min=\"0\"></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-max-results\">Max Jobs / Detection</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-max-results\" min=\"0\"></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-global-exec\">Global Execution Concurrency</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-global-exec\" min=\"0\"></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-per-worker-exec\">Per Worker Concurrency</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-per-worker-exec\" min=\"0\"></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-retry-limit\">Retry Limit</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-retry-limit\" min=\"0\"></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-retry-backoff\">Retry Backoff (s)</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-retry-backoff\" min=\"0\"></div></div></div></div><div class=\"card shadow-sm mt-3\"><div class=\"card-header d-flex justify-content-between align-items-center\"><h5 class=\"mb-0\"><i class=\"bi bi-hourglass-split me-2\"></i>Next scheduled check</h5><small class=\"text-muted\">Scheduler</small></div><div class=\"card-body\"><div class=\"h5 mb-1 plugin-scheduler-next-run\">-</div><div class=\"text-muted small plugin-scheduler-next-run-meta\">Not scheduled</div></div></div></div></div><div class=\"row mb-4\"><div class=\"col-lg-6 mb-3\"><div class=\"card shadow-sm h-100\"><div class=\"card-header d-flex justify-content-between align-items-center\"><h5 class=\"mb-0\"><i class=\"bi bi-clipboard-check me-2\"></i>Run History</h5><small class=\"text-muted\">Keep last 10 success + last 10 errors</small></div><div class=\"card-body\"><div class=\"row\"><div class=\"col-12 mb-3\"><h6 class=\"text-success\">Successful Runs</h6><div class=\"table-responsive\"><table class=\"table table-sm table-striped\"><thead><tr><th>Time</th><th>Job ID</th><th>Worker</th><th>Duration</th></tr></thead> <tbody id=\"plugin-runs-success-body\"><tr><td colspan=\"4\" class=\"text-muted\">No data</td></tr></tbody></table></div></div><div class=\"col-12\"><h6 class=\"text-danger\">Error Runs</h6><div class=\"table-responsive\"><table class=\"table table-sm table-striped\"><thead><tr><th>Time</th><th>Job ID</th><th>Worker</th><th>Error</th></tr></thead> <tbody id=\"plugin-runs-error-body\"><tr><td colspan=\"4\" class=\"text-muted\">No data</td></tr></tbody></table></div></div></div></div></div></div><div class=\"col-lg-6 mb-3\"><div class=\"card shadow-sm h-100\"><div class=\"card-header\"><h5 class=\"mb-0\"><i class=\"bi bi-lightbulb me-2\"></i>Detection Results</h5></div><div class=\"card-body\" id=\"plugin-detection-results\"><div class=\"text-muted\">Run detection to see proposals.</div></div></div></div></div></div><div class=\"plugin-section plugin-section-queue\"><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow-sm\"><div class=\"card-header d-flex justify-content-between align-items-center flex-wrap gap-2\"><h5 class=\"mb-0\"><i class=\"bi bi-list me-2\"></i>Job Queue</h5><div class=\"d-flex gap-2 align-items-center flex-wrap\"><small class=\"text-muted\">States: pending/assigned/running</small></div></div><div class=\"card-body p-0\"><div class=\"table-responsive\" style=\"max-height: 560px; overflow-y: auto;\"><table class=\"table table-sm table-hover mb-0\"><thead class=\"table-light sticky-top\"><tr><th>Job ID</th><th>Type</th><th>State</th><th>Progress</th><th>Worker</th><th>Updated</th><th>Message</th></tr></thead> <tbody id=\"plugin-queue-jobs-table-body\"><tr><td colspan=\"7\" class=\"text-muted text-center py-3\">Loading...</td></tr></tbody></table></div></div></div></div></div></div><div class=\"plugin-section plugin-section-detection\"><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow-sm\"><div class=\"card-header d-flex justify-content-between align-items-center flex-wrap gap-2\"><h5 class=\"mb-0\"><i class=\"bi bi-search me-2\"></i>Detection Jobs</h5><div class=\"small text-muted\">Detection activities for selected job type</div></div><div class=\"card-body p-0\"><div class=\"table-responsive\" style=\"max-height: 420px; overflow-y: auto;\"><table class=\"table table-sm table-hover mb-0\"><thead class=\"table-light sticky-top\"><tr><th>Time</th><th>Job Type</th><th>Request ID</th><th>Worker</th><th>Stage</th><th>Source</th><th>Message</th></tr></thead> <tbody id=\"plugin-detection-table-body\"><tr><td colspan=\"7\" class=\"text-muted text-center py-3\">Loading...</td></tr></tbody></table></div></div></div></div></div></div><div class=\"plugin-section plugin-section-execution\"><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow-sm\"><div class=\"card-header d-flex justify-content-between align-items-center flex-wrap gap-2\"><h5 class=\"mb-0\"><i class=\"bi bi-list-check me-2\"></i>Execution Jobs</h5><div class=\"d-flex gap-2 align-items-center flex-wrap\"><select class=\"form-select form-select-sm\" id=\"plugin-monitor-job-state-filter\" style=\"min-width: 180px;\"><option value=\"\">All States</option> <option value=\"assigned\">Assigned</option> <option value=\"running\">Running</option> <option value=\"succeeded\">Succeeded</option> <option value=\"failed\">Failed</option> <option value=\"canceled\">Canceled</option></select></div></div><div class=\"card-body p-0\"><div class=\"table-responsive\"><table class=\"table table-hover mb-0\"><thead class=\"table-light\"><tr><th>Job ID</th><th>Type</th><th>State</th><th>Progress</th><th>Worker</th><th>Updated</th><th>Message</th></tr></thead> <tbody id=\"plugin-execution-jobs-table-body\"><tr><td colspan=\"7\" class=\"text-muted text-center py-3\">Loading...</td></tr></tbody></table></div></div></div></div></div><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow-sm\"><div class=\"card-header d-flex justify-content-between align-items-center flex-wrap gap-2\"><h5 class=\"mb-0\"><i class=\"bi bi-list-nested me-2\"></i>Execution Activities</h5><small class=\"text-muted\">Non-detection events only</small></div><div class=\"card-body p-0\"><div class=\"table-responsive\" style=\"max-height: 420px; overflow-y: auto;\"><table class=\"table table-sm table-hover mb-0\"><thead class=\"table-light sticky-top\"><tr><th>Time</th><th>Job Type</th><th>Job ID</th><th>Source</th><th>Stage</th><th>Message</th></tr></thead> <tbody id=\"plugin-execution-activities-table-body\"><tr><td colspan=\"6\" class=\"text-muted text-center py-3\">Loading...</td></tr></tbody></table></div></div></div></div></div></div></div><div class=\"modal fade\" id=\"plugin-job-detail-modal\" tabindex=\"-1\" aria-labelledby=\"plugin-job-detail-modal-label\" aria-hidden=\"true\"><div class=\"modal-dialog modal-xl modal-dialog-scrollable\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"plugin-job-detail-modal-label\"><i class=\"bi bi-file-earmark-text me-2\"></i>Job Detail</h5><div class=\"ms-auto me-2\"><button type=\"button\" class=\"btn btn-outline-danger btn-sm\" id=\"plugin-expire-job-btn\" disabled><i class=\"bi bi-stop-circle me-1\"></i>Expire Job</button></div><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\" id=\"plugin-job-detail-content\"><div class=\"text-muted\">Select a job to view details.</div></div></div></div></div><style>\n .plugin-section {\n display: none;\n }\n\n .plugin-section.plugin-section-active {\n display: block;\n }\n\n .plugin-form-root .card {\n border: 1px solid #dee2e6;\n }\n .plugin-form-root textarea {\n min-height: 12rem;\n }\n\n .plugin-field-hidden {\n display: none;\n }\n\n .plugin-capability-badge {\n font-size: 0.72rem;\n margin-right: 0.25rem;\n }\n\n .plugin-job-progress {\n min-width: 120px;\n }\n\n .plugin-detection-item {\n border: 1px solid #dee2e6;\n border-radius: 6px;\n padding: 0.5rem 0.75rem;\n margin-bottom: 0.5rem;\n background: #fbfcfd;\n }\n\n .plugin-job-link {\n text-decoration: none;\n }\n\n .plugin-job-detail-json {\n max-height: 220px;\n overflow: auto;\n background: #f8f9fa;\n border: 1px solid #dee2e6;\n border-radius: 6px;\n padding: 0.5rem;\n margin-bottom: 0;\n font-size: 0.82rem;\n }\n </style><script>\n (function() {\n var page = document.getElementById('plugin-page');\n if (!page) {\n return;\n }\n\n var pluginLane = String(page.getAttribute('data-plugin-lane') || '').trim();\n\n function basePath(path) {\n return (window.__BASE_PATH__ || '') + path;\n }\n\n var state = {\n selectedJobType: '',\n jobTypes: [],\n lastDetectionByJobType: {},\n initialPage: String(page.getAttribute('data-plugin-page') || 'overview').trim().toLowerCase(),\n initialJob: String(page.getAttribute('data-plugin-job') || '').trim(),\n activeTopTab: 'overview',\n activeSubTab: 'configuration',\n initialNavigationApplied: false,\n monitorExecutionJobState: '',\n workers: [],\n jobs: [],\n activities: [],\n schedulerStates: [],\n schedulerStatus: null,\n schedulerLock: null,\n allJobs: [],\n allActivities: [],\n monitorRowsScope: null,\n refreshError: '',\n loadedJobType: '',\n descriptor: null,\n config: null,\n refreshTimer: null,\n };\n\n // appendLaneParam appends ?lane= or &lane= to a URL if a lane filter is active.\n function appendLaneParam(url) {\n if (!pluginLane) return url;\n var sep = url.indexOf('?') === -1 ? '?' : '&';\n return url + sep + 'lane=' + encodeURIComponent(pluginLane);\n }\n\n // appendJobTypeParam appends ?job_type= or &job_type= to a URL if a job type is given.\n function appendJobTypeParam(url, jobType) {\n if (!jobType) return url;\n var sep = url.indexOf('?') === -1 ? '?' : '&';\n return url + sep + 'job_type=' + encodeURIComponent(jobType);\n }\n\n function getCSRFToken() {\n var meta = document.querySelector('meta[name=\"csrf-token\"]');\n if (!meta) {\n return '';\n }\n return meta.getAttribute('content') || '';\n }\n\n function notify(message, level) {\n if (typeof window.showAlert === 'function') {\n window.showAlert(message, level || 'info');\n return;\n }\n if (level === 'error') {\n console.error(message);\n }\n alert(message);\n }\n\n async function readResponseJSON(response) {\n var bodyText = await response.text();\n if (!bodyText) {\n return {};\n }\n try {\n return JSON.parse(bodyText);\n } catch (e) {\n return { error: bodyText };\n }\n }\n\n async function pluginRequest(method, url, payload) {\n var headers = {};\n var requestOptions = {\n method: method,\n headers: headers,\n };\n\n if (payload !== undefined && payload !== null) {\n headers['Content-Type'] = 'application/json';\n requestOptions.body = JSON.stringify(payload);\n }\n\n if (method !== 'GET') {\n var csrf = getCSRFToken();\n if (csrf) {\n headers['X-CSRF-Token'] = csrf;\n }\n }\n\n var response = await fetch(basePath(url), requestOptions);\n var data = await readResponseJSON(response);\n if (!response.ok) {\n var message = (data && (data.error || data.message)) ? (data.error || data.message) : ('Request failed: ' + response.status);\n var requestError = new Error(message);\n requestError.responseData = data;\n requestError.responseStatus = response.status;\n throw requestError;\n }\n return data;\n }\n\n function textOrDash(value) {\n if (value === null || value === undefined || value === '') {\n return '-';\n }\n return String(value);\n }\n\n function escapeHtml(value) {\n if (value === null || value === undefined) {\n return '';\n }\n return String(value)\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#039;');\n }\n\n function encodePath(value) {\n return encodeURIComponent(value || '');\n }\n\n function normalizeEnum(value) {\n if (value === undefined || value === null) {\n return '';\n }\n return String(value).toUpperCase();\n }\n\n function parseTime(value) {\n if (!value) {\n return '';\n }\n var date = new Date(value);\n if (Number.isNaN(date.getTime())) {\n return '';\n }\n return date.toLocaleString();\n }\n\n function normalizeSubTab(value) {\n var normalized = String(value || '').toLowerCase();\n if (normalized === 'configuration' || normalized === 'detection' || normalized === 'queue' || normalized === 'execution') {\n return normalized;\n }\n return 'configuration';\n }\n\n function buildPluginURL(topTab, subTab, jobType) {\n var laneName = pluginLane || 'default';\n var laneBase = '/plugin/lanes/' + encodeURIComponent(laneName);\n if (topTab === 'overview') {\n return laneBase;\n }\n var effectiveSubTab = normalizeSubTab(subTab);\n var path = laneBase + '/' + encodeURIComponent(effectiveSubTab);\n var jt = String(jobType || '').trim();\n if (jt) {\n path += '?job=' + encodeURIComponent(jt);\n }\n return path;\n }\n\n function updateURL(replace) {\n var url = basePath(buildPluginURL(state.activeTopTab, state.activeSubTab, state.selectedJobType));\n if (replace) {\n history.replaceState({ pluginTopTab: state.activeTopTab, pluginSubTab: state.activeSubTab, pluginJob: state.selectedJobType }, '', url);\n } else {\n history.pushState({ pluginTopTab: state.activeTopTab, pluginSubTab: state.activeSubTab, pluginJob: state.selectedJobType }, '', url);\n }\n }\n\n // Parse a job type item (string or object) into a safe object shape\n function parseJobTypeItem(item) {\n var jobType = '';\n var displayName = '';\n \n if (typeof item === 'string') {\n jobType = String(item || '').trim();\n displayName = jobType;\n } else if (item && typeof item === 'object') {\n jobType = String(item.job_type || item.jobType || '').trim();\n displayName = String(item.display_name || item.displayName || jobType || '').trim();\n if (!displayName) {\n displayName = jobType;\n }\n }\n \n return { jobType: jobType, displayName: displayName };\n }\n\n function monitorJobTypeScope() {\n return state.activeTopTab === 'overview' ? '' : state.selectedJobType;\n }\n\n function topTabKeyForJobType(jobType) {\n var normalized = String(jobType || '').trim();\n if (!normalized) {\n return '';\n }\n return 'job:' + normalized;\n }\n\n function parseJobTypeFromTopTab(tabKey) {\n var normalized = String(tabKey || '').trim();\n if (normalized.indexOf('job:') !== 0) {\n return '';\n }\n return normalized.slice(4);\n }\n\n function hasJobType(jobType) {\n var normalized = String(jobType || '').trim();\n if (!normalized) {\n return false;\n }\n var jobTypes = Array.isArray(state.jobTypes) ? state.jobTypes : [];\n for (var i = 0; i < jobTypes.length; i++) {\n var item = parseJobTypeItem(jobTypes[i]);\n if (item.jobType === normalized) {\n return true;\n }\n }\n return false;\n }\n\n function applyInitialNavigation() {\n if (state.initialNavigationApplied) {\n return;\n }\n state.initialNavigationApplied = true;\n state.activeSubTab = normalizeSubTab(state.initialPage);\n\n if (state.initialPage === 'overview') {\n state.activeTopTab = 'overview';\n return;\n }\n if (!Array.isArray(state.jobTypes) || state.jobTypes.length === 0) {\n state.activeTopTab = 'overview';\n return;\n }\n // If a specific job type was provided in the URL, use it\n if (state.initialJob && hasJobType(state.initialJob)) {\n state.selectedJobType = state.initialJob;\n } else {\n var firstItem = parseJobTypeItem(state.jobTypes[0]);\n state.selectedJobType = firstItem.jobType;\n }\n state.activeTopTab = topTabKeyForJobType(state.selectedJobType);\n }\n\n function ensureActiveNavigation() {\n state.activeSubTab = normalizeSubTab(state.activeSubTab);\n\n if (state.selectedJobType && !hasJobType(state.selectedJobType)) {\n state.selectedJobType = '';\n state.descriptor = null;\n state.config = null;\n }\n\n var topTabJobType = parseJobTypeFromTopTab(state.activeTopTab);\n if (topTabJobType && !hasJobType(topTabJobType)) {\n state.activeTopTab = 'overview';\n topTabJobType = '';\n }\n\n if (state.activeTopTab === 'overview') {\n if (!state.selectedJobType && Array.isArray(state.jobTypes) && state.jobTypes.length > 0) {\n var item = parseJobTypeItem(state.jobTypes[0]);\n state.selectedJobType = item.jobType;\n }\n return;\n }\n\n if (!topTabJobType && state.selectedJobType) {\n topTabJobType = state.selectedJobType;\n }\n if (!topTabJobType && Array.isArray(state.jobTypes) && state.jobTypes.length > 0) {\n var item = parseJobTypeItem(state.jobTypes[0]);\n topTabJobType = item.jobType;\n }\n if (!topTabJobType) {\n state.activeTopTab = 'overview';\n return;\n }\n\n state.selectedJobType = topTabJobType;\n state.activeTopTab = topTabKeyForJobType(topTabJobType);\n }\n\n function renderTopTabs() {\n var root = document.getElementById('plugin-top-tabs');\n if (!root) {\n return;\n }\n\n var html = '' +\n '<li class=\"nav-item\">' +\n '<button type=\"button\" class=\"nav-link\" data-plugin-top-tab=\"overview\">' +\n '<i class=\"bi bi-graph-up-arrow me-1\"></i>Overview' +\n '</button>' +\n '</li>';\n\n var jobTypes = Array.isArray(state.jobTypes) ? state.jobTypes : [];\n for (var i = 0; i < jobTypes.length; i++) {\n var item = parseJobTypeItem(jobTypes[i]);\n var jobType = item.jobType;\n var displayName = item.displayName;\n \n if (!jobType) {\n continue;\n }\n html += '' +\n '<li class=\"nav-item\">' +\n '<button type=\"button\" class=\"nav-link\" data-plugin-top-tab=\"' + escapeHtml(topTabKeyForJobType(jobType)) + '\">' +\n escapeHtml(displayName) +\n '</button>' +\n '</li>';\n }\n root.innerHTML = html;\n }\n\n function renderNavigationState() {\n var selectedJobTypeLabel = document.getElementById('plugin-selected-job-type');\n if (selectedJobTypeLabel) {\n selectedJobTypeLabel.textContent = state.selectedJobType || '-';\n }\n\n var isOverview = state.activeTopTab === 'overview';\n var subtabRow = document.getElementById('plugin-subtab-row');\n if (subtabRow) {\n subtabRow.classList.toggle('d-none', isOverview);\n }\n\n var topTabs = document.querySelectorAll('#plugin-top-tabs [data-plugin-top-tab]');\n for (var i = 0; i < topTabs.length; i++) {\n var topTab = topTabs[i];\n var topKey = String(topTab.getAttribute('data-plugin-top-tab') || '');\n topTab.classList.toggle('active', topKey === state.activeTopTab);\n }\n\n var subTabs = document.querySelectorAll('#plugin-subtabs [data-plugin-subtab]');\n for (var j = 0; j < subTabs.length; j++) {\n var subTab = subTabs[j];\n var subKey = String(subTab.getAttribute('data-plugin-subtab') || '');\n subTab.classList.toggle('active', !isOverview && subKey === state.activeSubTab);\n }\n\n function toggleSection(sectionName, visible) {\n var section = document.querySelector('.plugin-section-' + sectionName);\n if (!section) {\n return;\n }\n section.classList.toggle('plugin-section-active', !!visible);\n }\n\n toggleSection('overview', isOverview);\n toggleSection('configuration', !isOverview && state.activeSubTab === 'configuration');\n toggleSection('detection', !isOverview && state.activeSubTab === 'detection');\n toggleSection('queue', !isOverview && state.activeSubTab === 'queue');\n toggleSection('execution', !isOverview && state.activeSubTab === 'execution');\n }\n\n function renderJobLink(jobID) {\n var normalized = String(jobID || '').trim();\n if (!normalized) {\n return '<small>-</small>';\n }\n return '<button type=\"button\" class=\"btn btn-link btn-sm p-0 align-baseline plugin-job-link\" data-job-id=\"' + escapeHtml(normalized) + '\">' + escapeHtml(normalized) + '</button>';\n }\n\n function toPrettyJson(value) {\n if (value === null || value === undefined || value === '') {\n return '';\n }\n if (typeof value === 'string') {\n return value;\n }\n try {\n return JSON.stringify(value, null, 2);\n } catch (e) {\n return String(value);\n }\n }\n\n function clonePlainObject(value) {\n if (!value || typeof value !== 'object') {\n return null;\n }\n try {\n return JSON.parse(JSON.stringify(value));\n } catch (e) {\n return null;\n }\n }\n\n function extractExecutionPlan(job) {\n if (!job || !job.parameters) {\n return null;\n }\n var plan = job.parameters.execution_plan;\n if (!plan) {\n return null;\n }\n if (typeof plan === 'string') {\n try {\n plan = JSON.parse(plan);\n } catch (e) {\n return null;\n }\n }\n if (typeof plan !== 'object' || Array.isArray(plan)) {\n return null;\n }\n return plan;\n }\n\n function removeExecutionPlanForDisplay(parameters) {\n var copy = clonePlainObject(parameters);\n if (!copy) {\n return parameters;\n }\n if (copy.execution_plan !== undefined) {\n delete copy.execution_plan;\n }\n if (Object.keys(copy).length === 0) {\n return null;\n }\n return copy;\n }\n\n function parseIntOrDefault(value, fallback) {\n var parsed = parseInt(value, 10);\n if (Number.isNaN(parsed)) {\n return fallback;\n }\n return parsed;\n }\n\n function normalizeShardIDs(value) {\n if (!Array.isArray(value)) {\n return [];\n }\n var out = [];\n for (var i = 0; i < value.length; i++) {\n var parsed = parseIntOrDefault(value[i], -1);\n if (parsed >= 0) {\n out.push(parsed);\n }\n }\n out.sort(function(a, b) { return a - b; });\n return out;\n }\n\n function classifyShardLabel(shardID, dataShardCount) {\n if (shardID < dataShardCount) {\n return {\n kind: 'data',\n label: String(shardID),\n className: 'bg-primary',\n title: 'Data shard ' + shardID,\n };\n }\n var parityIndex = shardID - dataShardCount;\n return {\n kind: 'parity',\n label: String(shardID),\n className: 'bg-warning text-dark',\n title: 'Parity shard ' + shardID + ' (index ' + parityIndex + ')',\n };\n }\n\n function renderShardBadges(shardIDs, dataShardCount) {\n if (!Array.isArray(shardIDs) || shardIDs.length === 0) {\n return '<span class=\"text-muted\">-</span>';\n }\n var html = '';\n for (var i = 0; i < shardIDs.length; i++) {\n var shard = classifyShardLabel(shardIDs[i], dataShardCount);\n html += '<span class=\"badge me-1 ' + shard.className + '\" title=\"' + escapeHtml(shard.title) + '\">' + escapeHtml(shard.label) + '</span>';\n }\n return html;\n }\n\n function renderExecutionPlan(plan) {\n if (!plan || typeof plan !== 'object') {\n return '';\n }\n\n var jobType = String(plan.job_type || '').trim().toLowerCase();\n if (jobType === 'volume_balance') {\n return renderBalanceExecutionPlan(plan);\n }\n if (jobType !== 'erasure_coding') {\n var fallbackText = toPrettyJson(plan);\n if (!fallbackText) {\n return '';\n }\n return '<div class=\"mb-3\"><h6>Execution Plan</h6><pre class=\"plugin-job-detail-json\">' + escapeHtml(fallbackText) + '</pre></div>';\n }\n\n var dataShards = parseIntOrDefault(plan.data_shards, 10);\n var parityShards = parseIntOrDefault(plan.parity_shards, 4);\n var totalShards = parseIntOrDefault(plan.total_shards, dataShards + parityShards);\n var sources = Array.isArray(plan.sources) ? plan.sources : [];\n var targets = Array.isArray(plan.targets) ? plan.targets : [];\n var assignments = Array.isArray(plan.shard_assignments) ? plan.shard_assignments : [];\n\n var html = '';\n html += '<div class=\"mb-3\"><h6>Execution Plan</h6>';\n html += '<div class=\"row g-2 mb-2\">' +\n '<div class=\"col-md-3\"><small><strong>Volume:</strong> ' + escapeHtml(textOrDash(plan.volume_id)) + '</small></div>' +\n '<div class=\"col-md-3\"><small><strong>Collection:</strong> ' + escapeHtml(textOrDash(plan.collection)) + '</small></div>' +\n '<div class=\"col-md-3\"><small><strong>Shards:</strong> ' + escapeHtml(String(dataShards)) + '+' + escapeHtml(String(parityShards)) + '</small></div>' +\n '<div class=\"col-md-3\"><small><strong>Total:</strong> ' + escapeHtml(String(totalShards)) + '</small></div>' +\n '</div>';\n\n html += '<div class=\"small text-muted mb-2\">' +\n '<span class=\"badge bg-primary me-1\">Data</span>' +\n '<span class=\"badge bg-warning text-dark me-2\">Parity</span>' +\n 'Source and target placement per shard.' +\n '</div>';\n\n function renderEndpointsTable(title, endpoints) {\n if (!endpoints.length) {\n return '<div class=\"mb-2\"><strong>' + escapeHtml(title) + ':</strong> <span class=\"text-muted\">none</span></div>';\n }\n var table = '<div class=\"table-responsive mb-2\"><table class=\"table table-sm table-striped mb-0\">' +\n '<thead><tr><th>#</th><th>Node</th><th>DC</th><th>Rack</th><th>Volume</th><th>Shards</th></tr></thead><tbody>';\n for (var i = 0; i < endpoints.length; i++) {\n var endpoint = endpoints[i] || {};\n var endpointShards = normalizeShardIDs(endpoint.shard_ids);\n table += '<tr>' +\n '<td>' + escapeHtml(String(i + 1)) + '</td>' +\n '<td><code>' + escapeHtml(textOrDash(endpoint.node)) + '</code></td>' +\n '<td>' + escapeHtml(textOrDash(endpoint.data_center)) + '</td>' +\n '<td>' + escapeHtml(textOrDash(endpoint.rack)) + '</td>' +\n '<td>' + escapeHtml(textOrDash(endpoint.volume_id)) + '</td>' +\n '<td>' + renderShardBadges(endpointShards, dataShards) + '</td>' +\n '</tr>';\n }\n table += '</tbody></table></div>';\n return '<div class=\"mb-2\"><strong>' + escapeHtml(title) + '</strong></div>' + table;\n }\n\n html += renderEndpointsTable('Sources', sources);\n html += renderEndpointsTable('Targets', targets);\n\n if (assignments.length) {\n html += '<div class=\"mb-2\"><strong>Shard Assignments</strong></div>';\n html += '<div class=\"table-responsive\"><table class=\"table table-sm table-striped mb-0\">' +\n '<thead><tr><th>Shard</th><th>Kind</th><th>Target</th><th>DC</th><th>Rack</th></tr></thead><tbody>';\n for (var j = 0; j < assignments.length; j++) {\n var assignment = assignments[j] || {};\n var shardID = parseIntOrDefault(assignment.shard_id, -1);\n if (shardID < 0) {\n continue;\n }\n var shard = classifyShardLabel(shardID, dataShards);\n html += '<tr>' +\n '<td><span class=\"badge ' + shard.className + '\">' + escapeHtml(shard.label) + '</span></td>' +\n '<td>' + escapeHtml(textOrDash(assignment.kind || shard.kind)) + '</td>' +\n '<td><code>' + escapeHtml(textOrDash(assignment.target_node)) + '</code></td>' +\n '<td>' + escapeHtml(textOrDash(assignment.target_data_center)) + '</td>' +\n '<td>' + escapeHtml(textOrDash(assignment.target_rack)) + '</td>' +\n '</tr>';\n }\n html += '</tbody></table></div>';\n }\n\n html += '</div>';\n return html;\n }\n\n function renderBalanceExecutionPlan(plan) {\n var html = '<div class=\"mb-3\"><h6>Execution Plan</h6>';\n var moves = Array.isArray(plan.moves) ? plan.moves : [];\n\n if (moves.length === 0) {\n // Single-move balance job\n var src = textOrDash(plan.source_node || plan.source_server);\n var dst = textOrDash(plan.target_node || plan.target_server);\n var vid = textOrDash(plan.volume_id);\n var col = textOrDash(plan.collection);\n html += `<div class=\"row g-2 mb-2\">\n <div class=\"col-md-3\"><small><strong>Volume:</strong> ${escapeHtml(vid)}</small></div>\n <div class=\"col-md-3\"><small><strong>Collection:</strong> ${escapeHtml(col)}</small></div>\n <div class=\"col-md-3\"><small><strong>Source:</strong> <code>${escapeHtml(src)}</code></small></div>\n <div class=\"col-md-3\"><small><strong>Target:</strong> <code>${escapeHtml(dst)}</code></small></div>\n </div>`;\n } else {\n // Batch balance job\n html += '<div class=\"mb-2\"><span class=\"badge bg-info\">' + escapeHtml(String(moves.length)) + ' moves</span></div>';\n html += '<div class=\"table-responsive\"><table class=\"table table-sm table-striped mb-0\">' +\n '<thead><tr><th>#</th><th>Volume</th><th>Source</th><th>Target</th><th>Collection</th></tr></thead><tbody>';\n for (var i = 0; i < moves.length; i++) {\n var move = moves[i] || {};\n html += `<tr>\n <td>${escapeHtml(String(i + 1))}</td>\n <td>${escapeHtml(textOrDash(move.volume_id))}</td>\n <td><code>${escapeHtml(textOrDash(move.source_node))}</code></td>\n <td><code>${escapeHtml(textOrDash(move.target_node))}</code></td>\n <td>${escapeHtml(textOrDash(move.collection))}</td>\n </tr>`;\n }\n html += '</tbody></table></div>';\n }\n\n html += '</div>';\n return html;\n }\n\n function isActiveJobState(candidateState) {\n var jobState = candidateState;\n if (candidateState && typeof candidateState === 'object' && candidateState.state !== undefined) {\n jobState = candidateState.state;\n }\n var st = String(jobState || '').toLowerCase();\n return st === 'job_state_pending' || st === 'job_state_assigned' || st === 'job_state_running' ||\n st === 'pending' || st === 'assigned' || st === 'running' || st === 'in_progress';\n }\n\n function setExpireButtonState(job) {\n var expireBtn = document.getElementById('plugin-expire-job-btn');\n if (!expireBtn) {\n return;\n }\n var jobID = job && job.job_id ? String(job.job_id) : '';\n var active = isActiveJobState(job);\n expireBtn.setAttribute('data-job-id', jobID);\n expireBtn.disabled = !jobID || !active;\n if (!jobID) {\n expireBtn.title = 'Select a job to expire.';\n } else if (!active) {\n expireBtn.title = 'Job is not active.';\n } else {\n expireBtn.title = 'Expire job to unblock scheduling.';\n }\n }\n\n async function expireJob(jobID) {\n var normalizedJobID = String(jobID || '').trim();\n if (!normalizedJobID) {\n return;\n }\n\n var reason = window.prompt('Expire job ' + normalizedJobID + '? Optional reason:', 'job expired by admin request');\n if (reason === null) {\n return;\n }\n\n var expireBtn = document.getElementById('plugin-expire-job-btn');\n if (expireBtn) {\n expireBtn.disabled = true;\n }\n\n try {\n var response = await pluginRequest('POST', '/api/plugin/jobs/' + encodePath(normalizedJobID) + '/expire', {\n reason: reason,\n });\n if (response && response.expired === false) {\n notify(response.message || 'Job is not active.', 'info');\n } else {\n notify('Job expired: ' + normalizedJobID, 'success');\n }\n } catch (e) {\n notify('Failed to expire job: ' + e.message, 'error');\n return;\n }\n try {\n await refreshJobsAndActivities();\n } catch (refreshErr) {\n notify('Monitoring refresh failed: ' + refreshErr.message, 'error');\n }\n await openJobDetail(normalizedJobID);\n }\n\n async function openJobDetail(jobID) {\n var normalizedJobID = String(jobID || '').trim();\n if (!normalizedJobID) {\n return;\n }\n\n var modalElement = document.getElementById('plugin-job-detail-modal');\n var contentRoot = document.getElementById('plugin-job-detail-content');\n if (!modalElement || !contentRoot) {\n return;\n }\n\n var modal;\n if (window.bootstrap && window.bootstrap.Modal) {\n modal = window.bootstrap.Modal.getOrCreateInstance(modalElement);\n }\n if (modal) {\n modal.show();\n }\n\n setExpireButtonState(null);\n contentRoot.innerHTML = '<div class=\"text-muted\">Loading job detail...</div>';\n try {\n var detail = await pluginRequest('GET', '/api/plugin/jobs/' + encodePath(normalizedJobID) + '/detail?activity_limit=500&related_limit=20');\n var job = (detail && detail.job) ? detail.job : {};\n setExpireButtonState(job);\n var runRecord = detail && detail.run_record ? detail.run_record : null;\n var activities = (detail && Array.isArray(detail.activities)) ? detail.activities : [];\n var relatedJobs = (detail && Array.isArray(detail.related_jobs)) ? detail.related_jobs : [];\n var html = '';\n\n html += '<div class=\"row g-3 mb-3\">' +\n '<div class=\"col-lg-8\">' +\n '<div><strong>Job ID:</strong> ' + escapeHtml(textOrDash(job.job_id || normalizedJobID)) + '</div>' +\n '<div><strong>Type:</strong> ' + escapeHtml(textOrDash(job.job_type)) + '</div>' +\n '<div><strong>State:</strong> ' + escapeHtml(textOrDash(job.state)) + '</div>' +\n '<div><strong>Worker:</strong> ' + escapeHtml(textOrDash(job.worker_id)) + '</div>' +\n '<div><strong>Updated:</strong> ' + escapeHtml(parseTime(job.updated_at) || '-') + '</div>' +\n '</div>' +\n '<div class=\"col-lg-4\">' +\n '<div><strong>Attempt:</strong> ' + escapeHtml(textOrDash(job.attempt)) + '</div>' +\n '<div><strong>Progress:</strong> ' + escapeHtml(String(Math.round(Number(job.progress || 0)))) + '%</div>' +\n '<div><strong>Created:</strong> ' + escapeHtml(parseTime(job.created_at) || '-') + '</div>' +\n '<div><strong>Completed:</strong> ' + escapeHtml(parseTime(job.completed_at) || '-') + '</div>' +\n '</div>' +\n '</div>';\n\n if (job.summary) {\n html += '<div class=\"mb-2\"><strong>Summary:</strong> ' + escapeHtml(String(job.summary)) + '</div>';\n }\n if (job.detail) {\n html += '<div class=\"mb-2\"><strong>Detail:</strong> ' + escapeHtml(String(job.detail)) + '</div>';\n }\n if (job.message) {\n html += '<div class=\"mb-2\"><strong>Message:</strong> ' + escapeHtml(String(job.message)) + '</div>';\n }\n if (job.error_message) {\n html += '<div class=\"mb-2 text-danger\"><strong>Error:</strong> ' + escapeHtml(String(job.error_message)) + '</div>';\n }\n if (job.result_summary) {\n html += '<div class=\"mb-2\"><strong>Result:</strong> ' + escapeHtml(String(job.result_summary)) + '</div>';\n }\n\n var executionPlan = extractExecutionPlan(job);\n if (executionPlan) {\n html += renderExecutionPlan(executionPlan);\n }\n\n var parametersText = toPrettyJson(removeExecutionPlanForDisplay(job.parameters));\n if (parametersText) {\n html += '<div class=\"mb-3\"><h6>Parameters</h6><pre class=\"plugin-job-detail-json\">' + escapeHtml(parametersText) + '</pre></div>';\n }\n var labelsText = toPrettyJson(job.labels);\n if (labelsText) {\n html += '<div class=\"mb-3\"><h6>Labels</h6><pre class=\"plugin-job-detail-json\">' + escapeHtml(labelsText) + '</pre></div>';\n }\n var outputsText = toPrettyJson(job.result_output_values);\n if (outputsText) {\n html += '<div class=\"mb-3\"><h6>Result Output Values</h6><pre class=\"plugin-job-detail-json\">' + escapeHtml(outputsText) + '</pre></div>';\n }\n\n if (runRecord) {\n html += '<div class=\"mb-3\"><h6>Run Record</h6>' +\n '<div><strong>Outcome:</strong> ' + escapeHtml(textOrDash(runRecord.outcome)) + '</div>' +\n '<div><strong>Duration:</strong> ' + escapeHtml(formatDurationMs(runRecord.duration_ms)) + '</div>' +\n '<div><strong>Completed:</strong> ' + escapeHtml(parseTime(runRecord.completed_at) || '-') + '</div>' +\n '<div><strong>Message:</strong> ' + escapeHtml(textOrDash(runRecord.message)) + '</div>' +\n '</div>';\n }\n\n html += '<h6 class=\"mt-3\">Activity Timeline</h6>';\n if (!activities.length) {\n html += '<div class=\"text-muted mb-3\">No activity records.</div>';\n } else {\n html += '<div class=\"table-responsive mb-3\"><table class=\"table table-sm table-striped\">' +\n '<thead><tr><th>Time</th><th>Stage</th><th>Source</th><th>Worker</th><th>Message</th></tr></thead><tbody>';\n for (var i = 0; i < activities.length; i++) {\n var activity = activities[i] || {};\n html += '<tr>' +\n '<td><small>' + escapeHtml(parseTime(activity.occurred_at) || '-') + '</small></td>' +\n '<td>' + escapeHtml(textOrDash(activity.stage)) + '</td>' +\n '<td>' + escapeHtml(textOrDash(activity.source)) + '</td>' +\n '<td>' + escapeHtml(textOrDash(activity.worker_id)) + '</td>' +\n '<td><small>' + escapeHtml(textOrDash(activity.message)) + '</small></td>' +\n '</tr>';\n }\n html += '</tbody></table></div>';\n }\n\n if (relatedJobs.length) {\n html += '<h6>Related Jobs</h6><div class=\"table-responsive\"><table class=\"table table-sm table-hover\">' +\n '<thead><tr><th>Job ID</th><th>State</th><th>Worker</th><th>Updated</th></tr></thead><tbody>';\n for (var j = 0; j < relatedJobs.length; j++) {\n var related = relatedJobs[j] || {};\n html += '<tr>' +\n '<td><small>' + escapeHtml(textOrDash(related.job_id)) + '</small></td>' +\n '<td>' + escapeHtml(textOrDash(related.state)) + '</td>' +\n '<td>' + escapeHtml(textOrDash(related.worker_id)) + '</td>' +\n '<td><small>' + escapeHtml(parseTime(related.updated_at) || '-') + '</small></td>' +\n '</tr>';\n }\n html += '</tbody></table></div>';\n }\n\n contentRoot.innerHTML = html;\n } catch (e) {\n setExpireButtonState(null);\n contentRoot.innerHTML = '<div class=\"alert alert-danger mb-0\">Failed to load job detail: ' + escapeHtml(e.message) + '</div>';\n }\n }\n\n function formatDurationMs(value) {\n var ms = Number(value || 0);\n if (!Number.isFinite(ms) || ms <= 0) {\n return '-';\n }\n if (ms < 1000) {\n return ms + 'ms';\n }\n var sec = Math.floor(ms / 1000);\n var remainMs = ms % 1000;\n if (sec < 60) {\n return sec + '.' + String(Math.floor(remainMs / 100)) + 's';\n }\n var min = Math.floor(sec / 60);\n var remainSec = sec % 60;\n return min + 'm ' + remainSec + 's';\n }\n\n function getWorkerField(worker, name) {\n if (!worker) {\n return null;\n }\n if (worker[name] !== undefined) {\n return worker[name];\n }\n var camel = name.charAt(0).toUpperCase() + name.slice(1);\n if (worker[camel] !== undefined) {\n return worker[camel];\n }\n return null;\n }\n\n function renderStatus() {\n var allJobs = Array.isArray(state.allJobs) ? state.allJobs : [];\n var allActivities = Array.isArray(state.allActivities) ? state.allActivities : [];\n\n var activeCount = allJobs.filter(function(job) {\n return isActiveJobState(job);\n }).length;\n\n document.getElementById('plugin-status-workers').textContent = String(state.workers.length);\n document.getElementById('plugin-status-active-jobs').textContent = String(activeCount);\n document.getElementById('plugin-status-activities').textContent = String(allActivities.length);\n }\n\n function renderJobTypeSummary() {\n var tbody = document.getElementById('plugin-jobtype-summary-body');\n if (!tbody) {\n return;\n }\n\n var activeByType = {};\n var activityByType = {};\n\n var allJobs = Array.isArray(state.allJobs) ? state.allJobs : [];\n var allActivities = Array.isArray(state.allActivities) ? state.allActivities : [];\n\n for (var i = 0; i < allJobs.length; i++) {\n var job = allJobs[i] || {};\n var jobType = String(job.job_type || '').trim();\n if (!jobType) {\n continue;\n }\n var isActive = isActiveJobState(job);\n if (!isActive) {\n continue;\n }\n if (!activeByType[jobType]) {\n activeByType[jobType] = 0;\n }\n activeByType[jobType]++;\n }\n\n for (var j = 0; j < allActivities.length; j++) {\n var activity = allActivities[j] || {};\n var activityJobType = String(activity.job_type || '').trim();\n if (!activityJobType) {\n continue;\n }\n if (!activityByType[activityJobType]) {\n activityByType[activityJobType] = 0;\n }\n activityByType[activityJobType]++;\n }\n\n var known = Array.isArray(state.jobTypes) ? state.jobTypes.slice() : [];\n var seen = {};\n var jobTypes = [];\n\n for (var k = 0; k < known.length; k++) {\n var item = parseJobTypeItem(known[k]);\n var knownType = item && item.jobType ? String(item.jobType).trim() : '';\n if (!knownType || seen[knownType]) {\n continue;\n }\n seen[knownType] = true;\n jobTypes.push(knownType);\n }\n\n Object.keys(activeByType).forEach(function(jobType) {\n if (!seen[jobType]) {\n seen[jobType] = true;\n jobTypes.push(jobType);\n }\n });\n Object.keys(activityByType).forEach(function(jobType) {\n if (!seen[jobType]) {\n seen[jobType] = true;\n jobTypes.push(jobType);\n }\n });\n\n jobTypes.sort();\n\n if (jobTypes.length === 0) {\n tbody.innerHTML = '<tr><td colspan=\\\"3\\\" class=\\\"text-muted text-center py-3\\\">No job types discovered</td></tr>';\n return;\n }\n\n var rows = '';\n for (var m = 0; m < jobTypes.length; m++) {\n var rowType = jobTypes[m];\n rows += '<tr>' +\n '<td>' + escapeHtml(rowType) + '</td>' +\n '<td><span class=\\\"badge bg-warning text-dark\\\">' + escapeHtml(String(activeByType[rowType] || 0)) + '</span></td>' +\n '<td><span class=\\\"badge bg-info\\\">' + escapeHtml(String(activityByType[rowType] || 0)) + '</span></td>' +\n '</tr>';\n }\n tbody.innerHTML = rows;\n }\n\n function computeEffectiveExecutionCapacity(globalExec, perWorkerExec, executorWorkers) {\n var capacities = [];\n if (globalExec > 0) {\n capacities.push(globalExec);\n }\n var workerCapacity = perWorkerExec > 0 && executorWorkers > 0 ? (perWorkerExec * executorWorkers) : 0;\n if (workerCapacity > 0) {\n capacities.push(workerCapacity);\n }\n if (!capacities.length) {\n return 0;\n }\n var effective = capacities[0];\n for (var i = 1; i < capacities.length; i++) {\n if (capacities[i] < effective) {\n effective = capacities[i];\n }\n }\n return effective;\n }\n\n function renderSchedulerStates() {\n var tbody = document.getElementById('plugin-scheduler-table-body');\n if (!tbody) {\n return;\n }\n\n var states = Array.isArray(state.schedulerStates) ? state.schedulerStates : [];\n if (!states.length) {\n tbody.innerHTML = '<tr><td colspan=\"10\" class=\"text-muted text-center py-3\">No scheduler state available</td></tr>';\n return;\n }\n\n var rows = '';\n for (var i = 0; i < states.length; i++) {\n var item = states[i] || {};\n var enabled = !!item.enabled;\n var inFlight = !!item.detection_in_flight;\n var detector = item.detector_available ? textOrDash(item.detector_worker_id) : 'No detector';\n var maxRuntimeSeconds = Number(item.job_type_max_runtime_seconds || 0);\n var maxRuntimeText = maxRuntimeSeconds > 0 ? (String(maxRuntimeSeconds) + 's') : '-';\n var globalExec = Number(item.global_execution_concurrency || 0);\n var perWorkerExec = Number(item.per_worker_execution_concurrency || 0);\n var executorWorkers = Number(item.executor_worker_count || 0);\n var effectiveExec = computeEffectiveExecutionCapacity(globalExec, perWorkerExec, executorWorkers);\n var globalExecText = enabled ? String(globalExec) : '-';\n var perWorkerExecText = enabled ? String(perWorkerExec) : '-';\n var executorWorkersText = enabled ? String(executorWorkers) : '-';\n var effectiveExecText = enabled ? String(effectiveExec) : '-';\n var lastRunStatus = textOrDash(item.last_run_status);\n var lastRunTime = parseTime(item.last_run_completed_at);\n var lastRunText = '-';\n if (lastRunStatus !== '-' || lastRunTime) {\n var statusLabel = lastRunStatus !== '-' ? lastRunStatus : 'run';\n lastRunText = lastRunTime ? (statusLabel + ' @ ' + lastRunTime) : statusLabel;\n }\n\n var enabledBadge = enabled ? '<span class=\"badge bg-success\">Enabled</span>' : '<span class=\"badge bg-secondary\">Disabled</span>';\n var inFlightBadge = inFlight ? '<span class=\"badge bg-warning text-dark\">Yes</span>' : '<span class=\"badge bg-light text-dark\">No</span>';\n var policyErrorHtml = '';\n if (item.policy_error) {\n policyErrorHtml = '<div><small class=\"text-danger\">' + escapeHtml(String(item.policy_error)) + '</small></div>';\n }\n\n rows += '<tr>' +\n '<td>' + escapeHtml(textOrDash(item.job_type)) + policyErrorHtml + '</td>' +\n '<td>' + enabledBadge + '</td>' +\n '<td><small>' + escapeHtml(detector) + '</small></td>' +\n '<td>' + inFlightBadge + '</td>' +\n '<td><small>' + escapeHtml(maxRuntimeText) + '</small></td>' +\n '<td><small>' + escapeHtml(globalExecText) + '</small></td>' +\n '<td><small>' + escapeHtml(perWorkerExecText) + '</small></td>' +\n '<td><small>' + escapeHtml(executorWorkersText) + '</small></td>' +\n '<td><small>' + escapeHtml(effectiveExecText) + '</small></td>' +\n '<td><small>' + escapeHtml(lastRunText) + '</small></td>' +\n '</tr>';\n }\n\n tbody.innerHTML = rows;\n }\n\n function renderSchedulerStatus() {\n window.renderPluginSchedulerStatus({scheduler: state.schedulerStatus, lock: state.schedulerLock, job_type: monitorJobTypeScope()});\n var valueNodes = document.querySelectorAll('.plugin-scheduler-next-run');\n if (!valueNodes.length) {\n return;\n }\n var metaNodes = document.querySelectorAll('.plugin-scheduler-next-run-meta');\n var status = state.schedulerStatus || {};\n var nextRun = parseTime(status.next_detection_at);\n var display = nextRun || '-';\n valueNodes.forEach(function(node) {\n node.textContent = display;\n });\n var metaText = nextRun ? 'Next scheduled check (local time); locks and other jobs may delay detection.' : 'Not scheduled';\n if (metaNodes.length) {\n metaNodes.forEach(function(node) {\n node.textContent = metaText;\n });\n }\n }\n\n function renderWorkers() {\n var tbody = document.getElementById('plugin-workers-table-body');\n if (!state.workers.length) {\n tbody.innerHTML = '<tr><td colspan=\"4\" class=\"text-muted text-center py-3\">No connected workers</td></tr>';\n return;\n }\n\n var rows = '';\n for (var i = 0; i < state.workers.length; i++) {\n var worker = state.workers[i];\n var workerID = textOrDash(getWorkerField(worker, 'workerID'));\n var address = textOrDash(getWorkerField(worker, 'address'));\n var caps = getWorkerField(worker, 'capabilities') || {};\n var capBadges = [];\n\n Object.keys(caps).sort().forEach(function(jobType) {\n var cap = caps[jobType] || {};\n var labels = [];\n if (cap.can_detect) {\n labels.push('D');\n }\n if (cap.can_execute) {\n labels.push('E');\n }\n var text = jobType;\n if (labels.length) {\n text += ' (' + labels.join('/') + ')';\n }\n capBadges.push('<span class=\"badge bg-secondary plugin-capability-badge\">' + escapeHtml(text) + '</span>');\n });\n\n if (!capBadges.length) {\n capBadges.push('<span class=\"text-muted\">-</span>');\n }\n\n var heartbeat = getWorkerField(worker, 'heartbeat') || {};\n var detUsed = Number(heartbeat.detection_slots_used || heartbeat.DetectionSlotsUsed || 0);\n var detTotal = Number(heartbeat.detection_slots_total || heartbeat.DetectionSlotsTotal || 0);\n var execUsed = Number(heartbeat.execution_slots_used || heartbeat.ExecutionSlotsUsed || 0);\n var execTotal = Number(heartbeat.execution_slots_total || heartbeat.ExecutionSlotsTotal || 0);\n var runningWork = heartbeat.running_work || heartbeat.RunningWork || [];\n var queuedByType = heartbeat.queued_jobs_by_type || heartbeat.QueuedJobsByType || {};\n var queuedTotal = 0;\n Object.keys(queuedByType || {}).forEach(function(jobType) {\n var queuedCount = Number(queuedByType[jobType] || 0);\n if (Number.isFinite(queuedCount) && queuedCount > 0) {\n queuedTotal += queuedCount;\n }\n });\n var loadLines = [];\n loadLines.push('Detect: ' + String(detUsed) + '/' + String(detTotal));\n loadLines.push('Execute: ' + String(execUsed) + '/' + String(execTotal));\n loadLines.push('Running: ' + String(Array.isArray(runningWork) ? runningWork.length : 0));\n loadLines.push('Queued: ' + String(queuedTotal));\n\n rows += '<tr>' +\n '<td><div class=\"fw-semibold\">' + escapeHtml(workerID) + '</div></td>' +\n '<td><small>' + escapeHtml(address) + '</small></td>' +\n '<td>' + capBadges.join('') + '</td>' +\n '<td><small>' + escapeHtml(loadLines.join(' | ')) + '</small></td>' +\n '</tr>';\n }\n\n tbody.innerHTML = rows;\n }\n\n function normalizeJobStateForFilter(value) {\n var normalized = String(value || '').toLowerCase();\n if (normalized.indexOf('job_state_') === 0) {\n normalized = normalized.slice('job_state_'.length);\n }\n return normalized;\n }\n\n function matchesExecutionStateFilter(jobState, selectedFilter) {\n var target = normalizeJobStateForFilter(selectedFilter);\n if (!target) {\n return true;\n }\n var actual = normalizeJobStateForFilter(jobState);\n if (actual === target) {\n return true;\n }\n if (target === 'running' && actual === 'in_progress') {\n return true;\n }\n return false;\n }\n\n function isDetectionActivitySource(source) {\n var normalized = String(source || '').toLowerCase();\n if (!normalized) {\n return false;\n }\n if (normalized === 'worker_detection') {\n return true;\n }\n return normalized.indexOf('detector') >= 0;\n }\n\n function renderExecutionJobs() {\n var tbody = document.getElementById('plugin-execution-jobs-table-body');\n if (!tbody) {\n return;\n }\n\n var filteredJobs = [];\n var jobs = Array.isArray(state.jobs) ? state.jobs : [];\n for (var i = 0; i < jobs.length; i++) {\n var job = jobs[i] || {};\n var jobType = String(job.job_type || '').trim();\n if (state.selectedJobType && jobType !== state.selectedJobType) {\n continue;\n }\n if (!matchesExecutionStateFilter(job.state, state.monitorExecutionJobState)) {\n continue;\n }\n filteredJobs.push(job);\n }\n\n if (!filteredJobs.length) {\n tbody.innerHTML = '<tr><td colspan=\"7\" class=\"text-muted text-center py-3\">No execution jobs tracked yet</td></tr>';\n return;\n }\n\n var rows = '';\n for (var j = 0; j < filteredJobs.length; j++) {\n var executionJob = filteredJobs[j] || {};\n var progress = Number(executionJob.progress || 0);\n if (!Number.isFinite(progress) || progress < 0) {\n progress = 0;\n }\n if (progress > 100) {\n progress = 100;\n }\n\n var barClass = 'bg-info';\n var stateText = String(executionJob.state || 'unknown').toLowerCase();\n if (stateText.indexOf('failed') >= 0) {\n barClass = 'bg-danger';\n } else if (stateText.indexOf('succeed') >= 0 || stateText.indexOf('complete') >= 0) {\n barClass = 'bg-success';\n } else if (stateText.indexOf('run') >= 0 || stateText.indexOf('progress') >= 0) {\n barClass = 'bg-warning';\n }\n\n var jobTypeCell = escapeHtml(textOrDash(executionJob.job_type));\n var execLabels = executionJob.labels || {};\n if (execLabels.batch === 'true' && execLabels.batch_size) {\n jobTypeCell += ' <span class=\"badge bg-info\">' + escapeHtml(execLabels.batch_size) + ' moves</span>';\n }\n\n rows += '<tr>' +\n '<td>' + renderJobLink(executionJob.job_id) + '</td>' +\n '<td>' + jobTypeCell + '</td>' +\n '<td><span class=\"badge bg-light text-dark\">' + escapeHtml(textOrDash(executionJob.state)) + '</span></td>' +\n '<td class=\"plugin-job-progress\"><div class=\"progress\" style=\"height: 14px;\"><div class=\"progress-bar ' + barClass + '\" role=\"progressbar\" style=\"width:' + progress + '%\">' + Math.round(progress) + '%</div></div></td>' +\n '<td><small>' + escapeHtml(textOrDash(executionJob.worker_id)) + '</small></td>' +\n '<td><small>' + escapeHtml(parseTime(executionJob.updated_at) || '-') + '</small></td>' +\n '<td><small>' + escapeHtml(textOrDash(executionJob.message)) + '</small></td>' +\n '</tr>';\n }\n\n tbody.innerHTML = rows;\n }\n\n function renderQueueJobs() {\n var tbody = document.getElementById('plugin-queue-jobs-table-body');\n if (!tbody) {\n return;\n }\n\n var filteredJobs = [];\n var jobs = Array.isArray(state.jobs) ? state.jobs : [];\n for (var i = 0; i < jobs.length; i++) {\n var queueJob = jobs[i] || {};\n var queueJobType = String(queueJob.job_type || '').trim();\n if (state.selectedJobType && queueJobType !== state.selectedJobType) {\n continue;\n }\n var normalizedState = normalizeJobStateForFilter(queueJob.state);\n if (normalizedState !== 'pending' && normalizedState !== 'assigned' && normalizedState !== 'running' && normalizedState !== 'in_progress') {\n continue;\n }\n filteredJobs.push(queueJob);\n }\n\n if (!filteredJobs.length) {\n tbody.innerHTML = '<tr><td colspan=\"7\" class=\"text-muted text-center py-3\">No queued/active jobs</td></tr>';\n return;\n }\n\n var rows = '';\n for (var j = 0; j < filteredJobs.length; j++) {\n var queueItem = filteredJobs[j] || {};\n var progress = Number(queueItem.progress || 0);\n if (!Number.isFinite(progress) || progress < 0) {\n progress = 0;\n }\n if (progress > 100) {\n progress = 100;\n }\n\n var barClass = 'bg-warning';\n var queueStateText = String(queueItem.state || 'unknown').toLowerCase();\n if (queueStateText.indexOf('run') >= 0 || queueStateText.indexOf('progress') >= 0) {\n barClass = 'bg-info';\n }\n\n rows += '<tr>' +\n '<td>' + renderJobLink(queueItem.job_id) + '</td>' +\n '<td>' + escapeHtml(textOrDash(queueItem.job_type)) + '</td>' +\n '<td><span class=\"badge bg-light text-dark\">' + escapeHtml(textOrDash(queueItem.state)) + '</span></td>' +\n '<td class=\"plugin-job-progress\"><div class=\"progress\" style=\"height: 14px;\"><div class=\"progress-bar ' + barClass + '\" role=\"progressbar\" style=\"width:' + progress + '%\">' + Math.round(progress) + '%</div></div></td>' +\n '<td><small>' + escapeHtml(textOrDash(queueItem.worker_id)) + '</small></td>' +\n '<td><small>' + escapeHtml(parseTime(queueItem.updated_at) || '-') + '</small></td>' +\n '<td><small>' + escapeHtml(textOrDash(queueItem.message)) + '</small></td>' +\n '</tr>';\n }\n\n tbody.innerHTML = rows;\n }\n\n function renderDetectionJobs() {\n var tbody = document.getElementById('plugin-detection-table-body');\n if (!tbody) {\n return;\n }\n\n var filteredActivities = [];\n var activities = Array.isArray(state.activities) ? state.activities : [];\n for (var i = 0; i < activities.length; i++) {\n var activity = activities[i] || {};\n var jobType = String(activity.job_type || '').trim();\n if (state.selectedJobType && jobType !== state.selectedJobType) {\n continue;\n }\n if (!isDetectionActivitySource(activity.source)) {\n continue;\n }\n filteredActivities.push(activity);\n }\n\n if (!filteredActivities.length) {\n tbody.innerHTML = '<tr><td colspan=\"7\" class=\"text-muted text-center py-3\">No detection jobs tracked yet</td></tr>';\n return;\n }\n\n var rows = '';\n for (var j = 0; j < filteredActivities.length; j++) {\n var detectionActivity = filteredActivities[j] || {};\n rows += '<tr>' +\n '<td><small>' + escapeHtml(parseTime(detectionActivity.occurred_at) || '-') + '</small></td>' +\n '<td>' + escapeHtml(textOrDash(detectionActivity.job_type)) + '</td>' +\n '<td><small>' + escapeHtml(textOrDash(detectionActivity.request_id)) + '</small></td>' +\n '<td><small>' + escapeHtml(textOrDash(detectionActivity.worker_id)) + '</small></td>' +\n '<td>' + escapeHtml(textOrDash(detectionActivity.stage)) + '</td>' +\n '<td><span class=\"badge bg-light text-dark\">' + escapeHtml(textOrDash(detectionActivity.source)) + '</span></td>' +\n '<td><small>' + escapeHtml(textOrDash(detectionActivity.message)) + '</small></td>' +\n '</tr>';\n }\n\n tbody.innerHTML = rows;\n }\n\n function renderExecutionActivities() {\n var tbody = document.getElementById('plugin-execution-activities-table-body');\n if (!tbody) {\n return;\n }\n\n var filteredActivities = [];\n var activities = Array.isArray(state.activities) ? state.activities : [];\n for (var i = 0; i < activities.length; i++) {\n var activity = activities[i] || {};\n if (isDetectionActivitySource(activity.source)) {\n continue;\n }\n var jobType = String(activity.job_type || '').trim();\n if (state.selectedJobType && jobType !== state.selectedJobType) {\n continue;\n }\n filteredActivities.push(activity);\n }\n\n if (!filteredActivities.length) {\n tbody.innerHTML = '<tr><td colspan=\"6\" class=\"text-muted text-center py-3\">No execution activities yet</td></tr>';\n return;\n }\n\n var rows = '';\n for (var j = 0; j < filteredActivities.length; j++) {\n var executionActivity = filteredActivities[j] || {};\n rows += '<tr>' +\n '<td><small>' + escapeHtml(parseTime(executionActivity.occurred_at) || '-') + '</small></td>' +\n '<td>' + escapeHtml(textOrDash(executionActivity.job_type)) + '</td>' +\n '<td>' + renderJobLink(executionActivity.job_id) + '</td>' +\n '<td><span class=\"badge bg-light text-dark\">' + escapeHtml(textOrDash(executionActivity.source)) + '</span></td>' +\n '<td>' + escapeHtml(textOrDash(executionActivity.stage)) + '</td>' +\n '<td><small>' + escapeHtml(textOrDash(executionActivity.message)) + '</small></td>' +\n '</tr>';\n }\n\n tbody.innerHTML = rows;\n }\n\n function getSelectValueArray(selectEl) {\n if (!selectEl) {\n return [];\n }\n var values = [];\n for (var i = 0; i < selectEl.options.length; i++) {\n if (selectEl.options[i].selected) {\n values.push(selectEl.options[i].value);\n }\n }\n return values;\n }\n\n function configValueToNative(configValue) {\n if (!configValue || typeof configValue !== 'object') {\n return null;\n }\n if (Object.prototype.hasOwnProperty.call(configValue, 'bool_value')) {\n return !!configValue.bool_value;\n }\n if (Object.prototype.hasOwnProperty.call(configValue, 'int64_value')) {\n return configValue.int64_value;\n }\n if (Object.prototype.hasOwnProperty.call(configValue, 'double_value')) {\n return configValue.double_value;\n }\n if (Object.prototype.hasOwnProperty.call(configValue, 'string_value')) {\n return configValue.string_value;\n }\n if (Object.prototype.hasOwnProperty.call(configValue, 'bytes_value')) {\n return configValue.bytes_value;\n }\n if (Object.prototype.hasOwnProperty.call(configValue, 'duration_value')) {\n return configValue.duration_value;\n }\n if (configValue.string_list && Array.isArray(configValue.string_list.values)) {\n return configValue.string_list.values.slice();\n }\n if (configValue.int64_list && Array.isArray(configValue.int64_list.values)) {\n return configValue.int64_list.values.slice();\n }\n if (configValue.double_list && Array.isArray(configValue.double_list.values)) {\n return configValue.double_list.values.slice();\n }\n if (configValue.bool_list && Array.isArray(configValue.bool_list.values)) {\n return configValue.bool_list.values.slice();\n }\n if (configValue.list_value && Array.isArray(configValue.list_value.values)) {\n return configValue.list_value.values.map(function(v) {\n return configValueToNative(v);\n });\n }\n if (configValue.map_value && configValue.map_value.fields) {\n var out = {};\n Object.keys(configValue.map_value.fields).forEach(function(k) {\n out[k] = configValueToNative(configValue.map_value.fields[k]);\n });\n return out;\n }\n return null;\n }\n\n function inferConfigValue(value) {\n if (value === null || value === undefined) {\n return { string_value: '' };\n }\n if (typeof value === 'boolean') {\n return { bool_value: value };\n }\n if (typeof value === 'number') {\n if (Number.isInteger(value)) {\n return { int64_value: String(value) };\n }\n return { double_value: value };\n }\n if (typeof value === 'string') {\n return { string_value: value };\n }\n if (Array.isArray(value)) {\n var listValues = value.map(function(item) {\n return inferConfigValue(item);\n });\n return { list_value: { values: listValues } };\n }\n if (typeof value === 'object') {\n var fields = {};\n Object.keys(value).forEach(function(key) {\n fields[key] = inferConfigValue(value[key]);\n });\n return { map_value: { fields: fields } };\n }\n return { string_value: String(value) };\n }\n\n function nativeToConfigValue(value, fieldType, widget, field) {\n var normalizedFieldType = normalizeEnum(fieldType);\n var normalizedWidget = normalizeEnum(widget);\n\n if (normalizedFieldType === 'CONFIG_FIELD_TYPE_BOOL') {\n return { bool_value: !!value };\n }\n\n if (normalizedFieldType === 'CONFIG_FIELD_TYPE_INT64') {\n if (value === '' || value === null || value === undefined) {\n return null;\n }\n var intValue = parseInt(value, 10);\n if (Number.isNaN(intValue)) {\n throw new Error('Invalid int64 value for field ' + field.name);\n }\n return { int64_value: String(intValue) };\n }\n\n if (normalizedFieldType === 'CONFIG_FIELD_TYPE_DOUBLE') {\n if (value === '' || value === null || value === undefined) {\n return null;\n }\n var doubleValue = parseFloat(value);\n if (Number.isNaN(doubleValue)) {\n throw new Error('Invalid number for field ' + field.name);\n }\n return { double_value: doubleValue };\n }\n\n if (normalizedFieldType === 'CONFIG_FIELD_TYPE_DURATION') {\n if (value === '' || value === null || value === undefined) {\n return null;\n }\n var text = String(value).trim();\n if (!text) {\n return null;\n }\n if (/^\\d+$/.test(text)) {\n text += 's';\n }\n return { duration_value: text };\n }\n\n if (normalizedFieldType === 'CONFIG_FIELD_TYPE_LIST') {\n if (value === '' || value === null || value === undefined) {\n return null;\n }\n\n if (normalizedWidget === 'CONFIG_WIDGET_MULTI_SELECT' && Array.isArray(value)) {\n return { string_list: { values: value } };\n }\n\n if (typeof value === 'string') {\n try {\n var parsed = JSON.parse(value);\n if (!Array.isArray(parsed)) {\n throw new Error('Expected JSON array');\n }\n return inferConfigValue(parsed);\n } catch (e) {\n throw new Error('Invalid JSON list for field ' + field.name + ': ' + e.message);\n }\n }\n return inferConfigValue(value);\n }\n\n if (normalizedFieldType === 'CONFIG_FIELD_TYPE_OBJECT') {\n if (value === '' || value === null || value === undefined) {\n return null;\n }\n if (typeof value === 'string') {\n try {\n var parsedObject = JSON.parse(value);\n if (!parsedObject || typeof parsedObject !== 'object' || Array.isArray(parsedObject)) {\n throw new Error('Expected JSON object');\n }\n return inferConfigValue(parsedObject);\n } catch (e) {\n throw new Error('Invalid JSON object for field ' + field.name + ': ' + e.message);\n }\n }\n return inferConfigValue(value);\n }\n\n if (normalizedFieldType === 'CONFIG_FIELD_TYPE_ENUM') {\n if (normalizedWidget === 'CONFIG_WIDGET_MULTI_SELECT') {\n if (!value || !value.length) {\n return null;\n }\n return { string_list: { values: value } };\n }\n if (value === '' || value === null || value === undefined) {\n return null;\n }\n return { string_value: String(value) };\n }\n\n if (value === '' || value === null || value === undefined) {\n return null;\n }\n\n return { string_value: String(value) };\n }\n\n function toInputID(scope, fieldName) {\n return 'plugin-' + scope + '-field-' + String(fieldName || '').replace(/[^a-zA-Z0-9_-]/g, '_');\n }\n\n function resolveFieldConfigValue(scope, field) {\n if (!field || !field.name) {\n return null;\n }\n var fromConfig = null;\n if (state.config) {\n if (scope === 'admin' && state.config.admin_config_values) {\n fromConfig = state.config.admin_config_values[field.name];\n }\n if (scope === 'worker' && state.config.worker_config_values) {\n fromConfig = state.config.worker_config_values[field.name];\n }\n }\n if (fromConfig) {\n return fromConfig;\n }\n\n var formDefaults = null;\n if (scope === 'admin' && state.descriptor && state.descriptor.admin_config_form && state.descriptor.admin_config_form.default_values) {\n formDefaults = state.descriptor.admin_config_form.default_values[field.name];\n }\n if (scope === 'worker' && state.descriptor && state.descriptor.worker_config_form && state.descriptor.worker_config_form.default_values) {\n formDefaults = state.descriptor.worker_config_form.default_values[field.name];\n }\n if (formDefaults) {\n return formDefaults;\n }\n\n if (scope === 'worker' && state.descriptor && state.descriptor.worker_default_values) {\n return state.descriptor.worker_default_values[field.name] || null;\n }\n\n return null;\n }\n\n function renderFieldInput(scope, field, value) {\n var inputID = toInputID(scope, field.name);\n var normalizedType = normalizeEnum(field.field_type);\n var normalizedWidget = normalizeEnum(field.widget);\n var input;\n\n if (normalizedType === 'CONFIG_FIELD_TYPE_BOOL' || normalizedWidget === 'CONFIG_WIDGET_TOGGLE') {\n input = document.createElement('input');\n input.type = 'checkbox';\n input.className = 'form-check-input';\n input.id = inputID;\n input.checked = !!value;\n } else if ((normalizedType === 'CONFIG_FIELD_TYPE_ENUM' && normalizedWidget === 'CONFIG_WIDGET_MULTI_SELECT') || normalizedWidget === 'CONFIG_WIDGET_MULTI_SELECT') {\n input = document.createElement('select');\n input.className = 'form-select';\n input.id = inputID;\n input.multiple = true;\n var selected = Array.isArray(value) ? value : [];\n var options = Array.isArray(field.options) ? field.options : [];\n for (var i = 0; i < options.length; i++) {\n var option = document.createElement('option');\n option.value = options[i].value || '';\n option.textContent = options[i].label || options[i].value || '';\n if (selected.indexOf(option.value) >= 0) {\n option.selected = true;\n }\n input.appendChild(option);\n }\n } else if (normalizedType === 'CONFIG_FIELD_TYPE_ENUM' || normalizedWidget === 'CONFIG_WIDGET_SELECT') {\n input = document.createElement('select');\n input.className = 'form-select';\n input.id = inputID;\n var blankOption = document.createElement('option');\n blankOption.value = '';\n blankOption.textContent = '-- select --';\n input.appendChild(blankOption);\n var enumOptions = Array.isArray(field.options) ? field.options : [];\n for (var j = 0; j < enumOptions.length; j++) {\n var enumOption = document.createElement('option');\n enumOption.value = enumOptions[j].value || '';\n enumOption.textContent = enumOptions[j].label || enumOptions[j].value || '';\n if (String(value) === enumOption.value) {\n enumOption.selected = true;\n }\n input.appendChild(enumOption);\n }\n } else if (normalizedType === 'CONFIG_FIELD_TYPE_INT64' || normalizedType === 'CONFIG_FIELD_TYPE_DOUBLE' || normalizedWidget === 'CONFIG_WIDGET_NUMBER') {\n input = document.createElement('input');\n input.type = 'number';\n if (normalizedType === 'CONFIG_FIELD_TYPE_DOUBLE') {\n input.step = 'any';\n }\n input.className = 'form-control';\n input.id = inputID;\n if (value !== null && value !== undefined && value !== '') {\n input.value = String(value);\n }\n } else if (normalizedType === 'CONFIG_FIELD_TYPE_LIST' || normalizedType === 'CONFIG_FIELD_TYPE_OBJECT' || normalizedWidget === 'CONFIG_WIDGET_TEXTAREA') {\n input = document.createElement('textarea');\n input.className = 'form-control';\n input.id = inputID;\n input.rows = 4;\n if (normalizedType === 'CONFIG_FIELD_TYPE_LIST' || normalizedType === 'CONFIG_FIELD_TYPE_OBJECT') {\n input.placeholder = normalizedType === 'CONFIG_FIELD_TYPE_LIST' ? '[...]' : '{...}';\n }\n if (value !== null && value !== undefined && value !== '') {\n if (typeof value === 'object') {\n input.value = JSON.stringify(value, null, 2);\n } else {\n input.value = String(value);\n }\n }\n } else {\n input = document.createElement('input');\n input.className = 'form-control';\n input.id = inputID;\n if (normalizedWidget === 'CONFIG_WIDGET_PASSWORD' || field.sensitive) {\n input.type = 'password';\n } else {\n input.type = 'text';\n }\n if (value !== null && value !== undefined && value !== '') {\n input.value = String(value);\n }\n }\n\n if (field.placeholder && input.tagName === 'INPUT') {\n input.placeholder = field.placeholder;\n }\n if (field.placeholder && input.tagName === 'TEXTAREA') {\n input.placeholder = field.placeholder;\n }\n\n if (field.required) {\n input.required = true;\n }\n if (field.read_only) {\n input.disabled = true;\n }\n\n return input;\n }\n\n function shardTransferParallelOn(nativeValue) {\n if (nativeValue === null || nativeValue === undefined || nativeValue === '') {\n return true;\n }\n var n = parseInt(nativeValue, 10);\n if (Number.isNaN(n)) {\n return true;\n }\n return n !== 0;\n }\n\n function shardTransferMaxText(nativeValue) {\n if (nativeValue === null || nativeValue === undefined || nativeValue === '') {\n return '';\n }\n var n = parseInt(nativeValue, 10);\n if (Number.isNaN(n) || n <= 0) {\n return '';\n }\n return String(n);\n }\n\n // Presentation of the single persisted max_shard_transfers value.\n // Unchecked stores 0. Checked with an empty max omits the key.\n function renderShardTransferControls(scope, field, nativeValue) {\n var parallelOn = shardTransferParallelOn(nativeValue);\n var wrapper = document.createElement('div');\n wrapper.className = 'mb-3 plugin-field';\n wrapper.dataset.scope = scope;\n wrapper.dataset.fieldName = field.name;\n wrapper.dataset.fieldType = normalizeEnum(field.field_type);\n wrapper.dataset.widget = 'SHARD_TRANSFERS';\n\n var checkWrap = document.createElement('div');\n checkWrap.className = 'form-check form-switch mb-2';\n var box = document.createElement('input');\n box.type = 'checkbox';\n box.className = 'form-check-input';\n box.id = toInputID(scope, field.name) + '-parallel';\n box.checked = parallelOn;\n var boxLabel = document.createElement('label');\n boxLabel.className = 'form-check-label';\n boxLabel.setAttribute('for', box.id);\n boxLabel.textContent = 'Parallel shard distribution';\n checkWrap.appendChild(box);\n checkWrap.appendChild(boxLabel);\n wrapper.appendChild(checkWrap);\n\n var numberLabel = document.createElement('label');\n numberLabel.className = 'form-label';\n numberLabel.setAttribute('for', toInputID(scope, field.name));\n numberLabel.textContent = 'Max transfers';\n wrapper.appendChild(numberLabel);\n\n var input = document.createElement('input');\n input.type = 'number';\n input.min = '1';\n input.step = '1';\n input.className = 'form-control';\n input.id = toInputID(scope, field.name);\n input.placeholder = 'no global cap';\n input.value = shardTransferMaxText(nativeValue);\n input.disabled = !parallelOn;\n wrapper.appendChild(input);\n\n box.addEventListener('change', function() {\n input.disabled = !box.checked;\n });\n\n var help = document.createElement('div');\n help.className = 'form-text';\n help.textContent = field.description || 'Unchecked sends shards sequentially. Checked with an empty max uses one in-flight copy per destination disk. A number is a global cap, still one copy per disk.';\n wrapper.appendChild(help);\n return wrapper;\n }\n\n function collectShardTransferValue(scope) {\n var box = document.getElementById(toInputID(scope, 'max_shard_transfers') + '-parallel');\n var input = document.getElementById(toInputID(scope, 'max_shard_transfers'));\n if (!box || !input) {\n return null;\n }\n if (!box.checked) {\n return { int64_value: '0' };\n }\n var raw = String(input.value || '').trim();\n if (raw === '') {\n return null;\n }\n if (!/^\\d+$/.test(raw)) {\n throw new Error('Invalid int64 value for field Max transfers');\n }\n var n = parseInt(raw, 10);\n if (n <= 0) {\n return { int64_value: '0' };\n }\n return { int64_value: String(n) };\n }\n\n function renderConfigForm(scope, rootID, form) {\n var root = document.getElementById(rootID);\n if (!root) {\n return;\n }\n\n root.innerHTML = '';\n if (!form || !Array.isArray(form.sections) || form.sections.length === 0) {\n root.innerHTML = '<div class=\"text-muted\">No fields provided by descriptor.</div>';\n return;\n }\n\n for (var s = 0; s < form.sections.length; s++) {\n var section = form.sections[s] || {};\n var sectionCard = document.createElement('div');\n sectionCard.className = 'card mb-3';\n\n var sectionHeader = document.createElement('div');\n sectionHeader.className = 'card-header py-2';\n sectionHeader.innerHTML = '<strong>' + escapeHtml(textOrDash(section.title || section.section_id)) + '</strong>';\n sectionCard.appendChild(sectionHeader);\n\n var sectionBody = document.createElement('div');\n sectionBody.className = 'card-body';\n\n if (section.description) {\n var sectionDescription = document.createElement('p');\n sectionDescription.className = 'text-muted small';\n sectionDescription.textContent = section.description;\n sectionBody.appendChild(sectionDescription);\n }\n\n var fields = Array.isArray(section.fields) ? section.fields : [];\n if (!fields.length) {\n var noFields = document.createElement('div');\n noFields.className = 'text-muted';\n noFields.textContent = 'No fields in this section.';\n sectionBody.appendChild(noFields);\n }\n\n for (var f = 0; f < fields.length; f++) {\n var field = fields[f] || {};\n if (!field.name) {\n continue;\n }\n\n var configValue = resolveFieldConfigValue(scope, field);\n var nativeValue = configValueToNative(configValue);\n\n if (field.name === 'max_shard_transfers') {\n sectionBody.appendChild(renderShardTransferControls(scope, field, nativeValue));\n continue;\n }\n\n var wrapper = document.createElement('div');\n wrapper.className = 'mb-3 plugin-field';\n wrapper.dataset.scope = scope;\n wrapper.dataset.fieldName = field.name;\n wrapper.dataset.fieldType = normalizeEnum(field.field_type);\n wrapper.dataset.widget = normalizeEnum(field.widget);\n wrapper.dataset.visibleWhenField = field.visible_when_field || '';\n wrapper.dataset.visibleWhenEquals = JSON.stringify(field.visible_when_equals || null);\n\n var label = document.createElement('label');\n label.className = 'form-label';\n label.setAttribute('for', toInputID(scope, field.name));\n label.innerHTML = escapeHtml(field.label || field.name) + (field.required ? ' <span class=\"text-danger\">*</span>' : '');\n wrapper.appendChild(label);\n\n var input = renderFieldInput(scope, field, nativeValue);\n wrapper.appendChild(input);\n\n if (field.description || field.help_text) {\n var help = document.createElement('div');\n help.className = 'form-text';\n help.textContent = field.help_text || field.description || '';\n wrapper.appendChild(help);\n }\n\n sectionBody.appendChild(wrapper);\n }\n\n sectionCard.appendChild(sectionBody);\n root.appendChild(sectionCard);\n }\n\n root.addEventListener('change', function() {\n applyVisibility(scope);\n });\n root.addEventListener('input', function() {\n applyVisibility(scope);\n });\n\n applyVisibility(scope);\n }\n\n function readRawFieldValue(scope, fieldName) {\n var input = document.getElementById(toInputID(scope, fieldName));\n if (!input) {\n return null;\n }\n if (input.tagName === 'SELECT' && input.multiple) {\n return getSelectValueArray(input);\n }\n if (input.type === 'checkbox') {\n return !!input.checked;\n }\n return input.value;\n }\n\n function compareVisibleValue(currentValue, expectedValueObject) {\n if (!expectedValueObject) {\n return true;\n }\n var expectedNative = configValueToNative(expectedValueObject);\n if (Array.isArray(expectedNative)) {\n if (!Array.isArray(currentValue)) {\n return false;\n }\n if (expectedNative.length !== currentValue.length) {\n return false;\n }\n for (var i = 0; i < expectedNative.length; i++) {\n if (String(expectedNative[i]) !== String(currentValue[i])) {\n return false;\n }\n }\n return true;\n }\n return String(currentValue) === String(expectedNative);\n }\n\n function applyVisibility(scope) {\n var fields = document.querySelectorAll('.plugin-field[data-scope=\"' + scope + '\"]');\n for (var i = 0; i < fields.length; i++) {\n var wrapper = fields[i];\n var dependsOn = wrapper.dataset.visibleWhenField;\n if (!dependsOn) {\n wrapper.classList.remove('plugin-field-hidden');\n continue;\n }\n\n var expectedRaw = null;\n try {\n expectedRaw = JSON.parse(wrapper.dataset.visibleWhenEquals || 'null');\n } catch (e) {\n expectedRaw = null;\n }\n var current = readRawFieldValue(scope, dependsOn);\n var visible = compareVisibleValue(current, expectedRaw);\n if (visible) {\n wrapper.classList.remove('plugin-field-hidden');\n } else {\n wrapper.classList.add('plugin-field-hidden');\n }\n }\n }\n\n function collectConfigValues(scope, form) {\n var out = {};\n if (!form || !Array.isArray(form.sections)) {\n return out;\n }\n\n for (var s = 0; s < form.sections.length; s++) {\n var section = form.sections[s] || {};\n var fields = Array.isArray(section.fields) ? section.fields : [];\n for (var f = 0; f < fields.length; f++) {\n var field = fields[f] || {};\n if (!field.name) {\n continue;\n }\n\n if (field.name === 'max_shard_transfers') {\n var shardCap = collectShardTransferValue(scope);\n if (shardCap !== null) {\n out[field.name] = shardCap;\n }\n continue;\n }\n\n var wrapper = document.querySelector('.plugin-field[data-scope=\"' + scope + '\"][data-field-name=\"' + field.name + '\"]');\n if (wrapper && wrapper.classList.contains('plugin-field-hidden')) {\n continue;\n }\n\n var input = document.getElementById(toInputID(scope, field.name));\n if (!input) {\n continue;\n }\n\n var rawValue;\n if (input.tagName === 'SELECT' && input.multiple) {\n rawValue = getSelectValueArray(input);\n } else if (input.type === 'checkbox') {\n rawValue = !!input.checked;\n } else {\n rawValue = input.value;\n }\n\n if (field.required) {\n var missing = false;\n if (input.type === 'checkbox') {\n missing = false;\n } else if (Array.isArray(rawValue)) {\n missing = rawValue.length === 0;\n } else {\n missing = String(rawValue || '').trim() === '';\n }\n if (missing) {\n throw new Error('Missing required field: ' + (field.label || field.name));\n }\n }\n\n var converted = nativeToConfigValue(rawValue, field.field_type, field.widget, field);\n if (converted !== null) {\n out[field.name] = converted;\n }\n }\n }\n\n return out;\n }\n\n function renderDescriptorSummary() {\n var summary = document.getElementById('plugin-descriptor-summary');\n if (!state.descriptor) {\n summary.innerHTML = 'No descriptor loaded.';\n return;\n }\n\n var descriptor = state.descriptor;\n var html = '';\n html += '<div><strong>' + escapeHtml(textOrDash(descriptor.display_name || descriptor.job_type)) + '</strong></div>';\n html += '<div><small>Job Type: ' + escapeHtml(textOrDash(descriptor.job_type)) + '</small></div>';\n html += '<div><small>Descriptor Version: ' + escapeHtml(textOrDash(descriptor.descriptor_version)) + '</small></div>';\n if (descriptor.description) {\n html += '<div class=\"mt-1\">' + escapeHtml(descriptor.description) + '</div>';\n }\n summary.innerHTML = html;\n }\n\n function fillAdminSettings() {\n var runtimeConfig = (state.config && state.config.admin_runtime) ? state.config.admin_runtime : {};\n var defaults = (state.descriptor && state.descriptor.admin_runtime_defaults) ? state.descriptor.admin_runtime_defaults : {};\n\n function pickNumber(key) {\n if (runtimeConfig && runtimeConfig[key] !== undefined && runtimeConfig[key] !== null) {\n return runtimeConfig[key];\n }\n if (defaults && defaults[key] !== undefined && defaults[key] !== null) {\n return defaults[key];\n }\n return 0;\n }\n\n function pickBool(key) {\n if (runtimeConfig && runtimeConfig[key] !== undefined && runtimeConfig[key] !== null) {\n return !!runtimeConfig[key];\n }\n if (defaults && defaults[key] !== undefined && defaults[key] !== null) {\n return !!defaults[key];\n }\n return true;\n }\n\n document.getElementById('plugin-admin-enabled').checked = pickBool('enabled');\n document.getElementById('plugin-admin-detection-interval').value = String(pickNumber('detection_interval_minutes'));\n document.getElementById('plugin-admin-detection-timeout').value = String(pickNumber('detection_timeout_seconds'));\n document.getElementById('plugin-admin-execution-timeout').value = String(pickNumber('execution_timeout_seconds'));\n document.getElementById('plugin-admin-max-runtime').value = String(pickNumber('job_type_max_runtime_seconds'));\n document.getElementById('plugin-admin-max-results').value = String(pickNumber('max_jobs_per_detection'));\n document.getElementById('plugin-admin-global-exec').value = String(pickNumber('global_execution_concurrency'));\n document.getElementById('plugin-admin-per-worker-exec').value = String(pickNumber('per_worker_execution_concurrency'));\n document.getElementById('plugin-admin-retry-limit').value = String(pickNumber('retry_limit'));\n document.getElementById('plugin-admin-retry-backoff').value = String(pickNumber('retry_backoff_seconds'));\n }\n\n function collectAdminSettings() {\n function getInt(id) {\n var raw = String(document.getElementById(id).value || '').trim();\n if (!raw) {\n return 0;\n }\n var parsed = parseInt(raw, 10);\n if (Number.isNaN(parsed) || parsed < 0) {\n throw new Error('Invalid number for ' + id);\n }\n return parsed;\n }\n\n return {\n enabled: !!document.getElementById('plugin-admin-enabled').checked,\n detection_interval_minutes: getInt('plugin-admin-detection-interval'),\n detection_timeout_seconds: getInt('plugin-admin-detection-timeout'),\n execution_timeout_seconds: getInt('plugin-admin-execution-timeout'),\n job_type_max_runtime_seconds: getInt('plugin-admin-max-runtime'),\n max_jobs_per_detection: getInt('plugin-admin-max-results'),\n global_execution_concurrency: getInt('plugin-admin-global-exec'),\n per_worker_execution_concurrency: getInt('plugin-admin-per-worker-exec'),\n retry_limit: getInt('plugin-admin-retry-limit'),\n retry_backoff_seconds: getInt('plugin-admin-retry-backoff'),\n };\n }\n\n function renderRunHistory(history) {\n var successBody = document.getElementById('plugin-runs-success-body');\n var errorBody = document.getElementById('plugin-runs-error-body');\n\n var successRuns = (history && Array.isArray(history.successful_runs)) ? history.successful_runs : [];\n var errorRuns = (history && Array.isArray(history.error_runs)) ? history.error_runs : [];\n\n if (!successRuns.length) {\n successBody.innerHTML = '<tr><td colspan=\"4\" class=\"text-muted\">No successful runs</td></tr>';\n } else {\n var successRows = '';\n for (var i = 0; i < successRuns.length; i++) {\n var run = successRuns[i] || {};\n successRows += '<tr>' +\n '<td><small>' + escapeHtml(parseTime(run.completed_at) || '-') + '</small></td>' +\n '<td>' + renderJobLink(run.job_id) + '</td>' +\n '<td><small>' + escapeHtml(textOrDash(run.worker_id)) + '</small></td>' +\n '<td><small>' + escapeHtml(formatDurationMs(run.duration_ms)) + '</small></td>' +\n '</tr>';\n }\n successBody.innerHTML = successRows;\n }\n\n if (!errorRuns.length) {\n errorBody.innerHTML = '<tr><td colspan=\"4\" class=\"text-muted\">No error runs</td></tr>';\n } else {\n var errorRows = '';\n for (var j = 0; j < errorRuns.length; j++) {\n var errorRun = errorRuns[j] || {};\n errorRows += '<tr>' +\n '<td><small>' + escapeHtml(parseTime(errorRun.completed_at) || '-') + '</small></td>' +\n '<td>' + renderJobLink(errorRun.job_id) + '</td>' +\n '<td><small>' + escapeHtml(textOrDash(errorRun.worker_id)) + '</small></td>' +\n '<td><small class=\"text-danger\">' + escapeHtml(textOrDash(errorRun.message)) + '</small></td>' +\n '</tr>';\n }\n errorBody.innerHTML = errorRows;\n }\n }\n\n function renderDetectionResult(data) {\n var root = document.getElementById('plugin-detection-results');\n if (!root) {\n return;\n }\n\n function normalizeProposals(payload) {\n if (!payload || typeof payload !== 'object') {\n return [];\n }\n if (Array.isArray(payload.proposals)) {\n return payload.proposals;\n }\n if (payload.proposals && typeof payload.proposals === 'object') {\n return Object.keys(payload.proposals).map(function(key) {\n return payload.proposals[key];\n }).filter(function(item) {\n return !!item;\n });\n }\n return [];\n }\n\n function proposalID(proposal) {\n return proposal.proposal_id || proposal.proposalId || proposal.id || '';\n }\n\n function proposalSummary(proposal) {\n return proposal.summary || proposal.title || proposalID(proposal) || 'Proposal';\n }\n\n function proposalDetail(proposal) {\n return proposal.detail || proposal.reason || proposal.message || '-';\n }\n\n function normalizeActivities(payload) {\n if (!payload || typeof payload !== 'object') {\n return [];\n }\n if (Array.isArray(payload.activities)) {\n return payload.activities;\n }\n return [];\n }\n\n function encodeDetails(details) {\n if (!details || typeof details !== 'object') {\n return '';\n }\n var text = '';\n try {\n text = JSON.stringify(details);\n } catch (e) {\n text = '';\n }\n if (!text) {\n return '';\n }\n if (text.length > 360) {\n text = text.slice(0, 360) + '...';\n }\n return text;\n }\n\n if (!data) {\n root.innerHTML = '<div class=\"text-muted\">No results.</div>';\n return;\n }\n\n var proposals = normalizeProposals(data);\n var activities = normalizeActivities(data);\n var responseCount = Number(data.count || 0);\n if (!Number.isFinite(responseCount) || responseCount < 0) {\n responseCount = proposals.length;\n }\n var requestID = data.request_id || data.requestId || '';\n var detectorWorkerID = data.detector_worker_id || data.detectorWorkerId || '';\n var totalProposals = Number(data.total_proposals || 0);\n if (!Number.isFinite(totalProposals) || totalProposals < 0) {\n totalProposals = responseCount;\n }\n\n var html = '';\n html += '<div class=\"mb-2\"><strong>Detection Run</strong></div>';\n var skippedActivity = null;\n for (var si = 0; si < activities.length; si++) {\n if (activities[si] && activities[si].stage === 'skipped_by_interval') skippedActivity = activities[si];\n }\n if (data.skipped_reason || skippedActivity) {\n var eligibleAfter = data.eligible_after;\n if (!eligibleAfter && skippedActivity && skippedActivity.details) {\n var detailAfter = skippedActivity.details.eligible_after;\n eligibleAfter = (detailAfter && detailAfter.string_value) || detailAfter;\n }\n html += '<div class=\"alert alert-info\">Skipped: ' + escapeHtml(String(data.skipped_reason || skippedActivity.message || 'detection skipped'));\n if (eligibleAfter) html += ' · Eligible after: ' + escapeHtml(parseTime(eligibleAfter) || eligibleAfter);\n html += '</div>';\n } else if (!data.error && proposals.length === 0) {\n html += '<div class=\"text-muted\">Scan completed: no eligible volumes or jobs.</div>';\n }\n if (requestID) {\n html += '<div><small>request_id: ' + escapeHtml(String(requestID)) + '</small></div>';\n }\n if (detectorWorkerID) {\n html += '<div><small>detector: ' + escapeHtml(String(detectorWorkerID)) + '</small></div>';\n }\n html += '<div><small>proposals: ' + escapeHtml(String(responseCount)) + ' / total: ' + escapeHtml(String(totalProposals)) + '</small></div>';\n if (data.error) {\n html += '<div class=\"mt-1 text-danger\"><small>' + escapeHtml(String(data.error)) + '</small></div>';\n }\n\n if (!proposals.length) {\n html += '<div class=\"mt-2 text-muted\">No proposals returned.</div>';\n } else {\n html += '<div class=\"mt-2 mb-1\"><strong>' + escapeHtml(String(proposals.length)) + '</strong> proposal(s)</div>';\n for (var i = 0; i < proposals.length; i++) {\n var proposal = proposals[i] || {};\n var pID = proposalID(proposal);\n var pSummary = proposalSummary(proposal);\n var pDetail = proposalDetail(proposal);\n var pPriority = proposal.priority;\n if (pPriority === null || pPriority === undefined || pPriority === '') {\n pPriority = '-';\n }\n html += '<div class=\"plugin-detection-item\">' +\n '<div class=\"fw-semibold\">' + escapeHtml(textOrDash(pSummary)) + '</div>' +\n '<div><small>proposal_id: ' + escapeHtml(textOrDash(pID)) + '</small></div>' +\n '<div><small>priority: ' + escapeHtml(textOrDash(pPriority)) + '</small></div>' +\n '<div><small>detail: ' + escapeHtml(textOrDash(pDetail)) + '</small></div>' +\n '</div>';\n }\n }\n\n if (activities.length) {\n html += '<hr class=\"my-2\"/>';\n html += '<div class=\"mb-2\"><strong>Detection Process</strong></div>';\n for (var j = 0; j < activities.length; j++) {\n var activity = activities[j] || {};\n var activityStage = activity.stage || '-';\n var activitySource = activity.source || '-';\n var activityMessage = activity.message || '-';\n var activityTime = parseTime(activity.occurred_at) || '-';\n var detailsText = encodeDetails(activity.details);\n html += '<div class=\"plugin-detection-item\">' +\n '<div class=\"fw-semibold\">' + escapeHtml(textOrDash(activityStage)) + '</div>' +\n '<div><small>source: ' + escapeHtml(textOrDash(activitySource)) + ' | at: ' + escapeHtml(activityTime) + '</small></div>' +\n '<div><small>' + escapeHtml(textOrDash(activityMessage)) + '</small></div>';\n if (detailsText) {\n html += '<div><small class=\"text-muted\">details: ' + escapeHtml(detailsText) + '</small></div>';\n }\n html += '</div>';\n }\n }\n\n root.innerHTML = html;\n }\n\n function getSelectedJobType() {\n return String(state.selectedJobType || '').trim();\n }\n\n function resetJobTypePanels() {\n state.loadedJobType = '';\n state.descriptor = null;\n state.config = null;\n document.getElementById('plugin-descriptor-summary').textContent = 'No descriptor loaded.';\n document.getElementById('plugin-admin-config-form').innerHTML = '<div class=\"text-muted\">No admin form loaded.</div>';\n document.getElementById('plugin-worker-config-form').innerHTML = '<div class=\"text-muted\">No worker form loaded.</div>';\n document.getElementById('plugin-config-updated-at').textContent = 'Not loaded';\n renderRunHistory(null);\n renderDetectionResult(null);\n }\n\n async function loadDescriptorAndConfig(jobType, forceRefresh) {\n if (!jobType) {\n return;\n }\n\n state.selectedJobType = jobType;\n renderNavigationState();\n\n var summary = document.getElementById('plugin-descriptor-summary');\n summary.textContent = 'Loading descriptor and config...';\n\n try {\n if (forceRefresh) {\n var refreshURL = '/api/plugin/job-types/' + encodePath(jobType) + '/schema?force_refresh=true';\n state.descriptor = await pluginRequest('POST', refreshURL, null);\n } else {\n try {\n state.descriptor = await pluginRequest('GET', '/api/plugin/job-types/' + encodePath(jobType) + '/descriptor');\n } catch (descriptorLoadError) {\n state.descriptor = await pluginRequest('POST', '/api/plugin/job-types/' + encodePath(jobType) + '/schema', null);\n }\n }\n } catch (schemaError) {\n state.loadedJobType = '';\n state.descriptor = null;\n summary.innerHTML = '<span class=\"text-danger\">Failed to load descriptor: ' + escapeHtml(schemaError.message) + '</span>';\n document.getElementById('plugin-admin-config-form').innerHTML = '<div class=\"text-muted\">No admin form loaded.</div>';\n document.getElementById('plugin-worker-config-form').innerHTML = '<div class=\"text-muted\">No worker form loaded.</div>';\n throw schemaError;\n }\n\n try {\n state.config = await pluginRequest('GET', '/api/plugin/job-types/' + encodePath(jobType) + '/config');\n } catch (configError) {\n state.config = null;\n notify('Failed to load config: ' + configError.message, 'error');\n }\n\n renderDescriptorSummary();\n fillAdminSettings();\n\n if (state.descriptor) {\n renderConfigForm('admin', 'plugin-admin-config-form', state.descriptor.admin_config_form || {});\n renderConfigForm('worker', 'plugin-worker-config-form', state.descriptor.worker_config_form || {});\n }\n\n if (state.config && state.config.updated_at) {\n document.getElementById('plugin-config-updated-at').textContent = 'Updated: ' + (parseTime(state.config.updated_at) || state.config.updated_at);\n } else {\n document.getElementById('plugin-config-updated-at').textContent = 'Not saved yet';\n }\n state.loadedJobType = jobType;\n renderSchedulerStatus();\n\n await loadRunHistory(jobType);\n\n if (state.lastDetectionByJobType && state.lastDetectionByJobType[jobType]) {\n renderDetectionResult(state.lastDetectionByJobType[jobType]);\n } else {\n renderDetectionResult(null);\n }\n }\n\n async function loadRunHistory(jobType) {\n if (!jobType) {\n renderRunHistory(null);\n return;\n }\n try {\n var history = await pluginRequest('GET', '/api/plugin/job-types/' + encodePath(jobType) + '/runs');\n renderRunHistory(history);\n } catch (e) {\n renderRunHistory(null);\n notify('Failed to load run history: ' + e.message, 'error');\n }\n }\n\n async function saveConfig() {\n var jobType = state.selectedJobType || getSelectedJobType();\n if (!jobType) {\n notify('Select a job type first.', 'error');\n return;\n }\n if (!state.descriptor) {\n notify('Load descriptor before saving config.', 'error');\n return;\n }\n\n var payload;\n try {\n payload = {\n job_type: jobType,\n descriptor_version: state.descriptor.descriptor_version || 0,\n admin_runtime: collectAdminSettings(),\n admin_config_values: collectConfigValues('admin', state.descriptor.admin_config_form || {}),\n worker_config_values: collectConfigValues('worker', state.descriptor.worker_config_form || {}),\n };\n } catch (err) {\n notify(err.message, 'error');\n return;\n }\n\n try {\n state.config = await pluginRequest('PUT', '/api/plugin/job-types/' + encodePath(jobType) + '/config', payload);\n document.getElementById('plugin-config-updated-at').textContent = 'Updated: ' + (parseTime(state.config.updated_at) || state.config.updated_at || 'just now');\n notify('Config saved for ' + jobType, 'success');\n } catch (e) {\n notify('Failed to save config: ' + e.message, 'error');\n }\n }\n\n function getMaxResults() {\n var raw = String(document.getElementById('plugin-admin-max-results').value || '').trim();\n if (!raw) {\n return 0;\n }\n var parsed = parseInt(raw, 10);\n if (Number.isNaN(parsed) || parsed < 0) {\n return 0;\n }\n return parsed;\n }\n\n async function runDetection() {\n var jobType = state.selectedJobType || getSelectedJobType();\n if (!jobType) {\n notify('Select a job type first.', 'error');\n return;\n }\n\n try {\n var data = await pluginRequest('POST', '/api/plugin/job-types/' + encodePath(jobType) + '/detect', {\n max_results: getMaxResults(),\n });\n state.lastDetectionByJobType[jobType] = data;\n renderDetectionResult(data);\n } catch (e) {\n if (e && e.responseData) {\n state.lastDetectionByJobType[jobType] = e.responseData;\n renderDetectionResult(e.responseData);\n }\n notify('Detection failed: ' + e.message, 'error');\n return;\n }\n\n try {\n await refreshJobsAndActivities();\n } catch (refreshErr) {\n notify('Detection succeeded, but monitoring refresh failed: ' + refreshErr.message, 'error');\n }\n }\n\n async function runWorkflow() {\n var jobType = state.selectedJobType || getSelectedJobType();\n if (!jobType) {\n notify('Select a job type first.', 'error');\n return;\n }\n\n try {\n var data = await pluginRequest('POST', '/api/plugin/job-types/' + encodePath(jobType) + '/run', {\n max_results: getMaxResults(),\n });\n var resultRoot = document.getElementById('plugin-detection-results');\n resultRoot.innerHTML = '<div class=\"mb-2\"><strong>Workflow completed</strong></div>' +\n '<div>Detected: <strong>' + escapeHtml(String(data.detected_count || 0)) + '</strong></div>' +\n '<div>Ready to Execute: <strong>' + escapeHtml(String(data.ready_to_execute_count || 0)) + '</strong></div>' +\n '<div>Skipped (Already Active): <strong>' + escapeHtml(String(data.skipped_active_count || 0)) + '</strong></div>' +\n '<div>Executed: <strong>' + escapeHtml(String(data.executed_count || 0)) + '</strong></div>' +\n '<div class=\"text-success\">Success: ' + escapeHtml(String(data.success_count || 0)) + '</div>' +\n '<div class=\"text-danger\">Errors: ' + escapeHtml(String(data.error_count || 0)) + '</div>';\n await loadRunHistory(jobType);\n } catch (e) {\n notify('Workflow run failed: ' + e.message, 'error');\n return;\n }\n try {\n await refreshJobsAndActivities();\n } catch (refreshErr) {\n notify('Workflow run succeeded, but monitoring refresh failed: ' + refreshErr.message, 'error');\n }\n }\n\n async function refreshJobsAndActivities() {\n var executionStateFilter = document.getElementById('plugin-monitor-job-state-filter');\n\n state.monitorExecutionJobState = executionStateFilter ? String(executionStateFilter.value || '').trim() : '';\n\n // The newest 500 rows cluster-wide may hold none of the selected job type on a busy\n // cluster, so the job-type sub-tabs fetch their own server-side filtered window.\n var scopedJobType = monitorJobTypeScope();\n var sameScope = state.monitorRowsScope === scopedJobType;\n\n // A failed request keeps its last rows; the rest still land and the failure is rethrown.\n var failure = null;\n function keepOnFailure(promise, previous) {\n return promise.catch(function(e) {\n failure = failure || e;\n return previous;\n });\n }\n\n var allJobsPromise = keepOnFailure(pluginRequest('GET', appendLaneParam('/api/plugin/jobs?limit=500')), state.allJobs);\n var allActivitiesPromise = keepOnFailure(pluginRequest('GET', appendLaneParam('/api/plugin/activities?limit=500')), state.allActivities);\n var jobsPromise = scopedJobType ? keepOnFailure(pluginRequest('GET', appendJobTypeParam(appendLaneParam('/api/plugin/jobs?limit=500'), scopedJobType)), sameScope ? state.jobs : null) : allJobsPromise;\n var activitiesPromise = scopedJobType ? keepOnFailure(pluginRequest('GET', appendJobTypeParam(appendLaneParam('/api/plugin/activities?limit=500'), scopedJobType)), sameScope ? state.activities : null) : allActivitiesPromise;\n var schedulerPromise = keepOnFailure(pluginRequest('GET', appendLaneParam('/api/plugin/scheduler-states')), state.schedulerStates);\n var schedulerStatusPromise = pluginRequest('GET', appendLaneParam('/api/plugin/scheduler-status'));\n\n var allJobs = await allJobsPromise;\n var allActivities = await allActivitiesPromise;\n var jobs = await jobsPromise;\n var activities = await activitiesPromise;\n var schedulerStates = await schedulerPromise;\n var schedulerStatus = null;\n try {\n schedulerStatus = await schedulerStatusPromise;\n } catch (e) {\n schedulerStatus = null;\n }\n if (monitorJobTypeScope() !== scopedJobType) {\n return;\n }\n\n state.allJobs = Array.isArray(allJobs) ? allJobs : [];\n state.allActivities = Array.isArray(allActivities) ? allActivities : [];\n state.jobs = Array.isArray(jobs) ? jobs : state.allJobs;\n state.activities = Array.isArray(activities) ? activities : state.allActivities;\n state.monitorRowsScope = scopedJobType;\n state.schedulerStates = Array.isArray(schedulerStates) ? schedulerStates : [];\n state.schedulerStatus = schedulerStatus && schedulerStatus.scheduler ? schedulerStatus.scheduler : null;\n state.schedulerLock = schedulerStatus && schedulerStatus.lock ? schedulerStatus.lock : null;\n renderQueueJobs();\n renderDetectionJobs();\n renderExecutionJobs();\n renderExecutionActivities();\n renderSchedulerStates();\n renderSchedulerStatus();\n renderStatus();\n renderJobTypeSummary();\n if (failure) {\n throw failure;\n }\n }\n\n async function refreshAll() {\n try {\n var previousSelectedJobType = state.selectedJobType;\n\n var workers = await pluginRequest('GET', appendLaneParam('/api/plugin/workers'));\n state.workers = Array.isArray(workers) ? workers : [];\n renderWorkers();\n\n var jobTypes = await pluginRequest('GET', appendLaneParam('/api/plugin/job-types'));\n state.jobTypes = Array.isArray(jobTypes) ? jobTypes : [];\n applyInitialNavigation();\n ensureActiveNavigation();\n renderTopTabs();\n renderNavigationState();\n\n if (!state.selectedJobType) {\n resetJobTypePanels();\n } else if (state.loadedJobType !== state.selectedJobType || previousSelectedJobType !== state.selectedJobType) {\n try {\n await loadDescriptorAndConfig(state.selectedJobType, false);\n } catch (loadError) {\n // Already rendered in UI.\n }\n }\n\n await refreshJobsAndActivities();\n state.refreshError = '';\n } catch (e) {\n // The 3s timer would otherwise reopen the same alert on every tick.\n if (e.message !== state.refreshError) {\n state.refreshError = e.message;\n notify('Refresh failed: ' + e.message, 'error');\n }\n }\n }\n\n function bindActions() {\n var monitorStateFilter = document.getElementById('plugin-monitor-job-state-filter');\n if (monitorStateFilter) {\n monitorStateFilter.addEventListener('change', function() {\n state.monitorExecutionJobState = String(monitorStateFilter.value || '').trim();\n renderExecutionJobs();\n });\n }\n\n var expireBtn = document.getElementById('plugin-expire-job-btn');\n if (expireBtn) {\n expireBtn.addEventListener('click', function() {\n var jobID = String(expireBtn.getAttribute('data-job-id') || '').trim();\n if (!jobID) {\n return;\n }\n expireJob(jobID);\n });\n }\n\n document.getElementById('plugin-refresh-all-btn').addEventListener('click', function() {\n refreshAll();\n });\n\n document.getElementById('plugin-refresh-schema-btn').addEventListener('click', async function() {\n var jobType = getSelectedJobType();\n if (!jobType) {\n notify('Select a job type first.', 'error');\n return;\n }\n try {\n await loadDescriptorAndConfig(jobType, true);\n notify('Schema refreshed for ' + jobType, 'success');\n } catch (e) {\n notify('Schema refresh failed: ' + e.message, 'error');\n }\n });\n\n document.getElementById('plugin-save-config-btn').addEventListener('click', function() {\n saveConfig();\n });\n\n document.getElementById('plugin-trigger-detection-btn').addEventListener('click', function() {\n runDetection();\n });\n\n document.getElementById('plugin-run-workflow-btn').addEventListener('click', function() {\n runWorkflow();\n });\n\n page.addEventListener('click', async function(event) {\n var target = event.target;\n if (!target) {\n return;\n }\n\n var topTab = target.closest('[data-plugin-top-tab]');\n if (topTab) {\n event.preventDefault();\n var topTabKey = String(topTab.getAttribute('data-plugin-top-tab') || '').trim();\n if (!topTabKey) {\n return;\n }\n if (topTabKey === 'overview') {\n state.activeTopTab = 'overview';\n renderNavigationState();\n updateURL(false);\n return;\n }\n\n var jobType = parseJobTypeFromTopTab(topTabKey);\n if (!jobType) {\n return;\n }\n state.activeTopTab = topTabKey;\n state.selectedJobType = jobType;\n ensureActiveNavigation();\n renderNavigationState();\n updateURL(false);\n if (state.loadedJobType !== jobType) {\n try {\n await loadDescriptorAndConfig(jobType, false);\n } catch (e) {\n // Already rendered in UI.\n }\n } else {\n if (state.lastDetectionByJobType && state.lastDetectionByJobType[jobType]) {\n renderDetectionResult(state.lastDetectionByJobType[jobType]);\n } else {\n renderDetectionResult(null);\n }\n await loadRunHistory(jobType);\n }\n try {\n await refreshJobsAndActivities();\n } catch (e) {\n notify('Refresh failed: ' + e.message, 'error');\n }\n return;\n }\n\n var subTab = target.closest('[data-plugin-subtab]');\n if (subTab) {\n event.preventDefault();\n var subTabKey = normalizeSubTab(subTab.getAttribute('data-plugin-subtab'));\n state.activeSubTab = subTabKey;\n renderNavigationState();\n updateURL(false);\n return;\n }\n\n var trigger = target.closest('.plugin-job-link');\n if (!trigger) {\n return;\n }\n event.preventDefault();\n var jobID = trigger.getAttribute('data-job-id');\n if (!jobID) {\n return;\n }\n openJobDetail(jobID);\n });\n }\n\n async function init() {\n bindActions();\n renderTopTabs();\n ensureActiveNavigation();\n renderNavigationState();\n await refreshAll();\n\n // Set the initial browser history state to match the current view\n updateURL(true);\n\n state.refreshTimer = setInterval(function() {\n refreshAll();\n }, 3000);\n }\n\n window.addEventListener('popstate', async function(event) {\n var s = event.state;\n if (!s || !s.pluginTopTab) {\n // No plugin state — treat as overview\n state.activeTopTab = 'overview';\n renderNavigationState();\n return;\n }\n state.activeTopTab = String(s.pluginTopTab || 'overview');\n state.activeSubTab = normalizeSubTab(s.pluginSubTab);\n var jobType = String(s.pluginJob || '').trim();\n if (jobType) {\n state.selectedJobType = jobType;\n }\n ensureActiveNavigation();\n renderNavigationState();\n // If a job type is selected and not loaded yet, load it\n if (state.selectedJobType && state.loadedJobType !== state.selectedJobType) {\n try {\n await loadDescriptorAndConfig(state.selectedJobType, false);\n } catch (e) {\n console.error('Failed to load data on popstate navigation:', e);\n }\n }\n try {\n await refreshJobsAndActivities();\n } catch (e) {\n console.error('Failed to refresh jobs on popstate navigation:', e);\n }\n });\n\n window.addEventListener('beforeunload', function() {\n if (state.refreshTimer) {\n clearInterval(state.refreshTimer);\n state.refreshTimer = null;\n }\n });\n\n init();\n })();\n </script>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "<div class=\"plugin-section plugin-section-overview\"><div class=\"row mb-4\"><div class=\"col-md-3 mb-3\"><div class=\"card border-info h-100\"><div class=\"card-body text-center\"><div class=\"text-uppercase text-muted small mb-1\">Workers</div><h4 class=\"mb-0\" id=\"plugin-status-workers\">0</h4></div></div></div><div class=\"col-md-3 mb-3\"><div class=\"card border-warning h-100\"><div class=\"card-body text-center\"><div class=\"text-uppercase text-muted small mb-1\">Active Jobs</div><h4 class=\"mb-0\" id=\"plugin-status-active-jobs\">0</h4></div></div></div><div class=\"col-md-3 mb-3\"><div class=\"card border-success h-100\"><div class=\"card-body text-center\"><div class=\"text-uppercase text-muted small mb-1\">Activities (recent)</div><h4 class=\"mb-0\" id=\"plugin-status-activities\">0</h4></div></div></div><div class=\"col-md-3 mb-3\"><div class=\"card border-secondary h-100\"><div class=\"card-body text-center\"><div class=\"text-uppercase text-muted small mb-1\">Next scheduled check</div><h4 class=\"mb-0 plugin-scheduler-next-run\">-</h4><div class=\"text-muted small plugin-scheduler-next-run-meta\"></div></div></div></div></div><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow-sm\"><div class=\"card-header\"><h5 class=\"mb-0\"><i class=\"bi bi-bar-chart me-2\"></i>Per Job Type Summary</h5></div><div class=\"card-body p-0\"><div class=\"table-responsive\"><table class=\"table table-sm table-hover mb-0\"><thead class=\"table-light\"><tr><th>Job Type</th><th>Active Jobs</th><th>Recent Activities</th></tr></thead> <tbody id=\"plugin-jobtype-summary-body\"><tr><td colspan=\"3\" class=\"text-muted text-center py-3\">Loading...</td></tr></tbody></table></div></div></div></div></div><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow-sm\"><div class=\"card-header d-flex justify-content-between align-items-center flex-wrap gap-2\"><h5 class=\"mb-0\"><i class=\"bi bi-clock me-2\"></i>Scheduler State</h5><small class=\"text-muted\">Sequential scheduler with per-job runtime limits</small></div><div class=\"card-body p-0\"><div class=\"table-responsive\"><table class=\"table table-sm table-hover mb-0\"><thead class=\"table-light\"><tr><th>Job Type</th><th>Enabled</th><th>Detector</th><th>In Flight</th><th>Max Runtime</th><th>Exec Global</th><th>Exec/Worker</th><th>Executor Workers</th><th>Effective Exec</th><th>Last Run</th></tr></thead> <tbody id=\"plugin-scheduler-table-body\"><tr><td colspan=\"10\" class=\"text-muted text-center py-3\">Loading...</td></tr></tbody></table></div></div></div></div></div><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow-sm\"><div class=\"card-header\"><h5 class=\"mb-0\"><i class=\"bi bi-people me-2\"></i>Workers</h5></div><div class=\"card-body p-0\"><div class=\"table-responsive\" style=\"max-height: 560px; overflow-y: auto;\"><table class=\"table table-sm table-hover mb-0\"><thead class=\"table-light sticky-top\"><tr><th>Worker</th><th>Address</th><th>Capabilities</th><th>Load</th></tr></thead> <tbody id=\"plugin-workers-table-body\"><tr><td colspan=\"4\" class=\"text-muted text-center py-3\">Loading...</td></tr></tbody></table></div></div></div></div></div></div><div class=\"plugin-section plugin-section-configuration\"><div class=\"row mb-4\"><div class=\"col-lg-8 mb-3\"><div class=\"card shadow-sm h-100\"><div class=\"card-header d-flex justify-content-between align-items-center\"><h5 class=\"mb-0\"><i class=\"bi bi-sliders me-2\"></i>Job Type Configuration</h5><small class=\"text-muted\" id=\"plugin-config-updated-at\">Not loaded</small></div><div class=\"card-body\"><div class=\"mb-3\"><div class=\"small text-muted\">Selected Job Type</div><div class=\"fw-semibold\" id=\"plugin-selected-job-type\">-</div></div><div class=\"mb-3\"><div class=\"d-flex justify-content-between align-items-center mb-2\"><h6 class=\"mb-0\">Descriptor</h6><button type=\"button\" class=\"btn btn-sm btn-outline-secondary\" id=\"plugin-refresh-schema-btn\"><i class=\"bi bi-cloud-download me-1\"></i>Refresh Schema</button></div><div class=\"alert alert-light border\" id=\"plugin-descriptor-summary\">Select a job type to load schema and config.</div></div><div class=\"mb-3\"><h6>Admin Config Form</h6><div id=\"plugin-admin-config-form\" class=\"plugin-form-root\"><div class=\"text-muted\">No admin form loaded.</div></div></div><div class=\"mb-3\"><h6>Worker Config Form</h6><div id=\"plugin-worker-config-form\" class=\"plugin-form-root\"><div class=\"text-muted\">No worker form loaded.</div></div></div><div class=\"d-flex flex-wrap gap-2\"><button type=\"button\" class=\"btn btn-primary\" id=\"plugin-save-config-btn\"><i class=\"bi bi-floppy me-1\"></i>Save Config</button> <button type=\"button\" class=\"btn btn-outline-primary\" id=\"plugin-trigger-detection-btn\"><i class=\"bi bi-search me-1\"></i>Run Detection</button> <button type=\"button\" class=\"btn btn-outline-success\" id=\"plugin-run-workflow-btn\"><i class=\"bi bi-play me-1\"></i>Run Detect + Execute</button></div></div></div></div><div class=\"col-lg-4 mb-3\"><div class=\"card shadow-sm\"><div class=\"card-header\"><h5 class=\"mb-0\"><i class=\"bi bi-gear-wide-connected me-2\"></i>Job Scheduling Settings</h5></div><div class=\"card-body\"><div class=\"row g-2\" id=\"plugin-admin-settings-form\"><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-enabled\">Enabled</label><div class=\"form-check form-switch mt-1\"><input class=\"form-check-input\" type=\"checkbox\" id=\"plugin-admin-enabled\"></div></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-detection-interval\">Scheduled detection interval (min)</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-detection-interval\" min=\"0\"><div class=\"form-text\">How often to check for new work.</div></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-detection-timeout\">Detection Timeout (s)</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-detection-timeout\" min=\"0\"></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-execution-timeout\">Execution Timeout (s)</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-execution-timeout\" min=\"0\"><div class=\"form-text\">Per-attempt deadline for one job. Size-aware tasks may extend this automatically.</div></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-max-runtime\">Job Type Max Runtime (s)</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-max-runtime\" min=\"0\"></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-max-results\">Max Jobs / Detection</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-max-results\" min=\"0\"></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-global-exec\">Global Execution Concurrency</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-global-exec\" min=\"0\"></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-per-worker-exec\">Per Worker Concurrency</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-per-worker-exec\" min=\"0\"></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-retry-limit\">Retry Limit</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-retry-limit\" min=\"0\"></div><div class=\"col-12\"><label class=\"form-label\" for=\"plugin-admin-retry-backoff\">Retry Backoff (s)</label> <input type=\"number\" class=\"form-control\" id=\"plugin-admin-retry-backoff\" min=\"0\"></div></div></div></div><div class=\"card shadow-sm mt-3\"><div class=\"card-header d-flex justify-content-between align-items-center\"><h5 class=\"mb-0\"><i class=\"bi bi-hourglass-split me-2\"></i>Next scheduled check</h5><small class=\"text-muted\">Scheduler</small></div><div class=\"card-body\"><div class=\"h5 mb-1 plugin-scheduler-next-run\">-</div><div class=\"text-muted small plugin-scheduler-next-run-meta\">Not scheduled</div></div></div></div></div><div class=\"row mb-4\"><div class=\"col-lg-6 mb-3\"><div class=\"card shadow-sm h-100\"><div class=\"card-header d-flex justify-content-between align-items-center\"><h5 class=\"mb-0\"><i class=\"bi bi-clipboard-check me-2\"></i>Run History</h5><small class=\"text-muted\">Keep last 10 success + last 10 errors</small></div><div class=\"card-body\"><div class=\"row\"><div class=\"col-12 mb-3\"><h6 class=\"text-success\">Successful Runs</h6><div class=\"table-responsive\"><table class=\"table table-sm table-striped\"><thead><tr><th>Time</th><th>Job ID</th><th>Worker</th><th>Duration</th></tr></thead> <tbody id=\"plugin-runs-success-body\"><tr><td colspan=\"4\" class=\"text-muted\">No data</td></tr></tbody></table></div></div><div class=\"col-12\"><h6 class=\"text-danger\">Error Runs</h6><div class=\"table-responsive\"><table class=\"table table-sm table-striped\"><thead><tr><th>Time</th><th>Job ID</th><th>Worker</th><th>Error</th></tr></thead> <tbody id=\"plugin-runs-error-body\"><tr><td colspan=\"4\" class=\"text-muted\">No data</td></tr></tbody></table></div></div></div></div></div></div><div class=\"col-lg-6 mb-3\"><div class=\"card shadow-sm h-100\"><div class=\"card-header\"><h5 class=\"mb-0\"><i class=\"bi bi-lightbulb me-2\"></i>Detection Results</h5></div><div class=\"card-body\" id=\"plugin-detection-results\"><div class=\"text-muted\">Run detection to see proposals.</div></div></div></div></div></div><div class=\"plugin-section plugin-section-queue\"><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow-sm\"><div class=\"card-header d-flex justify-content-between align-items-center flex-wrap gap-2\"><h5 class=\"mb-0\"><i class=\"bi bi-list me-2\"></i>Job Queue</h5><div class=\"d-flex gap-2 align-items-center flex-wrap\"><small class=\"text-muted\">States: pending/assigned/running</small></div></div><div class=\"card-body p-0\"><div class=\"table-responsive\" style=\"max-height: 560px; overflow-y: auto;\"><table class=\"table table-sm table-hover mb-0\"><thead class=\"table-light sticky-top\"><tr><th>Job ID</th><th>Type</th><th>State</th><th>Progress</th><th>Worker</th><th>Updated</th><th>Message</th></tr></thead> <tbody id=\"plugin-queue-jobs-table-body\"><tr><td colspan=\"7\" class=\"text-muted text-center py-3\">Loading...</td></tr></tbody></table></div></div></div></div></div></div><div class=\"plugin-section plugin-section-detection\"><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow-sm\"><div class=\"card-header d-flex justify-content-between align-items-center flex-wrap gap-2\"><h5 class=\"mb-0\"><i class=\"bi bi-search me-2\"></i>Detection Jobs</h5><div class=\"small text-muted\">Detection activities for selected job type</div></div><div class=\"card-body p-0\"><div class=\"table-responsive\" style=\"max-height: 420px; overflow-y: auto;\"><table class=\"table table-sm table-hover mb-0\"><thead class=\"table-light sticky-top\"><tr><th>Time</th><th>Job Type</th><th>Request ID</th><th>Worker</th><th>Stage</th><th>Source</th><th>Message</th></tr></thead> <tbody id=\"plugin-detection-table-body\"><tr><td colspan=\"7\" class=\"text-muted text-center py-3\">Loading...</td></tr></tbody></table></div></div></div></div></div></div><div class=\"plugin-section plugin-section-execution\"><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow-sm\"><div class=\"card-header d-flex justify-content-between align-items-center flex-wrap gap-2\"><h5 class=\"mb-0\"><i class=\"bi bi-list-check me-2\"></i>Execution Jobs</h5><div class=\"d-flex gap-2 align-items-center flex-wrap\"><select class=\"form-select form-select-sm\" id=\"plugin-monitor-job-state-filter\" style=\"min-width: 180px;\"><option value=\"\">All States</option> <option value=\"assigned\">Assigned</option> <option value=\"running\">Running</option> <option value=\"succeeded\">Succeeded</option> <option value=\"failed\">Failed</option> <option value=\"canceled\">Canceled</option></select></div></div><div class=\"card-body p-0\"><div class=\"table-responsive\"><table class=\"table table-hover mb-0\"><thead class=\"table-light\"><tr><th>Job ID</th><th>Type</th><th>State</th><th>Progress</th><th>Worker</th><th>Updated</th><th>Message</th></tr></thead> <tbody id=\"plugin-execution-jobs-table-body\"><tr><td colspan=\"7\" class=\"text-muted text-center py-3\">Loading...</td></tr></tbody></table></div></div></div></div></div><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card shadow-sm\"><div class=\"card-header d-flex justify-content-between align-items-center flex-wrap gap-2\"><h5 class=\"mb-0\"><i class=\"bi bi-list-nested me-2\"></i>Execution Activities</h5><small class=\"text-muted\">Non-detection events only</small></div><div class=\"card-body p-0\"><div class=\"table-responsive\" style=\"max-height: 420px; overflow-y: auto;\"><table class=\"table table-sm table-hover mb-0\"><thead class=\"table-light sticky-top\"><tr><th>Time</th><th>Job Type</th><th>Job ID</th><th>Source</th><th>Stage</th><th>Message</th></tr></thead> <tbody id=\"plugin-execution-activities-table-body\"><tr><td colspan=\"6\" class=\"text-muted text-center py-3\">Loading...</td></tr></tbody></table></div></div></div></div></div></div></div><div class=\"modal fade\" id=\"plugin-job-detail-modal\" tabindex=\"-1\" aria-labelledby=\"plugin-job-detail-modal-label\" aria-hidden=\"true\"><div class=\"modal-dialog modal-xl modal-dialog-scrollable\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"plugin-job-detail-modal-label\"><i class=\"bi bi-file-earmark-text me-2\"></i>Job Detail</h5><div class=\"ms-auto me-2\"><button type=\"button\" class=\"btn btn-outline-danger btn-sm\" id=\"plugin-expire-job-btn\" disabled><i class=\"bi bi-stop-circle me-1\"></i>Expire Job</button></div><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\" id=\"plugin-job-detail-content\"><div class=\"text-muted\">Select a job to view details.</div></div></div></div></div><style>\n .plugin-section {\n display: none;\n }\n\n .plugin-section.plugin-section-active {\n display: block;\n }\n\n .plugin-form-root .card {\n border: 1px solid var(--bs-border-color);\n }\n .plugin-form-root textarea {\n min-height: 12rem;\n }\n\n .plugin-field-hidden {\n display: none;\n }\n\n .plugin-capability-badge {\n font-size: 0.72rem;\n margin-right: 0.25rem;\n }\n\n .plugin-job-progress {\n min-width: 120px;\n }\n\n .plugin-detection-item {\n border: 1px solid var(--bs-border-color);\n border-radius: 6px;\n padding: 0.5rem 0.75rem;\n margin-bottom: 0.5rem;\n background: var(--bs-tertiary-bg);\n }\n\n .plugin-job-link {\n text-decoration: none;\n }\n\n .plugin-job-detail-json {\n max-height: 220px;\n overflow: auto;\n background: var(--bs-tertiary-bg);\n border: 1px solid var(--bs-border-color);\n border-radius: 6px;\n padding: 0.5rem;\n margin-bottom: 0;\n font-size: 0.82rem;\n }\n </style><script>\n (function() {\n var page = document.getElementById('plugin-page');\n if (!page) {\n return;\n }\n\n var pluginLane = String(page.getAttribute('data-plugin-lane') || '').trim();\n\n function basePath(path) {\n return (window.__BASE_PATH__ || '') + path;\n }\n\n var state = {\n selectedJobType: '',\n jobTypes: [],\n lastDetectionByJobType: {},\n initialPage: String(page.getAttribute('data-plugin-page') || 'overview').trim().toLowerCase(),\n initialJob: String(page.getAttribute('data-plugin-job') || '').trim(),\n activeTopTab: 'overview',\n activeSubTab: 'configuration',\n initialNavigationApplied: false,\n monitorExecutionJobState: '',\n workers: [],\n jobs: [],\n activities: [],\n schedulerStates: [],\n schedulerStatus: null,\n schedulerLock: null,\n allJobs: [],\n allActivities: [],\n monitorRowsScope: null,\n refreshError: '',\n loadedJobType: '',\n descriptor: null,\n config: null,\n refreshTimer: null,\n };\n\n // appendLaneParam appends ?lane= or &lane= to a URL if a lane filter is active.\n function appendLaneParam(url) {\n if (!pluginLane) return url;\n var sep = url.indexOf('?') === -1 ? '?' : '&';\n return url + sep + 'lane=' + encodeURIComponent(pluginLane);\n }\n\n // appendJobTypeParam appends ?job_type= or &job_type= to a URL if a job type is given.\n function appendJobTypeParam(url, jobType) {\n if (!jobType) return url;\n var sep = url.indexOf('?') === -1 ? '?' : '&';\n return url + sep + 'job_type=' + encodeURIComponent(jobType);\n }\n\n function getCSRFToken() {\n var meta = document.querySelector('meta[name=\"csrf-token\"]');\n if (!meta) {\n return '';\n }\n return meta.getAttribute('content') || '';\n }\n\n function notify(message, level) {\n if (typeof window.showAlert === 'function') {\n window.showAlert(message, level || 'info');\n return;\n }\n if (level === 'error') {\n console.error(message);\n }\n alert(message);\n }\n\n async function readResponseJSON(response) {\n var bodyText = await response.text();\n if (!bodyText) {\n return {};\n }\n try {\n return JSON.parse(bodyText);\n } catch (e) {\n return { error: bodyText };\n }\n }\n\n async function pluginRequest(method, url, payload) {\n var headers = {};\n var requestOptions = {\n method: method,\n headers: headers,\n };\n\n if (payload !== undefined && payload !== null) {\n headers['Content-Type'] = 'application/json';\n requestOptions.body = JSON.stringify(payload);\n }\n\n if (method !== 'GET') {\n var csrf = getCSRFToken();\n if (csrf) {\n headers['X-CSRF-Token'] = csrf;\n }\n }\n\n var response = await fetch(basePath(url), requestOptions);\n var data = await readResponseJSON(response);\n if (!response.ok) {\n var message = (data && (data.error || data.message)) ? (data.error || data.message) : ('Request failed: ' + response.status);\n var requestError = new Error(message);\n requestError.responseData = data;\n requestError.responseStatus = response.status;\n throw requestError;\n }\n return data;\n }\n\n function textOrDash(value) {\n if (value === null || value === undefined || value === '') {\n return '-';\n }\n return String(value);\n }\n\n function escapeHtml(value) {\n if (value === null || value === undefined) {\n return '';\n }\n return String(value)\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#039;');\n }\n\n function encodePath(value) {\n return encodeURIComponent(value || '');\n }\n\n function normalizeEnum(value) {\n if (value === undefined || value === null) {\n return '';\n }\n return String(value).toUpperCase();\n }\n\n function parseTime(value) {\n if (!value) {\n return '';\n }\n var date = new Date(value);\n if (Number.isNaN(date.getTime())) {\n return '';\n }\n return date.toLocaleString();\n }\n\n function normalizeSubTab(value) {\n var normalized = String(value || '').toLowerCase();\n if (normalized === 'configuration' || normalized === 'detection' || normalized === 'queue' || normalized === 'execution') {\n return normalized;\n }\n return 'configuration';\n }\n\n function buildPluginURL(topTab, subTab, jobType) {\n var laneName = pluginLane || 'default';\n var laneBase = '/plugin/lanes/' + encodeURIComponent(laneName);\n if (topTab === 'overview') {\n return laneBase;\n }\n var effectiveSubTab = normalizeSubTab(subTab);\n var path = laneBase + '/' + encodeURIComponent(effectiveSubTab);\n var jt = String(jobType || '').trim();\n if (jt) {\n path += '?job=' + encodeURIComponent(jt);\n }\n return path;\n }\n\n function updateURL(replace) {\n var url = basePath(buildPluginURL(state.activeTopTab, state.activeSubTab, state.selectedJobType));\n if (replace) {\n history.replaceState({ pluginTopTab: state.activeTopTab, pluginSubTab: state.activeSubTab, pluginJob: state.selectedJobType }, '', url);\n } else {\n history.pushState({ pluginTopTab: state.activeTopTab, pluginSubTab: state.activeSubTab, pluginJob: state.selectedJobType }, '', url);\n }\n }\n\n // Parse a job type item (string or object) into a safe object shape\n function parseJobTypeItem(item) {\n var jobType = '';\n var displayName = '';\n \n if (typeof item === 'string') {\n jobType = String(item || '').trim();\n displayName = jobType;\n } else if (item && typeof item === 'object') {\n jobType = String(item.job_type || item.jobType || '').trim();\n displayName = String(item.display_name || item.displayName || jobType || '').trim();\n if (!displayName) {\n displayName = jobType;\n }\n }\n \n return { jobType: jobType, displayName: displayName };\n }\n\n function monitorJobTypeScope() {\n return state.activeTopTab === 'overview' ? '' : state.selectedJobType;\n }\n\n function topTabKeyForJobType(jobType) {\n var normalized = String(jobType || '').trim();\n if (!normalized) {\n return '';\n }\n return 'job:' + normalized;\n }\n\n function parseJobTypeFromTopTab(tabKey) {\n var normalized = String(tabKey || '').trim();\n if (normalized.indexOf('job:') !== 0) {\n return '';\n }\n return normalized.slice(4);\n }\n\n function hasJobType(jobType) {\n var normalized = String(jobType || '').trim();\n if (!normalized) {\n return false;\n }\n var jobTypes = Array.isArray(state.jobTypes) ? state.jobTypes : [];\n for (var i = 0; i < jobTypes.length; i++) {\n var item = parseJobTypeItem(jobTypes[i]);\n if (item.jobType === normalized) {\n return true;\n }\n }\n return false;\n }\n\n function applyInitialNavigation() {\n if (state.initialNavigationApplied) {\n return;\n }\n state.initialNavigationApplied = true;\n state.activeSubTab = normalizeSubTab(state.initialPage);\n\n if (state.initialPage === 'overview') {\n state.activeTopTab = 'overview';\n return;\n }\n if (!Array.isArray(state.jobTypes) || state.jobTypes.length === 0) {\n state.activeTopTab = 'overview';\n return;\n }\n // If a specific job type was provided in the URL, use it\n if (state.initialJob && hasJobType(state.initialJob)) {\n state.selectedJobType = state.initialJob;\n } else {\n var firstItem = parseJobTypeItem(state.jobTypes[0]);\n state.selectedJobType = firstItem.jobType;\n }\n state.activeTopTab = topTabKeyForJobType(state.selectedJobType);\n }\n\n function ensureActiveNavigation() {\n state.activeSubTab = normalizeSubTab(state.activeSubTab);\n\n if (state.selectedJobType && !hasJobType(state.selectedJobType)) {\n state.selectedJobType = '';\n state.descriptor = null;\n state.config = null;\n }\n\n var topTabJobType = parseJobTypeFromTopTab(state.activeTopTab);\n if (topTabJobType && !hasJobType(topTabJobType)) {\n state.activeTopTab = 'overview';\n topTabJobType = '';\n }\n\n if (state.activeTopTab === 'overview') {\n if (!state.selectedJobType && Array.isArray(state.jobTypes) && state.jobTypes.length > 0) {\n var item = parseJobTypeItem(state.jobTypes[0]);\n state.selectedJobType = item.jobType;\n }\n return;\n }\n\n if (!topTabJobType && state.selectedJobType) {\n topTabJobType = state.selectedJobType;\n }\n if (!topTabJobType && Array.isArray(state.jobTypes) && state.jobTypes.length > 0) {\n var item = parseJobTypeItem(state.jobTypes[0]);\n topTabJobType = item.jobType;\n }\n if (!topTabJobType) {\n state.activeTopTab = 'overview';\n return;\n }\n\n state.selectedJobType = topTabJobType;\n state.activeTopTab = topTabKeyForJobType(topTabJobType);\n }\n\n function renderTopTabs() {\n var root = document.getElementById('plugin-top-tabs');\n if (!root) {\n return;\n }\n\n var html = '' +\n '<li class=\"nav-item\">' +\n '<button type=\"button\" class=\"nav-link\" data-plugin-top-tab=\"overview\">' +\n '<i class=\"bi bi-graph-up-arrow me-1\"></i>Overview' +\n '</button>' +\n '</li>';\n\n var jobTypes = Array.isArray(state.jobTypes) ? state.jobTypes : [];\n for (var i = 0; i < jobTypes.length; i++) {\n var item = parseJobTypeItem(jobTypes[i]);\n var jobType = item.jobType;\n var displayName = item.displayName;\n \n if (!jobType) {\n continue;\n }\n html += '' +\n '<li class=\"nav-item\">' +\n '<button type=\"button\" class=\"nav-link\" data-plugin-top-tab=\"' + escapeHtml(topTabKeyForJobType(jobType)) + '\">' +\n escapeHtml(displayName) +\n '</button>' +\n '</li>';\n }\n root.innerHTML = html;\n }\n\n function renderNavigationState() {\n var selectedJobTypeLabel = document.getElementById('plugin-selected-job-type');\n if (selectedJobTypeLabel) {\n selectedJobTypeLabel.textContent = state.selectedJobType || '-';\n }\n\n var isOverview = state.activeTopTab === 'overview';\n var subtabRow = document.getElementById('plugin-subtab-row');\n if (subtabRow) {\n subtabRow.classList.toggle('d-none', isOverview);\n }\n\n var topTabs = document.querySelectorAll('#plugin-top-tabs [data-plugin-top-tab]');\n for (var i = 0; i < topTabs.length; i++) {\n var topTab = topTabs[i];\n var topKey = String(topTab.getAttribute('data-plugin-top-tab') || '');\n topTab.classList.toggle('active', topKey === state.activeTopTab);\n }\n\n var subTabs = document.querySelectorAll('#plugin-subtabs [data-plugin-subtab]');\n for (var j = 0; j < subTabs.length; j++) {\n var subTab = subTabs[j];\n var subKey = String(subTab.getAttribute('data-plugin-subtab') || '');\n subTab.classList.toggle('active', !isOverview && subKey === state.activeSubTab);\n }\n\n function toggleSection(sectionName, visible) {\n var section = document.querySelector('.plugin-section-' + sectionName);\n if (!section) {\n return;\n }\n section.classList.toggle('plugin-section-active', !!visible);\n }\n\n toggleSection('overview', isOverview);\n toggleSection('configuration', !isOverview && state.activeSubTab === 'configuration');\n toggleSection('detection', !isOverview && state.activeSubTab === 'detection');\n toggleSection('queue', !isOverview && state.activeSubTab === 'queue');\n toggleSection('execution', !isOverview && state.activeSubTab === 'execution');\n }\n\n function renderJobLink(jobID) {\n var normalized = String(jobID || '').trim();\n if (!normalized) {\n return '<small>-</small>';\n }\n return '<button type=\"button\" class=\"btn btn-link btn-sm p-0 align-baseline plugin-job-link\" data-job-id=\"' + escapeHtml(normalized) + '\">' + escapeHtml(normalized) + '</button>';\n }\n\n function toPrettyJson(value) {\n if (value === null || value === undefined || value === '') {\n return '';\n }\n if (typeof value === 'string') {\n return value;\n }\n try {\n return JSON.stringify(value, null, 2);\n } catch (e) {\n return String(value);\n }\n }\n\n function clonePlainObject(value) {\n if (!value || typeof value !== 'object') {\n return null;\n }\n try {\n return JSON.parse(JSON.stringify(value));\n } catch (e) {\n return null;\n }\n }\n\n function extractExecutionPlan(job) {\n if (!job || !job.parameters) {\n return null;\n }\n var plan = job.parameters.execution_plan;\n if (!plan) {\n return null;\n }\n if (typeof plan === 'string') {\n try {\n plan = JSON.parse(plan);\n } catch (e) {\n return null;\n }\n }\n if (typeof plan !== 'object' || Array.isArray(plan)) {\n return null;\n }\n return plan;\n }\n\n function removeExecutionPlanForDisplay(parameters) {\n var copy = clonePlainObject(parameters);\n if (!copy) {\n return parameters;\n }\n if (copy.execution_plan !== undefined) {\n delete copy.execution_plan;\n }\n if (Object.keys(copy).length === 0) {\n return null;\n }\n return copy;\n }\n\n function parseIntOrDefault(value, fallback) {\n var parsed = parseInt(value, 10);\n if (Number.isNaN(parsed)) {\n return fallback;\n }\n return parsed;\n }\n\n function normalizeShardIDs(value) {\n if (!Array.isArray(value)) {\n return [];\n }\n var out = [];\n for (var i = 0; i < value.length; i++) {\n var parsed = parseIntOrDefault(value[i], -1);\n if (parsed >= 0) {\n out.push(parsed);\n }\n }\n out.sort(function(a, b) { return a - b; });\n return out;\n }\n\n function classifyShardLabel(shardID, dataShardCount) {\n if (shardID < dataShardCount) {\n return {\n kind: 'data',\n label: String(shardID),\n className: 'bg-primary',\n title: 'Data shard ' + shardID,\n };\n }\n var parityIndex = shardID - dataShardCount;\n return {\n kind: 'parity',\n label: String(shardID),\n className: 'bg-warning text-dark',\n title: 'Parity shard ' + shardID + ' (index ' + parityIndex + ')',\n };\n }\n\n function renderShardBadges(shardIDs, dataShardCount) {\n if (!Array.isArray(shardIDs) || shardIDs.length === 0) {\n return '<span class=\"text-muted\">-</span>';\n }\n var html = '';\n for (var i = 0; i < shardIDs.length; i++) {\n var shard = classifyShardLabel(shardIDs[i], dataShardCount);\n html += '<span class=\"badge me-1 ' + shard.className + '\" title=\"' + escapeHtml(shard.title) + '\">' + escapeHtml(shard.label) + '</span>';\n }\n return html;\n }\n\n function renderExecutionPlan(plan) {\n if (!plan || typeof plan !== 'object') {\n return '';\n }\n\n var jobType = String(plan.job_type || '').trim().toLowerCase();\n if (jobType === 'volume_balance') {\n return renderBalanceExecutionPlan(plan);\n }\n if (jobType !== 'erasure_coding') {\n var fallbackText = toPrettyJson(plan);\n if (!fallbackText) {\n return '';\n }\n return '<div class=\"mb-3\"><h6>Execution Plan</h6><pre class=\"plugin-job-detail-json\">' + escapeHtml(fallbackText) + '</pre></div>';\n }\n\n var dataShards = parseIntOrDefault(plan.data_shards, 10);\n var parityShards = parseIntOrDefault(plan.parity_shards, 4);\n var totalShards = parseIntOrDefault(plan.total_shards, dataShards + parityShards);\n var sources = Array.isArray(plan.sources) ? plan.sources : [];\n var targets = Array.isArray(plan.targets) ? plan.targets : [];\n var assignments = Array.isArray(plan.shard_assignments) ? plan.shard_assignments : [];\n\n var html = '';\n html += '<div class=\"mb-3\"><h6>Execution Plan</h6>';\n html += '<div class=\"row g-2 mb-2\">' +\n '<div class=\"col-md-3\"><small><strong>Volume:</strong> ' + escapeHtml(textOrDash(plan.volume_id)) + '</small></div>' +\n '<div class=\"col-md-3\"><small><strong>Collection:</strong> ' + escapeHtml(textOrDash(plan.collection)) + '</small></div>' +\n '<div class=\"col-md-3\"><small><strong>Shards:</strong> ' + escapeHtml(String(dataShards)) + '+' + escapeHtml(String(parityShards)) + '</small></div>' +\n '<div class=\"col-md-3\"><small><strong>Total:</strong> ' + escapeHtml(String(totalShards)) + '</small></div>' +\n '</div>';\n\n html += '<div class=\"small text-muted mb-2\">' +\n '<span class=\"badge bg-primary me-1\">Data</span>' +\n '<span class=\"badge bg-warning text-dark me-2\">Parity</span>' +\n 'Source and target placement per shard.' +\n '</div>';\n\n function renderEndpointsTable(title, endpoints) {\n if (!endpoints.length) {\n return '<div class=\"mb-2\"><strong>' + escapeHtml(title) + ':</strong> <span class=\"text-muted\">none</span></div>';\n }\n var table = '<div class=\"table-responsive mb-2\"><table class=\"table table-sm table-striped mb-0\">' +\n '<thead><tr><th>#</th><th>Node</th><th>DC</th><th>Rack</th><th>Volume</th><th>Shards</th></tr></thead><tbody>';\n for (var i = 0; i < endpoints.length; i++) {\n var endpoint = endpoints[i] || {};\n var endpointShards = normalizeShardIDs(endpoint.shard_ids);\n table += '<tr>' +\n '<td>' + escapeHtml(String(i + 1)) + '</td>' +\n '<td><code>' + escapeHtml(textOrDash(endpoint.node)) + '</code></td>' +\n '<td>' + escapeHtml(textOrDash(endpoint.data_center)) + '</td>' +\n '<td>' + escapeHtml(textOrDash(endpoint.rack)) + '</td>' +\n '<td>' + escapeHtml(textOrDash(endpoint.volume_id)) + '</td>' +\n '<td>' + renderShardBadges(endpointShards, dataShards) + '</td>' +\n '</tr>';\n }\n table += '</tbody></table></div>';\n return '<div class=\"mb-2\"><strong>' + escapeHtml(title) + '</strong></div>' + table;\n }\n\n html += renderEndpointsTable('Sources', sources);\n html += renderEndpointsTable('Targets', targets);\n\n if (assignments.length) {\n html += '<div class=\"mb-2\"><strong>Shard Assignments</strong></div>';\n html += '<div class=\"table-responsive\"><table class=\"table table-sm table-striped mb-0\">' +\n '<thead><tr><th>Shard</th><th>Kind</th><th>Target</th><th>DC</th><th>Rack</th></tr></thead><tbody>';\n for (var j = 0; j < assignments.length; j++) {\n var assignment = assignments[j] || {};\n var shardID = parseIntOrDefault(assignment.shard_id, -1);\n if (shardID < 0) {\n continue;\n }\n var shard = classifyShardLabel(shardID, dataShards);\n html += '<tr>' +\n '<td><span class=\"badge ' + shard.className + '\">' + escapeHtml(shard.label) + '</span></td>' +\n '<td>' + escapeHtml(textOrDash(assignment.kind || shard.kind)) + '</td>' +\n '<td><code>' + escapeHtml(textOrDash(assignment.target_node)) + '</code></td>' +\n '<td>' + escapeHtml(textOrDash(assignment.target_data_center)) + '</td>' +\n '<td>' + escapeHtml(textOrDash(assignment.target_rack)) + '</td>' +\n '</tr>';\n }\n html += '</tbody></table></div>';\n }\n\n html += '</div>';\n return html;\n }\n\n function renderBalanceExecutionPlan(plan) {\n var html = '<div class=\"mb-3\"><h6>Execution Plan</h6>';\n var moves = Array.isArray(plan.moves) ? plan.moves : [];\n\n if (moves.length === 0) {\n // Single-move balance job\n var src = textOrDash(plan.source_node || plan.source_server);\n var dst = textOrDash(plan.target_node || plan.target_server);\n var vid = textOrDash(plan.volume_id);\n var col = textOrDash(plan.collection);\n html += `<div class=\"row g-2 mb-2\">\n <div class=\"col-md-3\"><small><strong>Volume:</strong> ${escapeHtml(vid)}</small></div>\n <div class=\"col-md-3\"><small><strong>Collection:</strong> ${escapeHtml(col)}</small></div>\n <div class=\"col-md-3\"><small><strong>Source:</strong> <code>${escapeHtml(src)}</code></small></div>\n <div class=\"col-md-3\"><small><strong>Target:</strong> <code>${escapeHtml(dst)}</code></small></div>\n </div>`;\n } else {\n // Batch balance job\n html += '<div class=\"mb-2\"><span class=\"badge bg-info\">' + escapeHtml(String(moves.length)) + ' moves</span></div>';\n html += '<div class=\"table-responsive\"><table class=\"table table-sm table-striped mb-0\">' +\n '<thead><tr><th>#</th><th>Volume</th><th>Source</th><th>Target</th><th>Collection</th></tr></thead><tbody>';\n for (var i = 0; i < moves.length; i++) {\n var move = moves[i] || {};\n html += `<tr>\n <td>${escapeHtml(String(i + 1))}</td>\n <td>${escapeHtml(textOrDash(move.volume_id))}</td>\n <td><code>${escapeHtml(textOrDash(move.source_node))}</code></td>\n <td><code>${escapeHtml(textOrDash(move.target_node))}</code></td>\n <td>${escapeHtml(textOrDash(move.collection))}</td>\n </tr>`;\n }\n html += '</tbody></table></div>';\n }\n\n html += '</div>';\n return html;\n }\n\n function isActiveJobState(candidateState) {\n var jobState = candidateState;\n if (candidateState && typeof candidateState === 'object' && candidateState.state !== undefined) {\n jobState = candidateState.state;\n }\n var st = String(jobState || '').toLowerCase();\n return st === 'job_state_pending' || st === 'job_state_assigned' || st === 'job_state_running' ||\n st === 'pending' || st === 'assigned' || st === 'running' || st === 'in_progress';\n }\n\n function setExpireButtonState(job) {\n var expireBtn = document.getElementById('plugin-expire-job-btn');\n if (!expireBtn) {\n return;\n }\n var jobID = job && job.job_id ? String(job.job_id) : '';\n var active = isActiveJobState(job);\n expireBtn.setAttribute('data-job-id', jobID);\n expireBtn.disabled = !jobID || !active;\n if (!jobID) {\n expireBtn.title = 'Select a job to expire.';\n } else if (!active) {\n expireBtn.title = 'Job is not active.';\n } else {\n expireBtn.title = 'Expire job to unblock scheduling.';\n }\n }\n\n async function expireJob(jobID) {\n var normalizedJobID = String(jobID || '').trim();\n if (!normalizedJobID) {\n return;\n }\n\n var reason = window.prompt('Expire job ' + normalizedJobID + '? Optional reason:', 'job expired by admin request');\n if (reason === null) {\n return;\n }\n\n var expireBtn = document.getElementById('plugin-expire-job-btn');\n if (expireBtn) {\n expireBtn.disabled = true;\n }\n\n try {\n var response = await pluginRequest('POST', '/api/plugin/jobs/' + encodePath(normalizedJobID) + '/expire', {\n reason: reason,\n });\n if (response && response.expired === false) {\n notify(response.message || 'Job is not active.', 'info');\n } else {\n notify('Job expired: ' + normalizedJobID, 'success');\n }\n } catch (e) {\n notify('Failed to expire job: ' + e.message, 'error');\n return;\n }\n try {\n await refreshJobsAndActivities();\n } catch (refreshErr) {\n notify('Monitoring refresh failed: ' + refreshErr.message, 'error');\n }\n await openJobDetail(normalizedJobID);\n }\n\n async function openJobDetail(jobID) {\n var normalizedJobID = String(jobID || '').trim();\n if (!normalizedJobID) {\n return;\n }\n\n var modalElement = document.getElementById('plugin-job-detail-modal');\n var contentRoot = document.getElementById('plugin-job-detail-content');\n if (!modalElement || !contentRoot) {\n return;\n }\n\n var modal;\n if (window.bootstrap && window.bootstrap.Modal) {\n modal = window.bootstrap.Modal.getOrCreateInstance(modalElement);\n }\n if (modal) {\n modal.show();\n }\n\n setExpireButtonState(null);\n contentRoot.innerHTML = '<div class=\"text-muted\">Loading job detail...</div>';\n try {\n var detail = await pluginRequest('GET', '/api/plugin/jobs/' + encodePath(normalizedJobID) + '/detail?activity_limit=500&related_limit=20');\n var job = (detail && detail.job) ? detail.job : {};\n setExpireButtonState(job);\n var runRecord = detail && detail.run_record ? detail.run_record : null;\n var activities = (detail && Array.isArray(detail.activities)) ? detail.activities : [];\n var relatedJobs = (detail && Array.isArray(detail.related_jobs)) ? detail.related_jobs : [];\n var html = '';\n\n html += '<div class=\"row g-3 mb-3\">' +\n '<div class=\"col-lg-8\">' +\n '<div><strong>Job ID:</strong> ' + escapeHtml(textOrDash(job.job_id || normalizedJobID)) + '</div>' +\n '<div><strong>Type:</strong> ' + escapeHtml(textOrDash(job.job_type)) + '</div>' +\n '<div><strong>State:</strong> ' + escapeHtml(textOrDash(job.state)) + '</div>' +\n '<div><strong>Worker:</strong> ' + escapeHtml(textOrDash(job.worker_id)) + '</div>' +\n '<div><strong>Updated:</strong> ' + escapeHtml(parseTime(job.updated_at) || '-') + '</div>' +\n '</div>' +\n '<div class=\"col-lg-4\">' +\n '<div><strong>Attempt:</strong> ' + escapeHtml(textOrDash(job.attempt)) + '</div>' +\n '<div><strong>Progress:</strong> ' + escapeHtml(String(Math.round(Number(job.progress || 0)))) + '%</div>' +\n '<div><strong>Created:</strong> ' + escapeHtml(parseTime(job.created_at) || '-') + '</div>' +\n '<div><strong>Completed:</strong> ' + escapeHtml(parseTime(job.completed_at) || '-') + '</div>' +\n '</div>' +\n '</div>';\n\n if (job.summary) {\n html += '<div class=\"mb-2\"><strong>Summary:</strong> ' + escapeHtml(String(job.summary)) + '</div>';\n }\n if (job.detail) {\n html += '<div class=\"mb-2\"><strong>Detail:</strong> ' + escapeHtml(String(job.detail)) + '</div>';\n }\n if (job.message) {\n html += '<div class=\"mb-2\"><strong>Message:</strong> ' + escapeHtml(String(job.message)) + '</div>';\n }\n if (job.error_message) {\n html += '<div class=\"mb-2 text-danger\"><strong>Error:</strong> ' + escapeHtml(String(job.error_message)) + '</div>';\n }\n if (job.result_summary) {\n html += '<div class=\"mb-2\"><strong>Result:</strong> ' + escapeHtml(String(job.result_summary)) + '</div>';\n }\n\n var executionPlan = extractExecutionPlan(job);\n if (executionPlan) {\n html += renderExecutionPlan(executionPlan);\n }\n\n var parametersText = toPrettyJson(removeExecutionPlanForDisplay(job.parameters));\n if (parametersText) {\n html += '<div class=\"mb-3\"><h6>Parameters</h6><pre class=\"plugin-job-detail-json\">' + escapeHtml(parametersText) + '</pre></div>';\n }\n var labelsText = toPrettyJson(job.labels);\n if (labelsText) {\n html += '<div class=\"mb-3\"><h6>Labels</h6><pre class=\"plugin-job-detail-json\">' + escapeHtml(labelsText) + '</pre></div>';\n }\n var outputsText = toPrettyJson(job.result_output_values);\n if (outputsText) {\n html += '<div class=\"mb-3\"><h6>Result Output Values</h6><pre class=\"plugin-job-detail-json\">' + escapeHtml(outputsText) + '</pre></div>';\n }\n\n if (runRecord) {\n html += '<div class=\"mb-3\"><h6>Run Record</h6>' +\n '<div><strong>Outcome:</strong> ' + escapeHtml(textOrDash(runRecord.outcome)) + '</div>' +\n '<div><strong>Duration:</strong> ' + escapeHtml(formatDurationMs(runRecord.duration_ms)) + '</div>' +\n '<div><strong>Completed:</strong> ' + escapeHtml(parseTime(runRecord.completed_at) || '-') + '</div>' +\n '<div><strong>Message:</strong> ' + escapeHtml(textOrDash(runRecord.message)) + '</div>' +\n '</div>';\n }\n\n html += '<h6 class=\"mt-3\">Activity Timeline</h6>';\n if (!activities.length) {\n html += '<div class=\"text-muted mb-3\">No activity records.</div>';\n } else {\n html += '<div class=\"table-responsive mb-3\"><table class=\"table table-sm table-striped\">' +\n '<thead><tr><th>Time</th><th>Stage</th><th>Source</th><th>Worker</th><th>Message</th></tr></thead><tbody>';\n for (var i = 0; i < activities.length; i++) {\n var activity = activities[i] || {};\n html += '<tr>' +\n '<td><small>' + escapeHtml(parseTime(activity.occurred_at) || '-') + '</small></td>' +\n '<td>' + escapeHtml(textOrDash(activity.stage)) + '</td>' +\n '<td>' + escapeHtml(textOrDash(activity.source)) + '</td>' +\n '<td>' + escapeHtml(textOrDash(activity.worker_id)) + '</td>' +\n '<td><small>' + escapeHtml(textOrDash(activity.message)) + '</small></td>' +\n '</tr>';\n }\n html += '</tbody></table></div>';\n }\n\n if (relatedJobs.length) {\n html += '<h6>Related Jobs</h6><div class=\"table-responsive\"><table class=\"table table-sm table-hover\">' +\n '<thead><tr><th>Job ID</th><th>State</th><th>Worker</th><th>Updated</th></tr></thead><tbody>';\n for (var j = 0; j < relatedJobs.length; j++) {\n var related = relatedJobs[j] || {};\n html += '<tr>' +\n '<td><small>' + escapeHtml(textOrDash(related.job_id)) + '</small></td>' +\n '<td>' + escapeHtml(textOrDash(related.state)) + '</td>' +\n '<td>' + escapeHtml(textOrDash(related.worker_id)) + '</td>' +\n '<td><small>' + escapeHtml(parseTime(related.updated_at) || '-') + '</small></td>' +\n '</tr>';\n }\n html += '</tbody></table></div>';\n }\n\n contentRoot.innerHTML = html;\n } catch (e) {\n setExpireButtonState(null);\n contentRoot.innerHTML = '<div class=\"alert alert-danger mb-0\">Failed to load job detail: ' + escapeHtml(e.message) + '</div>';\n }\n }\n\n function formatDurationMs(value) {\n var ms = Number(value || 0);\n if (!Number.isFinite(ms) || ms <= 0) {\n return '-';\n }\n if (ms < 1000) {\n return ms + 'ms';\n }\n var sec = Math.floor(ms / 1000);\n var remainMs = ms % 1000;\n if (sec < 60) {\n return sec + '.' + String(Math.floor(remainMs / 100)) + 's';\n }\n var min = Math.floor(sec / 60);\n var remainSec = sec % 60;\n return min + 'm ' + remainSec + 's';\n }\n\n function getWorkerField(worker, name) {\n if (!worker) {\n return null;\n }\n if (worker[name] !== undefined) {\n return worker[name];\n }\n var camel = name.charAt(0).toUpperCase() + name.slice(1);\n if (worker[camel] !== undefined) {\n return worker[camel];\n }\n return null;\n }\n\n function renderStatus() {\n var allJobs = Array.isArray(state.allJobs) ? state.allJobs : [];\n var allActivities = Array.isArray(state.allActivities) ? state.allActivities : [];\n\n var activeCount = allJobs.filter(function(job) {\n return isActiveJobState(job);\n }).length;\n\n document.getElementById('plugin-status-workers').textContent = String(state.workers.length);\n document.getElementById('plugin-status-active-jobs').textContent = String(activeCount);\n document.getElementById('plugin-status-activities').textContent = String(allActivities.length);\n }\n\n function renderJobTypeSummary() {\n var tbody = document.getElementById('plugin-jobtype-summary-body');\n if (!tbody) {\n return;\n }\n\n var activeByType = {};\n var activityByType = {};\n\n var allJobs = Array.isArray(state.allJobs) ? state.allJobs : [];\n var allActivities = Array.isArray(state.allActivities) ? state.allActivities : [];\n\n for (var i = 0; i < allJobs.length; i++) {\n var job = allJobs[i] || {};\n var jobType = String(job.job_type || '').trim();\n if (!jobType) {\n continue;\n }\n var isActive = isActiveJobState(job);\n if (!isActive) {\n continue;\n }\n if (!activeByType[jobType]) {\n activeByType[jobType] = 0;\n }\n activeByType[jobType]++;\n }\n\n for (var j = 0; j < allActivities.length; j++) {\n var activity = allActivities[j] || {};\n var activityJobType = String(activity.job_type || '').trim();\n if (!activityJobType) {\n continue;\n }\n if (!activityByType[activityJobType]) {\n activityByType[activityJobType] = 0;\n }\n activityByType[activityJobType]++;\n }\n\n var known = Array.isArray(state.jobTypes) ? state.jobTypes.slice() : [];\n var seen = {};\n var jobTypes = [];\n\n for (var k = 0; k < known.length; k++) {\n var item = parseJobTypeItem(known[k]);\n var knownType = item && item.jobType ? String(item.jobType).trim() : '';\n if (!knownType || seen[knownType]) {\n continue;\n }\n seen[knownType] = true;\n jobTypes.push(knownType);\n }\n\n Object.keys(activeByType).forEach(function(jobType) {\n if (!seen[jobType]) {\n seen[jobType] = true;\n jobTypes.push(jobType);\n }\n });\n Object.keys(activityByType).forEach(function(jobType) {\n if (!seen[jobType]) {\n seen[jobType] = true;\n jobTypes.push(jobType);\n }\n });\n\n jobTypes.sort();\n\n if (jobTypes.length === 0) {\n tbody.innerHTML = '<tr><td colspan=\\\"3\\\" class=\\\"text-muted text-center py-3\\\">No job types discovered</td></tr>';\n return;\n }\n\n var rows = '';\n for (var m = 0; m < jobTypes.length; m++) {\n var rowType = jobTypes[m];\n rows += '<tr>' +\n '<td>' + escapeHtml(rowType) + '</td>' +\n '<td><span class=\\\"badge bg-warning text-dark\\\">' + escapeHtml(String(activeByType[rowType] || 0)) + '</span></td>' +\n '<td><span class=\\\"badge bg-info\\\">' + escapeHtml(String(activityByType[rowType] || 0)) + '</span></td>' +\n '</tr>';\n }\n tbody.innerHTML = rows;\n }\n\n function computeEffectiveExecutionCapacity(globalExec, perWorkerExec, executorWorkers) {\n var capacities = [];\n if (globalExec > 0) {\n capacities.push(globalExec);\n }\n var workerCapacity = perWorkerExec > 0 && executorWorkers > 0 ? (perWorkerExec * executorWorkers) : 0;\n if (workerCapacity > 0) {\n capacities.push(workerCapacity);\n }\n if (!capacities.length) {\n return 0;\n }\n var effective = capacities[0];\n for (var i = 1; i < capacities.length; i++) {\n if (capacities[i] < effective) {\n effective = capacities[i];\n }\n }\n return effective;\n }\n\n function renderSchedulerStates() {\n var tbody = document.getElementById('plugin-scheduler-table-body');\n if (!tbody) {\n return;\n }\n\n var states = Array.isArray(state.schedulerStates) ? state.schedulerStates : [];\n if (!states.length) {\n tbody.innerHTML = '<tr><td colspan=\"10\" class=\"text-muted text-center py-3\">No scheduler state available</td></tr>';\n return;\n }\n\n var rows = '';\n for (var i = 0; i < states.length; i++) {\n var item = states[i] || {};\n var enabled = !!item.enabled;\n var inFlight = !!item.detection_in_flight;\n var detector = item.detector_available ? textOrDash(item.detector_worker_id) : 'No detector';\n var maxRuntimeSeconds = Number(item.job_type_max_runtime_seconds || 0);\n var maxRuntimeText = maxRuntimeSeconds > 0 ? (String(maxRuntimeSeconds) + 's') : '-';\n var globalExec = Number(item.global_execution_concurrency || 0);\n var perWorkerExec = Number(item.per_worker_execution_concurrency || 0);\n var executorWorkers = Number(item.executor_worker_count || 0);\n var effectiveExec = computeEffectiveExecutionCapacity(globalExec, perWorkerExec, executorWorkers);\n var globalExecText = enabled ? String(globalExec) : '-';\n var perWorkerExecText = enabled ? String(perWorkerExec) : '-';\n var executorWorkersText = enabled ? String(executorWorkers) : '-';\n var effectiveExecText = enabled ? String(effectiveExec) : '-';\n var lastRunStatus = textOrDash(item.last_run_status);\n var lastRunTime = parseTime(item.last_run_completed_at);\n var lastRunText = '-';\n if (lastRunStatus !== '-' || lastRunTime) {\n var statusLabel = lastRunStatus !== '-' ? lastRunStatus : 'run';\n lastRunText = lastRunTime ? (statusLabel + ' @ ' + lastRunTime) : statusLabel;\n }\n\n var enabledBadge = enabled ? '<span class=\"badge bg-success\">Enabled</span>' : '<span class=\"badge bg-secondary\">Disabled</span>';\n var inFlightBadge = inFlight ? '<span class=\"badge bg-warning text-dark\">Yes</span>' : '<span class=\"badge bg-light text-dark\">No</span>';\n var policyErrorHtml = '';\n if (item.policy_error) {\n policyErrorHtml = '<div><small class=\"text-danger\">' + escapeHtml(String(item.policy_error)) + '</small></div>';\n }\n\n rows += '<tr>' +\n '<td>' + escapeHtml(textOrDash(item.job_type)) + policyErrorHtml + '</td>' +\n '<td>' + enabledBadge + '</td>' +\n '<td><small>' + escapeHtml(detector) + '</small></td>' +\n '<td>' + inFlightBadge + '</td>' +\n '<td><small>' + escapeHtml(maxRuntimeText) + '</small></td>' +\n '<td><small>' + escapeHtml(globalExecText) + '</small></td>' +\n '<td><small>' + escapeHtml(perWorkerExecText) + '</small></td>' +\n '<td><small>' + escapeHtml(executorWorkersText) + '</small></td>' +\n '<td><small>' + escapeHtml(effectiveExecText) + '</small></td>' +\n '<td><small>' + escapeHtml(lastRunText) + '</small></td>' +\n '</tr>';\n }\n\n tbody.innerHTML = rows;\n }\n\n function renderSchedulerStatus() {\n window.renderPluginSchedulerStatus({scheduler: state.schedulerStatus, lock: state.schedulerLock, job_type: monitorJobTypeScope()});\n var valueNodes = document.querySelectorAll('.plugin-scheduler-next-run');\n if (!valueNodes.length) {\n return;\n }\n var metaNodes = document.querySelectorAll('.plugin-scheduler-next-run-meta');\n var status = state.schedulerStatus || {};\n var nextRun = parseTime(status.next_detection_at);\n var display = nextRun || '-';\n valueNodes.forEach(function(node) {\n node.textContent = display;\n });\n var metaText = nextRun ? 'Next scheduled check (local time); locks and other jobs may delay detection.' : 'Not scheduled';\n if (metaNodes.length) {\n metaNodes.forEach(function(node) {\n node.textContent = metaText;\n });\n }\n }\n\n function renderWorkers() {\n var tbody = document.getElementById('plugin-workers-table-body');\n if (!state.workers.length) {\n tbody.innerHTML = '<tr><td colspan=\"4\" class=\"text-muted text-center py-3\">No connected workers</td></tr>';\n return;\n }\n\n var rows = '';\n for (var i = 0; i < state.workers.length; i++) {\n var worker = state.workers[i];\n var workerID = textOrDash(getWorkerField(worker, 'workerID'));\n var address = textOrDash(getWorkerField(worker, 'address'));\n var caps = getWorkerField(worker, 'capabilities') || {};\n var capBadges = [];\n\n Object.keys(caps).sort().forEach(function(jobType) {\n var cap = caps[jobType] || {};\n var labels = [];\n if (cap.can_detect) {\n labels.push('D');\n }\n if (cap.can_execute) {\n labels.push('E');\n }\n var text = jobType;\n if (labels.length) {\n text += ' (' + labels.join('/') + ')';\n }\n capBadges.push('<span class=\"badge bg-secondary plugin-capability-badge\">' + escapeHtml(text) + '</span>');\n });\n\n if (!capBadges.length) {\n capBadges.push('<span class=\"text-muted\">-</span>');\n }\n\n var heartbeat = getWorkerField(worker, 'heartbeat') || {};\n var detUsed = Number(heartbeat.detection_slots_used || heartbeat.DetectionSlotsUsed || 0);\n var detTotal = Number(heartbeat.detection_slots_total || heartbeat.DetectionSlotsTotal || 0);\n var execUsed = Number(heartbeat.execution_slots_used || heartbeat.ExecutionSlotsUsed || 0);\n var execTotal = Number(heartbeat.execution_slots_total || heartbeat.ExecutionSlotsTotal || 0);\n var runningWork = heartbeat.running_work || heartbeat.RunningWork || [];\n var queuedByType = heartbeat.queued_jobs_by_type || heartbeat.QueuedJobsByType || {};\n var queuedTotal = 0;\n Object.keys(queuedByType || {}).forEach(function(jobType) {\n var queuedCount = Number(queuedByType[jobType] || 0);\n if (Number.isFinite(queuedCount) && queuedCount > 0) {\n queuedTotal += queuedCount;\n }\n });\n var loadLines = [];\n loadLines.push('Detect: ' + String(detUsed) + '/' + String(detTotal));\n loadLines.push('Execute: ' + String(execUsed) + '/' + String(execTotal));\n loadLines.push('Running: ' + String(Array.isArray(runningWork) ? runningWork.length : 0));\n loadLines.push('Queued: ' + String(queuedTotal));\n\n rows += '<tr>' +\n '<td><div class=\"fw-semibold\">' + escapeHtml(workerID) + '</div></td>' +\n '<td><small>' + escapeHtml(address) + '</small></td>' +\n '<td>' + capBadges.join('') + '</td>' +\n '<td><small>' + escapeHtml(loadLines.join(' | ')) + '</small></td>' +\n '</tr>';\n }\n\n tbody.innerHTML = rows;\n }\n\n function normalizeJobStateForFilter(value) {\n var normalized = String(value || '').toLowerCase();\n if (normalized.indexOf('job_state_') === 0) {\n normalized = normalized.slice('job_state_'.length);\n }\n return normalized;\n }\n\n function matchesExecutionStateFilter(jobState, selectedFilter) {\n var target = normalizeJobStateForFilter(selectedFilter);\n if (!target) {\n return true;\n }\n var actual = normalizeJobStateForFilter(jobState);\n if (actual === target) {\n return true;\n }\n if (target === 'running' && actual === 'in_progress') {\n return true;\n }\n return false;\n }\n\n function isDetectionActivitySource(source) {\n var normalized = String(source || '').toLowerCase();\n if (!normalized) {\n return false;\n }\n if (normalized === 'worker_detection') {\n return true;\n }\n return normalized.indexOf('detector') >= 0;\n }\n\n function renderExecutionJobs() {\n var tbody = document.getElementById('plugin-execution-jobs-table-body');\n if (!tbody) {\n return;\n }\n\n var filteredJobs = [];\n var jobs = Array.isArray(state.jobs) ? state.jobs : [];\n for (var i = 0; i < jobs.length; i++) {\n var job = jobs[i] || {};\n var jobType = String(job.job_type || '').trim();\n if (state.selectedJobType && jobType !== state.selectedJobType) {\n continue;\n }\n if (!matchesExecutionStateFilter(job.state, state.monitorExecutionJobState)) {\n continue;\n }\n filteredJobs.push(job);\n }\n\n if (!filteredJobs.length) {\n tbody.innerHTML = '<tr><td colspan=\"7\" class=\"text-muted text-center py-3\">No execution jobs tracked yet</td></tr>';\n return;\n }\n\n var rows = '';\n for (var j = 0; j < filteredJobs.length; j++) {\n var executionJob = filteredJobs[j] || {};\n var progress = Number(executionJob.progress || 0);\n if (!Number.isFinite(progress) || progress < 0) {\n progress = 0;\n }\n if (progress > 100) {\n progress = 100;\n }\n\n var barClass = 'bg-info';\n var stateText = String(executionJob.state || 'unknown').toLowerCase();\n if (stateText.indexOf('failed') >= 0) {\n barClass = 'bg-danger';\n } else if (stateText.indexOf('succeed') >= 0 || stateText.indexOf('complete') >= 0) {\n barClass = 'bg-success';\n } else if (stateText.indexOf('run') >= 0 || stateText.indexOf('progress') >= 0) {\n barClass = 'bg-warning';\n }\n\n var jobTypeCell = escapeHtml(textOrDash(executionJob.job_type));\n var execLabels = executionJob.labels || {};\n if (execLabels.batch === 'true' && execLabels.batch_size) {\n jobTypeCell += ' <span class=\"badge bg-info\">' + escapeHtml(execLabels.batch_size) + ' moves</span>';\n }\n\n rows += '<tr>' +\n '<td>' + renderJobLink(executionJob.job_id) + '</td>' +\n '<td>' + jobTypeCell + '</td>' +\n '<td><span class=\"badge bg-light text-dark\">' + escapeHtml(textOrDash(executionJob.state)) + '</span></td>' +\n '<td class=\"plugin-job-progress\"><div class=\"progress\" style=\"height: 14px;\"><div class=\"progress-bar ' + barClass + '\" role=\"progressbar\" style=\"width:' + progress + '%\">' + Math.round(progress) + '%</div></div></td>' +\n '<td><small>' + escapeHtml(textOrDash(executionJob.worker_id)) + '</small></td>' +\n '<td><small>' + escapeHtml(parseTime(executionJob.updated_at) || '-') + '</small></td>' +\n '<td><small>' + escapeHtml(textOrDash(executionJob.message)) + '</small></td>' +\n '</tr>';\n }\n\n tbody.innerHTML = rows;\n }\n\n function renderQueueJobs() {\n var tbody = document.getElementById('plugin-queue-jobs-table-body');\n if (!tbody) {\n return;\n }\n\n var filteredJobs = [];\n var jobs = Array.isArray(state.jobs) ? state.jobs : [];\n for (var i = 0; i < jobs.length; i++) {\n var queueJob = jobs[i] || {};\n var queueJobType = String(queueJob.job_type || '').trim();\n if (state.selectedJobType && queueJobType !== state.selectedJobType) {\n continue;\n }\n var normalizedState = normalizeJobStateForFilter(queueJob.state);\n if (normalizedState !== 'pending' && normalizedState !== 'assigned' && normalizedState !== 'running' && normalizedState !== 'in_progress') {\n continue;\n }\n filteredJobs.push(queueJob);\n }\n\n if (!filteredJobs.length) {\n tbody.innerHTML = '<tr><td colspan=\"7\" class=\"text-muted text-center py-3\">No queued/active jobs</td></tr>';\n return;\n }\n\n var rows = '';\n for (var j = 0; j < filteredJobs.length; j++) {\n var queueItem = filteredJobs[j] || {};\n var progress = Number(queueItem.progress || 0);\n if (!Number.isFinite(progress) || progress < 0) {\n progress = 0;\n }\n if (progress > 100) {\n progress = 100;\n }\n\n var barClass = 'bg-warning';\n var queueStateText = String(queueItem.state || 'unknown').toLowerCase();\n if (queueStateText.indexOf('run') >= 0 || queueStateText.indexOf('progress') >= 0) {\n barClass = 'bg-info';\n }\n\n rows += '<tr>' +\n '<td>' + renderJobLink(queueItem.job_id) + '</td>' +\n '<td>' + escapeHtml(textOrDash(queueItem.job_type)) + '</td>' +\n '<td><span class=\"badge bg-light text-dark\">' + escapeHtml(textOrDash(queueItem.state)) + '</span></td>' +\n '<td class=\"plugin-job-progress\"><div class=\"progress\" style=\"height: 14px;\"><div class=\"progress-bar ' + barClass + '\" role=\"progressbar\" style=\"width:' + progress + '%\">' + Math.round(progress) + '%</div></div></td>' +\n '<td><small>' + escapeHtml(textOrDash(queueItem.worker_id)) + '</small></td>' +\n '<td><small>' + escapeHtml(parseTime(queueItem.updated_at) || '-') + '</small></td>' +\n '<td><small>' + escapeHtml(textOrDash(queueItem.message)) + '</small></td>' +\n '</tr>';\n }\n\n tbody.innerHTML = rows;\n }\n\n function renderDetectionJobs() {\n var tbody = document.getElementById('plugin-detection-table-body');\n if (!tbody) {\n return;\n }\n\n var filteredActivities = [];\n var activities = Array.isArray(state.activities) ? state.activities : [];\n for (var i = 0; i < activities.length; i++) {\n var activity = activities[i] || {};\n var jobType = String(activity.job_type || '').trim();\n if (state.selectedJobType && jobType !== state.selectedJobType) {\n continue;\n }\n if (!isDetectionActivitySource(activity.source)) {\n continue;\n }\n filteredActivities.push(activity);\n }\n\n if (!filteredActivities.length) {\n tbody.innerHTML = '<tr><td colspan=\"7\" class=\"text-muted text-center py-3\">No detection jobs tracked yet</td></tr>';\n return;\n }\n\n var rows = '';\n for (var j = 0; j < filteredActivities.length; j++) {\n var detectionActivity = filteredActivities[j] || {};\n rows += '<tr>' +\n '<td><small>' + escapeHtml(parseTime(detectionActivity.occurred_at) || '-') + '</small></td>' +\n '<td>' + escapeHtml(textOrDash(detectionActivity.job_type)) + '</td>' +\n '<td><small>' + escapeHtml(textOrDash(detectionActivity.request_id)) + '</small></td>' +\n '<td><small>' + escapeHtml(textOrDash(detectionActivity.worker_id)) + '</small></td>' +\n '<td>' + escapeHtml(textOrDash(detectionActivity.stage)) + '</td>' +\n '<td><span class=\"badge bg-light text-dark\">' + escapeHtml(textOrDash(detectionActivity.source)) + '</span></td>' +\n '<td><small>' + escapeHtml(textOrDash(detectionActivity.message)) + '</small></td>' +\n '</tr>';\n }\n\n tbody.innerHTML = rows;\n }\n\n function renderExecutionActivities() {\n var tbody = document.getElementById('plugin-execution-activities-table-body');\n if (!tbody) {\n return;\n }\n\n var filteredActivities = [];\n var activities = Array.isArray(state.activities) ? state.activities : [];\n for (var i = 0; i < activities.length; i++) {\n var activity = activities[i] || {};\n if (isDetectionActivitySource(activity.source)) {\n continue;\n }\n var jobType = String(activity.job_type || '').trim();\n if (state.selectedJobType && jobType !== state.selectedJobType) {\n continue;\n }\n filteredActivities.push(activity);\n }\n\n if (!filteredActivities.length) {\n tbody.innerHTML = '<tr><td colspan=\"6\" class=\"text-muted text-center py-3\">No execution activities yet</td></tr>';\n return;\n }\n\n var rows = '';\n for (var j = 0; j < filteredActivities.length; j++) {\n var executionActivity = filteredActivities[j] || {};\n rows += '<tr>' +\n '<td><small>' + escapeHtml(parseTime(executionActivity.occurred_at) || '-') + '</small></td>' +\n '<td>' + escapeHtml(textOrDash(executionActivity.job_type)) + '</td>' +\n '<td>' + renderJobLink(executionActivity.job_id) + '</td>' +\n '<td><span class=\"badge bg-light text-dark\">' + escapeHtml(textOrDash(executionActivity.source)) + '</span></td>' +\n '<td>' + escapeHtml(textOrDash(executionActivity.stage)) + '</td>' +\n '<td><small>' + escapeHtml(textOrDash(executionActivity.message)) + '</small></td>' +\n '</tr>';\n }\n\n tbody.innerHTML = rows;\n }\n\n function getSelectValueArray(selectEl) {\n if (!selectEl) {\n return [];\n }\n var values = [];\n for (var i = 0; i < selectEl.options.length; i++) {\n if (selectEl.options[i].selected) {\n values.push(selectEl.options[i].value);\n }\n }\n return values;\n }\n\n function configValueToNative(configValue) {\n if (!configValue || typeof configValue !== 'object') {\n return null;\n }\n if (Object.prototype.hasOwnProperty.call(configValue, 'bool_value')) {\n return !!configValue.bool_value;\n }\n if (Object.prototype.hasOwnProperty.call(configValue, 'int64_value')) {\n return configValue.int64_value;\n }\n if (Object.prototype.hasOwnProperty.call(configValue, 'double_value')) {\n return configValue.double_value;\n }\n if (Object.prototype.hasOwnProperty.call(configValue, 'string_value')) {\n return configValue.string_value;\n }\n if (Object.prototype.hasOwnProperty.call(configValue, 'bytes_value')) {\n return configValue.bytes_value;\n }\n if (Object.prototype.hasOwnProperty.call(configValue, 'duration_value')) {\n return configValue.duration_value;\n }\n if (configValue.string_list && Array.isArray(configValue.string_list.values)) {\n return configValue.string_list.values.slice();\n }\n if (configValue.int64_list && Array.isArray(configValue.int64_list.values)) {\n return configValue.int64_list.values.slice();\n }\n if (configValue.double_list && Array.isArray(configValue.double_list.values)) {\n return configValue.double_list.values.slice();\n }\n if (configValue.bool_list && Array.isArray(configValue.bool_list.values)) {\n return configValue.bool_list.values.slice();\n }\n if (configValue.list_value && Array.isArray(configValue.list_value.values)) {\n return configValue.list_value.values.map(function(v) {\n return configValueToNative(v);\n });\n }\n if (configValue.map_value && configValue.map_value.fields) {\n var out = {};\n Object.keys(configValue.map_value.fields).forEach(function(k) {\n out[k] = configValueToNative(configValue.map_value.fields[k]);\n });\n return out;\n }\n return null;\n }\n\n function inferConfigValue(value) {\n if (value === null || value === undefined) {\n return { string_value: '' };\n }\n if (typeof value === 'boolean') {\n return { bool_value: value };\n }\n if (typeof value === 'number') {\n if (Number.isInteger(value)) {\n return { int64_value: String(value) };\n }\n return { double_value: value };\n }\n if (typeof value === 'string') {\n return { string_value: value };\n }\n if (Array.isArray(value)) {\n var listValues = value.map(function(item) {\n return inferConfigValue(item);\n });\n return { list_value: { values: listValues } };\n }\n if (typeof value === 'object') {\n var fields = {};\n Object.keys(value).forEach(function(key) {\n fields[key] = inferConfigValue(value[key]);\n });\n return { map_value: { fields: fields } };\n }\n return { string_value: String(value) };\n }\n\n function nativeToConfigValue(value, fieldType, widget, field) {\n var normalizedFieldType = normalizeEnum(fieldType);\n var normalizedWidget = normalizeEnum(widget);\n\n if (normalizedFieldType === 'CONFIG_FIELD_TYPE_BOOL') {\n return { bool_value: !!value };\n }\n\n if (normalizedFieldType === 'CONFIG_FIELD_TYPE_INT64') {\n if (value === '' || value === null || value === undefined) {\n return null;\n }\n var intValue = parseInt(value, 10);\n if (Number.isNaN(intValue)) {\n throw new Error('Invalid int64 value for field ' + field.name);\n }\n return { int64_value: String(intValue) };\n }\n\n if (normalizedFieldType === 'CONFIG_FIELD_TYPE_DOUBLE') {\n if (value === '' || value === null || value === undefined) {\n return null;\n }\n var doubleValue = parseFloat(value);\n if (Number.isNaN(doubleValue)) {\n throw new Error('Invalid number for field ' + field.name);\n }\n return { double_value: doubleValue };\n }\n\n if (normalizedFieldType === 'CONFIG_FIELD_TYPE_DURATION') {\n if (value === '' || value === null || value === undefined) {\n return null;\n }\n var text = String(value).trim();\n if (!text) {\n return null;\n }\n if (/^\\d+$/.test(text)) {\n text += 's';\n }\n return { duration_value: text };\n }\n\n if (normalizedFieldType === 'CONFIG_FIELD_TYPE_LIST') {\n if (value === '' || value === null || value === undefined) {\n return null;\n }\n\n if (normalizedWidget === 'CONFIG_WIDGET_MULTI_SELECT' && Array.isArray(value)) {\n return { string_list: { values: value } };\n }\n\n if (typeof value === 'string') {\n try {\n var parsed = JSON.parse(value);\n if (!Array.isArray(parsed)) {\n throw new Error('Expected JSON array');\n }\n return inferConfigValue(parsed);\n } catch (e) {\n throw new Error('Invalid JSON list for field ' + field.name + ': ' + e.message);\n }\n }\n return inferConfigValue(value);\n }\n\n if (normalizedFieldType === 'CONFIG_FIELD_TYPE_OBJECT') {\n if (value === '' || value === null || value === undefined) {\n return null;\n }\n if (typeof value === 'string') {\n try {\n var parsedObject = JSON.parse(value);\n if (!parsedObject || typeof parsedObject !== 'object' || Array.isArray(parsedObject)) {\n throw new Error('Expected JSON object');\n }\n return inferConfigValue(parsedObject);\n } catch (e) {\n throw new Error('Invalid JSON object for field ' + field.name + ': ' + e.message);\n }\n }\n return inferConfigValue(value);\n }\n\n if (normalizedFieldType === 'CONFIG_FIELD_TYPE_ENUM') {\n if (normalizedWidget === 'CONFIG_WIDGET_MULTI_SELECT') {\n if (!value || !value.length) {\n return null;\n }\n return { string_list: { values: value } };\n }\n if (value === '' || value === null || value === undefined) {\n return null;\n }\n return { string_value: String(value) };\n }\n\n if (value === '' || value === null || value === undefined) {\n return null;\n }\n\n return { string_value: String(value) };\n }\n\n function toInputID(scope, fieldName) {\n return 'plugin-' + scope + '-field-' + String(fieldName || '').replace(/[^a-zA-Z0-9_-]/g, '_');\n }\n\n function resolveFieldConfigValue(scope, field) {\n if (!field || !field.name) {\n return null;\n }\n var fromConfig = null;\n if (state.config) {\n if (scope === 'admin' && state.config.admin_config_values) {\n fromConfig = state.config.admin_config_values[field.name];\n }\n if (scope === 'worker' && state.config.worker_config_values) {\n fromConfig = state.config.worker_config_values[field.name];\n }\n }\n if (fromConfig) {\n return fromConfig;\n }\n\n var formDefaults = null;\n if (scope === 'admin' && state.descriptor && state.descriptor.admin_config_form && state.descriptor.admin_config_form.default_values) {\n formDefaults = state.descriptor.admin_config_form.default_values[field.name];\n }\n if (scope === 'worker' && state.descriptor && state.descriptor.worker_config_form && state.descriptor.worker_config_form.default_values) {\n formDefaults = state.descriptor.worker_config_form.default_values[field.name];\n }\n if (formDefaults) {\n return formDefaults;\n }\n\n if (scope === 'worker' && state.descriptor && state.descriptor.worker_default_values) {\n return state.descriptor.worker_default_values[field.name] || null;\n }\n\n return null;\n }\n\n function renderFieldInput(scope, field, value) {\n var inputID = toInputID(scope, field.name);\n var normalizedType = normalizeEnum(field.field_type);\n var normalizedWidget = normalizeEnum(field.widget);\n var input;\n\n if (normalizedType === 'CONFIG_FIELD_TYPE_BOOL' || normalizedWidget === 'CONFIG_WIDGET_TOGGLE') {\n input = document.createElement('input');\n input.type = 'checkbox';\n input.className = 'form-check-input';\n input.id = inputID;\n input.checked = !!value;\n } else if ((normalizedType === 'CONFIG_FIELD_TYPE_ENUM' && normalizedWidget === 'CONFIG_WIDGET_MULTI_SELECT') || normalizedWidget === 'CONFIG_WIDGET_MULTI_SELECT') {\n input = document.createElement('select');\n input.className = 'form-select';\n input.id = inputID;\n input.multiple = true;\n var selected = Array.isArray(value) ? value : [];\n var options = Array.isArray(field.options) ? field.options : [];\n for (var i = 0; i < options.length; i++) {\n var option = document.createElement('option');\n option.value = options[i].value || '';\n option.textContent = options[i].label || options[i].value || '';\n if (selected.indexOf(option.value) >= 0) {\n option.selected = true;\n }\n input.appendChild(option);\n }\n } else if (normalizedType === 'CONFIG_FIELD_TYPE_ENUM' || normalizedWidget === 'CONFIG_WIDGET_SELECT') {\n input = document.createElement('select');\n input.className = 'form-select';\n input.id = inputID;\n var blankOption = document.createElement('option');\n blankOption.value = '';\n blankOption.textContent = '-- select --';\n input.appendChild(blankOption);\n var enumOptions = Array.isArray(field.options) ? field.options : [];\n for (var j = 0; j < enumOptions.length; j++) {\n var enumOption = document.createElement('option');\n enumOption.value = enumOptions[j].value || '';\n enumOption.textContent = enumOptions[j].label || enumOptions[j].value || '';\n if (String(value) === enumOption.value) {\n enumOption.selected = true;\n }\n input.appendChild(enumOption);\n }\n } else if (normalizedType === 'CONFIG_FIELD_TYPE_INT64' || normalizedType === 'CONFIG_FIELD_TYPE_DOUBLE' || normalizedWidget === 'CONFIG_WIDGET_NUMBER') {\n input = document.createElement('input');\n input.type = 'number';\n if (normalizedType === 'CONFIG_FIELD_TYPE_DOUBLE') {\n input.step = 'any';\n }\n input.className = 'form-control';\n input.id = inputID;\n if (value !== null && value !== undefined && value !== '') {\n input.value = String(value);\n }\n } else if (normalizedType === 'CONFIG_FIELD_TYPE_LIST' || normalizedType === 'CONFIG_FIELD_TYPE_OBJECT' || normalizedWidget === 'CONFIG_WIDGET_TEXTAREA') {\n input = document.createElement('textarea');\n input.className = 'form-control';\n input.id = inputID;\n input.rows = 4;\n if (normalizedType === 'CONFIG_FIELD_TYPE_LIST' || normalizedType === 'CONFIG_FIELD_TYPE_OBJECT') {\n input.placeholder = normalizedType === 'CONFIG_FIELD_TYPE_LIST' ? '[...]' : '{...}';\n }\n if (value !== null && value !== undefined && value !== '') {\n if (typeof value === 'object') {\n input.value = JSON.stringify(value, null, 2);\n } else {\n input.value = String(value);\n }\n }\n } else {\n input = document.createElement('input');\n input.className = 'form-control';\n input.id = inputID;\n if (normalizedWidget === 'CONFIG_WIDGET_PASSWORD' || field.sensitive) {\n input.type = 'password';\n } else {\n input.type = 'text';\n }\n if (value !== null && value !== undefined && value !== '') {\n input.value = String(value);\n }\n }\n\n if (field.placeholder && input.tagName === 'INPUT') {\n input.placeholder = field.placeholder;\n }\n if (field.placeholder && input.tagName === 'TEXTAREA') {\n input.placeholder = field.placeholder;\n }\n\n if (field.required) {\n input.required = true;\n }\n if (field.read_only) {\n input.disabled = true;\n }\n\n return input;\n }\n\n function shardTransferParallelOn(nativeValue) {\n if (nativeValue === null || nativeValue === undefined || nativeValue === '') {\n return true;\n }\n var n = parseInt(nativeValue, 10);\n if (Number.isNaN(n)) {\n return true;\n }\n return n !== 0;\n }\n\n function shardTransferMaxText(nativeValue) {\n if (nativeValue === null || nativeValue === undefined || nativeValue === '') {\n return '';\n }\n var n = parseInt(nativeValue, 10);\n if (Number.isNaN(n) || n <= 0) {\n return '';\n }\n return String(n);\n }\n\n // Presentation of the single persisted max_shard_transfers value.\n // Unchecked stores 0. Checked with an empty max omits the key.\n function renderShardTransferControls(scope, field, nativeValue) {\n var parallelOn = shardTransferParallelOn(nativeValue);\n var wrapper = document.createElement('div');\n wrapper.className = 'mb-3 plugin-field';\n wrapper.dataset.scope = scope;\n wrapper.dataset.fieldName = field.name;\n wrapper.dataset.fieldType = normalizeEnum(field.field_type);\n wrapper.dataset.widget = 'SHARD_TRANSFERS';\n\n var checkWrap = document.createElement('div');\n checkWrap.className = 'form-check form-switch mb-2';\n var box = document.createElement('input');\n box.type = 'checkbox';\n box.className = 'form-check-input';\n box.id = toInputID(scope, field.name) + '-parallel';\n box.checked = parallelOn;\n var boxLabel = document.createElement('label');\n boxLabel.className = 'form-check-label';\n boxLabel.setAttribute('for', box.id);\n boxLabel.textContent = 'Parallel shard distribution';\n checkWrap.appendChild(box);\n checkWrap.appendChild(boxLabel);\n wrapper.appendChild(checkWrap);\n\n var numberLabel = document.createElement('label');\n numberLabel.className = 'form-label';\n numberLabel.setAttribute('for', toInputID(scope, field.name));\n numberLabel.textContent = 'Max transfers';\n wrapper.appendChild(numberLabel);\n\n var input = document.createElement('input');\n input.type = 'number';\n input.min = '1';\n input.step = '1';\n input.className = 'form-control';\n input.id = toInputID(scope, field.name);\n input.placeholder = 'no global cap';\n input.value = shardTransferMaxText(nativeValue);\n input.disabled = !parallelOn;\n wrapper.appendChild(input);\n\n box.addEventListener('change', function() {\n input.disabled = !box.checked;\n });\n\n var help = document.createElement('div');\n help.className = 'form-text';\n help.textContent = field.description || 'Unchecked sends shards sequentially. Checked with an empty max uses one in-flight copy per destination disk. A number is a global cap, still one copy per disk.';\n wrapper.appendChild(help);\n return wrapper;\n }\n\n function collectShardTransferValue(scope) {\n var box = document.getElementById(toInputID(scope, 'max_shard_transfers') + '-parallel');\n var input = document.getElementById(toInputID(scope, 'max_shard_transfers'));\n if (!box || !input) {\n return null;\n }\n if (!box.checked) {\n return { int64_value: '0' };\n }\n var raw = String(input.value || '').trim();\n if (raw === '') {\n return null;\n }\n if (!/^\\d+$/.test(raw)) {\n throw new Error('Invalid int64 value for field Max transfers');\n }\n var n = parseInt(raw, 10);\n if (n <= 0) {\n return { int64_value: '0' };\n }\n return { int64_value: String(n) };\n }\n\n function renderConfigForm(scope, rootID, form) {\n var root = document.getElementById(rootID);\n if (!root) {\n return;\n }\n\n root.innerHTML = '';\n if (!form || !Array.isArray(form.sections) || form.sections.length === 0) {\n root.innerHTML = '<div class=\"text-muted\">No fields provided by descriptor.</div>';\n return;\n }\n\n for (var s = 0; s < form.sections.length; s++) {\n var section = form.sections[s] || {};\n var sectionCard = document.createElement('div');\n sectionCard.className = 'card mb-3';\n\n var sectionHeader = document.createElement('div');\n sectionHeader.className = 'card-header py-2';\n sectionHeader.innerHTML = '<strong>' + escapeHtml(textOrDash(section.title || section.section_id)) + '</strong>';\n sectionCard.appendChild(sectionHeader);\n\n var sectionBody = document.createElement('div');\n sectionBody.className = 'card-body';\n\n if (section.description) {\n var sectionDescription = document.createElement('p');\n sectionDescription.className = 'text-muted small';\n sectionDescription.textContent = section.description;\n sectionBody.appendChild(sectionDescription);\n }\n\n var fields = Array.isArray(section.fields) ? section.fields : [];\n if (!fields.length) {\n var noFields = document.createElement('div');\n noFields.className = 'text-muted';\n noFields.textContent = 'No fields in this section.';\n sectionBody.appendChild(noFields);\n }\n\n for (var f = 0; f < fields.length; f++) {\n var field = fields[f] || {};\n if (!field.name) {\n continue;\n }\n\n var configValue = resolveFieldConfigValue(scope, field);\n var nativeValue = configValueToNative(configValue);\n\n if (field.name === 'max_shard_transfers') {\n sectionBody.appendChild(renderShardTransferControls(scope, field, nativeValue));\n continue;\n }\n\n var wrapper = document.createElement('div');\n wrapper.className = 'mb-3 plugin-field';\n wrapper.dataset.scope = scope;\n wrapper.dataset.fieldName = field.name;\n wrapper.dataset.fieldType = normalizeEnum(field.field_type);\n wrapper.dataset.widget = normalizeEnum(field.widget);\n wrapper.dataset.visibleWhenField = field.visible_when_field || '';\n wrapper.dataset.visibleWhenEquals = JSON.stringify(field.visible_when_equals || null);\n\n var label = document.createElement('label');\n label.className = 'form-label';\n label.setAttribute('for', toInputID(scope, field.name));\n label.innerHTML = escapeHtml(field.label || field.name) + (field.required ? ' <span class=\"text-danger\">*</span>' : '');\n wrapper.appendChild(label);\n\n var input = renderFieldInput(scope, field, nativeValue);\n wrapper.appendChild(input);\n\n if (field.description || field.help_text) {\n var help = document.createElement('div');\n help.className = 'form-text';\n help.textContent = field.help_text || field.description || '';\n wrapper.appendChild(help);\n }\n\n sectionBody.appendChild(wrapper);\n }\n\n sectionCard.appendChild(sectionBody);\n root.appendChild(sectionCard);\n }\n\n root.addEventListener('change', function() {\n applyVisibility(scope);\n });\n root.addEventListener('input', function() {\n applyVisibility(scope);\n });\n\n applyVisibility(scope);\n }\n\n function readRawFieldValue(scope, fieldName) {\n var input = document.getElementById(toInputID(scope, fieldName));\n if (!input) {\n return null;\n }\n if (input.tagName === 'SELECT' && input.multiple) {\n return getSelectValueArray(input);\n }\n if (input.type === 'checkbox') {\n return !!input.checked;\n }\n return input.value;\n }\n\n function compareVisibleValue(currentValue, expectedValueObject) {\n if (!expectedValueObject) {\n return true;\n }\n var expectedNative = configValueToNative(expectedValueObject);\n if (Array.isArray(expectedNative)) {\n if (!Array.isArray(currentValue)) {\n return false;\n }\n if (expectedNative.length !== currentValue.length) {\n return false;\n }\n for (var i = 0; i < expectedNative.length; i++) {\n if (String(expectedNative[i]) !== String(currentValue[i])) {\n return false;\n }\n }\n return true;\n }\n return String(currentValue) === String(expectedNative);\n }\n\n function applyVisibility(scope) {\n var fields = document.querySelectorAll('.plugin-field[data-scope=\"' + scope + '\"]');\n for (var i = 0; i < fields.length; i++) {\n var wrapper = fields[i];\n var dependsOn = wrapper.dataset.visibleWhenField;\n if (!dependsOn) {\n wrapper.classList.remove('plugin-field-hidden');\n continue;\n }\n\n var expectedRaw = null;\n try {\n expectedRaw = JSON.parse(wrapper.dataset.visibleWhenEquals || 'null');\n } catch (e) {\n expectedRaw = null;\n }\n var current = readRawFieldValue(scope, dependsOn);\n var visible = compareVisibleValue(current, expectedRaw);\n if (visible) {\n wrapper.classList.remove('plugin-field-hidden');\n } else {\n wrapper.classList.add('plugin-field-hidden');\n }\n }\n }\n\n function collectConfigValues(scope, form) {\n var out = {};\n if (!form || !Array.isArray(form.sections)) {\n return out;\n }\n\n for (var s = 0; s < form.sections.length; s++) {\n var section = form.sections[s] || {};\n var fields = Array.isArray(section.fields) ? section.fields : [];\n for (var f = 0; f < fields.length; f++) {\n var field = fields[f] || {};\n if (!field.name) {\n continue;\n }\n\n if (field.name === 'max_shard_transfers') {\n var shardCap = collectShardTransferValue(scope);\n if (shardCap !== null) {\n out[field.name] = shardCap;\n }\n continue;\n }\n\n var wrapper = document.querySelector('.plugin-field[data-scope=\"' + scope + '\"][data-field-name=\"' + field.name + '\"]');\n if (wrapper && wrapper.classList.contains('plugin-field-hidden')) {\n continue;\n }\n\n var input = document.getElementById(toInputID(scope, field.name));\n if (!input) {\n continue;\n }\n\n var rawValue;\n if (input.tagName === 'SELECT' && input.multiple) {\n rawValue = getSelectValueArray(input);\n } else if (input.type === 'checkbox') {\n rawValue = !!input.checked;\n } else {\n rawValue = input.value;\n }\n\n if (field.required) {\n var missing = false;\n if (input.type === 'checkbox') {\n missing = false;\n } else if (Array.isArray(rawValue)) {\n missing = rawValue.length === 0;\n } else {\n missing = String(rawValue || '').trim() === '';\n }\n if (missing) {\n throw new Error('Missing required field: ' + (field.label || field.name));\n }\n }\n\n var converted = nativeToConfigValue(rawValue, field.field_type, field.widget, field);\n if (converted !== null) {\n out[field.name] = converted;\n }\n }\n }\n\n return out;\n }\n\n function renderDescriptorSummary() {\n var summary = document.getElementById('plugin-descriptor-summary');\n if (!state.descriptor) {\n summary.innerHTML = 'No descriptor loaded.';\n return;\n }\n\n var descriptor = state.descriptor;\n var html = '';\n html += '<div><strong>' + escapeHtml(textOrDash(descriptor.display_name || descriptor.job_type)) + '</strong></div>';\n html += '<div><small>Job Type: ' + escapeHtml(textOrDash(descriptor.job_type)) + '</small></div>';\n html += '<div><small>Descriptor Version: ' + escapeHtml(textOrDash(descriptor.descriptor_version)) + '</small></div>';\n if (descriptor.description) {\n html += '<div class=\"mt-1\">' + escapeHtml(descriptor.description) + '</div>';\n }\n summary.innerHTML = html;\n }\n\n function fillAdminSettings() {\n var runtimeConfig = (state.config && state.config.admin_runtime) ? state.config.admin_runtime : {};\n var defaults = (state.descriptor && state.descriptor.admin_runtime_defaults) ? state.descriptor.admin_runtime_defaults : {};\n\n function pickNumber(key) {\n if (runtimeConfig && runtimeConfig[key] !== undefined && runtimeConfig[key] !== null) {\n return runtimeConfig[key];\n }\n if (defaults && defaults[key] !== undefined && defaults[key] !== null) {\n return defaults[key];\n }\n return 0;\n }\n\n function pickBool(key) {\n if (runtimeConfig && runtimeConfig[key] !== undefined && runtimeConfig[key] !== null) {\n return !!runtimeConfig[key];\n }\n if (defaults && defaults[key] !== undefined && defaults[key] !== null) {\n return !!defaults[key];\n }\n return true;\n }\n\n document.getElementById('plugin-admin-enabled').checked = pickBool('enabled');\n document.getElementById('plugin-admin-detection-interval').value = String(pickNumber('detection_interval_minutes'));\n document.getElementById('plugin-admin-detection-timeout').value = String(pickNumber('detection_timeout_seconds'));\n document.getElementById('plugin-admin-execution-timeout').value = String(pickNumber('execution_timeout_seconds'));\n document.getElementById('plugin-admin-max-runtime').value = String(pickNumber('job_type_max_runtime_seconds'));\n document.getElementById('plugin-admin-max-results').value = String(pickNumber('max_jobs_per_detection'));\n document.getElementById('plugin-admin-global-exec').value = String(pickNumber('global_execution_concurrency'));\n document.getElementById('plugin-admin-per-worker-exec').value = String(pickNumber('per_worker_execution_concurrency'));\n document.getElementById('plugin-admin-retry-limit').value = String(pickNumber('retry_limit'));\n document.getElementById('plugin-admin-retry-backoff').value = String(pickNumber('retry_backoff_seconds'));\n }\n\n function collectAdminSettings() {\n function getInt(id) {\n var raw = String(document.getElementById(id).value || '').trim();\n if (!raw) {\n return 0;\n }\n var parsed = parseInt(raw, 10);\n if (Number.isNaN(parsed) || parsed < 0) {\n throw new Error('Invalid number for ' + id);\n }\n return parsed;\n }\n\n return {\n enabled: !!document.getElementById('plugin-admin-enabled').checked,\n detection_interval_minutes: getInt('plugin-admin-detection-interval'),\n detection_timeout_seconds: getInt('plugin-admin-detection-timeout'),\n execution_timeout_seconds: getInt('plugin-admin-execution-timeout'),\n job_type_max_runtime_seconds: getInt('plugin-admin-max-runtime'),\n max_jobs_per_detection: getInt('plugin-admin-max-results'),\n global_execution_concurrency: getInt('plugin-admin-global-exec'),\n per_worker_execution_concurrency: getInt('plugin-admin-per-worker-exec'),\n retry_limit: getInt('plugin-admin-retry-limit'),\n retry_backoff_seconds: getInt('plugin-admin-retry-backoff'),\n };\n }\n\n function renderRunHistory(history) {\n var successBody = document.getElementById('plugin-runs-success-body');\n var errorBody = document.getElementById('plugin-runs-error-body');\n\n var successRuns = (history && Array.isArray(history.successful_runs)) ? history.successful_runs : [];\n var errorRuns = (history && Array.isArray(history.error_runs)) ? history.error_runs : [];\n\n if (!successRuns.length) {\n successBody.innerHTML = '<tr><td colspan=\"4\" class=\"text-muted\">No successful runs</td></tr>';\n } else {\n var successRows = '';\n for (var i = 0; i < successRuns.length; i++) {\n var run = successRuns[i] || {};\n successRows += '<tr>' +\n '<td><small>' + escapeHtml(parseTime(run.completed_at) || '-') + '</small></td>' +\n '<td>' + renderJobLink(run.job_id) + '</td>' +\n '<td><small>' + escapeHtml(textOrDash(run.worker_id)) + '</small></td>' +\n '<td><small>' + escapeHtml(formatDurationMs(run.duration_ms)) + '</small></td>' +\n '</tr>';\n }\n successBody.innerHTML = successRows;\n }\n\n if (!errorRuns.length) {\n errorBody.innerHTML = '<tr><td colspan=\"4\" class=\"text-muted\">No error runs</td></tr>';\n } else {\n var errorRows = '';\n for (var j = 0; j < errorRuns.length; j++) {\n var errorRun = errorRuns[j] || {};\n errorRows += '<tr>' +\n '<td><small>' + escapeHtml(parseTime(errorRun.completed_at) || '-') + '</small></td>' +\n '<td>' + renderJobLink(errorRun.job_id) + '</td>' +\n '<td><small>' + escapeHtml(textOrDash(errorRun.worker_id)) + '</small></td>' +\n '<td><small class=\"text-danger\">' + escapeHtml(textOrDash(errorRun.message)) + '</small></td>' +\n '</tr>';\n }\n errorBody.innerHTML = errorRows;\n }\n }\n\n function renderDetectionResult(data) {\n var root = document.getElementById('plugin-detection-results');\n if (!root) {\n return;\n }\n\n function normalizeProposals(payload) {\n if (!payload || typeof payload !== 'object') {\n return [];\n }\n if (Array.isArray(payload.proposals)) {\n return payload.proposals;\n }\n if (payload.proposals && typeof payload.proposals === 'object') {\n return Object.keys(payload.proposals).map(function(key) {\n return payload.proposals[key];\n }).filter(function(item) {\n return !!item;\n });\n }\n return [];\n }\n\n function proposalID(proposal) {\n return proposal.proposal_id || proposal.proposalId || proposal.id || '';\n }\n\n function proposalSummary(proposal) {\n return proposal.summary || proposal.title || proposalID(proposal) || 'Proposal';\n }\n\n function proposalDetail(proposal) {\n return proposal.detail || proposal.reason || proposal.message || '-';\n }\n\n function normalizeActivities(payload) {\n if (!payload || typeof payload !== 'object') {\n return [];\n }\n if (Array.isArray(payload.activities)) {\n return payload.activities;\n }\n return [];\n }\n\n function encodeDetails(details) {\n if (!details || typeof details !== 'object') {\n return '';\n }\n var text = '';\n try {\n text = JSON.stringify(details);\n } catch (e) {\n text = '';\n }\n if (!text) {\n return '';\n }\n if (text.length > 360) {\n text = text.slice(0, 360) + '...';\n }\n return text;\n }\n\n if (!data) {\n root.innerHTML = '<div class=\"text-muted\">No results.</div>';\n return;\n }\n\n var proposals = normalizeProposals(data);\n var activities = normalizeActivities(data);\n var responseCount = Number(data.count || 0);\n if (!Number.isFinite(responseCount) || responseCount < 0) {\n responseCount = proposals.length;\n }\n var requestID = data.request_id || data.requestId || '';\n var detectorWorkerID = data.detector_worker_id || data.detectorWorkerId || '';\n var totalProposals = Number(data.total_proposals || 0);\n if (!Number.isFinite(totalProposals) || totalProposals < 0) {\n totalProposals = responseCount;\n }\n\n var html = '';\n html += '<div class=\"mb-2\"><strong>Detection Run</strong></div>';\n var skippedActivity = null;\n for (var si = 0; si < activities.length; si++) {\n if (activities[si] && activities[si].stage === 'skipped_by_interval') skippedActivity = activities[si];\n }\n if (data.skipped_reason || skippedActivity) {\n var eligibleAfter = data.eligible_after;\n if (!eligibleAfter && skippedActivity && skippedActivity.details) {\n var detailAfter = skippedActivity.details.eligible_after;\n eligibleAfter = (detailAfter && detailAfter.string_value) || detailAfter;\n }\n html += '<div class=\"alert alert-info\">Skipped: ' + escapeHtml(String(data.skipped_reason || skippedActivity.message || 'detection skipped'));\n if (eligibleAfter) html += ' · Eligible after: ' + escapeHtml(parseTime(eligibleAfter) || eligibleAfter);\n html += '</div>';\n } else if (!data.error && proposals.length === 0) {\n html += '<div class=\"text-muted\">Scan completed: no eligible volumes or jobs.</div>';\n }\n if (requestID) {\n html += '<div><small>request_id: ' + escapeHtml(String(requestID)) + '</small></div>';\n }\n if (detectorWorkerID) {\n html += '<div><small>detector: ' + escapeHtml(String(detectorWorkerID)) + '</small></div>';\n }\n html += '<div><small>proposals: ' + escapeHtml(String(responseCount)) + ' / total: ' + escapeHtml(String(totalProposals)) + '</small></div>';\n if (data.error) {\n html += '<div class=\"mt-1 text-danger\"><small>' + escapeHtml(String(data.error)) + '</small></div>';\n }\n\n if (!proposals.length) {\n html += '<div class=\"mt-2 text-muted\">No proposals returned.</div>';\n } else {\n html += '<div class=\"mt-2 mb-1\"><strong>' + escapeHtml(String(proposals.length)) + '</strong> proposal(s)</div>';\n for (var i = 0; i < proposals.length; i++) {\n var proposal = proposals[i] || {};\n var pID = proposalID(proposal);\n var pSummary = proposalSummary(proposal);\n var pDetail = proposalDetail(proposal);\n var pPriority = proposal.priority;\n if (pPriority === null || pPriority === undefined || pPriority === '') {\n pPriority = '-';\n }\n html += '<div class=\"plugin-detection-item\">' +\n '<div class=\"fw-semibold\">' + escapeHtml(textOrDash(pSummary)) + '</div>' +\n '<div><small>proposal_id: ' + escapeHtml(textOrDash(pID)) + '</small></div>' +\n '<div><small>priority: ' + escapeHtml(textOrDash(pPriority)) + '</small></div>' +\n '<div><small>detail: ' + escapeHtml(textOrDash(pDetail)) + '</small></div>' +\n '</div>';\n }\n }\n\n if (activities.length) {\n html += '<hr class=\"my-2\"/>';\n html += '<div class=\"mb-2\"><strong>Detection Process</strong></div>';\n for (var j = 0; j < activities.length; j++) {\n var activity = activities[j] || {};\n var activityStage = activity.stage || '-';\n var activitySource = activity.source || '-';\n var activityMessage = activity.message || '-';\n var activityTime = parseTime(activity.occurred_at) || '-';\n var detailsText = encodeDetails(activity.details);\n html += '<div class=\"plugin-detection-item\">' +\n '<div class=\"fw-semibold\">' + escapeHtml(textOrDash(activityStage)) + '</div>' +\n '<div><small>source: ' + escapeHtml(textOrDash(activitySource)) + ' | at: ' + escapeHtml(activityTime) + '</small></div>' +\n '<div><small>' + escapeHtml(textOrDash(activityMessage)) + '</small></div>';\n if (detailsText) {\n html += '<div><small class=\"text-muted\">details: ' + escapeHtml(detailsText) + '</small></div>';\n }\n html += '</div>';\n }\n }\n\n root.innerHTML = html;\n }\n\n function getSelectedJobType() {\n return String(state.selectedJobType || '').trim();\n }\n\n function resetJobTypePanels() {\n state.loadedJobType = '';\n state.descriptor = null;\n state.config = null;\n document.getElementById('plugin-descriptor-summary').textContent = 'No descriptor loaded.';\n document.getElementById('plugin-admin-config-form').innerHTML = '<div class=\"text-muted\">No admin form loaded.</div>';\n document.getElementById('plugin-worker-config-form').innerHTML = '<div class=\"text-muted\">No worker form loaded.</div>';\n document.getElementById('plugin-config-updated-at').textContent = 'Not loaded';\n renderRunHistory(null);\n renderDetectionResult(null);\n }\n\n async function loadDescriptorAndConfig(jobType, forceRefresh) {\n if (!jobType) {\n return;\n }\n\n state.selectedJobType = jobType;\n renderNavigationState();\n\n var summary = document.getElementById('plugin-descriptor-summary');\n summary.textContent = 'Loading descriptor and config...';\n\n try {\n if (forceRefresh) {\n var refreshURL = '/api/plugin/job-types/' + encodePath(jobType) + '/schema?force_refresh=true';\n state.descriptor = await pluginRequest('POST', refreshURL, null);\n } else {\n try {\n state.descriptor = await pluginRequest('GET', '/api/plugin/job-types/' + encodePath(jobType) + '/descriptor');\n } catch (descriptorLoadError) {\n state.descriptor = await pluginRequest('POST', '/api/plugin/job-types/' + encodePath(jobType) + '/schema', null);\n }\n }\n } catch (schemaError) {\n state.loadedJobType = '';\n state.descriptor = null;\n summary.innerHTML = '<span class=\"text-danger\">Failed to load descriptor: ' + escapeHtml(schemaError.message) + '</span>';\n document.getElementById('plugin-admin-config-form').innerHTML = '<div class=\"text-muted\">No admin form loaded.</div>';\n document.getElementById('plugin-worker-config-form').innerHTML = '<div class=\"text-muted\">No worker form loaded.</div>';\n throw schemaError;\n }\n\n try {\n state.config = await pluginRequest('GET', '/api/plugin/job-types/' + encodePath(jobType) + '/config');\n } catch (configError) {\n state.config = null;\n notify('Failed to load config: ' + configError.message, 'error');\n }\n\n renderDescriptorSummary();\n fillAdminSettings();\n\n if (state.descriptor) {\n renderConfigForm('admin', 'plugin-admin-config-form', state.descriptor.admin_config_form || {});\n renderConfigForm('worker', 'plugin-worker-config-form', state.descriptor.worker_config_form || {});\n }\n\n if (state.config && state.config.updated_at) {\n document.getElementById('plugin-config-updated-at').textContent = 'Updated: ' + (parseTime(state.config.updated_at) || state.config.updated_at);\n } else {\n document.getElementById('plugin-config-updated-at').textContent = 'Not saved yet';\n }\n state.loadedJobType = jobType;\n renderSchedulerStatus();\n\n await loadRunHistory(jobType);\n\n if (state.lastDetectionByJobType && state.lastDetectionByJobType[jobType]) {\n renderDetectionResult(state.lastDetectionByJobType[jobType]);\n } else {\n renderDetectionResult(null);\n }\n }\n\n async function loadRunHistory(jobType) {\n if (!jobType) {\n renderRunHistory(null);\n return;\n }\n try {\n var history = await pluginRequest('GET', '/api/plugin/job-types/' + encodePath(jobType) + '/runs');\n renderRunHistory(history);\n } catch (e) {\n renderRunHistory(null);\n notify('Failed to load run history: ' + e.message, 'error');\n }\n }\n\n async function saveConfig() {\n var jobType = state.selectedJobType || getSelectedJobType();\n if (!jobType) {\n notify('Select a job type first.', 'error');\n return;\n }\n if (!state.descriptor) {\n notify('Load descriptor before saving config.', 'error');\n return;\n }\n\n var payload;\n try {\n payload = {\n job_type: jobType,\n descriptor_version: state.descriptor.descriptor_version || 0,\n admin_runtime: collectAdminSettings(),\n admin_config_values: collectConfigValues('admin', state.descriptor.admin_config_form || {}),\n worker_config_values: collectConfigValues('worker', state.descriptor.worker_config_form || {}),\n };\n } catch (err) {\n notify(err.message, 'error');\n return;\n }\n\n try {\n state.config = await pluginRequest('PUT', '/api/plugin/job-types/' + encodePath(jobType) + '/config', payload);\n document.getElementById('plugin-config-updated-at').textContent = 'Updated: ' + (parseTime(state.config.updated_at) || state.config.updated_at || 'just now');\n notify('Config saved for ' + jobType, 'success');\n } catch (e) {\n notify('Failed to save config: ' + e.message, 'error');\n }\n }\n\n function getMaxResults() {\n var raw = String(document.getElementById('plugin-admin-max-results').value || '').trim();\n if (!raw) {\n return 0;\n }\n var parsed = parseInt(raw, 10);\n if (Number.isNaN(parsed) || parsed < 0) {\n return 0;\n }\n return parsed;\n }\n\n async function runDetection() {\n var jobType = state.selectedJobType || getSelectedJobType();\n if (!jobType) {\n notify('Select a job type first.', 'error');\n return;\n }\n\n try {\n var data = await pluginRequest('POST', '/api/plugin/job-types/' + encodePath(jobType) + '/detect', {\n max_results: getMaxResults(),\n });\n state.lastDetectionByJobType[jobType] = data;\n renderDetectionResult(data);\n } catch (e) {\n if (e && e.responseData) {\n state.lastDetectionByJobType[jobType] = e.responseData;\n renderDetectionResult(e.responseData);\n }\n notify('Detection failed: ' + e.message, 'error');\n return;\n }\n\n try {\n await refreshJobsAndActivities();\n } catch (refreshErr) {\n notify('Detection succeeded, but monitoring refresh failed: ' + refreshErr.message, 'error');\n }\n }\n\n async function runWorkflow() {\n var jobType = state.selectedJobType || getSelectedJobType();\n if (!jobType) {\n notify('Select a job type first.', 'error');\n return;\n }\n\n try {\n var data = await pluginRequest('POST', '/api/plugin/job-types/' + encodePath(jobType) + '/run', {\n max_results: getMaxResults(),\n });\n var resultRoot = document.getElementById('plugin-detection-results');\n resultRoot.innerHTML = '<div class=\"mb-2\"><strong>Workflow completed</strong></div>' +\n '<div>Detected: <strong>' + escapeHtml(String(data.detected_count || 0)) + '</strong></div>' +\n '<div>Ready to Execute: <strong>' + escapeHtml(String(data.ready_to_execute_count || 0)) + '</strong></div>' +\n '<div>Skipped (Already Active): <strong>' + escapeHtml(String(data.skipped_active_count || 0)) + '</strong></div>' +\n '<div>Executed: <strong>' + escapeHtml(String(data.executed_count || 0)) + '</strong></div>' +\n '<div class=\"text-success\">Success: ' + escapeHtml(String(data.success_count || 0)) + '</div>' +\n '<div class=\"text-danger\">Errors: ' + escapeHtml(String(data.error_count || 0)) + '</div>';\n await loadRunHistory(jobType);\n } catch (e) {\n notify('Workflow run failed: ' + e.message, 'error');\n return;\n }\n try {\n await refreshJobsAndActivities();\n } catch (refreshErr) {\n notify('Workflow run succeeded, but monitoring refresh failed: ' + refreshErr.message, 'error');\n }\n }\n\n async function refreshJobsAndActivities() {\n var executionStateFilter = document.getElementById('plugin-monitor-job-state-filter');\n\n state.monitorExecutionJobState = executionStateFilter ? String(executionStateFilter.value || '').trim() : '';\n\n // The newest 500 rows cluster-wide may hold none of the selected job type on a busy\n // cluster, so the job-type sub-tabs fetch their own server-side filtered window.\n var scopedJobType = monitorJobTypeScope();\n var sameScope = state.monitorRowsScope === scopedJobType;\n\n // A failed request keeps its last rows; the rest still land and the failure is rethrown.\n var failure = null;\n function keepOnFailure(promise, previous) {\n return promise.catch(function(e) {\n failure = failure || e;\n return previous;\n });\n }\n\n var allJobsPromise = keepOnFailure(pluginRequest('GET', appendLaneParam('/api/plugin/jobs?limit=500')), state.allJobs);\n var allActivitiesPromise = keepOnFailure(pluginRequest('GET', appendLaneParam('/api/plugin/activities?limit=500')), state.allActivities);\n var jobsPromise = scopedJobType ? keepOnFailure(pluginRequest('GET', appendJobTypeParam(appendLaneParam('/api/plugin/jobs?limit=500'), scopedJobType)), sameScope ? state.jobs : null) : allJobsPromise;\n var activitiesPromise = scopedJobType ? keepOnFailure(pluginRequest('GET', appendJobTypeParam(appendLaneParam('/api/plugin/activities?limit=500'), scopedJobType)), sameScope ? state.activities : null) : allActivitiesPromise;\n var schedulerPromise = keepOnFailure(pluginRequest('GET', appendLaneParam('/api/plugin/scheduler-states')), state.schedulerStates);\n var schedulerStatusPromise = pluginRequest('GET', appendLaneParam('/api/plugin/scheduler-status'));\n\n var allJobs = await allJobsPromise;\n var allActivities = await allActivitiesPromise;\n var jobs = await jobsPromise;\n var activities = await activitiesPromise;\n var schedulerStates = await schedulerPromise;\n var schedulerStatus = null;\n try {\n schedulerStatus = await schedulerStatusPromise;\n } catch (e) {\n schedulerStatus = null;\n }\n if (monitorJobTypeScope() !== scopedJobType) {\n return;\n }\n\n state.allJobs = Array.isArray(allJobs) ? allJobs : [];\n state.allActivities = Array.isArray(allActivities) ? allActivities : [];\n state.jobs = Array.isArray(jobs) ? jobs : state.allJobs;\n state.activities = Array.isArray(activities) ? activities : state.allActivities;\n state.monitorRowsScope = scopedJobType;\n state.schedulerStates = Array.isArray(schedulerStates) ? schedulerStates : [];\n state.schedulerStatus = schedulerStatus && schedulerStatus.scheduler ? schedulerStatus.scheduler : null;\n state.schedulerLock = schedulerStatus && schedulerStatus.lock ? schedulerStatus.lock : null;\n renderQueueJobs();\n renderDetectionJobs();\n renderExecutionJobs();\n renderExecutionActivities();\n renderSchedulerStates();\n renderSchedulerStatus();\n renderStatus();\n renderJobTypeSummary();\n if (failure) {\n throw failure;\n }\n }\n\n async function refreshAll() {\n try {\n var previousSelectedJobType = state.selectedJobType;\n\n var workers = await pluginRequest('GET', appendLaneParam('/api/plugin/workers'));\n state.workers = Array.isArray(workers) ? workers : [];\n renderWorkers();\n\n var jobTypes = await pluginRequest('GET', appendLaneParam('/api/plugin/job-types'));\n state.jobTypes = Array.isArray(jobTypes) ? jobTypes : [];\n applyInitialNavigation();\n ensureActiveNavigation();\n renderTopTabs();\n renderNavigationState();\n\n if (!state.selectedJobType) {\n resetJobTypePanels();\n } else if (state.loadedJobType !== state.selectedJobType || previousSelectedJobType !== state.selectedJobType) {\n try {\n await loadDescriptorAndConfig(state.selectedJobType, false);\n } catch (loadError) {\n // Already rendered in UI.\n }\n }\n\n await refreshJobsAndActivities();\n state.refreshError = '';\n } catch (e) {\n // The 3s timer would otherwise reopen the same alert on every tick.\n if (e.message !== state.refreshError) {\n state.refreshError = e.message;\n notify('Refresh failed: ' + e.message, 'error');\n }\n }\n }\n\n function bindActions() {\n var monitorStateFilter = document.getElementById('plugin-monitor-job-state-filter');\n if (monitorStateFilter) {\n monitorStateFilter.addEventListener('change', function() {\n state.monitorExecutionJobState = String(monitorStateFilter.value || '').trim();\n renderExecutionJobs();\n });\n }\n\n var expireBtn = document.getElementById('plugin-expire-job-btn');\n if (expireBtn) {\n expireBtn.addEventListener('click', function() {\n var jobID = String(expireBtn.getAttribute('data-job-id') || '').trim();\n if (!jobID) {\n return;\n }\n expireJob(jobID);\n });\n }\n\n document.getElementById('plugin-refresh-all-btn').addEventListener('click', function() {\n refreshAll();\n });\n\n document.getElementById('plugin-refresh-schema-btn').addEventListener('click', async function() {\n var jobType = getSelectedJobType();\n if (!jobType) {\n notify('Select a job type first.', 'error');\n return;\n }\n try {\n await loadDescriptorAndConfig(jobType, true);\n notify('Schema refreshed for ' + jobType, 'success');\n } catch (e) {\n notify('Schema refresh failed: ' + e.message, 'error');\n }\n });\n\n document.getElementById('plugin-save-config-btn').addEventListener('click', function() {\n saveConfig();\n });\n\n document.getElementById('plugin-trigger-detection-btn').addEventListener('click', function() {\n runDetection();\n });\n\n document.getElementById('plugin-run-workflow-btn').addEventListener('click', function() {\n runWorkflow();\n });\n\n page.addEventListener('click', async function(event) {\n var target = event.target;\n if (!target) {\n return;\n }\n\n var topTab = target.closest('[data-plugin-top-tab]');\n if (topTab) {\n event.preventDefault();\n var topTabKey = String(topTab.getAttribute('data-plugin-top-tab') || '').trim();\n if (!topTabKey) {\n return;\n }\n if (topTabKey === 'overview') {\n state.activeTopTab = 'overview';\n renderNavigationState();\n updateURL(false);\n return;\n }\n\n var jobType = parseJobTypeFromTopTab(topTabKey);\n if (!jobType) {\n return;\n }\n state.activeTopTab = topTabKey;\n state.selectedJobType = jobType;\n ensureActiveNavigation();\n renderNavigationState();\n updateURL(false);\n if (state.loadedJobType !== jobType) {\n try {\n await loadDescriptorAndConfig(jobType, false);\n } catch (e) {\n // Already rendered in UI.\n }\n } else {\n if (state.lastDetectionByJobType && state.lastDetectionByJobType[jobType]) {\n renderDetectionResult(state.lastDetectionByJobType[jobType]);\n } else {\n renderDetectionResult(null);\n }\n await loadRunHistory(jobType);\n }\n try {\n await refreshJobsAndActivities();\n } catch (e) {\n notify('Refresh failed: ' + e.message, 'error');\n }\n return;\n }\n\n var subTab = target.closest('[data-plugin-subtab]');\n if (subTab) {\n event.preventDefault();\n var subTabKey = normalizeSubTab(subTab.getAttribute('data-plugin-subtab'));\n state.activeSubTab = subTabKey;\n renderNavigationState();\n updateURL(false);\n return;\n }\n\n var trigger = target.closest('.plugin-job-link');\n if (!trigger) {\n return;\n }\n event.preventDefault();\n var jobID = trigger.getAttribute('data-job-id');\n if (!jobID) {\n return;\n }\n openJobDetail(jobID);\n });\n }\n\n async function init() {\n bindActions();\n renderTopTabs();\n ensureActiveNavigation();\n renderNavigationState();\n await refreshAll();\n\n // Set the initial browser history state to match the current view\n updateURL(true);\n\n state.refreshTimer = setInterval(function() {\n refreshAll();\n }, 3000);\n }\n\n window.addEventListener('popstate', async function(event) {\n var s = event.state;\n if (!s || !s.pluginTopTab) {\n // No plugin state — treat as overview\n state.activeTopTab = 'overview';\n renderNavigationState();\n return;\n }\n state.activeTopTab = String(s.pluginTopTab || 'overview');\n state.activeSubTab = normalizeSubTab(s.pluginSubTab);\n var jobType = String(s.pluginJob || '').trim();\n if (jobType) {\n state.selectedJobType = jobType;\n }\n ensureActiveNavigation();\n renderNavigationState();\n // If a job type is selected and not loaded yet, load it\n if (state.selectedJobType && state.loadedJobType !== state.selectedJobType) {\n try {\n await loadDescriptorAndConfig(state.selectedJobType, false);\n } catch (e) {\n console.error('Failed to load data on popstate navigation:', e);\n }\n }\n try {\n await refreshJobsAndActivities();\n } catch (e) {\n console.error('Failed to refresh jobs on popstate navigation:', e);\n }\n });\n\n window.addEventListener('beforeunload', function() {\n if (state.refreshTimer) {\n clearInterval(state.refreshTimer);\n state.refreshTimer = null;\n }\n });\n\n init();\n })();\n </script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/weed/admin/view/app/policies.templ b/weed/admin/view/app/policies.templ
index 16273178e8..dfbd734b39 100644
--- a/weed/admin/view/app/policies.templ
+++ b/weed/admin/view/app/policies.templ
@@ -61,48 +61,12 @@ templ Policies(data dash.PoliciesData) {
</div>
</div>
</div>
-
- <div class="col-xl-4 col-md-6 mb-4">
- <div class="card border-left-info shadow h-100 py-2">
- <div class="card-body">
- <div class="row no-gutters align-items-center">
- <div class="col mr-2">
- <div class="text-xs font-weight-bold text-info text-uppercase mb-1">
- Last Updated
- </div>
- <div class="h5 mb-0 font-weight-bold text-gray-800">
- {data.LastUpdated.Format("15:04")}
- </div>
- </div>
- <div class="col-auto">
- <i class="bi bi-clock icon-2x text-gray-300"></i>
- </div>
- </div>
- </div>
- </div>
- </div>
</div>
<!-- Policies Table -->
<div class="row">
<div class="col-12">
<div class="card shadow mb-4">
- <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
- <h6 class="m-0 font-weight-bold text-primary">
- <i class="bi bi-shield me-2"></i>IAM Policies
- </h6>
- <div class="dropdown no-arrow">
- <a class="dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
- <i class="bi bi-three-dots-vertical icon-sm icon-fixed-width text-gray-400"></i>
- </a>
- <div class="dropdown-menu dropdown-menu-right shadow animated--fade-in">
- <div class="dropdown-header">Actions:</div>
- <a class="dropdown-item" href="#">
- <i class="bi bi-download me-2"></i>Export List
- </a>
- </div>
- </div>
- </div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover" width="100%" cellspacing="0">
@@ -170,6 +134,15 @@ templ Policies(data dash.PoliciesData) {
</div>
</div>
</div>
+
+ <div class="row">
+ <div class="col-12">
+ <small class="text-muted">
+ <i class="bi bi-clock me-1"></i>
+ Last updated: {data.LastUpdated.Format("2006-01-02 15:04:05")}
+ </small>
+ </div>
+ </div>
</div>
@PolicyDatalists()
diff --git a/weed/admin/view/app/policies_templ.go b/weed/admin/view/app/policies_templ.go
index ca42e1f8f5..ac53ac9151 100644
--- a/weed/admin/view/app/policies_templ.go
+++ b/weed/admin/view/app/policies_templ.go
@@ -57,140 +57,140 @@ func Policies(data dash.PoliciesData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</div></div><div class=\"col-auto\"><i class=\"bi bi-check-circle icon-2x text-gray-300\"></i></div></div></div></div></div><div class=\"col-xl-4 col-md-6 mb-4\"><div class=\"card border-left-info shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-info text-uppercase mb-1\">Last Updated</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var4 string
- templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("15:04"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 74, Col: 69}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</div></div><div class=\"col-auto\"><i class=\"bi bi-clock icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Policies Table --><div class=\"row\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3 d-flex flex-row align-items-center justify-content-between\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-shield me-2\"></i>IAM Policies</h6><div class=\"dropdown no-arrow\"><a class=\"dropdown-toggle\" href=\"#\" role=\"button\" data-bs-toggle=\"dropdown\"><i class=\"bi bi-three-dots-vertical icon-sm icon-fixed-width text-gray-400\"></i></a><div class=\"dropdown-menu dropdown-menu-right shadow animated--fade-in\"><div class=\"dropdown-header\">Actions:</div><a class=\"dropdown-item\" href=\"#\"><i class=\"bi bi-download me-2\"></i>Export List</a></div></div></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\"><thead><tr><th>Policy Name</th><th>Version</th><th>Statements</th><th>Created</th><th>Updated</th><th>Actions</th></tr></thead> <tbody>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</div></div><div class=\"col-auto\"><i class=\"bi bi-check-circle icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Policies Table --><div class=\"row\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\"><thead><tr><th>Policy Name</th><th>Version</th><th>Statements</th><th>Created</th><th>Updated</th><th>Actions</th></tr></thead> <tbody>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, policy := range data.Policies {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<tr><td><strong>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "<tr><td><strong>")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var4 string
+ templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(policy.Name)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 87, Col: 68}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "</strong></td><td><span class=\"badge bg-info\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
- templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(policy.Name)
+ templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(policy.Document.Version)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 123, Col: 68}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 90, Col: 100}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</strong></td><td><span class=\"badge bg-info\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</span></td><td><span class=\"badge bg-secondary\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
- templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(policy.Document.Version)
+ templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d statements", len(policy.Document.Statement)))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 126, Col: 100}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 93, Col: 142}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</span></td><td><span class=\"badge bg-secondary\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</span></td><td><small class=\"text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
- templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d statements", len(policy.Document.Statement)))
+ templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(policy.CreatedAt.Format("2006-01-02 15:04"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 129, Col: 142}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 96, Col: 118}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</span></td><td><small class=\"text-muted\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</small></td><td><small class=\"text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
- templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(policy.CreatedAt.Format("2006-01-02 15:04"))
+ templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(policy.UpdatedAt.Format("2006-01-02 15:04"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 132, Col: 118}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 99, Col: 118}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</small></td><td><small class=\"text-muted\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</small></td><td><div class=\"btn-group btn-group-sm\" role=\"group\"><button type=\"button\" class=\"btn btn-outline-info view-policy-btn\" title=\"View Policy\" data-policy-name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
- templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(policy.UpdatedAt.Format("2006-01-02 15:04"))
+ templ_7745c5c3_Var9, templ_7745c5c3_Err = templruntime.NewAttributeExpression(policy.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 135, Col: 118}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 103, Col: 168}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</small></td><td><div class=\"btn-group btn-group-sm\" role=\"group\"><button type=\"button\" class=\"btn btn-outline-info view-policy-btn\" title=\"View Policy\" data-policy-name=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "\"><i class=\"bi bi-eye\"></i></button> <button type=\"button\" class=\"btn btn-outline-primary edit-policy-btn\" title=\"Edit Policy\" data-policy-name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templruntime.NewAttributeExpression(policy.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 139, Col: 168}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 106, Col: 171}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "\"><i class=\"bi bi-eye\"></i></button> <button type=\"button\" class=\"btn btn-outline-primary edit-policy-btn\" title=\"Edit Policy\" data-policy-name=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "\"><i class=\"bi bi-pencil-square\"></i></button> <button type=\"button\" class=\"btn btn-outline-danger delete-policy-btn\" title=\"Delete Policy\" data-policy-name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templruntime.NewAttributeExpression(policy.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 142, Col: 171}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 109, Col: 174}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\"><i class=\"bi bi-pencil-square\"></i></button> <button type=\"button\" class=\"btn btn-outline-danger delete-policy-btn\" title=\"Delete Policy\" data-policy-name=\"")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var12 string
- templ_7745c5c3_Var12, templ_7745c5c3_Err = templruntime.NewAttributeExpression(policy.Name).Resolve(ctx)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 145, Col: 174}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\"><i class=\"bi bi-trash\"></i></button></div></td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\"><i class=\"bi bi-trash\"></i></button></div></td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if len(data.Policies) == 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<tr><td colspan=\"6\" class=\"text-center text-muted py-4\"><i class=\"bi bi-shield icon-3x mb-3 text-muted\"></i><div><h5>No IAM policies found</h5><p>Create your first policy to manage access permissions.</p><button type=\"button\" class=\"btn btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#createPolicyModal\"><i class=\"bi bi-plus me-1\"></i>Create Policy</button></div></td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<tr><td colspan=\"6\" class=\"text-center text-muted py-4\"><i class=\"bi bi-shield icon-3x mb-3 text-muted\"></i><div><h5>No IAM policies found</h5><p>Create your first policy to manage access permissions.</p><button type=\"button\" class=\"btn btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#createPolicyModal\"><i class=\"bi bi-plus me-1\"></i>Create Policy</button></div></td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "</tbody></table></div></div></div></div></div></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "</tbody></table></div></div></div></div></div><div class=\"row\"><div class=\"col-12\"><small class=\"text-muted\"><i class=\"bi bi-clock me-1\"></i> Last updated: ")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var12 string
+ templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/policies.templ`, Line: 142, Col: 81}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "</small></div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/weed/admin/view/app/s3_buckets.templ b/weed/admin/view/app/s3_buckets.templ
index fb9384f333..a8fc1b416d 100644
--- a/weed/admin/view/app/s3_buckets.templ
+++ b/weed/admin/view/app/s3_buckets.templ
@@ -18,6 +18,9 @@ templ S3Buckets(data dash.S3BucketsData) {
<option value="200" if data.PageSize == 200 { selected="selected" }>200 per page</option>
<option value="500" if data.PageSize == 500 { selected="selected" }>500 per page</option>
</select>
+ <button type="button" class="btn btn-sm btn-outline-primary me-2" onclick="exportBucketList()">
+ <i class="bi bi-download me-1"></i>Export
+ </button>
<button type="button" class="btn btn-sm btn-primary"
data-bs-toggle="modal"
data-bs-target="#createBucketModal">
@@ -70,48 +73,12 @@ templ S3Buckets(data dash.S3BucketsData) {
</div>
</div>
-
- <div class="col-xl-4 col-md-6 mb-4">
- <div class="card border-left-warning shadow h-100 py-2">
- <div class="card-body">
- <div class="row no-gutters align-items-center">
- <div class="col mr-2">
- <div class="text-xs font-weight-bold text-warning text-uppercase mb-1">
- Last Updated
- </div>
- <div class="h6 mb-0 font-weight-bold text-gray-800">
- {data.LastUpdated.Format("15:04:05")}
- </div>
- </div>
- <div class="col-auto">
- <i class="bi bi-clock icon-2x text-gray-300"></i>
- </div>
- </div>
- </div>
- </div>
- </div>
</div>
<!-- Buckets Table -->
<div class="row">
<div class="col-12">
<div class="card shadow mb-4">
- <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
- <h6 class="m-0 font-weight-bold text-primary">
- <i class="bi bi-box me-2"></i>Object Store Buckets
- </h6>
- <div class="dropdown no-arrow">
- <a class="dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
- <i class="bi bi-three-dots-vertical icon-sm icon-fixed-width text-gray-400"></i>
- </a>
- <div class="dropdown-menu dropdown-menu-right shadow animated--fade-in">
- <div class="dropdown-header">Actions:</div>
- <a class="dropdown-item" href="#" onclick="exportBucketList()">
- <i class="bi bi-download me-2"></i>Export List
- </a>
- </div>
- </div>
- </div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover" width="100%" cellspacing="0" id="bucketsTable">
@@ -160,7 +127,7 @@ templ S3Buckets(data dash.S3BucketsData) {
<tr>
<td>
<a href={dash.PUrl(ctx, fmt.Sprintf("/files?path=/buckets/%s", bucket.Name))}
- class="text-decoration-none">
+ class="text-decoration-none text-nowrap">
<i class="bi bi-box me-2"></i>
{bucket.Name}
</a>
@@ -176,10 +143,10 @@ templ S3Buckets(data dash.S3BucketsData) {
<i class="bi bi-person me-1"></i>{bucket.Owner}
</span>
} else {
- <span class="text-muted small">No owner</span>
+ @emptyValue("No owner")
}
</td>
- <td>{bucket.CreatedAt.Format("2006-01-02 15:04")}</td>
+ <td class="text-nowrap" title={bucket.CreatedAt.Format("2006-01-02 15:04")}>{bucket.CreatedAt.Format("2006-01-02")}</td>
<td>
<div>{formatBytes(bucket.LogicalSize)}</div>
if bucket.PhysicalSize > 0 && bucket.LogicalSize > 0 && bucket.PhysicalSize > bucket.LogicalSize {
@@ -204,7 +171,7 @@ templ S3Buckets(data dash.S3BucketsData) {
}
</div>
} else {
- <span class="text-muted">No quota</span>
+ @emptyValue("No quota")
}
</td>
<td>
@@ -217,7 +184,7 @@ templ S3Buckets(data dash.S3BucketsData) {
<i class="bi bi-pause me-1"></i>Suspended
</span>
} else {
- <span class="text-muted">Not configured</span>
+ @emptyValue("Not configured")
}
</td>
<td>
@@ -231,7 +198,7 @@ templ S3Buckets(data dash.S3BucketsData) {
</div>
</div>
} else {
- <span class="text-muted">Not configured</span>
+ @emptyValue("Not configured")
}
</td>
<td>
@@ -253,7 +220,7 @@ templ S3Buckets(data dash.S3BucketsData) {
}
</div>
} else {
- <span class="text-muted">Not configured</span>
+ @emptyValue("Not configured")
}
</td>
<td>
@@ -268,7 +235,7 @@ templ S3Buckets(data dash.S3BucketsData) {
}
</button>
} else {
- <span class="text-muted">Not configured</span>
+ @emptyValue("Not configured")
}
</td>
<td>
@@ -2234,8 +2201,7 @@ function commitOpenLifecycleRuleForm() {
}
const buckets = data.buckets || [];
- const csvContent = "data:text/csv;charset=utf-8," +
- "Name,Owner,Logical Size,Physical Size,Created,Quota,Versioning,Object Lock\n" +
+ const csvContent = "Name,Owner,Logical Size,Physical Size,Created,Quota,Versioning,Object Lock\n" +
buckets.map(b => [
escapeCsvField(b.name),
escapeCsvField(b.owner),
@@ -2247,13 +2213,7 @@ function commitOpenLifecycleRuleForm() {
escapeCsvField(b.object_lock_enabled ? 'Enabled' : 'Not configured')
].join(',')).join("\n");
- const encodedUri = encodeURI(csvContent);
- const link = document.createElement("a");
- link.setAttribute("href", encodedUri);
- link.setAttribute("download", "buckets.csv");
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
+ downloadCSV(csvContent, "buckets.csv");
})
.catch(error => {
console.error('Error:', error);
diff --git a/weed/admin/view/app/s3_buckets_templ.go b/weed/admin/view/app/s3_buckets_templ.go
index 49d6bc3f18..8f7abee7d6 100644
--- a/weed/admin/view/app/s3_buckets_templ.go
+++ b/weed/admin/view/app/s3_buckets_templ.go
@@ -71,14 +71,14 @@ func S3Buckets(data dash.S3BucketsData) templ.Component {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, ">500 per page</option></select> <button type=\"button\" class=\"btn btn-sm btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#createBucketModal\"><i class=\"bi bi-plus me-1\"></i>Create Bucket</button></div></div></div><div id=\"s3-buckets-content\"><!-- Summary Cards --><div class=\"row mb-4\"><div class=\"col-xl-4 col-md-6 mb-4\"><div class=\"card border-left-primary shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-primary text-uppercase mb-1\">Total Buckets</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, ">500 per page</option></select> <button type=\"button\" class=\"btn btn-sm btn-outline-primary me-2\" onclick=\"exportBucketList()\"><i class=\"bi bi-download me-1\"></i>Export</button> <button type=\"button\" class=\"btn btn-sm btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#createBucketModal\"><i class=\"bi bi-plus me-1\"></i>Create Bucket</button></div></div></div><div id=\"s3-buckets-content\"><!-- Summary Cards --><div class=\"row mb-4\"><div class=\"col-xl-4 col-md-6 mb-4\"><div class=\"card border-left-primary shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-primary text-uppercase mb-1\">Total Buckets</div><div class=\"h5 mb-0 font-weight-bold text-gray-800\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", data.TotalBuckets))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 42, Col: 73}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 45, Col: 73}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
@@ -91,26 +91,13 @@ func S3Buckets(data dash.S3BucketsData) templ.Component {
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(data.TotalSize))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 62, Col: 64}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 65, Col: 64}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</div></div><div class=\"col-auto\"><i class=\"bi bi-device-hdd icon-2x text-gray-300\"></i></div></div></div></div></div><div class=\"col-xl-4 col-md-6 mb-4\"><div class=\"card border-left-warning shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-warning text-uppercase mb-1\">Last Updated</div><div class=\"h6 mb-0 font-weight-bold text-gray-800\">")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var4 string
- templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("15:04:05"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 83, Col: 72}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "</div></div><div class=\"col-auto\"><i class=\"bi bi-clock icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Buckets Table --><div class=\"row\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3 d-flex flex-row align-items-center justify-content-between\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-box me-2\"></i>Object Store Buckets</h6><div class=\"dropdown no-arrow\"><a class=\"dropdown-toggle\" href=\"#\" role=\"button\" data-bs-toggle=\"dropdown\"><i class=\"bi bi-three-dots-vertical icon-sm icon-fixed-width text-gray-400\"></i></a><div class=\"dropdown-menu dropdown-menu-right shadow animated--fade-in\"><div class=\"dropdown-header\">Actions:</div><a class=\"dropdown-item\" href=\"#\" onclick=\"exportBucketList()\"><i class=\"bi bi-download me-2\"></i>Export List</a></div></div></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\" id=\"bucketsTable\"><thead><tr><th><a href=\"#\" onclick=\"sortTable('name')\" class=\"text-decoration-none text-dark\">Name")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</div></div><div class=\"col-auto\"><i class=\"bi bi-device-hdd icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Buckets Table --><div class=\"row\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\" id=\"bucketsTable\"><thead><tr><th><a href=\"#\" onclick=\"sortTable('name')\" class=\"text-decoration-none text-dark\">Name")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -118,7 +105,7 @@ func S3Buckets(data dash.S3BucketsData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "</a></th><th><a href=\"#\" onclick=\"sortTable('owner')\" class=\"text-decoration-none text-dark\">Owner")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "</a></th><th><a href=\"#\" onclick=\"sortTable('owner')\" class=\"text-decoration-none text-dark\">Owner")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -126,7 +113,7 @@ func S3Buckets(data dash.S3BucketsData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "</a></th><th><a href=\"#\" onclick=\"sortTable('created')\" class=\"text-decoration-none text-dark\">Created")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "</a></th><th><a href=\"#\" onclick=\"sortTable('created')\" class=\"text-decoration-none text-dark\">Created")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -134,7 +121,7 @@ func S3Buckets(data dash.S3BucketsData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "</a></th><th><a href=\"#\" onclick=\"sortTable('logical_size')\" class=\"text-decoration-none text-dark\">Logical Size")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "</a></th><th><a href=\"#\" onclick=\"sortTable('logical_size')\" class=\"text-decoration-none text-dark\">Logical Size")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -142,7 +129,7 @@ func S3Buckets(data dash.S3BucketsData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "</a></th><th><a href=\"#\" onclick=\"sortTable('physical_size')\" class=\"text-decoration-none text-dark\">Physical Size")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "</a></th><th><a href=\"#\" onclick=\"sortTable('physical_size')\" class=\"text-decoration-none text-dark\">Physical Size")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -150,143 +137,156 @@ func S3Buckets(data dash.S3BucketsData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</a></th><th>Quota</th><th>Versioning</th><th>Object Lock</th><th>Lifecycle</th><th>Policy</th><th>Actions</th></tr></thead> <tbody>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "</a></th><th>Quota</th><th>Versioning</th><th>Object Lock</th><th>Lifecycle</th><th>Policy</th><th>Actions</th></tr></thead> <tbody>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, bucket := range data.Buckets {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<tr><td><a href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "<tr><td><a href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var5 string
- templ_7745c5c3_Var5, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, fmt.Sprintf("/files?path=/buckets/%s", bucket.Name))).ResolveURL(ctx)
+ var templ_7745c5c3_Var4 string
+ templ_7745c5c3_Var4, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, fmt.Sprintf("/files?path=/buckets/%s", bucket.Name))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 162, Col: 124}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 129, Col: 124}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var5)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var4)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "\" class=\"text-decoration-none\"><i class=\"bi bi-box me-2\"></i> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "\" class=\"text-decoration-none text-nowrap\"><i class=\"bi bi-box me-2\"></i> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var6 string
- templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(bucket.Name)
+ var templ_7745c5c3_Var5 string
+ templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(bucket.Name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 165, Col: 64}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 132, Col: 64}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "</a> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</a> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if bucket.ReadOnly {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "<span class=\"badge bg-danger ms-2\" title=\"Bucket is read-only (quota enforcement or manual lock); writes are rejected\"><i class=\"bi bi-lock me-1\"></i>Read-only</span>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<span class=\"badge bg-danger ms-2\" title=\"Bucket is read-only (quota enforcement or manual lock); writes are rejected\"><i class=\"bi bi-lock me-1\"></i>Read-only</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if bucket.Owner != "" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<span class=\"badge bg-info\"><i class=\"bi bi-person me-1\"></i>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "<span class=\"badge bg-info\"><i class=\"bi bi-person me-1\"></i>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var7 string
- templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(bucket.Owner)
+ var templ_7745c5c3_Var6 string
+ templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(bucket.Owner)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 176, Col: 102}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 143, Col: 102}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</span>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<span class=\"text-muted small\">No owner</span>")
+ templ_7745c5c3_Err = emptyValue("No owner").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</td><td class=\"text-nowrap\" title=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var7 string
+ templ_7745c5c3_Var7, templ_7745c5c3_Err = templruntime.NewAttributeExpression(bucket.CreatedAt.Format("2006-01-02 15:04")).Resolve(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 149, Col: 118}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
- templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(bucket.CreatedAt.Format("2006-01-02 15:04"))
+ templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(bucket.CreatedAt.Format("2006-01-02"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 182, Col: 92}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 149, Col: 158}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</td><td><div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "</td><td><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(bucket.LogicalSize))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 184, Col: 85}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 151, Col: 85}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "</div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if bucket.PhysicalSize > 0 && bucket.LogicalSize > 0 && bucket.PhysicalSize > bucket.LogicalSize {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<div class=\"small text-muted\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "<div class=\"small text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.1fx overhead", float64(bucket.PhysicalSize)/float64(bucket.LogicalSize)))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 187, Col: 144}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 154, Col: 144}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "</div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(bucket.PhysicalSize))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 191, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 158, Col: 81}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if bucket.Quota > 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "<div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "<div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -294,7 +294,7 @@ func S3Buckets(data dash.S3BucketsData) templ.Component {
templ_7745c5c3_ElementWriter := templ_7745c5c3_Buffer
templ_7745c5c3_Buffer := templ.GetBuffer()
var templ_7745c5c3_ElementScripts []templ.ComponentScript
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "<span class=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "<span class=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -312,7 +312,7 @@ func S3Buckets(data dash.S3BucketsData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -326,142 +326,142 @@ func S3Buckets(data dash.S3BucketsData) templ.Component {
}
templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, ">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, ">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(formatBytes(bucket.Quota))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 196, Col: 86}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 163, Col: 86}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</span> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "</span> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if bucket.QuotaEnabled {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "<div class=\"small text-muted\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "<div class=\"small text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.1f%% used", float64(bucket.LogicalSize)/float64(bucket.Quota)*100))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 200, Col: 146}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 167, Col: 146}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "<div class=\"small text-muted\">Disabled</div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "<div class=\"small text-muted\">Disabled</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "</div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "<span class=\"text-muted\">No quota</span>")
+ templ_7745c5c3_Err = emptyValue("No quota").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if bucket.VersioningStatus == "Enabled" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "<span class=\"badge bg-success\"><i class=\"bi bi-check me-1\"></i>Enabled</span>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "<span class=\"badge bg-success\"><i class=\"bi bi-check me-1\"></i>Enabled</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else if bucket.VersioningStatus == "Suspended" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<span class=\"badge bg-warning\"><i class=\"bi bi-pause me-1\"></i>Suspended</span>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "<span class=\"badge bg-warning\"><i class=\"bi bi-pause me-1\"></i>Suspended</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "<span class=\"text-muted\">Not configured</span>")
+ templ_7745c5c3_Err = emptyValue("Not configured").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if bucket.ObjectLockEnabled {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "<div><span class=\"badge bg-warning\"><i class=\"bi bi-lock me-1\"></i>Enabled</span><div class=\"small text-muted\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<div><span class=\"badge bg-warning\"><i class=\"bi bi-lock me-1\"></i>Enabled</span><div class=\"small text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(bucket.ObjectLockMode)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 230, Col: 82}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 197, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, " • ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, " • ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d days", bucket.ObjectLockDuration))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 230, Col: 138}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 197, Col: 138}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "</div></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "</div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "<span class=\"text-muted\">Not configured</span>")
+ templ_7745c5c3_Err = emptyValue("Not configured").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if bucket.LifecycleRuleCount > 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "<div><button type=\"button\" class=\"badge bg-primary border-0 lifecycle-btn\" data-bucket-name=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "<div><button type=\"button\" class=\"badge bg-primary border-0 lifecycle-btn\" data-bucket-name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templruntime.NewAttributeExpression(bucket.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 241, Col: 93}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 208, Col: 93}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "\" title=\"View Lifecycle Rules\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "\" title=\"View Lifecycle Rules\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if bucket.LifecycleRuleCount == 1 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "1 rule")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "1 rule")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -469,70 +469,70 @@ func S3Buckets(data dash.S3BucketsData) templ.Component {
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d rules", bucket.LifecycleRuleCount))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 246, Col: 115}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 213, Col: 115}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "</button> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "</button> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if bucket.LifecycleEnabledCount < bucket.LifecycleRuleCount {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "<div class=\"small text-muted\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "<div class=\"small text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d enabled", bucket.LifecycleEnabledCount))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 251, Col: 120}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 218, Col: 120}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "</div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "</div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "<span class=\"text-muted\">Not configured</span>")
+ templ_7745c5c3_Err = emptyValue("Not configured").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if bucket.PolicyStatementCount > 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "<button type=\"button\" class=\"badge bg-primary border-0 policy-btn\" data-bucket-name=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "<button type=\"button\" class=\"badge bg-primary border-0 policy-btn\" data-bucket-name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templruntime.NewAttributeExpression(bucket.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 262, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 229, Col: 89}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var21)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "\" title=\"View Bucket Policy\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "\" title=\"View Bucket Policy\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if bucket.PolicyStatementCount == 1 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "1 statement")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "1 statement")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -540,339 +540,339 @@ func S3Buckets(data dash.S3BucketsData) templ.Component {
var templ_7745c5c3_Var22 string
templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d statements", bucket.PolicyStatementCount))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 267, Col: 118}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 234, Col: 118}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "</button>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "</button>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "<span class=\"text-muted\">Not configured</span>")
+ templ_7745c5c3_Err = emptyValue("Not configured").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "</td><td><div class=\"btn-group btn-group-sm\" role=\"group\"><a href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "</td><td><div class=\"btn-group btn-group-sm\" role=\"group\"><a href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templruntime.NewAttributeExpression(dash.PUrl(ctx, fmt.Sprintf("/files?path=/buckets/%s", bucket.Name))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 276, Col: 128}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 243, Col: 128}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var23)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "\" class=\"btn btn-outline-success btn-sm\" title=\"Browse Files\"><i class=\"bi bi-folder2-open\"></i></a> <button type=\"button\" class=\"btn btn-outline-primary btn-sm view-details-btn\" data-bucket-name=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "\" class=\"btn btn-outline-success btn-sm\" title=\"Browse Files\"><i class=\"bi bi-folder2-open\"></i></a> <button type=\"button\" class=\"btn btn-outline-primary btn-sm view-details-btn\" data-bucket-name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templruntime.NewAttributeExpression(bucket.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 283, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 250, Col: 89}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "\" title=\"View Details\"><i class=\"bi bi-eye\"></i></button> <button type=\"button\" class=\"btn btn-outline-secondary btn-sm lifecycle-btn\" data-bucket-name=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "\" title=\"View Details\"><i class=\"bi bi-eye\"></i></button> <button type=\"button\" class=\"btn btn-outline-secondary btn-sm lifecycle-btn\" data-bucket-name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templruntime.NewAttributeExpression(bucket.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 289, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 256, Col: 89}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var25)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "\" title=\"Lifecycle Rules\"><i class=\"bi bi-recycle\"></i></button> <button type=\"button\" class=\"btn btn-outline-info btn-sm policy-btn\" data-bucket-name=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "\" title=\"Lifecycle Rules\"><i class=\"bi bi-recycle\"></i></button> <button type=\"button\" class=\"btn btn-outline-info btn-sm policy-btn\" data-bucket-name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templruntime.NewAttributeExpression(bucket.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 295, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 262, Col: 89}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var26)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "\" title=\"Bucket Policy\"><i class=\"bi bi-shield\"></i></button> <button type=\"button\" class=\"btn btn-outline-info btn-sm owner-btn\" data-bucket-name=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "\" title=\"Bucket Policy\"><i class=\"bi bi-shield\"></i></button> <button type=\"button\" class=\"btn btn-outline-info btn-sm owner-btn\" data-bucket-name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templruntime.NewAttributeExpression(bucket.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 301, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 268, Col: 89}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var27)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "\" data-current-owner=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "\" data-current-owner=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var28 string
templ_7745c5c3_Var28, templ_7745c5c3_Err = templruntime.NewAttributeExpression(bucket.Owner).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 302, Col: 92}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 269, Col: 92}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var28)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "\" title=\"Manage Owner\"><i class=\"bi bi-person-gear\"></i></button> <button type=\"button\" class=\"btn btn-outline-warning btn-sm quota-btn\" data-bucket-name=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "\" title=\"Manage Owner\"><i class=\"bi bi-person-gear\"></i></button> <button type=\"button\" class=\"btn btn-outline-warning btn-sm quota-btn\" data-bucket-name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var29 string
templ_7745c5c3_Var29, templ_7745c5c3_Err = templruntime.NewAttributeExpression(bucket.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 308, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 275, Col: 89}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var29)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, "\" data-current-quota=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "\" data-current-quota=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", getQuotaInMB(bucket.Quota))).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 309, Col: 125}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 276, Col: 125}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var30)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, "\" data-quota-enabled=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "\" data-quota-enabled=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%t", bucket.QuotaEnabled)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 310, Col: 118}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 277, Col: 118}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var31)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, "\" title=\"Manage Quota\"><i class=\"bi bi-speedometer2\"></i></button> <button type=\"button\" class=\"btn btn-outline-danger btn-sm delete-bucket-btn\" data-bucket-name=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "\" title=\"Manage Quota\"><i class=\"bi bi-speedometer2\"></i></button> <button type=\"button\" class=\"btn btn-outline-danger btn-sm delete-bucket-btn\" data-bucket-name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templruntime.NewAttributeExpression(bucket.Name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 316, Col: 89}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 283, Col: 89}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var32)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, "\" title=\"Delete Bucket\"><i class=\"bi bi-trash\"></i></button></div></td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "\" title=\"Delete Bucket\"><i class=\"bi bi-trash\"></i></button></div></td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if len(data.Buckets) == 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, "<tr><td colspan=\"11\" class=\"text-center text-muted py-4\"><i class=\"bi bi-box icon-3x mb-3 text-muted\"></i><div><h5>No Object Store buckets found</h5><p>Create your first bucket to get started with S3 storage.</p><button type=\"button\" class=\"btn btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#createBucketModal\"><i class=\"bi bi-plus me-1\"></i>Create Bucket</button></div></td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "<tr><td colspan=\"11\" class=\"text-center text-muted py-4\"><i class=\"bi bi-box icon-3x mb-3 text-muted\"></i><div><h5>No Object Store buckets found</h5><p>Create your first bucket to get started with S3 storage.</p><button type=\"button\" class=\"btn btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#createBucketModal\"><i class=\"bi bi-plus me-1\"></i>Create Bucket</button></div></td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, "</tbody></table></div><!-- Pagination Controls -->")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "</tbody></table></div><!-- Pagination Controls -->")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if data.TotalPages > 1 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, "<div class=\"d-flex justify-content-between align-items-center mt-3\"><small class=\"text-muted\">Showing ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, "<div class=\"d-flex justify-content-between align-items-center mt-3\"><small class=\"text-muted\">Showing ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var33 string
templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", (data.CurrentPage-1)*data.PageSize+1))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 348, Col: 101}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 315, Col: 101}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, " to ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, " to ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var34 string
templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", minInt(data.CurrentPage*data.PageSize, data.TotalBuckets)))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 348, Col: 185}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 315, Col: 185}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, " of ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, " of ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var35 string
templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", data.TotalBuckets))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 348, Col: 229}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 315, Col: 229}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, " buckets</small><nav aria-label=\"Buckets pagination\"><ul class=\"pagination pagination-sm mb-0\"><!-- Previous Button -->")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, " buckets</small><nav aria-label=\"Buckets pagination\"><ul class=\"pagination pagination-sm mb-0\"><!-- Previous Button -->")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if data.CurrentPage > 1 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 84, "<li class=\"page-item\"><a class=\"page-link pagination-link\" href=\"#\" data-page=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, "<li class=\"page-item\"><a class=\"page-link pagination-link\" href=\"#\" data-page=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var36 string
templ_7745c5c3_Var36, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", data.CurrentPage-1)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 355, Col: 142}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 322, Col: 142}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var36)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 85, "\"><i class=\"bi bi-chevron-left\"></i></a></li>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, "\"><i class=\"bi bi-chevron-left\"></i></a></li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 86, "<li class=\"page-item disabled\"><span class=\"page-link\"><i class=\"bi bi-chevron-left\"></i></span></li>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, "<li class=\"page-item disabled\"><span class=\"page-link\"><i class=\"bi bi-chevron-left\"></i></span></li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 87, "<!-- Page Numbers -->")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, "<!-- Page Numbers -->")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for i := maxInt(1, data.CurrentPage-2); i <= minInt(data.TotalPages, data.CurrentPage+2); i++ {
if i == data.CurrentPage {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 88, "<li class=\"page-item active\"><span class=\"page-link\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, "<li class=\"page-item active\"><span class=\"page-link\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var37 string
templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", i))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 371, Col: 97}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 338, Col: 97}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, "</span></li>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, "</span></li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 90, "<li class=\"page-item\"><a class=\"page-link pagination-link\" href=\"#\" data-page=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 84, "<li class=\"page-item\"><a class=\"page-link pagination-link\" href=\"#\" data-page=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var38 string
templ_7745c5c3_Var38, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", i)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 375, Col: 129}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 342, Col: 129}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var38)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 91, "\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 85, "\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var39 string
templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", i))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 375, Col: 152}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 342, Col: 152}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 92, "</a></li>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 86, "</a></li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 93, "<!-- Next Button -->")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 87, "<!-- Next Button -->")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if data.CurrentPage < data.TotalPages {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 94, "<li class=\"page-item\"><a class=\"page-link pagination-link\" href=\"#\" data-page=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 88, "<li class=\"page-item\"><a class=\"page-link pagination-link\" href=\"#\" data-page=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var40 string
templ_7745c5c3_Var40, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%d", data.CurrentPage+1)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 383, Col: 142}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 350, Col: 142}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var40)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 95, "\"><i class=\"bi bi-chevron-right\"></i></a></li>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, "\"><i class=\"bi bi-chevron-right\"></i></a></li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 96, "<li class=\"page-item disabled\"><span class=\"page-link\"><i class=\"bi bi-chevron-right\"></i></span></li>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 90, "<li class=\"page-item disabled\"><span class=\"page-link\"><i class=\"bi bi-chevron-right\"></i></span></li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 97, "</ul></nav></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 91, "</ul></nav></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 98, "</div></div></div></div><!-- Last Updated --><div class=\"row\"><div class=\"col-12\"><small class=\"text-muted\"><i class=\"bi bi-clock me-1\"></i> Last updated: ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 92, "</div></div></div></div><!-- Last Updated --><div class=\"row\"><div class=\"col-12\"><small class=\"text-muted\"><i class=\"bi bi-clock me-1\"></i> Last updated: ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var41 string
templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 408, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/s3_buckets.templ`, Line: 375, Col: 81}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 99, "</small></div></div></div><!-- Create Bucket Modal --><div class=\"modal fade\" id=\"createBucketModal\" tabindex=\"-1\" aria-labelledby=\"createBucketModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"createBucketModalLabel\"><i class=\"bi bi-plus me-2\"></i>Create New S3 Bucket</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><form id=\"createBucketForm\"><div class=\"modal-body\"><div class=\"mb-3\"><label for=\"bucketName\" class=\"form-label\">Bucket Name</label> <input type=\"text\" class=\"form-control\" id=\"bucketName\" name=\"name\" placeholder=\"my-bucket-name\" required pattern=\"[a-z0-9.-]+\" title=\"Bucket name must contain only lowercase letters, numbers, dots, and hyphens\"><div class=\"form-text\">Bucket names must be between 3 and 63 characters, contain only lowercase letters, numbers, dots, and hyphens.</div></div><div class=\"mb-3\"><label for=\"bucketOwner\" class=\"form-label\">Owner (Optional)</label> <select class=\"form-select\" id=\"bucketOwner\" name=\"owner\"><option value=\"\">No owner (admin-only access)</option><!-- Options will be populated dynamically when modal opens --></select><div class=\"form-text\">The S3 identity that owns this bucket. Non-admin users can only access buckets they own.</div></div><div class=\"mb-3\"><div class=\"form-check\"><input class=\"form-check-input\" type=\"checkbox\" id=\"enableQuota\" name=\"quota_enabled\"> <label class=\"form-check-label\" for=\"enableQuota\">Enable Storage Quota</label></div></div><div class=\"mb-3\" id=\"quotaSettings\" style=\"display: none;\"><div class=\"row\"><div class=\"col-md-8\"><label for=\"quotaSize\" class=\"form-label\">Quota Size</label> <input type=\"number\" class=\"form-control\" id=\"quotaSize\" name=\"quota_size\" placeholder=\"1024\" min=\"1\" step=\"1\"></div><div class=\"col-md-4\"><label for=\"quotaUnit\" class=\"form-label\">Unit</label> <select class=\"form-select\" id=\"quotaUnit\" name=\"quota_unit\"><option value=\"MB\" selected>MB</option> <option value=\"GB\">GB</option> <option value=\"TB\">TB</option></select></div></div><div class=\"form-text\">Set the maximum storage size for this bucket.</div></div><div class=\"mb-3\"><div class=\"form-check\"><input class=\"form-check-input\" type=\"checkbox\" id=\"enableVersioning\" name=\"versioning_enabled\"> <label class=\"form-check-label\" for=\"enableVersioning\">Enable Object Versioning</label></div><div class=\"form-text\">Keep multiple versions of objects in this bucket.</div></div><div class=\"mb-3\"><div class=\"form-check\"><input class=\"form-check-input\" type=\"checkbox\" id=\"enableObjectLock\" name=\"object_lock_enabled\"> <label class=\"form-check-label\" for=\"enableObjectLock\">Enable Object Lock</label></div><div class=\"form-text\">Prevent objects from being deleted or overwritten for a specified period. Automatically enables versioning.</div></div><div class=\"mb-3\" id=\"objectLockSettings\" style=\"display: none;\"><div class=\"row\"><div class=\"col-md-6\"><label for=\"objectLockMode\" class=\"form-label\">Object Lock Mode</label> <select class=\"form-select\" id=\"objectLockMode\" name=\"object_lock_mode\"><option value=\"GOVERNANCE\" selected>Governance</option> <option value=\"COMPLIANCE\">Compliance</option></select><div class=\"form-text\">Governance allows override with special permissions, Compliance is immutable.</div></div><div class=\"col-md-6\"><div class=\"form-check mb-3\"><input class=\"form-check-input\" type=\"checkbox\" id=\"setDefaultRetention\" name=\"set_default_retention\"> <label class=\"form-check-label\" for=\"setDefaultRetention\">Set Default Retention</label><div class=\"form-text\">Apply default retention to all new objects in this bucket.</div></div><div id=\"defaultRetentionSettings\" style=\"display: none;\"><label for=\"objectLockDuration\" class=\"form-label\">Default Retention (days)</label> <input type=\"number\" class=\"form-control\" id=\"objectLockDuration\" name=\"object_lock_duration\" placeholder=\"30\" min=\"1\" max=\"36500\" step=\"1\"><div class=\"form-text\">Default retention period for new objects (1-36500 days).</div></div></div></div></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"submit\" class=\"btn btn-primary\"><i class=\"bi bi-plus me-1\"></i>Create Bucket</button></div></form></div></div></div><!-- Delete Confirmation Modal --><div class=\"modal fade\" id=\"deleteBucketModal\" tabindex=\"-1\" aria-labelledby=\"deleteBucketModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"deleteBucketModalLabel\"><i class=\"bi bi-exclamation-triangle me-2 text-warning\"></i>Delete Bucket</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\"><p>Are you sure you want to delete the bucket <strong id=\"deleteBucketName\"></strong>?</p><div class=\"alert alert-warning\"><i class=\"bi bi-exclamation-triangle me-2\"></i> <strong>Warning:</strong> This action cannot be undone. All objects in the bucket will be permanently deleted.</div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-danger\" onclick=\"deleteBucket()\"><i class=\"bi bi-trash me-1\"></i>Delete Bucket</button></div></div></div></div><!-- Manage Quota Modal --><div class=\"modal fade\" id=\"manageQuotaModal\" tabindex=\"-1\" aria-labelledby=\"manageQuotaModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"manageQuotaModalLabel\"><i class=\"bi bi-speedometer2 me-2\"></i>Manage Bucket Quota</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><form id=\"quotaForm\"><div class=\"modal-body\"><div class=\"mb-3\"><label class=\"form-label\">Bucket Name</label> <input type=\"text\" class=\"form-control\" id=\"quotaBucketName\" readonly></div><div class=\"mb-3\"><div class=\"form-check\"><input class=\"form-check-input\" type=\"checkbox\" id=\"quotaEnabled\" name=\"quota_enabled\"> <label class=\"form-check-label\" for=\"quotaEnabled\">Enable Storage Quota</label></div></div><div class=\"mb-3\" id=\"quotaSizeSettings\"><div class=\"row\"><div class=\"col-md-8\"><label for=\"quotaSizeMB\" class=\"form-label\">Quota Size</label> <input type=\"number\" class=\"form-control\" id=\"quotaSizeMB\" name=\"quota_size\" placeholder=\"1024\" min=\"0\" step=\"1\"></div><div class=\"col-md-4\"><label for=\"quotaUnitMB\" class=\"form-label\">Unit</label> <select class=\"form-select\" id=\"quotaUnitMB\" name=\"quota_unit\"><option value=\"MB\" selected>MB</option> <option value=\"GB\">GB</option> <option value=\"TB\">TB</option></select></div></div><div class=\"form-text\">Set the maximum storage size for this bucket. Set to 0 to remove quota.</div></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"submit\" class=\"btn btn-warning\"><i class=\"bi bi-floppy me-1\"></i>Update Quota</button></div></form></div></div></div><!-- Bucket Details Modal --><div class=\"modal fade\" id=\"bucketDetailsModal\" tabindex=\"-1\" aria-labelledby=\"bucketDetailsModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog modal-lg\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"bucketDetailsModalLabel\"><i class=\"bi bi-box me-2\"></i>Bucket Details</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\"><div id=\"bucketDetailsContent\"><div class=\"text-center py-4\"><div class=\"spinner-border text-primary\" role=\"status\"><span class=\"visually-hidden\">Loading...</span></div><div class=\"mt-2\">Loading bucket details...</div></div></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Close</button></div></div></div></div><!-- Bucket Lifecycle Modal --><div class=\"modal fade\" id=\"bucketLifecycleModal\" tabindex=\"-1\" aria-labelledby=\"bucketLifecycleModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog modal-xl\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"bucketLifecycleModalLabel\"><i class=\"bi bi-recycle me-2\"></i>Lifecycle</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\"><div id=\"bucketLifecycleContent\"></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-outline-danger me-auto\" id=\"lifecycleDeleteAllBtn\"><i class=\"bi bi-trash me-1\"></i>Delete all rules</button> <button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-primary\" id=\"lifecycleSaveAllBtn\"><i class=\"bi bi-floppy me-1\"></i>Save</button></div></div></div></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 93, "</small></div></div></div><!-- Create Bucket Modal --><div class=\"modal fade\" id=\"createBucketModal\" tabindex=\"-1\" aria-labelledby=\"createBucketModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"createBucketModalLabel\"><i class=\"bi bi-plus me-2\"></i>Create New S3 Bucket</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><form id=\"createBucketForm\"><div class=\"modal-body\"><div class=\"mb-3\"><label for=\"bucketName\" class=\"form-label\">Bucket Name</label> <input type=\"text\" class=\"form-control\" id=\"bucketName\" name=\"name\" placeholder=\"my-bucket-name\" required pattern=\"[a-z0-9.-]+\" title=\"Bucket name must contain only lowercase letters, numbers, dots, and hyphens\"><div class=\"form-text\">Bucket names must be between 3 and 63 characters, contain only lowercase letters, numbers, dots, and hyphens.</div></div><div class=\"mb-3\"><label for=\"bucketOwner\" class=\"form-label\">Owner (Optional)</label> <select class=\"form-select\" id=\"bucketOwner\" name=\"owner\"><option value=\"\">No owner (admin-only access)</option><!-- Options will be populated dynamically when modal opens --></select><div class=\"form-text\">The S3 identity that owns this bucket. Non-admin users can only access buckets they own.</div></div><div class=\"mb-3\"><div class=\"form-check\"><input class=\"form-check-input\" type=\"checkbox\" id=\"enableQuota\" name=\"quota_enabled\"> <label class=\"form-check-label\" for=\"enableQuota\">Enable Storage Quota</label></div></div><div class=\"mb-3\" id=\"quotaSettings\" style=\"display: none;\"><div class=\"row\"><div class=\"col-md-8\"><label for=\"quotaSize\" class=\"form-label\">Quota Size</label> <input type=\"number\" class=\"form-control\" id=\"quotaSize\" name=\"quota_size\" placeholder=\"1024\" min=\"1\" step=\"1\"></div><div class=\"col-md-4\"><label for=\"quotaUnit\" class=\"form-label\">Unit</label> <select class=\"form-select\" id=\"quotaUnit\" name=\"quota_unit\"><option value=\"MB\" selected>MB</option> <option value=\"GB\">GB</option> <option value=\"TB\">TB</option></select></div></div><div class=\"form-text\">Set the maximum storage size for this bucket.</div></div><div class=\"mb-3\"><div class=\"form-check\"><input class=\"form-check-input\" type=\"checkbox\" id=\"enableVersioning\" name=\"versioning_enabled\"> <label class=\"form-check-label\" for=\"enableVersioning\">Enable Object Versioning</label></div><div class=\"form-text\">Keep multiple versions of objects in this bucket.</div></div><div class=\"mb-3\"><div class=\"form-check\"><input class=\"form-check-input\" type=\"checkbox\" id=\"enableObjectLock\" name=\"object_lock_enabled\"> <label class=\"form-check-label\" for=\"enableObjectLock\">Enable Object Lock</label></div><div class=\"form-text\">Prevent objects from being deleted or overwritten for a specified period. Automatically enables versioning.</div></div><div class=\"mb-3\" id=\"objectLockSettings\" style=\"display: none;\"><div class=\"row\"><div class=\"col-md-6\"><label for=\"objectLockMode\" class=\"form-label\">Object Lock Mode</label> <select class=\"form-select\" id=\"objectLockMode\" name=\"object_lock_mode\"><option value=\"GOVERNANCE\" selected>Governance</option> <option value=\"COMPLIANCE\">Compliance</option></select><div class=\"form-text\">Governance allows override with special permissions, Compliance is immutable.</div></div><div class=\"col-md-6\"><div class=\"form-check mb-3\"><input class=\"form-check-input\" type=\"checkbox\" id=\"setDefaultRetention\" name=\"set_default_retention\"> <label class=\"form-check-label\" for=\"setDefaultRetention\">Set Default Retention</label><div class=\"form-text\">Apply default retention to all new objects in this bucket.</div></div><div id=\"defaultRetentionSettings\" style=\"display: none;\"><label for=\"objectLockDuration\" class=\"form-label\">Default Retention (days)</label> <input type=\"number\" class=\"form-control\" id=\"objectLockDuration\" name=\"object_lock_duration\" placeholder=\"30\" min=\"1\" max=\"36500\" step=\"1\"><div class=\"form-text\">Default retention period for new objects (1-36500 days).</div></div></div></div></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"submit\" class=\"btn btn-primary\"><i class=\"bi bi-plus me-1\"></i>Create Bucket</button></div></form></div></div></div><!-- Delete Confirmation Modal --><div class=\"modal fade\" id=\"deleteBucketModal\" tabindex=\"-1\" aria-labelledby=\"deleteBucketModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"deleteBucketModalLabel\"><i class=\"bi bi-exclamation-triangle me-2 text-warning\"></i>Delete Bucket</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\"><p>Are you sure you want to delete the bucket <strong id=\"deleteBucketName\"></strong>?</p><div class=\"alert alert-warning\"><i class=\"bi bi-exclamation-triangle me-2\"></i> <strong>Warning:</strong> This action cannot be undone. All objects in the bucket will be permanently deleted.</div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-danger\" onclick=\"deleteBucket()\"><i class=\"bi bi-trash me-1\"></i>Delete Bucket</button></div></div></div></div><!-- Manage Quota Modal --><div class=\"modal fade\" id=\"manageQuotaModal\" tabindex=\"-1\" aria-labelledby=\"manageQuotaModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"manageQuotaModalLabel\"><i class=\"bi bi-speedometer2 me-2\"></i>Manage Bucket Quota</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><form id=\"quotaForm\"><div class=\"modal-body\"><div class=\"mb-3\"><label class=\"form-label\">Bucket Name</label> <input type=\"text\" class=\"form-control\" id=\"quotaBucketName\" readonly></div><div class=\"mb-3\"><div class=\"form-check\"><input class=\"form-check-input\" type=\"checkbox\" id=\"quotaEnabled\" name=\"quota_enabled\"> <label class=\"form-check-label\" for=\"quotaEnabled\">Enable Storage Quota</label></div></div><div class=\"mb-3\" id=\"quotaSizeSettings\"><div class=\"row\"><div class=\"col-md-8\"><label for=\"quotaSizeMB\" class=\"form-label\">Quota Size</label> <input type=\"number\" class=\"form-control\" id=\"quotaSizeMB\" name=\"quota_size\" placeholder=\"1024\" min=\"0\" step=\"1\"></div><div class=\"col-md-4\"><label for=\"quotaUnitMB\" class=\"form-label\">Unit</label> <select class=\"form-select\" id=\"quotaUnitMB\" name=\"quota_unit\"><option value=\"MB\" selected>MB</option> <option value=\"GB\">GB</option> <option value=\"TB\">TB</option></select></div></div><div class=\"form-text\">Set the maximum storage size for this bucket. Set to 0 to remove quota.</div></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"submit\" class=\"btn btn-warning\"><i class=\"bi bi-floppy me-1\"></i>Update Quota</button></div></form></div></div></div><!-- Bucket Details Modal --><div class=\"modal fade\" id=\"bucketDetailsModal\" tabindex=\"-1\" aria-labelledby=\"bucketDetailsModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog modal-lg\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"bucketDetailsModalLabel\"><i class=\"bi bi-box me-2\"></i>Bucket Details</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\"><div id=\"bucketDetailsContent\"><div class=\"text-center py-4\"><div class=\"spinner-border text-primary\" role=\"status\"><span class=\"visually-hidden\">Loading...</span></div><div class=\"mt-2\">Loading bucket details...</div></div></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Close</button></div></div></div></div><!-- Bucket Lifecycle Modal --><div class=\"modal fade\" id=\"bucketLifecycleModal\" tabindex=\"-1\" aria-labelledby=\"bucketLifecycleModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog modal-xl\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"bucketLifecycleModalLabel\"><i class=\"bi bi-recycle me-2\"></i>Lifecycle</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\"><div id=\"bucketLifecycleContent\"></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-outline-danger me-auto\" id=\"lifecycleDeleteAllBtn\"><i class=\"bi bi-trash me-1\"></i>Delete all rules</button> <button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-primary\" id=\"lifecycleSaveAllBtn\"><i class=\"bi bi-floppy me-1\"></i>Save</button></div></div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -880,7 +880,7 @@ func S3Buckets(data dash.S3BucketsData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 100, "<!-- Bucket Policy Modal --><div class=\"modal fade\" id=\"bucketPolicyModal\" tabindex=\"-1\" aria-labelledby=\"bucketPolicyModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog modal-xl\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"bucketPolicyModalLabel\"><i class=\"bi bi-file-earmark-lock me-2\"></i>Bucket Policy</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\"><div id=\"bucketPolicyLoading\" class=\"text-center py-4\"><div class=\"spinner-border text-primary\" role=\"status\"><span class=\"visually-hidden\">Loading...</span></div><div class=\"mt-2\">Loading bucket policy...</div></div><div id=\"bucketPolicyError\" class=\"alert alert-danger\" style=\"display: none;\"></div><div id=\"bucketPolicyEditorWrapper\" style=\"display: none;\"><p class=\"text-muted small\">Every statement must specify a Principal, and every Resource must refer to this bucket. Leave the document empty and click Delete to remove the policy.</p><ul class=\"nav nav-tabs\" role=\"tablist\"><li class=\"nav-item\" role=\"presentation\"><button class=\"nav-link active\" id=\"bucketPolicyEditorTabBtn\" type=\"button\" data-bs-toggle=\"tab\" data-bs-target=\"#bucketPolicyEditorTab\" role=\"tab\" aria-controls=\"bucketPolicyEditorTab\" aria-selected=\"true\">Editor</button></li><li class=\"nav-item\" role=\"presentation\"><button class=\"nav-link\" id=\"bucketPolicyJsonTabBtn\" type=\"button\" data-bs-toggle=\"tab\" data-bs-target=\"#bucketPolicyJsonTab\" role=\"tab\" aria-controls=\"bucketPolicyJsonTab\" aria-selected=\"false\">JSON</button></li></ul><div class=\"tab-content border border-top-0 rounded-bottom p-3 mb-3\"><div class=\"tab-pane fade show active\" id=\"bucketPolicyEditorTab\" role=\"tabpanel\" aria-labelledby=\"bucketPolicyEditorTabBtn\"><div id=\"bucketPolicyEditorBody\"></div><button type=\"button\" class=\"btn btn-sm btn-outline-secondary\" id=\"bucketPolicyAddStatementBtn\"><i class=\"bi bi-plus me-1\"></i>Add statement</button></div><div class=\"tab-pane fade\" id=\"bucketPolicyJsonTab\" role=\"tabpanel\" aria-labelledby=\"bucketPolicyJsonTabBtn\"><textarea class=\"form-control\" id=\"bucketPolicyDocument\" rows=\"15\" style=\"font-family: monospace;\" spellcheck=\"false\" placeholder='{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"s3:GetObject\",\"Resource\":\"arn:aws:s3:::bucket-name/*\"}]}'></textarea><div class=\"form-text\">Enter the bucket policy document as JSON</div></div></div><div class=\"mb-3\"><button type=\"button\" class=\"btn btn-outline-info btn-sm\" id=\"bucketPolicyInsertSampleBtn\"><i class=\"bi bi-file-earmark-text me-1\"></i>Use Sample Policy</button></div></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-outline-danger me-auto\" id=\"bucketPolicyDeleteBtn\"><i class=\"bi bi-trash me-1\"></i>Delete</button> <button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-primary\" id=\"bucketPolicySaveBtn\"><i class=\"bi bi-floppy me-1\"></i>Save</button></div></div></div></div><!-- Manage Owner Modal --><div class=\"modal fade\" id=\"manageOwnerModal\" tabindex=\"-1\" aria-labelledby=\"manageOwnerModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"manageOwnerModalLabel\"><i class=\"bi bi-person-gear me-2\"></i>Manage Bucket Owner</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><form id=\"ownerForm\"><div class=\"modal-body\"><div class=\"mb-3\"><label class=\"form-label\">Bucket Name</label> <input type=\"text\" class=\"form-control\" id=\"ownerBucketName\" readonly></div><div class=\"mb-3\"><label for=\"bucketOwnerSelect\" class=\"form-label\">Owner</label> <select class=\"form-select\" id=\"bucketOwnerSelect\" name=\"owner\"><option value=\"\">No owner (admin-only access)</option><!-- Options will be populated dynamically --></select><div class=\"form-text\">Select the S3 identity that owns this bucket. Non-admin users can only access buckets they own.</div></div><div id=\"ownerLoadingSpinner\" class=\"text-center py-2\" style=\"display: none;\"><div class=\"spinner-border spinner-border-sm text-primary\" role=\"status\"><span class=\"visually-hidden\">Loading users...</span></div><span class=\"ms-2\">Loading users...</span></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"submit\" class=\"btn btn-info\"><i class=\"bi bi-floppy me-1\"></i>Update Owner</button></div></form></div></div></div><!-- JavaScript for bucket management --><script>\n // Global state (shared between DOMContentLoaded handlers and global functions)\n let deleteModalInstance = null;\n let quotaModalInstance = null;\n let ownerModalInstance = null;\n let detailsModalInstance = null;\n let lifecycleModalInstance = null;\n let lifecycleRequestSeq = 0;\n let policyModalInstance = null;\n let policyRequestSeq = 0;\n let policyEditorBucket = null;\n // True only once the bucket-policy GET for the currently open bucket has\n // actually completed successfully. The Save button lives outside the\n // (initially hidden) editor wrapper, so it stays clickable while a load\n // is in flight or has failed; without this guard, Save could commit\n // whatever the editor happened to hold - a stale previous bucket's\n // statements, or a freshly-initialized empty state - onto\n // policyEditorBucket before its own policy ever loaded.\n let bucketPolicyLoaded = false;\n // True while a Save (PUT) or Delete (DELETE) request for the bucket\n // policy is in flight, so a double-click - or Save and Delete fired in\n // quick succession - can't send two overlapping mutations for the same\n // bucket. Cleared on failure so the user can retry; left set on success,\n // since the modal hides and the page reloads shortly after anyway.\n let bucketPolicyMutationInFlight = false;\n\n function setBucketPolicyMutationInFlight(inFlight) {\n bucketPolicyMutationInFlight = inFlight;\n document.getElementById('bucketPolicySaveBtn').disabled = inFlight;\n document.getElementById('bucketPolicyDeleteBtn').disabled = inFlight;\n }\n\n let cachedUsers = null;\n\n // Working copy of the lifecycle rules currently shown in the modal.\n // Edits (add/edit/delete rule) only mutate this local state; nothing is\n // sent to the server until \"Save\" or \"Delete all rules\" is clicked.\n let lifecycleEditor = { bucket: null, rules: [], editingIndex: null, editingRule: null, rawXml: '', hasTransition: false };\n\n function escapeHtml(v) {\n return String(v ?? '')\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;');\n }\n\n // Shadows admin.js's formatBytes for this page, so it keeps that\n // signature and unit list; the extra guard is for a size the API left\n // out, which the shared one renders as \"NaN undefined\".\n function formatBytes(bytes, decimals = 2) {\n if (!bytes) return '0 Bytes';\n const k = 1024;\n const dm = decimals < 0 ? 0 : decimals;\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];\n }\n\n function formatDays(n) {\n return n + (n === 1 ? ' day' : ' days');\n }\n\n // csrfHeaders reads the token the layout stamps into every page\n // (<meta name=\"csrf-token\">) so mutating lifecycle requests pass it the\n // same way the newer admin pages (e.g. s3tables) do.\n function csrfHeaders() {\n const meta = document.querySelector('meta[name=\"csrf-token\"]');\n const token = meta ? (meta.getAttribute('content') || '') : '';\n const headers = { 'Content-Type': 'application/json' };\n if (token) {\n headers['X-CSRF-Token'] = token;\n }\n return headers;\n }\n\n // parseLifecycleResponse reads the body as text before parsing, so a\n // non-JSON response (a proxy's HTML error page, an empty body, plain\n // text from some middleware) surfaces the HTTP status instead of\n // throwing a raw JSON syntax error out of response.json().\n function parseLifecycleResponse(response) {\n return response.text().then(text => {\n let data = {};\n if (text) {\n try {\n data = JSON.parse(text);\n } catch (e) {\n data = { error: response.statusText || ('HTTP ' + response.status) };\n }\n } else if (!response.ok) {\n data = { error: response.statusText || ('HTTP ' + response.status) };\n }\n return { ok: response.ok, data: data };\n });\n }\n\n document.addEventListener('DOMContentLoaded', function() {\n // Add click handlers to pagination links\n document.querySelectorAll('.pagination-link').forEach(link => {\n link.addEventListener('click', function(e) {\n e.preventDefault();\n const page = this.getAttribute('data-page');\n goToPage(page);\n });\n });\n\n // Initialize modal instances once (reuse with show/hide)\n deleteModalInstance = new bootstrap.Modal(document.getElementById('deleteBucketModal'));\n quotaModalInstance = new bootstrap.Modal(document.getElementById('manageQuotaModal'));\n ownerModalInstance = new bootstrap.Modal(document.getElementById('manageOwnerModal'));\n detailsModalInstance = new bootstrap.Modal(document.getElementById('bucketDetailsModal'));\n lifecycleModalInstance = new bootstrap.Modal(document.getElementById('bucketLifecycleModal'));\n policyModalInstance = new bootstrap.Modal(document.getElementById('bucketPolicyModal'));\n\n const quotaCheckbox = document.getElementById('enableQuota');\n const quotaSettings = document.getElementById('quotaSettings');\n const versioningCheckbox = document.getElementById('enableVersioning');\n const objectLockCheckbox = document.getElementById('enableObjectLock');\n const objectLockSettings = document.getElementById('objectLockSettings');\n const setDefaultRetentionCheckbox = document.getElementById('setDefaultRetention');\n const defaultRetentionSettings = document.getElementById('defaultRetentionSettings');\n const createBucketForm = document.getElementById('createBucketForm');\n\n // Toggle quota settings\n quotaCheckbox.addEventListener('change', function() {\n quotaSettings.style.display = this.checked ? 'block' : 'none';\n });\n\n // Toggle object lock settings and automatically enable versioning\n objectLockCheckbox.addEventListener('change', function() {\n objectLockSettings.style.display = this.checked ? 'block' : 'none';\n if (this.checked) {\n versioningCheckbox.checked = true;\n versioningCheckbox.disabled = true;\n } else {\n versioningCheckbox.disabled = false;\n // Reset default retention settings when object lock is disabled\n setDefaultRetentionCheckbox.checked = false;\n defaultRetentionSettings.style.display = 'none';\n }\n });\n\n // Toggle default retention settings\n setDefaultRetentionCheckbox.addEventListener('change', function() {\n defaultRetentionSettings.style.display = this.checked ? 'block' : 'none';\n });\n\n // Populate owner dropdown when create bucket modal opens\n document.getElementById('createBucketModal').addEventListener('show.bs.modal', async function() {\n const ownerSelect = document.getElementById('bucketOwner');\n \n // Only fetch if not already populated\n if (ownerSelect.options.length <= 1) {\n try {\n const response = await fetch(basePath('/api/users'));\n const data = await response.json();\n const users = data.users || [];\n \n users.forEach(user => {\n const option = document.createElement('option');\n option.value = user.username;\n option.textContent = user.username;\n ownerSelect.appendChild(option);\n });\n } catch (error) {\n console.error('Error fetching users for owner dropdown:', error);\n // Reset to default state on error - user can still create bucket without owner\n ownerSelect.innerHTML = '<option value=\"\">No owner (admin-only access)</option>';\n ownerSelect.selectedIndex = 0;\n }\n }\n });\n\n // Handle form submission\n createBucketForm.addEventListener('submit', function(e) {\n e.preventDefault();\n \n const formData = new FormData(this);\n const data = {\n name: formData.get('name'),\n owner: formData.get('owner') || '',\n region: formData.get('region') || '',\n quota_size: quotaCheckbox.checked ? parseInt(formData.get('quota_size')) || 0 : 0,\n quota_unit: formData.get('quota_unit') || 'MB',\n quota_enabled: quotaCheckbox.checked,\n versioning_enabled: versioningCheckbox.checked,\n object_lock_enabled: objectLockCheckbox.checked,\n object_lock_mode: formData.get('object_lock_mode') || 'GOVERNANCE',\n set_default_retention: setDefaultRetentionCheckbox.checked,\n object_lock_duration: setDefaultRetentionCheckbox.checked ? parseInt(formData.get('object_lock_duration')) || 30 : 0\n };\n\n // Validate object lock settings\n if (data.object_lock_enabled && data.set_default_retention && data.object_lock_duration <= 0) {\n alert('Please enter a valid retention duration for object lock.');\n return;\n }\n\n fetch(basePath('/api/s3/buckets'), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data)\n })\n .then(response => response.json())\n .then(data => {\n if (data.error) {\n alert('Error creating bucket: ' + data.error);\n } else {\n alert('Bucket created successfully!');\n // Properly close the modal before reloading\n const createModal = bootstrap.Modal.getInstance(document.getElementById('createBucketModal'));\n if (createModal) {\n createModal.hide();\n }\n setTimeout(() => location.reload(), 500);\n }\n })\n .catch(error => {\n console.error('Error:', error);\n alert('Error creating bucket: ' + error.message);\n });\n });\n\n // Handle delete bucket\n const deleteForm = document.getElementById('deleteBucketModal');\n document.querySelectorAll('.delete-bucket-btn').forEach(button => {\n button.addEventListener('click', function() {\n const bucketName = this.dataset.bucketName;\n document.getElementById('deleteBucketName').textContent = bucketName;\n // Store bucket name on modal element instead of global window property\n deleteForm.dataset.bucketName = bucketName;\n deleteModalInstance.show();\n });\n });\n\n // Handle quota management\n const quotaForm = document.getElementById('quotaForm');\n document.querySelectorAll('.quota-btn').forEach(button => {\n button.addEventListener('click', function() {\n const bucketName = this.dataset.bucketName;\n const currentQuota = parseInt(this.dataset.currentQuota);\n const quotaEnabled = this.dataset.quotaEnabled === 'true';\n \n document.getElementById('quotaBucketName').value = bucketName;\n document.getElementById('quotaEnabled').checked = quotaEnabled;\n document.getElementById('quotaSizeMB').value = currentQuota;\n \n // Toggle quota size settings\n document.getElementById('quotaSizeSettings').style.display = quotaEnabled ? 'block' : 'none';\n \n // Store bucket name on form element instead of global window property\n quotaForm.dataset.bucketName = bucketName;\n quotaModalInstance.show();\n });\n });\n\n // Add event listener to properly dispose of quota modal when hidden\n document.getElementById('manageQuotaModal').addEventListener('hidden.bs.modal', function() {\n if (quotaModalInstance) {\n quotaModalInstance.dispose();\n quotaModalInstance = null;\n }\n // Force remove any remaining backdrops\n document.querySelectorAll('.modal-backdrop').forEach(backdrop => {\n backdrop.remove();\n });\n // Ensure body classes are removed\n document.body.classList.remove('modal-open');\n document.body.style.removeProperty('padding-right');\n });\n\n // Handle quota form submission\n document.getElementById('quotaForm').addEventListener('submit', function(e) {\n e.preventDefault();\n \n const bucketName = this.dataset.bucketName;\n if (!bucketName) return;\n\n const formData = new FormData(this);\n const enabled = document.getElementById('quotaEnabled').checked;\n const data = {\n quota_size: enabled ? parseInt(formData.get('quota_size')) || 0 : 0,\n quota_unit: formData.get('quota_unit') || 'MB',\n quota_enabled: enabled\n };\n\n fetch(basePath(`/api/s3/buckets/${bucketName}/quota`), {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data)\n })\n .then(response => response.json())\n .then(data => {\n if (data.error) {\n alert('Error updating quota: ' + data.error);\n } else {\n alert('Quota updated successfully!');\n // Properly close the modal before reloading\n if (quotaModalInstance) {\n quotaModalInstance.hide();\n }\n setTimeout(() => location.reload(), 500);\n }\n })\n .catch(error => {\n console.error('Error:', error);\n alert('Error updating quota: ' + error.message);\n });\n });\n\n // Handle quota enabled checkbox\n document.getElementById('quotaEnabled').addEventListener('change', function() {\n document.getElementById('quotaSizeSettings').style.display = this.checked ? 'block' : 'none';\n });\n\n // Handle owner management\n const ownerForm = document.getElementById('ownerForm');\n document.querySelectorAll('.owner-btn').forEach(button => {\n button.addEventListener('click', async function() {\n const bucketName = this.dataset.bucketName;\n const currentOwner = this.dataset.currentOwner || '';\n \n document.getElementById('ownerBucketName').value = bucketName;\n // Store bucket name on form element instead of global window property\n ownerForm.dataset.bucketName = bucketName;\n \n // Show loading spinner\n document.getElementById('ownerLoadingSpinner').style.display = 'block';\n document.getElementById('bucketOwnerSelect').disabled = true;\n \n ownerModalInstance.show();\n \n // Fetch users if not cached\n try {\n if (!cachedUsers) {\n const response = await fetch(basePath('/api/users'));\n const data = await response.json();\n cachedUsers = data.users || [];\n }\n \n // Populate the select dropdown\n const select = document.getElementById('bucketOwnerSelect');\n select.innerHTML = '<option value=\"\">No owner (admin-only access)</option>';\n \n cachedUsers.forEach(user => {\n const option = document.createElement('option');\n option.value = user.username;\n option.textContent = user.username;\n if (user.username === currentOwner) {\n option.selected = true;\n }\n select.appendChild(option);\n });\n \n select.disabled = false;\n } catch (error) {\n console.error('Error fetching users:', error);\n alert('Error loading users: ' + error.message);\n // Re-enable select and reset to default on error\n const select = document.getElementById('bucketOwnerSelect');\n select.innerHTML = '<option value=\"\">No owner (admin-only access)</option>';\n select.selectedIndex = 0;\n select.disabled = false;\n } finally {\n document.getElementById('ownerLoadingSpinner').style.display = 'none';\n }\n });\n });\n\n // Handle owner form submission\n document.getElementById('ownerForm').addEventListener('submit', function(e) {\n e.preventDefault();\n \n const bucketName = this.dataset.bucketName;\n if (!bucketName) return;\n\n const owner = document.getElementById('bucketOwnerSelect').value;\n const data = { owner: owner };\n\n fetch(basePath(`/api/s3/buckets/${bucketName}/owner`), {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data)\n })\n .then(response => response.json())\n .then(data => {\n if (data.error) {\n alert('Error updating owner: ' + data.error);\n } else {\n alert('Bucket owner updated successfully!');\n // Properly close the modal before reloading\n if (ownerModalInstance) {\n ownerModalInstance.hide();\n }\n setTimeout(() => location.reload(), 500);\n }\n })\n .catch(error => {\n console.error('Error:', error);\n alert('Error updating owner: ' + error.message);\n });\n });\n\n // Handle view details button\n document.querySelectorAll('.view-details-btn').forEach(button => {\n button.addEventListener('click', function() {\n const bucketName = this.dataset.bucketName;\n \n // Update modal title\n document.getElementById('bucketDetailsModalLabel').innerHTML = \n '<i class=\"bi bi-box me-2\"></i>Bucket Details - ' + bucketName;\n \n // Show loading spinner\n document.getElementById('bucketDetailsContent').innerHTML = \n '<div class=\"text-center py-4\">' +\n '<div class=\"spinner-border text-primary\" role=\"status\">' +\n '<span class=\"visually-hidden\">Loading...</span>' +\n '<\\\\/div>' +\n '<div class=\"mt-2\">Loading bucket details...</div>' +\n '<\\\\/div>';\n \n detailsModalInstance.show();\n \n // Fetch bucket details\n fetch(basePath('/api/s3/buckets/' + bucketName))\n .then(response => response.json())\n .then(data => {\n if (data.error) {\n document.getElementById('bucketDetailsContent').innerHTML = \n '<div class=\"alert alert-danger\">' +\n '<i class=\"bi bi-exclamation-triangle me-2\"></i>' +\n 'Error loading bucket details: ' + data.error +\n '<\\\\/div>';\n } else {\n displayBucketDetails(data);\n }\n })\n .catch(error => {\n console.error('Error fetching bucket details:', error);\n document.getElementById('bucketDetailsContent').innerHTML = \n '<div class=\"alert alert-danger\">' +\n '<i class=\"bi bi-exclamation-triangle me-2\"></i>' +\n 'Error loading bucket details: ' + error.message +\n '<\\\\/div>';\n });\n });\n });\n\n // Lifecycle buttons: column badge and action button\n document.querySelectorAll('.lifecycle-btn').forEach(button => {\n button.addEventListener('click', function() {\n const bucketName = this.dataset.bucketName;\n\n // Reset the working copy until the GET below repopulates it,\n // so Save/Delete-all can't act on the previous bucket's rules.\n lifecycleEditor = { bucket: null, rules: [], editingIndex: null, editingRule: null, rawXml: '', hasTransition: false };\n\n document.getElementById('bucketLifecycleModalLabel').innerHTML =\n '<i class=\"bi bi-recycle me-2\"></i>Lifecycle - ' + bucketName;\n\n document.getElementById('bucketLifecycleContent').innerHTML =\n '<div class=\"text-center py-4\">' +\n '<div class=\"spinner-border text-primary\" role=\"status\">' +\n '<span class=\"visually-hidden\">Loading...</span>' +\n '<\\/div>' +\n '<div class=\"mt-2\">Loading lifecycle rules...</div>' +\n '<\\/div>';\n\n lifecycleModalInstance.show();\n\n // Drop responses that arrive after another bucket was opened\n const requestSeq = ++lifecycleRequestSeq;\n fetch(basePath('/api/s3/buckets/' + bucketName + '/lifecycle'))\n .then(parseLifecycleResponse)\n .then(({ ok, data }) => {\n if (requestSeq !== lifecycleRequestSeq) return;\n if (!ok || data.error) {\n document.getElementById('bucketLifecycleContent').innerHTML =\n '<div class=\"alert alert-danger\">' +\n '<i class=\"bi bi-exclamation-triangle me-2\"></i>' +\n 'Error loading lifecycle rules: ' + (data.error || 'unknown error') +\n '<\\/div>';\n } else {\n displayBucketLifecycle(data);\n }\n })\n .catch(error => {\n if (requestSeq !== lifecycleRequestSeq) return;\n console.error('Error fetching bucket lifecycle:', error);\n document.getElementById('bucketLifecycleContent').innerHTML =\n '<div class=\"alert alert-danger\">' +\n '<i class=\"bi bi-exclamation-triangle me-2\"></i>' +\n 'Error loading lifecycle rules: ' + error.message +\n '<\\/div>';\n });\n });\n });\n\n // Save the whole working rule set back to the bucket.\n document.getElementById('lifecycleSaveAllBtn').addEventListener('click', function() {\n if (!lifecycleEditor.bucket) return;\n // Fold in any rule the user is still editing so Save doesn't\n // silently discard it; abort if that form isn't valid yet.\n if (!commitOpenLifecycleRuleForm()) return;\n // An empty list clears the configuration, same as Delete all rules,\n // so it gets the same prompt.\n if (lifecycleEditor.rules.length === 0 &&\n !confirm('No rules left: saving removes the lifecycle configuration for ' + lifecycleEditor.bucket + '. This cannot be undone.')) {\n return;\n }\n\n fetch(basePath('/api/s3/buckets/' + lifecycleEditor.bucket + '/lifecycle'), {\n method: 'PUT',\n headers: csrfHeaders(),\n body: JSON.stringify({ rules: lifecycleEditor.rules })\n })\n .then(parseLifecycleResponse)\n .then(({ ok, data }) => {\n if (!ok || data.error) {\n alert('Error saving lifecycle rules: ' + (data.error || 'unknown error'));\n return;\n }\n if (lifecycleModalInstance) {\n lifecycleModalInstance.hide();\n }\n setTimeout(() => location.reload(), 500);\n })\n .catch(error => {\n console.error('Error:', error);\n alert('Error saving lifecycle rules: ' + error.message);\n });\n });\n\n // Clear the lifecycle configuration entirely.\n document.getElementById('lifecycleDeleteAllBtn').addEventListener('click', function() {\n if (!lifecycleEditor.bucket) return;\n if (!confirm('Delete all lifecycle rules for ' + lifecycleEditor.bucket + '? This cannot be undone.')) return;\n\n fetch(basePath('/api/s3/buckets/' + lifecycleEditor.bucket + '/lifecycle'), {\n method: 'DELETE',\n headers: csrfHeaders()\n })\n .then(parseLifecycleResponse)\n .then(({ ok, data }) => {\n if (!ok || data.error) {\n alert('Error deleting lifecycle rules: ' + (data.error || 'unknown error'));\n return;\n }\n if (lifecycleModalInstance) {\n lifecycleModalInstance.hide();\n }\n setTimeout(() => location.reload(), 500);\n })\n .catch(error => {\n console.error('Error:', error);\n alert('Error deleting lifecycle rules: ' + error.message);\n });\n });\n\n // Policy buttons: column badge and action button. The visual editor\n // (weed/admin/static/js/policy_editor.js) is set up once per page\n // load; registerPolicyEditor is re-called on every open so the\n // resource-ARN autocomplete and default Principal stay pinned to\n // whichever bucket is currently open.\n let bucketPolicyEditorSetUp = false;\n document.getElementById('bucketPolicyInsertSampleBtn').addEventListener('click', function() {\n if (!policyEditorBucket) return;\n insertSamplePolicy('bucket', {\n Version: '2012-10-17',\n Statement: [{\n Effect: 'Allow',\n Principal: '*',\n Action: ['s3:GetObject'],\n Resource: ['arn:aws:s3:::' + policyEditorBucket + '/*']\n }]\n });\n });\n\n document.querySelectorAll('.policy-btn').forEach(button => {\n button.addEventListener('click', function() {\n const bucketName = this.dataset.bucketName;\n policyEditorBucket = bucketName;\n bucketPolicyLoaded = false;\n // Deliberately not resetting bucketPolicyMutationInFlight\n // here: if a Save/Delete for a previously open bucket is\n // still in flight, Save/Delete for this bucket must stay\n // blocked until that request settles (its own completion\n // handler releases the flag once done, whether or not it's\n // still the active bucket by then) - otherwise this bucket's\n // mutation could race the abandoned one.\n registerPolicyEditor('bucket', { requirePrincipal: true, bucket: bucketName });\n if (!bucketPolicyEditorSetUp) {\n setupPolicyEditor('bucket');\n bucketPolicyEditorSetUp = true;\n }\n\n document.getElementById('bucketPolicyModalLabel').innerHTML =\n '<i class=\"bi bi-file-earmark-lock me-2\"></i>Bucket Policy - ' + escapeHtml(bucketName);\n document.getElementById('bucketPolicyLoading').style.display = '';\n document.getElementById('bucketPolicyError').style.display = 'none';\n document.getElementById('bucketPolicyEditorWrapper').style.display = 'none';\n\n policyModalInstance.show();\n\n // Drop responses that arrive after another bucket was opened\n const requestSeq = ++policyRequestSeq;\n fetch(basePath('/api/s3/buckets/' + encodeURIComponent(bucketName) + '/policy'))\n .then(parseLifecycleResponse)\n .then(({ ok, data }) => {\n if (requestSeq !== policyRequestSeq) return;\n document.getElementById('bucketPolicyLoading').style.display = 'none';\n if (!ok || data.error) {\n document.getElementById('bucketPolicyError').textContent =\n 'Error loading bucket policy: ' + (data.error || 'unknown error');\n document.getElementById('bucketPolicyError').style.display = '';\n return;\n }\n document.getElementById('bucketPolicyEditorWrapper').style.display = '';\n // policy_text carries stored bytes the server-side\n // decoder rejects; the JSON tab shows them so they\n // can be fixed or deleted.\n document.getElementById('bucketPolicyDocument').value =\n data.policy ? JSON.stringify(data.policy, null, 2) : (data.policy_text || '');\n bucketPolicyLoaded = true;\n loadPolicyTextareaIntoEditor('bucket');\n })\n .catch(error => {\n if (requestSeq !== policyRequestSeq) return;\n console.error('Error fetching bucket policy:', error);\n document.getElementById('bucketPolicyLoading').style.display = 'none';\n document.getElementById('bucketPolicyError').textContent =\n 'Error loading bucket policy: ' + error.message;\n document.getElementById('bucketPolicyError').style.display = '';\n });\n });\n });\n\n // Save the policy document currently shown (whichever tab is active).\n document.getElementById('bucketPolicySaveBtn').addEventListener('click', function() {\n if (!policyEditorBucket) return;\n if (bucketPolicyMutationInFlight) return;\n if (!bucketPolicyLoaded) {\n alert('The current policy has not finished loading. Close and reopen this dialog before saving.');\n return;\n }\n\n // Commit first: if the Editor tab is active, the textarea still\n // holds whatever was there at load time until this runs, so a\n // policy entered purely through the structured form (no tab\n // switch) would otherwise read back as empty here.\n if (!commitPolicyActiveTab('bucket')) return;\n\n const raw = document.getElementById('bucketPolicyDocument').value.trim();\n if (!raw || !policyTextHasStatements(raw)) {\n alert('Add at least one statement, or use Delete to remove the bucket policy.');\n return;\n }\n\n let policy;\n try {\n policy = JSON.parse(document.getElementById('bucketPolicyDocument').value);\n } catch (e) {\n alert('Invalid JSON: ' + e.message);\n return;\n }\n const validationError = validatePolicyEditorDoc('bucket', policy);\n if (validationError) {\n alert(validationError);\n return;\n }\n // The admin API decodes only Version and Statement, so warn\n // before other top-level fields are silently dropped - the IAM\n // policies page already does. (The S3 Tables dialogs don't:\n // their backend stores the document verbatim.)\n if (!confirmPolicyFieldDiscard('bucket')) return;\n\n // Captured now: if the dialog moves on to a different bucket\n // before this PUT resolves, the completion below must not hide\n // or reload over whatever that other bucket is now showing.\n const targetBucket = policyEditorBucket;\n setBucketPolicyMutationInFlight(true);\n fetch(basePath('/api/s3/buckets/' + encodeURIComponent(targetBucket) + '/policy'), {\n method: 'PUT',\n headers: csrfHeaders(),\n body: JSON.stringify({ policy: policy })\n })\n .then(parseLifecycleResponse)\n .then(({ ok, data }) => {\n setBucketPolicyMutationInFlight(false);\n const stillCurrent = targetBucket === policyEditorBucket;\n if (!ok || data.error) {\n if (stillCurrent) {\n alert('Error saving bucket policy: ' + (data.error || 'unknown error'));\n } else {\n console.error('Error saving policy for ' + targetBucket + ' (no longer the open bucket): ' + (data.error || 'unknown error'));\n }\n return;\n }\n if (!stillCurrent) return;\n if (policyModalInstance) {\n policyModalInstance.hide();\n }\n setTimeout(() => location.reload(), 500);\n })\n .catch(error => {\n setBucketPolicyMutationInFlight(false);\n console.error('Error:', error);\n if (targetBucket === policyEditorBucket) {\n alert('Error saving bucket policy: ' + error.message);\n }\n });\n });\n\n // Clear the bucket policy entirely.\n document.getElementById('bucketPolicyDeleteBtn').addEventListener('click', function() {\n if (!policyEditorBucket) return;\n if (bucketPolicyMutationInFlight) return;\n if (!bucketPolicyLoaded) {\n alert('The current policy has not finished loading. Close and reopen this dialog before deleting.');\n return;\n }\n if (!confirm('Delete the bucket policy for ' + policyEditorBucket + '? This cannot be undone.')) return;\n\n // Captured now: if the dialog moves on to a different bucket\n // before this DELETE resolves, the completion below must not\n // hide or reload over whatever that other bucket is now showing.\n const targetBucket = policyEditorBucket;\n setBucketPolicyMutationInFlight(true);\n fetch(basePath('/api/s3/buckets/' + encodeURIComponent(targetBucket) + '/policy'), {\n method: 'DELETE',\n headers: csrfHeaders()\n })\n .then(parseLifecycleResponse)\n .then(({ ok, data }) => {\n setBucketPolicyMutationInFlight(false);\n const stillCurrent = targetBucket === policyEditorBucket;\n if (!ok || data.error) {\n if (stillCurrent) {\n alert('Error deleting bucket policy: ' + (data.error || 'unknown error'));\n } else {\n console.error('Error deleting policy for ' + targetBucket + ' (no longer the open bucket): ' + (data.error || 'unknown error'));\n }\n return;\n }\n if (!stillCurrent) return;\n if (policyModalInstance) {\n policyModalInstance.hide();\n }\n setTimeout(() => location.reload(), 500);\n })\n .catch(error => {\n setBucketPolicyMutationInFlight(false);\n console.error('Error:', error);\n if (targetBucket === policyEditorBucket) {\n alert('Error deleting bucket policy: ' + error.message);\n }\n });\n });\n });\n\n function deleteBucket() {\n const bucketName = document.getElementById('deleteBucketModal').dataset.bucketName;\n if (!bucketName) return;\n\n fetch(basePath(`/api/s3/buckets/${bucketName}`), {\n method: 'DELETE'\n })\n .then(response => response.json())\n .then(data => {\n if (data.error) {\n alert('Error deleting bucket: ' + data.error);\n } else {\n alert('Bucket deleted successfully!');\n // Properly close the modal before reloading\n if (deleteModalInstance) {\n deleteModalInstance.hide();\n }\n setTimeout(() => location.reload(), 500);\n }\n })\n .catch(error => {\n console.error('Error:', error);\n alert('Error deleting bucket: ' + error.message);\n });\n }\n\nfunction displayBucketDetails(data) {\n const bucket = data.bucket;\n\n function formatDate(dateString) {\n const date = new Date(dateString);\n return date.toLocaleString();\n }\n\n let ownerHtml = '<span class=\"text-muted\">No owner (admin-only)</span>';\n if (bucket.owner) {\n ownerHtml = '<span class=\"badge bg-info\"><i class=\"bi bi-person me-1\"></i>' + escapeHtml(bucket.owner) + '</span>';\n }\n\n let usageHtml = '';\n if (bucket.physical_size > 0 && bucket.logical_size > 0 && bucket.physical_size > bucket.logical_size) {\n const overhead = (bucket.physical_size / bucket.logical_size).toFixed(1);\n usageHtml = '<br><small class=\"text-muted\">' + overhead + 'x overhead<\\/small>';\n }\n\n let quotaHtml = '<span class=\"badge bg-secondary\">Disabled</span>';\n if (bucket.quota_enabled) {\n quotaHtml = '<span class=\"badge bg-success\">' + formatBytes(bucket.quota) + '</span>';\n }\n\n let versioningHtml = '<span class=\"text-muted\">Not configured</span>';\n if (bucket.versioning_status === 'Enabled') {\n versioningHtml = '<span class=\"badge bg-success\"><i class=\"bi bi-check me-1\"></i>Enabled</span>';\n } else if (bucket.versioning_status === 'Suspended') {\n versioningHtml = '<span class=\"badge bg-warning\"><i class=\"bi bi-pause me-1\"></i>Suspended</span>';\n }\n\n let statusHtml = '<span class=\"badge bg-success\">Writable</span>';\n if (bucket.read_only) {\n statusHtml = '<span class=\"badge bg-danger\"><i class=\"bi bi-lock me-1\"></i>Read-only</span>';\n }\n\n let objectLockHtml = '<span class=\"text-muted\">Not configured</span>';\n if (bucket.object_lock_enabled) {\n let details = '';\n if (bucket.object_lock_mode && bucket.object_lock_duration > 0) {\n details = '<br><small class=\"text-muted\">' + escapeHtml(bucket.object_lock_mode) + ' • ' + bucket.object_lock_duration + ' days<\\/small>';\n }\n objectLockHtml = '<span class=\"badge bg-warning\"><i class=\"bi bi-lock me-1\"></i>Enabled</span>' + details;\n }\n\n let policyHtml = '<span class=\"text-muted\">Not configured</span>';\n if (bucket.policy_statement_count > 0) {\n const label = bucket.policy_statement_count === 1 ? '1 statement' : bucket.policy_statement_count + ' statements';\n policyHtml = '<span class=\"badge bg-primary\">' + label + '<\\/span>';\n }\n\n const rows = [\n '<div class=\"row\">',\n '<div class=\"col-md-6\">',\n '<h6><i class=\"bi bi-info-circle me-2\"></i>Bucket Information</h6>',\n '<table class=\"table table-sm\">',\n '<tr><td><strong>Name:</strong></td><td>' + escapeHtml(bucket.name) + '<\\/td><\\/tr>',\n '<tr><td><strong>Owner:</strong></td><td>' + ownerHtml + '<\\/td><\\/tr>',\n '<tr><td><strong>Created:</strong></td><td>' + formatDate(bucket.created_at) + '<\\/td><\\/tr>',\n '<tr><td><strong>Last Modified:</strong></td><td>' + formatDate(bucket.last_modified) + '<\\/td><\\/tr>',\n '<tr><td><strong>Logical Size:</strong></td><td>' + formatBytes(bucket.logical_size) + '<\\/td><\\/tr>',\n '<tr><td><strong>Physical Size:</strong></td><td>' + formatBytes(bucket.physical_size) + usageHtml + '<\\/td><\\/tr>',\n '<\\/table>',\n '<\\/div>',\n '<div class=\"col-md-6\">',\n '<h6><i class=\"bi bi-gear-wide-connected me-2\"></i>Configuration</h6>',\n '<table class=\"table table-sm\">',\n '<tr><td><strong>Status:</strong></td><td>' + statusHtml + '<\\/td><\\/tr>',\n '<tr><td><strong>Quota:</strong></td><td>' + quotaHtml + '<\\/td><\\/tr>',\n '<tr><td><strong>Versioning:</strong></td><td>' + versioningHtml + '<\\/td><\\/tr>',\n '<tr><td><strong>Object Lock:</strong></td><td>' + objectLockHtml + '<\\/td><\\/tr>',\n '<tr><td><strong>Policy:</strong></td><td>' + policyHtml + '<\\/td><\\/tr>',\n '<\\/table>',\n '<\\/div>',\n '<\\/div>'\n ];\n\n document.getElementById('bucketDetailsContent').innerHTML = rows.join('');\n}\n\n// displayBucketLifecycle loads the GET response into the local working copy\n// and renders the editor. Nothing is sent back to the server until Save or\n// Delete all rules is clicked.\nfunction displayBucketLifecycle(data) {\n lifecycleEditor.bucket = data.bucket || lifecycleEditor.bucket;\n lifecycleEditor.rules = (data.rules || []).map(cloneLifecycleRule);\n lifecycleEditor.editingIndex = null;\n lifecycleEditor.editingRule = null;\n lifecycleEditor.rawXml = data.xml || '';\n // SeaweedFS doesn't support Transition rules (PutBucketLifecycleConfiguration\n // rejects them for Enabled rules), and the canonical rule shape the admin\n // edits has no field for one, so a Transition set by another client would\n // silently disappear on the next Save. Warn instead.\n // Matches <Transition> and <NoncurrentVersionTransition> however they are\n // spelled: with attributes, self-closed, or namespace-prefixed.\n lifecycleEditor.hasTransition = /<(\\w+:)?(NoncurrentVersion)?Transition[\\s>\\/]/.test(data.xml || '');\n renderLifecycleEditor();\n}\n\n// normalizeLifecycleStatus maps a stored status onto the two the editor can\n// show. The S3 API stores <Status> unvalidated, and the engine runs a rule\n// only on an exact \"Enabled\", so everything else is Disabled - collapsing it\n// here keeps an odd spelling from leaving both radios unchecked, which would\n// throw out of readLifecycleRuleFromForm and make the modal look dead.\nfunction normalizeLifecycleStatus(status) {\n return status === 'Enabled' ? 'Enabled' : 'Disabled';\n}\n\nfunction cloneLifecycleRule(r) {\n return {\n id: r.id || '',\n status: normalizeLifecycleStatus(r.status),\n prefix: r.prefix || '',\n tags: Object.assign({}, r.tags || {}),\n size_greater_than: r.size_greater_than || null,\n size_less_than: r.size_less_than || null,\n expiration_days: r.expiration_days || null,\n expiration_date: r.expiration_date || '',\n expired_object_delete_marker: !!r.expired_object_delete_marker,\n noncurrent_version_expiration_days: r.noncurrent_version_expiration_days || null,\n newer_noncurrent_versions: r.newer_noncurrent_versions || null,\n abort_multipart_days: r.abort_multipart_days || null,\n };\n}\n\nfunction blankLifecycleRule() {\n return {\n id: '', status: 'Enabled', prefix: '', tags: {},\n size_greater_than: null, size_less_than: null,\n expiration_days: null, expiration_date: '',\n expired_object_delete_marker: false,\n noncurrent_version_expiration_days: null, newer_noncurrent_versions: null,\n abort_multipart_days: null,\n };\n}\n\nfunction describeLifecycleScope(rule) {\n const parts = [];\n if (rule.prefix) {\n parts.push('<code>' + escapeHtml(rule.prefix) + '<\\/code>');\n }\n Object.entries(rule.tags || {}).forEach(([k, v]) => {\n parts.push('<span class=\"badge bg-light text-dark border\">' + escapeHtml(k) + '=' + escapeHtml(v) + '<\\/span>');\n });\n if (rule.size_greater_than) {\n parts.push('size &gt; ' + formatBytes(rule.size_greater_than));\n }\n if (rule.size_less_than) {\n parts.push('size &lt; ' + formatBytes(rule.size_less_than));\n }\n return parts.length ? parts.join(' ') : '<span class=\"text-muted\">Whole bucket<\\/span>';\n}\n\nfunction describeLifecycleActions(rule) {\n const actions = [];\n if (rule.expiration_days) {\n actions.push('Expire after ' + formatDays(rule.expiration_days));\n }\n if (rule.expiration_date) {\n actions.push('Expire on ' + escapeHtml(rule.expiration_date));\n }\n if (rule.expired_object_delete_marker) {\n actions.push('Remove expired object delete markers');\n }\n if (rule.noncurrent_version_expiration_days) {\n let action = 'Expire noncurrent versions after ' + formatDays(rule.noncurrent_version_expiration_days);\n if (rule.newer_noncurrent_versions) {\n action += ', keep ' + rule.newer_noncurrent_versions + ' newest';\n }\n actions.push(action);\n } else if (rule.newer_noncurrent_versions) {\n // Standalone (no expiration_days): the engine still recognizes this\n // as an action that expires noncurrent versions beyond the N newest.\n actions.push('Keep ' + rule.newer_noncurrent_versions + ' newest noncurrent versions');\n }\n if (rule.abort_multipart_days) {\n actions.push('Abort incomplete multipart uploads after ' + formatDays(rule.abort_multipart_days));\n }\n if (actions.length === 0) {\n return '<span class=\"text-muted\">None<\\/span>';\n }\n return actions.join('<br>');\n}\n\nfunction lifecycleRuleRowHtml(rule, idx) {\n const statusHtml = rule.status === 'Enabled'\n ? '<span class=\"badge bg-success\">Enabled<\\/span>'\n : '<span class=\"badge bg-secondary\">' + escapeHtml(rule.status) + '<\\/span>';\n return '<tr>' +\n '<td>' + (rule.id ? escapeHtml(rule.id) : '<span class=\"text-muted\">unnamed<\\/span>') + '<\\/td>' +\n '<td>' + statusHtml + '<\\/td>' +\n '<td>' + describeLifecycleScope(rule) + '<\\/td>' +\n '<td>' + describeLifecycleActions(rule) + '<\\/td>' +\n '<td class=\"text-end text-nowrap\">' +\n '<button type=\"button\" class=\"btn btn-sm btn-outline-secondary lifecycle-edit-rule-btn\" data-index=\"' + idx + '\" title=\"Edit rule\"><i class=\"bi bi-pen\"><\\/i><\\/button> ' +\n '<button type=\"button\" class=\"btn btn-sm btn-outline-danger lifecycle-delete-rule-btn\" data-index=\"' + idx + '\" title=\"Delete rule\"><i class=\"bi bi-trash\"><\\/i><\\/button>' +\n '<\\/td>' +\n '<\\/tr>';\n}\n\nfunction lifecycleRuleFormHtml() {\n const rule = lifecycleEditor.editingRule;\n const tagRowHtml = (k, v) =>\n '<div class=\"input-group input-group-sm mb-1 lifecycle-tag-row\">' +\n '<input type=\"text\" class=\"form-control lifecycle-tag-key\" placeholder=\"Key\" value=\"' + escapeHtml(k) + '\">' +\n '<input type=\"text\" class=\"form-control lifecycle-tag-value\" placeholder=\"Value\" value=\"' + escapeHtml(v) + '\">' +\n '<button type=\"button\" class=\"btn btn-outline-danger lifecycle-remove-tag-btn\"><i class=\"bi bi-x\"><\\/i><\\/button>' +\n '<\\/div>';\n const tagRows = Object.entries(rule.tags || {}).map(([k, v]) => tagRowHtml(k, v)).join('');\n\n return '' +\n '<div class=\"card mb-3\" id=\"lifecycleRuleForm\">' +\n '<div class=\"card-body\">' +\n '<h6 class=\"card-title\">' + (lifecycleEditor.editingIndex === 'new' ? 'Add rule' : 'Edit rule') + '<\\/h6>' +\n\n '<div class=\"row g-2 mb-2\">' +\n '<div class=\"col-md-6\">' +\n '<label class=\"form-label small\">ID (optional)<\\/label>' +\n '<input type=\"text\" class=\"form-control form-control-sm\" id=\"lifecycleRuleId\" value=\"' + escapeHtml(rule.id) + '\">' +\n '<\\/div>' +\n '<div class=\"col-md-6\">' +\n '<label class=\"form-label small d-block\">Status<\\/label>' +\n '<div class=\"form-check form-check-inline\">' +\n '<input class=\"form-check-input\" type=\"radio\" name=\"lifecycleRuleStatus\" id=\"lifecycleStatusEnabled\" value=\"Enabled\"' + (rule.status === 'Enabled' ? ' checked' : '') + '>' +\n '<label class=\"form-check-label\" for=\"lifecycleStatusEnabled\">Enabled<\\/label>' +\n '<\\/div>' +\n '<div class=\"form-check form-check-inline\">' +\n '<input class=\"form-check-input\" type=\"radio\" name=\"lifecycleRuleStatus\" id=\"lifecycleStatusDisabled\" value=\"Disabled\"' + (rule.status === 'Disabled' ? ' checked' : '') + '>' +\n '<label class=\"form-check-label\" for=\"lifecycleStatusDisabled\">Disabled<\\/label>' +\n '<\\/div>' +\n '<\\/div>' +\n '<\\/div>' +\n\n '<div class=\"mb-2\">' +\n '<label class=\"form-label small\">Prefix<\\/label>' +\n '<input type=\"text\" class=\"form-control form-control-sm\" id=\"lifecycleRulePrefix\" placeholder=\"logs/\" value=\"' + escapeHtml(rule.prefix) + '\">' +\n '<\\/div>' +\n\n '<div class=\"mb-2\">' +\n '<label class=\"form-label small d-block\">Tags<\\/label>' +\n '<div id=\"lifecycleTagRows\">' + tagRows + '<\\/div>' +\n '<button type=\"button\" class=\"btn btn-sm btn-outline-secondary\" id=\"lifecycleAddTagBtn\"><i class=\"bi bi-plus me-1\"><\\/i>Add tag<\\/button>' +\n '<\\/div>' +\n\n '<div class=\"row g-2 mb-3\">' +\n '<div class=\"col-md-6\">' +\n '<label class=\"form-label small\">Size greater than (bytes)<\\/label>' +\n '<input type=\"number\" class=\"form-control form-control-sm\" id=\"lifecycleRuleSizeGT\" min=\"0\" step=\"1\" value=\"' + (rule.size_greater_than || '') + '\">' +\n '<\\/div>' +\n '<div class=\"col-md-6\">' +\n '<label class=\"form-label small\">Size less than (bytes)<\\/label>' +\n '<input type=\"number\" class=\"form-control form-control-sm\" id=\"lifecycleRuleSizeLT\" min=\"0\" step=\"1\" value=\"' + (rule.size_less_than || '') + '\">' +\n '<\\/div>' +\n '<\\/div>' +\n\n '<hr>' +\n '<h6 class=\"small text-muted text-uppercase\">Actions<\\/h6>' +\n\n '<div class=\"row g-2 align-items-center mb-2\">' +\n '<div class=\"col-auto\">' +\n '<div class=\"form-check\">' +\n '<input class=\"form-check-input\" type=\"checkbox\" id=\"lifecycleExpireDaysEnabled\"' + (rule.expiration_days ? ' checked' : '') + '>' +\n '<label class=\"form-check-label\" for=\"lifecycleExpireDaysEnabled\">Expire after<\\/label>' +\n '<\\/div>' +\n '<\\/div>' +\n '<div class=\"col-auto\">' +\n '<input type=\"number\" class=\"form-control form-control-sm\" id=\"lifecycleExpireDays\" min=\"1\" step=\"1\" style=\"width: 6rem;\" value=\"' + (rule.expiration_days || '') + '\"' + (rule.expiration_days ? '' : ' disabled') + '>' +\n '<\\/div><div class=\"col-auto\">days<\\/div>' +\n '<\\/div>' +\n\n '<div class=\"row g-2 align-items-center mb-2\">' +\n '<div class=\"col-auto\">' +\n '<div class=\"form-check\">' +\n '<input class=\"form-check-input\" type=\"checkbox\" id=\"lifecycleExpireDateEnabled\"' + (rule.expiration_date ? ' checked' : '') + '>' +\n '<label class=\"form-check-label\" for=\"lifecycleExpireDateEnabled\">Expire on date<\\/label>' +\n '<\\/div>' +\n '<\\/div>' +\n '<div class=\"col-auto\">' +\n '<input type=\"date\" class=\"form-control form-control-sm\" id=\"lifecycleExpireDate\" value=\"' + escapeHtml(rule.expiration_date) + '\"' + (rule.expiration_date ? '' : ' disabled') + '>' +\n '<\\/div>' +\n '<\\/div>' +\n\n '<div class=\"form-check mb-2\">' +\n '<input class=\"form-check-input\" type=\"checkbox\" id=\"lifecycleDeleteMarker\"' + (rule.expired_object_delete_marker ? ' checked' : '') + '>' +\n '<label class=\"form-check-label\" for=\"lifecycleDeleteMarker\">Remove expired object delete markers<\\/label>' +\n '<\\/div>' +\n\n (() => {\n const noncurrentActive = !!(rule.noncurrent_version_expiration_days || rule.newer_noncurrent_versions);\n return '<div class=\"row g-2 align-items-center mb-2\">' +\n '<div class=\"col-auto\">' +\n '<div class=\"form-check\">' +\n '<input class=\"form-check-input\" type=\"checkbox\" id=\"lifecycleNoncurrentEnabled\"' + (noncurrentActive ? ' checked' : '') + '>' +\n '<label class=\"form-check-label\" for=\"lifecycleNoncurrentEnabled\">Limit noncurrent versions<\\/label>' +\n '<\\/div>' +\n '<\\/div>' +\n '<div class=\"col-auto\">after<\\/div>' +\n '<div class=\"col-auto\">' +\n '<input type=\"number\" class=\"form-control form-control-sm\" id=\"lifecycleNoncurrentDays\" min=\"1\" step=\"1\" style=\"width: 6rem;\" value=\"' + (rule.noncurrent_version_expiration_days || '') + '\"' + (noncurrentActive ? '' : ' disabled') + '>' +\n '<\\/div><div class=\"col-auto\">days (optional), keep<\\/div>' +\n '<div class=\"col-auto\">' +\n '<input type=\"number\" class=\"form-control form-control-sm\" id=\"lifecycleNoncurrentKeep\" min=\"0\" step=\"1\" style=\"width: 6rem;\" value=\"' + (rule.newer_noncurrent_versions || '') + '\"' + (noncurrentActive ? '' : ' disabled') + '>' +\n '<\\/div><div class=\"col-auto\">newest (optional)<\\/div>' +\n '<\\/div>';\n })() +\n\n '<div class=\"row g-2 align-items-center mb-3\">' +\n '<div class=\"col-auto\">' +\n '<div class=\"form-check\">' +\n '<input class=\"form-check-input\" type=\"checkbox\" id=\"lifecycleAbortMPUEnabled\"' + (rule.abort_multipart_days ? ' checked' : '') + '>' +\n '<label class=\"form-check-label\" for=\"lifecycleAbortMPUEnabled\">Abort incomplete multipart uploads after<\\/label>' +\n '<\\/div>' +\n '<\\/div>' +\n '<div class=\"col-auto\">' +\n '<input type=\"number\" class=\"form-control form-control-sm\" id=\"lifecycleAbortMPUDays\" min=\"1\" step=\"1\" style=\"width: 6rem;\" value=\"' + (rule.abort_multipart_days || '') + '\"' + (rule.abort_multipart_days ? '' : ' disabled') + '>' +\n '<\\/div><div class=\"col-auto\">days<\\/div>' +\n '<\\/div>' +\n\n '<div class=\"text-end\">' +\n '<button type=\"button\" class=\"btn btn-sm btn-secondary\" id=\"lifecycleCancelRuleBtn\">Cancel<\\/button> ' +\n '<button type=\"button\" class=\"btn btn-sm btn-primary\" id=\"lifecycleSaveRuleBtn\">Save rule<\\/button>' +\n '<\\/div>' +\n '<\\/div>' +\n '<\\/div>';\n}\n\nfunction renderLifecycleEditor() {\n const container = document.getElementById('bucketLifecycleContent');\n const rowsHtml = lifecycleEditor.rules.map(lifecycleRuleRowHtml).join('') ||\n '<tr><td colspan=\"5\" class=\"text-center text-muted py-3\">No lifecycle rules<\\/td><\\/tr>';\n\n let html = '';\n if (lifecycleEditor.hasTransition) {\n html += '<div class=\"alert alert-warning small\">' +\n '<i class=\"bi bi-exclamation-triangle me-1\"><\\/i>' +\n 'This bucket has a Transition rule set outside the admin (SeaweedFS does not support storage class transitions). Saving from here will drop it.' +\n '<\\/div>';\n }\n\n html += '<div class=\"table-responsive mb-3\">' +\n '<table class=\"table table-sm align-middle\">' +\n '<thead><tr><th>Rule<\\/th><th>Status<\\/th><th>Scope<\\/th><th>Actions<\\/th><th><\\/th><\\/tr><\\/thead>' +\n '<tbody>' + rowsHtml + '<\\/tbody>' +\n '<\\/table>' +\n '<\\/div>' +\n '<button type=\"button\" class=\"btn btn-sm btn-outline-primary mb-3\" id=\"lifecycleAddRuleBtn\">' +\n '<i class=\"bi bi-plus me-1\"><\\/i>Add rule' +\n '<\\/button>';\n\n if (lifecycleEditor.editingIndex !== null) {\n html += lifecycleRuleFormHtml();\n }\n\n if (lifecycleEditor.rawXml) {\n html += '<details class=\"mt-2\">' +\n '<summary class=\"text-muted small\">Raw XML (as currently stored)<\\/summary>' +\n '<pre class=\"bg-light border rounded p-2 mt-2 small mb-0\">' + escapeHtml(lifecycleEditor.rawXml) + '<\\/pre>' +\n '<\\/details>';\n }\n\n container.innerHTML = html;\n bindLifecycleEditorEvents();\n}\n\nfunction bindLifecycleToggle(checkboxId, fieldId, mutuallyExclusiveId) {\n const checkbox = document.getElementById(checkboxId);\n const field = document.getElementById(fieldId);\n if (!checkbox || !field) return;\n checkbox.addEventListener('change', function() {\n field.disabled = !this.checked;\n if (this.checked && mutuallyExclusiveId) {\n const other = document.getElementById(mutuallyExclusiveId);\n if (other && other.checked) {\n other.checked = false;\n other.dispatchEvent(new Event('change'));\n }\n }\n });\n}\n\nfunction bindLifecycleEditorEvents() {\n const addBtn = document.getElementById('lifecycleAddRuleBtn');\n if (addBtn) {\n addBtn.addEventListener('click', function() {\n // Fold in any rule already being edited before switching forms,\n // so an invalid in-progress draft isn't silently discarded.\n if (!commitOpenLifecycleRuleForm()) return;\n lifecycleEditor.editingIndex = 'new';\n lifecycleEditor.editingRule = blankLifecycleRule();\n renderLifecycleEditor();\n });\n }\n\n document.querySelectorAll('.lifecycle-edit-rule-btn').forEach(btn => {\n btn.addEventListener('click', function() {\n const idx = parseInt(this.dataset.index, 10);\n // Same as above: committing never shifts indices (it either\n // pushes a new rule at the end or replaces one in place), so\n // idx captured above is still valid after this call.\n if (!commitOpenLifecycleRuleForm()) return;\n lifecycleEditor.editingIndex = idx;\n lifecycleEditor.editingRule = cloneLifecycleRule(lifecycleEditor.rules[idx]);\n renderLifecycleEditor();\n });\n });\n\n document.querySelectorAll('.lifecycle-delete-rule-btn').forEach(btn => {\n btn.addEventListener('click', function() {\n const idx = parseInt(this.dataset.index, 10);\n // Fold in an open form first, like every other transition does:\n // re-rendering after the splice would otherwise redraw it from the\n // snapshot taken when editing began and lose what was typed.\n if (lifecycleEditor.editingIndex !== null && lifecycleEditor.editingIndex !== idx) {\n if (!commitOpenLifecycleRuleForm()) return;\n }\n lifecycleEditor.rules.splice(idx, 1);\n // Deleting a rule shifts every later index down by one, so an\n // open edit form must follow its rule rather than silently\n // start targeting whatever now sits at its old index.\n if (lifecycleEditor.editingIndex === idx) {\n lifecycleEditor.editingIndex = null;\n lifecycleEditor.editingRule = null;\n } else if (typeof lifecycleEditor.editingIndex === 'number' && lifecycleEditor.editingIndex > idx) {\n lifecycleEditor.editingIndex -= 1;\n }\n renderLifecycleEditor();\n });\n });\n\n const cancelBtn = document.getElementById('lifecycleCancelRuleBtn');\n if (cancelBtn) {\n cancelBtn.addEventListener('click', function() {\n lifecycleEditor.editingIndex = null;\n lifecycleEditor.editingRule = null;\n renderLifecycleEditor();\n });\n }\n\n const addTagBtn = document.getElementById('lifecycleAddTagBtn');\n if (addTagBtn) {\n addTagBtn.addEventListener('click', function() {\n const rows = document.getElementById('lifecycleTagRows');\n const row = document.createElement('div');\n row.className = 'input-group input-group-sm mb-1 lifecycle-tag-row';\n row.innerHTML =\n '<input type=\"text\" class=\"form-control lifecycle-tag-key\" placeholder=\"Key\">' +\n '<input type=\"text\" class=\"form-control lifecycle-tag-value\" placeholder=\"Value\">' +\n '<button type=\"button\" class=\"btn btn-outline-danger lifecycle-remove-tag-btn\"><i class=\"bi bi-x\"><\\/i><\\/button>';\n rows.appendChild(row);\n row.querySelector('.lifecycle-remove-tag-btn').addEventListener('click', function() {\n row.remove();\n });\n });\n }\n\n document.querySelectorAll('.lifecycle-remove-tag-btn').forEach(btn => {\n btn.addEventListener('click', function() {\n this.closest('.lifecycle-tag-row').remove();\n });\n });\n\n bindLifecycleToggle('lifecycleExpireDaysEnabled', 'lifecycleExpireDays', 'lifecycleExpireDateEnabled');\n bindLifecycleToggle('lifecycleExpireDateEnabled', 'lifecycleExpireDate', 'lifecycleExpireDaysEnabled');\n bindLifecycleToggle('lifecycleNoncurrentEnabled', 'lifecycleNoncurrentDays');\n bindLifecycleToggle('lifecycleNoncurrentEnabled', 'lifecycleNoncurrentKeep');\n bindLifecycleToggle('lifecycleAbortMPUEnabled', 'lifecycleAbortMPUDays');\n\n const saveRuleBtn = document.getElementById('lifecycleSaveRuleBtn');\n if (saveRuleBtn) {\n saveRuleBtn.addEventListener('click', saveLifecycleRuleFromForm);\n }\n}\n\n// readLifecycleRuleFromForm builds and validates a rule from the currently\n// open edit form's DOM inputs. Returns { rule: null, error: '...' } when the\n// form doesn't hold a valid rule, without mutating any state.\nfunction readLifecycleRuleFromForm() {\n const id = document.getElementById('lifecycleRuleId').value.trim();\n const status = document.querySelector('input[name=\"lifecycleRuleStatus\"]:checked').value;\n const prefix = document.getElementById('lifecycleRulePrefix').value.trim();\n\n const tags = {};\n document.querySelectorAll('#lifecycleTagRows .lifecycle-tag-row').forEach(row => {\n const key = row.querySelector('.lifecycle-tag-key').value.trim();\n const value = row.querySelector('.lifecycle-tag-value').value.trim();\n if (key) {\n tags[key] = value;\n }\n });\n\n const sizeGT = parseInt(document.getElementById('lifecycleRuleSizeGT').value, 10) || 0;\n const sizeLT = parseInt(document.getElementById('lifecycleRuleSizeLT').value, 10) || 0;\n\n const expireDaysEnabled = document.getElementById('lifecycleExpireDaysEnabled').checked;\n const expireDateEnabled = document.getElementById('lifecycleExpireDateEnabled').checked;\n const expirationDays = expireDaysEnabled ? (parseInt(document.getElementById('lifecycleExpireDays').value, 10) || 0) : 0;\n const expirationDate = expireDateEnabled ? document.getElementById('lifecycleExpireDate').value : '';\n\n const deleteMarker = document.getElementById('lifecycleDeleteMarker').checked;\n\n const noncurrentEnabled = document.getElementById('lifecycleNoncurrentEnabled').checked;\n const noncurrentDays = noncurrentEnabled ? (parseInt(document.getElementById('lifecycleNoncurrentDays').value, 10) || 0) : 0;\n const noncurrentKeep = noncurrentEnabled ? (parseInt(document.getElementById('lifecycleNoncurrentKeep').value, 10) || 0) : 0;\n\n const abortEnabled = document.getElementById('lifecycleAbortMPUEnabled').checked;\n const abortDays = abortEnabled ? (parseInt(document.getElementById('lifecycleAbortMPUDays').value, 10) || 0) : 0;\n\n if (expireDaysEnabled && expirationDays <= 0) {\n return { rule: null, error: 'Enter a valid number of days for expiration.' };\n }\n if (expireDateEnabled && !expirationDate) {\n return { rule: null, error: 'Enter a valid expiration date.' };\n }\n if (noncurrentEnabled && noncurrentDays <= 0 && noncurrentKeep <= 0) {\n return { rule: null, error: 'Enter a number of days and/or a newest-versions-to-keep count for noncurrent version handling.' };\n }\n if (abortEnabled && abortDays <= 0) {\n return { rule: null, error: 'Enter a valid number of days for aborting incomplete multipart uploads.' };\n }\n if (!expireDaysEnabled && !expireDateEnabled && !deleteMarker && !noncurrentEnabled && !abortEnabled) {\n return { rule: null, error: 'Select at least one action for this rule.' };\n }\n // The server rejects this combination too; catching it here names the two\n // fields instead of surfacing a 400 after the whole set is submitted.\n if (deleteMarker && (expireDaysEnabled || expireDateEnabled)) {\n return { rule: null, error: 'Removing expired object delete markers cannot be combined with an expiration.' };\n }\n if (sizeGT > 0 && sizeLT > 0 && sizeGT >= sizeLT) {\n return { rule: null, error: '\"Size greater than\" must be less than \"size less than\".' };\n }\n\n return {\n rule: {\n id: id,\n status: status,\n prefix: prefix,\n tags: tags,\n size_greater_than: sizeGT > 0 ? sizeGT : null,\n size_less_than: sizeLT > 0 ? sizeLT : null,\n expiration_days: expirationDays > 0 ? expirationDays : null,\n expiration_date: expirationDate || '',\n expired_object_delete_marker: deleteMarker,\n noncurrent_version_expiration_days: noncurrentDays > 0 ? noncurrentDays : null,\n newer_noncurrent_versions: noncurrentKeep > 0 ? noncurrentKeep : null,\n abort_multipart_days: abortDays > 0 ? abortDays : null,\n },\n error: null,\n };\n}\n\nfunction saveLifecycleRuleFromForm() {\n const { rule, error } = readLifecycleRuleFromForm();\n if (error) {\n alert(error);\n return;\n }\n\n if (lifecycleEditor.editingIndex === 'new') {\n lifecycleEditor.rules.push(rule);\n } else {\n lifecycleEditor.rules[lifecycleEditor.editingIndex] = rule;\n }\n lifecycleEditor.editingIndex = null;\n lifecycleEditor.editingRule = null;\n renderLifecycleEditor();\n}\n\n// commitOpenLifecycleRuleForm folds an in-progress add/edit form into\n// lifecycleEditor.rules before the whole rule set is sent to the server, so\n// clicking the modal's \"Save\" without first clicking \"Save rule\" doesn't\n// silently drop the open edit. Returns false (and leaves the form open) when\n// the open form doesn't hold a valid rule, so the caller can abort the save.\nfunction commitOpenLifecycleRuleForm() {\n if (lifecycleEditor.editingIndex === null) {\n return true;\n }\n\n const { rule, error } = readLifecycleRuleFromForm();\n if (error) {\n alert(error);\n return false;\n }\n\n if (lifecycleEditor.editingIndex === 'new') {\n lifecycleEditor.rules.push(rule);\n } else {\n lifecycleEditor.rules[lifecycleEditor.editingIndex] = rule;\n }\n lifecycleEditor.editingIndex = null;\n lifecycleEditor.editingRule = null;\n renderLifecycleEditor();\n return true;\n}\n\n function goToPage(page) {\n const url = new URL(window.location);\n url.searchParams.set('page', page);\n window.location.href = url.toString();\n }\n\n function changePageSize() {\n const pageSize = document.getElementById('pageSizeSelect').value;\n const url = new URL(window.location);\n url.searchParams.set('pageSize', pageSize);\n url.searchParams.set('page', '1');\n window.location.href = url.toString();\n }\n\n function sortTable(column) {\n const url = new URL(window.location);\n const currentSort = url.searchParams.get('sortBy');\n const currentOrder = url.searchParams.get('sortOrder') || 'asc';\n\n let newOrder = 'asc';\n if (currentSort === column && currentOrder === 'asc') {\n newOrder = 'desc';\n }\n\n url.searchParams.set('sortBy', column);\n url.searchParams.set('sortOrder', newOrder);\n url.searchParams.set('page', '1');\n window.location.href = url.toString();\n }\n\n function exportBucketList() {\n // RFC 4180 compliant CSV escaping: escape double quotes by doubling them\n function escapeCsvField(value) {\n const str = String(value ?? '');\n if (str.includes(',') || str.includes('\"') || str.includes('\\n') || str.includes('\\r')) {\n return '\"' + str.replace(/\"/g, '\"\"') + '\"';\n }\n return '\"' + str + '\"';\n }\n\n // Fetch all buckets from the API (not just the current page)\n fetch(basePath('/api/s3/buckets'))\n .then(response => response.json())\n .then(data => {\n if (data.error) {\n alert('Error exporting buckets: ' + data.error);\n return;\n }\n\n const buckets = data.buckets || [];\n const csvContent = \"data:text/csv;charset=utf-8,\" +\n \"Name,Owner,Logical Size,Physical Size,Created,Quota,Versioning,Object Lock\\n\" +\n buckets.map(b => [\n escapeCsvField(b.name),\n escapeCsvField(b.owner),\n escapeCsvField(formatBytes(b.logical_size)),\n escapeCsvField(formatBytes(b.physical_size)),\n escapeCsvField(b.created_at),\n escapeCsvField(b.quota_enabled ? formatBytes(b.quota) : 'No quota'),\n escapeCsvField(b.versioning_status || 'Not configured'),\n escapeCsvField(b.object_lock_enabled ? 'Enabled' : 'Not configured')\n ].join(',')).join(\"\\n\");\n\n const encodedUri = encodeURI(csvContent);\n const link = document.createElement(\"a\");\n link.setAttribute(\"href\", encodedUri);\n link.setAttribute(\"download\", \"buckets.csv\");\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n })\n .catch(error => {\n console.error('Error:', error);\n alert('Error exporting buckets: ' + error.message);\n });\n }\n </script>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 94, "<!-- Bucket Policy Modal --><div class=\"modal fade\" id=\"bucketPolicyModal\" tabindex=\"-1\" aria-labelledby=\"bucketPolicyModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog modal-xl\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"bucketPolicyModalLabel\"><i class=\"bi bi-file-earmark-lock me-2\"></i>Bucket Policy</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><div class=\"modal-body\"><div id=\"bucketPolicyLoading\" class=\"text-center py-4\"><div class=\"spinner-border text-primary\" role=\"status\"><span class=\"visually-hidden\">Loading...</span></div><div class=\"mt-2\">Loading bucket policy...</div></div><div id=\"bucketPolicyError\" class=\"alert alert-danger\" style=\"display: none;\"></div><div id=\"bucketPolicyEditorWrapper\" style=\"display: none;\"><p class=\"text-muted small\">Every statement must specify a Principal, and every Resource must refer to this bucket. Leave the document empty and click Delete to remove the policy.</p><ul class=\"nav nav-tabs\" role=\"tablist\"><li class=\"nav-item\" role=\"presentation\"><button class=\"nav-link active\" id=\"bucketPolicyEditorTabBtn\" type=\"button\" data-bs-toggle=\"tab\" data-bs-target=\"#bucketPolicyEditorTab\" role=\"tab\" aria-controls=\"bucketPolicyEditorTab\" aria-selected=\"true\">Editor</button></li><li class=\"nav-item\" role=\"presentation\"><button class=\"nav-link\" id=\"bucketPolicyJsonTabBtn\" type=\"button\" data-bs-toggle=\"tab\" data-bs-target=\"#bucketPolicyJsonTab\" role=\"tab\" aria-controls=\"bucketPolicyJsonTab\" aria-selected=\"false\">JSON</button></li></ul><div class=\"tab-content border border-top-0 rounded-bottom p-3 mb-3\"><div class=\"tab-pane fade show active\" id=\"bucketPolicyEditorTab\" role=\"tabpanel\" aria-labelledby=\"bucketPolicyEditorTabBtn\"><div id=\"bucketPolicyEditorBody\"></div><button type=\"button\" class=\"btn btn-sm btn-outline-secondary\" id=\"bucketPolicyAddStatementBtn\"><i class=\"bi bi-plus me-1\"></i>Add statement</button></div><div class=\"tab-pane fade\" id=\"bucketPolicyJsonTab\" role=\"tabpanel\" aria-labelledby=\"bucketPolicyJsonTabBtn\"><textarea class=\"form-control\" id=\"bucketPolicyDocument\" rows=\"15\" style=\"font-family: monospace;\" spellcheck=\"false\" placeholder='{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"s3:GetObject\",\"Resource\":\"arn:aws:s3:::bucket-name/*\"}]}'></textarea><div class=\"form-text\">Enter the bucket policy document as JSON</div></div></div><div class=\"mb-3\"><button type=\"button\" class=\"btn btn-outline-info btn-sm\" id=\"bucketPolicyInsertSampleBtn\"><i class=\"bi bi-file-earmark-text me-1\"></i>Use Sample Policy</button></div></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-outline-danger me-auto\" id=\"bucketPolicyDeleteBtn\"><i class=\"bi bi-trash me-1\"></i>Delete</button> <button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-primary\" id=\"bucketPolicySaveBtn\"><i class=\"bi bi-floppy me-1\"></i>Save</button></div></div></div></div><!-- Manage Owner Modal --><div class=\"modal fade\" id=\"manageOwnerModal\" tabindex=\"-1\" aria-labelledby=\"manageOwnerModalLabel\" aria-hidden=\"true\"><div class=\"modal-dialog\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\" id=\"manageOwnerModalLabel\"><i class=\"bi bi-person-gear me-2\"></i>Manage Bucket Owner</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button></div><form id=\"ownerForm\"><div class=\"modal-body\"><div class=\"mb-3\"><label class=\"form-label\">Bucket Name</label> <input type=\"text\" class=\"form-control\" id=\"ownerBucketName\" readonly></div><div class=\"mb-3\"><label for=\"bucketOwnerSelect\" class=\"form-label\">Owner</label> <select class=\"form-select\" id=\"bucketOwnerSelect\" name=\"owner\"><option value=\"\">No owner (admin-only access)</option><!-- Options will be populated dynamically --></select><div class=\"form-text\">Select the S3 identity that owns this bucket. Non-admin users can only access buckets they own.</div></div><div id=\"ownerLoadingSpinner\" class=\"text-center py-2\" style=\"display: none;\"><div class=\"spinner-border spinner-border-sm text-primary\" role=\"status\"><span class=\"visually-hidden\">Loading users...</span></div><span class=\"ms-2\">Loading users...</span></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"submit\" class=\"btn btn-info\"><i class=\"bi bi-floppy me-1\"></i>Update Owner</button></div></form></div></div></div><!-- JavaScript for bucket management --><script>\n // Global state (shared between DOMContentLoaded handlers and global functions)\n let deleteModalInstance = null;\n let quotaModalInstance = null;\n let ownerModalInstance = null;\n let detailsModalInstance = null;\n let lifecycleModalInstance = null;\n let lifecycleRequestSeq = 0;\n let policyModalInstance = null;\n let policyRequestSeq = 0;\n let policyEditorBucket = null;\n // True only once the bucket-policy GET for the currently open bucket has\n // actually completed successfully. The Save button lives outside the\n // (initially hidden) editor wrapper, so it stays clickable while a load\n // is in flight or has failed; without this guard, Save could commit\n // whatever the editor happened to hold - a stale previous bucket's\n // statements, or a freshly-initialized empty state - onto\n // policyEditorBucket before its own policy ever loaded.\n let bucketPolicyLoaded = false;\n // True while a Save (PUT) or Delete (DELETE) request for the bucket\n // policy is in flight, so a double-click - or Save and Delete fired in\n // quick succession - can't send two overlapping mutations for the same\n // bucket. Cleared on failure so the user can retry; left set on success,\n // since the modal hides and the page reloads shortly after anyway.\n let bucketPolicyMutationInFlight = false;\n\n function setBucketPolicyMutationInFlight(inFlight) {\n bucketPolicyMutationInFlight = inFlight;\n document.getElementById('bucketPolicySaveBtn').disabled = inFlight;\n document.getElementById('bucketPolicyDeleteBtn').disabled = inFlight;\n }\n\n let cachedUsers = null;\n\n // Working copy of the lifecycle rules currently shown in the modal.\n // Edits (add/edit/delete rule) only mutate this local state; nothing is\n // sent to the server until \"Save\" or \"Delete all rules\" is clicked.\n let lifecycleEditor = { bucket: null, rules: [], editingIndex: null, editingRule: null, rawXml: '', hasTransition: false };\n\n function escapeHtml(v) {\n return String(v ?? '')\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;');\n }\n\n // Shadows admin.js's formatBytes for this page, so it keeps that\n // signature and unit list; the extra guard is for a size the API left\n // out, which the shared one renders as \"NaN undefined\".\n function formatBytes(bytes, decimals = 2) {\n if (!bytes) return '0 Bytes';\n const k = 1024;\n const dm = decimals < 0 ? 0 : decimals;\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];\n }\n\n function formatDays(n) {\n return n + (n === 1 ? ' day' : ' days');\n }\n\n // csrfHeaders reads the token the layout stamps into every page\n // (<meta name=\"csrf-token\">) so mutating lifecycle requests pass it the\n // same way the newer admin pages (e.g. s3tables) do.\n function csrfHeaders() {\n const meta = document.querySelector('meta[name=\"csrf-token\"]');\n const token = meta ? (meta.getAttribute('content') || '') : '';\n const headers = { 'Content-Type': 'application/json' };\n if (token) {\n headers['X-CSRF-Token'] = token;\n }\n return headers;\n }\n\n // parseLifecycleResponse reads the body as text before parsing, so a\n // non-JSON response (a proxy's HTML error page, an empty body, plain\n // text from some middleware) surfaces the HTTP status instead of\n // throwing a raw JSON syntax error out of response.json().\n function parseLifecycleResponse(response) {\n return response.text().then(text => {\n let data = {};\n if (text) {\n try {\n data = JSON.parse(text);\n } catch (e) {\n data = { error: response.statusText || ('HTTP ' + response.status) };\n }\n } else if (!response.ok) {\n data = { error: response.statusText || ('HTTP ' + response.status) };\n }\n return { ok: response.ok, data: data };\n });\n }\n\n document.addEventListener('DOMContentLoaded', function() {\n // Add click handlers to pagination links\n document.querySelectorAll('.pagination-link').forEach(link => {\n link.addEventListener('click', function(e) {\n e.preventDefault();\n const page = this.getAttribute('data-page');\n goToPage(page);\n });\n });\n\n // Initialize modal instances once (reuse with show/hide)\n deleteModalInstance = new bootstrap.Modal(document.getElementById('deleteBucketModal'));\n quotaModalInstance = new bootstrap.Modal(document.getElementById('manageQuotaModal'));\n ownerModalInstance = new bootstrap.Modal(document.getElementById('manageOwnerModal'));\n detailsModalInstance = new bootstrap.Modal(document.getElementById('bucketDetailsModal'));\n lifecycleModalInstance = new bootstrap.Modal(document.getElementById('bucketLifecycleModal'));\n policyModalInstance = new bootstrap.Modal(document.getElementById('bucketPolicyModal'));\n\n const quotaCheckbox = document.getElementById('enableQuota');\n const quotaSettings = document.getElementById('quotaSettings');\n const versioningCheckbox = document.getElementById('enableVersioning');\n const objectLockCheckbox = document.getElementById('enableObjectLock');\n const objectLockSettings = document.getElementById('objectLockSettings');\n const setDefaultRetentionCheckbox = document.getElementById('setDefaultRetention');\n const defaultRetentionSettings = document.getElementById('defaultRetentionSettings');\n const createBucketForm = document.getElementById('createBucketForm');\n\n // Toggle quota settings\n quotaCheckbox.addEventListener('change', function() {\n quotaSettings.style.display = this.checked ? 'block' : 'none';\n });\n\n // Toggle object lock settings and automatically enable versioning\n objectLockCheckbox.addEventListener('change', function() {\n objectLockSettings.style.display = this.checked ? 'block' : 'none';\n if (this.checked) {\n versioningCheckbox.checked = true;\n versioningCheckbox.disabled = true;\n } else {\n versioningCheckbox.disabled = false;\n // Reset default retention settings when object lock is disabled\n setDefaultRetentionCheckbox.checked = false;\n defaultRetentionSettings.style.display = 'none';\n }\n });\n\n // Toggle default retention settings\n setDefaultRetentionCheckbox.addEventListener('change', function() {\n defaultRetentionSettings.style.display = this.checked ? 'block' : 'none';\n });\n\n // Populate owner dropdown when create bucket modal opens\n document.getElementById('createBucketModal').addEventListener('show.bs.modal', async function() {\n const ownerSelect = document.getElementById('bucketOwner');\n \n // Only fetch if not already populated\n if (ownerSelect.options.length <= 1) {\n try {\n const response = await fetch(basePath('/api/users'));\n const data = await response.json();\n const users = data.users || [];\n \n users.forEach(user => {\n const option = document.createElement('option');\n option.value = user.username;\n option.textContent = user.username;\n ownerSelect.appendChild(option);\n });\n } catch (error) {\n console.error('Error fetching users for owner dropdown:', error);\n // Reset to default state on error - user can still create bucket without owner\n ownerSelect.innerHTML = '<option value=\"\">No owner (admin-only access)</option>';\n ownerSelect.selectedIndex = 0;\n }\n }\n });\n\n // Handle form submission\n createBucketForm.addEventListener('submit', function(e) {\n e.preventDefault();\n \n const formData = new FormData(this);\n const data = {\n name: formData.get('name'),\n owner: formData.get('owner') || '',\n region: formData.get('region') || '',\n quota_size: quotaCheckbox.checked ? parseInt(formData.get('quota_size')) || 0 : 0,\n quota_unit: formData.get('quota_unit') || 'MB',\n quota_enabled: quotaCheckbox.checked,\n versioning_enabled: versioningCheckbox.checked,\n object_lock_enabled: objectLockCheckbox.checked,\n object_lock_mode: formData.get('object_lock_mode') || 'GOVERNANCE',\n set_default_retention: setDefaultRetentionCheckbox.checked,\n object_lock_duration: setDefaultRetentionCheckbox.checked ? parseInt(formData.get('object_lock_duration')) || 30 : 0\n };\n\n // Validate object lock settings\n if (data.object_lock_enabled && data.set_default_retention && data.object_lock_duration <= 0) {\n alert('Please enter a valid retention duration for object lock.');\n return;\n }\n\n fetch(basePath('/api/s3/buckets'), {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data)\n })\n .then(response => response.json())\n .then(data => {\n if (data.error) {\n alert('Error creating bucket: ' + data.error);\n } else {\n alert('Bucket created successfully!');\n // Properly close the modal before reloading\n const createModal = bootstrap.Modal.getInstance(document.getElementById('createBucketModal'));\n if (createModal) {\n createModal.hide();\n }\n setTimeout(() => location.reload(), 500);\n }\n })\n .catch(error => {\n console.error('Error:', error);\n alert('Error creating bucket: ' + error.message);\n });\n });\n\n // Handle delete bucket\n const deleteForm = document.getElementById('deleteBucketModal');\n document.querySelectorAll('.delete-bucket-btn').forEach(button => {\n button.addEventListener('click', function() {\n const bucketName = this.dataset.bucketName;\n document.getElementById('deleteBucketName').textContent = bucketName;\n // Store bucket name on modal element instead of global window property\n deleteForm.dataset.bucketName = bucketName;\n deleteModalInstance.show();\n });\n });\n\n // Handle quota management\n const quotaForm = document.getElementById('quotaForm');\n document.querySelectorAll('.quota-btn').forEach(button => {\n button.addEventListener('click', function() {\n const bucketName = this.dataset.bucketName;\n const currentQuota = parseInt(this.dataset.currentQuota);\n const quotaEnabled = this.dataset.quotaEnabled === 'true';\n \n document.getElementById('quotaBucketName').value = bucketName;\n document.getElementById('quotaEnabled').checked = quotaEnabled;\n document.getElementById('quotaSizeMB').value = currentQuota;\n \n // Toggle quota size settings\n document.getElementById('quotaSizeSettings').style.display = quotaEnabled ? 'block' : 'none';\n \n // Store bucket name on form element instead of global window property\n quotaForm.dataset.bucketName = bucketName;\n quotaModalInstance.show();\n });\n });\n\n // Add event listener to properly dispose of quota modal when hidden\n document.getElementById('manageQuotaModal').addEventListener('hidden.bs.modal', function() {\n if (quotaModalInstance) {\n quotaModalInstance.dispose();\n quotaModalInstance = null;\n }\n // Force remove any remaining backdrops\n document.querySelectorAll('.modal-backdrop').forEach(backdrop => {\n backdrop.remove();\n });\n // Ensure body classes are removed\n document.body.classList.remove('modal-open');\n document.body.style.removeProperty('padding-right');\n });\n\n // Handle quota form submission\n document.getElementById('quotaForm').addEventListener('submit', function(e) {\n e.preventDefault();\n \n const bucketName = this.dataset.bucketName;\n if (!bucketName) return;\n\n const formData = new FormData(this);\n const enabled = document.getElementById('quotaEnabled').checked;\n const data = {\n quota_size: enabled ? parseInt(formData.get('quota_size')) || 0 : 0,\n quota_unit: formData.get('quota_unit') || 'MB',\n quota_enabled: enabled\n };\n\n fetch(basePath(`/api/s3/buckets/${bucketName}/quota`), {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data)\n })\n .then(response => response.json())\n .then(data => {\n if (data.error) {\n alert('Error updating quota: ' + data.error);\n } else {\n alert('Quota updated successfully!');\n // Properly close the modal before reloading\n if (quotaModalInstance) {\n quotaModalInstance.hide();\n }\n setTimeout(() => location.reload(), 500);\n }\n })\n .catch(error => {\n console.error('Error:', error);\n alert('Error updating quota: ' + error.message);\n });\n });\n\n // Handle quota enabled checkbox\n document.getElementById('quotaEnabled').addEventListener('change', function() {\n document.getElementById('quotaSizeSettings').style.display = this.checked ? 'block' : 'none';\n });\n\n // Handle owner management\n const ownerForm = document.getElementById('ownerForm');\n document.querySelectorAll('.owner-btn').forEach(button => {\n button.addEventListener('click', async function() {\n const bucketName = this.dataset.bucketName;\n const currentOwner = this.dataset.currentOwner || '';\n \n document.getElementById('ownerBucketName').value = bucketName;\n // Store bucket name on form element instead of global window property\n ownerForm.dataset.bucketName = bucketName;\n \n // Show loading spinner\n document.getElementById('ownerLoadingSpinner').style.display = 'block';\n document.getElementById('bucketOwnerSelect').disabled = true;\n \n ownerModalInstance.show();\n \n // Fetch users if not cached\n try {\n if (!cachedUsers) {\n const response = await fetch(basePath('/api/users'));\n const data = await response.json();\n cachedUsers = data.users || [];\n }\n \n // Populate the select dropdown\n const select = document.getElementById('bucketOwnerSelect');\n select.innerHTML = '<option value=\"\">No owner (admin-only access)</option>';\n \n cachedUsers.forEach(user => {\n const option = document.createElement('option');\n option.value = user.username;\n option.textContent = user.username;\n if (user.username === currentOwner) {\n option.selected = true;\n }\n select.appendChild(option);\n });\n \n select.disabled = false;\n } catch (error) {\n console.error('Error fetching users:', error);\n alert('Error loading users: ' + error.message);\n // Re-enable select and reset to default on error\n const select = document.getElementById('bucketOwnerSelect');\n select.innerHTML = '<option value=\"\">No owner (admin-only access)</option>';\n select.selectedIndex = 0;\n select.disabled = false;\n } finally {\n document.getElementById('ownerLoadingSpinner').style.display = 'none';\n }\n });\n });\n\n // Handle owner form submission\n document.getElementById('ownerForm').addEventListener('submit', function(e) {\n e.preventDefault();\n \n const bucketName = this.dataset.bucketName;\n if (!bucketName) return;\n\n const owner = document.getElementById('bucketOwnerSelect').value;\n const data = { owner: owner };\n\n fetch(basePath(`/api/s3/buckets/${bucketName}/owner`), {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data)\n })\n .then(response => response.json())\n .then(data => {\n if (data.error) {\n alert('Error updating owner: ' + data.error);\n } else {\n alert('Bucket owner updated successfully!');\n // Properly close the modal before reloading\n if (ownerModalInstance) {\n ownerModalInstance.hide();\n }\n setTimeout(() => location.reload(), 500);\n }\n })\n .catch(error => {\n console.error('Error:', error);\n alert('Error updating owner: ' + error.message);\n });\n });\n\n // Handle view details button\n document.querySelectorAll('.view-details-btn').forEach(button => {\n button.addEventListener('click', function() {\n const bucketName = this.dataset.bucketName;\n \n // Update modal title\n document.getElementById('bucketDetailsModalLabel').innerHTML = \n '<i class=\"bi bi-box me-2\"></i>Bucket Details - ' + bucketName;\n \n // Show loading spinner\n document.getElementById('bucketDetailsContent').innerHTML = \n '<div class=\"text-center py-4\">' +\n '<div class=\"spinner-border text-primary\" role=\"status\">' +\n '<span class=\"visually-hidden\">Loading...</span>' +\n '<\\\\/div>' +\n '<div class=\"mt-2\">Loading bucket details...</div>' +\n '<\\\\/div>';\n \n detailsModalInstance.show();\n \n // Fetch bucket details\n fetch(basePath('/api/s3/buckets/' + bucketName))\n .then(response => response.json())\n .then(data => {\n if (data.error) {\n document.getElementById('bucketDetailsContent').innerHTML = \n '<div class=\"alert alert-danger\">' +\n '<i class=\"bi bi-exclamation-triangle me-2\"></i>' +\n 'Error loading bucket details: ' + data.error +\n '<\\\\/div>';\n } else {\n displayBucketDetails(data);\n }\n })\n .catch(error => {\n console.error('Error fetching bucket details:', error);\n document.getElementById('bucketDetailsContent').innerHTML = \n '<div class=\"alert alert-danger\">' +\n '<i class=\"bi bi-exclamation-triangle me-2\"></i>' +\n 'Error loading bucket details: ' + error.message +\n '<\\\\/div>';\n });\n });\n });\n\n // Lifecycle buttons: column badge and action button\n document.querySelectorAll('.lifecycle-btn').forEach(button => {\n button.addEventListener('click', function() {\n const bucketName = this.dataset.bucketName;\n\n // Reset the working copy until the GET below repopulates it,\n // so Save/Delete-all can't act on the previous bucket's rules.\n lifecycleEditor = { bucket: null, rules: [], editingIndex: null, editingRule: null, rawXml: '', hasTransition: false };\n\n document.getElementById('bucketLifecycleModalLabel').innerHTML =\n '<i class=\"bi bi-recycle me-2\"></i>Lifecycle - ' + bucketName;\n\n document.getElementById('bucketLifecycleContent').innerHTML =\n '<div class=\"text-center py-4\">' +\n '<div class=\"spinner-border text-primary\" role=\"status\">' +\n '<span class=\"visually-hidden\">Loading...</span>' +\n '<\\/div>' +\n '<div class=\"mt-2\">Loading lifecycle rules...</div>' +\n '<\\/div>';\n\n lifecycleModalInstance.show();\n\n // Drop responses that arrive after another bucket was opened\n const requestSeq = ++lifecycleRequestSeq;\n fetch(basePath('/api/s3/buckets/' + bucketName + '/lifecycle'))\n .then(parseLifecycleResponse)\n .then(({ ok, data }) => {\n if (requestSeq !== lifecycleRequestSeq) return;\n if (!ok || data.error) {\n document.getElementById('bucketLifecycleContent').innerHTML =\n '<div class=\"alert alert-danger\">' +\n '<i class=\"bi bi-exclamation-triangle me-2\"></i>' +\n 'Error loading lifecycle rules: ' + (data.error || 'unknown error') +\n '<\\/div>';\n } else {\n displayBucketLifecycle(data);\n }\n })\n .catch(error => {\n if (requestSeq !== lifecycleRequestSeq) return;\n console.error('Error fetching bucket lifecycle:', error);\n document.getElementById('bucketLifecycleContent').innerHTML =\n '<div class=\"alert alert-danger\">' +\n '<i class=\"bi bi-exclamation-triangle me-2\"></i>' +\n 'Error loading lifecycle rules: ' + error.message +\n '<\\/div>';\n });\n });\n });\n\n // Save the whole working rule set back to the bucket.\n document.getElementById('lifecycleSaveAllBtn').addEventListener('click', function() {\n if (!lifecycleEditor.bucket) return;\n // Fold in any rule the user is still editing so Save doesn't\n // silently discard it; abort if that form isn't valid yet.\n if (!commitOpenLifecycleRuleForm()) return;\n // An empty list clears the configuration, same as Delete all rules,\n // so it gets the same prompt.\n if (lifecycleEditor.rules.length === 0 &&\n !confirm('No rules left: saving removes the lifecycle configuration for ' + lifecycleEditor.bucket + '. This cannot be undone.')) {\n return;\n }\n\n fetch(basePath('/api/s3/buckets/' + lifecycleEditor.bucket + '/lifecycle'), {\n method: 'PUT',\n headers: csrfHeaders(),\n body: JSON.stringify({ rules: lifecycleEditor.rules })\n })\n .then(parseLifecycleResponse)\n .then(({ ok, data }) => {\n if (!ok || data.error) {\n alert('Error saving lifecycle rules: ' + (data.error || 'unknown error'));\n return;\n }\n if (lifecycleModalInstance) {\n lifecycleModalInstance.hide();\n }\n setTimeout(() => location.reload(), 500);\n })\n .catch(error => {\n console.error('Error:', error);\n alert('Error saving lifecycle rules: ' + error.message);\n });\n });\n\n // Clear the lifecycle configuration entirely.\n document.getElementById('lifecycleDeleteAllBtn').addEventListener('click', function() {\n if (!lifecycleEditor.bucket) return;\n if (!confirm('Delete all lifecycle rules for ' + lifecycleEditor.bucket + '? This cannot be undone.')) return;\n\n fetch(basePath('/api/s3/buckets/' + lifecycleEditor.bucket + '/lifecycle'), {\n method: 'DELETE',\n headers: csrfHeaders()\n })\n .then(parseLifecycleResponse)\n .then(({ ok, data }) => {\n if (!ok || data.error) {\n alert('Error deleting lifecycle rules: ' + (data.error || 'unknown error'));\n return;\n }\n if (lifecycleModalInstance) {\n lifecycleModalInstance.hide();\n }\n setTimeout(() => location.reload(), 500);\n })\n .catch(error => {\n console.error('Error:', error);\n alert('Error deleting lifecycle rules: ' + error.message);\n });\n });\n\n // Policy buttons: column badge and action button. The visual editor\n // (weed/admin/static/js/policy_editor.js) is set up once per page\n // load; registerPolicyEditor is re-called on every open so the\n // resource-ARN autocomplete and default Principal stay pinned to\n // whichever bucket is currently open.\n let bucketPolicyEditorSetUp = false;\n document.getElementById('bucketPolicyInsertSampleBtn').addEventListener('click', function() {\n if (!policyEditorBucket) return;\n insertSamplePolicy('bucket', {\n Version: '2012-10-17',\n Statement: [{\n Effect: 'Allow',\n Principal: '*',\n Action: ['s3:GetObject'],\n Resource: ['arn:aws:s3:::' + policyEditorBucket + '/*']\n }]\n });\n });\n\n document.querySelectorAll('.policy-btn').forEach(button => {\n button.addEventListener('click', function() {\n const bucketName = this.dataset.bucketName;\n policyEditorBucket = bucketName;\n bucketPolicyLoaded = false;\n // Deliberately not resetting bucketPolicyMutationInFlight\n // here: if a Save/Delete for a previously open bucket is\n // still in flight, Save/Delete for this bucket must stay\n // blocked until that request settles (its own completion\n // handler releases the flag once done, whether or not it's\n // still the active bucket by then) - otherwise this bucket's\n // mutation could race the abandoned one.\n registerPolicyEditor('bucket', { requirePrincipal: true, bucket: bucketName });\n if (!bucketPolicyEditorSetUp) {\n setupPolicyEditor('bucket');\n bucketPolicyEditorSetUp = true;\n }\n\n document.getElementById('bucketPolicyModalLabel').innerHTML =\n '<i class=\"bi bi-file-earmark-lock me-2\"></i>Bucket Policy - ' + escapeHtml(bucketName);\n document.getElementById('bucketPolicyLoading').style.display = '';\n document.getElementById('bucketPolicyError').style.display = 'none';\n document.getElementById('bucketPolicyEditorWrapper').style.display = 'none';\n\n policyModalInstance.show();\n\n // Drop responses that arrive after another bucket was opened\n const requestSeq = ++policyRequestSeq;\n fetch(basePath('/api/s3/buckets/' + encodeURIComponent(bucketName) + '/policy'))\n .then(parseLifecycleResponse)\n .then(({ ok, data }) => {\n if (requestSeq !== policyRequestSeq) return;\n document.getElementById('bucketPolicyLoading').style.display = 'none';\n if (!ok || data.error) {\n document.getElementById('bucketPolicyError').textContent =\n 'Error loading bucket policy: ' + (data.error || 'unknown error');\n document.getElementById('bucketPolicyError').style.display = '';\n return;\n }\n document.getElementById('bucketPolicyEditorWrapper').style.display = '';\n // policy_text carries stored bytes the server-side\n // decoder rejects; the JSON tab shows them so they\n // can be fixed or deleted.\n document.getElementById('bucketPolicyDocument').value =\n data.policy ? JSON.stringify(data.policy, null, 2) : (data.policy_text || '');\n bucketPolicyLoaded = true;\n loadPolicyTextareaIntoEditor('bucket');\n })\n .catch(error => {\n if (requestSeq !== policyRequestSeq) return;\n console.error('Error fetching bucket policy:', error);\n document.getElementById('bucketPolicyLoading').style.display = 'none';\n document.getElementById('bucketPolicyError').textContent =\n 'Error loading bucket policy: ' + error.message;\n document.getElementById('bucketPolicyError').style.display = '';\n });\n });\n });\n\n // Save the policy document currently shown (whichever tab is active).\n document.getElementById('bucketPolicySaveBtn').addEventListener('click', function() {\n if (!policyEditorBucket) return;\n if (bucketPolicyMutationInFlight) return;\n if (!bucketPolicyLoaded) {\n alert('The current policy has not finished loading. Close and reopen this dialog before saving.');\n return;\n }\n\n // Commit first: if the Editor tab is active, the textarea still\n // holds whatever was there at load time until this runs, so a\n // policy entered purely through the structured form (no tab\n // switch) would otherwise read back as empty here.\n if (!commitPolicyActiveTab('bucket')) return;\n\n const raw = document.getElementById('bucketPolicyDocument').value.trim();\n if (!raw || !policyTextHasStatements(raw)) {\n alert('Add at least one statement, or use Delete to remove the bucket policy.');\n return;\n }\n\n let policy;\n try {\n policy = JSON.parse(document.getElementById('bucketPolicyDocument').value);\n } catch (e) {\n alert('Invalid JSON: ' + e.message);\n return;\n }\n const validationError = validatePolicyEditorDoc('bucket', policy);\n if (validationError) {\n alert(validationError);\n return;\n }\n // The admin API decodes only Version and Statement, so warn\n // before other top-level fields are silently dropped - the IAM\n // policies page already does. (The S3 Tables dialogs don't:\n // their backend stores the document verbatim.)\n if (!confirmPolicyFieldDiscard('bucket')) return;\n\n // Captured now: if the dialog moves on to a different bucket\n // before this PUT resolves, the completion below must not hide\n // or reload over whatever that other bucket is now showing.\n const targetBucket = policyEditorBucket;\n setBucketPolicyMutationInFlight(true);\n fetch(basePath('/api/s3/buckets/' + encodeURIComponent(targetBucket) + '/policy'), {\n method: 'PUT',\n headers: csrfHeaders(),\n body: JSON.stringify({ policy: policy })\n })\n .then(parseLifecycleResponse)\n .then(({ ok, data }) => {\n setBucketPolicyMutationInFlight(false);\n const stillCurrent = targetBucket === policyEditorBucket;\n if (!ok || data.error) {\n if (stillCurrent) {\n alert('Error saving bucket policy: ' + (data.error || 'unknown error'));\n } else {\n console.error('Error saving policy for ' + targetBucket + ' (no longer the open bucket): ' + (data.error || 'unknown error'));\n }\n return;\n }\n if (!stillCurrent) return;\n if (policyModalInstance) {\n policyModalInstance.hide();\n }\n setTimeout(() => location.reload(), 500);\n })\n .catch(error => {\n setBucketPolicyMutationInFlight(false);\n console.error('Error:', error);\n if (targetBucket === policyEditorBucket) {\n alert('Error saving bucket policy: ' + error.message);\n }\n });\n });\n\n // Clear the bucket policy entirely.\n document.getElementById('bucketPolicyDeleteBtn').addEventListener('click', function() {\n if (!policyEditorBucket) return;\n if (bucketPolicyMutationInFlight) return;\n if (!bucketPolicyLoaded) {\n alert('The current policy has not finished loading. Close and reopen this dialog before deleting.');\n return;\n }\n if (!confirm('Delete the bucket policy for ' + policyEditorBucket + '? This cannot be undone.')) return;\n\n // Captured now: if the dialog moves on to a different bucket\n // before this DELETE resolves, the completion below must not\n // hide or reload over whatever that other bucket is now showing.\n const targetBucket = policyEditorBucket;\n setBucketPolicyMutationInFlight(true);\n fetch(basePath('/api/s3/buckets/' + encodeURIComponent(targetBucket) + '/policy'), {\n method: 'DELETE',\n headers: csrfHeaders()\n })\n .then(parseLifecycleResponse)\n .then(({ ok, data }) => {\n setBucketPolicyMutationInFlight(false);\n const stillCurrent = targetBucket === policyEditorBucket;\n if (!ok || data.error) {\n if (stillCurrent) {\n alert('Error deleting bucket policy: ' + (data.error || 'unknown error'));\n } else {\n console.error('Error deleting policy for ' + targetBucket + ' (no longer the open bucket): ' + (data.error || 'unknown error'));\n }\n return;\n }\n if (!stillCurrent) return;\n if (policyModalInstance) {\n policyModalInstance.hide();\n }\n setTimeout(() => location.reload(), 500);\n })\n .catch(error => {\n setBucketPolicyMutationInFlight(false);\n console.error('Error:', error);\n if (targetBucket === policyEditorBucket) {\n alert('Error deleting bucket policy: ' + error.message);\n }\n });\n });\n });\n\n function deleteBucket() {\n const bucketName = document.getElementById('deleteBucketModal').dataset.bucketName;\n if (!bucketName) return;\n\n fetch(basePath(`/api/s3/buckets/${bucketName}`), {\n method: 'DELETE'\n })\n .then(response => response.json())\n .then(data => {\n if (data.error) {\n alert('Error deleting bucket: ' + data.error);\n } else {\n alert('Bucket deleted successfully!');\n // Properly close the modal before reloading\n if (deleteModalInstance) {\n deleteModalInstance.hide();\n }\n setTimeout(() => location.reload(), 500);\n }\n })\n .catch(error => {\n console.error('Error:', error);\n alert('Error deleting bucket: ' + error.message);\n });\n }\n\nfunction displayBucketDetails(data) {\n const bucket = data.bucket;\n\n function formatDate(dateString) {\n const date = new Date(dateString);\n return date.toLocaleString();\n }\n\n let ownerHtml = '<span class=\"text-muted\">No owner (admin-only)</span>';\n if (bucket.owner) {\n ownerHtml = '<span class=\"badge bg-info\"><i class=\"bi bi-person me-1\"></i>' + escapeHtml(bucket.owner) + '</span>';\n }\n\n let usageHtml = '';\n if (bucket.physical_size > 0 && bucket.logical_size > 0 && bucket.physical_size > bucket.logical_size) {\n const overhead = (bucket.physical_size / bucket.logical_size).toFixed(1);\n usageHtml = '<br><small class=\"text-muted\">' + overhead + 'x overhead<\\/small>';\n }\n\n let quotaHtml = '<span class=\"badge bg-secondary\">Disabled</span>';\n if (bucket.quota_enabled) {\n quotaHtml = '<span class=\"badge bg-success\">' + formatBytes(bucket.quota) + '</span>';\n }\n\n let versioningHtml = '<span class=\"text-muted\">Not configured</span>';\n if (bucket.versioning_status === 'Enabled') {\n versioningHtml = '<span class=\"badge bg-success\"><i class=\"bi bi-check me-1\"></i>Enabled</span>';\n } else if (bucket.versioning_status === 'Suspended') {\n versioningHtml = '<span class=\"badge bg-warning\"><i class=\"bi bi-pause me-1\"></i>Suspended</span>';\n }\n\n let statusHtml = '<span class=\"badge bg-success\">Writable</span>';\n if (bucket.read_only) {\n statusHtml = '<span class=\"badge bg-danger\"><i class=\"bi bi-lock me-1\"></i>Read-only</span>';\n }\n\n let objectLockHtml = '<span class=\"text-muted\">Not configured</span>';\n if (bucket.object_lock_enabled) {\n let details = '';\n if (bucket.object_lock_mode && bucket.object_lock_duration > 0) {\n details = '<br><small class=\"text-muted\">' + escapeHtml(bucket.object_lock_mode) + ' • ' + bucket.object_lock_duration + ' days<\\/small>';\n }\n objectLockHtml = '<span class=\"badge bg-warning\"><i class=\"bi bi-lock me-1\"></i>Enabled</span>' + details;\n }\n\n let policyHtml = '<span class=\"text-muted\">Not configured</span>';\n if (bucket.policy_statement_count > 0) {\n const label = bucket.policy_statement_count === 1 ? '1 statement' : bucket.policy_statement_count + ' statements';\n policyHtml = '<span class=\"badge bg-primary\">' + label + '<\\/span>';\n }\n\n const rows = [\n '<div class=\"row\">',\n '<div class=\"col-md-6\">',\n '<h6><i class=\"bi bi-info-circle me-2\"></i>Bucket Information</h6>',\n '<table class=\"table table-sm\">',\n '<tr><td><strong>Name:</strong></td><td>' + escapeHtml(bucket.name) + '<\\/td><\\/tr>',\n '<tr><td><strong>Owner:</strong></td><td>' + ownerHtml + '<\\/td><\\/tr>',\n '<tr><td><strong>Created:</strong></td><td>' + formatDate(bucket.created_at) + '<\\/td><\\/tr>',\n '<tr><td><strong>Last Modified:</strong></td><td>' + formatDate(bucket.last_modified) + '<\\/td><\\/tr>',\n '<tr><td><strong>Logical Size:</strong></td><td>' + formatBytes(bucket.logical_size) + '<\\/td><\\/tr>',\n '<tr><td><strong>Physical Size:</strong></td><td>' + formatBytes(bucket.physical_size) + usageHtml + '<\\/td><\\/tr>',\n '<\\/table>',\n '<\\/div>',\n '<div class=\"col-md-6\">',\n '<h6><i class=\"bi bi-gear-wide-connected me-2\"></i>Configuration</h6>',\n '<table class=\"table table-sm\">',\n '<tr><td><strong>Status:</strong></td><td>' + statusHtml + '<\\/td><\\/tr>',\n '<tr><td><strong>Quota:</strong></td><td>' + quotaHtml + '<\\/td><\\/tr>',\n '<tr><td><strong>Versioning:</strong></td><td>' + versioningHtml + '<\\/td><\\/tr>',\n '<tr><td><strong>Object Lock:</strong></td><td>' + objectLockHtml + '<\\/td><\\/tr>',\n '<tr><td><strong>Policy:</strong></td><td>' + policyHtml + '<\\/td><\\/tr>',\n '<\\/table>',\n '<\\/div>',\n '<\\/div>'\n ];\n\n document.getElementById('bucketDetailsContent').innerHTML = rows.join('');\n}\n\n// displayBucketLifecycle loads the GET response into the local working copy\n// and renders the editor. Nothing is sent back to the server until Save or\n// Delete all rules is clicked.\nfunction displayBucketLifecycle(data) {\n lifecycleEditor.bucket = data.bucket || lifecycleEditor.bucket;\n lifecycleEditor.rules = (data.rules || []).map(cloneLifecycleRule);\n lifecycleEditor.editingIndex = null;\n lifecycleEditor.editingRule = null;\n lifecycleEditor.rawXml = data.xml || '';\n // SeaweedFS doesn't support Transition rules (PutBucketLifecycleConfiguration\n // rejects them for Enabled rules), and the canonical rule shape the admin\n // edits has no field for one, so a Transition set by another client would\n // silently disappear on the next Save. Warn instead.\n // Matches <Transition> and <NoncurrentVersionTransition> however they are\n // spelled: with attributes, self-closed, or namespace-prefixed.\n lifecycleEditor.hasTransition = /<(\\w+:)?(NoncurrentVersion)?Transition[\\s>\\/]/.test(data.xml || '');\n renderLifecycleEditor();\n}\n\n// normalizeLifecycleStatus maps a stored status onto the two the editor can\n// show. The S3 API stores <Status> unvalidated, and the engine runs a rule\n// only on an exact \"Enabled\", so everything else is Disabled - collapsing it\n// here keeps an odd spelling from leaving both radios unchecked, which would\n// throw out of readLifecycleRuleFromForm and make the modal look dead.\nfunction normalizeLifecycleStatus(status) {\n return status === 'Enabled' ? 'Enabled' : 'Disabled';\n}\n\nfunction cloneLifecycleRule(r) {\n return {\n id: r.id || '',\n status: normalizeLifecycleStatus(r.status),\n prefix: r.prefix || '',\n tags: Object.assign({}, r.tags || {}),\n size_greater_than: r.size_greater_than || null,\n size_less_than: r.size_less_than || null,\n expiration_days: r.expiration_days || null,\n expiration_date: r.expiration_date || '',\n expired_object_delete_marker: !!r.expired_object_delete_marker,\n noncurrent_version_expiration_days: r.noncurrent_version_expiration_days || null,\n newer_noncurrent_versions: r.newer_noncurrent_versions || null,\n abort_multipart_days: r.abort_multipart_days || null,\n };\n}\n\nfunction blankLifecycleRule() {\n return {\n id: '', status: 'Enabled', prefix: '', tags: {},\n size_greater_than: null, size_less_than: null,\n expiration_days: null, expiration_date: '',\n expired_object_delete_marker: false,\n noncurrent_version_expiration_days: null, newer_noncurrent_versions: null,\n abort_multipart_days: null,\n };\n}\n\nfunction describeLifecycleScope(rule) {\n const parts = [];\n if (rule.prefix) {\n parts.push('<code>' + escapeHtml(rule.prefix) + '<\\/code>');\n }\n Object.entries(rule.tags || {}).forEach(([k, v]) => {\n parts.push('<span class=\"badge bg-light text-dark border\">' + escapeHtml(k) + '=' + escapeHtml(v) + '<\\/span>');\n });\n if (rule.size_greater_than) {\n parts.push('size &gt; ' + formatBytes(rule.size_greater_than));\n }\n if (rule.size_less_than) {\n parts.push('size &lt; ' + formatBytes(rule.size_less_than));\n }\n return parts.length ? parts.join(' ') : '<span class=\"text-muted\">Whole bucket<\\/span>';\n}\n\nfunction describeLifecycleActions(rule) {\n const actions = [];\n if (rule.expiration_days) {\n actions.push('Expire after ' + formatDays(rule.expiration_days));\n }\n if (rule.expiration_date) {\n actions.push('Expire on ' + escapeHtml(rule.expiration_date));\n }\n if (rule.expired_object_delete_marker) {\n actions.push('Remove expired object delete markers');\n }\n if (rule.noncurrent_version_expiration_days) {\n let action = 'Expire noncurrent versions after ' + formatDays(rule.noncurrent_version_expiration_days);\n if (rule.newer_noncurrent_versions) {\n action += ', keep ' + rule.newer_noncurrent_versions + ' newest';\n }\n actions.push(action);\n } else if (rule.newer_noncurrent_versions) {\n // Standalone (no expiration_days): the engine still recognizes this\n // as an action that expires noncurrent versions beyond the N newest.\n actions.push('Keep ' + rule.newer_noncurrent_versions + ' newest noncurrent versions');\n }\n if (rule.abort_multipart_days) {\n actions.push('Abort incomplete multipart uploads after ' + formatDays(rule.abort_multipart_days));\n }\n if (actions.length === 0) {\n return '<span class=\"text-muted\">None<\\/span>';\n }\n return actions.join('<br>');\n}\n\nfunction lifecycleRuleRowHtml(rule, idx) {\n const statusHtml = rule.status === 'Enabled'\n ? '<span class=\"badge bg-success\">Enabled<\\/span>'\n : '<span class=\"badge bg-secondary\">' + escapeHtml(rule.status) + '<\\/span>';\n return '<tr>' +\n '<td>' + (rule.id ? escapeHtml(rule.id) : '<span class=\"text-muted\">unnamed<\\/span>') + '<\\/td>' +\n '<td>' + statusHtml + '<\\/td>' +\n '<td>' + describeLifecycleScope(rule) + '<\\/td>' +\n '<td>' + describeLifecycleActions(rule) + '<\\/td>' +\n '<td class=\"text-end text-nowrap\">' +\n '<button type=\"button\" class=\"btn btn-sm btn-outline-secondary lifecycle-edit-rule-btn\" data-index=\"' + idx + '\" title=\"Edit rule\"><i class=\"bi bi-pen\"><\\/i><\\/button> ' +\n '<button type=\"button\" class=\"btn btn-sm btn-outline-danger lifecycle-delete-rule-btn\" data-index=\"' + idx + '\" title=\"Delete rule\"><i class=\"bi bi-trash\"><\\/i><\\/button>' +\n '<\\/td>' +\n '<\\/tr>';\n}\n\nfunction lifecycleRuleFormHtml() {\n const rule = lifecycleEditor.editingRule;\n const tagRowHtml = (k, v) =>\n '<div class=\"input-group input-group-sm mb-1 lifecycle-tag-row\">' +\n '<input type=\"text\" class=\"form-control lifecycle-tag-key\" placeholder=\"Key\" value=\"' + escapeHtml(k) + '\">' +\n '<input type=\"text\" class=\"form-control lifecycle-tag-value\" placeholder=\"Value\" value=\"' + escapeHtml(v) + '\">' +\n '<button type=\"button\" class=\"btn btn-outline-danger lifecycle-remove-tag-btn\"><i class=\"bi bi-x\"><\\/i><\\/button>' +\n '<\\/div>';\n const tagRows = Object.entries(rule.tags || {}).map(([k, v]) => tagRowHtml(k, v)).join('');\n\n return '' +\n '<div class=\"card mb-3\" id=\"lifecycleRuleForm\">' +\n '<div class=\"card-body\">' +\n '<h6 class=\"card-title\">' + (lifecycleEditor.editingIndex === 'new' ? 'Add rule' : 'Edit rule') + '<\\/h6>' +\n\n '<div class=\"row g-2 mb-2\">' +\n '<div class=\"col-md-6\">' +\n '<label class=\"form-label small\">ID (optional)<\\/label>' +\n '<input type=\"text\" class=\"form-control form-control-sm\" id=\"lifecycleRuleId\" value=\"' + escapeHtml(rule.id) + '\">' +\n '<\\/div>' +\n '<div class=\"col-md-6\">' +\n '<label class=\"form-label small d-block\">Status<\\/label>' +\n '<div class=\"form-check form-check-inline\">' +\n '<input class=\"form-check-input\" type=\"radio\" name=\"lifecycleRuleStatus\" id=\"lifecycleStatusEnabled\" value=\"Enabled\"' + (rule.status === 'Enabled' ? ' checked' : '') + '>' +\n '<label class=\"form-check-label\" for=\"lifecycleStatusEnabled\">Enabled<\\/label>' +\n '<\\/div>' +\n '<div class=\"form-check form-check-inline\">' +\n '<input class=\"form-check-input\" type=\"radio\" name=\"lifecycleRuleStatus\" id=\"lifecycleStatusDisabled\" value=\"Disabled\"' + (rule.status === 'Disabled' ? ' checked' : '') + '>' +\n '<label class=\"form-check-label\" for=\"lifecycleStatusDisabled\">Disabled<\\/label>' +\n '<\\/div>' +\n '<\\/div>' +\n '<\\/div>' +\n\n '<div class=\"mb-2\">' +\n '<label class=\"form-label small\">Prefix<\\/label>' +\n '<input type=\"text\" class=\"form-control form-control-sm\" id=\"lifecycleRulePrefix\" placeholder=\"logs/\" value=\"' + escapeHtml(rule.prefix) + '\">' +\n '<\\/div>' +\n\n '<div class=\"mb-2\">' +\n '<label class=\"form-label small d-block\">Tags<\\/label>' +\n '<div id=\"lifecycleTagRows\">' + tagRows + '<\\/div>' +\n '<button type=\"button\" class=\"btn btn-sm btn-outline-secondary\" id=\"lifecycleAddTagBtn\"><i class=\"bi bi-plus me-1\"><\\/i>Add tag<\\/button>' +\n '<\\/div>' +\n\n '<div class=\"row g-2 mb-3\">' +\n '<div class=\"col-md-6\">' +\n '<label class=\"form-label small\">Size greater than (bytes)<\\/label>' +\n '<input type=\"number\" class=\"form-control form-control-sm\" id=\"lifecycleRuleSizeGT\" min=\"0\" step=\"1\" value=\"' + (rule.size_greater_than || '') + '\">' +\n '<\\/div>' +\n '<div class=\"col-md-6\">' +\n '<label class=\"form-label small\">Size less than (bytes)<\\/label>' +\n '<input type=\"number\" class=\"form-control form-control-sm\" id=\"lifecycleRuleSizeLT\" min=\"0\" step=\"1\" value=\"' + (rule.size_less_than || '') + '\">' +\n '<\\/div>' +\n '<\\/div>' +\n\n '<hr>' +\n '<h6 class=\"small text-muted text-uppercase\">Actions<\\/h6>' +\n\n '<div class=\"row g-2 align-items-center mb-2\">' +\n '<div class=\"col-auto\">' +\n '<div class=\"form-check\">' +\n '<input class=\"form-check-input\" type=\"checkbox\" id=\"lifecycleExpireDaysEnabled\"' + (rule.expiration_days ? ' checked' : '') + '>' +\n '<label class=\"form-check-label\" for=\"lifecycleExpireDaysEnabled\">Expire after<\\/label>' +\n '<\\/div>' +\n '<\\/div>' +\n '<div class=\"col-auto\">' +\n '<input type=\"number\" class=\"form-control form-control-sm\" id=\"lifecycleExpireDays\" min=\"1\" step=\"1\" style=\"width: 6rem;\" value=\"' + (rule.expiration_days || '') + '\"' + (rule.expiration_days ? '' : ' disabled') + '>' +\n '<\\/div><div class=\"col-auto\">days<\\/div>' +\n '<\\/div>' +\n\n '<div class=\"row g-2 align-items-center mb-2\">' +\n '<div class=\"col-auto\">' +\n '<div class=\"form-check\">' +\n '<input class=\"form-check-input\" type=\"checkbox\" id=\"lifecycleExpireDateEnabled\"' + (rule.expiration_date ? ' checked' : '') + '>' +\n '<label class=\"form-check-label\" for=\"lifecycleExpireDateEnabled\">Expire on date<\\/label>' +\n '<\\/div>' +\n '<\\/div>' +\n '<div class=\"col-auto\">' +\n '<input type=\"date\" class=\"form-control form-control-sm\" id=\"lifecycleExpireDate\" value=\"' + escapeHtml(rule.expiration_date) + '\"' + (rule.expiration_date ? '' : ' disabled') + '>' +\n '<\\/div>' +\n '<\\/div>' +\n\n '<div class=\"form-check mb-2\">' +\n '<input class=\"form-check-input\" type=\"checkbox\" id=\"lifecycleDeleteMarker\"' + (rule.expired_object_delete_marker ? ' checked' : '') + '>' +\n '<label class=\"form-check-label\" for=\"lifecycleDeleteMarker\">Remove expired object delete markers<\\/label>' +\n '<\\/div>' +\n\n (() => {\n const noncurrentActive = !!(rule.noncurrent_version_expiration_days || rule.newer_noncurrent_versions);\n return '<div class=\"row g-2 align-items-center mb-2\">' +\n '<div class=\"col-auto\">' +\n '<div class=\"form-check\">' +\n '<input class=\"form-check-input\" type=\"checkbox\" id=\"lifecycleNoncurrentEnabled\"' + (noncurrentActive ? ' checked' : '') + '>' +\n '<label class=\"form-check-label\" for=\"lifecycleNoncurrentEnabled\">Limit noncurrent versions<\\/label>' +\n '<\\/div>' +\n '<\\/div>' +\n '<div class=\"col-auto\">after<\\/div>' +\n '<div class=\"col-auto\">' +\n '<input type=\"number\" class=\"form-control form-control-sm\" id=\"lifecycleNoncurrentDays\" min=\"1\" step=\"1\" style=\"width: 6rem;\" value=\"' + (rule.noncurrent_version_expiration_days || '') + '\"' + (noncurrentActive ? '' : ' disabled') + '>' +\n '<\\/div><div class=\"col-auto\">days (optional), keep<\\/div>' +\n '<div class=\"col-auto\">' +\n '<input type=\"number\" class=\"form-control form-control-sm\" id=\"lifecycleNoncurrentKeep\" min=\"0\" step=\"1\" style=\"width: 6rem;\" value=\"' + (rule.newer_noncurrent_versions || '') + '\"' + (noncurrentActive ? '' : ' disabled') + '>' +\n '<\\/div><div class=\"col-auto\">newest (optional)<\\/div>' +\n '<\\/div>';\n })() +\n\n '<div class=\"row g-2 align-items-center mb-3\">' +\n '<div class=\"col-auto\">' +\n '<div class=\"form-check\">' +\n '<input class=\"form-check-input\" type=\"checkbox\" id=\"lifecycleAbortMPUEnabled\"' + (rule.abort_multipart_days ? ' checked' : '') + '>' +\n '<label class=\"form-check-label\" for=\"lifecycleAbortMPUEnabled\">Abort incomplete multipart uploads after<\\/label>' +\n '<\\/div>' +\n '<\\/div>' +\n '<div class=\"col-auto\">' +\n '<input type=\"number\" class=\"form-control form-control-sm\" id=\"lifecycleAbortMPUDays\" min=\"1\" step=\"1\" style=\"width: 6rem;\" value=\"' + (rule.abort_multipart_days || '') + '\"' + (rule.abort_multipart_days ? '' : ' disabled') + '>' +\n '<\\/div><div class=\"col-auto\">days<\\/div>' +\n '<\\/div>' +\n\n '<div class=\"text-end\">' +\n '<button type=\"button\" class=\"btn btn-sm btn-secondary\" id=\"lifecycleCancelRuleBtn\">Cancel<\\/button> ' +\n '<button type=\"button\" class=\"btn btn-sm btn-primary\" id=\"lifecycleSaveRuleBtn\">Save rule<\\/button>' +\n '<\\/div>' +\n '<\\/div>' +\n '<\\/div>';\n}\n\nfunction renderLifecycleEditor() {\n const container = document.getElementById('bucketLifecycleContent');\n const rowsHtml = lifecycleEditor.rules.map(lifecycleRuleRowHtml).join('') ||\n '<tr><td colspan=\"5\" class=\"text-center text-muted py-3\">No lifecycle rules<\\/td><\\/tr>';\n\n let html = '';\n if (lifecycleEditor.hasTransition) {\n html += '<div class=\"alert alert-warning small\">' +\n '<i class=\"bi bi-exclamation-triangle me-1\"><\\/i>' +\n 'This bucket has a Transition rule set outside the admin (SeaweedFS does not support storage class transitions). Saving from here will drop it.' +\n '<\\/div>';\n }\n\n html += '<div class=\"table-responsive mb-3\">' +\n '<table class=\"table table-sm align-middle\">' +\n '<thead><tr><th>Rule<\\/th><th>Status<\\/th><th>Scope<\\/th><th>Actions<\\/th><th><\\/th><\\/tr><\\/thead>' +\n '<tbody>' + rowsHtml + '<\\/tbody>' +\n '<\\/table>' +\n '<\\/div>' +\n '<button type=\"button\" class=\"btn btn-sm btn-outline-primary mb-3\" id=\"lifecycleAddRuleBtn\">' +\n '<i class=\"bi bi-plus me-1\"><\\/i>Add rule' +\n '<\\/button>';\n\n if (lifecycleEditor.editingIndex !== null) {\n html += lifecycleRuleFormHtml();\n }\n\n if (lifecycleEditor.rawXml) {\n html += '<details class=\"mt-2\">' +\n '<summary class=\"text-muted small\">Raw XML (as currently stored)<\\/summary>' +\n '<pre class=\"bg-light border rounded p-2 mt-2 small mb-0\">' + escapeHtml(lifecycleEditor.rawXml) + '<\\/pre>' +\n '<\\/details>';\n }\n\n container.innerHTML = html;\n bindLifecycleEditorEvents();\n}\n\nfunction bindLifecycleToggle(checkboxId, fieldId, mutuallyExclusiveId) {\n const checkbox = document.getElementById(checkboxId);\n const field = document.getElementById(fieldId);\n if (!checkbox || !field) return;\n checkbox.addEventListener('change', function() {\n field.disabled = !this.checked;\n if (this.checked && mutuallyExclusiveId) {\n const other = document.getElementById(mutuallyExclusiveId);\n if (other && other.checked) {\n other.checked = false;\n other.dispatchEvent(new Event('change'));\n }\n }\n });\n}\n\nfunction bindLifecycleEditorEvents() {\n const addBtn = document.getElementById('lifecycleAddRuleBtn');\n if (addBtn) {\n addBtn.addEventListener('click', function() {\n // Fold in any rule already being edited before switching forms,\n // so an invalid in-progress draft isn't silently discarded.\n if (!commitOpenLifecycleRuleForm()) return;\n lifecycleEditor.editingIndex = 'new';\n lifecycleEditor.editingRule = blankLifecycleRule();\n renderLifecycleEditor();\n });\n }\n\n document.querySelectorAll('.lifecycle-edit-rule-btn').forEach(btn => {\n btn.addEventListener('click', function() {\n const idx = parseInt(this.dataset.index, 10);\n // Same as above: committing never shifts indices (it either\n // pushes a new rule at the end or replaces one in place), so\n // idx captured above is still valid after this call.\n if (!commitOpenLifecycleRuleForm()) return;\n lifecycleEditor.editingIndex = idx;\n lifecycleEditor.editingRule = cloneLifecycleRule(lifecycleEditor.rules[idx]);\n renderLifecycleEditor();\n });\n });\n\n document.querySelectorAll('.lifecycle-delete-rule-btn').forEach(btn => {\n btn.addEventListener('click', function() {\n const idx = parseInt(this.dataset.index, 10);\n // Fold in an open form first, like every other transition does:\n // re-rendering after the splice would otherwise redraw it from the\n // snapshot taken when editing began and lose what was typed.\n if (lifecycleEditor.editingIndex !== null && lifecycleEditor.editingIndex !== idx) {\n if (!commitOpenLifecycleRuleForm()) return;\n }\n lifecycleEditor.rules.splice(idx, 1);\n // Deleting a rule shifts every later index down by one, so an\n // open edit form must follow its rule rather than silently\n // start targeting whatever now sits at its old index.\n if (lifecycleEditor.editingIndex === idx) {\n lifecycleEditor.editingIndex = null;\n lifecycleEditor.editingRule = null;\n } else if (typeof lifecycleEditor.editingIndex === 'number' && lifecycleEditor.editingIndex > idx) {\n lifecycleEditor.editingIndex -= 1;\n }\n renderLifecycleEditor();\n });\n });\n\n const cancelBtn = document.getElementById('lifecycleCancelRuleBtn');\n if (cancelBtn) {\n cancelBtn.addEventListener('click', function() {\n lifecycleEditor.editingIndex = null;\n lifecycleEditor.editingRule = null;\n renderLifecycleEditor();\n });\n }\n\n const addTagBtn = document.getElementById('lifecycleAddTagBtn');\n if (addTagBtn) {\n addTagBtn.addEventListener('click', function() {\n const rows = document.getElementById('lifecycleTagRows');\n const row = document.createElement('div');\n row.className = 'input-group input-group-sm mb-1 lifecycle-tag-row';\n row.innerHTML =\n '<input type=\"text\" class=\"form-control lifecycle-tag-key\" placeholder=\"Key\">' +\n '<input type=\"text\" class=\"form-control lifecycle-tag-value\" placeholder=\"Value\">' +\n '<button type=\"button\" class=\"btn btn-outline-danger lifecycle-remove-tag-btn\"><i class=\"bi bi-x\"><\\/i><\\/button>';\n rows.appendChild(row);\n row.querySelector('.lifecycle-remove-tag-btn').addEventListener('click', function() {\n row.remove();\n });\n });\n }\n\n document.querySelectorAll('.lifecycle-remove-tag-btn').forEach(btn => {\n btn.addEventListener('click', function() {\n this.closest('.lifecycle-tag-row').remove();\n });\n });\n\n bindLifecycleToggle('lifecycleExpireDaysEnabled', 'lifecycleExpireDays', 'lifecycleExpireDateEnabled');\n bindLifecycleToggle('lifecycleExpireDateEnabled', 'lifecycleExpireDate', 'lifecycleExpireDaysEnabled');\n bindLifecycleToggle('lifecycleNoncurrentEnabled', 'lifecycleNoncurrentDays');\n bindLifecycleToggle('lifecycleNoncurrentEnabled', 'lifecycleNoncurrentKeep');\n bindLifecycleToggle('lifecycleAbortMPUEnabled', 'lifecycleAbortMPUDays');\n\n const saveRuleBtn = document.getElementById('lifecycleSaveRuleBtn');\n if (saveRuleBtn) {\n saveRuleBtn.addEventListener('click', saveLifecycleRuleFromForm);\n }\n}\n\n// readLifecycleRuleFromForm builds and validates a rule from the currently\n// open edit form's DOM inputs. Returns { rule: null, error: '...' } when the\n// form doesn't hold a valid rule, without mutating any state.\nfunction readLifecycleRuleFromForm() {\n const id = document.getElementById('lifecycleRuleId').value.trim();\n const status = document.querySelector('input[name=\"lifecycleRuleStatus\"]:checked').value;\n const prefix = document.getElementById('lifecycleRulePrefix').value.trim();\n\n const tags = {};\n document.querySelectorAll('#lifecycleTagRows .lifecycle-tag-row').forEach(row => {\n const key = row.querySelector('.lifecycle-tag-key').value.trim();\n const value = row.querySelector('.lifecycle-tag-value').value.trim();\n if (key) {\n tags[key] = value;\n }\n });\n\n const sizeGT = parseInt(document.getElementById('lifecycleRuleSizeGT').value, 10) || 0;\n const sizeLT = parseInt(document.getElementById('lifecycleRuleSizeLT').value, 10) || 0;\n\n const expireDaysEnabled = document.getElementById('lifecycleExpireDaysEnabled').checked;\n const expireDateEnabled = document.getElementById('lifecycleExpireDateEnabled').checked;\n const expirationDays = expireDaysEnabled ? (parseInt(document.getElementById('lifecycleExpireDays').value, 10) || 0) : 0;\n const expirationDate = expireDateEnabled ? document.getElementById('lifecycleExpireDate').value : '';\n\n const deleteMarker = document.getElementById('lifecycleDeleteMarker').checked;\n\n const noncurrentEnabled = document.getElementById('lifecycleNoncurrentEnabled').checked;\n const noncurrentDays = noncurrentEnabled ? (parseInt(document.getElementById('lifecycleNoncurrentDays').value, 10) || 0) : 0;\n const noncurrentKeep = noncurrentEnabled ? (parseInt(document.getElementById('lifecycleNoncurrentKeep').value, 10) || 0) : 0;\n\n const abortEnabled = document.getElementById('lifecycleAbortMPUEnabled').checked;\n const abortDays = abortEnabled ? (parseInt(document.getElementById('lifecycleAbortMPUDays').value, 10) || 0) : 0;\n\n if (expireDaysEnabled && expirationDays <= 0) {\n return { rule: null, error: 'Enter a valid number of days for expiration.' };\n }\n if (expireDateEnabled && !expirationDate) {\n return { rule: null, error: 'Enter a valid expiration date.' };\n }\n if (noncurrentEnabled && noncurrentDays <= 0 && noncurrentKeep <= 0) {\n return { rule: null, error: 'Enter a number of days and/or a newest-versions-to-keep count for noncurrent version handling.' };\n }\n if (abortEnabled && abortDays <= 0) {\n return { rule: null, error: 'Enter a valid number of days for aborting incomplete multipart uploads.' };\n }\n if (!expireDaysEnabled && !expireDateEnabled && !deleteMarker && !noncurrentEnabled && !abortEnabled) {\n return { rule: null, error: 'Select at least one action for this rule.' };\n }\n // The server rejects this combination too; catching it here names the two\n // fields instead of surfacing a 400 after the whole set is submitted.\n if (deleteMarker && (expireDaysEnabled || expireDateEnabled)) {\n return { rule: null, error: 'Removing expired object delete markers cannot be combined with an expiration.' };\n }\n if (sizeGT > 0 && sizeLT > 0 && sizeGT >= sizeLT) {\n return { rule: null, error: '\"Size greater than\" must be less than \"size less than\".' };\n }\n\n return {\n rule: {\n id: id,\n status: status,\n prefix: prefix,\n tags: tags,\n size_greater_than: sizeGT > 0 ? sizeGT : null,\n size_less_than: sizeLT > 0 ? sizeLT : null,\n expiration_days: expirationDays > 0 ? expirationDays : null,\n expiration_date: expirationDate || '',\n expired_object_delete_marker: deleteMarker,\n noncurrent_version_expiration_days: noncurrentDays > 0 ? noncurrentDays : null,\n newer_noncurrent_versions: noncurrentKeep > 0 ? noncurrentKeep : null,\n abort_multipart_days: abortDays > 0 ? abortDays : null,\n },\n error: null,\n };\n}\n\nfunction saveLifecycleRuleFromForm() {\n const { rule, error } = readLifecycleRuleFromForm();\n if (error) {\n alert(error);\n return;\n }\n\n if (lifecycleEditor.editingIndex === 'new') {\n lifecycleEditor.rules.push(rule);\n } else {\n lifecycleEditor.rules[lifecycleEditor.editingIndex] = rule;\n }\n lifecycleEditor.editingIndex = null;\n lifecycleEditor.editingRule = null;\n renderLifecycleEditor();\n}\n\n// commitOpenLifecycleRuleForm folds an in-progress add/edit form into\n// lifecycleEditor.rules before the whole rule set is sent to the server, so\n// clicking the modal's \"Save\" without first clicking \"Save rule\" doesn't\n// silently drop the open edit. Returns false (and leaves the form open) when\n// the open form doesn't hold a valid rule, so the caller can abort the save.\nfunction commitOpenLifecycleRuleForm() {\n if (lifecycleEditor.editingIndex === null) {\n return true;\n }\n\n const { rule, error } = readLifecycleRuleFromForm();\n if (error) {\n alert(error);\n return false;\n }\n\n if (lifecycleEditor.editingIndex === 'new') {\n lifecycleEditor.rules.push(rule);\n } else {\n lifecycleEditor.rules[lifecycleEditor.editingIndex] = rule;\n }\n lifecycleEditor.editingIndex = null;\n lifecycleEditor.editingRule = null;\n renderLifecycleEditor();\n return true;\n}\n\n function goToPage(page) {\n const url = new URL(window.location);\n url.searchParams.set('page', page);\n window.location.href = url.toString();\n }\n\n function changePageSize() {\n const pageSize = document.getElementById('pageSizeSelect').value;\n const url = new URL(window.location);\n url.searchParams.set('pageSize', pageSize);\n url.searchParams.set('page', '1');\n window.location.href = url.toString();\n }\n\n function sortTable(column) {\n const url = new URL(window.location);\n const currentSort = url.searchParams.get('sortBy');\n const currentOrder = url.searchParams.get('sortOrder') || 'asc';\n\n let newOrder = 'asc';\n if (currentSort === column && currentOrder === 'asc') {\n newOrder = 'desc';\n }\n\n url.searchParams.set('sortBy', column);\n url.searchParams.set('sortOrder', newOrder);\n url.searchParams.set('page', '1');\n window.location.href = url.toString();\n }\n\n function exportBucketList() {\n // RFC 4180 compliant CSV escaping: escape double quotes by doubling them\n function escapeCsvField(value) {\n const str = String(value ?? '');\n if (str.includes(',') || str.includes('\"') || str.includes('\\n') || str.includes('\\r')) {\n return '\"' + str.replace(/\"/g, '\"\"') + '\"';\n }\n return '\"' + str + '\"';\n }\n\n // Fetch all buckets from the API (not just the current page)\n fetch(basePath('/api/s3/buckets'))\n .then(response => response.json())\n .then(data => {\n if (data.error) {\n alert('Error exporting buckets: ' + data.error);\n return;\n }\n\n const buckets = data.buckets || [];\n const csvContent = \"Name,Owner,Logical Size,Physical Size,Created,Quota,Versioning,Object Lock\\n\" +\n buckets.map(b => [\n escapeCsvField(b.name),\n escapeCsvField(b.owner),\n escapeCsvField(formatBytes(b.logical_size)),\n escapeCsvField(formatBytes(b.physical_size)),\n escapeCsvField(b.created_at),\n escapeCsvField(b.quota_enabled ? formatBytes(b.quota) : 'No quota'),\n escapeCsvField(b.versioning_status || 'Not configured'),\n escapeCsvField(b.object_lock_enabled ? 'Enabled' : 'Not configured')\n ].join(',')).join(\"\\n\");\n\n downloadCSV(csvContent, \"buckets.csv\");\n })\n .catch(error => {\n console.error('Error:', error);\n alert('Error exporting buckets: ' + error.message);\n });\n }\n </script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/weed/admin/view/app/service_accounts.templ b/weed/admin/view/app/service_accounts.templ
index b69916ed15..1face7f3e1 100644
--- a/weed/admin/view/app/service_accounts.templ
+++ b/weed/admin/view/app/service_accounts.templ
@@ -65,37 +65,12 @@ templ ServiceAccounts(data dash.ServiceAccountsData) {
</div>
</div>
</div>
-
- <div class="col-xl-3 col-md-6 mb-4">
- <div class="card border-left-info shadow h-100 py-2">
- <div class="card-body">
- <div class="row no-gutters align-items-center">
- <div class="col mr-2">
- <div class="text-xs font-weight-bold text-info text-uppercase mb-1">
- Last Updated
- </div>
- <div class="h6 mb-0 font-weight-bold text-gray-800">
- {data.LastUpdated.Format("15:04")}
- </div>
- </div>
- <div class="col-auto">
- <i class="bi bi-clock icon-2x text-gray-300"></i>
- </div>
- </div>
- </div>
- </div>
- </div>
</div>
<!-- Service Accounts Table -->
<div class="row">
<div class="col-12">
<div class="card shadow mb-4">
- <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
- <h6 class="m-0 font-weight-bold text-primary">
- <i class="bi bi-robot me-2"></i>Service Accounts
- </h6>
- </div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover" width="100%" cellspacing="0" id="serviceAccountsTable">
diff --git a/weed/admin/view/app/service_accounts_templ.go b/weed/admin/view/app/service_accounts_templ.go
index 307e4cb075..8a8f27fad0 100644
--- a/weed/admin/view/app/service_accounts_templ.go
+++ b/weed/admin/view/app/service_accounts_templ.go
@@ -57,219 +57,206 @@ func ServiceAccounts(data dash.ServiceAccountsData) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</div></div><div class=\"col-auto\"><i class=\"bi bi-check-circle icon-2x text-gray-300\"></i></div></div></div></div></div><div class=\"col-xl-3 col-md-6 mb-4\"><div class=\"card border-left-info shadow h-100 py-2\"><div class=\"card-body\"><div class=\"row no-gutters align-items-center\"><div class=\"col mr-2\"><div class=\"text-xs font-weight-bold text-info text-uppercase mb-1\">Last Updated</div><div class=\"h6 mb-0 font-weight-bold text-gray-800\">")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var4 string
- templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("15:04"))
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 78, Col: 69}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</div></div><div class=\"col-auto\"><i class=\"bi bi-clock icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Service Accounts Table --><div class=\"row\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-header py-3 d-flex flex-row align-items-center justify-content-between\"><h6 class=\"m-0 font-weight-bold text-primary\"><i class=\"bi bi-robot me-2\"></i>Service Accounts</h6></div><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\" id=\"serviceAccountsTable\"><thead><tr><th>ID</th><th>Parent User</th><th>Access Key</th><th>Status</th><th>Created</th><th>Actions</th></tr></thead> <tbody>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</div></div><div class=\"col-auto\"><i class=\"bi bi-check-circle icon-2x text-gray-300\"></i></div></div></div></div></div></div><!-- Service Accounts Table --><div class=\"row\"><div class=\"col-12\"><div class=\"card shadow mb-4\"><div class=\"card-body\"><div class=\"table-responsive\"><table class=\"table table-hover\" width=\"100%\" cellspacing=\"0\" id=\"serviceAccountsTable\"><thead><tr><th>ID</th><th>Parent User</th><th>Access Key</th><th>Status</th><th>Created</th><th>Actions</th></tr></thead> <tbody>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, sa := range data.ServiceAccounts {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<tr><td><div class=\"d-flex align-items-center\"><i class=\"bi bi-robot me-2 text-muted\"></i> <code>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "<tr><td><div class=\"d-flex align-items-center\"><i class=\"bi bi-robot me-2 text-muted\"></i> <code>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var5 string
- templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(sa.ID)
+ var templ_7745c5c3_Var4 string
+ templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(sa.ID)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 118, Col: 64}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 93, Col: 64}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</code></div></td><td><i class=\"bi bi-person me-1 text-muted\"></i> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "</code></div></td><td><i class=\"bi bi-person me-1 text-muted\"></i> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var6 string
- templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(sa.ParentUser)
+ var templ_7745c5c3_Var5 string
+ templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(sa.ParentUser)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 123, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 98, Col: 62}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</td><td><code class=\"text-muted\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</td><td><code class=\"text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var7 string
- templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(sa.AccessKeyId)
+ var templ_7745c5c3_Var6 string
+ templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(sa.AccessKeyId)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 126, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 101, Col: 88}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</code></td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</code></td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if sa.Status == dash.StatusActive {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "<span class=\"badge bg-success\">Active</span>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<span class=\"badge bg-success\">Active</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<span class=\"badge bg-secondary\">Inactive</span>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "<span class=\"badge bg-secondary\">Inactive</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</td><td>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var8 string
- templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(sa.CreateDate.Format("2006-01-02"))
+ var templ_7745c5c3_Var7 string
+ templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(sa.CreateDate.Format("2006-01-02"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 135, Col: 83}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 110, Col: 83}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "</td><td><div class=\"btn-group btn-group-sm\" role=\"group\"><button type=\"button\" class=\"btn btn-outline-info\" data-action=\"show-sa-details\" data-sa-id=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</td><td><div class=\"btn-group btn-group-sm\" role=\"group\"><button type=\"button\" class=\"btn btn-outline-info\" data-action=\"show-sa-details\" data-sa-id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var9 string
- templ_7745c5c3_Var9, templ_7745c5c3_Err = templruntime.NewAttributeExpression(sa.ID).Resolve(ctx)
+ var templ_7745c5c3_Var8 string
+ templ_7745c5c3_Var8, templ_7745c5c3_Err = templruntime.NewAttributeExpression(sa.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 139, Col: 108}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 114, Col: 108}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\"><i class=\"bi bi-info-circle\"></i></button> <button type=\"button\" class=\"btn btn-outline-primary\" data-action=\"toggle-sa-status\" data-sa-id=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\"><i class=\"bi bi-info-circle\"></i></button> <button type=\"button\" class=\"btn btn-outline-primary\" data-action=\"toggle-sa-status\" data-sa-id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var10 string
- templ_7745c5c3_Var10, templ_7745c5c3_Err = templruntime.NewAttributeExpression(sa.ID).Resolve(ctx)
+ var templ_7745c5c3_Var9 string
+ templ_7745c5c3_Var9, templ_7745c5c3_Err = templruntime.NewAttributeExpression(sa.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 143, Col: 109}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 118, Col: 109}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "\" data-current-status=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\" data-current-status=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var11 string
- templ_7745c5c3_Var11, templ_7745c5c3_Err = templruntime.NewAttributeExpression(sa.Status).Resolve(ctx)
+ var templ_7745c5c3_Var10 string
+ templ_7745c5c3_Var10, templ_7745c5c3_Err = templruntime.NewAttributeExpression(sa.Status).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 143, Col: 143}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 118, Col: 143}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if sa.Status == dash.StatusActive {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<i class=\"bi bi-pause\"></i>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "<i class=\"bi bi-pause\"></i>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "<i class=\"bi bi-play\"></i>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<i class=\"bi bi-play\"></i>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</button> <button type=\"button\" class=\"btn btn-outline-danger\" data-action=\"delete-sa\" data-sa-id=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</button> <button type=\"button\" class=\"btn btn-outline-danger\" data-action=\"delete-sa\" data-sa-id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var12 string
- templ_7745c5c3_Var12, templ_7745c5c3_Err = templruntime.NewAttributeExpression(sa.ID).Resolve(ctx)
+ var templ_7745c5c3_Var11 string
+ templ_7745c5c3_Var11, templ_7745c5c3_Err = templruntime.NewAttributeExpression(sa.ID).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 151, Col: 102}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 126, Col: 102}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "\"><i class=\"bi bi-trash\"></i></button></div></td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "\"><i class=\"bi bi-trash\"></i></button></div></td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if len(data.ServiceAccounts) == 0 {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<tr><td colspan=\"6\" class=\"text-center text-muted py-4\"><i class=\"bi bi-robot icon-3x mb-3 text-muted\"></i><div><h5>No service accounts found</h5><p>Create your first service account for automated processes.</p></div></td></tr>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "<tr><td colspan=\"6\" class=\"text-center text-muted py-4\"><i class=\"bi bi-robot icon-3x mb-3 text-muted\"></i><div><h5>No service accounts found</h5><p>Create your first service account for automated processes.</p></div></td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</tbody></table></div></div></div></div></div><!-- Last Updated --><div class=\"row\"><div class=\"col-12\"><small class=\"text-muted\"><i class=\"bi bi-clock me-1\"></i> Last updated: ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "</tbody></table></div></div></div></div></div><!-- Last Updated --><div class=\"row\"><div class=\"col-12\"><small class=\"text-muted\"><i class=\"bi bi-clock me-1\"></i> Last updated: ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var13 string
- templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))
+ var templ_7745c5c3_Var12 string
+ templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 182, Col: 81}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 157, Col: 81}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</small></div></div></div><!-- Create Service Account Modal --><div class=\"modal fade\" id=\"createServiceAccountModal\" tabindex=\"-1\" role=\"dialog\"><div class=\"modal-dialog\" role=\"document\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\"><i class=\"bi bi-plus me-2\"></i>Create Service Account</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\"></button></div><div class=\"modal-body\"><form id=\"createSAForm\"><div class=\"mb-3\"><label for=\"parentUser\" class=\"form-label\">Parent User *</label> <select class=\"form-select\" id=\"parentUser\" name=\"parent_user\" required><option value=\"\">-- Select a user --</option> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</small></div></div></div><!-- Create Service Account Modal --><div class=\"modal fade\" id=\"createServiceAccountModal\" tabindex=\"-1\" role=\"dialog\"><div class=\"modal-dialog\" role=\"document\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\"><i class=\"bi bi-plus me-2\"></i>Create Service Account</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\"></button></div><div class=\"modal-body\"><form id=\"createSAForm\"><div class=\"mb-3\"><label for=\"parentUser\" class=\"form-label\">Parent User *</label> <select class=\"form-select\" id=\"parentUser\" name=\"parent_user\" required><option value=\"\">-- Select a user --</option> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, user := range data.AvailableUsers {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<option value=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "<option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var14 string
- templ_7745c5c3_Var14, templ_7745c5c3_Err = templruntime.NewAttributeExpression(user).Resolve(ctx)
+ var templ_7745c5c3_Var13 string
+ templ_7745c5c3_Var13, templ_7745c5c3_Err = templruntime.NewAttributeExpression(user).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 205, Col: 56}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 180, Col: 56}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var15 string
- templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(user)
+ var templ_7745c5c3_Var14 string
+ templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(user)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 205, Col: 65}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/service_accounts.templ`, Line: 180, Col: 65}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "</option>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</option>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "</select> <small class=\"form-text text-muted\">The service account will inherit permissions from this user</small></div><div class=\"mb-3\"><label for=\"description\" class=\"form-label\">Description</label> <textarea class=\"form-control\" id=\"description\" name=\"description\" rows=\"2\" placeholder=\"What is this service account used for?\"></textarea></div><div class=\"mb-3\"><label for=\"expiration\" class=\"form-label\">Expiration (optional)</label> <input type=\"datetime-local\" class=\"form-control\" id=\"expiration\" name=\"expiration\"> <small class=\"form-text text-muted\">Leave empty for no expiration</small></div></form></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-primary\" onclick=\"handleCreateServiceAccount()\">Create</button></div></div></div></div><!-- Service Account Details Modal --><div class=\"modal fade\" id=\"saDetailsModal\" tabindex=\"-1\" role=\"dialog\"><div class=\"modal-dialog modal-lg\" role=\"document\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\"><i class=\"bi bi-robot me-2\"></i>Service Account Details</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\"></button></div><div class=\"modal-body\" id=\"saDetailsContent\"><!-- Content will be loaded dynamically --></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Close</button></div></div></div></div><!-- Credentials Display Modal --><div class=\"modal fade\" id=\"credentialsModal\" tabindex=\"-1\" role=\"dialog\" data-bs-backdrop=\"static\" data-bs-keyboard=\"false\"><div class=\"modal-dialog modal-lg\" role=\"document\"><div class=\"modal-content\"><div class=\"modal-header bg-success text-white\"><h5 class=\"modal-title\"><i class=\"bi bi-check-circle me-2\"></i>Service Account Created Successfully</h5></div><div class=\"modal-body\"><div class=\"alert alert-warning\"><i class=\"bi bi-exclamation-triangle me-2\"></i> <strong>Important:</strong> This is the only time you will see the secret access key. Please save it securely.</div><div class=\"mb-4\"><h6 class=\"text-muted mb-3\">AWS CLI Configuration</h6><p class=\"text-muted small\">Use these credentials to configure AWS CLI or SDKs:</p><div class=\"mb-3\"><label class=\"form-label fw-bold\">AWS_ACCESS_KEY_ID</label><div class=\"input-group\"><input type=\"text\" class=\"form-control font-monospace\" id=\"displayAccessKey\" readonly> <button class=\"btn btn-outline-secondary\" type=\"button\" onclick=\"copyCredentialToClipboard(this, 'displayAccessKey')\"><i class=\"bi bi-copy\"></i> Copy</button></div></div><div class=\"mb-3\"><label class=\"form-label fw-bold\">AWS_SECRET_ACCESS_KEY</label><div class=\"input-group\"><input type=\"text\" class=\"form-control font-monospace\" id=\"displaySecretKey\" readonly> <button class=\"btn btn-outline-secondary\" type=\"button\" onclick=\"copyCredentialToClipboard(this, 'displaySecretKey')\"><i class=\"bi bi-copy\"></i> Copy</button></div></div></div><div class=\"bg-light p-3 rounded\"><h6 class=\"text-muted mb-2\">Example AWS CLI Usage:</h6><div class=\"font-monospace small\"><div>export AWS_ACCESS_KEY_ID=<span id=\"exampleAccessKey\"></span></div><div>export AWS_SECRET_ACCESS_KEY=<span id=\"exampleSecretKey\"></span></div><div>export AWS_ENDPOINT_URL=http://localhost:8333</div><div class=\"mt-2\"># List buckets</div><div>aws s3 ls</div><div class=\"mt-2\"># Upload a file</div><div>aws s3 cp myfile.txt s3://mybucket/</div></div></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-primary\" onclick=\"closeCredentialsModal()\"><i class=\"bi bi-check me-1\"></i>I have saved the credentials</button></div></div></div></div><!-- JavaScript for service account management --><script>\n document.addEventListener('DOMContentLoaded', function() {\n document.addEventListener('click', function(e) {\n const button = e.target.closest('[data-action]');\n if (!button) return;\n \n const action = button.getAttribute('data-action');\n const saId = button.getAttribute('data-sa-id');\n \n switch (action) {\n case 'show-sa-details':\n showSADetails(saId);\n break;\n case 'toggle-sa-status':\n toggleSAStatus(saId, button.getAttribute('data-current-status'));\n break;\n case 'delete-sa':\n deleteSA(saId);\n break;\n }\n });\n });\n\n async function showSADetails(id) {\n try {\n const encodedId = encodeURIComponent(id);\n const response = await fetch(basePath(`/api/service-accounts/${encodedId}`));\n if (response.ok) {\n const sa = await response.json();\n document.getElementById('saDetailsContent').innerHTML = createSADetailsContent(sa);\n const modal = new bootstrap.Modal(document.getElementById('saDetailsModal'));\n modal.show();\n } else {\n showErrorMessage('Failed to load service account details');\n }\n } catch (error) {\n console.error('Error loading service account details:', error);\n showErrorMessage('Failed to load service account details');\n }\n }\n\n async function toggleSAStatus(id, currentStatus) {\n const newStatus = currentStatus === 'Active' ? 'Inactive' : 'Active';\n try {\n const encodedId = encodeURIComponent(id);\n const response = await fetch(basePath(`/api/service-accounts/${encodedId}`), {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ status: newStatus })\n });\n \n if (response.ok) {\n showSuccessMessage(`Service account ${newStatus === 'Active' ? 'activated' : 'deactivated'}`);\n setTimeout(() => window.location.reload(), 1000);\n } else {\n const error = await response.json();\n showErrorMessage('Failed to update status: ' + (error.error || 'Unknown error'));\n }\n } catch (error) {\n console.error('Error updating status:', error);\n showErrorMessage('Failed to update status: ' + error.message);\n }\n }\n\n async function deleteSA(id) {\n showDeleteConfirm(id, async function() {\n try {\n const encodedId = encodeURIComponent(id);\n const response = await fetch(basePath(`/api/service-accounts/${encodedId}`), {\n method: 'DELETE'\n });\n \n if (response.ok) {\n showSuccessMessage('Service account deleted successfully');\n setTimeout(() => window.location.reload(), 1000);\n } else {\n const error = await response.json();\n showErrorMessage('Failed to delete: ' + (error.error || 'Unknown error'));\n }\n } catch (error) {\n console.error('Error deleting service account:', error);\n showErrorMessage('Failed to delete: ' + error.message);\n }\n }, 'Are you sure you want to delete this service account? This action cannot be undone.');\n }\n\n async function handleCreateServiceAccount() {\n const form = document.getElementById('createSAForm');\n const formData = new FormData(form);\n \n const saData = {\n parent_user: formData.get('parent_user'),\n description: formData.get('description')\n };\n \n // Handle expiration if set\n const expiration = formData.get('expiration');\n if (expiration) {\n // Validate the date before using it\n const date = new Date(expiration);\n const now = new Date();\n \n if (isNaN(date.getTime())) {\n showErrorMessage('Invalid expiration date format');\n return;\n }\n \n // Ensure expiration is in the future\n if (date <= now) {\n showErrorMessage('Expiration date must be in the future');\n return;\n }\n \n saData.expiration = date.toISOString();\n }\n \n try {\n const response = await fetch(basePath('/api/service-accounts'), {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(saData)\n });\n \n if (response.ok) {\n const result = await response.json();\n \n // Hide create modal\n const createModal = bootstrap.Modal.getInstance(document.getElementById('createServiceAccountModal'));\n createModal.hide();\n form.reset();\n \n // Show credentials if returned\n if (result.service_account && result.service_account.secret_access_key) {\n showCredentials(result.service_account);\n } else {\n showSuccessMessage('Service account created successfully');\n setTimeout(() => window.location.reload(), 1000);\n }\n } else {\n const error = await response.json();\n showErrorMessage('Failed to create service account: ' + (error.error || 'Unknown error'));\n }\n } catch (error) {\n console.error('Error creating service account:', error);\n showErrorMessage('Failed to create service account: ' + error.message);\n }\n }\n\n function showCredentials(serviceAccount) {\n // Populate the credentials modal\n document.getElementById('displayAccessKey').value = serviceAccount.access_key_id;\n document.getElementById('displaySecretKey').value = serviceAccount.secret_access_key;\n document.getElementById('exampleAccessKey').textContent = serviceAccount.access_key_id;\n document.getElementById('exampleSecretKey').textContent = serviceAccount.secret_access_key;\n \n // Show the modal\n const credentialsModal = new bootstrap.Modal(document.getElementById('credentialsModal'));\n credentialsModal.show();\n }\n\n function closeCredentialsModal() {\n const modal = bootstrap.Modal.getInstance(document.getElementById('credentialsModal'));\n modal.hide();\n // Reload to show the new service account in the list\n setTimeout(() => window.location.reload(), 500);\n }\n\n function copyCredentialToClipboard(button, elementId) {\n const element = document.getElementById(elementId);\n const textToCopy = element.value;\n \n // Use modern Clipboard API if available\n if (navigator.clipboard && navigator.clipboard.writeText) {\n navigator.clipboard.writeText(textToCopy).then(() => {\n showSuccessMessage('Copied to clipboard!');\n }).catch(err => {\n console.warn('Clipboard API failed:', err);\n // Fallback\n fallbackCopyTextToClipboard(element);\n });\n } else {\n // Fallback for older browsers or non-secure contexts\n fallbackCopyTextToClipboard(element);\n }\n \n // Visual feedback\n const originalHTML = button.innerHTML;\n \n button.innerHTML = '<i class=\"bi bi-check\"></i>';\n button.classList.remove('btn-outline-secondary');\n button.classList.add('btn-success');\n \n setTimeout(() => {\n button.innerHTML = originalHTML;\n button.classList.remove('btn-success');\n button.classList.add('btn-outline-secondary');\n }, 1000);\n }\n\n function fallbackCopyTextToClipboard(element) {\n element.select();\n element.setSelectionRange(0, 99999); // For mobile devices\n \n try {\n const successful = document.execCommand('copy');\n if (successful) {\n showSuccessMessage('Copied to clipboard!');\n } else {\n showErrorMessage('Failed to copy to clipboard');\n }\n } catch (err) {\n console.error('Fallback copy failed:', err);\n showErrorMessage('Failed to copy to clipboard');\n }\n \n // Clear selection\n window.getSelection().removeAllRanges();\n }\n\n\n function createSADetailsContent(sa) {\n // Create DOM elements safely to prevent XSS\n const container = document.createElement('div');\n container.className = 'row';\n \n // Basic Information column\n const col1 = document.createElement('div');\n col1.className = 'col-md-6';\n \n const h6_1 = document.createElement('h6');\n h6_1.className = 'text-muted';\n h6_1.textContent = 'Basic Information';\n col1.appendChild(h6_1);\n \n const table1 = document.createElement('table');\n table1.className = 'table table-sm';\n \n // ID row\n const idRow = document.createElement('tr');\n idRow.innerHTML = '<td><strong>ID:</strong></td><td><code></code></td>';\n idRow.querySelector('code').textContent = sa.id || '';\n table1.appendChild(idRow);\n \n // Parent User row\n const parentRow = document.createElement('tr');\n parentRow.innerHTML = '<td><strong>Parent User:</strong></td><td></td>';\n parentRow.querySelectorAll('td')[1].textContent = sa.parent_user || '';\n table1.appendChild(parentRow);\n \n // Access Key row\n const keyRow = document.createElement('tr');\n keyRow.innerHTML = '<td><strong>Access Key:</strong></td><td><code></code></td>';\n keyRow.querySelector('code').textContent = sa.access_key_id || '';\n table1.appendChild(keyRow);\n \n // Status row\n const statusRow = document.createElement('tr');\n const statusTd1 = document.createElement('td');\n statusTd1.innerHTML = '<strong>Status:</strong>';\n const statusTd2 = document.createElement('td');\n const statusBadge = document.createElement('span');\n statusBadge.className = sa.status === 'Active' ? 'badge bg-success' : 'badge bg-secondary';\n statusBadge.textContent = sa.status || 'Unknown';\n statusTd2.appendChild(statusBadge);\n statusRow.appendChild(statusTd1);\n statusRow.appendChild(statusTd2);\n table1.appendChild(statusRow);\n \n col1.appendChild(table1);\n container.appendChild(col1);\n \n // Details column\n const col2 = document.createElement('div');\n col2.className = 'col-md-6';\n \n const h6_2 = document.createElement('h6');\n h6_2.className = 'text-muted';\n h6_2.textContent = 'Details';\n col2.appendChild(h6_2);\n \n const table2 = document.createElement('table');\n table2.className = 'table table-sm';\n \n // Description row\n const descRow = document.createElement('tr');\n descRow.innerHTML = '<td><strong>Description:</strong></td><td></td>';\n descRow.querySelectorAll('td')[1].textContent = sa.description || 'Not set';\n table2.appendChild(descRow);\n \n // Created row\n const createdRow = document.createElement('tr');\n createdRow.innerHTML = '<td><strong>Created:</strong></td><td></td>';\n try {\n createdRow.querySelectorAll('td')[1].textContent = new Date(sa.create_date).toLocaleString();\n } catch (e) {\n createdRow.querySelectorAll('td')[1].textContent = 'Invalid date';\n }\n table2.appendChild(createdRow);\n \n // Expiration row\n const expRow = document.createElement('tr');\n expRow.innerHTML = '<td><strong>Expires:</strong></td><td></td>';\n expRow.querySelectorAll('td')[1].textContent = sa.expiration || 'Never';\n table2.appendChild(expRow);\n \n col2.appendChild(table2);\n container.appendChild(col2);\n \n return container.outerHTML;\n }\n\n\n function showSuccessMessage(message) {\n showToast(message, 'success');\n }\n\n function showErrorMessage(message) {\n showToast(message, 'danger');\n }\n\n function showToast(message, type) {\n // Create toast container if it doesn't exist\n let toastContainer = document.getElementById('toastContainer');\n if (!toastContainer) {\n toastContainer = document.createElement('div');\n toastContainer.id = 'toastContainer';\n toastContainer.className = 'toast-container position-fixed top-0 end-0 p-3';\n toastContainer.style.zIndex = '9999';\n document.body.appendChild(toastContainer);\n }\n\n // Create toast element\n const toastId = 'toast-' + Date.now();\n const toastHTML = `\n <div id=\"${toastId}\" class=\"toast align-items-center text-white bg-${type} border-0\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\">\n <div class=\"d-flex\">\n <div class=\"toast-body\">\n ${escapeHtml(message)}\n </div>\n <button type=\"button\" class=\"btn-close btn-close-white me-2 m-auto\" data-bs-dismiss=\"toast\" aria-label=\"Close\"></button>\n </div>\n </div>\n `;\n \n toastContainer.insertAdjacentHTML('beforeend', toastHTML);\n const toastElement = document.getElementById(toastId);\n const toast = new bootstrap.Toast(toastElement, { autohide: true, delay: 5000 });\n toast.show();\n \n // Remove toast element after it's hidden\n toastElement.addEventListener('hidden.bs.toast', () => {\n toastElement.remove();\n });\n }\n\n function escapeHtml(text) {\n const div = document.createElement('div');\n div.textContent = text;\n return div.innerHTML;\n }\n </script>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "</select> <small class=\"form-text text-muted\">The service account will inherit permissions from this user</small></div><div class=\"mb-3\"><label for=\"description\" class=\"form-label\">Description</label> <textarea class=\"form-control\" id=\"description\" name=\"description\" rows=\"2\" placeholder=\"What is this service account used for?\"></textarea></div><div class=\"mb-3\"><label for=\"expiration\" class=\"form-label\">Expiration (optional)</label> <input type=\"datetime-local\" class=\"form-control\" id=\"expiration\" name=\"expiration\"> <small class=\"form-text text-muted\">Leave empty for no expiration</small></div></form></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button> <button type=\"button\" class=\"btn btn-primary\" onclick=\"handleCreateServiceAccount()\">Create</button></div></div></div></div><!-- Service Account Details Modal --><div class=\"modal fade\" id=\"saDetailsModal\" tabindex=\"-1\" role=\"dialog\"><div class=\"modal-dialog modal-lg\" role=\"document\"><div class=\"modal-content\"><div class=\"modal-header\"><h5 class=\"modal-title\"><i class=\"bi bi-robot me-2\"></i>Service Account Details</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\"></button></div><div class=\"modal-body\" id=\"saDetailsContent\"><!-- Content will be loaded dynamically --></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Close</button></div></div></div></div><!-- Credentials Display Modal --><div class=\"modal fade\" id=\"credentialsModal\" tabindex=\"-1\" role=\"dialog\" data-bs-backdrop=\"static\" data-bs-keyboard=\"false\"><div class=\"modal-dialog modal-lg\" role=\"document\"><div class=\"modal-content\"><div class=\"modal-header bg-success text-white\"><h5 class=\"modal-title\"><i class=\"bi bi-check-circle me-2\"></i>Service Account Created Successfully</h5></div><div class=\"modal-body\"><div class=\"alert alert-warning\"><i class=\"bi bi-exclamation-triangle me-2\"></i> <strong>Important:</strong> This is the only time you will see the secret access key. Please save it securely.</div><div class=\"mb-4\"><h6 class=\"text-muted mb-3\">AWS CLI Configuration</h6><p class=\"text-muted small\">Use these credentials to configure AWS CLI or SDKs:</p><div class=\"mb-3\"><label class=\"form-label fw-bold\">AWS_ACCESS_KEY_ID</label><div class=\"input-group\"><input type=\"text\" class=\"form-control font-monospace\" id=\"displayAccessKey\" readonly> <button class=\"btn btn-outline-secondary\" type=\"button\" onclick=\"copyCredentialToClipboard(this, 'displayAccessKey')\"><i class=\"bi bi-copy\"></i> Copy</button></div></div><div class=\"mb-3\"><label class=\"form-label fw-bold\">AWS_SECRET_ACCESS_KEY</label><div class=\"input-group\"><input type=\"text\" class=\"form-control font-monospace\" id=\"displaySecretKey\" readonly> <button class=\"btn btn-outline-secondary\" type=\"button\" onclick=\"copyCredentialToClipboard(this, 'displaySecretKey')\"><i class=\"bi bi-copy\"></i> Copy</button></div></div></div><div class=\"bg-light p-3 rounded\"><h6 class=\"text-muted mb-2\">Example AWS CLI Usage:</h6><div class=\"font-monospace small\"><div>export AWS_ACCESS_KEY_ID=<span id=\"exampleAccessKey\"></span></div><div>export AWS_SECRET_ACCESS_KEY=<span id=\"exampleSecretKey\"></span></div><div>export AWS_ENDPOINT_URL=http://localhost:8333</div><div class=\"mt-2\"># List buckets</div><div>aws s3 ls</div><div class=\"mt-2\"># Upload a file</div><div>aws s3 cp myfile.txt s3://mybucket/</div></div></div></div><div class=\"modal-footer\"><button type=\"button\" class=\"btn btn-primary\" onclick=\"closeCredentialsModal()\"><i class=\"bi bi-check me-1\"></i>I have saved the credentials</button></div></div></div></div><!-- JavaScript for service account management --><script>\n document.addEventListener('DOMContentLoaded', function() {\n document.addEventListener('click', function(e) {\n const button = e.target.closest('[data-action]');\n if (!button) return;\n \n const action = button.getAttribute('data-action');\n const saId = button.getAttribute('data-sa-id');\n \n switch (action) {\n case 'show-sa-details':\n showSADetails(saId);\n break;\n case 'toggle-sa-status':\n toggleSAStatus(saId, button.getAttribute('data-current-status'));\n break;\n case 'delete-sa':\n deleteSA(saId);\n break;\n }\n });\n });\n\n async function showSADetails(id) {\n try {\n const encodedId = encodeURIComponent(id);\n const response = await fetch(basePath(`/api/service-accounts/${encodedId}`));\n if (response.ok) {\n const sa = await response.json();\n document.getElementById('saDetailsContent').innerHTML = createSADetailsContent(sa);\n const modal = new bootstrap.Modal(document.getElementById('saDetailsModal'));\n modal.show();\n } else {\n showErrorMessage('Failed to load service account details');\n }\n } catch (error) {\n console.error('Error loading service account details:', error);\n showErrorMessage('Failed to load service account details');\n }\n }\n\n async function toggleSAStatus(id, currentStatus) {\n const newStatus = currentStatus === 'Active' ? 'Inactive' : 'Active';\n try {\n const encodedId = encodeURIComponent(id);\n const response = await fetch(basePath(`/api/service-accounts/${encodedId}`), {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ status: newStatus })\n });\n \n if (response.ok) {\n showSuccessMessage(`Service account ${newStatus === 'Active' ? 'activated' : 'deactivated'}`);\n setTimeout(() => window.location.reload(), 1000);\n } else {\n const error = await response.json();\n showErrorMessage('Failed to update status: ' + (error.error || 'Unknown error'));\n }\n } catch (error) {\n console.error('Error updating status:', error);\n showErrorMessage('Failed to update status: ' + error.message);\n }\n }\n\n async function deleteSA(id) {\n showDeleteConfirm(id, async function() {\n try {\n const encodedId = encodeURIComponent(id);\n const response = await fetch(basePath(`/api/service-accounts/${encodedId}`), {\n method: 'DELETE'\n });\n \n if (response.ok) {\n showSuccessMessage('Service account deleted successfully');\n setTimeout(() => window.location.reload(), 1000);\n } else {\n const error = await response.json();\n showErrorMessage('Failed to delete: ' + (error.error || 'Unknown error'));\n }\n } catch (error) {\n console.error('Error deleting service account:', error);\n showErrorMessage('Failed to delete: ' + error.message);\n }\n }, 'Are you sure you want to delete this service account? This action cannot be undone.');\n }\n\n async function handleCreateServiceAccount() {\n const form = document.getElementById('createSAForm');\n const formData = new FormData(form);\n \n const saData = {\n parent_user: formData.get('parent_user'),\n description: formData.get('description')\n };\n \n // Handle expiration if set\n const expiration = formData.get('expiration');\n if (expiration) {\n // Validate the date before using it\n const date = new Date(expiration);\n const now = new Date();\n \n if (isNaN(date.getTime())) {\n showErrorMessage('Invalid expiration date format');\n return;\n }\n \n // Ensure expiration is in the future\n if (date <= now) {\n showErrorMessage('Expiration date must be in the future');\n return;\n }\n \n saData.expiration = date.toISOString();\n }\n \n try {\n const response = await fetch(basePath('/api/service-accounts'), {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(saData)\n });\n \n if (response.ok) {\n const result = await response.json();\n \n // Hide create modal\n const createModal = bootstrap.Modal.getInstance(document.getElementById('createServiceAccountModal'));\n createModal.hide();\n form.reset();\n \n // Show credentials if returned\n if (result.service_account && result.service_account.secret_access_key) {\n showCredentials(result.service_account);\n } else {\n showSuccessMessage('Service account created successfully');\n setTimeout(() => window.location.reload(), 1000);\n }\n } else {\n const error = await response.json();\n showErrorMessage('Failed to create service account: ' + (error.error || 'Unknown error'));\n }\n } catch (error) {\n console.error('Error creating service account:', error);\n showErrorMessage('Failed to create service account: ' + error.message);\n }\n }\n\n function showCredentials(serviceAccount) {\n // Populate the credentials modal\n document.getElementById('displayAccessKey').value = serviceAccount.access_key_id;\n document.getElementById('displaySecretKey').value = serviceAccount.secret_access_key;\n document.getElementById('exampleAccessKey').textContent = serviceAccount.access_key_id;\n document.getElementById('exampleSecretKey').textContent = serviceAccount.secret_access_key;\n \n // Show the modal\n const credentialsModal = new bootstrap.Modal(document.getElementById('credentialsModal'));\n credentialsModal.show();\n }\n\n function closeCredentialsModal() {\n const modal = bootstrap.Modal.getInstance(document.getElementById('credentialsModal'));\n modal.hide();\n // Reload to show the new service account in the list\n setTimeout(() => window.location.reload(), 500);\n }\n\n function copyCredentialToClipboard(button, elementId) {\n const element = document.getElementById(elementId);\n const textToCopy = element.value;\n \n // Use modern Clipboard API if available\n if (navigator.clipboard && navigator.clipboard.writeText) {\n navigator.clipboard.writeText(textToCopy).then(() => {\n showSuccessMessage('Copied to clipboard!');\n }).catch(err => {\n console.warn('Clipboard API failed:', err);\n // Fallback\n fallbackCopyTextToClipboard(element);\n });\n } else {\n // Fallback for older browsers or non-secure contexts\n fallbackCopyTextToClipboard(element);\n }\n \n // Visual feedback\n const originalHTML = button.innerHTML;\n \n button.innerHTML = '<i class=\"bi bi-check\"></i>';\n button.classList.remove('btn-outline-secondary');\n button.classList.add('btn-success');\n \n setTimeout(() => {\n button.innerHTML = originalHTML;\n button.classList.remove('btn-success');\n button.classList.add('btn-outline-secondary');\n }, 1000);\n }\n\n function fallbackCopyTextToClipboard(element) {\n element.select();\n element.setSelectionRange(0, 99999); // For mobile devices\n \n try {\n const successful = document.execCommand('copy');\n if (successful) {\n showSuccessMessage('Copied to clipboard!');\n } else {\n showErrorMessage('Failed to copy to clipboard');\n }\n } catch (err) {\n console.error('Fallback copy failed:', err);\n showErrorMessage('Failed to copy to clipboard');\n }\n \n // Clear selection\n window.getSelection().removeAllRanges();\n }\n\n\n function createSADetailsContent(sa) {\n // Create DOM elements safely to prevent XSS\n const container = document.createElement('div');\n container.className = 'row';\n \n // Basic Information column\n const col1 = document.createElement('div');\n col1.className = 'col-md-6';\n \n const h6_1 = document.createElement('h6');\n h6_1.className = 'text-muted';\n h6_1.textContent = 'Basic Information';\n col1.appendChild(h6_1);\n \n const table1 = document.createElement('table');\n table1.className = 'table table-sm';\n \n // ID row\n const idRow = document.createElement('tr');\n idRow.innerHTML = '<td><strong>ID:</strong></td><td><code></code></td>';\n idRow.querySelector('code').textContent = sa.id || '';\n table1.appendChild(idRow);\n \n // Parent User row\n const parentRow = document.createElement('tr');\n parentRow.innerHTML = '<td><strong>Parent User:</strong></td><td></td>';\n parentRow.querySelectorAll('td')[1].textContent = sa.parent_user || '';\n table1.appendChild(parentRow);\n \n // Access Key row\n const keyRow = document.createElement('tr');\n keyRow.innerHTML = '<td><strong>Access Key:</strong></td><td><code></code></td>';\n keyRow.querySelector('code').textContent = sa.access_key_id || '';\n table1.appendChild(keyRow);\n \n // Status row\n const statusRow = document.createElement('tr');\n const statusTd1 = document.createElement('td');\n statusTd1.innerHTML = '<strong>Status:</strong>';\n const statusTd2 = document.createElement('td');\n const statusBadge = document.createElement('span');\n statusBadge.className = sa.status === 'Active' ? 'badge bg-success' : 'badge bg-secondary';\n statusBadge.textContent = sa.status || 'Unknown';\n statusTd2.appendChild(statusBadge);\n statusRow.appendChild(statusTd1);\n statusRow.appendChild(statusTd2);\n table1.appendChild(statusRow);\n \n col1.appendChild(table1);\n container.appendChild(col1);\n \n // Details column\n const col2 = document.createElement('div');\n col2.className = 'col-md-6';\n \n const h6_2 = document.createElement('h6');\n h6_2.className = 'text-muted';\n h6_2.textContent = 'Details';\n col2.appendChild(h6_2);\n \n const table2 = document.createElement('table');\n table2.className = 'table table-sm';\n \n // Description row\n const descRow = document.createElement('tr');\n descRow.innerHTML = '<td><strong>Description:</strong></td><td></td>';\n descRow.querySelectorAll('td')[1].textContent = sa.description || 'Not set';\n table2.appendChild(descRow);\n \n // Created row\n const createdRow = document.createElement('tr');\n createdRow.innerHTML = '<td><strong>Created:</strong></td><td></td>';\n try {\n createdRow.querySelectorAll('td')[1].textContent = new Date(sa.create_date).toLocaleString();\n } catch (e) {\n createdRow.querySelectorAll('td')[1].textContent = 'Invalid date';\n }\n table2.appendChild(createdRow);\n \n // Expiration row\n const expRow = document.createElement('tr');\n expRow.innerHTML = '<td><strong>Expires:</strong></td><td></td>';\n expRow.querySelectorAll('td')[1].textContent = sa.expiration || 'Never';\n table2.appendChild(expRow);\n \n col2.appendChild(table2);\n container.appendChild(col2);\n \n return container.outerHTML;\n }\n\n\n function showSuccessMessage(message) {\n showToast(message, 'success');\n }\n\n function showErrorMessage(message) {\n showToast(message, 'danger');\n }\n\n function showToast(message, type) {\n // Create toast container if it doesn't exist\n let toastContainer = document.getElementById('toastContainer');\n if (!toastContainer) {\n toastContainer = document.createElement('div');\n toastContainer.id = 'toastContainer';\n toastContainer.className = 'toast-container position-fixed top-0 end-0 p-3';\n toastContainer.style.zIndex = '9999';\n document.body.appendChild(toastContainer);\n }\n\n // Create toast element\n const toastId = 'toast-' + Date.now();\n const toastHTML = `\n <div id=\"${toastId}\" class=\"toast align-items-center text-white bg-${type} border-0\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\">\n <div class=\"d-flex\">\n <div class=\"toast-body\">\n ${escapeHtml(message)}\n </div>\n <button type=\"button\" class=\"btn-close btn-close-white me-2 m-auto\" data-bs-dismiss=\"toast\" aria-label=\"Close\"></button>\n </div>\n </div>\n `;\n \n toastContainer.insertAdjacentHTML('beforeend', toastHTML);\n const toastElement = document.getElementById(toastId);\n const toast = new bootstrap.Toast(toastElement, { autohide: true, delay: 5000 });\n toast.show();\n \n // Remove toast element after it's hidden\n toastElement.addEventListener('hidden.bs.toast', () => {\n toastElement.remove();\n });\n }\n\n function escapeHtml(text) {\n const div = document.createElement('div');\n div.textContent = text;\n return div.innerHTML;\n }\n </script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/weed/admin/view/layout/layout.templ b/weed/admin/view/layout/layout.templ
index 3e10120a89..b31ffc1e2a 100644
--- a/weed/admin/view/layout/layout.templ
+++ b/weed/admin/view/layout/layout.templ
@@ -55,6 +55,7 @@ templ Layout(view ViewContext, content templ.Component) {
<meta name="csrf-token" content={ csrfToken }>
<link rel="icon" href={ string(view.P("/static/favicon.ico")) } type="image/x-icon">
+ <script src={ string(view.P("/static/js/theme.js")) }></script>
<!-- Bootstrap CSS -->
<link href={ string(view.P("/static/css/bootstrap.min.css")) } rel="stylesheet">
<!-- Bootstrap Icons CSS -->
@@ -69,10 +70,10 @@ templ Layout(view ViewContext, content templ.Component) {
<body>
<div class="container-fluid p-0">
<!-- Header -->
- <header class="navbar navbar-expand-lg navbar-dark bg-primary sticky-top">
+ <header class="navbar navbar-expand-lg sticky-top admin-toolbar">
<div class="container-fluid">
- <a class="navbar-brand fw-bold" href={ view.P("/admin") }>
- <i class="bi bi-server me-2"></i>
+ <a class="navbar-brand" href={ view.P("/admin") }>
+ <span class="brand-mark"><i class="bi bi-server"></i></span>
SeaweedFS Admin
</a>
@@ -84,12 +85,19 @@ templ Layout(view ViewContext, content templ.Component) {
</button>
<div class="collapse navbar-collapse" id="navbarNav">
- <ul class="navbar-nav ms-auto">
+ <ul class="navbar-nav ms-auto align-items-lg-center">
+ <li class="nav-item">
+ <button class="theme-toggle" type="button" data-theme-toggle title="Switch theme: auto, light, dark" aria-label="Switch color theme">
+ <i class="bi bi-circle-half theme-icon theme-icon-auto"></i>
+ <i class="bi bi-sun theme-icon theme-icon-light"></i>
+ <i class="bi bi-moon-stars theme-icon theme-icon-dark"></i>
+ </button>
+ </li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
<i class="bi bi-person me-1"></i>{username}
</a>
- <ul class="dropdown-menu">
+ <ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item" href={ view.P("/logout") }>
<i class="bi bi-box-arrow-right me-2"></i>Logout
</a></li>
@@ -391,17 +399,19 @@ templ LoginForm(title string, errorMessage string, csrfToken string) {
<title>{title} - Login</title>
<link rel="icon" href={ prefix + "/static/favicon.ico" } type="image/x-icon">
<meta name="viewport" content="width=device-width, initial-scale=1">
+ <script src={ prefix + "/static/js/theme.js" }></script>
<link href={ prefix + "/static/css/bootstrap.min.css" } rel="stylesheet">
- <link href={ prefix + "/static/css/bootstrap-icons.min.css" } rel="stylesheet">
+ <link href={ prefix + "/static/css/bootstrap-icons.min.css" } rel="stylesheet">
+ <link href={ prefix + "/static/css/admin.css" } rel="stylesheet">
</head>
-<body class="bg-light">
+<body class="login-page">
<div class="container">
<div class="row justify-content-center min-vh-100 align-items-center">
<div class="col-md-6 col-lg-4">
<div class="card shadow">
<div class="card-body p-5">
<div class="text-center mb-4">
- <i class="bi bi-server icon-3x text-primary mb-3"></i>
+ <span class="brand-mark mb-3"><i class="bi bi-server"></i></span>
<h4 class="card-title">{title}</h4>
<p class="text-muted">Please sign in to continue</p>
</div>
diff --git a/weed/admin/view/layout/layout_templ.go b/weed/admin/view/layout/layout_templ.go
index 8cb49a4651..7556cafe6d 100644
--- a/weed/admin/view/layout/layout_templ.go
+++ b/weed/admin/view/layout/layout_templ.go
@@ -101,119 +101,132 @@ func Layout(view ViewContext, content templ.Component) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\" type=\"image/x-icon\"><!-- Bootstrap CSS --><link href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\" type=\"image/x-icon\"><script src=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
- templ_7745c5c3_Var4, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/css/bootstrap.min.css"))).ResolveURL(ctx)
+ templ_7745c5c3_Var4, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/js/theme.js"))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 59, Col: 64}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 58, Col: 55}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var4)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\" rel=\"stylesheet\"><!-- Bootstrap Icons CSS --><link href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\"></script><!-- Bootstrap CSS --><link href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
- templ_7745c5c3_Var5, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/css/bootstrap-icons.min.css"))).ResolveURL(ctx)
+ templ_7745c5c3_Var5, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/css/bootstrap.min.css"))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 61, Col: 70}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 60, Col: 64}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var5)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\" rel=\"stylesheet\"><!-- HTMX --><script src=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\" rel=\"stylesheet\"><!-- Bootstrap Icons CSS --><link href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
- templ_7745c5c3_Var6, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/js/htmx.min.js"))).ResolveURL(ctx)
+ templ_7745c5c3_Var6, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/css/bootstrap-icons.min.css"))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 63, Col: 58}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 62, Col: 70}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "\"></script><!-- Custom CSS --><link rel=\"stylesheet\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "\" rel=\"stylesheet\"><!-- HTMX --><script src=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
- templ_7745c5c3_Var7, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/css/admin.css"))).ResolveURL(ctx)
+ templ_7745c5c3_Var7, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/js/htmx.min.js"))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 65, Col: 73}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 64, Col: 58}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "\"><!-- Set base path for JavaScript -->")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "\"></script><!-- Custom CSS --><link rel=\"stylesheet\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = setBasePath(view.URLPrefix).Render(ctx, templ_7745c5c3_Buffer)
+ var templ_7745c5c3_Var8 string
+ templ_7745c5c3_Var8, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/css/admin.css"))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 66, Col: 73}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</head><body><div class=\"container-fluid p-0\"><!-- Header --><header class=\"navbar navbar-expand-lg navbar-dark bg-primary sticky-top\"><div class=\"container-fluid\"><a class=\"navbar-brand fw-bold\" href=\"")
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var8 string
- templ_7745c5c3_Var8, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/admin")).ResolveURL(ctx)
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "\"><!-- Set base path for JavaScript -->")
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 74, Col: 71}
+ return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8)
+ templ_7745c5c3_Err = setBasePath(view.URLPrefix).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\"><i class=\"bi bi-server me-2\"></i> SeaweedFS Admin</a> <button class=\"navbar-toggler d-md-none me-2\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#sidebarMenu\" aria-controls=\"sidebarMenu\" aria-expanded=\"false\" aria-label=\"Toggle navigation menu\"><span class=\"navbar-toggler-icon\"></span></button> <button class=\"navbar-toggler\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#navbarNav\" aria-controls=\"navbarNav\" aria-expanded=\"false\" aria-label=\"User menu\"><i class=\"bi bi-person\"></i></button><div class=\"collapse navbar-collapse\" id=\"navbarNav\"><ul class=\"navbar-nav ms-auto\"><li class=\"nav-item dropdown\"><a class=\"nav-link dropdown-toggle\" href=\"#\" role=\"button\" data-bs-toggle=\"dropdown\"><i class=\"bi bi-person me-1\"></i>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</head><body><div class=\"container-fluid p-0\"><!-- Header --><header class=\"navbar navbar-expand-lg sticky-top admin-toolbar\"><div class=\"container-fluid\"><a class=\"navbar-brand\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
- templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(username)
+ templ_7745c5c3_Var9, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/admin")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 90, Col: 74}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 75, Col: 63}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</a><ul class=\"dropdown-menu\"><li><a class=\"dropdown-item\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "\"><span class=\"brand-mark\"><i class=\"bi bi-server\"></i></span> SeaweedFS Admin</a> <button class=\"navbar-toggler d-md-none me-2\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#sidebarMenu\" aria-controls=\"sidebarMenu\" aria-expanded=\"false\" aria-label=\"Toggle navigation menu\"><span class=\"navbar-toggler-icon\"></span></button> <button class=\"navbar-toggler\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#navbarNav\" aria-controls=\"navbarNav\" aria-expanded=\"false\" aria-label=\"User menu\"><i class=\"bi bi-person\"></i></button><div class=\"collapse navbar-collapse\" id=\"navbarNav\"><ul class=\"navbar-nav ms-auto align-items-lg-center\"><li class=\"nav-item\"><button class=\"theme-toggle\" type=\"button\" data-theme-toggle title=\"Switch theme: auto, light, dark\" aria-label=\"Switch color theme\"><i class=\"bi bi-circle-half theme-icon theme-icon-auto\"></i> <i class=\"bi bi-sun theme-icon theme-icon-light\"></i> <i class=\"bi bi-moon-stars theme-icon theme-icon-dark\"></i></button></li><li class=\"nav-item dropdown\"><a class=\"nav-link dropdown-toggle\" href=\"#\" role=\"button\" data-bs-toggle=\"dropdown\"><i class=\"bi bi-person me-1\"></i>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
- templ_7745c5c3_Var10, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/logout")).ResolveURL(ctx)
+ templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(username)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 93, Col: 85}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 98, Col: 74}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "\"><i class=\"bi bi-box-arrow-right me-2\"></i>Logout</a></li></ul></li></ul></div></div></header><div class=\"row g-0\"><!-- Sidebar --><div class=\"col-md-3 col-lg-2 d-md-block bg-light sidebar collapse\" id=\"sidebarMenu\"><div class=\"position-sticky pt-3\"><h6 class=\"sidebar-heading px-3 mt-4 mb-1 text-muted\"><span>MAIN</span></h6><ul class=\"nav flex-column\"><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</a><ul class=\"dropdown-menu dropdown-menu-end\"><li><a class=\"dropdown-item\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
- templ_7745c5c3_Var11, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/admin")).ResolveURL(ctx)
+ templ_7745c5c3_Var11, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/logout")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 112, Col: 71}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 101, Col: 85}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\"><i class=\"bi bi-speedometer2 me-2\"></i>Dashboard</a></li><li class=\"nav-item\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\"><i class=\"bi bi-box-arrow-right me-2\"></i>Logout</a></li></ul></li></ul></div></div></header><div class=\"row g-0\"><!-- Sidebar --><div class=\"col-md-3 col-lg-2 d-md-block bg-light sidebar collapse\" id=\"sidebarMenu\"><div class=\"position-sticky pt-3\"><h6 class=\"sidebar-heading px-3 mt-4 mb-1 text-muted\"><span>MAIN</span></h6><ul class=\"nav flex-column\"><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var12 string
+ templ_7745c5c3_Var12, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/admin")).ResolveURL(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 120, Col: 71}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\"><i class=\"bi bi-speedometer2 me-2\"></i>Dashboard</a></li><li class=\"nav-item\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -221,38 +234,38 @@ func Layout(view ViewContext, content templ.Component) templ.Component {
templ_7745c5c3_ElementWriter := templ_7745c5c3_Buffer
templ_7745c5c3_Buffer := templ.GetBuffer()
var templ_7745c5c3_ElementScripts []templ.ComponentScript
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<a class=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<a class=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var12 = []any{"nav-link", templ.KV("collapsed", !isClusterPage)}
- templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_ElementWriter, templ_7745c5c3_Var12...)
+ var templ_7745c5c3_Var13 = []any{"nav-link", templ.KV("collapsed", !isClusterPage)}
+ templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_ElementWriter, templ_7745c5c3_Var13...)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var13 string
- templ_7745c5c3_Var13, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.CSSClasses(templ_7745c5c3_Var12).String()).Resolve(ctx)
+ var templ_7745c5c3_Var14 string
+ templ_7745c5c3_Var14, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.CSSClasses(templ_7745c5c3_Var13).String()).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 1, Col: 0}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "\" href=\"#\" data-bs-toggle=\"collapse\" data-bs-target=\"#clusterSubmenu\" aria-expanded=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "\" href=\"#\" data-bs-toggle=\"collapse\" data-bs-target=\"#clusterSubmenu\" aria-expanded=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var14 string
- templ_7745c5c3_Var14, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%t", isClusterPage)).Resolve(ctx)
+ var templ_7745c5c3_Var15 string
+ templ_7745c5c3_Var15, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%t", isClusterPage)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 117, Col: 207}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 125, Col: 207}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var15)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "\" aria-controls=\"clusterSubmenu\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "\" aria-controls=\"clusterSubmenu\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -266,7 +279,7 @@ func Layout(view ViewContext, content templ.Component) templ.Component {
}
templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "><i class=\"bi bi-diagram-3 me-2\"></i>Cluster <i class=\"bi bi-chevron-down ms-auto\"></i></a>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "><i class=\"bi bi-diagram-3 me-2\"></i>Cluster <i class=\"bi bi-chevron-down ms-auto\"></i></a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -274,25 +287,25 @@ func Layout(view ViewContext, content templ.Component) templ.Component {
templ_7745c5c3_ElementWriter := templ_7745c5c3_Buffer
templ_7745c5c3_Buffer := templ.GetBuffer()
var templ_7745c5c3_ElementScripts []templ.ComponentScript
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "<div class=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<div class=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var15 = []any{"collapse", templ.KV("show", isClusterPage)}
- templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_ElementWriter, templ_7745c5c3_Var15...)
+ var templ_7745c5c3_Var16 = []any{"collapse", templ.KV("show", isClusterPage)}
+ templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_ElementWriter, templ_7745c5c3_Var16...)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var16 string
- templ_7745c5c3_Var16, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.CSSClasses(templ_7745c5c3_Var15).String()).Resolve(ctx)
+ var templ_7745c5c3_Var17 string
+ templ_7745c5c3_Var17, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.CSSClasses(templ_7745c5c3_Var16).String()).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 1, Col: 0}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var16)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var17)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "\" id=\"clusterSubmenu\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "\" id=\"clusterSubmenu\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -306,72 +319,72 @@ func Layout(view ViewContext, content templ.Component) templ.Component {
}
templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "><ul class=\"nav flex-column ms-3\"><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var17 string
- templ_7745c5c3_Var17, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/cluster/masters")).ResolveURL(ctx)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 124, Col: 98}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var17)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "\"><i class=\"bi bi-award me-2\"></i>Masters</a></li><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "><ul class=\"nav flex-column ms-3\"><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
- templ_7745c5c3_Var18, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/cluster/volume-servers")).ResolveURL(ctx)
+ templ_7745c5c3_Var18, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/cluster/masters")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 129, Col: 105}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 132, Col: 98}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "\"><i class=\"bi bi-server me-2\"></i>Volume Servers</a></li><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "\"><i class=\"bi bi-award me-2\"></i>Masters</a></li><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
- templ_7745c5c3_Var19, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/cluster/filers")).ResolveURL(ctx)
+ templ_7745c5c3_Var19, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/cluster/volume-servers")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 134, Col: 97}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 137, Col: 105}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var19)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "\"><i class=\"bi bi-folder2-open me-2\"></i>Filers</a></li><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "\"><i class=\"bi bi-server me-2\"></i>Volume Servers</a></li><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 string
- templ_7745c5c3_Var20, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/cluster/s3")).ResolveURL(ctx)
+ templ_7745c5c3_Var20, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/cluster/filers")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 139, Col: 93}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 142, Col: 97}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var20)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "\"><i class=\"bi bi-cloud me-2\"></i>S3 Servers</a></li><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "\"><i class=\"bi bi-folder2-open me-2\"></i>Filers</a></li><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var21 string
- templ_7745c5c3_Var21, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/cluster/mount-clients")).ResolveURL(ctx)
+ templ_7745c5c3_Var21, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/cluster/s3")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 144, Col: 104}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 147, Col: 93}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var21)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "\"><i class=\"bi bi-plug me-2\"></i>Mount Clients</a></li></ul></div></li><li class=\"nav-item\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "\"><i class=\"bi bi-cloud me-2\"></i>S3 Servers</a></li><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var22 string
+ templ_7745c5c3_Var22, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/cluster/mount-clients")).ResolveURL(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 152, Col: 104}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var22)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "\"><i class=\"bi bi-plug me-2\"></i>Mount Clients</a></li></ul></div></li><li class=\"nav-item\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -379,38 +392,38 @@ func Layout(view ViewContext, content templ.Component) templ.Component {
templ_7745c5c3_ElementWriter := templ_7745c5c3_Buffer
templ_7745c5c3_Buffer := templ.GetBuffer()
var templ_7745c5c3_ElementScripts []templ.ComponentScript
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<a class=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "<a class=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var22 = []any{"nav-link", templ.KV("collapsed", !isStoragePage)}
- templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_ElementWriter, templ_7745c5c3_Var22...)
+ var templ_7745c5c3_Var23 = []any{"nav-link", templ.KV("collapsed", !isStoragePage)}
+ templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_ElementWriter, templ_7745c5c3_Var23...)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var23 string
- templ_7745c5c3_Var23, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.CSSClasses(templ_7745c5c3_Var22).String()).Resolve(ctx)
+ var templ_7745c5c3_Var24 string
+ templ_7745c5c3_Var24, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.CSSClasses(templ_7745c5c3_Var23).String()).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 1, Col: 0}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var23)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "\" href=\"#\" data-bs-toggle=\"collapse\" data-bs-target=\"#storageSubmenu\" aria-expanded=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "\" href=\"#\" data-bs-toggle=\"collapse\" data-bs-target=\"#storageSubmenu\" aria-expanded=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var24 string
- templ_7745c5c3_Var24, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%t", isStoragePage)).Resolve(ctx)
+ var templ_7745c5c3_Var25 string
+ templ_7745c5c3_Var25, templ_7745c5c3_Err = templruntime.NewAttributeExpression(fmt.Sprintf("%t", isStoragePage)).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 152, Col: 207}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 160, Col: 207}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var25)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "\" aria-controls=\"storageSubmenu\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "\" aria-controls=\"storageSubmenu\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -424,7 +437,7 @@ func Layout(view ViewContext, content templ.Component) templ.Component {
}
templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "><i class=\"bi bi-device-hdd me-2\"></i>Storage <i class=\"bi bi-chevron-down ms-auto\"></i></a>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "><i class=\"bi bi-device-hdd me-2\"></i>Storage <i class=\"bi bi-chevron-down ms-auto\"></i></a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -432,25 +445,25 @@ func Layout(view ViewContext, content templ.Component) templ.Component {
templ_7745c5c3_ElementWriter := templ_7745c5c3_Buffer
templ_7745c5c3_Buffer := templ.GetBuffer()
var templ_7745c5c3_ElementScripts []templ.ComponentScript
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<div class=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "<div class=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var25 = []any{"collapse", templ.KV("show", isStoragePage)}
- templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_ElementWriter, templ_7745c5c3_Var25...)
+ var templ_7745c5c3_Var26 = []any{"collapse", templ.KV("show", isStoragePage)}
+ templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_ElementWriter, templ_7745c5c3_Var26...)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var26 string
- templ_7745c5c3_Var26, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.CSSClasses(templ_7745c5c3_Var25).String()).Resolve(ctx)
+ var templ_7745c5c3_Var27 string
+ templ_7745c5c3_Var27, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.CSSClasses(templ_7745c5c3_Var26).String()).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 1, Col: 0}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var26)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var27)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "\" id=\"storageSubmenu\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "\" id=\"storageSubmenu\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -464,448 +477,448 @@ func Layout(view ViewContext, content templ.Component) templ.Component {
}
templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "><ul class=\"nav flex-column ms-3\"><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var27 string
- templ_7745c5c3_Var27, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/storage/volumes")).ResolveURL(ctx)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 159, Col: 98}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var27)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "\"><i class=\"bi bi-database me-2\"></i>Volumes</a></li><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "><ul class=\"nav flex-column ms-3\"><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var28 string
- templ_7745c5c3_Var28, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/storage/ec-shards")).ResolveURL(ctx)
+ templ_7745c5c3_Var28, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/storage/volumes")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 164, Col: 100}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 167, Col: 98}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var28)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "\"><i class=\"bi bi-grid me-2\"></i>EC Volumes</a></li><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "\"><i class=\"bi bi-database me-2\"></i>Volumes</a></li><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var29 string
- templ_7745c5c3_Var29, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/storage/collections")).ResolveURL(ctx)
+ templ_7745c5c3_Var29, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/storage/ec-shards")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 169, Col: 102}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 172, Col: 100}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var29)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "\"><i class=\"bi bi-layers me-2\"></i>Collections</a></li></ul></div></li></ul><h6 class=\"sidebar-heading px-3 mt-4 mb-1 text-muted\"><span>OBJECT STORE</span></h6><ul class=\"nav flex-column\"><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "\"><i class=\"bi bi-grid me-2\"></i>EC Volumes</a></li><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var30 string
- templ_7745c5c3_Var30, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/object-store/buckets")).ResolveURL(ctx)
+ templ_7745c5c3_Var30, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/storage/collections")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 183, Col: 86}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 177, Col: 102}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var30)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "\"><i class=\"bi bi-box me-2\"></i>Buckets</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "\"><i class=\"bi bi-layers me-2\"></i>Collections</a></li></ul></div></li></ul><h6 class=\"sidebar-heading px-3 mt-4 mb-1 text-muted\"><span>OBJECT STORE</span></h6><ul class=\"nav flex-column\"><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var31 string
- templ_7745c5c3_Var31, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/object-store/s3tables/buckets")).ResolveURL(ctx)
+ templ_7745c5c3_Var31, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/object-store/buckets")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 188, Col: 95}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 191, Col: 86}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var31)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "\"><i class=\"bi bi-table me-2\"></i>Table Buckets</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "\"><i class=\"bi bi-box me-2\"></i>Buckets</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var32 string
- templ_7745c5c3_Var32, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/object-store/vector-buckets")).ResolveURL(ctx)
+ templ_7745c5c3_Var32, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/object-store/s3tables/buckets")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 193, Col: 93}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 196, Col: 95}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var32)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "\"><i class=\"bi bi-bounding-box-circles me-2\"></i>Vector Buckets</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "\"><i class=\"bi bi-table me-2\"></i>Table Buckets</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var33 string
- templ_7745c5c3_Var33, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/object-store/users")).ResolveURL(ctx)
+ templ_7745c5c3_Var33, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/object-store/vector-buckets")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 198, Col: 84}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 201, Col: 93}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var33)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "\"><i class=\"bi bi-people me-2\"></i>Users</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "\"><i class=\"bi bi-bounding-box-circles me-2\"></i>Vector Buckets</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var34 string
- templ_7745c5c3_Var34, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/object-store/groups")).ResolveURL(ctx)
+ templ_7745c5c3_Var34, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/object-store/users")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 203, Col: 85}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 206, Col: 84}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var34)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "\"><i class=\"bi bi-people-fill me-2\"></i>Groups</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "\"><i class=\"bi bi-people me-2\"></i>Users</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var35 string
- templ_7745c5c3_Var35, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/object-store/service-accounts")).ResolveURL(ctx)
+ templ_7745c5c3_Var35, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/object-store/groups")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 208, Col: 95}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 211, Col: 85}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var35)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "\"><i class=\"bi bi-robot me-2\"></i>Service Accounts</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "\"><i class=\"bi bi-people-fill me-2\"></i>Groups</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var36 string
- templ_7745c5c3_Var36, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/object-store/policies")).ResolveURL(ctx)
+ templ_7745c5c3_Var36, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/object-store/service-accounts")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 213, Col: 87}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 216, Col: 95}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var36)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "\"><i class=\"bi bi-shield me-2\"></i>Policies</a></li></ul><h6 class=\"sidebar-heading px-3 mt-4 mb-1 text-muted\"><span>MANAGEMENT</span></h6><ul class=\"nav flex-column\"><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "\"><i class=\"bi bi-robot me-2\"></i>Service Accounts</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var37 string
- templ_7745c5c3_Var37, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/files")).ResolveURL(ctx)
+ templ_7745c5c3_Var37, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/object-store/policies")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 224, Col: 71}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 221, Col: 87}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var37)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "\"><i class=\"bi bi-folder me-2\"></i>File Browser</a></li><li class=\"nav-item\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "\"><i class=\"bi bi-shield me-2\"></i>Policies</a></li></ul><h6 class=\"sidebar-heading px-3 mt-4 mb-1 text-muted\"><span>MANAGEMENT</span></h6><ul class=\"nav flex-column\"><li class=\"nav-item\"><a class=\"nav-link\" href=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var38 string
+ templ_7745c5c3_Var38, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/files")).ResolveURL(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 232, Col: 71}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var38)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "\"><i class=\"bi bi-folder me-2\"></i>File Browser</a></li><li class=\"nav-item\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if isMQPage {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "<a class=\"nav-link\" href=\"#\" data-bs-toggle=\"collapse\" data-bs-target=\"#messageQueueSubmenu\" aria-expanded=\"true\" aria-controls=\"messageQueueSubmenu\"><i class=\"bi bi-chat-dots me-2\"></i>Message Queue <i class=\"bi bi-chevron-down ms-auto\"></i></a> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "<a class=\"nav-link\" href=\"#\" data-bs-toggle=\"collapse\" data-bs-target=\"#messageQueueSubmenu\" aria-expanded=\"true\" aria-controls=\"messageQueueSubmenu\"><i class=\"bi bi-chat-dots me-2\"></i>Message Queue <i class=\"bi bi-chevron-down ms-auto\"></i></a> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "<a class=\"nav-link collapsed\" href=\"#\" data-bs-toggle=\"collapse\" data-bs-target=\"#messageQueueSubmenu\" aria-expanded=\"false\" aria-controls=\"messageQueueSubmenu\"><i class=\"bi bi-chat-dots me-2\"></i>Message Queue <i class=\"bi bi-chevron-down ms-auto\"></i></a> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<a class=\"nav-link collapsed\" href=\"#\" data-bs-toggle=\"collapse\" data-bs-target=\"#messageQueueSubmenu\" aria-expanded=\"false\" aria-controls=\"messageQueueSubmenu\"><i class=\"bi bi-chat-dots me-2\"></i>Message Queue <i class=\"bi bi-chevron-down ms-auto\"></i></a> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if isMQPage {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<div class=\"collapse show\" id=\"messageQueueSubmenu\"><ul class=\"nav flex-column ms-3\"><li class=\"nav-item\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "<div class=\"collapse show\" id=\"messageQueueSubmenu\"><ul class=\"nav flex-column ms-3\"><li class=\"nav-item\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if currentPath == "/mq/brokers" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "<a class=\"nav-link py-2 active\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "<a class=\"nav-link py-2 active\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var38 string
- templ_7745c5c3_Var38, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/mq/brokers")).ResolveURL(ctx)
+ var templ_7745c5c3_Var39 string
+ templ_7745c5c3_Var39, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/mq/brokers")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 245, Col: 108}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 253, Col: 108}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var38)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var39)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "\"><i class=\"bi bi-server me-2\"></i>Brokers</a>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "\"><i class=\"bi bi-server me-2\"></i>Brokers</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "<a class=\"nav-link py-2\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "<a class=\"nav-link py-2\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var39 string
- templ_7745c5c3_Var39, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/mq/brokers")).ResolveURL(ctx)
+ var templ_7745c5c3_Var40 string
+ templ_7745c5c3_Var40, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/mq/brokers")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 249, Col: 101}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 257, Col: 101}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var39)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var40)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "\"><i class=\"bi bi-server me-2\"></i>Brokers</a>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "\"><i class=\"bi bi-server me-2\"></i>Brokers</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "</li><li class=\"nav-item\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "</li><li class=\"nav-item\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if currentPath == "/mq/topics" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "<a class=\"nav-link py-2 active\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "<a class=\"nav-link py-2 active\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var40 string
- templ_7745c5c3_Var40, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/mq/topics")).ResolveURL(ctx)
+ var templ_7745c5c3_Var41 string
+ templ_7745c5c3_Var41, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/mq/topics")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 256, Col: 107}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 264, Col: 107}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var40)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var41)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "\"><i class=\"bi bi-card-list me-2\"></i>Topics</a>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "\"><i class=\"bi bi-card-list me-2\"></i>Topics</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "<a class=\"nav-link py-2\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "<a class=\"nav-link py-2\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var41 string
- templ_7745c5c3_Var41, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/mq/topics")).ResolveURL(ctx)
+ var templ_7745c5c3_Var42 string
+ templ_7745c5c3_Var42, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/mq/topics")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 260, Col: 100}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 268, Col: 100}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var41)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var42)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "\"><i class=\"bi bi-card-list me-2\"></i>Topics</a>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "\"><i class=\"bi bi-card-list me-2\"></i>Topics</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "</li></ul></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "</li></ul></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "<div class=\"collapse\" id=\"messageQueueSubmenu\"><ul class=\"nav flex-column ms-3\"><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "<div class=\"collapse\" id=\"messageQueueSubmenu\"><ul class=\"nav flex-column ms-3\"><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var42 string
- templ_7745c5c3_Var42, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/mq/brokers")).ResolveURL(ctx)
+ var templ_7745c5c3_Var43 string
+ templ_7745c5c3_Var43, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/mq/brokers")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 272, Col: 97}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 280, Col: 97}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var42)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var43)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "\"><i class=\"bi bi-server me-2\"></i>Brokers</a></li><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "\"><i class=\"bi bi-server me-2\"></i>Brokers</a></li><li class=\"nav-item\"><a class=\"nav-link py-2\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var43 string
- templ_7745c5c3_Var43, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/mq/topics")).ResolveURL(ctx)
+ var templ_7745c5c3_Var44 string
+ templ_7745c5c3_Var44, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/mq/topics")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 277, Col: 96}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 285, Col: 96}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var43)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var44)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "\"><i class=\"bi bi-card-list me-2\"></i>Topics</a></li></ul></div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "\"><i class=\"bi bi-card-list me-2\"></i>Topics</a></li></ul></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "</li></ul><h6 class=\"sidebar-heading px-3 mt-4 mb-1 text-muted\"><span>WORKERS</span></h6><ul class=\"nav flex-column\"><li class=\"nav-item\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "</li></ul><h6 class=\"sidebar-heading px-3 mt-4 mb-1 text-muted\"><span>WORKERS</span></h6><ul class=\"nav flex-column\"><li class=\"nav-item\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if isDefaultWorkerPage {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "<a class=\"nav-link active\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "<a class=\"nav-link active\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var44 string
- templ_7745c5c3_Var44, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/default")).ResolveURL(ctx)
+ var templ_7745c5c3_Var45 string
+ templ_7745c5c3_Var45, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/default")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 294, Col: 97}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 302, Col: 97}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var44)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var45)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "\"><i class=\"bi bi-server me-2\"></i>Default</a>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "\"><i class=\"bi bi-server me-2\"></i>Default</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "<a class=\"nav-link\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "<a class=\"nav-link\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var45 string
- templ_7745c5c3_Var45, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/default")).ResolveURL(ctx)
+ var templ_7745c5c3_Var46 string
+ templ_7745c5c3_Var46, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/default")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 298, Col: 90}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 306, Col: 90}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var45)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var46)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "\"><i class=\"bi bi-server me-2\"></i>Default</a>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "\"><i class=\"bi bi-server me-2\"></i>Default</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "</li><li class=\"nav-item\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "</li><li class=\"nav-item\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if isLifecycleWorkerPage {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "<a class=\"nav-link active\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "<a class=\"nav-link active\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var46 string
- templ_7745c5c3_Var46, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/lifecycle")).ResolveURL(ctx)
+ var templ_7745c5c3_Var47 string
+ templ_7745c5c3_Var47, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/lifecycle")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 305, Col: 99}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 313, Col: 99}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var46)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var47)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "\"><i class=\"bi bi-hourglass-split me-2\"></i>Lifecycle</a>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "\"><i class=\"bi bi-hourglass-split me-2\"></i>Lifecycle</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "<a class=\"nav-link\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "<a class=\"nav-link\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var47 string
- templ_7745c5c3_Var47, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/lifecycle")).ResolveURL(ctx)
+ var templ_7745c5c3_Var48 string
+ templ_7745c5c3_Var48, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/lifecycle")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 309, Col: 92}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 317, Col: 92}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var47)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var48)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "\"><i class=\"bi bi-hourglass-split me-2\"></i>Lifecycle</a>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "\"><i class=\"bi bi-hourglass-split me-2\"></i>Lifecycle</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "</li><li class=\"nav-item\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "</li><li class=\"nav-item\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if isIcebergWorkerPage {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "<a class=\"nav-link active\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "<a class=\"nav-link active\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var48 string
- templ_7745c5c3_Var48, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/iceberg")).ResolveURL(ctx)
+ var templ_7745c5c3_Var49 string
+ templ_7745c5c3_Var49, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/iceberg")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 316, Col: 97}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 324, Col: 97}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var48)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var49)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "\"><i class=\"bi bi-snow me-2\"></i>Iceberg</a>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "\"><i class=\"bi bi-snow me-2\"></i>Iceberg</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "<a class=\"nav-link\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "<a class=\"nav-link\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var49 string
- templ_7745c5c3_Var49, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/iceberg")).ResolveURL(ctx)
+ var templ_7745c5c3_Var50 string
+ templ_7745c5c3_Var50, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/iceberg")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 320, Col: 90}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 328, Col: 90}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var49)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var50)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "\"><i class=\"bi bi-snow me-2\"></i>Iceberg</a>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, "\"><i class=\"bi bi-snow me-2\"></i>Iceberg</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, "</li><li class=\"nav-item\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, "</li><li class=\"nav-item\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if isLanceWorkerPage {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, "<a class=\"nav-link active\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, "<a class=\"nav-link active\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var50 string
- templ_7745c5c3_Var50, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/lance")).ResolveURL(ctx)
+ var templ_7745c5c3_Var51 string
+ templ_7745c5c3_Var51, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/lance")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 327, Col: 95}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 335, Col: 95}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var50)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var51)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, "\"><i class=\"bi bi-bounding-box me-2\"></i>Lance</a>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, "\"><i class=\"bi bi-bounding-box me-2\"></i>Lance</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, "<a class=\"nav-link\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, "<a class=\"nav-link\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var51 string
- templ_7745c5c3_Var51, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/lance")).ResolveURL(ctx)
+ var templ_7745c5c3_Var52 string
+ templ_7745c5c3_Var52, templ_7745c5c3_Err = templruntime.NewAttributeExpression(view.P("/plugin/lanes/lance")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 331, Col: 88}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 339, Col: 88}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var51)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var52)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, "\"><i class=\"bi bi-bounding-box me-2\"></i>Lance</a>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, "\"><i class=\"bi bi-bounding-box me-2\"></i>Lance</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, "</li></ul></div></div><!-- Sidebar backdrop for mobile --><div class=\"sidebar-backdrop\" id=\"sidebarBackdrop\"></div><!-- Main content --><main class=\"col-md-9 ms-sm-auto col-lg-10 px-3 px-md-4\"><div class=\"pt-3\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, "</li></ul></div></div><!-- Sidebar backdrop for mobile --><div class=\"sidebar-backdrop\" id=\"sidebarBackdrop\"></div><!-- Main content --><main class=\"col-md-9 ms-sm-auto col-lg-10 px-3 px-md-4\"><div class=\"pt-3\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -913,108 +926,95 @@ func Layout(view ViewContext, content templ.Component) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, "</div></main></div></div><!-- Footer --><footer class=\"footer mt-auto py-3 bg-light\"><div class=\"container-fluid text-center\"><small class=\"text-muted\">&copy; ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, "</div></main></div></div><!-- Footer --><footer class=\"footer mt-auto py-3 bg-light\"><div class=\"container-fluid text-center\"><small class=\"text-muted\">&copy; ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var52 string
- templ_7745c5c3_Var52, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", time.Now().Year()))
+ var templ_7745c5c3_Var53 string
+ templ_7745c5c3_Var53, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", time.Now().Year()))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 356, Col: 60}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 364, Col: 60}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var52))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var53))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, " SeaweedFS Admin v")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, " SeaweedFS Admin v")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var53 string
- templ_7745c5c3_Var53, templ_7745c5c3_Err = templ.JoinStringErrs(version.VERSION_NUMBER)
+ var templ_7745c5c3_Var54 string
+ templ_7745c5c3_Var54, templ_7745c5c3_Err = templ.JoinStringErrs(version.VERSION_NUMBER)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 356, Col: 102}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 364, Col: 102}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var53))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var54))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, " ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, " ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if version.COMMIT != "" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, "<span class=\"mx-1\">(")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 84, "<span class=\"mx-1\">(")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var54 string
- templ_7745c5c3_Var54, templ_7745c5c3_Err = templ.JoinStringErrs(version.COMMIT)
+ var templ_7745c5c3_Var55 string
+ templ_7745c5c3_Var55, templ_7745c5c3_Err = templ.JoinStringErrs(version.COMMIT)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 358, Col: 55}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 366, Col: 55}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var54))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var55))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 84, ")</span> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 85, ")</span> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if !strings.Contains(version.VERSION, "enterprise") {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 85, "<span class=\"mx-2\">•</span> <a href=\"https://seaweedfs.com\" target=\"_blank\" class=\"text-decoration-none\"><i class=\"bi bi-star me-1\"></i>Enterprise Version Available</a>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 86, "<span class=\"mx-2\">•</span> <a href=\"https://seaweedfs.com\" target=\"_blank\" class=\"text-decoration-none\"><i class=\"bi bi-star me-1\"></i>Enterprise Version Available</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 86, "</small></div></footer><!-- Bootstrap JS --><script src=\"")
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- var templ_7745c5c3_Var55 string
- templ_7745c5c3_Var55, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/js/bootstrap.bundle.min.js"))).ResolveURL(ctx)
- if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 371, Col: 70}
- }
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var55)
- if templ_7745c5c3_Err != nil {
- return templ_7745c5c3_Err
- }
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 87, "\"></script><!-- Modal Alerts JS (replaces native alert/confirm) --><script src=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 87, "</small></div></footer><!-- Bootstrap JS --><script src=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var56 string
- templ_7745c5c3_Var56, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/js/modal-alerts.js"))).ResolveURL(ctx)
+ templ_7745c5c3_Var56, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/js/bootstrap.bundle.min.js"))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 373, Col: 62}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 379, Col: 70}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var56)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 88, "\"></script><!-- Custom JS --><script src=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 88, "\"></script><!-- Modal Alerts JS (replaces native alert/confirm) --><script src=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var57 string
- templ_7745c5c3_Var57, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/js/admin.js"))).ResolveURL(ctx)
+ templ_7745c5c3_Var57, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/js/modal-alerts.js"))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 375, Col: 55}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 381, Col: 62}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var57)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, "\"></script><script src=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, "\"></script><!-- Custom JS --><script src=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var58 string
- templ_7745c5c3_Var58, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/js/iam-utils.js"))).ResolveURL(ctx)
+ templ_7745c5c3_Var58, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/js/admin.js"))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 376, Col: 59}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 383, Col: 55}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var58)
if templ_7745c5c3_Err != nil {
@@ -1025,9 +1025,9 @@ func Layout(view ViewContext, content templ.Component) templ.Component {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var59 string
- templ_7745c5c3_Var59, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/js/s3tables.js"))).ResolveURL(ctx)
+ templ_7745c5c3_Var59, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/js/iam-utils.js"))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 377, Col: 58}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 384, Col: 59}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var59)
if templ_7745c5c3_Err != nil {
@@ -1038,15 +1038,28 @@ func Layout(view ViewContext, content templ.Component) templ.Component {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var60 string
- templ_7745c5c3_Var60, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/js/policy_editor.js"))).ResolveURL(ctx)
+ templ_7745c5c3_Var60, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/js/s3tables.js"))).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 378, Col: 63}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 385, Col: 58}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var60)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 92, "\"></script></body></html>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 92, "\"></script><script src=\"")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var61 string
+ templ_7745c5c3_Var61, templ_7745c5c3_Err = templruntime.NewAttributeExpression(string(view.P("/static/js/policy_editor.js"))).ResolveURL(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 386, Col: 63}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var61)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 93, "\"></script></body></html>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -1072,134 +1085,160 @@ func LoginForm(title string, errorMessage string, csrfToken string) templ.Compon
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
prefix := dash.URLPrefixFromContext(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 93, "<!doctype html><html lang=\"en\"><head><meta charset=\"UTF-8\"><title>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 94, "<!doctype html><html lang=\"en\"><head><meta charset=\"UTF-8\"><title>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var62 string
- templ_7745c5c3_Var62, templ_7745c5c3_Err = templ.JoinStringErrs(title)
+ var templ_7745c5c3_Var63 string
+ templ_7745c5c3_Var63, templ_7745c5c3_Err = templ.JoinStringErrs(title)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 391, Col: 17}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 399, Col: 17}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var62))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var63))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 94, " - Login</title><link rel=\"icon\" href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 95, " - Login</title><link rel=\"icon\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var63 string
- templ_7745c5c3_Var63, templ_7745c5c3_Err = templruntime.NewAttributeExpression(prefix + "/static/favicon.ico").ResolveURL(ctx)
+ var templ_7745c5c3_Var64 string
+ templ_7745c5c3_Var64, templ_7745c5c3_Err = templruntime.NewAttributeExpression(prefix + "/static/favicon.ico").ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 392, Col: 58}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 400, Col: 58}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var63)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var64)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 95, "\" type=\"image/x-icon\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><link href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 96, "\" type=\"image/x-icon\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><script src=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var64 string
- templ_7745c5c3_Var64, templ_7745c5c3_Err = templruntime.NewAttributeExpression(prefix + "/static/css/bootstrap.min.css").ResolveURL(ctx)
+ var templ_7745c5c3_Var65 string
+ templ_7745c5c3_Var65, templ_7745c5c3_Err = templruntime.NewAttributeExpression(prefix + "/static/js/theme.js").ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 394, Col: 57}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 402, Col: 48}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var64)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var65)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 96, "\" rel=\"stylesheet\"><link href=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 97, "\"></script><link href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var65 string
- templ_7745c5c3_Var65, templ_7745c5c3_Err = templruntime.NewAttributeExpression(prefix + "/static/css/bootstrap-icons.min.css").ResolveURL(ctx)
+ var templ_7745c5c3_Var66 string
+ templ_7745c5c3_Var66, templ_7745c5c3_Err = templruntime.NewAttributeExpression(prefix + "/static/css/bootstrap.min.css").ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 395, Col: 67}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 403, Col: 57}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var65)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var66)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 97, "\" rel=\"stylesheet\"></head><body class=\"bg-light\"><div class=\"container\"><div class=\"row justify-content-center min-vh-100 align-items-center\"><div class=\"col-md-6 col-lg-4\"><div class=\"card shadow\"><div class=\"card-body p-5\"><div class=\"text-center mb-4\"><i class=\"bi bi-server icon-3x text-primary mb-3\"></i><h4 class=\"card-title\">")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 98, "\" rel=\"stylesheet\"><link href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var66 string
- templ_7745c5c3_Var66, templ_7745c5c3_Err = templ.JoinStringErrs(title)
+ var templ_7745c5c3_Var67 string
+ templ_7745c5c3_Var67, templ_7745c5c3_Err = templruntime.NewAttributeExpression(prefix + "/static/css/bootstrap-icons.min.css").ResolveURL(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 404, Col: 63}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var67)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 405, Col: 57}
+ return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var66))
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 99, "\" rel=\"stylesheet\"><link href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 98, "</h4><p class=\"text-muted\">Please sign in to continue</p></div>")
+ var templ_7745c5c3_Var68 string
+ templ_7745c5c3_Var68, templ_7745c5c3_Err = templruntime.NewAttributeExpression(prefix + "/static/css/admin.css").ResolveURL(ctx)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 405, Col: 49}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var68)
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 100, "\" rel=\"stylesheet\"></head><body class=\"login-page\"><div class=\"container\"><div class=\"row justify-content-center min-vh-100 align-items-center\"><div class=\"col-md-6 col-lg-4\"><div class=\"card shadow\"><div class=\"card-body p-5\"><div class=\"text-center mb-4\"><span class=\"brand-mark mb-3\"><i class=\"bi bi-server\"></i></span><h4 class=\"card-title\">")
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ var templ_7745c5c3_Var69 string
+ templ_7745c5c3_Var69, templ_7745c5c3_Err = templ.JoinStringErrs(title)
+ if templ_7745c5c3_Err != nil {
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 415, Col: 57}
+ }
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var69))
+ if templ_7745c5c3_Err != nil {
+ return templ_7745c5c3_Err
+ }
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 101, "</h4><p class=\"text-muted\">Please sign in to continue</p></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if errorMessage != "" {
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 99, "<div class=\"alert alert-danger\" role=\"alert\"><i class=\"bi bi-exclamation-triangle me-2\"></i> ")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 102, "<div class=\"alert alert-danger\" role=\"alert\"><i class=\"bi bi-exclamation-triangle me-2\"></i> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var67 string
- templ_7745c5c3_Var67, templ_7745c5c3_Err = templ.JoinStringErrs(errorMessage)
+ var templ_7745c5c3_Var70 string
+ templ_7745c5c3_Var70, templ_7745c5c3_Err = templ.JoinStringErrs(errorMessage)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 412, Col: 45}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 422, Col: 45}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var67))
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var70))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 100, "</div>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 103, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 101, "<form method=\"POST\" action=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 104, "<form method=\"POST\" action=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var68 string
- templ_7745c5c3_Var68, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(prefix + "/login")).ResolveURL(ctx)
+ var templ_7745c5c3_Var71 string
+ templ_7745c5c3_Var71, templ_7745c5c3_Err = templruntime.NewAttributeExpression(templ.SafeURL(prefix + "/login")).ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 416, Col: 85}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 426, Col: 85}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var68)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var71)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 102, "\"><input type=\"hidden\" name=\"csrf_token\" value=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 105, "\"><input type=\"hidden\" name=\"csrf_token\" value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var69 string
- templ_7745c5c3_Var69, templ_7745c5c3_Err = templruntime.NewAttributeExpression(csrfToken).Resolve(ctx)
+ var templ_7745c5c3_Var72 string
+ templ_7745c5c3_Var72, templ_7745c5c3_Err = templruntime.NewAttributeExpression(csrfToken).Resolve(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 417, Col: 84}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 427, Col: 84}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var69)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var72)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 103, "\"><div class=\"mb-3\"><label for=\"username\" class=\"form-label\">Username</label><div class=\"input-group\"><span class=\"input-group-text\"><i class=\"bi bi-person\"></i></span> <input type=\"text\" class=\"form-control\" id=\"username\" name=\"username\" required></div></div><div class=\"mb-4\"><label for=\"password\" class=\"form-label\">Password</label><div class=\"input-group\"><span class=\"input-group-text\"><i class=\"bi bi-lock\"></i></span> <input type=\"password\" class=\"form-control\" id=\"password\" name=\"password\" required></div></div><button type=\"submit\" class=\"btn btn-primary w-100\"><i class=\"bi bi-box-arrow-in-right me-2\"></i>Sign In</button></form></div></div></div></div></div><script src=\"")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 106, "\"><div class=\"mb-3\"><label for=\"username\" class=\"form-label\">Username</label><div class=\"input-group\"><span class=\"input-group-text\"><i class=\"bi bi-person\"></i></span> <input type=\"text\" class=\"form-control\" id=\"username\" name=\"username\" required></div></div><div class=\"mb-4\"><label for=\"password\" class=\"form-label\">Password</label><div class=\"input-group\"><span class=\"input-group-text\"><i class=\"bi bi-lock\"></i></span> <input type=\"password\" class=\"form-control\" id=\"password\" name=\"password\" required></div></div><button type=\"submit\" class=\"btn btn-primary w-100\"><i class=\"bi bi-box-arrow-in-right me-2\"></i>Sign In</button></form></div></div></div></div></div><script src=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- var templ_7745c5c3_Var70 string
- templ_7745c5c3_Var70, templ_7745c5c3_Err = templruntime.NewAttributeExpression(prefix + "/static/js/bootstrap.bundle.min.js").ResolveURL(ctx)
+ var templ_7745c5c3_Var73 string
+ templ_7745c5c3_Var73, templ_7745c5c3_Err = templruntime.NewAttributeExpression(prefix + "/static/js/bootstrap.bundle.min.js").ResolveURL(ctx)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 448, Col: 63}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layout/layout.templ`, Line: 458, Col: 63}
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var70)
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var73)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 104, "\"></script></body></html>")
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 107, "\"></script></body></html>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}