mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: extensible domain & system manage sidebar
This commit is contained in:
1 parent
7cee2eae4e
commit
dc13760852
6 files changed
+31
-30
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "4.2.5",
|
"version": "4.2.6",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/plugin-api",
|
"main": "src/plugin-api",
|
||||||
"module": "src/plugin-api",
|
"module": "src/plugin-api",
|
||||||
|
|||||||
@@ -695,7 +695,7 @@ export interface Lib extends Record<string, any> {
|
|||||||
problemSearch: ProblemSearch;
|
problemSearch: ProblemSearch;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type UIInjectableFields = 'ProblemAdd' | 'Nav' | 'UserDropdown';
|
export type UIInjectableFields = 'ProblemAdd' | 'Nav' | 'UserDropdown' | 'DomainManage' | 'ControlPanel';
|
||||||
export interface UI {
|
export interface UI {
|
||||||
template: Record<string, string>,
|
template: Record<string, string>,
|
||||||
nodes: Record<UIInjectableFields, any[]>,
|
nodes: Record<UIInjectableFields, any[]>,
|
||||||
|
|||||||
@@ -63,6 +63,19 @@ inject('Nav', 'ranking', { prefix: 'ranking' }, PERM.PERM_VIEW_RANKING);
|
|||||||
inject('Nav', 'domain_dashboard', { prefix: 'domain' }, PERM.PERM_EDIT_DOMAIN);
|
inject('Nav', 'domain_dashboard', { prefix: 'domain' }, PERM.PERM_EDIT_DOMAIN);
|
||||||
inject('Nav', 'manage_dashboard', { prefix: 'manage' }, PRIV.PRIV_EDIT_SYSTEM);
|
inject('Nav', 'manage_dashboard', { prefix: 'manage' }, PRIV.PRIV_EDIT_SYSTEM);
|
||||||
inject('ProblemAdd', 'problem_create', { icon: 'add', text: 'Create Problem' });
|
inject('ProblemAdd', 'problem_create', { icon: 'add', text: 'Create Problem' });
|
||||||
|
inject('ControlPanel', 'manage_dashboard');
|
||||||
|
inject('ControlPanel', 'manage_script');
|
||||||
|
inject('ControlPanel', 'manage_user_import');
|
||||||
|
inject('ControlPanel', 'manage_user_priv');
|
||||||
|
inject('ControlPanel', 'manage_setting');
|
||||||
|
inject('ControlPanel', 'manage_config');
|
||||||
|
inject('DomainManage', 'domain_dashboard', { family: 'Properties', icon: 'info' });
|
||||||
|
inject('DomainManage', 'domain_edit', { family: 'Properties', icon: 'info' });
|
||||||
|
inject('DomainManage', 'domain_join_applications', { family: 'Properties', icon: 'info' });
|
||||||
|
inject('DomainManage', 'domain_role', { family: 'Access Control', icon: 'user' });
|
||||||
|
inject('DomainManage', 'domain_user', { family: 'Access Control', icon: 'user' });
|
||||||
|
inject('DomainManage', 'domain_permission', { family: 'Access Control', icon: 'user' });
|
||||||
|
inject('DomainManage', 'domain_group', { family: 'Access Control', icon: 'user' });
|
||||||
|
|
||||||
global.Hydro.ui.inject = inject;
|
global.Hydro.ui.inject = inject;
|
||||||
global.Hydro.ui.nodes = nodes as any;
|
global.Hydro.ui.nodes = nodes as any;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.42.1",
|
"version": "4.42.2",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
|
|||||||
@@ -7,27 +7,18 @@
|
|||||||
<div class="medium-3 columns"><div data-sticky="large">
|
<div class="medium-3 columns"><div data-sticky="large">
|
||||||
<div class="section side">
|
<div class="section side">
|
||||||
<ol class="menu">
|
<ol class="menu">
|
||||||
<li class="menu__item">
|
{%- for family, items in ui.getNodes('DomainManage')|groupby('args.family') -%}
|
||||||
<div class="menu__link expandable">
|
<li class="menu__item">
|
||||||
<span class="icon icon-info"></span> {{ _('Properties') }}
|
<div class="menu__link expandable">
|
||||||
</div>
|
<span class="icon icon-{{ items[0].args.icon }}"></span> {{ _(family) }}
|
||||||
<ol class="menu collapsed">
|
</div>
|
||||||
{{ sidemenu.render_item(null, 'domain_dashboard') }}
|
<ol class="menu collapsed">
|
||||||
{{ sidemenu.render_item(null, 'domain_edit') }}
|
{%- for item in items -%}
|
||||||
{{ sidemenu.render_item(null, 'domain_join_applications') }}
|
{{ sidemenu.render_item(null, item.name) }}
|
||||||
</ol>
|
{%- endfor -%}
|
||||||
</li>
|
</ol>
|
||||||
<li class="menu__item">
|
</li>
|
||||||
<div class="menu__link expandable">
|
{% endfor %}
|
||||||
<span class="icon icon-user"></span> {{ _('Access Control') }}
|
|
||||||
</div>
|
|
||||||
<ol class="menu collapsed">
|
|
||||||
{{ sidemenu.render_item(null, 'domain_role') }}
|
|
||||||
{{ sidemenu.render_item(null, 'domain_user') }}
|
|
||||||
{{ sidemenu.render_item(null, 'domain_permission') }}
|
|
||||||
{{ sidemenu.render_item(null, 'domain_group') }}
|
|
||||||
</ol>
|
|
||||||
</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|||||||
@@ -12,12 +12,9 @@
|
|||||||
<span class="icon icon-info"></span> {{ _('Properties') }}
|
<span class="icon icon-info"></span> {{ _('Properties') }}
|
||||||
</div>
|
</div>
|
||||||
<ol class="menu collapsed">
|
<ol class="menu collapsed">
|
||||||
{{ sidemenu.render_item(null, 'manage_dashboard') }}
|
{%- for item in ui.getNodes('ControlPanel') -%}
|
||||||
{{ sidemenu.render_item(null, 'manage_script') }}
|
{{ sidemenu.render_item(item.icon, item.name) }}
|
||||||
{{ sidemenu.render_item(null, 'manage_user_import') }}
|
{%- endfor -%}
|
||||||
{{ sidemenu.render_item(null, 'manage_user_priv') }}
|
|
||||||
{{ sidemenu.render_item(null, 'manage_setting') }}
|
|
||||||
{{ sidemenu.render_item(null, 'manage_config') }}
|
|
||||||
</ol>
|
</ol>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|||||||
Reference in new issue
Block a user