mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: bug fix
This commit is contained in:
1 parent
42f41c4f61
commit
e4c2f309c4
6 files changed
+9
-26
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.39.4",
|
"version": "2.39.5",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -224,16 +224,11 @@ function set(s: Setting, key: string, value: any) {
|
|||||||
class HomeSettingsHandler extends Handler {
|
class HomeSettingsHandler extends Handler {
|
||||||
@param('category', Types.Name)
|
@param('category', Types.Name)
|
||||||
async get(domainId: string, category: string) {
|
async get(domainId: string, category: string) {
|
||||||
const path = [
|
|
||||||
['Hydro', 'homepage'],
|
|
||||||
[`home_${category}`, null],
|
|
||||||
];
|
|
||||||
this.response.template = 'home_settings.html';
|
this.response.template = 'home_settings.html';
|
||||||
this.response.body = {
|
this.response.body = {
|
||||||
category,
|
category,
|
||||||
page_name: `home_${category}`,
|
page_name: `home_${category}`,
|
||||||
current: this.user,
|
current: this.user,
|
||||||
path,
|
|
||||||
};
|
};
|
||||||
if (category === 'preference') {
|
if (category === 'preference') {
|
||||||
this.response.body.settings = setting.PREFERENCE_SETTINGS;
|
this.response.body.settings = setting.PREFERENCE_SETTINGS;
|
||||||
@@ -281,10 +276,6 @@ class UserChangemailWithCodeHandler extends Handler {
|
|||||||
|
|
||||||
class HomeDomainHandler extends Handler {
|
class HomeDomainHandler extends Handler {
|
||||||
async get() {
|
async get() {
|
||||||
const path = [
|
|
||||||
['Hydro', 'homepage'],
|
|
||||||
['home_domain', null],
|
|
||||||
];
|
|
||||||
let ddocs: DomainDoc[] = [];
|
let ddocs: DomainDoc[] = [];
|
||||||
let dudict: Record<string, DomainDoc> = {};
|
let dudict: Record<string, DomainDoc> = {};
|
||||||
if (!this.user.hasPriv(PRIV.PRIV_VIEW_ALL_DOMAIN)) {
|
if (!this.user.hasPriv(PRIV.PRIV_VIEW_ALL_DOMAIN)) {
|
||||||
@@ -310,20 +301,12 @@ class HomeDomainHandler extends Handler {
|
|||||||
|| udoc.hasPriv(PRIV.PRIV_MANAGE_ALL_DOMAIN);
|
|| udoc.hasPriv(PRIV.PRIV_MANAGE_ALL_DOMAIN);
|
||||||
}
|
}
|
||||||
this.response.template = 'home_domain.html';
|
this.response.template = 'home_domain.html';
|
||||||
this.response.body = {
|
this.response.body = { ddocs, dudict, canManage };
|
||||||
ddocs, dudict, canManage, path,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class HomeDomainCreateHandler extends Handler {
|
class HomeDomainCreateHandler extends Handler {
|
||||||
async get() {
|
async get() {
|
||||||
this.response.body = {
|
|
||||||
path: [
|
|
||||||
['Hydro', 'homepage'],
|
|
||||||
['domain_create', null],
|
|
||||||
],
|
|
||||||
};
|
|
||||||
this.response.template = 'domain_create.html';
|
this.response.template = 'domain_create.html';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ class UserModel {
|
|||||||
|
|
||||||
@ArgMethod
|
@ArgMethod
|
||||||
static async setById(uid: number, $set?: Partial<Udoc>, $unset?: Value<Partial<Udoc>, ''>) {
|
static async setById(uid: number, $set?: Partial<Udoc>, $unset?: Value<Partial<Udoc>, ''>) {
|
||||||
if (uid < 1000) return null;
|
if (uid < -999) return null;
|
||||||
const op: any = {};
|
const op: any = {};
|
||||||
if ($set && Object.keys($set).length) op.$set = $set;
|
if ($set && Object.keys($set).length) op.$set = $set;
|
||||||
if ($unset && Object.keys($unset).length) op.$unset = $unset;
|
if ($unset && Object.keys($unset).length) op.$unset = $unset;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.22.6",
|
"version": "4.22.7",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ async function initChart() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const page = new NamedPage('user_detail', () => {
|
const page = new NamedPage('user_detail', () => {
|
||||||
$('[name="profile_contact_copy"]').get().forEach((el) => {
|
$('[data-copy]').get().forEach((el) => {
|
||||||
const data = $(el).attr('data-content');
|
const data = $(el).attr('data-copy');
|
||||||
const decoded = base64.decode(data);
|
const decoded = base64.decode(data);
|
||||||
const clip = new Clipboard(el, { text: () => decoded });
|
const clip = new Clipboard(el, { text: () => decoded });
|
||||||
clip.on('success', () => {
|
clip.on('success', () => {
|
||||||
|
|||||||
@@ -41,17 +41,17 @@
|
|||||||
<span class="icon icon-comment--multiple"></span>
|
<span class="icon icon-comment--multiple"></span>
|
||||||
</a>
|
</a>
|
||||||
{% if udoc['mail'] %}
|
{% if udoc['mail'] %}
|
||||||
<a class="profile-header__contact-item" href="javascript:;" name="profile_contact_copy" data-content="{{ udoc['mail'] | base64_encode }}" data-tooltip="{{ _('Copy Email') }}">
|
<a class="profile-header__contact-item" href="javascript:;" data-copy="{{ udoc['mail'] | base64_encode }}" data-tooltip="{{ _('Copy Email') }}">
|
||||||
<span class="icon icon-mail"></span>
|
<span class="icon icon-mail"></span>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if udoc['qq'] %}
|
{% if udoc['qq'] %}
|
||||||
<a class="profile-header__contact-item" href="javascript:;" name="profile_qq_copy" data-content="{{ udoc['qq'] | base64_encode }}" data-tooltip="{{ _('Copy QQ Number') }}">
|
<a class="profile-header__contact-item" href="javascript:;" data-copy="{{ udoc['qq'] | base64_encode }}" data-tooltip="{{ _('Copy QQ Number') }}">
|
||||||
<span class="icon icon-qq"></span>
|
<span class="icon icon-qq"></span>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if udoc['wechat'] %}
|
{% if udoc['wechat'] %}
|
||||||
<a class="profile-header__contact-item" href="javascript:;" name="profile_wechat_copy" data-content="{{ udoc['wechat'] | base64_encode }}" data-tooltip="{{ _('Copy WeChat Account') }}">
|
<a class="profile-header__contact-item" href="javascript:;" data-copy="{{ udoc['wechat'] | base64_encode }}" data-tooltip="{{ _('Copy WeChat Account') }}">
|
||||||
<span class="icon icon-wechat"></span>
|
<span class="icon icon-wechat"></span>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in new issue
Block a user