mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
Merge branch 'master' into events
This commit is contained in:
57 files changed
+381
-229
No files matched your search
@@ -7,10 +7,10 @@ const highlighterPage = new AutoloadPage('highlighterPage', () => {
|
||||
function runHighlight($container) {
|
||||
$container.find('pre code').get().forEach((code) => {
|
||||
const language = ($(code).attr('class') || '').trim();
|
||||
if (language.includes('line-numbers')) $(code).parent().addClass('line-numbers');
|
||||
const m = language.match(/language-([a-z0-9]+)(\|[\d,-]+)/);
|
||||
if (m?.[2]) {
|
||||
$(code).parent().attr('data-line', m[2].substring(1));
|
||||
if (language.includes('line-numbers')) $(code).parent().addClass('line-numbers');
|
||||
$(code).attr('class', `language-${m[1]}`);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -64,10 +64,7 @@ let scratchpad: ScratchpadService;
|
||||
|
||||
export default function ScratchpadContainer() {
|
||||
const store = useStore();
|
||||
if (!scratchpad) {
|
||||
scratchpad = new ScratchpadService(store);
|
||||
ctx.provide('scratchpad', scratchpad);
|
||||
}
|
||||
scratchpad ||= new ScratchpadService(store);
|
||||
const [, updateState] = React.useState<any>();
|
||||
const forceUpdate = React.useCallback(() => updateState({}), []);
|
||||
React.useEffect(() => {
|
||||
|
||||
@@ -76,7 +76,7 @@ class MarkdownHandler extends Handler {
|
||||
|
||||
class SystemConfigSchemaHandler extends Handler {
|
||||
async get() {
|
||||
const schema = convert(Schema.intersect(this.ctx.config.settings) as any, true);
|
||||
const schema = convert(Schema.intersect(this.ctx.setting.settings) as any, true);
|
||||
this.response.body = schema;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ __langname: 简体中文
|
||||
'{0} comments': '{0} 条评论'
|
||||
'{0} discussions': '{0} 条讨论'
|
||||
'{0} is a moderator of this domain.': '{}是这个域的管理者之一。'
|
||||
'{0} is a superuser.': '{0}是超级管理员。'
|
||||
'{0} limit exceeded (limit: {2} operations in {1} seconds).': '{0} 超过频率限制。限制:{1} 秒内最多 {2} 次操作。'
|
||||
'{0} problems': '{0} 道题'
|
||||
'{0} sections': '{0} 小节'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.58.0-beta.2",
|
||||
"version": "4.58.0-beta.3",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "index.ts",
|
||||
@@ -12,17 +12,17 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blueprintjs/core": "^5.19.0",
|
||||
"@fontsource/dm-mono": "^5.2.5",
|
||||
"@fontsource/dm-mono": "^5.2.6",
|
||||
"@fontsource/fira-code": "^5.2.6",
|
||||
"@fontsource/inconsolata": "^5.2.5",
|
||||
"@fontsource/jetbrains-mono": "^5.2.5",
|
||||
"@fontsource/pt-mono": "^5.2.5",
|
||||
"@fontsource/roboto-mono": "^5.2.5",
|
||||
"@fontsource/source-code-pro": "^5.2.5",
|
||||
"@fontsource/ubuntu-mono": "^5.2.5",
|
||||
"@fontsource/inconsolata": "^5.2.6",
|
||||
"@fontsource/jetbrains-mono": "^5.2.6",
|
||||
"@fontsource/pt-mono": "^5.2.6",
|
||||
"@fontsource/roboto-mono": "^5.2.6",
|
||||
"@fontsource/source-code-pro": "^5.2.6",
|
||||
"@fontsource/ubuntu-mono": "^5.2.6",
|
||||
"@hydrooj/utils": "workspace:^",
|
||||
"@sentry/browser": "^9.17.0",
|
||||
"@sentry/webpack-plugin": "^3.4.0",
|
||||
"@sentry/browser": "^9.27.0",
|
||||
"@sentry/webpack-plugin": "^3.5.0",
|
||||
"@simplewebauthn/browser": "13.1.0",
|
||||
"@svgr/webpack": "^8.1.0",
|
||||
"@types/html-to-text": "^9.0.4",
|
||||
@@ -34,8 +34,8 @@
|
||||
"@types/nunjucks": "^3.2.6",
|
||||
"@types/pickadate": "^3.5.35",
|
||||
"@types/qrcode": "^1.5.5",
|
||||
"@types/react": "^19.1.3",
|
||||
"@types/react-dom": "^19.1.3",
|
||||
"@types/react": "^18.3.23",
|
||||
"@types/react-dom": "^18.3.7",
|
||||
"@types/redux-logger": "^3.0.13",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@types/webpack-env": "^1.18.8",
|
||||
@@ -49,12 +49,12 @@
|
||||
"clean-webpack-plugin": "^4.0.0",
|
||||
"clipboard": "^2.0.11",
|
||||
"copy-webpack-plugin": "^13.0.0",
|
||||
"cordis": "4.0.0-beta.2",
|
||||
"core-js": "^3.42.0",
|
||||
"core-js-compat": "^3.42.0",
|
||||
"cordis": "4.0.0-beta.5",
|
||||
"core-js": "^3.43.0",
|
||||
"core-js-compat": "^3.43.0",
|
||||
"css-loader": "^7.1.2",
|
||||
"diff": "^7.0.0",
|
||||
"diff-dom": "^5.1.4",
|
||||
"diff": "^8.0.2",
|
||||
"diff-dom": "^5.2.0",
|
||||
"echarts": "^5.6.0",
|
||||
"emojis-keywords": "2.0.0",
|
||||
"emojis-list": "2.1.0",
|
||||
@@ -66,7 +66,7 @@
|
||||
"jquery.easing": "^1.4.1",
|
||||
"jquery.transit": "^0.9.12",
|
||||
"matchmedia-polyfill": "^0.3.2",
|
||||
"md-editor-rt": "^5.5.1",
|
||||
"md-editor-rt": "^5.6.1",
|
||||
"mini-css-extract-plugin": "^2.9.2",
|
||||
"moment": "^2.30.1",
|
||||
"monaco-editor": "0.52.2",
|
||||
@@ -98,10 +98,9 @@
|
||||
"redux-promise-middleware": "^6.2.0",
|
||||
"redux-thunk": "^3.1.0",
|
||||
"rupture": "^0.7.1",
|
||||
"sass": "^1.87.0",
|
||||
"sass": "^1.89.1",
|
||||
"sass-loader": "^16.0.5",
|
||||
"schemastery": "^3.16.1",
|
||||
"schemastery-react": "^0.1.2",
|
||||
"shorty.js": "^1.0.1",
|
||||
"slideout": "^1.0.1",
|
||||
"sticky-kit": "^1.1.3",
|
||||
@@ -115,15 +114,15 @@
|
||||
"timeago.js": "^4.0.2",
|
||||
"ts-loader": "^9.5.2",
|
||||
"web-streams-polyfill": "^4.1.0",
|
||||
"webpack": "^5.99.8",
|
||||
"webpack": "^5.99.9",
|
||||
"webpack-bundle-analyzer": "^4.10.2",
|
||||
"webpack-dev-server": "^5.2.1",
|
||||
"webpack-dev-server": "^5.2.2",
|
||||
"webpack-manifest-plugin": "^5.0.1",
|
||||
"webpackbar": "^7.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@hydrooj/common": "workspace:^",
|
||||
"ansi_up": "^6.0.5",
|
||||
"ansi_up": "^6.0.6",
|
||||
"cssfilter": "^0.0.11",
|
||||
"esbuild": "0.25.2",
|
||||
"fs-extra": "^11.3.0",
|
||||
|
||||
@@ -7,6 +7,10 @@ import { NamedPage } from 'vj/misc/Page';
|
||||
import { i18n, request } from 'vj/utils';
|
||||
|
||||
const page = new NamedPage('manage_config', async () => {
|
||||
if (document.documentElement.className.includes('theme--dark')) {
|
||||
document.documentElement.className += ' dark';
|
||||
}
|
||||
|
||||
const [{ ConfigEditor, ComponentsProvider }, { load }] = await Promise.all([
|
||||
import('@hydrooj/components'),
|
||||
import('vj/components/monaco/loader'),
|
||||
@@ -35,6 +39,7 @@ const page = new NamedPage('manage_config', async () => {
|
||||
onSave={(value) => {
|
||||
request.post('', { value }).then(() => {
|
||||
Notification.success(i18n('Changes saved successfully'));
|
||||
window.location.reload();
|
||||
}).catch((e) => {
|
||||
Notification.error(i18n('Failed to save changes:'), e.message);
|
||||
});
|
||||
|
||||
@@ -95,6 +95,7 @@ function shouldCachePath(path: string) {
|
||||
if (!path.split('?')[0].split('/').pop()) return false;
|
||||
if (!path.split('?')[0].split('/').pop().includes('.')) return false;
|
||||
if (process.env.NODE_ENV !== 'production' && (path.includes('.hot-update.') || path.includes('?version='))) return false;
|
||||
if (path.includes('?v=')) return false;
|
||||
return true;
|
||||
}
|
||||
function shouldCache(request: Request) {
|
||||
|
||||
@@ -142,12 +142,12 @@
|
||||
{% if handler.user.hasPerm(reply_post_perm) %}
|
||||
<a href="javascript:;" data-tooltip="{{ _('Reply') }}" data-op="reply" data-type="reply"><span class="icon icon-reply"></span></a>
|
||||
{% endif %}
|
||||
{% if (handler.user.hasPerm(reply_edit_self_perm) and handler.user.own(doc)) or handler.user.hasPerm(reply_edit_perm) %}
|
||||
{% if (handler.user.hasPerm(reply_edit_self_perm) and handler.user.own(rdoc)) or handler.user.hasPerm(reply_edit_perm) %}
|
||||
<a href="javascript:;" data-tooltip="{{ _('Edit') }}" data-op="edit" data-type="reply"
|
||||
data-form="{{ {operation: reply_edit_op, psid: doc._id, psrid: rdoc._id}|json }}"
|
||||
><span class="icon icon-edit"></span></a>
|
||||
{% endif %}
|
||||
{% if (handler.user.hasPerm(reply_delete_self_perm) and handler.user.own(doc)) or handler.user.hasPerm(reply_delete_perm) %}
|
||||
{% if (handler.user.hasPerm(reply_delete_self_perm) and handler.user.own(rdoc)) or handler.user.hasPerm(reply_delete_perm) %}
|
||||
<a href="javascript:;" data-tooltip="{{ _('Delete') }}" data-op="delete" data-type="reply"
|
||||
data-form="{{ {operation: reply_delete_op, psid: doc._id, psrid: rdoc._id}|json }}"
|
||||
><span class="icon icon-delete"></span></a>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<li class="footer__category__item"><a href="https://github.com/hydro-dev/Hydro" target="_blank">{{ _('Open Source') }}</a></li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<div class="medium-3 large-2 columns footer__category expandable end">
|
||||
<div class="medium-3 large-2 columns footer__category expandable">
|
||||
<h1>
|
||||
{{ _('Support') }}
|
||||
<span class="expand-icon">
|
||||
@@ -34,7 +34,21 @@
|
||||
</h1>
|
||||
<div class="footer__category__expander"><ul class="footer__category__list">
|
||||
<li class="footer__category__item"><a href="{{ url('wiki_help') }}">{{ _('Help') }}</a></li>
|
||||
<li class="footer__category__item"><a href="{{ url('wiki_about', anchor='contact') }}">{{ _('QQ Group') }}</a></li>
|
||||
<li class="footer__category__item"><a href="{{ url('wiki_about', anchor='contact') }}">{{ _('Contact Us') }}</a></li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<div class="medium-3 large-2 columns footer__category expandable end">
|
||||
<h1>
|
||||
{{ _('About') }}
|
||||
<span class="expand-icon">
|
||||
<span class="icon icon-expand_more"></span>
|
||||
</span>
|
||||
</h1>
|
||||
<div class="footer__category__expander"><ul class="footer__category__list">
|
||||
<li class="footer__category__item"><a href="{{ url('wiki_about') }}">{{ _('About') }}</a></li>
|
||||
<li class="footer__category__item"><a href="{{ url('wiki_about', anchor='privacy') }}">{{ _('Privacy') }}</a></li>
|
||||
<li class="footer__category__item"><a href="{{ url('wiki_about', anchor='tos') }}">{{ _('Terms of Service') }}</a></li>
|
||||
<li class="footer__category__item"><a href="{{ url('wiki_about', anchor='contact') }}">{{ _('Copyright Complaint') }}</a></li>
|
||||
</ul></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -42,11 +56,13 @@
|
||||
<div class="footer__extra-link clearfix">
|
||||
<div class="footer__extra-left">
|
||||
<ol class="clearfix">
|
||||
{% if not show_topics|default(true) %}
|
||||
<li class="footer__extra-link-item"><a href="{{ url('wiki_about') }}">{{ _('About') }}</a></li>
|
||||
<li class="footer__extra-link-item"><a href="{{ url('wiki_about', anchor='contact') }}">{{ _('Contact Us') }}</a></li>
|
||||
<li class="footer__extra-link-item"><a href="{{ url('wiki_about', anchor='privacy') }}">{{ _('Privacy') }}</a></li>
|
||||
<li class="footer__extra-link-item"><a href="{{ url('wiki_about', anchor='tos') }}">{{ _('Terms of Service') }}</a></li>
|
||||
<li class="footer__extra-link-item"><a href="{{ url('wiki_about', anchor='contact') }}">{{ _('Copyright Complaint') }}</a></li>
|
||||
{% endif %}
|
||||
<li class="footer__extra-link-item nojs--hide" data-dropdown-target="#menu-footer-lang">
|
||||
<span><span class="icon icon-global"></span> Language <span class="icon icon-expand_less"></span></span>
|
||||
<ol class="dropdown-target menu" id="menu-footer-lang">
|
||||
|
||||
Reference in new issue
Block a user