经理中心

This commit is contained in:
zhx 2026-06-24 15:39:32 +08:00
parent b603946051
commit 80f529c6f2
6 changed files with 28 additions and 8 deletions

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
<title>Manager Center</title> <title>Manager Center</title>
<link rel="stylesheet" href="./style.css?v=20260622-0100" /> <link rel="stylesheet" href="./style.css?v=20260624-0100" />
</head> </head>
<body> <body>
<div class="manager-center" aria-label="Manager Center" data-i18n-aria="page_label" data-loading="true"> <div class="manager-center" aria-label="Manager Center" data-i18n-aria="page_label" data-loading="true">
@ -280,6 +280,6 @@
</div> </div>
<div class="toast" id="toast" role="status" hidden></div> <div class="toast" id="toast" role="status" hidden></div>
</div> </div>
<script src="./script.js?v=20260622-0100" defer></script> <script src="./script.js?v=20260624-0100" defer></script>
</body> </body>
</html> </html>

View File

@ -13,6 +13,7 @@
"target_user": "المستخدم المستهدف", "target_user": "المستخدم المستهدف",
"current_country": "Current country", "current_country": "Current country",
"change_country": "Change Country", "change_country": "Change Country",
"change_country_disabled": "Change Country disabled",
"select_country": "Select country", "select_country": "Select country",
"changing_country": "Changing...", "changing_country": "Changing...",
"country_changed": "Country changed", "country_changed": "Country changed",

View File

@ -13,6 +13,7 @@
"target_user": "Target User", "target_user": "Target User",
"current_country": "Current country", "current_country": "Current country",
"change_country": "Change Country", "change_country": "Change Country",
"change_country_disabled": "Change Country disabled",
"select_country": "Select country", "select_country": "Select country",
"changing_country": "Changing...", "changing_country": "Changing...",
"country_changed": "Country changed", "country_changed": "Country changed",

View File

@ -13,6 +13,7 @@
"target_user": "Pengguna Target", "target_user": "Pengguna Target",
"current_country": "Current country", "current_country": "Current country",
"change_country": "Change Country", "change_country": "Change Country",
"change_country_disabled": "Change Country disabled",
"select_country": "Select country", "select_country": "Select country",
"changing_country": "Changing...", "changing_country": "Changing...",
"country_changed": "Country changed", "country_changed": "Country changed",

View File

@ -13,6 +13,7 @@
"target_user": "Hedef Kullanıcı", "target_user": "Hedef Kullanıcı",
"current_country": "Current country", "current_country": "Current country",
"change_country": "Change Country", "change_country": "Change Country",
"change_country_disabled": "Change Country disabled",
"select_country": "Select country", "select_country": "Select country",
"changing_country": "Changing...", "changing_country": "Changing...",
"country_changed": "Country changed", "country_changed": "Country changed",

View File

@ -27,6 +27,7 @@
target_user: "Target User", target_user: "Target User",
current_country: "Current country", current_country: "Current country",
change_country: "Change Country", change_country: "Change Country",
change_country_disabled: "Change Country disabled",
select_country: "Select country", select_country: "Select country",
changing_country: "Changing...", changing_country: "Changing...",
country_changed: "Country changed", country_changed: "Country changed",
@ -109,6 +110,7 @@
target_user: "المستخدم المستهدف", target_user: "المستخدم المستهدف",
current_country: "Current country", current_country: "Current country",
change_country: "Change Country", change_country: "Change Country",
change_country_disabled: "Change Country disabled",
select_country: "Select country", select_country: "Select country",
changing_country: "Changing...", changing_country: "Changing...",
country_changed: "Country changed", country_changed: "Country changed",
@ -191,6 +193,7 @@
target_user: "Hedef Kullanıcı", target_user: "Hedef Kullanıcı",
current_country: "Current country", current_country: "Current country",
change_country: "Change Country", change_country: "Change Country",
change_country_disabled: "Change Country disabled",
select_country: "Select country", select_country: "Select country",
changing_country: "Changing...", changing_country: "Changing...",
country_changed: "Country changed", country_changed: "Country changed",
@ -273,6 +276,7 @@
target_user: "Pengguna Target", target_user: "Pengguna Target",
current_country: "Current country", current_country: "Current country",
change_country: "Change Country", change_country: "Change Country",
change_country_disabled: "Change Country disabled",
select_country: "Select country", select_country: "Select country",
changing_country: "Changing...", changing_country: "Changing...",
country_changed: "Country changed", country_changed: "Country changed",
@ -410,7 +414,7 @@
if (window.location.protocol === "file:") return fallbackMessages[normalizedLang]; if (window.location.protocol === "file:") return fallbackMessages[normalizedLang];
try { try {
const response = await fetch(`./locales/${normalizedLang}.json?v=20260622-0100`, { cache: "no-store" }); const response = await fetch(`./locales/${normalizedLang}.json?v=20260624-0100`, { cache: "no-store" });
if (response.ok) return await response.json(); if (response.ok) return await response.json();
} catch (error) { } catch (error) {
return fallbackMessages[normalizedLang]; return fallbackMessages[normalizedLang];
@ -754,6 +758,10 @@
} }
async function openCountryModal() { async function openCountryModal() {
if (!featureEnabled("changeCountry")) {
showToast(message("change_country_disabled"));
return;
}
if (!state.target) { if (!state.target) {
showToast(message("enter_user")); showToast(message("enter_user"));
return; return;
@ -868,7 +876,8 @@
addBdLeader: true, addBdLeader: true,
giftProps: true, giftProps: true,
banUser: true, banUser: true,
unbanUser: true unbanUser: true,
changeCountry: true
}; };
} }
@ -877,7 +886,8 @@
addBdLeader: features?.addBdLeader !== false, addBdLeader: features?.addBdLeader !== false,
giftProps: features?.giftProps !== false, giftProps: features?.giftProps !== false,
banUser: features?.banUser !== false, banUser: features?.banUser !== false,
unbanUser: features?.unbanUser !== false unbanUser: features?.unbanUser !== false,
changeCountry: features?.changeCountry !== false
}; };
} }
@ -1152,9 +1162,11 @@
if (title) title.textContent = disabledByFeature ? message("gift_props_disabled") : message("gift_props"); if (title) title.textContent = disabledByFeature ? message("gift_props_disabled") : message("gift_props");
} }
if (countryEntryButton) { if (countryEntryButton) {
countryEntryButton.disabled = !state.target || state.countriesLoading || state.changingCountry; const disabledByFeature = !featureEnabled("changeCountry");
countryEntryButton.disabled = disabledByFeature || !state.target || state.countriesLoading || state.changingCountry;
countryEntryButton.classList.toggle("is-feature-disabled", disabledByFeature);
const title = countryEntryButton.querySelector(".action-item-title"); const title = countryEntryButton.querySelector(".action-item-title");
if (title) title.textContent = message("change_country"); if (title) title.textContent = disabledByFeature ? message("change_country_disabled") : message("change_country");
} }
if (banEntryButton) { if (banEntryButton) {
const disabledByFeature = !featureEnabled("banUser"); const disabledByFeature = !featureEnabled("banUser");
@ -1174,7 +1186,7 @@
if (sendButton) sendButton.disabled = !featureEnabled("giftProps") || !state.target || !state.selectedPropsId; if (sendButton) sendButton.disabled = !featureEnabled("giftProps") || !state.target || !state.selectedPropsId;
if (changeCountryButton) { if (changeCountryButton) {
const currentID = String(state.target?.countryId || matchingCountryId(state.target) || ""); const currentID = String(state.target?.countryId || matchingCountryId(state.target) || "");
changeCountryButton.disabled = !state.target || state.countriesLoading || state.changingCountry || !state.selectedCountryId || state.selectedCountryId === currentID; changeCountryButton.disabled = !featureEnabled("changeCountry") || !state.target || state.countriesLoading || state.changingCountry || !state.selectedCountryId || state.selectedCountryId === currentID;
changeCountryButton.textContent = state.changingCountry ? message("changing_country") : message("change_country"); changeCountryButton.textContent = state.changingCountry ? message("changing_country") : message("change_country");
} }
if (banButton) banButton.disabled = !featureEnabled("banUser") || !canBanTarget(state.target); if (banButton) banButton.disabled = !featureEnabled("banUser") || !canBanTarget(state.target);
@ -1381,6 +1393,10 @@
async function changeUserCountry() { async function changeUserCountry() {
if (!state.target) return; if (!state.target) return;
if (!featureEnabled("changeCountry")) {
setStatus($("#countryStatus"), message("change_country_disabled"), "error");
return;
}
if (!state.selectedCountryId) { if (!state.selectedCountryId) {
setStatus($("#countryStatus"), message("country_required"), "error"); setStatus($("#countryStatus"), message("country_required"), "error");
return; return;