Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files
server/wildfire_web_interface.py
CHANGED
|
@@ -711,6 +711,12 @@ def get_wildfire_web_interface_html(metadata: Optional[EnvironmentMetadata] = No
|
|
| 711 |
}}
|
| 712 |
|
| 713 |
async submitAction() {{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 714 |
const formData = new FormData(document.getElementById('action-form'));
|
| 715 |
const action = {{}};
|
| 716 |
|
|
@@ -809,6 +815,10 @@ def get_wildfire_web_interface_html(metadata: Optional[EnvironmentMetadata] = No
|
|
| 809 |
console.log('Reset result:', result);
|
| 810 |
console.log('Reset observation:', result.observation);
|
| 811 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 812 |
// Render grid immediately after reset and update stats
|
| 813 |
if (result.observation && result.observation.grid) {{
|
| 814 |
const obs = result.observation;
|
|
|
|
| 711 |
}}
|
| 712 |
|
| 713 |
async submitAction() {{
|
| 714 |
+
// Check if environment has been reset
|
| 715 |
+
if (!this.isInitialized) {{
|
| 716 |
+
alert('Please click "Reset Environment" first to initialize the environment before taking actions.');
|
| 717 |
+
return;
|
| 718 |
+
}}
|
| 719 |
+
|
| 720 |
const formData = new FormData(document.getElementById('action-form'));
|
| 721 |
const action = {{}};
|
| 722 |
|
|
|
|
| 815 |
console.log('Reset result:', result);
|
| 816 |
console.log('Reset observation:', result.observation);
|
| 817 |
|
| 818 |
+
// Mark environment as initialized
|
| 819 |
+
this.isInitialized = true;
|
| 820 |
+
this.updateActionButtonState();
|
| 821 |
+
|
| 822 |
// Render grid immediately after reset and update stats
|
| 823 |
if (result.observation && result.observation.grid) {{
|
| 824 |
const obs = result.observation;
|