logo

pleroma-fe

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

settings_modal.vue (5554B)


  1. <template>
  2. <Modal
  3. :is-open="modalActivated"
  4. class="settings-modal"
  5. :class="{ peek: modalPeeked }"
  6. :no-background="modalPeeked"
  7. >
  8. <div class="settings-modal-panel panel">
  9. <div class="panel-heading">
  10. <h1 class="title">
  11. {{ modalMode === 'user' ? $t('settings.settings') : $t('admin_dash.window_title') }}
  12. </h1>
  13. <transition name="fade">
  14. <div
  15. v-if="currentSaveStateNotice"
  16. class="alert"
  17. :class="{ success: !currentSaveStateNotice.error, error: currentSaveStateNotice.error}"
  18. @click.prevent
  19. >
  20. {{ currentSaveStateNotice.error ? $t('settings.saving_err') : $t('settings.saving_ok') }}
  21. </div>
  22. </transition>
  23. <button
  24. class="btn button-default"
  25. :title="$t('general.peek')"
  26. @click="peekModal"
  27. >
  28. <FAIcon
  29. :icon="['far', 'window-minimize']"
  30. fixed-width
  31. />
  32. </button>
  33. <button
  34. class="btn button-default"
  35. :title="$t('general.close')"
  36. @click="closeModal"
  37. >
  38. <FAIcon
  39. icon="times"
  40. fixed-width
  41. />
  42. </button>
  43. </div>
  44. <div class="panel-body">
  45. <SettingsModalUserContent v-if="modalMode === 'user' && modalOpenedOnceUser" />
  46. <SettingsModalAdminContent v-if="modalMode === 'admin' && modalOpenedOnceAdmin" />
  47. </div>
  48. <div class="panel-footer settings-footer -flexible-height">
  49. <Popover
  50. v-if="modalMode === 'user'"
  51. class="export"
  52. trigger="click"
  53. placement="top"
  54. :offset="{ y: 5, x: 5 }"
  55. :bound-to="{ x: 'container' }"
  56. remove-padding
  57. >
  58. <template #trigger>
  59. <button
  60. class="btn button-default"
  61. :title="$t('general.close')"
  62. >
  63. <span>{{ $t("settings.file_export_import.backup_restore") }}</span>
  64. {{ ' ' }}
  65. <FAIcon
  66. icon="chevron-down"
  67. />
  68. </button>
  69. </template>
  70. <template #content="{close}">
  71. <div class="dropdown-menu">
  72. <div class="menu-item dropdown-item -icon">
  73. <button
  74. class="main-button"
  75. @click.prevent="backup"
  76. @click="close"
  77. >
  78. <FAIcon
  79. icon="file-download"
  80. fixed-width
  81. /><span>{{ $t("settings.file_export_import.backup_settings") }}</span>
  82. </button>
  83. </div>
  84. <div class="menu-item dropdown-item -icon">
  85. <button
  86. class="main-button"
  87. @click.prevent="backupWithTheme"
  88. @click="close"
  89. >
  90. <FAIcon
  91. icon="file-download"
  92. fixed-width
  93. /><span>{{ $t("settings.file_export_import.backup_settings_theme") }}</span>
  94. </button>
  95. </div>
  96. <div class="menu-item dropdown-item -icon">
  97. <button
  98. class="main-button"
  99. @click.prevent="restore"
  100. @click="close"
  101. >
  102. <FAIcon
  103. icon="file-upload"
  104. fixed-width
  105. /><span>{{ $t("settings.file_export_import.restore_settings") }}</span>
  106. </button>
  107. </div>
  108. </div>
  109. </template>
  110. </Popover>
  111. <Checkbox
  112. :model-value="!!expertLevel"
  113. @update:modelValue="expertLevel = Number($event)"
  114. >
  115. {{ $t("settings.expert_mode") }}
  116. </Checkbox>
  117. <span v-if="modalMode === 'admin'">
  118. <i18n-t
  119. scope="global"
  120. keypath="admin_dash.wip_notice"
  121. >
  122. <template #adminFeLink>
  123. <a
  124. href="/pleroma/admin/#/login-pleroma"
  125. target="_blank"
  126. >
  127. {{ $t("admin_dash.old_ui_link") }}
  128. </a>
  129. </template>
  130. </i18n-t>
  131. </span>
  132. <span
  133. id="unscrolled-content"
  134. class="extra-content"
  135. />
  136. <span
  137. v-if="modalMode === 'admin'"
  138. class="admin-buttons"
  139. >
  140. <button
  141. class="button-default btn"
  142. :disabled="!adminDraftAny"
  143. @click="resetAdminDraft"
  144. >
  145. {{ $t("admin_dash.reset_all") }}
  146. </button>
  147. {{ ' ' }}
  148. <button
  149. class="button-default btn"
  150. :disabled="!adminDraftAny"
  151. @click="pushAdminDraft"
  152. >
  153. {{ $t("admin_dash.commit_all") }}
  154. </button>
  155. </span>
  156. </div>
  157. </div>
  158. <teleport to="#modal">
  159. <ConfirmModal
  160. v-if="$store.state.interface.temporaryChangesTimeoutId"
  161. :title="$t('settings.confirm_new_setting')"
  162. :cancel-text="$t('settings.revert')"
  163. :confirm-text="$t('settings.confirm')"
  164. @cancelled="$store.state.interface.temporaryChangesRevert"
  165. @accepted="$store.state.interface.temporaryChangesConfirm"
  166. >
  167. {{ $t('settings.confirm_new_question') }}
  168. </ConfirmModal>
  169. </teleport>
  170. </Modal>
  171. </template>
  172. <script src="./settings_modal.js"></script>
  173. <style src="./settings_modal.scss" lang="scss"></style>