mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
fixed crash detection / auto start checkboxes - found huge issue with crash detection. putting on bug list for later
This commit is contained in:
parent
568e1e8f41
commit
d7fabb3da8
@ -235,6 +235,7 @@ class Server:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
running = psutil.pid_exists(self.PID)
|
running = psutil.pid_exists(self.PID)
|
||||||
|
logger.info("Checking if PID: {} is running".format(self.PID))
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Unable to find if server PID exists: {}".format(self.PID))
|
logger.error("Unable to find if server PID exists: {}".format(self.PID))
|
||||||
|
@ -113,10 +113,10 @@ class PanelHandler(BaseHandler):
|
|||||||
executable = self.get_argument('executable', None)
|
executable = self.get_argument('executable', None)
|
||||||
execution_command = self.get_argument('execution_command', None)
|
execution_command = self.get_argument('execution_command', None)
|
||||||
stop_command = self.get_argument('stop_command', None)
|
stop_command = self.get_argument('stop_command', None)
|
||||||
auto_start_delay = self.get_argument('auto_start_delay', None)
|
auto_start_delay = self.get_argument('auto_start_delay', '10')
|
||||||
server_port = self.get_argument('server_port', None)
|
server_port = self.get_argument('server_port', None)
|
||||||
auto_start = self.get_argument('auto_start', '0')
|
auto_start = int(float(self.get_argument('auto_start', '0')))
|
||||||
crash_detection = self.get_argument('crash_detection', '0')
|
crash_detection = int(float(self.get_argument('crash_detection', '0')))
|
||||||
subpage = self.get_argument('subpage', None)
|
subpage = self.get_argument('subpage', None)
|
||||||
|
|
||||||
if server_id is None:
|
if server_id is None:
|
||||||
@ -143,4 +143,11 @@ class PanelHandler(BaseHandler):
|
|||||||
Servers.crash_detection: crash_detection,
|
Servers.crash_detection: crash_detection,
|
||||||
}).where(Servers.server_id == server_id).execute()
|
}).where(Servers.server_id == server_id).execute()
|
||||||
|
|
||||||
|
user_data = json.loads(self.get_secure_cookie("user_data"))
|
||||||
|
|
||||||
|
db_helper.add_to_audit_log(user_data['user_id'],
|
||||||
|
"Edited server {} named {}".format(server_id, server_name),
|
||||||
|
server_id,
|
||||||
|
self.get_remote_ip())
|
||||||
|
|
||||||
self.redirect("/panel/server_detail?id={}&subpage=config".format(server_id))
|
self.redirect("/panel/server_detail?id={}&subpage=config".format(server_id))
|
||||||
|
@ -110,23 +110,23 @@
|
|||||||
<div class="form-check-flat">
|
<div class="form-check-flat">
|
||||||
<label for="auto_start" class="form-check-label ml-4 mb-4">
|
<label for="auto_start" class="form-check-label ml-4 mb-4">
|
||||||
{% if data['server_stats'][0]['server_id']['auto_start'] %}
|
{% if data['server_stats'][0]['server_id']['auto_start'] %}
|
||||||
<input type="checkbox" class="form-check-input" id="auto_start" name="auto_start" checked="" >Server Auto Start
|
<input type="checkbox" class="form-check-input" id="auto_start" name="auto_start" checked="" value="1">Server Auto Start
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="checkbox" class="form-check-input" id="auto_start" name="auto_start" >Server Auto Start
|
<input type="checkbox" class="form-check-input" id="auto_start" name="auto_start" value="1">Server Auto Start
|
||||||
{% end %}
|
{% end %}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label for="crash_detection" class="form-check-label ml-4 mb-4">
|
<label for="crash_detection" class="form-check-label ml-4 mb-4">
|
||||||
{% if data['server_stats'][0]['server_id']['auto_start'] %}
|
{% if data['server_stats'][0]['server_id']['crash_detection'] %}
|
||||||
<input type="checkbox" class="form-check-input" id="crash_detection" name="crash_detection" checked="" >Server Crash Detection
|
<input type="checkbox" class="form-check-input" id="crash_detection" name="crash_detection" checked="" value="1">Server Crash Detection
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="checkbox" class="form-check-input" id="crash_detection" name="crash_detection" >Server Crash Detection
|
<input type="checkbox" class="form-check-input" id="crash_detection" name="crash_detection" value="1" >Server Crash Detection
|
||||||
{% end %}
|
{% end %}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="submit" class="btn btn-success mr-2">Submit</button>
|
<button type="submit" class="btn btn-success mr-2">Save</button>
|
||||||
<button type="reset" class="btn btn-light">Cancel</button>
|
<button type="reset" class="btn btn-light">Cancel</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@ -151,10 +151,17 @@
|
|||||||
sudo chown crafty:crafty /path/to/your/server -R<br />
|
sudo chown crafty:crafty /path/to/your/server -R<br />
|
||||||
sudo chmod 2775 /path/to/your/server -R<br />
|
sudo chmod 2775 /path/to/your/server -R<br />
|
||||||
</code>
|
</code>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="text-center">
|
||||||
|
{% if data['server_stats'][0]['running'] %}
|
||||||
|
<a href="/panel/command" class="btn btn-sm btn-danger disabled">Delete Server</a><br />
|
||||||
|
<small>Please stop the server before deleting it</small>
|
||||||
|
{% else %}
|
||||||
|
<a class="btn btn-sm btn-danger">Delete Server</a>
|
||||||
|
{% end %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -165,6 +172,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- content-wrapper ends -->
|
<!-- content-wrapper ends -->
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"cookie_secret": "random",
|
"cookie_secret": "random",
|
||||||
"show_errors": true,
|
"show_errors": true,
|
||||||
"history_max_age": 7,
|
"history_max_age": 7,
|
||||||
"stats_update_frequency": 60,
|
"stats_update_frequency": 30,
|
||||||
"max_stats_count": 1000,
|
"max_stats_count": 1000,
|
||||||
"delete_default_json": false,
|
"delete_default_json": false,
|
||||||
"show_contribute_link": true,
|
"show_contribute_link": true,
|
||||||
|
Loading…
Reference in New Issue
Block a user