ui: 优化系统设置页面

pull/140/head
undefined 3 years ago
parent 29c8fded62
commit 03cddc00b2

@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.25.1",
"version": "2.25.2",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",

@ -3,14 +3,17 @@ langs:
desc: Code language settings
default:
__hint__:
- All keys started with _ will be ignored
- Entries named like [foo], [foo].[bar] [foo].[baz] will be merged into one category.
- A entry named [foo].[bar] will inhert all options defined in entry [foo] if not overwritten
- code_file option defaults to foo.[name]
- highlight option defaults to [name]
- if highlight option was set, monaco option defaults to [highlight], otherwise defaults to [name]
- Compile step will be ignored if compile option was not set
- Key marked with a ? means the option is optional
- ~ All keys starting with _ will be ignored
- ~ Entries named like [foo], [foo].[bar] [foo].[baz]
- will be merged into one category.
- ~ A entry named [foo].[bar] will inhert all options
- defined in entry [foo] if not overwritten
- ~ code_file option defaults to foo.[name]
- ~ highlight option defaults to [name]
- ~ if highlight option was set, monaco option defaults
- to [highlight], otherwise defaults to [name]
- ~ Compiling be be ignored if compile option wasn't set
- ~ Key marked with a ? means the option is optional
- (name):
compile?: Compile Command
code_file?: Where to write code file when compiling

@ -3,10 +3,12 @@ import delay from 'vj/utils/delay';
import CmEditor from '.';
function runSubstitute($container) {
const selector = ['textarea[data-markdown]'];
$container.find(selector.join(', ')).get().forEach((element) => {
$container.find('textarea[data-markdown]').get().forEach((element) => {
CmEditor.getOrConstruct($(element));
});
$container.find('textarea[data-yaml]').get().forEach((element) => {
CmEditor.getOrConstruct($(element), { language: 'yaml' });
});
}
const cmEditorPage = new AutoloadPage('cmEditorPage', () => {

@ -58,10 +58,16 @@ export default class Editor extends DOMAttachedObject {
lightbulb: { enabled: true },
model: this.model,
automaticLayout: true,
wordWarp: 'bounded',
minimap: { enabled: false },
hideCursorInOverviewRuler: true,
overviewRulerLanes: 0,
overviewRulerBorder: false,
};
if (autoResize) {
cfg.scrollbar = {
vertical: 'hidden',
horizontal: 'hidden',
handleMouseWheel: false,
};
cfg.scrollBeyondLastLine = false;

@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.8.2",
"version": "4.8.3",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "hydro.js",

@ -183,7 +183,7 @@
{% endmacro %}
{% macro form_textarea(args) %}
{{ form_begin({columns:8}|assign(args)) }}
{{ form_begin({columns:10}|assign(args)) }}
{{ textarea(args) }}
{{ form_end(args) }}
{% endmacro %}

@ -52,7 +52,8 @@
name:setting.key,
value:'' if secret else (current[setting.key]|default(setting.value)),
disabled:setting.disabled,
placeholder:_('(Not changed)') if secret else ''
placeholder:_('(Not changed)') if secret else '',
extra_attr: 'data-yaml' if setting.subType == 'yaml' else ''
}) }}
{% elif setting.type == 'markdown' %}
{{ form.form_textarea({

Loading…
Cancel
Save