apply fixes

This commit is contained in:
FloatingGhost 2022-06-14 19:05:19 +01:00
parent 4406dce589
commit 9baa356f56
3 changed files with 14 additions and 9 deletions

View file

@ -29,13 +29,13 @@
], ],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/PanJiaChen/vue-element-admin.git" "url": "git+https://akkoma.dev/AkkomaGang/admin-fe.git"
}, },
"resolutions": { "resolutions": {
"prosemirror-model": "1.9.1" "prosemirror-model": "1.9.1"
}, },
"bugs": { "bugs": {
"url": "https://github.com/PanJiaChen/vue-element-admin/issues" "url": "https://akkoma.dev/AkkomaGang/admin-fe/-/issues"
}, },
"dependencies": { "dependencies": {
"@babel/runtime": "^7.3.4", "@babel/runtime": "^7.3.4",

View file

@ -28,7 +28,7 @@ const getCurrentValue = (type, value, path) => {
} }
const getValueWithoutKey = (key, [type, value]) => { const getValueWithoutKey = (key, [type, value]) => {
if (prependWithСolon(type, value)) { if (prependWithColon(type, value)) {
return `:${value}` return `:${value}`
} else if (key === ':backends') { } else if (key === ':backends') {
const index = value.findIndex(el => el === ':ex_syslogger') const index = value.findIndex(el => el === ':ex_syslogger')
@ -113,8 +113,8 @@ export const parseTuples = (tuples, key) => {
accum[item.tuple[0]] = parseNonTuples(item.tuple[0], item.tuple[1]) accum[item.tuple[0]] = parseNonTuples(item.tuple[0], item.tuple[1])
} else if (item.tuple[0] === ':ip_whitelist') { } else if (item.tuple[0] === ':ip_whitelist') {
accum[item.tuple[0]] = item.tuple[1].map(ip => typeof ip === 'string' ? ip : ip.tuple.join('.')) accum[item.tuple[0]] = item.tuple[1].map(ip => typeof ip === 'string' ? ip : ip.tuple.join('.'))
} else if (Array.isArray(item.tuple[1]) && } else if (Array.isArray(item.tuple[1]) && (item.tuple[1][0] !== null &&
(typeof item.tuple[1][0] === 'object' && !Array.isArray(item.tuple[1][0])) && item.tuple[1][0]['tuple']) { typeof item.tuple[1][0] === 'object' && !Array.isArray(item.tuple[1][0])) && item.tuple[1][0]['tuple']) {
accum[item.tuple[0]] = parseTuples(item.tuple[1], item.tuple[0]) accum[item.tuple[0]] = parseTuples(item.tuple[1], item.tuple[0])
} else if (Array.isArray(item.tuple[1])) { } else if (Array.isArray(item.tuple[1])) {
accum[item.tuple[0]] = item.tuple[1] accum[item.tuple[0]] = item.tuple[1]
@ -167,7 +167,7 @@ const parseStringOrTupleValue = (key, value) => {
} }
} }
const prependWithСolon = (type, value) => { const prependWithColon = (type, value) => {
return (type === 'atom' && value.length > 0) || return (type === 'atom' && value.length > 0) ||
(Array.isArray(type) && type.includes('boolean') && type.includes('atom') && typeof value === 'string') (Array.isArray(type) && type.includes('boolean') && type.includes('atom') && typeof value === 'string')
} }
@ -256,7 +256,7 @@ const wrapValues = (settings, currentState) => {
)) ))
) { ) {
return { 'tuple': [setting, wrapValues(value, currentState)] } return { 'tuple': [setting, wrapValues(value, currentState)] }
} else if (prependWithСolon(type, value)) { } else if (prependWithColon(type, value)) {
return { 'tuple': [setting, `:${value}`] } return { 'tuple': [setting, `:${value}`] }
} else if (type.includes('tuple') && } else if (type.includes('tuple') &&
(type.includes('string') || type.includes('atom') || type.includes('boolean'))) { (type.includes('string') || type.includes('atom') || type.includes('boolean'))) {

View file

@ -55,7 +55,12 @@ export default {
}, },
async handleOpen($event) { async handleOpen($event) {
if ($event === '/settings') { if ($event === '/settings') {
if (!localStorage.getItem('settingsTabs')) { let settingsTabs = localStorage.getItem('settingsTabs')
if (settingsTabs === '[]') {
localStorage.removeItem('settingsTabs')
settingsTabs = null
}
if (!settingsTabs) {
await this.$store.dispatch('FetchSettings') await this.$store.dispatch('FetchSettings')
const menuItems = this.tabs const menuItems = this.tabs
localStorage.setItem('settingsTabs', JSON.stringify(menuItems)) localStorage.setItem('settingsTabs', JSON.stringify(menuItems))