logo

pleroma-fe

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

frontends_tab.vue (8118B)


  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. scope="global"
  52. keypath="admin_dash.frontend.is_default"
  53. />
  54. <i18n-t
  55. v-else
  56. keypath="admin_dash.frontend.is_default_custom"
  57. scope="global"
  58. >
  59. <template #version>
  60. <code>{{ adminDraft && adminDraft[':pleroma'][':frontends'][':primary'].ref }}</code>
  61. </template>
  62. </i18n-t>
  63. </span>
  64. <dl>
  65. <dt>{{ $t('admin_dash.frontend.repository') }}</dt>
  66. <dd>
  67. <a
  68. :href="frontend.git"
  69. target="_blank"
  70. >{{ frontend.git }}</a>
  71. </dd>
  72. <template v-if="expertLevel">
  73. <dt>{{ $t('admin_dash.frontend.versions') }}</dt>
  74. <dd
  75. v-for="ref in frontend.refs"
  76. :key="ref"
  77. >
  78. <code>{{ ref }}</code>
  79. </dd>
  80. </template>
  81. <dt v-if="expertLevel">
  82. {{ $t('admin_dash.frontend.build_url') }}
  83. </dt>
  84. <dd v-if="expertLevel">
  85. <a
  86. :href="frontend.build_url"
  87. target="_blank"
  88. >{{ frontend.build_url }}</a>
  89. </dd>
  90. </dl>
  91. <div>
  92. <span class="btn-group">
  93. <button
  94. class="button button-default btn"
  95. type="button"
  96. @click="update(frontend)"
  97. >
  98. {{
  99. frontend.installed
  100. ? $t('admin_dash.frontend.reinstall')
  101. : $t('admin_dash.frontend.install')
  102. }}
  103. <code>
  104. {{
  105. getSuggestedRef(frontend)
  106. }}
  107. </code>
  108. </button>
  109. <Popover
  110. v-if="frontend.refs.length > 1"
  111. trigger="click"
  112. class="button-dropdown"
  113. placement="bottom"
  114. >
  115. <template #content="{close}">
  116. <div class="dropdown-menu">
  117. <div
  118. v-for="ref in frontend.refs"
  119. :key="ref"
  120. class="menu-item dropdown-item"
  121. >
  122. <button
  123. class="main-button"
  124. @click.prevent="update(frontend, ref)"
  125. @click="close"
  126. >
  127. <span>
  128. <i18n-t
  129. keypath="admin_dash.frontend.install_version"
  130. scope="global"
  131. >
  132. <template #version>
  133. <code>{{ ref }}</code>
  134. </template>
  135. </i18n-t>
  136. </span>
  137. </button>
  138. </div>
  139. </div>
  140. </template>
  141. <template #trigger>
  142. <button
  143. class="button button-default btn dropdown-button"
  144. type="button"
  145. :title="$t('admin_dash.frontend.more_install_options')"
  146. >
  147. <FAIcon icon="chevron-down" />
  148. </button>
  149. </template>
  150. </Popover>
  151. </span>
  152. <span
  153. v-if="frontend.installed && frontend.name !== 'admin-fe'"
  154. class="btn-group"
  155. >
  156. <button
  157. class="button button-default btn"
  158. type="button"
  159. :disabled="
  160. !adminDraft || adminDraft[':pleroma'][':frontends'][':primary']?.name === frontend.name &&
  161. adminDraft[':pleroma'][':frontends'][':primary']?.ref === frontend.refs[0]
  162. "
  163. @click="setDefault(frontend)"
  164. >
  165. {{
  166. $t('admin_dash.frontend.set_default')
  167. }}
  168. <code>
  169. {{
  170. getSuggestedRef(frontend)
  171. }}
  172. </code>
  173. </button>
  174. {{ ' ' }}
  175. <Popover
  176. v-if="frontend.refs.length > 1"
  177. trigger="click"
  178. class="button-dropdown"
  179. placement="bottom"
  180. >
  181. <template #content="{close}">
  182. <div class="dropdown-menu">
  183. <div
  184. v-for="ref in frontend.installedRefs || frontend.refs"
  185. :key="ref"
  186. class="menu-item dropdown-item"
  187. >
  188. <button
  189. class="main-button"
  190. @click.prevent="setDefault(frontend, ref)"
  191. @click="close"
  192. >
  193. <span>
  194. <i18n-t
  195. keypath="admin_dash.frontend.set_default_version"
  196. scope="global"
  197. >
  198. <template #version>
  199. <code>{{ ref }}</code>
  200. </template>
  201. </i18n-t>
  202. </span>
  203. </button>
  204. </div>
  205. </div>
  206. </template>
  207. <template #trigger>
  208. <button
  209. class="button button-default btn dropdown-button"
  210. type="button"
  211. :title="$t('admin_dash.frontend.more_default_options')"
  212. >
  213. <FAIcon icon="chevron-down" />
  214. </button>
  215. </template>
  216. </Popover>
  217. </span>
  218. </div>
  219. </li>
  220. </ul>
  221. </div>
  222. </div>
  223. </div>
  224. </template>
  225. <script src="./frontends_tab.js"></script>
  226. <style lang="scss" src="./frontends_tab.scss"></style>