修复一些错误

This commit is contained in:
masnn committed 2020-05-19 12:46:00 +08:00
1 parent 747cb1b9b5
commit b19f948fdd
30 files changed
+306 -132

No files matched your search

+41 -7
View File
@@ -20,15 +20,25 @@ class ManageMainHandler extends ManageHandler {
class ManageDashboardHandler extends ManageHandler {
async get() {
const path = [
['Hydro', '/'],
['manage', '/manage'],
['manage_dashboard', null],
];
this.response.template = 'manage_dashboard.html';
this.response.body = { system: this.system };
this.response.body = { system: this.system, path };
}
}
class ManageEditHandler extends ManageHandler {
async get() {
const path = [
['Hydro', '/'],
['manage', '/manage'],
['manage_edit', null],
];
this.response.template = 'manage_edit.html';
this.response.body = { system: this.system };
this.response.body = { system: this.system, path };
}
async post({ uname, gravatar, bio }) {
@@ -56,9 +66,14 @@ class ManageUserHandler extends ManageHandler {
}
const rolesSelect = roles.map((role) => [role._id, role._id]);
const udict = await user.getList(uids);
const path = [
['Hydro', '/'],
['manage', '/manage'],
['manage_user', null],
];
this.response.template = 'manage_user.html';
this.response.body = {
roles, rolesSelect, rudocs, udict, system,
roles, rolesSelect, rudocs, udict, system, path,
};
}
@@ -74,8 +89,13 @@ class ManagePermissionHandler extends ManageHandler {
user.getRoles(),
user.getById(0),
]);
const path = [
['Hydro', '/'],
['manage', '/manage'],
['manage_permission', null],
];
this.response.template = 'manage_permission.html';
this.response.body = { roles, system };
this.response.body = { roles, system, path };
}
async post({ roles }) {
@@ -97,8 +117,13 @@ class ManageRoleHandler extends ManageHandler {
user.getRoles(),
user.getById(0),
]);
const path = [
['Hydro', '/'],
['manage', '/manage'],
['manage_role', null],
];
this.response.template = 'manage_role.html';
this.response.body = { roles, system };
this.response.body = { roles, system, path };
}
async postAdd({ role }) {
@@ -125,11 +150,20 @@ class ManageRoleHandler extends ManageHandler {
class ManageModuleHandler extends ManageHandler {
async get() {
const installed = await hpm.getInstalled();
const active = loader.active.map((module) => module.id);
this.response.body = { installed, active };
const path = [
['Hydro', '/'],
['manage', '/manage'],
['manage_module', null],
];
this.response.body = { installed, active: loader.active, path };
this.response.template = 'manage_module.html';
}
async postInstall({ url, id }) {
await hpm.install(url, id);
this.back();
}
async postDelete({ id }) {
await hpm.del(id);
this.back();