Skip to content

Commit

Permalink
bug fixes in UI and history
Browse files Browse the repository at this point in the history
  • Loading branch information
hspaay committed Jul 9, 2024
1 parent ae70fdf commit c75b29e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
9 changes: 6 additions & 3 deletions bindings/hiveoview/src/views/history/historyPage.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
<div
hx-trigger="intersect once"
hx-swap="outerHTML"
hx-get="">reloading page fragment...</div>
{{else}}
hx-get="">reloading page fragment...
</div>

{{else}}

<main class="container-fluid">

Expand All @@ -23,8 +24,10 @@
{{else}}
hx-get="/history/{{.ThingID}}/{{.Key}}?time={{.Timestamp}}"
{{end}}
hx-target="#historyPage"
hx-swap="innerHTML"
class="h-panel container-fluid"
>
>
<ul class="h-grid-table history-header" style="grid-column-gap: 10px; align-items: baseline">
<label for="histDeviceName">History of:</label>
<input id="histDeviceName" readonly
Expand Down
2 changes: 1 addition & 1 deletion bindings/hiveoview/src/views/history/historyTable.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{{range .Values}}
<li>
<div>{{.GetUpdated "WT"}}</div>
<div>{{.DataAsText}} {{$.Aff.Data.Unit}}</div>
<div>{{.DataAsText}} {{$.Aff.Data.UnitSymbol}}</div>
</li>
{{end}}
</ul>
Expand Down
6 changes: 5 additions & 1 deletion bindings/owserver/service/PublishNodeTDs.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ func CreateTDFromNode(node *eds.OneWireNode) (tdoc *thing.TD) {
prop := tdoc.AddProperty(attrID, propType, title, dataType)
unit := attrInfo.Unit
if attr.Unit != "" {
unit, _ = UnitNameVocab[attr.Unit]
unitID, found := UnitNameVocab[attr.Unit]
if found {
unitInfo := vocab.UnitClassesMap[unitID]
unit = unitInfo.Symbol
}
}
prop.Unit = unit
// non-sensors are attributes. Writable attributes are configuration.
Expand Down
4 changes: 3 additions & 1 deletion lib/buckets/CursorCache.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,13 @@ func (cc *CursorCache) GetCursorsByOwner(ownerID string) []*CursorInfo {

// Release releases the cursor and removes the cursor from the tracker
// If a bucket was included it will be closed as well.
func (cc *CursorCache) Release(cursorKey string, clientID string) error {
func (cc *CursorCache) Release(clientID string, cursorKey string) error {
slog.Info("Release", "cursorKey", cursorKey)
cc.mux.Lock()
defer cc.mux.Unlock()
ci, found := cc.cursorsByKey[cursorKey]
if !found {
slog.Error("Release. Cursor not found", "clientID", clientID, "cursorKey", cursorKey)
return nil
}
if ci.OwnerID != clientID {
Expand Down
2 changes: 1 addition & 1 deletion services/history/service/ReadHistory.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (svc *ReadHistory) GetCursor(
return nil, fmt.Errorf("missing thingID")
}
thingAddr := args.ThingID
slog.Debug("GetCursor for bucket: ", "addr", thingAddr)
slog.Info("GetCursor for bucket: ", "addr", thingAddr)
bucket := svc.bucketStore.GetBucket(thingAddr)
cursor, err := bucket.Cursor()
//
Expand Down

0 comments on commit c75b29e

Please sign in to comment.