Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85828990
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/components/admin_dashboard/tabs/config.vue b/src/components/admin_dashboard/tabs/config.vue
index 1fe6b1a1a0..3d55dd27cb 100644
--- a/src/components/admin_dashboard/tabs/config.vue
+++ b/src/components/admin_dashboard/tabs/config.vue
@@ -1,15 +1,15 @@
<template>
<div class="admin-dashboard-config">
<div
v-for="group in groups"
:key="group.group + group.key"
- >
+ >
<config-tree :path="[group.group, group.key]" />
</div>
</div>
</template>
<script src="./config.js"></script>
<style lang="scss">
</style>
diff --git a/src/components/admin_dashboard/tabs/config_entry.js b/src/components/admin_dashboard/tabs/config_entry.js
index 862518f7c1..bdf948d7bb 100644
--- a/src/components/admin_dashboard/tabs/config_entry.js
+++ b/src/components/admin_dashboard/tabs/config_entry.js
@@ -1,9 +1,33 @@
+import TypedInput from './typed_input.vue'
+
+const BASIC_TYPES = ['boolean', 'string', 'integer']
+
const ConfigEntry = {
props: {
configs: {},
descriptions: Object,
path: Array
+ },
+ components: {
+ TypedInput
+ },
+ computed: {
+ type () {
+ return this.descriptions.type
+ },
+ isBasicType () {
+ return BASIC_TYPES.includes(this.type)
+ },
+ suggestions () {
+ return this.descriptions.suggestions
+ }
+ },
+ methods: {
+ setConfigs (newVal) {
+ console.log('changing to', newVal)
+ this.configs = newVal
+ }
}
}
export default ConfigEntry
diff --git a/src/components/admin_dashboard/tabs/config_entry.vue b/src/components/admin_dashboard/tabs/config_entry.vue
index 207ab4b6c3..1634e1bfa4 100644
--- a/src/components/admin_dashboard/tabs/config_entry.vue
+++ b/src/components/admin_dashboard/tabs/config_entry.vue
@@ -1,10 +1,12 @@
<template>
- <div>
- Value: {{ configs }}
- </div>
+ <typed-input
+ :type="type"
+ :model-value="configs"
+ @update:modelValue="setConfigs"
+ />
</template>
<script src="./config_entry.js"></script>
<style lang="scss">
</style>
diff --git a/src/components/admin_dashboard/tabs/typed_input.js b/src/components/admin_dashboard/tabs/typed_input.js
new file mode 100644
index 0000000000..e4a5225ff6
--- /dev/null
+++ b/src/components/admin_dashboard/tabs/typed_input.js
@@ -0,0 +1,14 @@
+import Checkbox from 'src/components/checkbox/checkbox.vue'
+
+const TypedInput = {
+ props: [
+ 'modelValue',
+ 'type'
+ ],
+ emits: ['update:modelValue'],
+ components: {
+ Checkbox
+ }
+}
+
+export default TypedInput
diff --git a/src/components/admin_dashboard/tabs/typed_input.vue b/src/components/admin_dashboard/tabs/typed_input.vue
new file mode 100644
index 0000000000..2ba6cafe37
--- /dev/null
+++ b/src/components/admin_dashboard/tabs/typed_input.vue
@@ -0,0 +1,29 @@
+<template>
+ <div>
+ <input
+ v-if="type === 'integer'"
+ type="number"
+ :value="modelValue"
+ @change="$emit('update:modelValue', $event.target.value)"
+ >
+ <input
+ v-else-if="type === 'string'"
+ type="string"
+ :value="modelValue"
+ @change="$emit('update:modelValue', $event.target.value)"
+ >
+ <Checkbox
+ v-else-if="type === 'boolean'"
+ :value="modelValue"
+ @change="$emit('update:modelValue', $event.target.value)"
+ />
+ <p v-else>
+ {{ modelValue }}
+ </p>
+ </div>
+</template>
+
+<script src="./typed_input.js"></script>
+
+<style lang="scss">
+</style>
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Oct 31, 1:57 PM (12 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1801474
Default Alt Text
(3 KB)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline