Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

302 lignes
13 KiB

  1. <div class="h-full lg:min-w-full xl:min-w-0" x-data="UI.createTable({db:'{arguments:db}'})">
  2. <div class="border-base-200 flex items-center justify-between px-5 mb-[10px] space-x-3">
  3. <div>
  4. <span class="text-2xl text-[#008EED] leading-[80px]">{arguments:db}s</span>
  5. </div>
  6. <div role="alert" class="alert alert-info alert-soft hidden lg:flex">
  7. <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="stroke-info h-6 w-6 shrink-0 stroke-[#008EED]">
  8. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
  9. </svg>
  10. <span class="text-[#008EED]" js-data="texts tables info {arguments:id}">This is the log of the events related to trackers with their latest status</span>
  11. </div>
  12. <div class="flex items-center gap-2">
  13. <label class="input input-primary w-[200px]">
  14. <span
  15. class="iconify lucide--search text-base-content/70 size-4.5 "></span>
  16. <input
  17. class="text-base placeholder:text-sm"
  18. type="search"
  19. x-model="search"
  20. @input="updateSearch"
  21. placeholder="Search" />
  22. </label>
  23. <!-- <div class="dropdown dropdown-bottom dropdown-end">
  24. <div
  25. tabindex="0"
  26. role="button"
  27. class="btn btn-outline btn-primary">
  28. <span
  29. class="iconify lucide--columns-3-cog size-4"></span>
  30. </div>
  31. <div tabindex="0" class="dropdown-content bg-base-100 rounded-box w-44 shadow">
  32. <ul class="menu w-full">
  33. <template
  34. x-for="column in allLeafColumns"
  35. :key="column.id">
  36. <li @click="toggleColumn(column)">
  37. <div
  38. class="group gap-2.5"
  39. :data-visible="isColumnVisible(column) ? true : null">
  40. <span
  41. class="iconify lucide--check size-4 scale-50 opacity-0 transition-all duration-300 group-data-visible:scale-100 group-data-visible:opacity-100"></span>
  42. <span
  43. class="font-medium"
  44. x-text="column.columnDef.header"></span>
  45. </div>
  46. </li>
  47. </template>
  48. </ul>
  49. </div>
  50. </div> -->
  51. <div class="dropdown dropdown-bottom dropdown-end">
  52. <div
  53. aria-label="More actions"
  54. tabindex="0"
  55. role="button"
  56. class="btn btn-outline btn-primary">
  57. <span
  58. class="iconify lucide--ellipsis-vertical size-4"></span>
  59. </div>
  60. <div
  61. tabindex="0"
  62. class="dropdown-content bg-base-100 rounded-box w-44 shadow">
  63. <ul class="menu w-full">
  64. <li class="update{arguments:db}" @click="updateData()">
  65. <div>
  66. <span
  67. class="iconify lucide--refresh-cw size-4"></span>
  68. Refresh Data
  69. </div>
  70. </li>
  71. <li>
  72. <div>
  73. <span
  74. class="iconify lucide--download size-4"></span>
  75. Export
  76. </div>
  77. </li>
  78. </ul>
  79. </div>
  80. </div>
  81. <button type="submit" class="btn btn-outline btn-primary" style="cursor: pointer;" onclick="js.part({'do':'{arguments:new}',arguments:{db:'{arguments:db}'}})">Add</button>
  82. </div>
  83. </div>
  84. <div class="flex w-full px-[30px]">
  85. <div class=" max-h-[calc(100vh-260px)] overflow-y-scroll overflow-x-auto w-full border-solid border-1 border-[#008EED] rounded-none">
  86. <div class="min-w-[480px] px-[20px] py-[20px] border-base-200 flex flex-wrap items-center justify-between gap-2">
  87. <div class="join border-solid border-1 border-[#008EED] rounded-md">
  88. <button
  89. class="btn btn-square btn-sm btn-outline border-base-300 join-item"
  90. aria-label="Pagination controls"
  91. :disabled="!table.getCanPreviousPage()"
  92. @click="prevPage()">
  93. <span class="iconify lucide--arrow-left"></span>
  94. </button>
  95. <input
  96. aria-label="Page number"
  97. min="1"
  98. :max="table.getPageCount()"
  99. :value="pageIndex + 1"
  100. @input="setPageIndex($event.target.value - 1)"
  101. class="input input-sm join-item w-10 text-center border-0" />
  102. <button
  103. class="btn btn-square btn-sm btn-outline border-base-300 join-item"
  104. aria-label="Pagination controls"
  105. :disabled="!table.getCanNextPage()"
  106. @click="nextPage()">
  107. <span class="iconify lucide--arrow-right"></span>
  108. </button>
  109. </div>
  110. <p class="text-base-content/70 text-sm max-md:hidden">
  111. <span
  112. class="text-base-content font-medium"
  113. x-text="`${start}–${end}`"></span>
  114. out of
  115. <span
  116. class="text-base-content font-medium"
  117. x-text="rowCount"></span>
  118. </p>
  119. <div class="flex items-center gap-2">
  120. <p class="text-base-content/70 text-sm max-md:hidden">
  121. Per page
  122. </p>
  123. <select
  124. aria-label="Items per page"
  125. class="select select-sm w-16 border-solid border-1 border-[#008EED]"
  126. @change="changePageSize(Number($event.target.value))">
  127. <template x-for="size in pageSizes" :key="size">
  128. <option
  129. :value="size"
  130. :selected="size === pageSize"
  131. x-text="size"></option>
  132. </template>
  133. </select>
  134. </div>
  135. </div>
  136. <table class="table">
  137. <thead>
  138. <template
  139. x-for="headerGroup in table.getHeaderGroups()"
  140. :key="headerGroup.id">
  141. <tr>
  142. <template
  143. x-for="header in headerGroup.headers"
  144. :key="header.id">
  145. <th
  146. class="text-[#008EED]",
  147. x-show="!header.isPlaceholder"
  148. x-text="flexRender(header.column.columnDef.header, header.getContext())"></th>
  149. </template>
  150. </tr>
  151. </template>
  152. </thead>
  153. <tbody>
  154. <template x-if="!visibleRows.length">
  155. <tr>
  156. <td
  157. :colspan="columns.length"
  158. class="h-24 text-center">
  159. <p>
  160. No results.
  161. <span
  162. @click="clearFilters"
  163. class="text-primary cursor-pointer hover:underline">
  164. Clear filters
  165. </span>
  166. </p>
  167. </td>
  168. </tr>
  169. </template>
  170. <template x-if="visibleRows.length">
  171. <template
  172. x-for="row in visibleRows"
  173. :key="row.id"
  174. >
  175. <tr>
  176. <template
  177. x-for="cell in getVisibleCells(row)"
  178. :key="cell.id"
  179. >
  180. <td>
  181. <template
  182. x-if="cell.column.id === 'subject'">
  183. <div
  184. class="flex items-center gap-2">
  185. <div>
  186. <p
  187. class="leading-none font-medium"
  188. x-text="cell.row.original.subject"></p>
  189. <p
  190. class="text-base-content/70 mt-0.5 text-xs/none"
  191. x-text="cell.row.original.tracker"></p>
  192. </div>
  193. </div>
  194. </template>
  195. <template
  196. x-if="cell.column.id === 'id'">
  197. <span
  198. class="text-base-content/70 font-mono text-xs uppercase"
  199. x-text="cell.row.original.id"></span>
  200. </template>
  201. <template
  202. x-if="cell.column.id === 'name'">
  203. <div
  204. class="flex items-center gap-2">
  205. <div>
  206. <p
  207. class="leading-none font-medium"
  208. x-text="cell.row.original.name"></p>
  209. <!-- <p
  210. class="text-base-content/70 mt-0.5 text-xs/none"
  211. x-text="cell.row.original.mac"></p> -->
  212. </div>
  213. </div>
  214. </template>
  215. <template
  216. x-if="cell.column.id === 'city'">
  217. <span
  218. class="text-base font-medium"
  219. x-text="cell.row.original.city"></span>
  220. </template>
  221. <template
  222. x-if="cell.column.id === 'actions'">
  223. <div
  224. class="gap-2 text-right">
  225. <button
  226. aria-label="Show"
  227. class="saveButton btn btn-outline btn-primary"
  228. @click="viewRow(cell.row)"
  229. >Open</button>
  230. <!-- <button
  231. aria-label="Show"
  232. class="btn btn-soft btn-xs btn-square"
  233. @click="viewRow(cell.row)">
  234. <span
  235. class="iconify lucide--eye size-3.5"></span>
  236. </button>
  237. <button
  238. aria-label="Delete"
  239. class="btn btn-soft btn-error btn-xs btn-square"
  240. @click="deleteRow(cell.row)">
  241. <span
  242. class="iconify lucide--trash-2 size-3.5"></span>
  243. </button> -->
  244. </div>
  245. </template>
  246. <template
  247. x-if="!
  248. ['id', 'name', 'status', 'model', 'ip', 'position', 'actions'].includes(cell.column.id)">
  249. <span
  250. x-html="cell.column.columnDef.cell
  251. ? cell.column.columnDef.cell(cell.getContext())
  252. : cell.getValue()"></span>
  253. </template>
  254. </td>
  255. </template>
  256. </tr>
  257. </template>
  258. </template>
  259. </tbody>
  260. </table>
  261. </div>
  262. <div class="post min-w-[400px] max-w-[600px] max-h-[calc(100vh-260px)] overflow-y-scroll border-solid border-1 border-[#008EED] rounded-none post{arguments:id} ml-[30px] mb-[30px] hidden"></div>
  263. </div>
  264. </div>