Skip to content

Commit 4daa69c

Browse files
feat: Refactor screenshot configuration layout and improve readability in Edit view
1 parent d239005 commit 4daa69c

2 files changed

Lines changed: 47 additions & 37 deletions

File tree

src/XtremeIdiots.Portal.Web/Views/GameServers/ConfigurationSections/_ScreenshotsConfiguration.cshtml

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,53 @@
22
@model GameServerEditViewModel
33

44
<div class="ibox">
5-
<div class="ibox-title"><h5>Screenshot Monitoring</h5></div>
5+
<div class="ibox-title">
6+
<h5>Screenshot Monitoring</h5>
7+
</div>
68
<div class="ibox-content">
79
<div class="form-check mb-3">
810
<input class="form-check-input" asp-for="ScreenshotConfigEnabled" />
911
<label class="form-check-label" asp-for="ScreenshotConfigEnabled"></label>
10-
<small class="form-text text-muted d-block">Enable agent-side screenshot discovery and upload for this server.</small>
11-
</div>
12-
13-
<div class="mb-3">
14-
<label asp-for="ScreenshotConfigDirectoryPath" class="form-label"></label>
15-
<div class="input-group">
16-
<input asp-for="ScreenshotConfigDirectoryPath" class="form-control" id="ScreenshotConfigDirectoryPath" />
17-
@if (Model.GameServer.FileTransportEnabled && Model.CanEditFileTransport)
18-
{
19-
<button class="btn btn-outline-secondary" type="button"
20-
onclick="openFileTransportBrowser('@Model.GameServer.GameServerId', 'ScreenshotConfigDirectoryPath', { selectionMode: 'directory', initialPath: document.getElementById('ScreenshotConfigDirectoryPath')?.value || '/' })">
21-
<i class="fa-solid fa-fw fa-folder-open" aria-hidden="true"></i> Browse
22-
</button>
23-
}
12+
<small class="form-text text-muted d-block">Enable agent-side screenshot discovery and upload for this
13+
server.</small>
2414
</div>
25-
<span asp-validation-for="ScreenshotConfigDirectoryPath" class="text-danger"></span>
26-
<small class="form-text text-muted">Remote directory the agent scans for new screenshots when monitoring is enabled.</small>
27-
</div>
2815

29-
<div class="mb-3">
30-
<label asp-for="ScreenshotConfigFilePattern" class="form-label"></label>
31-
<input asp-for="ScreenshotConfigFilePattern" class="form-control" placeholder="@GameServerEditViewModel.DefaultScreenshotFilePattern" />
32-
<span asp-validation-for="ScreenshotConfigFilePattern" class="text-danger"></span>
33-
<small class="form-text text-muted">Optional glob pattern. Leave empty to use @GameServerEditViewModel.DefaultScreenshotFilePattern.</small>
34-
</div>
16+
<div class="mb-3">
17+
<label asp-for="ScreenshotConfigDirectoryPath" class="form-label"></label>
18+
<div class="input-group">
19+
<input asp-for="ScreenshotConfigDirectoryPath" class="form-control"
20+
id="ScreenshotConfigDirectoryPath" />
21+
@if (Model.GameServer.FileTransportEnabled && Model.CanEditFileTransport)
22+
{
23+
<button class="btn btn-outline-secondary" type="button"
24+
onclick="openFileTransportBrowser('@Model.GameServer.GameServerId', 'ScreenshotConfigDirectoryPath', { selectionMode: 'directory', initialPath: document.getElementById('ScreenshotConfigDirectoryPath')?.value || '/' })">
25+
<i class="fa-solid fa-fw fa-folder-open" aria-hidden="true"></i> Browse
26+
</button>
27+
}
28+
</div>
29+
<span asp-validation-for="ScreenshotConfigDirectoryPath" class="text-danger"></span>
30+
<small class="form-text text-muted">Remote directory the agent scans for new screenshots when monitoring is
31+
enabled.</small>
32+
</div>
3533

36-
<div class="mb-3">
37-
<label asp-for="ScreenshotConfigPollIntervalSeconds" class="form-label"></label>
38-
<input asp-for="ScreenshotConfigPollIntervalSeconds" class="form-control" type="number"
39-
min="@GameServerEditViewModel.MinScreenshotPollIntervalSeconds"
40-
max="@GameServerEditViewModel.MaxScreenshotPollIntervalSeconds" />
41-
<span asp-validation-for="ScreenshotConfigPollIntervalSeconds" class="text-danger"></span>
42-
<small class="form-text text-muted">How often the agent checks for new screenshots. Allowed range: @GameServerEditViewModel.MinScreenshotPollIntervalSeconds to @GameServerEditViewModel.MaxScreenshotPollIntervalSeconds seconds.</small>
43-
</div>
44-
</div>
45-
</div>
34+
<div class="mb-3">
35+
<label asp-for="ScreenshotConfigFilePattern" class="form-label"></label>
36+
<input asp-for="ScreenshotConfigFilePattern" class="form-control"
37+
placeholder="@GameServerEditViewModel.DefaultScreenshotFilePattern" />
38+
<span asp-validation-for="ScreenshotConfigFilePattern" class="text-danger"></span>
39+
<small class="form-text text-muted">Optional glob pattern. Leave empty to use
40+
@GameServerEditViewModel.DefaultScreenshotFilePattern.</small>
41+
</div>
42+
43+
<div class="mb-3">
44+
<label asp-for="ScreenshotConfigPollIntervalSeconds" class="form-label"></label>
45+
<input asp-for="ScreenshotConfigPollIntervalSeconds" class="form-control" type="number"
46+
min="@GameServerEditViewModel.MinScreenshotPollIntervalSeconds"
47+
max="@GameServerEditViewModel.MaxScreenshotPollIntervalSeconds" />
48+
<span asp-validation-for="ScreenshotConfigPollIntervalSeconds" class="text-danger"></span>
49+
<small class="form-text text-muted">How often the agent checks for new screenshots. Allowed range:
50+
@GameServerEditViewModel.MinScreenshotPollIntervalSeconds to
51+
@GameServerEditViewModel.MaxScreenshotPollIntervalSeconds seconds.</small>
52+
</div>
53+
</div>
54+
</div>

src/XtremeIdiots.Portal.Web/Views/GameServers/Edit.cshtml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
</li>
6363
<li class="nav-item" role="presentation" id="funny-messages-tab-item">
6464
<button class="nav-link" id="funny-messages-tab-btn" data-bs-toggle="tab"
65-
data-bs-target="#funny-messages-tab" type="button" role="tab" aria-controls="funny-messages-tab"
66-
aria-selected="false">Funny Messages</button>
65+
data-bs-target="#funny-messages-tab" type="button" role="tab"
66+
aria-controls="funny-messages-tab" aria-selected="false">Funny Messages</button>
6767
</li>
6868
<li class="nav-item" role="presentation" id="moderation-tab-item">
6969
<button class="nav-link" id="moderation-tab-btn" data-bs-toggle="tab"
@@ -118,7 +118,8 @@
118118

119119
@if (Model.CanConfigureScreenshots)
120120
{
121-
<div class="tab-pane fade" id="screenshots-config-tab" role="tabpanel" aria-labelledby="screenshots-config-tab-btn">
121+
<div class="tab-pane fade" id="screenshots-config-tab" role="tabpanel"
122+
aria-labelledby="screenshots-config-tab-btn">
122123
@await Html.PartialAsync("ConfigurationSections/_ScreenshotsConfiguration", Model)
123124
</div>
124125
}

0 commit comments

Comments
 (0)