Skip to content

Commit

Permalink
Edit scan and timeout on panel page
Browse files Browse the repository at this point in the history
  • Loading branch information
aceberg committed Aug 22, 2023
1 parent d056ba0 commit ad9cd7f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Change Log
All notable changes to this project will be documented in this file.

## [1.0.8] - 2023-08-23
### Changed
- Monospace font in edit board file [Issue #3](https://github.com/aceberg/miniboard/issues/3)
- Edit scan and timeout on panel page

## [1.0.7] - 2023-07-23
### Fixed
- Uptime sort issue
Expand Down
2 changes: 2 additions & 0 deletions internal/web/panels.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ func panelsHandler(w http.ResponseWriter, r *http.Request) {

yaml.Write(AppConfig.YamlPath, AllLinks)
}

http.Redirect(w, r, r.Header.Get("Referer"), 302)
}

guiData.Config = AppConfig
Expand Down
26 changes: 22 additions & 4 deletions internal/web/templates/panel-edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,29 @@
<div class="col">
<h4>Edit panel {{ $key }}</h4>
</div>
<div class="col"></div>
<div class="col">
<a href="/panel_edit/?del={{ $key }}">
<button type="submit" class="btn btn-outline-danger">Delete panel</button>
</a>
<form action="/panels/" class="input-group">
<span class="input-group-text">Scan</span>&nbsp;&nbsp;
<input name="oldkey" type="hidden" value="{{ $key }}">
<input name="key" type="hidden" value="{{ $key }}">
<div class="form-check">
{{ if .Scan }}
<input class="form-check-input" type="checkbox" name="scan" checked>
{{ else }}
<input class="form-check-input" type="checkbox" name="scan">
{{ end }}
</div>
<span class="input-group-text">Timeout</span>
<input name="timeout" type="text" class="form-control" value="{{ .Timeout }}" placeholder="Minutes">
<button type="submit" class="btn btn-outline-success"><i class="bi bi-check2"></i></button>
</form>
</div>
<div class="col">
<div class="d-flex justify-content-end">
<a href="/panel_edit/?del={{ $key }}">
<button type="submit" class="btn btn-outline-danger">Delete panel</button>
</a>
</div>
</div>
</div>
<br>
Expand Down

0 comments on commit ad9cd7f

Please sign in to comment.