Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin tools update #575

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
f0040a5
Update account.js
krossower1 Sep 26, 2024
77f5d20
Update account.js
krossower1 Sep 26, 2024
aef8ee8
Update account.js
krossower1 Sep 26, 2024
a480c86
Update en.json
krossower1 Sep 26, 2024
93f8b5e
Update ar.json
krossower1 Sep 26, 2024
88447d3
Update de.json
krossower1 Sep 26, 2024
fbc4ba2
Update eo.json
krossower1 Sep 26, 2024
7c6bd28
Update es.json
krossower1 Sep 26, 2024
1643c32
Update fr.json
krossower1 Sep 26, 2024
83a707c
Update it.json
krossower1 Sep 26, 2024
252a19d
Update ja.json
krossower1 Sep 26, 2024
299cf3a
Update ko.json
krossower1 Sep 26, 2024
7af42c7
Update pl.json
krossower1 Sep 26, 2024
c86c899
Update pt.json
krossower1 Sep 26, 2024
1396c9e
Update ro.json
krossower1 Sep 26, 2024
c7bfb41
Update ro.json
krossower1 Sep 26, 2024
adb5efa
Update pt.json
krossower1 Sep 26, 2024
911ede4
Update pl.json
krossower1 Sep 26, 2024
e88c072
Update ko.json
krossower1 Sep 26, 2024
e8f6972
Update ja.json
krossower1 Sep 26, 2024
3b5ef47
Update it.json
krossower1 Sep 26, 2024
a941fd6
Update fr.json
krossower1 Sep 26, 2024
e65c976
Update es.json
krossower1 Sep 26, 2024
fcb4c31
Update eo.json
krossower1 Sep 26, 2024
0bb7b10
Update en.json
krossower1 Sep 26, 2024
e9e9a53
Update de.json
krossower1 Sep 26, 2024
3fa309c
Update ar.json
krossower1 Sep 26, 2024
0c677cf
Update zh.json
krossower1 Sep 26, 2024
3a6ffbe
Update vi.json
krossower1 Sep 26, 2024
ed533e3
Update tr.json
krossower1 Sep 26, 2024
3cf2251
Update ru.json
krossower1 Sep 26, 2024
0a49409
Update ro.json
krossower1 Sep 26, 2024
897b8c2
Merge branch 'ynoproject:master' into adminTools
krossower1 Sep 27, 2024
b559c8b
Update ar.json
krossower1 Sep 27, 2024
ad72145
Update de.json
krossower1 Sep 27, 2024
156a3ab
Update en.json
krossower1 Sep 27, 2024
dc8ab07
Update eo.json
krossower1 Sep 27, 2024
6fa9905
Update es.json
krossower1 Sep 27, 2024
cb35a56
Update fr.json
krossower1 Sep 27, 2024
5ef5f97
Update it.json
krossower1 Sep 27, 2024
2835f78
Update ja.json
krossower1 Sep 27, 2024
0824378
Update ko.json
krossower1 Sep 27, 2024
051bca0
Update pl.json
krossower1 Sep 27, 2024
8e64567
Update pt.json
krossower1 Sep 27, 2024
57dbbbd
Update ro.json
krossower1 Sep 27, 2024
c64efa0
Update ru.json
krossower1 Sep 27, 2024
b27acd4
Update tr.json
krossower1 Sep 27, 2024
414bfa2
Update vi.json
krossower1 Sep 27, 2024
9cda32b
Update zh.json
krossower1 Sep 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions account.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,25 @@ function updateModControls() {
});
addModControlsButton(localizedMessages.modSettings.actions.ban.label,
() => adminPlayerAction('ban', localizedMessages.modSettings.actions.ban.playerPrompt, getMassagedLabel(localizedMessages.context.admin.ban.success, true), 'ban'));
addModControlsButton(localizedMessages.modSettings.actions.tempBan.label,
() => {
const playerName = prompt(localizedMessages.modSettings.actions.tempBan.playerPrompt);
if (!playerName)
return;
const duration = prompt(localizedMessages.modSettings.actions.tempBan.durationPrompt.replace('{PLAYER}', playerName));
if (!duration)
return;
apiFetch(`temporaryban?user=${playerName}&duration=${duration}`, true)
.then(response => {
if (!response.ok) {
showToastMessage(getMassagedLabel(localizedMessages.modSettings.actions.tempBan.error, true).replace('{PLAYER}', playerName));
throw new Error(response.statusText);
}
return response.text();
})
.then(_ => showToastMessage(getMassagedLabel(localizedMessages.modSettings.actions.tempBan.success, true).replace('{PLAYER}', playerName).replace('{DURATION}', duration), 'info', true, null, true))
.catch(err => console.error(err));
});
addModControlsButton(localizedMessages.modSettings.actions.unban.label,
() => adminPlayerAction('unban', localizedMessages.modSettings.actions.unban.playerPrompt, getMassagedLabel(localizedMessages.context.admin.unban.success, true), 'info'));
addModControlsButton(localizedMessages.modSettings.actions.mute.label,
Expand Down
9 changes: 8 additions & 1 deletion lang/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@
"label": "حظر لاعب",
"playerPrompt": "أدخل اسم الحساب المراد حظره"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "إلغاء حظر لاعب",
"playerPrompt": "أدخل اسم الحساب المطلوب إلغاء حظره"
Expand All @@ -1104,4 +1111,4 @@
}
}
}
}
}
9 changes: 8 additions & 1 deletion lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@
"label": "Ban a Player",
"playerPrompt": "Enter the name of the account to ban"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "Unban a Player",
"playerPrompt": "Enter the name of the account to unban"
Expand All @@ -1104,4 +1111,4 @@
}
}
}
}
}
9 changes: 8 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@
"label": "Ban a Player",
"playerPrompt": "Enter the name of the account to ban"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "Unban a Player",
"playerPrompt": "Enter the name of the account to unban"
Expand All @@ -1104,4 +1111,4 @@
}
}
}
}
}
9 changes: 8 additions & 1 deletion lang/eo.json
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,13 @@
"label": "Forbari Ludanton",
"playerPrompt": "Entajpi la nomon de la konto por forbari"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "Malforbari Ludanton",
"playerPrompt": "Entajpi la nomon de la konto por malforbari"
Expand All @@ -1103,4 +1110,4 @@
}
}
}
}
}
9 changes: 8 additions & 1 deletion lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@
"label": "Banear Jugador",
"playerPrompt": "Ingrese el nombre de la cuenta a banear"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "Desbanear Jugador",
"playerPrompt": "Ingrese el nombre de la cuenta a desbanear"
Expand All @@ -1104,4 +1111,4 @@
}
}
}
}
}
7 changes: 7 additions & 0 deletions lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@
"label": "Bannir un Joueur",
"playerPrompt": "Entrez le nom du compte à bannir"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "Débannir un Joueur",
"playerPrompt": "Entrez le nom du compte à débannir"
Expand Down
9 changes: 8 additions & 1 deletion lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@
"label": "Banna un Giocatore",
"playerPrompt": "Inserisci il nome dell'account che vuoi bannare"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "Unbanna un Giocatore",
"playerPrompt": "Inserisci il nome dell'account che vuoi unbannare"
Expand All @@ -1104,4 +1111,4 @@
}
}
}
}
}
7 changes: 7 additions & 0 deletions lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@
"label": "プレイヤーのBAN",
"playerPrompt": "BANするアカウントの名前を入力してください。"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "プレイヤーのBAN解除",
"playerPrompt": "BAN解除するアカウントの名前を入力してください。"
Expand Down
9 changes: 8 additions & 1 deletion lang/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@
"label": "플레이어 차단 설정",
"playerPrompt": "차단할 플레이어의 닉네임을 입력해주세요"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "플레이어 차단 해제",
"playerPrompt": "차단 해제할 플레이어의 닉네임을 입력해주세요"
Expand All @@ -1104,4 +1111,4 @@
}
}
}
}
}
9 changes: 8 additions & 1 deletion lang/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@
"label": "Zbanuj gracza",
"playerPrompt": "Podaj nazwę gracza do zbanowania"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "Odbanuj gracza",
"playerPrompt": "Podaj nazwę gracza do odbanowania"
Expand All @@ -1104,4 +1111,4 @@
}
}
}
}
}
9 changes: 8 additions & 1 deletion lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@
"label": "Banir um Jogador",
"playerPrompt": "Digite o nome da conta para banir"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "Desbanir um Jogador",
"playerPrompt": "Digite o nome da conta para desbanir"
Expand All @@ -1104,4 +1111,4 @@
}
}
}
}
}
9 changes: 8 additions & 1 deletion lang/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@
"label": "Ban a Player",
"playerPrompt": "Enter the name of the account to ban"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "Unban a Player",
"playerPrompt": "Enter the name of the account to unban"
Expand All @@ -1104,4 +1111,4 @@
}
}
}
}
}
9 changes: 8 additions & 1 deletion lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@
"label": "Забанить игрока",
"playerPrompt": "Введите имя аккаунта, что необходимо забанить"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "Разбанить игрока",
"playerPrompt": "Введите имя аккаунта, что необходимо разбанить"
Expand All @@ -1104,4 +1111,4 @@
}
}
}
}
}
9 changes: 8 additions & 1 deletion lang/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@
"label": "Bir Kullanıcı Banla",
"playerPrompt": "Banlamak için hesabın adını girin"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "Bir Kullanıcı Banı Kaldır",
"playerPrompt": "Ban kaldırmak için hesabın adını girin"
Expand All @@ -1104,4 +1111,4 @@
}
}
}
}
}
7 changes: 7 additions & 0 deletions lang/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@
"label": "Ban Người chơi",
"playerPrompt": "Nhập tên người chơi để ban"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "Bỏ ban Người chơi",
"playerPrompt": "Nhập tên người chơi để bỏ ban"
Expand Down
7 changes: 7 additions & 0 deletions lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,13 @@
"label": "封禁玩家",
"playerPrompt": "请输入淘气鬼的用户名"
},
"tempBan": {
"label": "Temporarily ban a Player",
"playerPrompt": "Enter the name of the account to ban",
"durationPrompt": "Enter the duration in minutes to ban {PLAYER} for",
"success": "{PLAYER} has been banned for {DURATION}",
"error": "Failed to ban {PLAYER}"
},
"unban": {
"label": "解封玩家",
"playerPrompt": "请输入要宽恕的用户名"
Expand Down