mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: use langConfig.hidden for remote problems
This commit is contained in:
1 parent
73b1a04bd0
commit
d60f31c427
10 files changed
+28
-27
No files matched your search
@@ -10,8 +10,8 @@ export interface LangConfig {
|
||||
domain: string[];
|
||||
display: string;
|
||||
target?: string;
|
||||
sub?: LangConfig[];
|
||||
key: string;
|
||||
hidden: boolean;
|
||||
}
|
||||
|
||||
export function parseLang(config: string): Record<string, LangConfig> {
|
||||
@@ -23,13 +23,8 @@ export function parseLang(config: string): Record<string, LangConfig> {
|
||||
if (key.includes('.')) {
|
||||
const base = key.split('.')[0];
|
||||
const baseCfg = file[base];
|
||||
if (baseCfg) {
|
||||
for (const bkey in baseCfg) {
|
||||
if (bkey === 'sub') continue;
|
||||
if (!(bkey in entry)) entry[bkey] = baseCfg[bkey];
|
||||
}
|
||||
if (baseCfg.sub) baseCfg.sub.push(entry);
|
||||
else baseCfg.sub = [entry];
|
||||
for (const bkey in baseCfg || {}) {
|
||||
if (!(bkey in entry)) entry[bkey] = baseCfg[bkey];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,6 +36,7 @@ export function parseLang(config: string): Record<string, LangConfig> {
|
||||
entry.code_file = entry.code_file || `foo.${key}`;
|
||||
entry.execute = entry.execute || '/w/foo';
|
||||
entry.key = key;
|
||||
entry.hidden = entry.hidden || false;
|
||||
}
|
||||
return file;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/utils",
|
||||
"version": "1.1.14",
|
||||
"version": "1.1.15",
|
||||
"description": "hydrooj utils",
|
||||
"main": "package.json",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
@@ -8,11 +8,11 @@
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"preferUnplugged": true,
|
||||
"dependencies": {
|
||||
"fs-extra": "^10.0.0",
|
||||
"fs-extra": "^10.0.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"moment": "^2.29.1",
|
||||
"mongodb": "^3.7.3",
|
||||
"systeminformation": "^5.11.3"
|
||||
"systeminformation": "^5.11.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "^9.0.13",
|
||||
|
||||
Reference in new issue
Block a user