Add possibility to provide version (#46)
This commit is contained in:
1 parent
44b236e2ef
commit
20b93f42d4
17 files changed
+122
-4
No files matched your search
@@ -267,6 +267,15 @@ p {
|
||||
.filterformcontainer {
|
||||
text-align: center;
|
||||
}
|
||||
.introtext {
|
||||
margin-bottom: 30px;
|
||||
color: black;
|
||||
font-size: 20px;
|
||||
}
|
||||
.admintextblock {
|
||||
margin-top: 16px;
|
||||
color: black;
|
||||
}
|
||||
@media (max-width: 991px) {
|
||||
.icons.oneback {
|
||||
margin-left: 113px;
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
LM "github.com/SommerEngineering/Ocean/Log/Meta"
|
||||
"github.com/SommerEngineering/Ocean/MimeTypes"
|
||||
"github.com/SommerEngineering/Ocean/Shutdown"
|
||||
"github.com/SommerEngineering/Ocean/System/Version"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -17,9 +18,13 @@ func HandlerOverview(response http.ResponseWriter, request *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// Get the data ready:
|
||||
data := AdminWebOverview{}
|
||||
data.Version = Version.GetVersion()
|
||||
|
||||
// Write the MIME type and execute the template:
|
||||
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebHTML)
|
||||
if executeError := AdminTemplates.ExecuteTemplate(response, `Overview`, nil); executeError != nil {
|
||||
if executeError := AdminTemplates.ExecuteTemplate(response, `Overview`, data); executeError != nil {
|
||||
Log.LogFull(senderName, LM.CategorySYSTEM, LM.LevelERROR, LM.SeverityCritical, LM.ImpactCritical, LM.MessageNameEXECUTE, `Was not able to execute the admin's overview template.`, executeError.Error())
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,12 @@ import (
|
||||
"github.com/SommerEngineering/Ocean/ConfigurationDB"
|
||||
)
|
||||
|
||||
// Data for the admin's configuration management site
|
||||
type AdminWebConfiguration struct {
|
||||
Configuration []ConfigurationDB.ConfigurationDBEntry
|
||||
}
|
||||
|
||||
// Data for the admin's overview i.e. dashboard
|
||||
type AdminWebOverview struct {
|
||||
Version string
|
||||
}
|
||||
@@ -29,6 +29,7 @@ var Overview = `
|
||||
<div class="w-col w-col-4"><a class="button adminbutton" href="/configuration">Configuration</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="admintextblock">The current Ocean's version is: {{.Version}}</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="/admin/js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/admin/js/webflow.js"></script>
|
||||
|
||||
Reference in new issue
Block a user