mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Added server_ip to DB, also removed
max_stats_count as it's not needed
This commit is contained in:
parent
7657b77785
commit
c896a12b17
@ -250,7 +250,7 @@ class Stats:
|
||||
Server_Stats.version: server.get("version", False)
|
||||
}).execute()
|
||||
|
||||
# delete 1 week old data
|
||||
# delete old data
|
||||
max_age = helper.get_setting("history_max_age")
|
||||
now = datetime.datetime.now()
|
||||
last_week = now.day - max_age
|
||||
|
@ -83,6 +83,7 @@ class Servers(BaseModel):
|
||||
auto_start_delay = IntegerField(default=10)
|
||||
crash_detection = BooleanField(default=0)
|
||||
stop_command = CharField(default="stop")
|
||||
server_ip = CharField(default="127.0.0.1")
|
||||
server_port = IntegerField(default=25565)
|
||||
|
||||
class Meta:
|
||||
|
@ -128,6 +128,7 @@ class PanelHandler(BaseHandler):
|
||||
execution_command = self.get_argument('execution_command', None)
|
||||
stop_command = self.get_argument('stop_command', None)
|
||||
auto_start_delay = self.get_argument('auto_start_delay', '10')
|
||||
server_ip = self.get_argument('server_ip', None)
|
||||
server_port = self.get_argument('server_port', None)
|
||||
auto_start = int(float(self.get_argument('auto_start', '0')))
|
||||
crash_detection = int(float(self.get_argument('crash_detection', '0')))
|
||||
@ -152,6 +153,7 @@ class PanelHandler(BaseHandler):
|
||||
Servers.execution_command: execution_command,
|
||||
Servers.stop_command: stop_command,
|
||||
Servers.auto_start_delay: auto_start_delay,
|
||||
Servers.server_ip: server_ip,
|
||||
Servers.server_port: server_port,
|
||||
Servers.auto_start: auto_start,
|
||||
Servers.crash_detection: crash_detection,
|
||||
|
@ -103,7 +103,12 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="server_port">Server Port <small class="text-muted ml-1"> - Port crafty should connect to for stats</small> </label>
|
||||
<label for="server_ip">Server IP <small class="text-muted ml-1"> - IP Crafty should connect to for stats (Try a real ip instead of 127.0.0.1 if you have issues)</small> </label>
|
||||
<input type="text" class="form-control" name="server_ip" id="server_ip" value="{{ data['server_stats'][0]['server_id']['server_ip'] }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="server_port">Server Port <small class="text-muted ml-1"> - Port Crafty should connect to for stats</small> </label>
|
||||
<input type="number" class="form-control" name="server_port" id="server_port" value="{{ data['server_stats'][0]['server_id']['server_port'] }}" step="1" max="65566" min="1" >
|
||||
</div>
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
"show_errors": true,
|
||||
"history_max_age": 7,
|
||||
"stats_update_frequency": 30,
|
||||
"max_stats_count": 1000,
|
||||
"delete_default_json": false,
|
||||
"show_contribute_link": true,
|
||||
"virtual_terminal_lines": 10,
|
||||
|
Loading…
Reference in New Issue
Block a user