added ban redirect correctly
All checks were successful
Build Frontend / Build Frontend (push) Successful in 25s

This commit is contained in:
2026-01-11 03:55:47 +00:00
parent d794c5ad48
commit 2aff879291
4 changed files with 601 additions and 18 deletions

View File

@@ -496,6 +496,80 @@
<p class="form-help">How often to auto-update market prices</p>
</div>
</div>
<div class="settings-section">
<h3>💵 Instant Sell Payout</h3>
<div class="form-group">
<label>Global Payout Rate (%)</label>
<input
v-model.number="instantSellForm.payoutRate"
type="number"
step="0.1"
min="0"
max="100"
class="form-input"
placeholder="70.0"
/>
<p class="form-help">
Default percentage of market price paid to users (e.g., 70 = pay
70% of item value)
</p>
</div>
<div class="form-group">
<label>CS2 Payout Rate (%)</label>
<input
v-model.number="instantSellForm.cs2.payoutRate"
type="number"
step="0.1"
min="0"
max="100"
class="form-input"
placeholder="70.0"
/>
<p class="form-help">
Payout rate specifically for CS2 items (overrides global)
</p>
</div>
<div class="form-group">
<label>Rust Payout Rate (%)</label>
<input
v-model.number="instantSellForm.rust.payoutRate"
type="number"
step="0.1"
min="0"
max="100"
class="form-input"
placeholder="70.0"
/>
<p class="form-help">
Payout rate specifically for Rust items (overrides global)
</p>
</div>
<div class="form-group">
<label>Min Item Value ($)</label>
<input
v-model.number="instantSellForm.minItemValue"
type="number"
step="0.01"
min="0"
class="form-input"
placeholder="0.01"
/>
<p class="form-help">Minimum item value for instant sell</p>
</div>
<div class="form-group">
<label>Max Item Value ($)</label>
<input
v-model.number="instantSellForm.maxItemValue"
type="number"
step="1"
min="0"
class="form-input"
placeholder="10000"
/>
<p class="form-help">Maximum item value for instant sell</p>
</div>
</div>
</div>
<div class="form-actions-centered">
@@ -970,6 +1044,22 @@ const promotionForm = ref({
code: "",
});
// Instant Sell form
const instantSellForm = ref({
enabled: true,
payoutRate: 70.0, // Percentage (70 = 70%)
minItemValue: 0.01,
maxItemValue: 10000,
cs2: {
enabled: true,
payoutRate: 70.0,
},
rust: {
enabled: true,
payoutRate: 70.0,
},
});
// Methods
const loadConfig = async () => {
loading.value = true;
@@ -1016,6 +1106,25 @@ const loadConfig = async () => {
commission: config.value.market.commission * 100,
};
}
if (config.value.instantSell) {
instantSellForm.value = {
enabled: config.value.instantSell.enabled ?? true,
// Convert decimal to percentage for display (0.7 -> 70)
payoutRate: (config.value.instantSell.payoutRate ?? 0.7) * 100,
minItemValue: config.value.instantSell.minItemValue ?? 0.01,
maxItemValue: config.value.instantSell.maxItemValue ?? 10000,
cs2: {
enabled: config.value.instantSell.cs2?.enabled ?? true,
payoutRate: (config.value.instantSell.cs2?.payoutRate ?? 0.7) * 100,
},
rust: {
enabled: config.value.instantSell.rust?.enabled ?? true,
payoutRate:
(config.value.instantSell.rust?.payoutRate ?? 0.7) * 100,
},
};
}
}
} catch (error) {
console.error("Failed to load config:", error);
@@ -1060,25 +1169,46 @@ const saveAllSettings = async () => {
commission: marketForm.value.commission / 100, // Convert percentage to decimal
};
const instantSellData = {
enabled: instantSellForm.value.enabled,
payoutRate: instantSellForm.value.payoutRate / 100, // Convert percentage to decimal
minItemValue: instantSellForm.value.minItemValue,
maxItemValue: instantSellForm.value.maxItemValue,
cs2: {
enabled: instantSellForm.value.cs2.enabled,
payoutRate: instantSellForm.value.cs2.payoutRate / 100,
},
rust: {
enabled: instantSellForm.value.rust.enabled,
payoutRate: instantSellForm.value.rust.payoutRate / 100,
},
};
console.log("💾 Saving all settings...");
console.log("Trading data:", tradingData);
console.log("Market data:", marketData);
console.log("Instant Sell data:", instantSellData);
// Save both in parallel
const [tradingResponse, marketResponse] = await Promise.all([
axios.patch("/api/admin/config/trading", tradingData),
axios.patch("/api/admin/config/market", marketData),
]);
// Save all in parallel
const [tradingResponse, marketResponse, instantSellResponse] =
await Promise.all([
axios.patch("/api/admin/config/trading", tradingData),
axios.patch("/api/admin/config/market", marketData),
axios.patch("/api/admin/config/instantsell", instantSellData),
]);
if (tradingResponse.data.success && marketResponse.data.success) {
toast.success("✅ All settings saved successfully!");
await loadConfig();
if (
tradingResponse.data.success &&
marketResponse.data.success &&
instantSellResponse.data.success
) {
toast.success("Settings saved successfully");
await loadConfig(); // Reload to get updated values
} else {
throw new Error("One or more settings failed to save");
toast.error("Failed to save some settings");
}
} catch (error) {
console.error("Failed to save settings:", error);
console.error("Error response:", error.response?.data);
console.error("Failed to save settings:", error);
toast.error(error.response?.data?.message || "Failed to save settings");
} finally {
saving.value = false;
@@ -1885,7 +2015,7 @@ onMounted(() => {
.settings-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-columns: repeat(3, 1fr);
gap: 2rem;
margin-bottom: 2rem;
}
@@ -1986,6 +2116,12 @@ onMounted(() => {
}
}
@media (max-width: 1400px) {
.settings-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 1024px) {
.settings-grid {
grid-template-columns: 1fr;

View File

@@ -9,12 +9,6 @@
<!-- Title -->
<h1 class="banned-title">Account Suspended</h1>
<!-- Message -->
<p class="banned-message">
Your account has been suspended due to a violation of our Terms of
Service.
</p>
<!-- Ban Details -->
<div v-if="banInfo" class="ban-details">
<div class="detail-item">