Merge branch 'master' into liaocl

This commit is contained in:
advplyr 2024-02-17 12:56:05 -06:00
commit 2ec52a7a45
119 changed files with 11524 additions and 25894 deletions

View file

@ -17,6 +17,7 @@ const languageCodeMap = {
'nl': { label: 'Nederlands', dateFnsLocale: 'nl' },
'no': { label: 'Norsk', dateFnsLocale: 'no' },
'pl': { label: 'Polski', dateFnsLocale: 'pl' },
'pt-br': { label: 'Português (Brasil)', dateFnsLocale: 'ptBR' },
'ru': { label: 'Русский', dateFnsLocale: 'ru' },
'sv': { label: 'Svenska', dateFnsLocale: 'sv' },
'zh-cn': { label: '简体中文 (Simplified Chinese)', dateFnsLocale: 'zhCN' },
@ -93,7 +94,7 @@ async function loadi18n(code) {
Vue.prototype.$setDateFnsLocale(languageCodeMap[code].dateFnsLocale)
this.$eventBus.$emit('change-lang', code)
this?.$eventBus?.$emit('change-lang', code)
return true
}

View file

@ -156,14 +156,14 @@ Vue.prototype.$copyToClipboard = (str, ctx) => {
}
function xmlToJson(xml) {
const json = {};
const json = {}
for (const res of xml.matchAll(/(?:<(\w*)(?:\s[^>]*)*>)((?:(?!<\1).)*)(?:<\/\1>)|<(\w*)(?:\s*)*\/>/gm)) {
const key = res[1] || res[3];
const value = res[2] && xmlToJson(res[2]);
json[key] = ((value && Object.keys(value).length) ? value : res[2]) || null;
const key = res[1] || res[3]
const value = res[2] && xmlToJson(res[2])
json[key] = ((value && Object.keys(value).length) ? value : res[2]) || null
}
return json;
return json
}
Vue.prototype.$xmlToJson = xmlToJson