diff --git a/src/components/settings_modal/admin_tabs/instance_tab.js b/src/components/settings_modal/admin_tabs/instance_tab.js
index b07bafe8f..4c4203c60 100644
--- a/src/components/settings_modal/admin_tabs/instance_tab.js
+++ b/src/components/settings_modal/admin_tabs/instance_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 AttachmentSetting from '../helpers/attachment_setting.vue'
+import MultiCheckboxSetting from '../helpers/multicheckbox_setting.vue'
import SharedComputedObject from '../helpers/shared_computed_object.js'
import { library } from '@fortawesome/fontawesome-svg-core'
@@ -28,6 +29,7 @@ const InstanceTab = {
IntegerSetting,
StringSetting,
AttachmentSetting,
+ MultiCheckboxSetting,
GroupSetting
},
computed: {
diff --git a/src/components/settings_modal/admin_tabs/instance_tab.vue b/src/components/settings_modal/admin_tabs/instance_tab.vue
index fe96329bb..d8d5ae889 100644
--- a/src/components/settings_modal/admin_tabs/instance_tab.vue
+++ b/src/components/settings_modal/admin_tabs/instance_tab.vue
@@ -131,6 +131,19 @@
+
{{ $t('admin_dash.instance.rich_metadata') }}
+
diff --git a/src/components/settings_modal/admin_tabs/links_tab.js b/src/components/settings_modal/admin_tabs/links_tab.js
index 3771a4f37..9bd58344c 100644
--- a/src/components/settings_modal/admin_tabs/links_tab.js
+++ b/src/components/settings_modal/admin_tabs/links_tab.js
@@ -4,8 +4,11 @@ import IntegerSetting from '../helpers/integer_setting.vue'
import StringSetting from '../helpers/string_setting.vue'
import GroupSetting from '../helpers/group_setting.vue'
import AttachmentSetting from '../helpers/attachment_setting.vue'
+import ListSetting from '../helpers/list_setting.vue'
+import MultiCheckboxSetting from '../helpers/multicheckbox_setting.vue'
import SharedComputedObject from '../helpers/shared_computed_object.js'
+import { get } from 'lodash'
const MediaProxyTab = {
provide () {
@@ -20,9 +23,25 @@ const MediaProxyTab = {
IntegerSetting,
StringSetting,
AttachmentSetting,
- GroupSetting
+ GroupSetting,
+ ListSetting,
+ MultiCheckboxSetting
},
computed: {
+ ttlSettersOptions () {
+ const desc = get(this.$store.state.adminSettings.descriptions, ':pleroma.:rich_media.:ttl_setters')
+ return new Set([...desc.suggestions, 'Pleroma.Web.RichMedia.Parser.TTL.Opengraph'].map(option => ({
+ label: option.replace('Pleroma.Web.RichMedia.Parser.TTL.', ''),
+ value: option
+ })))
+ },
+ parsersOptions () {
+ const desc = get(this.$store.state.adminSettings.descriptions, ':pleroma.:rich_media.:parsers')
+ return new Set(desc.suggestions.map(option => ({
+ label: option.replace('Pleroma.Web.RichMedia.Parsers.', ''),
+ value: option
+ })))
+ },
mediaProxyEnabled () {
return this.$store.state.adminSettings.draft[':pleroma'][':media_proxy'][':enabled']
},
diff --git a/src/components/settings_modal/admin_tabs/links_tab.vue b/src/components/settings_modal/admin_tabs/links_tab.vue
index 0bd2dadf6..11559c61d 100644
--- a/src/components/settings_modal/admin_tabs/links_tab.vue
+++ b/src/components/settings_modal/admin_tabs/links_tab.vue
@@ -1,115 +1,37 @@
-
{{ $t('admin_dash.media_proxy.basic') }}
+
{{ $t('admin_dash.links.link_previews') }}
-
-
-
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
-
- {{ $t('admin_dash.media_proxy.invalidation') }}
-
- -
-
-
- -
-
-
- {{ $t('admin_dash.media_proxy.invalidation_settings') }}
-
-
-
- -
-
-
-
-
-
-
-
- -
-
-
- -
-
-
-
-
-
-
-
- {{ $t('admin_dash.media_proxy.limits') }}
-
-
- {{ $t('admin_dash.media_proxy.thumbnails') }}
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
-
-
-
+
diff --git a/src/components/settings_modal/helpers/group_setting.js b/src/components/settings_modal/helpers/group_setting.js
index 23a2a2025..327654ff1 100644
--- a/src/components/settings_modal/helpers/group_setting.js
+++ b/src/components/settings_modal/helpers/group_setting.js
@@ -1,13 +1,5 @@
-import { isEqual } from 'lodash'
-
import Setting from './setting.js'
export default {
...Setting,
- computed: {
- ...Setting.computed,
- isDirty () {
- return !isEqual(this.state, this.draft)
- }
- }
}
diff --git a/src/components/settings_modal/helpers/list_setting.js b/src/components/settings_modal/helpers/list_setting.js
index 0ded0c36f..f744e925b 100644
--- a/src/components/settings_modal/helpers/list_setting.js
+++ b/src/components/settings_modal/helpers/list_setting.js
@@ -2,6 +2,11 @@ import Setting from './setting.js'
export default {
...Setting,
+ data () {
+ return {
+ newValue: ''
+ }
+ },
components: {
...Setting.components
},
@@ -13,9 +18,25 @@ export default {
},
methods: {
...Setting.methods,
- updateValue (e) {
- console.log(e.target.value)
- //this.configSink(this.path, parseFloat(e.target.value) + this.stateUnit)
+ addNew () {
+ this.update({ newValue: this.newValue })
+ },
+ getValue ({ event, index, newValue, remove }) {
+ if (newValue) {
+ this.newValue = ''
+ return [...this.visibleState, newValue]
+ } else if (remove) {
+ const pre = this.visibleState.slice(0, index)
+ const post = this.visibleState.slice(index + 1)
+
+ return [...pre, ...post]
+ } else {
+ const pre = this.visibleState.slice(0, index)
+ const post = this.visibleState.slice(index + 1)
+ const string = event?.target?.value
+
+ return [...pre, string, ...post]
+ }
}
}
}
diff --git a/src/components/settings_modal/helpers/list_setting.vue b/src/components/settings_modal/helpers/list_setting.vue
index 1a86e2aae..ef3315a14 100644
--- a/src/components/settings_modal/helpers/list_setting.vue
+++ b/src/components/settings_modal/helpers/list_setting.vue
@@ -1,10 +1,9 @@
-
- {{ ' ' }}
-
- {{ value }}
-
- {{ ' ' }}
-
-
-
{{ backendDescriptionDescription + ' ' }}
-
+
+
+
+
+
-
+
+
diff --git a/src/components/settings_modal/helpers/multicheckbox_setting.js b/src/components/settings_modal/helpers/multicheckbox_setting.js
new file mode 100644
index 000000000..3d64a8a56
--- /dev/null
+++ b/src/components/settings_modal/helpers/multicheckbox_setting.js
@@ -0,0 +1,47 @@
+import Checkbox from 'src/components/checkbox/checkbox.vue'
+import Setting from './setting.js'
+
+export default {
+ ...Setting,
+ props: {
+ ...Setting.props,
+ overrideAvailableOptions: {
+ required: false,
+ type: Set
+ }
+ },
+ components: {
+ ...Setting.components,
+ Checkbox
+ },
+ computed: {
+ ...Setting.computed,
+ availableOptions () {
+ if (this.overrideAvailableOptions) {
+ return new Set(this.overrideAvailableOptions)
+ }
+ return new Set(this.backendDescription?.suggestions.map((option) => ({
+ label: option,
+ value: option
+ })))
+ },
+ valueSet () {
+ return new Set(this.visibleState)
+ }
+ },
+ methods: {
+ ...Setting.methods,
+ optionPresent (option) {
+ return this.valueSet.has(option)
+ },
+ getValue ({ event, option }) {
+ const set = new Set(this.visibleState)
+ if (event) {
+ set.add(option)
+ } else {
+ set.delete(option)
+ }
+ return [...set]
+ }
+ }
+}
diff --git a/src/components/settings_modal/helpers/multicheckbox_setting.vue b/src/components/settings_modal/helpers/multicheckbox_setting.vue
new file mode 100644
index 000000000..083f568c1
--- /dev/null
+++ b/src/components/settings_modal/helpers/multicheckbox_setting.vue
@@ -0,0 +1,48 @@
+
+
+
+
+ {{ backendDescriptionLabel + ' ' }}
+
+
+ MISSING LABEL FOR {{ path }}
+
+
+
+
+ {{ backendDescriptionDescription + ' ' }}
+
+
+ -
+ update({event: e, option: option.value})"
+ >
+ {{ option.label }}
+
+
+
+
+
+
+
+
diff --git a/src/components/settings_modal/helpers/setting.js b/src/components/settings_modal/helpers/setting.js
index d4a0dff56..4e1e12e13 100644
--- a/src/components/settings_modal/helpers/setting.js
+++ b/src/components/settings_modal/helpers/setting.js
@@ -1,7 +1,7 @@
import ModifiedIndicator from './modified_indicator.vue'
import ProfileSettingIndicator from './profile_setting_indicator.vue'
import DraftButtons from './draft_buttons.vue'
-import { get, set, cloneDeep } from 'lodash'
+import { get, set, cloneDeep, isEqual } from 'lodash'
export default {
components: {
@@ -237,7 +237,7 @@ export default {
if (this.realSource === 'admin' && this.canonPath.length > 3) {
return false // should not show draft buttons for "grouped" values
} else {
- return this.realDraftMode && this.draft !== this.state
+ return this.realDraftMode && !isEqual(this.draft, this.state)
}
},
canHardReset () {
diff --git a/src/components/settings_modal/settings_modal_admin_content.js b/src/components/settings_modal/settings_modal_admin_content.js
index 50db2bb3b..4d89aefad 100644
--- a/src/components/settings_modal/settings_modal_admin_content.js
+++ b/src/components/settings_modal/settings_modal_admin_content.js
@@ -1,6 +1,7 @@
import VerticalTabSwitcher from './helpers/vertical_tab_switcher.jsx'
import InstanceTab from './admin_tabs/instance_tab.vue'
+import LinksTab from './admin_tabs/links_tab.vue'
import LimitsTab from './admin_tabs/limits_tab.vue'
import FrontendsTab from './admin_tabs/frontends_tab.vue'
import MediaProxyTab from './admin_tabs/media_proxy_tab.vue'
@@ -15,6 +16,7 @@ import { library } from '@fortawesome/fontawesome-svg-core'
import {
faWrench,
faHand,
+ faChain,
faLaptopCode,
faTowerBroadcast,
faEnvelope,
@@ -26,6 +28,7 @@ import {
library.add(
faWrench,
faHand,
+ faChain,
faLaptopCode,
faTowerBroadcast,
faEnvelope,
@@ -45,6 +48,7 @@ const SettingsModalAdminContent = {
MailerTab,
EmojiTab,
UploadsTab,
+ LinksTab,
MonitoringTab,
RegistrationsTab
},
diff --git a/src/components/settings_modal/settings_modal_admin_content.vue b/src/components/settings_modal/settings_modal_admin_content.vue
index bc2438b8b..572cc3a2c 100644
--- a/src/components/settings_modal/settings_modal_admin_content.vue
+++ b/src/components/settings_modal/settings_modal_admin_content.vue
@@ -106,6 +106,14 @@
+
+
+
+