mirror of
https://github.com/hrfee/jfa-go.git
synced 2025-04-18 00:52:52 +00:00
Compare commits
No commits in common. "f5f2a0f1904c0077b60dd2969fa57b18539cd0db" and "67c36dd30134c72a69a3abe7067fca62df0dc7da" have entirely different histories.
f5f2a0f190
...
67c36dd301
@ -37,8 +37,6 @@ archives:
|
|||||||
amd64: x86_64
|
amd64: x86_64
|
||||||
files:
|
files:
|
||||||
- data/*
|
- data/*
|
||||||
- data/templates/*
|
|
||||||
- data/static/*
|
|
||||||
checksum:
|
checksum:
|
||||||
name_template: 'checksums.txt'
|
name_template: 'checksums.txt'
|
||||||
snapshot:
|
snapshot:
|
||||||
|
@ -1120,10 +1120,7 @@ document.getElementById('settingsSave').onclick = function() {
|
|||||||
}
|
}
|
||||||
if (restart_setting_changed) {
|
if (restart_setting_changed) {
|
||||||
document.getElementById('applyRestarts').onclick = function(){ sendConfig('restartModal'); };
|
document.getElementById('applyRestarts').onclick = function(){ sendConfig('restartModal'); };
|
||||||
let restartButton = document.getElementById('applyAndRestart')
|
document.getElementById('applyAndRestart').onclick = function(){ sendConfig('restartModal', restart=true); };
|
||||||
if (restartButton) {
|
|
||||||
restartButton.onclick = function(){ sendConfig('restartModal', restart=true); };
|
|
||||||
}
|
|
||||||
settingsModal.hide();
|
settingsModal.hide();
|
||||||
restartModal.show();
|
restartModal.show();
|
||||||
} else if (settings_changed) {
|
} else if (settings_changed) {
|
||||||
|
@ -269,15 +269,6 @@
|
|||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title">Warning</h5>
|
<h5 class="modal-title">Warning</h5>
|
||||||
</div>
|
</div>
|
||||||
{{ if .windows }}
|
|
||||||
<div class="modal-body">
|
|
||||||
<p>A restart is needed to apply some settings. Self-restarts aren't possible on Windows, so you must restart manually.</p>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-light" data-dismiss="modal">Cancel</button>
|
|
||||||
<button type="button" class="btn btn-secondary" id="applyRestarts" data-dismiss="modal">Apply, Restart manually</button>
|
|
||||||
</div>
|
|
||||||
{{ else }}
|
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p>A restart is needed to apply some settings. Restart now, later, or cancel?</p>
|
<p>A restart is needed to apply some settings. Restart now, later, or cancel?</p>
|
||||||
</div>
|
</div>
|
||||||
@ -286,7 +277,6 @@
|
|||||||
<button type="button" class="btn btn-secondary" id="applyRestarts" data-dismiss="modal">Apply, Restart later</button>
|
<button type="button" class="btn btn-secondary" id="applyRestarts" data-dismiss="modal">Apply, Restart later</button>
|
||||||
<button type="button" class="btn btn-primary" id="applyAndRestart" data-dismiss="modal">Apply & Restart</button>
|
<button type="button" class="btn btn-primary" id="applyAndRestart" data-dismiss="modal">Apply & Restart</button>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -359,11 +359,7 @@
|
|||||||
<div class="card-body text-center">
|
<div class="card-body text-center">
|
||||||
<h5 class="card-title">Finished!</h5>
|
<h5 class="card-title">Finished!</h5>
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
{{ if .windows }}
|
|
||||||
Press the button below to submit your settings. Unfortunately you're running on Windows, so jfa-go <a href="https://github.com/golang/go/issues/30662">cannot restart itself.</a> You will manually have to restart.
|
|
||||||
{{ else }}
|
|
||||||
Press the button below to submit your settings. The program will restart. Once it's done, refresh this page.
|
Press the button below to submit your settings. The program will restart. Once it's done, refresh this page.
|
||||||
{{ end }}
|
|
||||||
</p>
|
</p>
|
||||||
<button id="submitButton" class="btn btn-primary">Submit</button>
|
<button id="submitButton" class="btn btn-primary">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
|
11
main.go
11
main.go
@ -14,7 +14,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-contrib/pprof"
|
"github.com/gin-contrib/pprof"
|
||||||
@ -96,8 +95,6 @@ func setGinLogger(router *gin.Engine, debugMode bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var PLATFORM string = runtime.GOOS
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Printf("jfa-go version: %s (%s)\n", VERSION, COMMIT)
|
fmt.Printf("jfa-go version: %s (%s)\n", VERSION, COMMIT)
|
||||||
// app encompasses essentially all useful functions.
|
// app encompasses essentially all useful functions.
|
||||||
@ -365,14 +362,8 @@ func main() {
|
|||||||
}
|
}
|
||||||
app.info.Printf("Starting router @ %s", address)
|
app.info.Printf("Starting router @ %s", address)
|
||||||
} else {
|
} else {
|
||||||
windows := false
|
|
||||||
if PLATFORM == "windows" {
|
|
||||||
windows = true
|
|
||||||
}
|
|
||||||
router.GET("/", func(gc *gin.Context) {
|
router.GET("/", func(gc *gin.Context) {
|
||||||
gc.HTML(200, "setup.html", gin.H{
|
gc.HTML(200, "setup.html", gin.H{})
|
||||||
"windows": windows,
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
router.POST("/testJF", app.TestJF)
|
router.POST("/testJF", app.TestJF)
|
||||||
router.POST("/modifyConfig", app.ModifyConfig)
|
router.POST("/modifyConfig", app.ModifyConfig)
|
||||||
|
5
views.go
5
views.go
@ -11,10 +11,6 @@ func (app *appContext) AdminPage(gc *gin.Context) {
|
|||||||
emailEnabled, _ := app.config.Section("invite_emails").Key("enabled").Bool()
|
emailEnabled, _ := app.config.Section("invite_emails").Key("enabled").Bool()
|
||||||
notificationsEnabled, _ := app.config.Section("notifications").Key("enabled").Bool()
|
notificationsEnabled, _ := app.config.Section("notifications").Key("enabled").Bool()
|
||||||
ombiEnabled := app.config.Section("ombi").Key("enabled").MustBool(false)
|
ombiEnabled := app.config.Section("ombi").Key("enabled").MustBool(false)
|
||||||
windows := false
|
|
||||||
if PLATFORM == "windows" {
|
|
||||||
windows = true
|
|
||||||
}
|
|
||||||
gc.HTML(http.StatusOK, "admin.html", gin.H{
|
gc.HTML(http.StatusOK, "admin.html", gin.H{
|
||||||
"bs5": bs5,
|
"bs5": bs5,
|
||||||
"cssFile": app.cssFile,
|
"cssFile": app.cssFile,
|
||||||
@ -24,7 +20,6 @@ func (app *appContext) AdminPage(gc *gin.Context) {
|
|||||||
"version": VERSION,
|
"version": VERSION,
|
||||||
"commit": COMMIT,
|
"commit": COMMIT,
|
||||||
"ombiEnabled": ombiEnabled,
|
"ombiEnabled": ombiEnabled,
|
||||||
"windows": windows,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user