mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: 支持限制题目的提交语言
This commit is contained in:
1 parent
f33d440b68
commit
75429bb43b
10 files changed
+44
-25
No files matched your search
@@ -78,6 +78,11 @@ export default connect(mapStateToProps, mapDispatchToProps)(class ScratchpadTool
|
||||
}
|
||||
|
||||
render() {
|
||||
const LANGS = {};
|
||||
for (const key in window.LANGS) {
|
||||
if (UiContext.pdoc.config.langs && !UiContext.pdoc.config.langs.includes(key)) continue;
|
||||
LANGS[key] = window.LANGS[key];
|
||||
}
|
||||
return (
|
||||
<Toolbar>
|
||||
<ToolbarButton
|
||||
@@ -136,7 +141,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class ScratchpadTool
|
||||
value={this.props.editorLang}
|
||||
onChange={(ev) => this.props.setEditorLanguage(ev.target.value)}
|
||||
>
|
||||
{_.map(window.LANGS, (val, key) => (
|
||||
{_.map(LANGS, (val, key) => (
|
||||
<option value={key} key={key}>{val.display}</option>
|
||||
))}
|
||||
</select>
|
||||
|
||||
Reference in new issue
Block a user