forked from jjclark1982/factorio-control-panel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.pug
182 lines (172 loc) · 7.39 KB
/
admin.pug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
- title = "Factorio Server Control Panel for " + parsedConfig.name + "!"
doctype html
html
head
meta(charset="utf-8")
title= title
link(rel='stylesheet' href='static/pure.css')
link(rel='stylesheet' href='static/main.css')
body
.container
h1= title
.pure-g
.pure-u-1-3
.pane
h3 Mods
- if (mods.length == 0)
p
i None
- else
ul
each mod in mods
li
a(href=mod.path)= mod.stem
form.pure-form.pure-form-stacked(method="POST" action="transload-mod")
fieldset
legend Install a mod
label URL:
input(type="text" name="fileURL")
br
button(type="submit") Transload
form.pure-form.pure-form-stacked(method="POST" action="mods" enctype="multipart/form-data")
fieldset
legend Upload a mod
input(type="file" name="file")
br
button(type="submit") Upload
.pure-u-1-3
.pane
h3 Saved Games
- if (saves.length == 0)
p
i None
- else
ul
each save in saves
li
a(href=save.path)= save.stem
time(datetime=save.stat.mtime)= '('+moment(save.stat.mtime).fromNow()+')'
form.pure-form.pure-form-stacked(method="POST" action="create-save")
fieldset
legend Create new save file
label Name:
input(type="text" name="saveName")
br
button(type="submit") Create
form.pure-form.pure-form-stacked(method="POST" action="saves" enctype="multipart/form-data")
fieldset
legend Upload a save file
input(type="file" name="file")
br
button(type="submit") Upload
.pure-u-1-3
.pane
h3 Game Server
- if (runningServer)
form.pure-form.pure-form-stacked(method="POST" action="stop-server")
fieldset
legend Server is Running
p= " UDP port "+runningServer.port
p Started
time(datetime=runningServer.startDate)= moment(runningServer.startDate).fromNow()
button(type="submit") Stop
form.pure-form.pure-form-stacked(method="POST" action="console-command")
fieldset
label Send console command:
input(type="text" name="command")
br
button(type="submit") Send
- else
form.pure-form.pure-form-stacked(method="POST" action="start-server")
fieldset
legend Server is not running
label Save file:
select(name='saveName')
each save in saves
option(value=save.stem)= save.stem
br
label Latency (ms):
input(type="text" name="latencyMS")
br
label Autosave Interval (minutes):
input(type="text" name="autosaveInterval" placeholder="2")
br
label Autosave Slots:
input(type="text" name="autosaveSlots" placeholder="3")
br
label
input(type="text" name="configfile" placeholder="server-settings.example.json")
br
label Port:
input(type="number" name="port" placeholder="34197")
br
label
input(type="checkbox" name="peerToPeer")
| Use Peer-to-Peer
label
input(type="checkbox" name="noAutoPause")
| No Auto-pause
br
button(type="submit") Start Server
.pure-u-1-3
.pane
h3 Game Settings
- if (runningServer)
| please stop the server before editing settings
- else
form.pure-form.pure-form-stacked(method="POST" action="save-settings")
fieldset
label Server Name
input(type="text" name="serverName" value=parsedConfig.name)
br
label Server Description
input(type="text" name="serverDescription" value=parsedConfig.description)
br
label Tags, Seperate with commas
input(type="text" name="serverTags" value=parsedConfig.tags)
br
label Max players (0 for unlimited)
input(type="number" name="serverMaxPlayers" min="0" value=parsedConfig.max_players)
br
h4(style="float: left; text-align: left") Visablity
br
br
br
br
label Public
input(type="checkbox" name="serverVisablityPublic" checked=parsedConfig.visibility.public)
br
label LAN
input(type="checkbox" name="serverVisablityLAN" checked=parsedConfig.visibility.lan)
br
h4(style="float: left; text-align: left") Your factorio.com login credentials. Required for games with visibility public
br
label Username
input(type="text" name="serverUsername" value=parsedConfig.username)
br
label Password
input(type="password" name="serverPassword" value=parsedConfig.password)
br
label Token (used instead of a password and username)
input(type="text" name="serverToken" value=parsedConfig.token)
br
label Game Password
input(type="password" name="serverGamePassword" value=parsedConfig.game_password)
br
label Required user verification
input(type="checkbox" name="serverUserVerification" checked=parsedConfig.require_user_verification)
br
label Max Upload in KB/s (0 for unlimited)
input(type="number" name="serverMaxUpload" value=parsedConfig.max_upload_in_kilobytes_per_second)
br
label Minimum latency in ticks (1 tick = 16ms, 0 for unlimited)
input(type="number" name="serverMinTick" value=parsedConfig.minimum_latency_in_ticks)
br
label Ignore player limit for returning players
input(type="checkbox" name="serverIgnoreRetuningPlayers" checked=parsedConfig.ignore_player_limit_for_returning_players)
br
label Allow Commands
select(name=serverAllowCommands value=parsedConfig.allow_commands)
option false
option admins-only
option true