You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							487 lines
						
					
					
						
							28 KiB
						
					
					
				
			
		
		
		
			
			
			
		
		
	
	
							487 lines
						
					
					
						
							28 KiB
						
					
					
				| // Code generated by templ - DO NOT EDIT. | |
|  | |
| // templ: version: v0.3.906 | |
| 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" | |
| 
 | |
| import ( | |
| 	"fmt" | |
| 	"github.com/seaweedfs/seaweedfs/weed/admin/dash" | |
| ) | |
| 
 | |
| func Admin(data dash.AdminData) 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) | |
| 		templ_7745c5c3_Var1 := templ.GetChildren(ctx) | |
| 		if templ_7745c5c3_Var1 == nil { | |
| 			templ_7745c5c3_Var1 = templ.NopComponent | |
| 		} | |
| 		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=\"fas fa-tachometer-alt me-2\"></i>Dashboard</h1><div class=\"btn-toolbar mb-2 mb-md-0\"><div class=\"btn-group me-2\"><a href=\"/object-store/buckets\" class=\"btn btn-sm btn-primary\"><i class=\"fas fa-cube me-1\"></i>Object Store Buckets</a></div></div></div><div id=\"dashboard-content\"><!-- Summary Cards --><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-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.TotalVolumes)) | |
| 		if templ_7745c5c3_Err != nil { | |
| 			return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 35, Col: 73} | |
| 		} | |
| 		_, 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=\"fas fa-database fa-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\">Total Files</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(formatNumber(data.TotalFiles)) | |
| 		if templ_7745c5c3_Err != nil { | |
| 			return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 55, Col: 66} | |
| 		} | |
| 		_, 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=\"fas fa-file fa-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-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\">Total Size</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(formatBytes(data.TotalSize)) | |
| 		if templ_7745c5c3_Err != nil { | |
| 			return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 75, Col: 64} | |
| 		} | |
| 		_, 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=\"fas fa-hdd fa-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-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\">") | |
| 		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 MB", data.VolumeSizeLimitMB)) | |
| 		if templ_7745c5c3_Err != nil { | |
| 			return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 95, Col: 81} | |
| 		} | |
| 		_, 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, 5, "</div></div><div class=\"col-auto\"><i class=\"fas fa-cogs fa-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\">") | |
| 		if templ_7745c5c3_Err != nil { | |
| 			return templ_7745c5c3_Err | |
| 		} | |
| 		var templ_7745c5c3_Var6 string | |
| 		templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", data.TotalEcVolumes)) | |
| 		if templ_7745c5c3_Err != nil { | |
| 			return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 118, Col: 75} | |
| 		} | |
| 		_, 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, 6, "</div></div><div class=\"col-auto\"><i class=\"fas fa-layer-group fa-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\">") | |
| 		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", data.TotalEcShards)) | |
| 		if templ_7745c5c3_Err != nil { | |
| 			return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 138, Col: 74} | |
| 		} | |
| 		_, 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, 7, "</div></div><div class=\"col-auto\"><i class=\"fas fa-puzzle-piece fa-2x text-gray-300\"></i></div></div></div></div></div><!-- Empty columns to balance the row --><div class=\"col-xl-3 col-md-6 mb-4\"></div><div class=\"col-xl-3 col-md-6 mb-4\"></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=\"fas fa-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, 8, "<tr><td>") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			var templ_7745c5c3_Var8 string | |
| 			templ_7745c5c3_Var8, 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: 175, Col: 63} | |
| 			} | |
| 			_, 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, "</td><td>") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			if master.IsLeader { | |
| 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<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, 11, "<span class=\"badge bg-secondary\">Follower</span>") | |
| 				if templ_7745c5c3_Err != nil { | |
| 					return templ_7745c5c3_Err | |
| 				} | |
| 			} | |
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "</td></tr>") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 		} | |
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "</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=\"fas fa-chart-pie me-2\"></i>Cluster</h6></div><div class=\"card-body text-center\"><div class=\"row\"><div class=\"col-3\"><div class=\"card bg-light\"><div class=\"card-body\"><h5>") | |
| 		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", len(data.MasterNodes))) | |
| 		if templ_7745c5c3_Err != nil { | |
| 			return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 205, 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, 14, "</h5><small class=\"text-muted\">Masters</small></div></div></div><div class=\"col-3\"><div class=\"card bg-light\"><div class=\"card-body\"><h5>") | |
| 		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", len(data.VolumeServers))) | |
| 		if templ_7745c5c3_Err != nil { | |
| 			return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 213, Col: 87} | |
| 		} | |
| 		_, 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, 15, "</h5><small class=\"text-muted\">Volume Servers</small></div></div></div><div class=\"col-3\"><div class=\"card bg-light\"><div class=\"card-body\"><h5>") | |
| 		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", len(data.FilerNodes))) | |
| 		if templ_7745c5c3_Err != nil { | |
| 			return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 221, Col: 84} | |
| 		} | |
| 		_, 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, 16, "</h5><small class=\"text-muted\">Filers</small></div></div></div><div class=\"col-3\"><div class=\"card bg-light\"><div class=\"card-body\"><h5>") | |
| 		if templ_7745c5c3_Err != nil { | |
| 			return templ_7745c5c3_Err | |
| 		} | |
| 		var templ_7745c5c3_Var12 string | |
| 		templ_7745c5c3_Var12, 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: 229, Col: 88} | |
| 		} | |
| 		_, 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, 17, "</h5><small class=\"text-muted\">Message Brokers</small></div></div></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=\"fas fa-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=\"fas fa-ellipsis-v fa-sm fa-fw 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=\"/volumes\">View Details</a> <a class=\"dropdown-item\" href=\"/cluster\">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>Volumes</th><th>EC Shards</th><th>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, 18, "<tr><td>") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			var templ_7745c5c3_Var13 string | |
| 			templ_7745c5c3_Var13, 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: 276, Col: 54} | |
| 			} | |
| 			_, 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, 19, "</td><td><a href=\"") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			var templ_7745c5c3_Var14 templ.SafeURL | |
| 			templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("http://%s/ui/index.html", vs.PublicURL))) | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 278, Col: 124} | |
| 			} | |
| 			_, 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, 20, "\" target=\"_blank\">") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			var templ_7745c5c3_Var15 string | |
| 			templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(vs.Address) | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 279, Col: 63} | |
| 			} | |
| 			_, 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, 21, " <i class=\"fas fa-external-link-alt ms-1 text-muted\"></i></a></td><td>") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			var templ_7745c5c3_Var16 string | |
| 			templ_7745c5c3_Var16, 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: 283, Col: 62} | |
| 			} | |
| 			_, 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, 22, "</td><td>") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			var templ_7745c5c3_Var17 string | |
| 			templ_7745c5c3_Var17, 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: 284, Col: 56} | |
| 			} | |
| 			_, 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, 23, "</td><td><div class=\"progress\" style=\"height: 20px;\"><div class=\"progress-bar\" role=\"progressbar\" style=\"") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			var templ_7745c5c3_Var18 string | |
| 			templ_7745c5c3_Var18, 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: 288, Col: 135} | |
| 			} | |
| 			_, 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, 24, "\">") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			var templ_7745c5c3_Var19 string | |
| 			templ_7745c5c3_Var19, 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: 289, Col: 104} | |
| 			} | |
| 			_, 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, 25, "</div></div></td><td>") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			if vs.EcShards > 0 { | |
| 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "<span class=\"badge bg-info text-white me-1\">") | |
| 				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", vs.EcShards)) | |
| 				if templ_7745c5c3_Err != nil { | |
| 					return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 295, Col: 127} | |
| 				} | |
| 				_, 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, 27, "</span> ") | |
| 				if templ_7745c5c3_Err != nil { | |
| 					return templ_7745c5c3_Err | |
| 				} | |
| 				if vs.EcVolumes > 0 { | |
| 					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "<small class=\"text-muted\">(") | |
| 					if templ_7745c5c3_Err != nil { | |
| 						return templ_7745c5c3_Err | |
| 					} | |
| 					var templ_7745c5c3_Var21 string | |
| 					templ_7745c5c3_Var21, 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: 297, Col: 119} | |
| 					} | |
| 					_, 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, 29, ")</small>") | |
| 					if templ_7745c5c3_Err != nil { | |
| 						return templ_7745c5c3_Err | |
| 					} | |
| 				} | |
| 			} else { | |
| 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "<span class=\"text-muted\">-</span>") | |
| 				if templ_7745c5c3_Err != nil { | |
| 					return templ_7745c5c3_Err | |
| 				} | |
| 			} | |
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "</td><td>") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			var templ_7745c5c3_Var22 string | |
| 			templ_7745c5c3_Var22, 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: 303, Col: 74} | |
| 			} | |
| 			_, 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, 32, " / ") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			var templ_7745c5c3_Var23 string | |
| 			templ_7745c5c3_Var23, 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: 303, Col: 107} | |
| 			} | |
| 			_, 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, 33, "</td></tr>") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 		} | |
| 		if len(data.VolumeServers) == 0 { | |
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "<tr><td colspan=\"7\" class=\"text-center text-muted py-4\"><i class=\"fas fa-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, 35, "</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=\"fas fa-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=\"fas fa-ellipsis-v fa-sm fa-fw 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=\"/filer\">File Browser</a> <a class=\"dropdown-item\" href=\"/cluster\">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>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, 36, "<tr><td><a href=\"") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			var templ_7745c5c3_Var24 templ.SafeURL | |
| 			templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("http://%s", filer.Address))) | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/admin.templ`, Line: 356, Col: 111} | |
| 			} | |
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "\" target=\"_blank\">") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			var templ_7745c5c3_Var25 string | |
| 			templ_7745c5c3_Var25, 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: 357, Col: 66} | |
| 			} | |
| 			_, 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, 38, " <i class=\"fas fa-external-link-alt ms-1 text-muted\"></i></a></td><td>") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			var templ_7745c5c3_Var26 string | |
| 			templ_7745c5c3_Var26, 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: 361, Col: 65} | |
| 			} | |
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26)) | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</td><td>") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			var templ_7745c5c3_Var27 string | |
| 			templ_7745c5c3_Var27, 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: 362, Col: 59} | |
| 			} | |
| 			_, 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, 40, "</td><td>") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			var templ_7745c5c3_Var28 string | |
| 			templ_7745c5c3_Var28, 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: 363, Col: 96} | |
| 			} | |
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28)) | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "</td></tr>") | |
| 			if templ_7745c5c3_Err != nil { | |
| 				return templ_7745c5c3_Err | |
| 			} | |
| 		} | |
| 		if len(data.FilerNodes) == 0 { | |
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "<tr><td colspan=\"4\" class=\"text-center text-muted py-4\"><i class=\"fas fa-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, 43, "</tbody></table></div></div></div></div></div><!-- Last Updated --><div class=\"row\"><div class=\"col-12\"><small class=\"text-muted\"><i class=\"fas fa-clock me-1\"></i> Last updated: ") | |
| 		if templ_7745c5c3_Err != nil { | |
| 			return templ_7745c5c3_Err | |
| 		} | |
| 		var templ_7745c5c3_Var29 string | |
| 		templ_7745c5c3_Var29, 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: 387, Col: 81} | |
| 		} | |
| 		_, 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, 44, "</small></div></div></div>") | |
| 		if templ_7745c5c3_Err != nil { | |
| 			return templ_7745c5c3_Err | |
| 		} | |
| 		return nil | |
| 	}) | |
| } | |
| 
 | |
| var _ = templruntime.GeneratedTemplate
 |