diff --git a/src/App.js b/src/App.js index c455c18c..be6548f3 100644 --- a/src/App.js +++ b/src/App.js @@ -2,8 +2,9 @@ import UserPanel from './components/user_panel/user_panel.vue' import NavPanel from './components/nav_panel/nav_panel.vue' import Notifications from './components/notifications/notifications.vue' import UserFinder from './components/user_finder/user_finder.vue' -import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue' import InstanceSpecificPanel from './components/instance_specific_panel/instance_specific_panel.vue' +import FeaturesPanel from './components/features_panel/features_panel.vue' +import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue' import ChatPanel from './components/chat_panel/chat_panel.vue' export default { @@ -13,8 +14,9 @@ export default { NavPanel, Notifications, UserFinder, - WhoToFollowPanel, InstanceSpecificPanel, + FeaturesPanel, + WhoToFollowPanel, ChatPanel }, data: () => ({ diff --git a/src/App.vue b/src/App.vue index fc446c57..059460f9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -28,6 +28,7 @@ + diff --git a/src/components/features_panel/features_panel.js b/src/components/features_panel/features_panel.js new file mode 100644 index 00000000..80f5c966 --- /dev/null +++ b/src/components/features_panel/features_panel.js @@ -0,0 +1,14 @@ +const FeaturesPanel = { + computed: { + chat: function () { + return this.$store.state.config.chatAvailable && (!this.$store.state.chatDisabled) + }, + gopher: function () { return this.$store.state.config.gopherAvailable }, + whoToFollow: function () { return this.$store.state.config.suggestionsEnabled }, + mediaProxy: function () { return this.$store.state.config.mediaProxyAvailable }, + scopeOptions: function () { return this.$store.state.config.scopeOptionsEnabled }, + textlimit: function () { return this.$store.state.config.textlimit } + } +} + +export default FeaturesPanel diff --git a/src/components/features_panel/features_panel.vue b/src/components/features_panel/features_panel.vue new file mode 100644 index 00000000..445143e9 --- /dev/null +++ b/src/components/features_panel/features_panel.vue @@ -0,0 +1,29 @@ + + + + + + {{$t('features_panel.title')}} + + + + + {{$t('features_panel.chat')}} + {{$t('features_panel.gopher')}} + {{$t('features_panel.who_to_follow')}} + {{$t('features_panel.media_proxy')}} + {{$t('features_panel.scope_options')}} + {{$t('features_panel.text_limit')}} = {{textlimit}} + + + + + + + + + diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 42e7e9d4..f1dcfa46 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -419,6 +419,15 @@ const en = { who_to_follow: { who_to_follow: 'Who to follow', more: 'More' + }, + features_panel: { + title: 'Features', + chat: 'Chat', + gopher: 'Gopher', + who_to_follow: 'Who to follow', + media_proxy: 'Media proxy', + scope_options: 'Scope options', + text_limit: 'Text limit' } } @@ -943,6 +952,15 @@ const ja = { who_to_follow: { who_to_follow: 'おすすめユーザー', more: 'くわしく' + }, + features_panel: { + title: 'ゆうこうなきのう', + chat: 'チャット', + gopher: 'Gopher', + who_to_follow: 'おすすめユーザー', + media_proxy: 'メディアプロクシ', + scope_options: 'こうかいはんい', + text_limit: 'もじのかず' } } diff --git a/src/main.js b/src/main.js index debd8703..58f520db 100644 --- a/src/main.js +++ b/src/main.js @@ -222,7 +222,12 @@ window.fetch('/instance/panel.html') window.fetch('/nodeinfo/2.0.json') .then((res) => res.json()) .then((data) => { - const suggestions = data.metadata.suggestions + const metadata = data.metadata + store.dispatch('setOption', { name: 'mediaProxyAvailable', value: data.metadata.mediaProxy }) + store.dispatch('setOption', { name: 'chatAvailable', value: data.metadata.chat }) + store.dispatch('setOption', { name: 'gopherAvailable', value: data.metadata.gopher }) + + const suggestions = metadata.suggestions store.dispatch('setOption', { name: 'suggestionsEnabled', value: suggestions.enabled }) store.dispatch('setOption', { name: 'suggestionsWeb', value: suggestions.web }) })