Skip to content

Commit 0d07b53

Browse files
committed
Improved config settings pages from Housekeeping (System status)
1 parent df02ed4 commit 0d07b53

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

Havana-Web/src/main/java/org/alexdev/http/controllers/housekeeping/HousekeepingCommandsController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public static void kickuser(WebConnection client) {
267267

268268
}});
269269

270-
boolean dbInsertSuccess = HousekeepingCommandsDao.insertRconLog("REMOTE_KICK", user, moderator,message);
270+
boolean dbInsertSuccess = HousekeepingCommandsDao.insertRconLog("REMOTE_KICK", user, moderator, message);
271271

272272
if (dbInsertSuccess) {
273273
client.session().set("alertColour", "success");

Havana-Web/src/main/java/org/alexdev/http/controllers/housekeeping/HousekeepingConfigController.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class HousekeepingConfigController {
2323
*/
2424
public static void configurations(WebConnection client) {
2525
if (!client.session().getBoolean(SessionUtil.LOGGED_IN_HOUSKEEPING)) {
26-
client.redirect("/" + Routes.HOUSEKEEPING_PATH);
26+
client.redirect("/" + Routes.HOUSEKEEPING_DEFAULT_PATH);
2727
return;
2828
}
2929

@@ -33,13 +33,12 @@ public static void configurations(WebConnection client) {
3333
PlayerDetails playerDetails = (PlayerDetails) tpl.get("playerDetails");
3434

3535
if (!HousekeepingManager.getInstance().hasPermission(playerDetails.getRank(), "configuration")) {
36-
client.redirect("/" + Routes.HOUSEKEEPING_PATH);
36+
client.redirect("/" + Routes.HOUSEKEEPING_PATH + "/permissions");
3737
return;
3838
}
3939

4040
if (client.post().queries().size() > 0) {
4141
SettingsDao.updateSettings(client.post().getValues().entrySet());
42-
4342
// Reload config
4443
// GameConfiguration.getInstance(new WebSettingsConfigWriter());
4544

tools/www-tpl/default-en/housekeeping/system_status/configurations.tpl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
{% set configurationsActive = " active" %}
44
{% include "housekeeping/base/navigation.tpl" %}
55
{% include "housekeeping/base/navigation_system_status.tpl" %}
6-
<!--<h2 class="mt-4">{% if categoryName == "loader" %}Loader{% endif %}{% if categoryName == "maintenance" %}Maintenance{% endif %} settings</h2>
7-
<p>These are the all configurations of the {% if categoryName == "loader" %}loader{% endif %}{% if categoryName == "maintenance" %}maintenance{% endif %}.</p>-->
86
<h2 class="mt-4">{% if CategoryExists %}<text style="text-transform: capitalize;">{{ categoryName }}</text>{% else %}Configuration{% endif %} settings</h2>
97
<p>{% if CategoryExists %}These are the all configurations of the {{ categoryName }}.{% else %}<text style="color:red;">Please select a setting in order to edit them.</text>{% endif %}</p>
108
{% if CategoryExists %}
@@ -21,10 +19,21 @@
2119
<tbody>
2220
{% for settings in configs %}
2321
<tr>
24-
<td>{{ settings.description }}</td>
22+
<td>
23+
<div><b>{{ settings.setting }}</b></div>
24+
<div>{{ settings.description }}</div>
25+
</td>
26+
{% if settings.value == 'true' or settings.value == 'false' %}
27+
<td>
28+
<select name="{{ settings.setting }}" id="searchFor" class="form-control">
29+
<option value="true" {% if settings.value == 'true' %}selected{% endif %}>True (enabled)</option>
30+
<option value="false" {% if settings.value == 'false' %}selected{% endif %}>False (disabled)</option>
31+
</select>
32+
{% else %}
2533
<td>
2634
<input type="text" name="{{ settings.setting }}" class="form-control" id="searchFor" value="{{ settings.value }}">
2735
</td>
36+
{% endif %}
2837
</tr>
2938
{% endfor %}
3039
</tbody>

0 commit comments

Comments
 (0)