core&ui: implement domain leave and kick

This commit is contained in:
undefined committed 2025-03-22 05:55:56 +08:00
1 parent f8ed636b30
commit a0f38d9ad1
13 files changed
+64 -28

No files matched your search

+2 -1
View File
@@ -680,6 +680,7 @@ Terms of Service: 이용 약관
Test data comes from: Testdata 출처
Testdata Config: Testdata 설정
Text: 본문
Leave: 나가기
The homework's deadline is due but in extension. You can still submit for this problem but your score will be penalized.: 추가 접수 중입니다. 제출할 수 있지만 감점될 수 있습니다.
The invitation code to enter to successfully join the domain. You can only use letters and numbers in the code and it should not be longer than 64 characters.: 초대 코드는 64글자 미만입니다.
The invitation code you provided is invalid.: 잘못된 초대 코드
@@ -688,7 +689,7 @@ The role to assign when user joining the domain.: 사용자가 그룹에 참여
The uploaded file is too long.: 업로드한 파일이 너무 깁니다.
The user is already a member of the domain.: 이미 그룹에 속한 사용자입니다.
The user is too lazy to leave something here...: 설명이 없습니다... (´・ω・`)
Their account will not be deleted and they will be with the default role.: 계정은 삭제되지 않을 것이고, default 역할을 가질 것입니다.
Their account will not be deleted and they will be with the guest role until they re-join the domain.: 계정은 삭제되지 않을 것이고, guest 역할을 가질 것입니다. 그룹에 다시 참여할 때까지 말이죠.
There are no contests...: 대회 없음
There is no homework so far ╰(*°▽°*)╯: 과제 없음 ╰(*°▽°*)╯
This contest is not live.: 대회가 실시간이 아닙니다.
+2 -1
View File
@@ -512,6 +512,7 @@ LaTeX Expressions: LaTeX 表达式
Learn More: 了解更多
Leave blank to use numeric pid.: 留空来使用数字题号。
Leave empty for default: 留空以使用默认
Leave: 离开
Ledo: 乐多
Legacy mode: 兼容模式
Light: 亮色
@@ -916,7 +917,7 @@ The scoreboard was frozen with {0} minutes remaining at {1} - submissions in the
The uploaded file is too long.: 上传的文件太长。
The user is already a member of the domain.: 该用户已是域的成员。
The user is too lazy to leave something here...: 该用户太懒,这里啥也没写 (´・ω・`)
Their account will not be deleted and they will be with the default role.: 他们的账号不会被删除,并且之后将以 default 角色访问。
Their account will not be deleted and they will be with the guest role until they re-join the domain.: 他们的账号不会被删除,并且之后将以 guest 角色访问,直到他们重新加入域。
Theme: 主题
There are no contests...: 没有比赛…
There is no homework so far ╰(*°▽°*)╯: 目前还没有作业 ╰(*°▽°*)╯
+2 -1
View File
@@ -238,6 +238,7 @@ Last Submit At: 最後遞交於
Last Update At: 最後活動時間
LaTeX Expressions: LaTeX 表示式
Learn More: 瞭解更多
Leave: 離開
Links: 連結
List View: 列表視圖
Live: 正在進行
@@ -462,7 +463,7 @@ Technical Information: 技術資訊
Temporary session: 臨時會話
Text: 文字
The homework's deadline is due but in extension. You can still submit for this problem but your score will be penalized.: 功課已經截止,但處於延期時間内。您此時遞交的題目無法獲得全部分數。
Their account will not be deleted and they will be with the default role.: 他們的賬號不會被刪除,並且之後將以 default 角色訪問。
Their account will not be deleted and they will be with the guest role until they re-join the domain.: 他們的賬號不會被刪除,並且之後將以 guest 角色訪問,直到他們重新加入域。
There are no contests...: 沒有比賽…
There is no homework so far ╰(*°▽°*)╯: 目前沒有功課 ╰(*°▽°*)╯
This contest is not live.: 比賽沒有開始。
@@ -60,8 +60,8 @@ const page = new NamedPage('domain_user', () => {
const role = addUserDialog.$dom.find('[name="role"]').val();
try {
await request.post('', {
operation: 'set_user',
uid: user._id,
operation: 'set_users',
uids: [user._id],
role,
});
window.location.reload();
@@ -91,15 +91,14 @@ const page = new NamedPage('domain_user', () => {
$body: tpl`
<div class="typo">
<p>${i18n('Confirm removing the selected users?')}</p>
<p>${i18n('Their account will not be deleted and they will be with the default role.')}</p>
<p>${i18n('Their account will not be deleted and they will be with the guest role until they re-join the domain.')}</p>
</div>`,
}).open();
if (action !== 'yes') return;
try {
await request.post('', {
operation: 'set_users',
uid: selectedUsers,
role: 'default',
operation: 'kick',
uids: selectedUsers,
});
Notification.success(i18n('Selected users have been removed from the domain.'));
await delay(2000);
@@ -122,7 +121,7 @@ const page = new NamedPage('domain_user', () => {
try {
await request.post('', {
operation: 'set_users',
uid: selectedUsers,
uids: selectedUsers,
role,
});
Notification.success(i18n('Role has been updated to {0} for selected users.', role));
@@ -138,8 +137,8 @@ const page = new NamedPage('domain_user', () => {
const role = $(ev.currentTarget).val();
try {
await request.post('', {
operation: 'set_user',
uid: row.attr('data-uid'),
operation: 'set_users',
uids: [row.attr('data-uid')],
role,
});
Notification.success(i18n('Role has been updated to {0}.', role));
@@ -11,7 +11,7 @@
border-left: 1px solid $table-border-color
.col--action
width: rem(135px)
width: rem(200px)
+mobile()
.col--icon, .col--role
@@ -44,6 +44,11 @@
{% if canManage[ddoc['_id']] %}
· <a class="typo-a" href="{{ url('domain_dashboard', domainId=ddoc['_id']) }}">{{ _('Manage') }}</a>
{% endif %}
· <form class="form--inline" method="post">
<input type="hidden" name="operation" value="leave">
<input type="hidden" name="id" value="{{ ddoc['_id'] }}">
<button class="typo-a" type="submit">{{ _('Leave') }}</button>
</form>
</td>
</tr>
{%- endfor -%}