logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git

frontends_tab.vue (7402B)


  1. <template>
  2. <div
  3. class="frontends-tab"
  4. :label="$t('admin_dash.tabs.frontends')"
  5. >
  6. <div class="setting-item">
  7. <h2>{{ $t('admin_dash.tabs.frontends') }}</h2>
  8. <p>{{ $t('admin_dash.frontend.wip_notice') }}</p>
  9. <ul
  10. v-if="adminDraft"
  11. class="setting-list"
  12. >
  13. <li>
  14. <h3>{{ $t('admin_dash.frontend.default_frontend') }}</h3>
  15. <p>{{ $t('admin_dash.frontend.default_frontend_tip') }}</p>
  16. <ul class="setting-list">
  17. <li>
  18. <StringSetting path=":pleroma.:frontends.:primary.name" />
  19. </li>
  20. <li>
  21. <StringSetting path=":pleroma.:frontends.:primary.ref" />
  22. </li>
  23. <li>
  24. <GroupSetting path=":pleroma.:frontends.:primary" />
  25. </li>
  26. </ul>
  27. </li>
  28. </ul>
  29. <div
  30. v-else
  31. class="setting-list"
  32. >
  33. {{ $t('admin_dash.frontend.default_frontend_unavail') }}
  34. </div>
  35. <div class="setting-list relative">
  36. <PanelLoading
  37. v-if="working"
  38. class="overlay"
  39. />
  40. <h3>{{ $t('admin_dash.frontend.available_frontends') }}</h3>
  41. <ul class="cards-list">
  42. <li
  43. v-for="frontend in frontends"
  44. :key="frontend.name"
  45. >
  46. <strong>{{ frontend.name }}</strong>
  47. {{ ' ' }}
  48. <span v-if="adminDraft && adminDraft[':pleroma'][':frontends'][':primary']?.name === frontend.name">
  49. <i18n-t
  50. v-if="adminDraft && adminDraft[':pleroma'][':frontends'][':primary']?.ref === frontend.refs[0]"
  51. keypath="admin_dash.frontend.is_default"
  52. />
  53. <i18n-t
  54. v-else
  55. keypath="admin_dash.frontend.is_default_custom"
  56. >
  57. <template #version>
  58. <code>{{ adminDraft && adminDraft[':pleroma'][':frontends'][':primary'].ref }}</code>
  59. </template>
  60. </i18n-t>
  61. </span>
  62. <dl>
  63. <dt>{{ $t('admin_dash.frontend.repository') }}</dt>
  64. <dd>
  65. <a
  66. :href="frontend.git"
  67. target="_blank"
  68. >{{ frontend.git }}</a>
  69. </dd>
  70. <template v-if="expertLevel">
  71. <dt>{{ $t('admin_dash.frontend.versions') }}</dt>
  72. <dd
  73. v-for="ref in frontend.refs"
  74. :key="ref"
  75. >
  76. <code>{{ ref }}</code>
  77. </dd>
  78. </template>
  79. <dt v-if="expertLevel">
  80. {{ $t('admin_dash.frontend.build_url') }}
  81. </dt>
  82. <dd v-if="expertLevel">
  83. <a
  84. :href="frontend.build_url"
  85. target="_blank"
  86. >{{ frontend.build_url }}</a>
  87. </dd>
  88. </dl>
  89. <div>
  90. <span class="btn-group">
  91. <button
  92. class="button button-default btn"
  93. type="button"
  94. @click="update(frontend)"
  95. >
  96. {{
  97. frontend.installed
  98. ? $t('admin_dash.frontend.reinstall')
  99. : $t('admin_dash.frontend.install')
  100. }}
  101. <code>
  102. {{
  103. getSuggestedRef(frontend)
  104. }}
  105. </code>
  106. </button>
  107. <Popover
  108. v-if="frontend.refs.length > 1"
  109. trigger="click"
  110. class="button-dropdown"
  111. placement="bottom"
  112. >
  113. <template #content="{close}">
  114. <div class="dropdown-menu">
  115. <button
  116. v-for="ref in frontend.refs"
  117. :key="ref"
  118. class="menu-item dropdown-item"
  119. @click.prevent="update(frontend, ref)"
  120. @click="close"
  121. >
  122. <i18n-t keypath="admin_dash.frontend.install_version">
  123. <template #version>
  124. <code>{{ ref }}</code>
  125. </template>
  126. </i18n-t>
  127. </button>
  128. </div>
  129. </template>
  130. <template #trigger>
  131. <button
  132. class="button button-default btn dropdown-button"
  133. type="button"
  134. :title="$t('admin_dash.frontend.more_install_options')"
  135. >
  136. <FAIcon icon="chevron-down" />
  137. </button>
  138. </template>
  139. </Popover>
  140. </span>
  141. <span
  142. v-if="frontend.installed && frontend.name !== 'admin-fe'"
  143. class="btn-group"
  144. >
  145. <button
  146. class="button button-default btn"
  147. type="button"
  148. :disabled="
  149. !adminDraft || adminDraft[':pleroma'][':frontends'][':primary']?.name === frontend.name &&
  150. adminDraft[':pleroma'][':frontends'][':primary']?.ref === frontend.refs[0]
  151. "
  152. @click="setDefault(frontend)"
  153. >
  154. {{
  155. $t('admin_dash.frontend.set_default')
  156. }}
  157. <code>
  158. {{
  159. getSuggestedRef(frontend)
  160. }}
  161. </code>
  162. </button>
  163. {{ ' ' }}
  164. <Popover
  165. v-if="frontend.refs.length > 1"
  166. trigger="click"
  167. class="button-dropdown"
  168. placement="bottom"
  169. >
  170. <template #content="{close}">
  171. <div class="dropdown-menu">
  172. <button
  173. v-for="ref in frontend.installedRefs || frontend.refs"
  174. :key="ref"
  175. class="menu-item dropdown-item"
  176. @click.prevent="setDefault(frontend, ref)"
  177. @click="close"
  178. >
  179. <i18n-t keypath="admin_dash.frontend.set_default_version">
  180. <template #version>
  181. <code>{{ ref }}</code>
  182. </template>
  183. </i18n-t>
  184. </button>
  185. </div>
  186. </template>
  187. <template #trigger>
  188. <button
  189. class="button button-default btn dropdown-button"
  190. type="button"
  191. :title="$t('admin_dash.frontend.more_default_options')"
  192. >
  193. <FAIcon icon="chevron-down" />
  194. </button>
  195. </template>
  196. </Popover>
  197. </span>
  198. </div>
  199. </li>
  200. </ul>
  201. </div>
  202. </div>
  203. </div>
  204. </template>
  205. <script src="./frontends_tab.js"></script>
  206. <style lang="scss" src="./frontends_tab.scss"></style>