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.
 
 
 

190 lignes
8.6 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"
  8. class="stroke-info h-6 w-6 shrink-0 stroke-[#008EED]">
  9. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
  10. d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
  11. </svg>
  12. <span class="text-[#008EED]" js-data="texts tables info {arguments:id}" js-text="test"
  13. js-do="{alert: 'test'}">{arguments:info}</span>
  14. </div>
  15. <div class="flex items-center gap-2">
  16. <label class="input input-primary w-[200px]">
  17. <span class="iconify lucide--search text-base-content/70 size-4.5 "></span>
  18. <input class="text-base placeholder:text-sm" type="search" x-model="search" @input="updateSearch"
  19. placeholder="Search" />
  20. </label>
  21. <div class="dropdown dropdown-bottom dropdown-end">
  22. <div aria-label="More actions" tabindex="0" role="button" class="btn btn-outline btn-primary">
  23. <span class="iconify lucide--ellipsis-vertical size-4"></span>
  24. </div>
  25. <div
  26. tabindex="0"
  27. class="dropdown-content bg-base-100 rounded-box w-44 shadow">
  28. <ul class="menu w-full">
  29. <li class="update{arguments:db}" @click="updateData()">
  30. <div>
  31. <span
  32. class="iconify lucide--refresh-cw size-4"></span>
  33. Refresh Data
  34. </div>
  35. </li>
  36. <li>
  37. <div>
  38. <span
  39. class="iconify lucide--download size-4"></span>
  40. Export
  41. </div>
  42. </li>
  43. </ul>
  44. </div>
  45. </div>
  46. <button type="submit" class="btn btn-outline btn-primary" style="cursor: pointer;"
  47. onclick="js.part({'do':'{arguments:new}',arguments:{db:'{arguments:db}'}})">Add</button>
  48. </div>
  49. </div>
  50. <div class="flex w-full px-[30px]">
  51. <div
  52. class=" max-h-[calc(100vh-260px)] overflow-y-scroll overflow-x-auto w-full border-solid border-1 border-[#008EED] rounded-none">
  53. <div
  54. class="min-w-[480px] px-[20px] py-[20px] border-base-200 flex flex-wrap items-center justify-between gap-2">
  55. <div class="join border-solid border-1 border-[#008EED] rounded-md">
  56. <button class="btn btn-square btn-sm btn-outline border-base-300 join-item"
  57. aria-label="Pagination controls" :disabled="!table.getCanPreviousPage()" @click="prevPage()">
  58. <span class="iconify lucide--arrow-left"></span>
  59. </button>
  60. <input aria-label="Page number" min="1" :max="table.getPageCount()" :value="pageIndex + 1"
  61. @input="setPageIndex($event.target.value - 1)"
  62. class="input input-sm join-item w-10 text-center border-0" />
  63. <button class="btn btn-square btn-sm btn-outline border-base-300 join-item"
  64. aria-label="Pagination controls" :disabled="!table.getCanNextPage()" @click="nextPage()">
  65. <span class="iconify lucide--arrow-right"></span>
  66. </button>
  67. </div>
  68. <p class="text-base-content/70 text-sm max-md:hidden">
  69. <span class="text-base-content font-medium" x-text="`${start}–${end}`"></span>
  70. out of
  71. <span class="text-base-content font-medium" x-text="rowCount"></span>
  72. </p>
  73. <div class="flex items-center gap-2">
  74. <p class="text-base-content/70 text-sm max-md:hidden">
  75. Per page
  76. </p>
  77. <select aria-label="Items per page" class="select select-sm w-16 border-solid border-1 border-[#008EED]"
  78. @change="changePageSize(Number($event.target.value))">
  79. <template x-for="size in pageSizes" :key="size">
  80. <option :value="size" :selected="size === pageSize" x-text="size"></option>
  81. </template>
  82. </select>
  83. </div>
  84. </div>
  85. <table class="table">
  86. <thead>
  87. <template x-for="headerGroup in table.getHeaderGroups()" :key="headerGroup.id">
  88. <tr>
  89. <template x-for="header in headerGroup.headers" :key="header.id">
  90. <th class="text-[#008EED]" , x-show="!header.isPlaceholder"
  91. x-text="flexRender(header.column.columnDef.header, header.getContext())"></th>
  92. </template>
  93. </tr>
  94. </template>
  95. </thead>
  96. <tbody>
  97. <template x-if="!visibleRows.length">
  98. <tr>
  99. <td :colspan="columns.length" class="h-24 text-center">
  100. <p>
  101. No results.
  102. <span @click="clearFilters" class="text-primary cursor-pointer hover:underline">
  103. Clear filters
  104. </span>
  105. </p>
  106. </td>
  107. </tr>
  108. </template>
  109. <template x-if="visibleRows.length">
  110. <template x-for="row in visibleRows" :key="row.id">
  111. <tr>
  112. <template x-for="cell in getVisibleCells(row)" :key="cell.id">
  113. <td>
  114. <template x-if="cell.column.id === 'subject'">
  115. <div class="flex items-center gap-2">
  116. <div>
  117. <p class="leading-none font-medium" x-text="cell.row.original.subject"></p>
  118. <p class="text-base-content/70 mt-0.5 text-xs/none"
  119. x-text="cell.row.original.tracker"></p>
  120. </div>
  121. </div>
  122. </template>
  123. <template x-if="cell.column.id === 'id'">
  124. <span class="text-base-content/70 font-mono text-xs uppercase"
  125. x-text="cell.row.original.id"></span>
  126. </template>
  127. <template x-if="cell.column.id === 'name'">
  128. <div class="flex items-center gap-2">
  129. <div>
  130. <p class="leading-none font-medium" x-text="cell.row.original.name"></p>
  131. <p
  132. class="text-base-content/70 mt-0.5 text-xs/none"
  133. x-text="cell.row.original.role"></p>
  134. </div>
  135. </div>
  136. </template>
  137. <template x-if="cell.column.id === 'actions'">
  138. <div class="gap-2 text-right">
  139. <button aria-label="Show" class="saveButton btn btn-outline btn-primary"
  140. @click="viewRow(cell.row)">Open</button>
  141. </div>
  142. </template>
  143. <template
  144. x-if="!['id', 'name', 'status', 'model', 'ip', 'position', 'actions'].includes(cell.column.id)">
  145. <span
  146. x-html="cell.column.columnDef.cell ? cell.column.columnDef.cell(cell.getContext()) : cell.getValue()"></span>
  147. </template>
  148. </td>
  149. </template>
  150. </tr>
  151. </template>
  152. </template>
  153. </tbody>
  154. </table>
  155. </div>
  156. <div
  157. 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">
  158. </div>
  159. </div>
  160. </div>