diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/global_notice_list/global_notice_list.vue | 2 | ||||
| -rw-r--r-- | src/components/settings_modal/admin_tabs/frontends_tab.js | 51 | ||||
| -rw-r--r-- | src/components/settings_modal/admin_tabs/frontends_tab.scss | 16 | ||||
| -rw-r--r-- | src/components/settings_modal/admin_tabs/frontends_tab.vue | 30 | ||||
| -rw-r--r-- | src/components/settings_modal/admin_tabs/instance_tab.vue | 6 | ||||
| -rw-r--r-- | src/components/settings_modal/helpers/attachment_setting.js | 1 | ||||
| -rw-r--r-- | src/components/settings_modal/helpers/attachment_setting.vue | 38 | ||||
| -rw-r--r-- | src/components/status/status.vue | 53 | ||||
| -rw-r--r-- | src/i18n/en.json | 5 | ||||
| -rw-r--r-- | src/i18n/nan-TW.json | 29 | ||||
| -rw-r--r-- | src/i18n/zh.json | 27 | ||||
| -rw-r--r-- | src/modules/adminSettings.js | 1 | ||||
| -rw-r--r-- | src/services/file_type/file_type.service.js | 2 |
13 files changed, 211 insertions, 50 deletions
diff --git a/src/components/global_notice_list/global_notice_list.vue b/src/components/global_notice_list/global_notice_list.vue index 0e58476f..9e9ec7aa 100644 --- a/src/components/global_notice_list/global_notice_list.vue +++ b/src/components/global_notice_list/global_notice_list.vue @@ -32,7 +32,7 @@ top: calc(var(--navbar-height) + 0.5em); width: 100%; pointer-events: none; - z-index: var(--ZI_navbar_popovers); + z-index: var(--ZI_modals_popovers); display: flex; flex-direction: column; align-items: center; diff --git a/src/components/settings_modal/admin_tabs/frontends_tab.js b/src/components/settings_modal/admin_tabs/frontends_tab.js index a2c27c2a..8163af59 100644 --- a/src/components/settings_modal/admin_tabs/frontends_tab.js +++ b/src/components/settings_modal/admin_tabs/frontends_tab.js @@ -4,6 +4,7 @@ import IntegerSetting from '../helpers/integer_setting.vue' import StringSetting from '../helpers/string_setting.vue' import GroupSetting from '../helpers/group_setting.vue' import Popover from 'src/components/popover/popover.vue' +import PanelLoading from 'src/components/panel_loading/panel_loading.vue' import SharedComputedObject from '../helpers/shared_computed_object.js' import { library } from '@fortawesome/fontawesome-svg-core' @@ -22,12 +23,18 @@ const FrontendsTab = { defaultSource: 'admin' } }, + data () { + return { + working: false + } + }, components: { BooleanSetting, ChoiceSetting, IntegerSetting, StringSetting, GroupSetting, + PanelLoading, Popover }, created () { @@ -42,18 +49,56 @@ const FrontendsTab = { ...SharedComputedObject() }, methods: { + canInstall (frontend) { + const fe = this.frontends.find(f => f.name === frontend.name) + if (!fe) return false + return fe.refs.includes(frontend.ref) + }, + getSuggestedRef (frontend) { + const defaultFe = this.adminDraft[':pleroma'][':frontends'][':primary'] + if (defaultFe?.name === frontend.name && this.canInstall(defaultFe)) { + return defaultFe.ref + } else { + return frontend.refs[0] + } + }, update (frontend, suggestRef) { - const ref = suggestRef || frontend.refs[0] + const ref = suggestRef || this.getSuggestedRef(frontend) const { name } = frontend const payload = { name, ref } + this.working = true this.$store.state.api.backendInteractor.installFrontend({ payload }) - .then((externalUser) => { + .finally(() => { + this.working = false + }) + .then(async (response) => { this.$store.dispatch('loadFrontendsStuff') + if (response.error) { + const reason = await response.error.json() + this.$store.dispatch('pushGlobalNotice', { + level: 'error', + messageKey: 'admin_dash.frontend.failure_installing_frontend', + messageArgs: { + version: name + '/' + ref, + reason: reason.error + }, + timeout: 5000 + }) + } else { + this.$store.dispatch('pushGlobalNotice', { + level: 'success', + messageKey: 'admin_dash.frontend.success_installing_frontend', + messageArgs: { + version: name + '/' + ref + }, + timeout: 2000 + }) + } }) }, setDefault (frontend, suggestRef) { - const ref = suggestRef || frontend.refs[0] + const ref = suggestRef || this.getSuggestedRef(frontend) const { name } = frontend this.$store.commit('updateAdminDraft', { path: [':pleroma', ':frontends', ':primary'], value: { name, ref } }) diff --git a/src/components/settings_modal/admin_tabs/frontends_tab.scss b/src/components/settings_modal/admin_tabs/frontends_tab.scss index e3e04bc6..420d20b3 100644 --- a/src/components/settings_modal/admin_tabs/frontends_tab.scss +++ b/src/components/settings_modal/admin_tabs/frontends_tab.scss @@ -3,6 +3,22 @@ padding: 0; } + .relative { + position: relative; + } + + .overlay { + position: absolute; + background: var(--bg); + // fix buttons showing through + z-index: 2; + opacity: 0.9; + top: 0; + bottom: 0; + left: 0; + right: 0; + } + dd { text-overflow: ellipsis; word-wrap: nowrap; diff --git a/src/components/settings_modal/admin_tabs/frontends_tab.vue b/src/components/settings_modal/admin_tabs/frontends_tab.vue index 25b08eb7..dd4c9790 100644 --- a/src/components/settings_modal/admin_tabs/frontends_tab.vue +++ b/src/components/settings_modal/admin_tabs/frontends_tab.vue @@ -10,7 +10,6 @@ <li> <h3>{{ $t('admin_dash.frontend.default_frontend') }}</h3> <p>{{ $t('admin_dash.frontend.default_frontend_tip') }}</p> - <p>{{ $t('admin_dash.frontend.default_frontend_tip2') }}</p> <ul class="setting-list"> <li> <StringSetting path=":pleroma.:frontends.:primary.name" /> @@ -24,7 +23,8 @@ </ul> </li> </ul> - <div class="setting-list"> + <div class="setting-list relative"> + <PanelLoading class="overlay" v-if="working"/> <h3>{{ $t('admin_dash.frontend.available_frontends') }}</h3> <ul class="cards-list"> <li @@ -86,6 +86,11 @@ ? $t('admin_dash.frontend.reinstall') : $t('admin_dash.frontend.install') }} + <code> + {{ + getSuggestedRef(frontend) + }} + </code> </button> <Popover v-if="frontend.refs.length > 1" @@ -93,13 +98,14 @@ class="button-dropdown" placement="bottom" > - <template #content> + <template #content="{close}"> <div class="dropdown-menu"> <button v-for="ref in frontend.refs" :key="ref" class="button-default dropdown-item" - @click="update(frontend, ref)" + @click.prevent="update(frontend, ref)" + @click="close" > <i18n-t keypath="admin_dash.frontend.install_version"> <template #version> @@ -128,14 +134,19 @@ class="button button-default btn" type="button" :disabled=" - adminDraft[':pleroma'][':frontends'][':primary'].name === frontend.name && - adminDraft[':pleroma'][':frontends'][':primary'].ref === frontend.refs[0] + adminDraft[':pleroma'][':frontends'][':primary']?.name === frontend.name && + adminDraft[':pleroma'][':frontends'][':primary']?.ref === frontend.refs[0] " @click="setDefault(frontend)" > {{ $t('admin_dash.frontend.set_default') }} + <code> + {{ + getSuggestedRef(frontend) + }} + </code> </button> {{ ' ' }} <Popover @@ -144,13 +155,14 @@ class="button-dropdown" placement="bottom" > - <template #content> + <template #content="{close}"> <div class="dropdown-menu"> <button - v-for="ref in frontend.refs.slice(1)" + v-for="ref in frontend.installedRefs || frontend.refs" :key="ref" class="button-default dropdown-item" - @click="setDefault(frontend, ref)" + @click.prevent="setDefault(frontend, ref)" + @click="close" > <i18n-t keypath="admin_dash.frontend.set_default_version"> <template #version> diff --git a/src/components/settings_modal/admin_tabs/instance_tab.vue b/src/components/settings_modal/admin_tabs/instance_tab.vue index a6be776b..a0e3351e 100644 --- a/src/components/settings_modal/admin_tabs/instance_tab.vue +++ b/src/components/settings_modal/admin_tabs/instance_tab.vue @@ -6,6 +6,10 @@ <li> <StringSetting path=":pleroma.:instance.:name" /> </li> + <!-- See https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3963 --> + <li v-if="adminDraft[':pleroma'][':instance'][':favicon'] !== undefined"> + <AttachmentSetting compact path=":pleroma.:instance.:favicon" /> + </li> <li> <StringSetting path=":pleroma.:instance.:email" /> </li> @@ -16,7 +20,7 @@ <StringSetting path=":pleroma.:instance.:short_description" /> </li> <li> - <AttachmentSetting path=":pleroma.:instance.:instance_thumbnail" /> + <AttachmentSetting compact path=":pleroma.:instance.:instance_thumbnail" /> </li> <li> <AttachmentSetting path=":pleroma.:instance.:background_image" /> diff --git a/src/components/settings_modal/helpers/attachment_setting.js b/src/components/settings_modal/helpers/attachment_setting.js index ac5c6f86..c4c04b2b 100644 --- a/src/components/settings_modal/helpers/attachment_setting.js +++ b/src/components/settings_modal/helpers/attachment_setting.js @@ -7,6 +7,7 @@ export default { ...Setting, props: { ...Setting.props, + compact: Boolean, acceptTypes: { type: String, required: false, diff --git a/src/components/settings_modal/helpers/attachment_setting.vue b/src/components/settings_modal/helpers/attachment_setting.vue index bbc5172c..b50231f2 100644 --- a/src/components/settings_modal/helpers/attachment_setting.vue +++ b/src/components/settings_modal/helpers/attachment_setting.vue @@ -2,6 +2,7 @@ <span v-if="matchesExpertLevel" class="AttachmentSetting" + :class="{ '-compact': compact }" > <label :for="path" @@ -24,8 +25,8 @@ {{ backendDescriptionDescription + ' ' }} </p> <div class="attachment-input"> - <div>{{ $t('settings.url') }}</div> - <div class="controls"> + <div class="controls control-field"> + <label for="path">{{ $t('settings.url') }}</label> <input :id="path" class="string-input" @@ -40,7 +41,7 @@ /> <ProfileSettingIndicator :is-profile="isProfileSetting" /> </div> - <div>{{ $t('settings.preview') }}</div> + <div v-if="!compact">{{ $t('settings.preview') }}</div> <Attachment class="attachment" :compact="compact" @@ -50,7 +51,7 @@ @setMedia="onMedia" @naturalSizeLoad="onNaturalSizeLoad" /> - <div class="controls"> + <div class="controls control-upload"> <MediaUpload ref="mediaUpload" class="media-upload-icon" @@ -84,6 +85,35 @@ width: 20em; } + &.-compact { + .attachment-input { + flex-direction: row; + align-items: flex-end; + } + + .attachment { + flex: 0; + order: 0; + display: block; + min-width: 4em; + height: 4em; + align-self: center; + margin-bottom: 0; + } + + .control-field { + order: 1; + min-width: 12em; + margin-left: 0.5em; + } + + .control-upload { + order: 2; + min-width: 12em; + padding: 0 0.5em; + } + } + .controls { margin-bottom: 0.5em; diff --git a/src/components/status/status.vue b/src/components/status/status.vue index a8477fa3..fa9d6f0b 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -249,22 +249,45 @@ </button> </span> </div> - <div class="status-rich-presence" v-if="scrobblePresent"> - <FAIcon - class="fa-scale-110 fa-old-padding" - icon="music" - /> - {{ scrobble.artist }} — {{ scrobble.title }} - <FAIcon - class="fa-scale-110 fa-old-padding" - icon="play" - /> - <span class="status-rich-presence-time"> - <Timeago - template-key="time.in_past" - :time="scrobble.created_at" - :auto-update="60" + <div + v-if="scrobblePresent" + class="status-rich-presence" + > + <a + v-if="scrobble.externalLink" + :href="scrobble.externalLink" + target="_blank" + > + {{ scrobble.artist }} — {{ scrobble.title }} + <FAIcon + class="fa-scale-110 fa-old-padding" + icon="play" /> + <span class="status-rich-presence-time"> + <Timeago + template-key="time.in_past" + :time="scrobble.created_at" + :auto-update="60" + /> + </span> + </a> + <span v-if="!scrobble.externalLink"> + <FAIcon + class="fa-scale-110 fa-old-padding" + icon="music" + /> + {{ scrobble.artist }} — {{ scrobble.title }} + <FAIcon + class="fa-scale-110 fa-old-padding" + icon="play" + /> + <span class="status-rich-presence-time"> + <Timeago + template-key="time.in_past" + :time="scrobble.created_at" + :auto-update="60" + /> + </span> </span> </div> <div diff --git a/src/i18n/en.json b/src/i18n/en.json index 145e1daa..f4c9de18 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -927,8 +927,9 @@ "wip_notice": "Please note that this section is a WIP and lacks certain features as backend implementation of front-end management is incomplete.", "default_frontend": "Default front-end", "default_frontend_tip": "Default front-end will be shown to all users. Currently there's no way to for a user to select personal front-end. If you switch away from PleromaFE you'll most likely have to use old and buggy AdminFE to do instance configuration until we replace it.", - "default_frontend_tip2": "WIP: Since Pleroma backend doesn't properly list all installed frontends you'll have to enter name and reference manually. List below provides shortcuts to fill the values.", - "available_frontends": "Available for install" + "available_frontends": "Available for install", + "failure_installing_frontend": "Failed to install frontend {version}: {reason}", + "success_installing_frontend": "Frontend {version} successfully installed" }, "temp_overrides": { ":pleroma": { diff --git a/src/i18n/nan-TW.json b/src/i18n/nan-TW.json index 5756555e..5e0df8ec 100644 --- a/src/i18n/nan-TW.json +++ b/src/i18n/nan-TW.json @@ -205,7 +205,13 @@ "migrated_to": "移民到", "reacted_with": "顯出{0} ê 反應", "submitted_report": "送出檢舉", - "poll_ended": "投票結束" + "poll_ended": "投票結束", + "unread_announcements": "{num} 篇公告iáu bē 讀", + "unread_chats": "{num} ê開講iáu bē讀", + "unread_follow_requests": "{num}ê新ê跟tuè請求", + "configuration_tip": "用{theSettings},lí通自訂siánn物佇tsia顯示。{dismiss}", + "configuration_tip_settings": "設定", + "configuration_tip_dismiss": "Mài koh顯示" }, "polls": { "add_poll": "開投票", @@ -713,8 +719,8 @@ "hide_all_muted_posts": "Khàm掉消音êPO文", "max_thumbnails": "PO文ê縮小圖ê khòo-tah(無寫=無限制)", "hide_isp": "Khàm 站臺特有ê面 pang", - "right_sidebar": "Kā 邊á liâu徙kah正手pîng", - "navbar_column_stretch": "伸導覽liâu,kah 欄平闊", + "right_sidebar": "Kā 邊á ê欄位徙kah正手pîng", + "navbar_column_stretch": "伸導覽liâu,kah 欄位平闊", "always_show_post_button": "一直顯示「新ê PO文」ê鈕仔", "hide_wallpaper": "Khàm站臺ê壁紙", "use_one_click_nsfw": "Tshi̍h chi̍t 下就ē當拍開敏感內容", @@ -850,11 +856,11 @@ "conversation_display": "顯示對話ê風格", "conversation_display_tree": "樹á ê形", "disable_sticky_headers": "Mài 予欄位ê頭牢佇螢幕頂懸", - "show_scrollbars": "展示邊á liâu ê giú-á", + "show_scrollbars": "展示邊á ê欄位 ê giú-á", "third_column_mode": "空間夠額ê時,展示第三ê欄位", "third_column_mode_none": "不管時mài顯示第三ê欄位", "third_column_mode_notifications": "通知ê欄位", - "third_column_mode_postform": "主要êPO文表kah導覽", + "third_column_mode_postform": "主要ê PO文表kah導覽", "show_admin_badge": "佇我ê個人資料顯示「行政員」證章", "pause_on_unfocused": "若是 Pleroma ê分頁無點開,tiō 暫停更新", "conversation_display_tree_quick": "樹á形ê展示", @@ -922,7 +928,13 @@ "hard_reset_value": "硬ê重頭設", "hard_reset_value_tooltip": "Suá掉儲存內底ê設定,強制用預設ê值", "reset_value": "重頭設", - "reset_value_tooltip": "重頭設草稿" + "reset_value_tooltip": "重頭設草稿", + "hide_scrobbles": "Tshàng scrobble(記錄)", + "notification_show_extra": "顯示koh khah tsē ê通知佇通知ê欄位", + "notification_extra_chats": "顯示bô讀ê開講", + "notification_extra_announcements": "顯示bô讀ê公告", + "notification_extra_follow_requests": "顯示新ê跟tuè請求", + "notification_extra_tip": "顯示自訂其他通知ê撇步" }, "status": { "favorites": "收藏", @@ -949,7 +961,7 @@ "mentions": "提起", "move_down": "Kā附件suá kàu正pîng", "thread_show_full": "展示tsit 條討論線ê所有(lóng總有{numStatus}ê狀態,深度上限:{depth})", - "thread_follow": "看討論線tshūn ê部份(lóng總有{numStatus}ê狀態)", + "thread_follow": "看討論線tshun ê部份(lóng總有{numStatus}ê狀態)", "replies_list_with_others": "回應(+其他{numReplies}ê):", "mute_conversation": "Kā會話消音", "unmute_conversation": "Kā會話取消消音", @@ -990,7 +1002,8 @@ "reaction_count_label": "{num}ê lâng用表情反應", "hide_quote": "Khàm條引用ê狀態", "display_quote": "顯示引用ê狀態", - "invisible_quote": "引用ê狀態bē當用:{link}" + "invisible_quote": "引用ê狀態bē當用:{link}", + "more_actions": "佇tsit ê狀態ê其他動作" }, "user_card": { "favorites": "收藏", diff --git a/src/i18n/zh.json b/src/i18n/zh.json index 69266caa..396cb2f2 100644 --- a/src/i18n/zh.json +++ b/src/i18n/zh.json @@ -146,7 +146,13 @@ "follow_request": "想要关注你", "error": "取得通知时发生错误:{0}", "poll_ended": "投票结束了", - "submitted_report": "提交举报" + "submitted_report": "提交举报", + "unread_announcements": "{num} 条未读公告", + "unread_chats": "{num} 条未读聊天讯息", + "unread_follow_requests": "{num} 个新关注请求", + "configuration_tip": "可以在 {theSettings} 里定制什么会显示在这里。{dismiss}", + "configuration_tip_settings": "设置", + "configuration_tip_dismiss": "不再显示" }, "polls": { "add_poll": "增加投票", @@ -212,7 +218,9 @@ "edit_unsupported_warning": "Pleroma 不支持对提及或投票进行编辑。", "edit_status": "编辑状态", "content_type_selection": "发帖格式", - "scope_notice_dismiss": "关闭此提示" + "scope_notice_dismiss": "关闭此提示", + "reply_option": "回复这条状态", + "quote_option": "引用这条状态" }, "registration": { "bio": "简介", @@ -747,7 +755,12 @@ "reset_value_tooltip": "重置草稿", "hard_reset_value": "硬重置", "hard_reset_value_tooltip": "从存储中移除设置,强制使用默认值", - "emoji_reactions_scale": "表情回应比例系数" + "emoji_reactions_scale": "表情回应比例系数", + "notification_show_extra": "在通知栏里显示额外通知", + "notification_extra_chats": "显示未读聊天", + "notification_extra_announcements": "显示未读公告", + "notification_extra_follow_requests": "显示新的关注请求", + "notification_extra_tip": "显示额外通知的定制提示" }, "time": { "day": "{0} 天", @@ -880,7 +893,10 @@ "show_attachment_in_modal": "在媒体模式中显示", "status_history": "状态历史", "delete_error": "删除状态时出错:{0}", - "reaction_count_label": "{num} 人作出了表情回应" + "reaction_count_label": "{num} 人作出了表情回应", + "invisible_quote": "引用的状态不可用:{link}", + "hide_quote": "隐藏引用的状态", + "display_quote": "显示引用的状态" }, "user_card": { "approve": "核准", @@ -1184,7 +1200,7 @@ "big_update_title": "请忍耐一下", "big_update_content": "我们已经有一段时间没有发布发行版,所以事情的外观和感觉可能与你习惯的不一样。", "update_bugs": "请在 {pleromaGitlab} 上报告任何问题和bug,因为我们已经改变了很多,虽然我们进行了彻底的测试,并且自己使用了开发版本,但我们可能错过了一些东西。我们欢迎你对你可能遇到的问题或如何改进Pleroma和Pleroma-FE提出反馈和建议。", - "art_by": "Art by {linkToArtist}" + "art_by": "{linkToArtist} 的作品" }, "lists": { "search": "搜索用户", @@ -1266,7 +1282,6 @@ "wip_notice": "请注意,此部分是一个WIP,缺乏某些功能,因为前端管理的后台实现并不完整。", "default_frontend": "默认前端", "default_frontend_tip": "默认的前端将显示给所有用户。目前还没有办法让用户选择个人的前端。如果你不使用 PleromaFE,你很可能不得不使用旧的和有问题的 AdminFE 来进行实例配置,直到我们替换它。", - "default_frontend_tip2": "WIP: 由于 Pleroma 后端没有正确列出所有已安装的前端,你必须手动输入名称和引用。下面的列表提供了填写这些值的快捷方式。", "available_frontends": "可供安装" }, "temp_overrides": { diff --git a/src/modules/adminSettings.js b/src/modules/adminSettings.js index e775eb12..ef28f6e0 100644 --- a/src/modules/adminSettings.js +++ b/src/modules/adminSettings.js @@ -26,6 +26,7 @@ const adminSettingsStorage = { }, setAvailableFrontends (state, { frontends }) { state.frontends = frontends.map(f => { + f.installedRefs = f.installed_refs if (f.name === 'pleroma-fe') { f.refs = ['master', 'develop'] } else { diff --git a/src/services/file_type/file_type.service.js b/src/services/file_type/file_type.service.js index b92c6c64..f7989ffe 100644 --- a/src/services/file_type/file_type.service.js +++ b/src/services/file_type/file_type.service.js @@ -26,7 +26,7 @@ export const fileType = mimetype => { } export const fileTypeExt = url => { - if (url.match(/\.(png|jpe?g|gif|webp|avif)$/)) { + if (url.match(/\.(a?png|jpe?g|gif|webp|avif)$/)) { return 'image' } if (url.match(/\.(ogv|mp4|webm|mov)$/)) { |
