topic_details_templ.go 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949
  1. // Code generated by templ - DO NOT EDIT.
  2. // templ: version: v0.3.906
  3. package app
  4. //lint:file-ignore SA4006 This context is only used if a nested component is present.
  5. import "github.com/a-h/templ"
  6. import templruntime "github.com/a-h/templ/runtime"
  7. import "fmt"
  8. import "github.com/seaweedfs/seaweedfs/weed/admin/dash"
  9. import "github.com/seaweedfs/seaweedfs/weed/util"
  10. func TopicDetails(data dash.TopicDetailsData) templ.Component {
  11. return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
  12. templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
  13. if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
  14. return templ_7745c5c3_CtxErr
  15. }
  16. templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
  17. if !templ_7745c5c3_IsBuffer {
  18. defer func() {
  19. templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
  20. if templ_7745c5c3_Err == nil {
  21. templ_7745c5c3_Err = templ_7745c5c3_BufErr
  22. }
  23. }()
  24. }
  25. ctx = templ.InitializeContext(ctx)
  26. templ_7745c5c3_Var1 := templ.GetChildren(ctx)
  27. if templ_7745c5c3_Var1 == nil {
  28. templ_7745c5c3_Var1 = templ.NopComponent
  29. }
  30. ctx = templ.ClearChildren(ctx)
  31. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"container-fluid\"><div class=\"row\"><div class=\"col-12\"><!-- Header --><div class=\"d-flex justify-content-between align-items-center mb-4\"><div><nav aria-label=\"breadcrumb\"><ol class=\"breadcrumb\"><li class=\"breadcrumb-item\"><a href=\"/mq/topics\">Topics</a></li><li class=\"breadcrumb-item active\" aria-current=\"page\">")
  32. if templ_7745c5c3_Err != nil {
  33. return templ_7745c5c3_Err
  34. }
  35. var templ_7745c5c3_Var2 string
  36. templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(data.TopicName)
  37. if templ_7745c5c3_Err != nil {
  38. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 17, Col: 102}
  39. }
  40. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
  41. if templ_7745c5c3_Err != nil {
  42. return templ_7745c5c3_Err
  43. }
  44. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</li></ol></nav><h1 class=\"h3 mb-0\">Topic Details: ")
  45. if templ_7745c5c3_Err != nil {
  46. return templ_7745c5c3_Err
  47. }
  48. var templ_7745c5c3_Var3 string
  49. templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(data.TopicName)
  50. if templ_7745c5c3_Err != nil {
  51. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 20, Col: 74}
  52. }
  53. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
  54. if templ_7745c5c3_Err != nil {
  55. return templ_7745c5c3_Err
  56. }
  57. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</h1></div><small class=\"text-muted\">Last updated: ")
  58. if templ_7745c5c3_Err != nil {
  59. return templ_7745c5c3_Err
  60. }
  61. var templ_7745c5c3_Var4 string
  62. templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(data.LastUpdated.Format("2006-01-02 15:04:05"))
  63. if templ_7745c5c3_Err != nil {
  64. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 22, Col: 107}
  65. }
  66. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
  67. if templ_7745c5c3_Err != nil {
  68. return templ_7745c5c3_Err
  69. }
  70. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</small></div><!-- Summary Cards --><div class=\"row mb-4\"><div class=\"col-md-2\"><div class=\"card text-center\"><div class=\"card-body\"><h5 class=\"card-title\">Partitions</h5><h3 class=\"text-primary\">")
  71. if templ_7745c5c3_Err != nil {
  72. return templ_7745c5c3_Err
  73. }
  74. var templ_7745c5c3_Var5 string
  75. templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.Partitions)))
  76. if templ_7745c5c3_Err != nil {
  77. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 31, Col: 97}
  78. }
  79. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
  80. if templ_7745c5c3_Err != nil {
  81. return templ_7745c5c3_Err
  82. }
  83. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "</h3></div></div></div><div class=\"col-md-2\"><div class=\"card text-center\"><div class=\"card-body\"><h5 class=\"card-title\">Schema Fields</h5><h3 class=\"text-info\">")
  84. if templ_7745c5c3_Err != nil {
  85. return templ_7745c5c3_Err
  86. }
  87. var templ_7745c5c3_Var6 string
  88. templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.Schema)))
  89. if templ_7745c5c3_Err != nil {
  90. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 39, Col: 90}
  91. }
  92. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
  93. if templ_7745c5c3_Err != nil {
  94. return templ_7745c5c3_Err
  95. }
  96. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</h3></div></div></div><div class=\"col-md-2\"><div class=\"card text-center\"><div class=\"card-body\"><h5 class=\"card-title\">Total Messages</h5><h3 class=\"text-success\">")
  97. if templ_7745c5c3_Err != nil {
  98. return templ_7745c5c3_Err
  99. }
  100. var templ_7745c5c3_Var7 string
  101. templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", data.MessageCount))
  102. if templ_7745c5c3_Err != nil {
  103. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 47, Col: 94}
  104. }
  105. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
  106. if templ_7745c5c3_Err != nil {
  107. return templ_7745c5c3_Err
  108. }
  109. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</h3></div></div></div><div class=\"col-md-2\"><div class=\"card text-center\"><div class=\"card-body\"><h5 class=\"card-title\">Total Size</h5><h3 class=\"text-warning\">")
  110. if templ_7745c5c3_Err != nil {
  111. return templ_7745c5c3_Err
  112. }
  113. var templ_7745c5c3_Var8 string
  114. templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(util.BytesToHumanReadable(uint64(data.TotalSize)))
  115. if templ_7745c5c3_Err != nil {
  116. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 55, Col: 107}
  117. }
  118. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
  119. if templ_7745c5c3_Err != nil {
  120. return templ_7745c5c3_Err
  121. }
  122. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</h3></div></div></div><div class=\"col-md-2\"><div class=\"card text-center\"><div class=\"card-body\"><h5 class=\"card-title\">Publishers</h5><h3 class=\"text-success\">")
  123. if templ_7745c5c3_Err != nil {
  124. return templ_7745c5c3_Err
  125. }
  126. var templ_7745c5c3_Var9 string
  127. templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.Publishers)))
  128. if templ_7745c5c3_Err != nil {
  129. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 63, Col: 97}
  130. }
  131. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
  132. if templ_7745c5c3_Err != nil {
  133. return templ_7745c5c3_Err
  134. }
  135. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</h3></div></div></div><div class=\"col-md-2\"><div class=\"card text-center\"><div class=\"card-body\"><h5 class=\"card-title\">Subscribers</h5><h3 class=\"text-info\">")
  136. if templ_7745c5c3_Err != nil {
  137. return templ_7745c5c3_Err
  138. }
  139. var templ_7745c5c3_Var10 string
  140. templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.Subscribers)))
  141. if templ_7745c5c3_Err != nil {
  142. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 71, Col: 95}
  143. }
  144. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
  145. if templ_7745c5c3_Err != nil {
  146. return templ_7745c5c3_Err
  147. }
  148. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</h3></div></div></div></div><!-- Consumer Group Offsets Summary --><div class=\"row mb-4\"><div class=\"col-md-12\"><div class=\"card text-center\"><div class=\"card-body\"><h5 class=\"card-title\">Consumer Group Offsets</h5><h3 class=\"text-warning\">")
  149. if templ_7745c5c3_Err != nil {
  150. return templ_7745c5c3_Err
  151. }
  152. var templ_7745c5c3_Var11 string
  153. templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.ConsumerGroupOffsets)))
  154. if templ_7745c5c3_Err != nil {
  155. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 83, Col: 107}
  156. }
  157. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
  158. if templ_7745c5c3_Err != nil {
  159. return templ_7745c5c3_Err
  160. }
  161. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</h3><p class=\"text-muted\">Saved consumer progress checkpoints</p></div></div></div></div><!-- Topic Information --><div class=\"row mb-4\"><div class=\"col-md-6\"><div class=\"card\"><div class=\"card-header\"><h5 class=\"mb-0\">Topic Information</h5></div><div class=\"card-body\"><dl class=\"row\"><dt class=\"col-sm-4\">Namespace:</dt><dd class=\"col-sm-8\">")
  162. if templ_7745c5c3_Err != nil {
  163. return templ_7745c5c3_Err
  164. }
  165. var templ_7745c5c3_Var12 string
  166. templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(data.Namespace)
  167. if templ_7745c5c3_Err != nil {
  168. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 100, Col: 72}
  169. }
  170. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
  171. if templ_7745c5c3_Err != nil {
  172. return templ_7745c5c3_Err
  173. }
  174. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "</dd><dt class=\"col-sm-4\">Name:</dt><dd class=\"col-sm-8\">")
  175. if templ_7745c5c3_Err != nil {
  176. return templ_7745c5c3_Err
  177. }
  178. var templ_7745c5c3_Var13 string
  179. templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(data.Name)
  180. if templ_7745c5c3_Err != nil {
  181. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 102, Col: 67}
  182. }
  183. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
  184. if templ_7745c5c3_Err != nil {
  185. return templ_7745c5c3_Err
  186. }
  187. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "</dd><dt class=\"col-sm-4\">Full Name:</dt><dd class=\"col-sm-8\">")
  188. if templ_7745c5c3_Err != nil {
  189. return templ_7745c5c3_Err
  190. }
  191. var templ_7745c5c3_Var14 string
  192. templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(data.TopicName)
  193. if templ_7745c5c3_Err != nil {
  194. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 104, Col: 72}
  195. }
  196. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
  197. if templ_7745c5c3_Err != nil {
  198. return templ_7745c5c3_Err
  199. }
  200. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "</dd><dt class=\"col-sm-4\">Created:</dt><dd class=\"col-sm-8\">")
  201. if templ_7745c5c3_Err != nil {
  202. return templ_7745c5c3_Err
  203. }
  204. var templ_7745c5c3_Var15 string
  205. templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(data.CreatedAt.Format("2006-01-02 15:04:05"))
  206. if templ_7745c5c3_Err != nil {
  207. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 106, Col: 102}
  208. }
  209. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
  210. if templ_7745c5c3_Err != nil {
  211. return templ_7745c5c3_Err
  212. }
  213. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "</dd></dl></div></div></div><div class=\"col-md-6\"><div class=\"card\"><div class=\"card-header d-flex justify-content-between align-items-center\"><h5 class=\"mb-0\"><i class=\"fas fa-clock me-2\"></i>Retention Policy</h5><button type=\"button\" class=\"btn btn-sm btn-outline-primary\" onclick=\"showEditRetentionModal()\"><i class=\"fas fa-edit me-1\"></i>Edit</button></div><div class=\"card-body\"><dl class=\"row\"><dt class=\"col-sm-4\">Status:</dt><dd class=\"col-sm-8\">")
  214. if templ_7745c5c3_Err != nil {
  215. return templ_7745c5c3_Err
  216. }
  217. if data.Retention.Enabled {
  218. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<span class=\"badge bg-success\">Enabled</span>")
  219. if templ_7745c5c3_Err != nil {
  220. return templ_7745c5c3_Err
  221. }
  222. } else {
  223. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "<span class=\"badge bg-secondary\">Disabled</span>")
  224. if templ_7745c5c3_Err != nil {
  225. return templ_7745c5c3_Err
  226. }
  227. }
  228. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</dd><dt class=\"col-sm-4\">Duration:</dt><dd class=\"col-sm-8\">")
  229. if templ_7745c5c3_Err != nil {
  230. return templ_7745c5c3_Err
  231. }
  232. if data.Retention.Enabled {
  233. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "<span class=\"text-success\">")
  234. if templ_7745c5c3_Err != nil {
  235. return templ_7745c5c3_Err
  236. }
  237. var templ_7745c5c3_Var16 string
  238. templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", data.Retention.DisplayValue))
  239. if templ_7745c5c3_Err != nil {
  240. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 135, Col: 95}
  241. }
  242. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
  243. if templ_7745c5c3_Err != nil {
  244. return templ_7745c5c3_Err
  245. }
  246. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, " ")
  247. if templ_7745c5c3_Err != nil {
  248. return templ_7745c5c3_Err
  249. }
  250. var templ_7745c5c3_Var17 string
  251. templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(data.Retention.DisplayUnit)
  252. if templ_7745c5c3_Err != nil {
  253. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 135, Col: 124}
  254. }
  255. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
  256. if templ_7745c5c3_Err != nil {
  257. return templ_7745c5c3_Err
  258. }
  259. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</span>")
  260. if templ_7745c5c3_Err != nil {
  261. return templ_7745c5c3_Err
  262. }
  263. } else {
  264. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "<span class=\"text-muted\">No retention configured</span>")
  265. if templ_7745c5c3_Err != nil {
  266. return templ_7745c5c3_Err
  267. }
  268. }
  269. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "</dd></dl></div></div></div></div><!-- Schema Information --><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card\"><div class=\"card-header\"><h5 class=\"mb-0\">Schema Definition</h5></div><div class=\"card-body\">")
  270. if templ_7745c5c3_Err != nil {
  271. return templ_7745c5c3_Err
  272. }
  273. if len(data.Schema) == 0 {
  274. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "<p class=\"text-muted\">No schema information available</p>")
  275. if templ_7745c5c3_Err != nil {
  276. return templ_7745c5c3_Err
  277. }
  278. } else {
  279. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<div class=\"table-responsive\"><table class=\"table table-sm\"><thead><tr><th>Field</th><th>Type</th><th>Required</th></tr></thead> <tbody>")
  280. if templ_7745c5c3_Err != nil {
  281. return templ_7745c5c3_Err
  282. }
  283. for _, field := range data.Schema {
  284. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "<tr><td><code>")
  285. if templ_7745c5c3_Err != nil {
  286. return templ_7745c5c3_Err
  287. }
  288. var templ_7745c5c3_Var18 string
  289. templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(field.Name)
  290. if templ_7745c5c3_Err != nil {
  291. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 170, Col: 77}
  292. }
  293. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
  294. if templ_7745c5c3_Err != nil {
  295. return templ_7745c5c3_Err
  296. }
  297. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</code></td><td><span class=\"badge bg-secondary\">")
  298. if templ_7745c5c3_Err != nil {
  299. return templ_7745c5c3_Err
  300. }
  301. var templ_7745c5c3_Var19 string
  302. templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(field.Type)
  303. if templ_7745c5c3_Err != nil {
  304. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 171, Col: 104}
  305. }
  306. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
  307. if templ_7745c5c3_Err != nil {
  308. return templ_7745c5c3_Err
  309. }
  310. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "</span></td><td>")
  311. if templ_7745c5c3_Err != nil {
  312. return templ_7745c5c3_Err
  313. }
  314. if field.Required {
  315. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<i class=\"fas fa-check text-success\"></i>")
  316. if templ_7745c5c3_Err != nil {
  317. return templ_7745c5c3_Err
  318. }
  319. } else {
  320. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "<i class=\"fas fa-times text-muted\"></i>")
  321. if templ_7745c5c3_Err != nil {
  322. return templ_7745c5c3_Err
  323. }
  324. }
  325. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "</td></tr>")
  326. if templ_7745c5c3_Err != nil {
  327. return templ_7745c5c3_Err
  328. }
  329. }
  330. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "</tbody></table></div>")
  331. if templ_7745c5c3_Err != nil {
  332. return templ_7745c5c3_Err
  333. }
  334. }
  335. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "</div></div></div></div><!-- Partitions Table --><div class=\"card\"><div class=\"card-header d-flex justify-content-between align-items-center\"><h5 class=\"mb-0\">Partitions</h5><div><button class=\"btn btn-sm btn-outline-secondary\" onclick=\"exportPartitionsCSV()\"><i class=\"fas fa-download me-1\"></i>Export CSV</button></div></div><div class=\"card-body\">")
  336. if templ_7745c5c3_Err != nil {
  337. return templ_7745c5c3_Err
  338. }
  339. if len(data.Partitions) == 0 {
  340. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "<div class=\"text-center py-4\"><i class=\"fas fa-server fa-3x text-muted mb-3\"></i><h5>No Partitions Found</h5><p class=\"text-muted\">No partitions are configured for this topic.</p></div>")
  341. if templ_7745c5c3_Err != nil {
  342. return templ_7745c5c3_Err
  343. }
  344. } else {
  345. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "<div class=\"table-responsive\"><table class=\"table table-striped\" id=\"partitionsTable\"><thead><tr><th>Partition ID</th><th>Leader Broker</th><th>Follower Broker</th><th>Messages</th><th>Size</th><th>Last Data Time</th><th>Created</th></tr></thead> <tbody>")
  346. if templ_7745c5c3_Err != nil {
  347. return templ_7745c5c3_Err
  348. }
  349. for _, partition := range data.Partitions {
  350. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "<tr><td><span class=\"badge bg-primary\">")
  351. if templ_7745c5c3_Err != nil {
  352. return templ_7745c5c3_Err
  353. }
  354. var templ_7745c5c3_Var20 string
  355. templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", partition.ID))
  356. if templ_7745c5c3_Err != nil {
  357. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 225, Col: 115}
  358. }
  359. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
  360. if templ_7745c5c3_Err != nil {
  361. return templ_7745c5c3_Err
  362. }
  363. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</span></td><td><strong>")
  364. if templ_7745c5c3_Err != nil {
  365. return templ_7745c5c3_Err
  366. }
  367. var templ_7745c5c3_Var21 string
  368. templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(partition.LeaderBroker)
  369. if templ_7745c5c3_Err != nil {
  370. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 228, Col: 83}
  371. }
  372. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
  373. if templ_7745c5c3_Err != nil {
  374. return templ_7745c5c3_Err
  375. }
  376. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "</strong></td><td>")
  377. if templ_7745c5c3_Err != nil {
  378. return templ_7745c5c3_Err
  379. }
  380. if partition.FollowerBroker != "" {
  381. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "<span class=\"text-muted\">")
  382. if templ_7745c5c3_Err != nil {
  383. return templ_7745c5c3_Err
  384. }
  385. var templ_7745c5c3_Var22 string
  386. templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(partition.FollowerBroker)
  387. if templ_7745c5c3_Err != nil {
  388. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 232, Col: 106}
  389. }
  390. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
  391. if templ_7745c5c3_Err != nil {
  392. return templ_7745c5c3_Err
  393. }
  394. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "</span>")
  395. if templ_7745c5c3_Err != nil {
  396. return templ_7745c5c3_Err
  397. }
  398. } else {
  399. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "<span class=\"text-muted\">None</span>")
  400. if templ_7745c5c3_Err != nil {
  401. return templ_7745c5c3_Err
  402. }
  403. }
  404. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "</td><td>")
  405. if templ_7745c5c3_Err != nil {
  406. return templ_7745c5c3_Err
  407. }
  408. var templ_7745c5c3_Var23 string
  409. templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", partition.MessageCount))
  410. if templ_7745c5c3_Err != nil {
  411. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 237, Col: 94}
  412. }
  413. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
  414. if templ_7745c5c3_Err != nil {
  415. return templ_7745c5c3_Err
  416. }
  417. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "</td><td>")
  418. if templ_7745c5c3_Err != nil {
  419. return templ_7745c5c3_Err
  420. }
  421. var templ_7745c5c3_Var24 string
  422. templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(util.BytesToHumanReadable(uint64(partition.TotalSize)))
  423. if templ_7745c5c3_Err != nil {
  424. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 238, Col: 107}
  425. }
  426. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
  427. if templ_7745c5c3_Err != nil {
  428. return templ_7745c5c3_Err
  429. }
  430. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "</td><td>")
  431. if templ_7745c5c3_Err != nil {
  432. return templ_7745c5c3_Err
  433. }
  434. if !partition.LastDataTime.IsZero() {
  435. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "<span class=\"text-muted\">")
  436. if templ_7745c5c3_Err != nil {
  437. return templ_7745c5c3_Err
  438. }
  439. var templ_7745c5c3_Var25 string
  440. templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(partition.LastDataTime.Format("2006-01-02 15:04:05"))
  441. if templ_7745c5c3_Err != nil {
  442. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 241, Col: 134}
  443. }
  444. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
  445. if templ_7745c5c3_Err != nil {
  446. return templ_7745c5c3_Err
  447. }
  448. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "</span>")
  449. if templ_7745c5c3_Err != nil {
  450. return templ_7745c5c3_Err
  451. }
  452. } else {
  453. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "<span class=\"text-muted\">Never</span>")
  454. if templ_7745c5c3_Err != nil {
  455. return templ_7745c5c3_Err
  456. }
  457. }
  458. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "</td><td><span class=\"text-muted\">")
  459. if templ_7745c5c3_Err != nil {
  460. return templ_7745c5c3_Err
  461. }
  462. var templ_7745c5c3_Var26 string
  463. templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(partition.CreatedAt.Format("2006-01-02 15:04:05"))
  464. if templ_7745c5c3_Err != nil {
  465. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 247, Col: 127}
  466. }
  467. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
  468. if templ_7745c5c3_Err != nil {
  469. return templ_7745c5c3_Err
  470. }
  471. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "</span></td></tr>")
  472. if templ_7745c5c3_Err != nil {
  473. return templ_7745c5c3_Err
  474. }
  475. }
  476. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "</tbody></table></div>")
  477. if templ_7745c5c3_Err != nil {
  478. return templ_7745c5c3_Err
  479. }
  480. }
  481. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "</div></div><!-- Publishers and Subscribers --><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card\"><div class=\"card-header\"><h5 class=\"mb-0\">Active Publishers <span class=\"badge bg-success\">")
  482. if templ_7745c5c3_Err != nil {
  483. return templ_7745c5c3_Err
  484. }
  485. var templ_7745c5c3_Var27 string
  486. templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.Publishers)))
  487. if templ_7745c5c3_Err != nil {
  488. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 263, Col: 138}
  489. }
  490. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
  491. if templ_7745c5c3_Err != nil {
  492. return templ_7745c5c3_Err
  493. }
  494. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "</span></h5></div><div class=\"card-body\">")
  495. if templ_7745c5c3_Err != nil {
  496. return templ_7745c5c3_Err
  497. }
  498. if len(data.Publishers) == 0 {
  499. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "<div class=\"alert alert-info mb-0\"><i class=\"fas fa-info-circle\"></i> No active publishers found for this topic.</div>")
  500. if templ_7745c5c3_Err != nil {
  501. return templ_7745c5c3_Err
  502. }
  503. } else {
  504. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "<div class=\"table-responsive\"><table class=\"table table-sm\"><thead><tr><th>Publisher</th><th>Partition</th><th>Broker</th><th>Status</th><th>Published</th><th>Acknowledged</th><th>Last Seen</th></tr></thead> <tbody>")
  505. if templ_7745c5c3_Err != nil {
  506. return templ_7745c5c3_Err
  507. }
  508. for _, publisher := range data.Publishers {
  509. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "<tr><td>")
  510. if templ_7745c5c3_Err != nil {
  511. return templ_7745c5c3_Err
  512. }
  513. var templ_7745c5c3_Var28 string
  514. templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(publisher.PublisherName)
  515. if templ_7745c5c3_Err != nil {
  516. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 287, Col: 84}
  517. }
  518. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
  519. if templ_7745c5c3_Err != nil {
  520. return templ_7745c5c3_Err
  521. }
  522. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "</td><td><span class=\"badge bg-primary\">")
  523. if templ_7745c5c3_Err != nil {
  524. return templ_7745c5c3_Err
  525. }
  526. var templ_7745c5c3_Var29 string
  527. templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", publisher.PartitionID))
  528. if templ_7745c5c3_Err != nil {
  529. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 288, Col: 132}
  530. }
  531. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
  532. if templ_7745c5c3_Err != nil {
  533. return templ_7745c5c3_Err
  534. }
  535. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "</span></td><td>")
  536. if templ_7745c5c3_Err != nil {
  537. return templ_7745c5c3_Err
  538. }
  539. var templ_7745c5c3_Var30 string
  540. templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(publisher.Broker)
  541. if templ_7745c5c3_Err != nil {
  542. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 289, Col: 77}
  543. }
  544. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
  545. if templ_7745c5c3_Err != nil {
  546. return templ_7745c5c3_Err
  547. }
  548. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "</td><td>")
  549. if templ_7745c5c3_Err != nil {
  550. return templ_7745c5c3_Err
  551. }
  552. if publisher.IsActive {
  553. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "<span class=\"badge bg-success\">Active</span>")
  554. if templ_7745c5c3_Err != nil {
  555. return templ_7745c5c3_Err
  556. }
  557. } else {
  558. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "<span class=\"badge bg-secondary\">Inactive</span>")
  559. if templ_7745c5c3_Err != nil {
  560. return templ_7745c5c3_Err
  561. }
  562. }
  563. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "</td><td>")
  564. if templ_7745c5c3_Err != nil {
  565. return templ_7745c5c3_Err
  566. }
  567. if publisher.LastPublishedOffset > 0 {
  568. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "<span class=\"text-muted\">")
  569. if templ_7745c5c3_Err != nil {
  570. return templ_7745c5c3_Err
  571. }
  572. var templ_7745c5c3_Var31 string
  573. templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", publisher.LastPublishedOffset))
  574. if templ_7745c5c3_Err != nil {
  575. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 299, Col: 138}
  576. }
  577. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
  578. if templ_7745c5c3_Err != nil {
  579. return templ_7745c5c3_Err
  580. }
  581. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "</span>")
  582. if templ_7745c5c3_Err != nil {
  583. return templ_7745c5c3_Err
  584. }
  585. } else {
  586. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "<span class=\"text-muted\">-</span>")
  587. if templ_7745c5c3_Err != nil {
  588. return templ_7745c5c3_Err
  589. }
  590. }
  591. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "</td><td>")
  592. if templ_7745c5c3_Err != nil {
  593. return templ_7745c5c3_Err
  594. }
  595. if publisher.LastAckedOffset > 0 {
  596. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "<span class=\"text-muted\">")
  597. if templ_7745c5c3_Err != nil {
  598. return templ_7745c5c3_Err
  599. }
  600. var templ_7745c5c3_Var32 string
  601. templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", publisher.LastAckedOffset))
  602. if templ_7745c5c3_Err != nil {
  603. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 306, Col: 134}
  604. }
  605. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
  606. if templ_7745c5c3_Err != nil {
  607. return templ_7745c5c3_Err
  608. }
  609. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "</span>")
  610. if templ_7745c5c3_Err != nil {
  611. return templ_7745c5c3_Err
  612. }
  613. } else {
  614. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "<span class=\"text-muted\">-</span>")
  615. if templ_7745c5c3_Err != nil {
  616. return templ_7745c5c3_Err
  617. }
  618. }
  619. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "</td><td>")
  620. if templ_7745c5c3_Err != nil {
  621. return templ_7745c5c3_Err
  622. }
  623. if !publisher.LastSeenTime.IsZero() {
  624. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "<span class=\"text-muted\">")
  625. if templ_7745c5c3_Err != nil {
  626. return templ_7745c5c3_Err
  627. }
  628. var templ_7745c5c3_Var33 string
  629. templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(publisher.LastSeenTime.Format("15:04:05"))
  630. if templ_7745c5c3_Err != nil {
  631. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 313, Col: 131}
  632. }
  633. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
  634. if templ_7745c5c3_Err != nil {
  635. return templ_7745c5c3_Err
  636. }
  637. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "</span>")
  638. if templ_7745c5c3_Err != nil {
  639. return templ_7745c5c3_Err
  640. }
  641. } else {
  642. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "<span class=\"text-muted\">-</span>")
  643. if templ_7745c5c3_Err != nil {
  644. return templ_7745c5c3_Err
  645. }
  646. }
  647. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "</td></tr>")
  648. if templ_7745c5c3_Err != nil {
  649. return templ_7745c5c3_Err
  650. }
  651. }
  652. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, "</tbody></table></div>")
  653. if templ_7745c5c3_Err != nil {
  654. return templ_7745c5c3_Err
  655. }
  656. }
  657. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, "</div></div></div></div><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card\"><div class=\"card-header\"><h5 class=\"mb-0\">Active Subscribers <span class=\"badge bg-info\">")
  658. if templ_7745c5c3_Err != nil {
  659. return templ_7745c5c3_Err
  660. }
  661. var templ_7745c5c3_Var34 string
  662. templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.Subscribers)))
  663. if templ_7745c5c3_Err != nil {
  664. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 333, Col: 137}
  665. }
  666. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
  667. if templ_7745c5c3_Err != nil {
  668. return templ_7745c5c3_Err
  669. }
  670. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, "</span></h5></div><div class=\"card-body\">")
  671. if templ_7745c5c3_Err != nil {
  672. return templ_7745c5c3_Err
  673. }
  674. if len(data.Subscribers) == 0 {
  675. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, "<div class=\"alert alert-info mb-0\"><i class=\"fas fa-info-circle\"></i> No active subscribers found for this topic.</div>")
  676. if templ_7745c5c3_Err != nil {
  677. return templ_7745c5c3_Err
  678. }
  679. } else {
  680. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, "<div class=\"table-responsive\"><table class=\"table table-sm\"><thead><tr><th>Consumer Group</th><th>Consumer ID</th><th>Partition</th><th>Broker</th><th>Status</th><th>Received</th><th>Acknowledged</th><th>Last Seen</th></tr></thead> <tbody>")
  681. if templ_7745c5c3_Err != nil {
  682. return templ_7745c5c3_Err
  683. }
  684. for _, subscriber := range data.Subscribers {
  685. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, "<tr><td>")
  686. if templ_7745c5c3_Err != nil {
  687. return templ_7745c5c3_Err
  688. }
  689. var templ_7745c5c3_Var35 string
  690. templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(subscriber.ConsumerGroup)
  691. if templ_7745c5c3_Err != nil {
  692. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 358, Col: 85}
  693. }
  694. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
  695. if templ_7745c5c3_Err != nil {
  696. return templ_7745c5c3_Err
  697. }
  698. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, "</td><td>")
  699. if templ_7745c5c3_Err != nil {
  700. return templ_7745c5c3_Err
  701. }
  702. var templ_7745c5c3_Var36 string
  703. templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(subscriber.ConsumerID)
  704. if templ_7745c5c3_Err != nil {
  705. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 359, Col: 82}
  706. }
  707. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
  708. if templ_7745c5c3_Err != nil {
  709. return templ_7745c5c3_Err
  710. }
  711. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, "</td><td><span class=\"badge bg-primary\">")
  712. if templ_7745c5c3_Err != nil {
  713. return templ_7745c5c3_Err
  714. }
  715. var templ_7745c5c3_Var37 string
  716. templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", subscriber.PartitionID))
  717. if templ_7745c5c3_Err != nil {
  718. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 360, Col: 133}
  719. }
  720. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
  721. if templ_7745c5c3_Err != nil {
  722. return templ_7745c5c3_Err
  723. }
  724. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, "</span></td><td>")
  725. if templ_7745c5c3_Err != nil {
  726. return templ_7745c5c3_Err
  727. }
  728. var templ_7745c5c3_Var38 string
  729. templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.JoinStringErrs(subscriber.Broker)
  730. if templ_7745c5c3_Err != nil {
  731. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 361, Col: 78}
  732. }
  733. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38))
  734. if templ_7745c5c3_Err != nil {
  735. return templ_7745c5c3_Err
  736. }
  737. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, "</td><td>")
  738. if templ_7745c5c3_Err != nil {
  739. return templ_7745c5c3_Err
  740. }
  741. if subscriber.IsActive {
  742. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 84, "<span class=\"badge bg-success\">Active</span>")
  743. if templ_7745c5c3_Err != nil {
  744. return templ_7745c5c3_Err
  745. }
  746. } else {
  747. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 85, "<span class=\"badge bg-secondary\">Inactive</span>")
  748. if templ_7745c5c3_Err != nil {
  749. return templ_7745c5c3_Err
  750. }
  751. }
  752. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 86, "</td><td>")
  753. if templ_7745c5c3_Err != nil {
  754. return templ_7745c5c3_Err
  755. }
  756. if subscriber.LastReceivedOffset > 0 {
  757. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 87, "<span class=\"text-muted\">")
  758. if templ_7745c5c3_Err != nil {
  759. return templ_7745c5c3_Err
  760. }
  761. var templ_7745c5c3_Var39 string
  762. templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", subscriber.LastReceivedOffset))
  763. if templ_7745c5c3_Err != nil {
  764. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 371, Col: 138}
  765. }
  766. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
  767. if templ_7745c5c3_Err != nil {
  768. return templ_7745c5c3_Err
  769. }
  770. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 88, "</span>")
  771. if templ_7745c5c3_Err != nil {
  772. return templ_7745c5c3_Err
  773. }
  774. } else {
  775. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, "<span class=\"text-muted\">-</span>")
  776. if templ_7745c5c3_Err != nil {
  777. return templ_7745c5c3_Err
  778. }
  779. }
  780. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 90, "</td><td>")
  781. if templ_7745c5c3_Err != nil {
  782. return templ_7745c5c3_Err
  783. }
  784. if subscriber.CurrentOffset > 0 {
  785. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 91, "<span class=\"text-muted\">")
  786. if templ_7745c5c3_Err != nil {
  787. return templ_7745c5c3_Err
  788. }
  789. var templ_7745c5c3_Var40 string
  790. templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", subscriber.CurrentOffset))
  791. if templ_7745c5c3_Err != nil {
  792. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 378, Col: 133}
  793. }
  794. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40))
  795. if templ_7745c5c3_Err != nil {
  796. return templ_7745c5c3_Err
  797. }
  798. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 92, "</span>")
  799. if templ_7745c5c3_Err != nil {
  800. return templ_7745c5c3_Err
  801. }
  802. } else {
  803. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 93, "<span class=\"text-muted\">-</span>")
  804. if templ_7745c5c3_Err != nil {
  805. return templ_7745c5c3_Err
  806. }
  807. }
  808. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 94, "</td><td>")
  809. if templ_7745c5c3_Err != nil {
  810. return templ_7745c5c3_Err
  811. }
  812. if !subscriber.LastSeenTime.IsZero() {
  813. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 95, "<span class=\"text-muted\">")
  814. if templ_7745c5c3_Err != nil {
  815. return templ_7745c5c3_Err
  816. }
  817. var templ_7745c5c3_Var41 string
  818. templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(subscriber.LastSeenTime.Format("15:04:05"))
  819. if templ_7745c5c3_Err != nil {
  820. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 385, Col: 132}
  821. }
  822. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
  823. if templ_7745c5c3_Err != nil {
  824. return templ_7745c5c3_Err
  825. }
  826. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 96, "</span>")
  827. if templ_7745c5c3_Err != nil {
  828. return templ_7745c5c3_Err
  829. }
  830. } else {
  831. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 97, "<span class=\"text-muted\">-</span>")
  832. if templ_7745c5c3_Err != nil {
  833. return templ_7745c5c3_Err
  834. }
  835. }
  836. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 98, "</td></tr>")
  837. if templ_7745c5c3_Err != nil {
  838. return templ_7745c5c3_Err
  839. }
  840. }
  841. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 99, "</tbody></table></div>")
  842. if templ_7745c5c3_Err != nil {
  843. return templ_7745c5c3_Err
  844. }
  845. }
  846. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 100, "</div></div></div></div><!-- Consumer Group Offsets --><div class=\"row mb-4\"><div class=\"col-12\"><div class=\"card\"><div class=\"card-header\"><h5 class=\"mb-0\">Consumer Group Offsets <span class=\"badge bg-warning\">")
  847. if templ_7745c5c3_Err != nil {
  848. return templ_7745c5c3_Err
  849. }
  850. var templ_7745c5c3_Var42 string
  851. templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", len(data.ConsumerGroupOffsets)))
  852. if templ_7745c5c3_Err != nil {
  853. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 406, Col: 153}
  854. }
  855. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42))
  856. if templ_7745c5c3_Err != nil {
  857. return templ_7745c5c3_Err
  858. }
  859. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 101, "</span></h5></div><div class=\"card-body\">")
  860. if templ_7745c5c3_Err != nil {
  861. return templ_7745c5c3_Err
  862. }
  863. if len(data.ConsumerGroupOffsets) == 0 {
  864. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 102, "<div class=\"alert alert-info mb-0\"><i class=\"fas fa-info-circle\"></i> No consumer group offsets found for this topic.</div>")
  865. if templ_7745c5c3_Err != nil {
  866. return templ_7745c5c3_Err
  867. }
  868. } else {
  869. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 103, "<div class=\"table-responsive\"><table class=\"table table-sm\"><thead><tr><th>Consumer Group</th><th>Partition</th><th>Offset</th><th>Last Updated</th></tr></thead> <tbody>")
  870. if templ_7745c5c3_Err != nil {
  871. return templ_7745c5c3_Err
  872. }
  873. for _, offset := range data.ConsumerGroupOffsets {
  874. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 104, "<tr><td><span class=\"badge bg-secondary\">")
  875. if templ_7745c5c3_Err != nil {
  876. return templ_7745c5c3_Err
  877. }
  878. var templ_7745c5c3_Var43 string
  879. templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(offset.ConsumerGroup)
  880. if templ_7745c5c3_Err != nil {
  881. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 428, Col: 114}
  882. }
  883. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
  884. if templ_7745c5c3_Err != nil {
  885. return templ_7745c5c3_Err
  886. }
  887. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 105, "</span></td><td><span class=\"badge bg-primary\">")
  888. if templ_7745c5c3_Err != nil {
  889. return templ_7745c5c3_Err
  890. }
  891. var templ_7745c5c3_Var44 string
  892. templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", offset.PartitionID))
  893. if templ_7745c5c3_Err != nil {
  894. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 431, Col: 129}
  895. }
  896. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44))
  897. if templ_7745c5c3_Err != nil {
  898. return templ_7745c5c3_Err
  899. }
  900. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 106, "</span></td><td><strong>")
  901. if templ_7745c5c3_Err != nil {
  902. return templ_7745c5c3_Err
  903. }
  904. var templ_7745c5c3_Var45 string
  905. templ_7745c5c3_Var45, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", offset.Offset))
  906. if templ_7745c5c3_Err != nil {
  907. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 434, Col: 101}
  908. }
  909. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var45))
  910. if templ_7745c5c3_Err != nil {
  911. return templ_7745c5c3_Err
  912. }
  913. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 107, "</strong></td><td><span class=\"text-muted\">")
  914. if templ_7745c5c3_Err != nil {
  915. return templ_7745c5c3_Err
  916. }
  917. var templ_7745c5c3_Var46 string
  918. templ_7745c5c3_Var46, templ_7745c5c3_Err = templ.JoinStringErrs(offset.LastUpdated.Format("2006-01-02 15:04:05"))
  919. if templ_7745c5c3_Err != nil {
  920. return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/app/topic_details.templ`, Line: 437, Col: 134}
  921. }
  922. _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var46))
  923. if templ_7745c5c3_Err != nil {
  924. return templ_7745c5c3_Err
  925. }
  926. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 108, "</span></td></tr>")
  927. if templ_7745c5c3_Err != nil {
  928. return templ_7745c5c3_Err
  929. }
  930. }
  931. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 109, "</tbody></table></div>")
  932. if templ_7745c5c3_Err != nil {
  933. return templ_7745c5c3_Err
  934. }
  935. }
  936. templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 110, "</div></div></div></div></div></div></div><script>\n function exportPartitionsCSV() {\n const table = document.getElementById('partitionsTable');\n if (!table) return;\n \n let csv = 'Partition ID,Leader Broker,Follower Broker,Messages,Size,Last Data Time,Created\\n';\n \n const rows = table.querySelectorAll('tbody tr');\n rows.forEach(row => {\n const cells = row.querySelectorAll('td');\n if (cells.length >= 7) {\n const rowData = [\n cells[0].querySelector('.badge')?.textContent || '',\n cells[1].querySelector('strong')?.textContent || '',\n cells[2].textContent || '',\n cells[3].textContent || '',\n cells[4].textContent || '',\n cells[5].querySelector('span')?.textContent || '',\n cells[6].querySelector('span')?.textContent || ''\n ];\n csv += rowData.map(field => `\"${field.replace(/\"/g, '\"\"')}\"`).join(',') + '\\n';\n }\n });\n \n const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });\n const link = document.createElement('a');\n const url = URL.createObjectURL(blob);\n link.setAttribute('href', url);\n link.setAttribute('download', 'topic_partitions.csv');\n link.style.visibility = 'hidden';\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }\n\n // Edit retention functions\n function showEditRetentionModal() {\n const modal = new bootstrap.Modal(document.getElementById('editRetentionModal'));\n \n // Get current retention values from the page\n const currentEnabled = document.querySelector('dd .badge.bg-success') !== null;\n const currentDurationElement = document.querySelector('dd .text-success');\n \n let currentValue = 7;\n let currentUnit = 'days';\n \n if (currentEnabled && currentDurationElement) {\n const durationText = currentDurationElement.textContent.trim();\n const parts = durationText.split(' ');\n if (parts.length >= 2) {\n currentValue = parseInt(parts[0]) || 7;\n currentUnit = parts[1].toLowerCase();\n // Handle plural forms\n if (currentUnit.endsWith('s')) {\n currentUnit = currentUnit.slice(0, -1);\n }\n // Map to our dropdown values\n if (currentUnit === 'hour') {\n currentUnit = 'hours';\n } else if (currentUnit === 'day') {\n currentUnit = 'days';\n }\n }\n }\n \n // Set current values in the modal\n document.getElementById('editEnableRetention').checked = currentEnabled;\n document.getElementById('editRetentionValue').value = currentValue;\n document.getElementById('editRetentionUnit').value = currentUnit;\n \n // Show/hide retention fields based on current state\n toggleEditRetentionFields();\n \n modal.show();\n }\n\n function toggleEditRetentionFields() {\n const enableRetention = document.getElementById('editEnableRetention');\n const retentionFields = document.getElementById('editRetentionFields');\n \n if (enableRetention.checked) {\n retentionFields.style.display = 'block';\n } else {\n retentionFields.style.display = 'none';\n }\n }\n\n function updateRetention() {\n const form = document.getElementById('editRetentionForm');\n const formData = new FormData(form);\n \n // Get topic details from the page\n const topicName = document.querySelector('h1').textContent.replace('Topic Details: ', '');\n const parts = topicName.split('.');\n \n if (parts.length < 2) {\n alert('Invalid topic name format');\n return;\n }\n \n const namespace = parts[0];\n const name = parts.slice(1).join('.');\n \n // Convert form data to JSON\n const data = {\n namespace: namespace,\n name: name,\n retention: {\n enabled: formData.get('editEnableRetention') === 'on',\n retention_seconds: 0\n }\n };\n\n // Calculate retention seconds if enabled\n if (data.retention.enabled) {\n const retentionValue = parseInt(formData.get('editRetentionValue'));\n const retentionUnit = formData.get('editRetentionUnit');\n \n if (retentionUnit === 'hours') {\n data.retention.retention_seconds = retentionValue * 3600;\n } else if (retentionUnit === 'days') {\n data.retention.retention_seconds = retentionValue * 86400;\n }\n }\n\n // Show loading state\n const updateButton = document.querySelector('#editRetentionModal .btn-primary');\n updateButton.disabled = true;\n updateButton.innerHTML = '<i class=\"fas fa-spinner fa-spin me-1\"></i>Updating...';\n\n // Send API request\n fetch('/api/mq/topics/retention/update', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data)\n })\n .then(response => response.json())\n .then(result => {\n if (result.error) {\n alert('Failed to update retention: ' + result.error);\n } else {\n alert('Retention policy updated successfully!');\n // Close modal and refresh page\n const modal = bootstrap.Modal.getInstance(document.getElementById('editRetentionModal'));\n modal.hide();\n window.location.reload();\n }\n })\n .catch(error => {\n alert('Failed to update retention: ' + error.message);\n })\n .finally(() => {\n // Reset button state\n updateButton.disabled = false;\n updateButton.innerHTML = '<i class=\"fas fa-save me-1\"></i>Update Retention';\n });\n }\n </script><!-- Edit Retention Modal --><div class=\"modal fade\" id=\"editRetentionModal\" 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=\"fas fa-edit me-2\"></i>Edit Retention Policy</h5><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\"></button></div><div class=\"modal-body\"><form id=\"editRetentionForm\"><div class=\"card\"><div class=\"card-header\"><h6 class=\"mb-0\"><i class=\"fas fa-clock me-2\"></i>Retention Configuration</h6></div><div class=\"card-body\"><div class=\"form-check mb-3\"><input class=\"form-check-input\" type=\"checkbox\" id=\"editEnableRetention\" name=\"editEnableRetention\" onchange=\"toggleEditRetentionFields()\"> <label class=\"form-check-label\" for=\"editEnableRetention\">Enable data retention</label></div><div id=\"editRetentionFields\" style=\"display: none;\"><div class=\"row\"><div class=\"col-md-6\"><div class=\"mb-3\"><label for=\"editRetentionValue\" class=\"form-label\">Retention Duration</label> <input type=\"number\" class=\"form-control\" id=\"editRetentionValue\" name=\"editRetentionValue\" min=\"1\" value=\"7\"></div></div><div class=\"col-md-6\"><div class=\"mb-3\"><label for=\"editRetentionUnit\" class=\"form-label\">Unit</label> <select class=\"form-control\" id=\"editRetentionUnit\" name=\"editRetentionUnit\"><option value=\"hours\">Hours</option> <option value=\"days\" selected>Days</option></select></div></div></div><div class=\"alert alert-info\"><i class=\"fas fa-info-circle me-2\"></i> Data older than this duration will be automatically purged to save storage space.</div></div></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=\"updateRetention()\"><i class=\"fas fa-save me-1\"></i>Update Retention</button></div></div></div></div>")
  937. if templ_7745c5c3_Err != nil {
  938. return templ_7745c5c3_Err
  939. }
  940. return nil
  941. })
  942. }
  943. var _ = templruntime.GeneratedTemplate