Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
admin-fe
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eugenij
admin-fe
Commits
39abd05b
Commit
39abd05b
authored
Dec 29, 2019
by
Angelina Filippova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix parsing and wrapping mime_types setting
parent
00dce737
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
13 deletions
+26
-13
src/store/modules/normalizers.js
src/store/modules/normalizers.js
+2
-1
src/views/settings/components/Inputs.vue
src/views/settings/components/Inputs.vue
+16
-3
src/views/settings/components/Other.vue
src/views/settings/components/Other.vue
+2
-2
src/views/settings/index.vue
src/views/settings/index.vue
+6
-7
No files found.
src/store/modules/normalizers.js
View file @
39abd05b
...
...
@@ -13,6 +13,8 @@ const getValueWithoutKey = (key, [type, value]) => {
updatedArray
[
index
]
=
{
'
tuple
'
:
[
'
ExSyslogger
'
,
'
:ex_syslogger
'
]
}
}
return
updatedArray
}
else
if
(
key
===
'
:types
'
)
{
return
Object
.
keys
(
value
).
reduce
((
acc
,
key
)
=>
{
return
{
...
acc
,
[
key
]:
value
[
key
][
1
]
}
},
{})
}
return
value
}
...
...
@@ -116,7 +118,6 @@ const parseProxyUrl = value => {
export
const
partialUpdate
=
(
group
,
key
)
=>
{
if
((
group
===
'
:pleroma
'
&&
key
===
'
Oban
'
)
||
(
group
===
'
:mime
'
&&
key
===
'
:types
'
)
||
(
group
===
'
:auto_linker
'
&&
key
===
'
:opts
'
))
{
return
false
}
...
...
src/views/settings/components/Inputs.vue
View file @
39abd05b
...
...
@@ -140,7 +140,7 @@ export default {
}
},
inputValue
()
{
if
([
'
:esshd
'
,
'
:cors_plug
'
,
'
:quack
'
,
'
:http_signatures
'
].
includes
(
this
.
settingGroup
.
group
)
&&
if
([
'
:esshd
'
,
'
:cors_plug
'
,
'
:quack
'
,
'
:http_signatures
'
,
'
:tesla
'
].
includes
(
this
.
settingGroup
.
group
)
&&
this
.
data
[
this
.
setting
.
key
])
{
return
this
.
setting
.
type
===
'
atom
'
&&
this
.
data
[
this
.
setting
.
key
].
value
[
0
]
===
'
:
'
?
this
.
data
[
this
.
setting
.
key
].
value
.
substr
(
1
)
...
...
@@ -149,6 +149,8 @@ export default {
this
.
setting
.
key
===
'
Pleroma.Web.Auth.Authenticator
'
||
this
.
setting
.
key
===
'
:admin_token
'
)
{
return
this
.
data
.
value
}
else
if
(
this
.
settingGroup
.
group
===
'
:mime
'
&&
this
.
settingParent
.
key
===
'
:types
'
)
{
return
this
.
data
.
value
[
this
.
setting
.
key
]
}
else
if
(
this
.
setting
.
type
===
'
atom
'
)
{
return
this
.
data
[
this
.
setting
.
key
]
&&
this
.
data
[
this
.
setting
.
key
][
0
]
===
'
:
'
?
this
.
data
[
this
.
setting
.
key
].
substr
(
1
)
:
this
.
data
[
this
.
setting
.
key
]
}
else
{
...
...
@@ -177,12 +179,23 @@ export default {
},
processNestedData
(
value
,
group
,
key
,
parentInput
,
parentType
,
childInput
,
childType
)
{
const
valueExists
=
value
=>
value
[
group
]
&&
value
[
group
][
key
]
&&
value
[
group
][
key
][
parentInput
]
cons
t
updatedValueForState
=
valueExists
(
this
.
settings
)
le
t
updatedValueForState
=
valueExists
(
this
.
settings
)
?
{
...
this
.
settings
[
group
][
key
][
parentInput
],
...{
[
childInput
]:
value
}}
:
{
[
childInput
]:
value
}
cons
t
updatedValue
=
valueExists
(
this
.
updatedSettings
)
le
t
updatedValue
=
valueExists
(
this
.
updatedSettings
)
?
{
...
this
.
updatedSettings
[
group
][
key
][
parentInput
][
1
],
...{
[
childInput
]:
[
childType
,
value
]
}}
:
{
[
childInput
]:
[
childType
,
value
]
}
if
(
group
===
'
:mime
'
&&
parentInput
===
'
:types
'
)
{
updatedValueForState
=
{
...
this
.
settings
[
group
][
parentInput
].
value
,
...
updatedValueForState
}
updatedValue
=
{
...
Object
.
keys
(
this
.
settings
[
group
][
parentInput
].
value
)
.
reduce
((
acc
,
el
)
=>
{
return
{
...
acc
,
[
el
]:
[[
'
list
'
,
'
string
'
],
this
.
settings
[
group
][
parentInput
].
value
[
el
]]
}
},
{}),
...
updatedValue
}
}
this
.
$store
.
dispatch
(
'
UpdateSettings
'
,
{
group
,
key
,
input
:
parentInput
,
value
:
updatedValue
,
type
:
parentType
})
this
.
$store
.
dispatch
(
'
UpdateState
'
,
{
group
,
key
,
input
:
parentInput
,
value
:
updatedValueForState
})
},
...
...
src/views/settings/components/Other.vue
View file @
39abd05b
...
...
@@ -38,13 +38,13 @@ export default {
return
this
.
settings
.
description
.
find
(
setting
=>
setting
.
group
===
'
:mime
'
)
},
mimeTypesData
()
{
return
this
.
settings
.
settings
[
'
:mime
'
]
[
'
:types
'
]
return
this
.
settings
.
settings
[
'
:mime
'
]
},
teslaAdapter
()
{
return
this
.
settings
.
description
.
find
(
setting
=>
setting
.
group
===
'
:tesla
'
)
},
teslaAdapterData
()
{
return
this
.
settings
.
settings
[
'
:tesla
'
]
[
'
:adapter
'
]
return
this
.
settings
.
settings
[
'
:tesla
'
]
}
},
methods
:
{
...
...
src/views/settings/index.vue
View file @
39abd05b
...
...
@@ -56,21 +56,20 @@
<el-tab-pane
:label=
"$t('settings.rateLimiters')"
lazy
>
<rate-limiters/>
</el-tab-pane>
<!--
<el-tab-pane
:label=
"$t('settings.mediaProxy')"
lazy
>
<media-proxy/>
</el-tab-pane>
<el-tab-pane
:label=
"$t('settings.relays')"
lazy
>
<relays/>
</el-tab-pane>
<el-tab-pane
:label=
"$t('settings.other')"
lazy
>
<other/>
</el-tab-pane>
<!--
<el-tab-pane
:label=
"$t('settings.mediaProxy')"
lazy
>
<media-proxy/>
</el-tab-pane>
<el-tab-pane
:label=
"$t('settings.upload')"
lazy
>
<upload/>
</el-tab-pane>
<el-tab-pane
:label=
"$t('settings.webPush')"
lazy
>
<web-push/>
</el-tab-pane>
<el-tab-pane
:label=
"$t('settings.other')"
lazy
>
<other/>
</el-tab-pane>
-->
</el-tabs>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment