mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
update readme
This commit is contained in:
1 parent
a8bd6f4e16
commit
c989d1291d
5 files changed
+15
-11
No files matched your search
@@ -3,7 +3,6 @@ import { generateRegistrationOptions, verifyRegistrationResponse } from '@simple
|
||||
import yaml from 'js-yaml';
|
||||
import { pick } from 'lodash';
|
||||
import { Binary, ObjectID } from 'mongodb';
|
||||
import { camelCase } from '@hydrooj/utils/lib/utils';
|
||||
import { Context } from '../context';
|
||||
import {
|
||||
AuthOperationError, BlacklistedError, DomainAlreadyExistsError, InvalidTokenError,
|
||||
@@ -33,7 +32,7 @@ import * as bus from '../service/bus';
|
||||
import {
|
||||
ConnectionHandler, Handler, param, query, requireSudo, Types,
|
||||
} from '../service/server';
|
||||
import { md5 } from '../utils';
|
||||
import { camelCase, md5 } from '../utils';
|
||||
|
||||
export class HomeHandler extends Handler {
|
||||
uids = new Set<number>();
|
||||
@@ -175,7 +174,7 @@ class HomeSecurityHandler extends Handler {
|
||||
'authenticatorAttachment', 'regat', 'fmt',
|
||||
])),
|
||||
geoipProvider: geoip?.provider,
|
||||
icon: useragent.icon,
|
||||
icon: (str = '') => str.split(' ')[0].toLowerCase(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -734,7 +734,6 @@ export interface Lib extends Record<string, any> {
|
||||
rank: typeof import('./lib/rank');
|
||||
rating: typeof import('./lib/rating');
|
||||
testdataConfig: typeof import('./lib/testdataConfig');
|
||||
useragent: typeof import('./lib/useragent');
|
||||
validator: typeof import('./lib/validator');
|
||||
template?: any;
|
||||
problemSearch: ProblemSearch;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import './i18n';
|
||||
import './mail';
|
||||
import './useragent';
|
||||
import './paginate';
|
||||
import './hash.hydro';
|
||||
import './rank';
|
||||
|
||||
@@ -3,9 +3,3 @@ import * as browser from 'detect-browser';
|
||||
export function parse(str: string) {
|
||||
return browser.parseUserAgent(str);
|
||||
}
|
||||
|
||||
export function icon(str: string = '') {
|
||||
return str.split(' ')[0].toLowerCase();
|
||||
}
|
||||
|
||||
global.Hydro.lib.useragent = { parse, icon };
|
||||
Reference in new issue
Block a user