proper functoin calls for faction data
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
async function updateEnemy() {
|
||||
const factionId = parseInt(document.getElementById("enemyId").value);
|
||||
const interval = parseInt(document.getElementById("refreshInterval").value);
|
||||
|
||||
if (!factionId || !interval) {
|
||||
alert("Please enter Enemy Faction ID and Refresh Interval!");
|
||||
return;
|
||||
}
|
||||
|
||||
await fetch(`/api/update_enemy_faction`, {
|
||||
method: "POST",
|
||||
headers: {"Content-Type": "application/json"},
|
||||
body: JSON.stringify({ faction_id: factionId, interval: interval })
|
||||
});
|
||||
}
|
||||
|
||||
async function updateFriendly() {
|
||||
const factionId = parseInt(document.getElementById("friendlyId").value);
|
||||
|
||||
if (!factionId) {
|
||||
alert("Please enter Friendly Faction ID!");
|
||||
return;
|
||||
}
|
||||
|
||||
const interval = parseInt(document.getElementById("refreshInterval").value);
|
||||
if (!interval) {
|
||||
alert("Please enter Refresh Interval!");
|
||||
return;
|
||||
}
|
||||
|
||||
await fetch(`/api/update_friendly_faction`, {
|
||||
method: "POST",
|
||||
headers: {"Content-Type": "application/json"},
|
||||
body: JSON.stringify({ faction_id: factionId, interval: interval })
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background-color: #1e1e2f;
|
||||
color: #f0f0f0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 2rem auto;
|
||||
padding: 2rem;
|
||||
background-color: #2c2c3e;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 0 20px rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
color: #ffcc00;
|
||||
}
|
||||
|
||||
.faction-section {
|
||||
background-color: #3a3a4d;
|
||||
margin: 1.5rem 0;
|
||||
padding: 1rem 1.5rem;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.faction-section h2 {
|
||||
color: #66ccff;
|
||||
}
|
||||
|
||||
input[type="number"] {
|
||||
padding: 0.5rem;
|
||||
margin-right: 0.5rem;
|
||||
border-radius: 6px;
|
||||
border: none;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 6px;
|
||||
border: none;
|
||||
background-color: #66ccff;
|
||||
color: #1e1e2f;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #3399ff;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user