mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
Merge remote-tracking branch 'origin/master' into rejudge_task
This commit is contained in:
96 files changed
+2077
-1691
No files matched your search
@@ -1,10 +0,0 @@
|
||||
.graphiql-container .doc-explorer-title, .graphiql-container .history-title
|
||||
overflow: hidden;
|
||||
padding: 5px 40px 0px 0px !important
|
||||
|
||||
.graphiql-container .docExplorerWrap
|
||||
font-family: var(--code-font-family) !important
|
||||
|
||||
.graphiql-container .doc-explorer-back
|
||||
overflow: hidden;
|
||||
padding: 8px 20px 0px 20px !important
|
||||
@@ -1,29 +0,0 @@
|
||||
import { pick } from 'lodash';
|
||||
import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { NamedPage } from 'vj/misc/Page';
|
||||
import { request } from 'vj/utils';
|
||||
|
||||
const defaultQuery = `\
|
||||
query Example(
|
||||
$name: String!
|
||||
) {
|
||||
user(uname: $name) {
|
||||
_id
|
||||
uname
|
||||
}
|
||||
}`;
|
||||
|
||||
export default new NamedPage('api', async () => {
|
||||
const { GraphiQL } = await import('graphiql');
|
||||
GraphiQL.Logo = function () {
|
||||
return <p></p>;
|
||||
} as any;
|
||||
createRoot(document.getElementById('main')!).render(
|
||||
<GraphiQL
|
||||
fetcher={(body, opts = {}) => request.post(`/d/${UiContext.domain._id}/api`, body, pick(opts, 'headers'))}
|
||||
defaultQuery={defaultQuery}
|
||||
variables='{"name": "Hydro"}'
|
||||
/>,
|
||||
);
|
||||
});
|
||||
@@ -5,22 +5,19 @@ import { ActionDialog, ConfirmDialog } from 'vj/components/dialog';
|
||||
import Notification from 'vj/components/notification';
|
||||
import { NamedPage } from 'vj/misc/Page';
|
||||
import {
|
||||
api, delay, gql, i18n, tpl,
|
||||
api, delay, i18n, tpl,
|
||||
} from 'vj/utils';
|
||||
|
||||
function update(name: string, uids: number[]) {
|
||||
return api(gql`
|
||||
domain { manage { group {
|
||||
update(name: ${name}, uids: ${uids})
|
||||
} } }
|
||||
`);
|
||||
function update(name: string, uids: number[] = []) {
|
||||
return api('domain.group', {
|
||||
name,
|
||||
uids,
|
||||
}, []);
|
||||
}
|
||||
function del(name: string) {
|
||||
return api(gql`
|
||||
domain { manage { group {
|
||||
del(name: ${name})
|
||||
} } }
|
||||
`);
|
||||
return api('domain.group', {
|
||||
name,
|
||||
}, []);
|
||||
}
|
||||
|
||||
const page = new NamedPage('domain_group', () => {
|
||||
|
||||
@@ -5,7 +5,7 @@ import VjNotification from 'vj/components/notification';
|
||||
import selectUser from 'vj/components/selectUser';
|
||||
import { ctx, Service } from 'vj/context';
|
||||
import { NamedPage } from 'vj/misc/Page';
|
||||
import { api, gql, loadReactRedux } from 'vj/utils';
|
||||
import { api, loadReactRedux } from 'vj/utils';
|
||||
|
||||
class MessagePadService extends Service {
|
||||
WebSocket: typeof import('../components/socket').default;
|
||||
@@ -91,14 +91,10 @@ const page = new NamedPage('home_messages', () => {
|
||||
async function loadSendTarget() {
|
||||
const target = new URL(window.location.href).searchParams.get('target');
|
||||
if (!target) return;
|
||||
const user = await api(gql`
|
||||
users(search: ${target}, exact: true) {
|
||||
_id
|
||||
uname
|
||||
avatarUrl
|
||||
mail
|
||||
}
|
||||
`, ['data', 'users']);
|
||||
const user = await api(
|
||||
'users', { search: target, exact: true },
|
||||
['_id', 'uname', 'avatarUrl', 'mail'],
|
||||
);
|
||||
if (!user?.length) return;
|
||||
createDialog(user[0]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user