kopia lustrzana https://github.com/cyoung/stratux
Add "System Errors" to main status page.
rodzic
ac5a054e7d
commit
e356194eb2
|
@ -1058,7 +1058,7 @@ type status struct {
|
||||||
NetworkDataMessagesSentNonqueueableLastSec uint64
|
NetworkDataMessagesSentNonqueueableLastSec uint64
|
||||||
NetworkDataBytesSentLastSec uint64
|
NetworkDataBytesSentLastSec uint64
|
||||||
NetworkDataBytesSentNonqueueableLastSec uint64
|
NetworkDataBytesSentNonqueueableLastSec uint64
|
||||||
Errors []error
|
Errors []string
|
||||||
}
|
}
|
||||||
|
|
||||||
var globalSettings settings
|
var globalSettings settings
|
||||||
|
@ -1106,7 +1106,7 @@ func readSettings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func addSystemError(err error) {
|
func addSystemError(err error) {
|
||||||
globalStatus.Errors = append(globalStatus.Errors, err)
|
globalStatus.Errors = append(globalStatus.Errors, err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
func saveSettings() {
|
func saveSettings() {
|
||||||
|
@ -1303,6 +1303,14 @@ func main() {
|
||||||
|
|
||||||
stratuxClock = NewMonotonic() // Start our "stratux clock".
|
stratuxClock = NewMonotonic() // Start our "stratux clock".
|
||||||
|
|
||||||
|
// Set up status.
|
||||||
|
globalStatus.Version = stratuxVersion
|
||||||
|
globalStatus.Build = stratuxBuild
|
||||||
|
globalStatus.Errors = make([]string, 0)
|
||||||
|
if _, err := os.Stat("/etc/FlightBox"); !os.IsNotExist(err) {
|
||||||
|
globalStatus.HardwareBuild = "FlightBox"
|
||||||
|
}
|
||||||
|
|
||||||
// replayESFilename := flag.String("eslog", "none", "ES Log filename")
|
// replayESFilename := flag.String("eslog", "none", "ES Log filename")
|
||||||
replayUATFilename := flag.String("uatlog", "none", "UAT Log filename")
|
replayUATFilename := flag.String("uatlog", "none", "UAT Log filename")
|
||||||
develFlag := flag.Bool("developer", false, "Developer mode")
|
develFlag := flag.Bool("developer", false, "Developer mode")
|
||||||
|
@ -1343,14 +1351,7 @@ func main() {
|
||||||
sdrInit()
|
sdrInit()
|
||||||
initTraffic()
|
initTraffic()
|
||||||
|
|
||||||
// Set up status/settings.
|
// Read settings.
|
||||||
globalStatus.Version = stratuxVersion
|
|
||||||
globalStatus.Build = stratuxBuild
|
|
||||||
globalStatus.Errors = make([]error, 0)
|
|
||||||
if _, err := os.Stat("/etc/FlightBox"); !os.IsNotExist(err) {
|
|
||||||
globalStatus.HardwareBuild = "FlightBox"
|
|
||||||
}
|
|
||||||
|
|
||||||
readSettings()
|
readSettings()
|
||||||
|
|
||||||
// Disable replay logs when replaying - so that messages replay data isn't copied into the logs.
|
// Disable replay logs when replaying - so that messages replay data isn't copied into the logs.
|
||||||
|
|
|
@ -61,7 +61,12 @@ function StatusCtrl($rootScope, $scope, $state, $http, $interval) {
|
||||||
var tempLocalClock = new Date;
|
var tempLocalClock = new Date;
|
||||||
$scope.LocalClock = tempLocalClock.toUTCString();
|
$scope.LocalClock = tempLocalClock.toUTCString();
|
||||||
$scope.SecondsFast = (Math.round(tempClock-tempLocalClock)/1000).toFixed(2);
|
$scope.SecondsFast = (Math.round(tempClock-tempLocalClock)/1000).toFixed(2);
|
||||||
|
|
||||||
|
// Errors array.
|
||||||
|
if (status.Errors.length > 0) {
|
||||||
|
$scope.visible_errors = true;
|
||||||
|
$scope.Errors = status.Errors;
|
||||||
|
}
|
||||||
|
|
||||||
var uptime = status.Uptime;
|
var uptime = status.Uptime;
|
||||||
if (uptime != undefined) {
|
if (uptime != undefined) {
|
||||||
|
|
|
@ -3,6 +3,16 @@
|
||||||
<p><strong>Version: <span>{{Version}} ({{Build}})</span></strong></p>
|
<p><strong>Version: <span>{{Version}} ({{Build}})</span></strong></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading" ng-class="{'section_invisible': !visible_errors}">
|
||||||
|
<span class="panel_label">Errors</span>
|
||||||
|
</div>
|
||||||
|
<div class="panel-body" ng-class="{'section_invisible': !visible_errors}">
|
||||||
|
<ul>
|
||||||
|
<li ng-repeat="err in Errors">
|
||||||
|
<font style="background-color: #FF0000">{{err}}</font>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<span class="panel_label">Status</span>
|
<span class="panel_label">Status</span>
|
||||||
<span ng-show="ConnectState == 'Connected'" class="label label-success">{{ConnectState}}</span>
|
<span ng-show="ConnectState == 'Connected'" class="label label-success">{{ConnectState}}</span>
|
||||||
|
|
Ładowanie…
Reference in New Issue