Skip to content

Commit 0c92120

Browse files
committed
feat(subscr): add number of nodes nad uis to api
1 parent be7ec59 commit 0c92120

5 files changed

Lines changed: 29 additions & 1 deletion

File tree

db/Store.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ type UserManager interface {
241241
GetUser(userID int) (User, error)
242242
GetUserByLoginOrEmail(login string, email string) (User, error)
243243
GetAllAdmins() ([]User, error)
244+
245+
GetNodeCount() (int, error)
246+
GetUiCount() (int, error)
244247
}
245248

246249
// ProjectStore handles project-related operations

db/bolt/task.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,11 @@ func (d *BoltDb) GetTaskStageResult(projectID int, taskID int, stageID int) (res
293293
func (d *BoltDb) GetTaskStageOutputs(projectID int, taskID int, stageID int) (res []db.TaskOutput, err error) {
294294
return
295295
}
296+
297+
func (d *BoltDb) GetNodeCount() (int, error) {
298+
return 0, nil
299+
}
300+
301+
func (d *BoltDb) GetUiCount() (int, error) {
302+
return 1, nil
303+
}

db/sql/task.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,3 +384,11 @@ func (d *SqlDb) GetTaskStageOutputs(projectID int, taskID int, stageID int) (out
384384
_, err = d.selectAll(&output, query, args...)
385385
return
386386
}
387+
388+
func (d *SqlDb) GetNodeCount() (int, error) {
389+
return 0, nil
390+
}
391+
392+
func (d *SqlDb) GetUiCount() (int, error) {
393+
return 1, nil
394+
}

pro_interfaces/subscription_svc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ type SubscriptionToken struct {
1010
Users int `json:"users"`
1111
ExpiresAt time.Time `json:"expiresAt"`
1212
Nodes int `json:"nodes,omitempty"`
13+
UIs int `json:"uis,omitempty"`
1314
}
1415

1516
func (t *SubscriptionToken) Validate() error {

web/src/components/SubscriptionForm.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
<v-list-item-content>
126126
<v-list-item-title>Nodes</v-list-item-title>
127127
<v-list-item-subtitle>
128-
{{ item.nodes }}
128+
{{ item.nodes_used }} / {{ item.nodes }}
129129
</v-list-item-subtitle>
130130
</v-list-item-content>
131131
</v-list-item>
@@ -173,6 +173,14 @@
173173
</v-list-item-subtitle>
174174
</v-list-item-content>
175175
</v-list-item>
176+
<v-list-item class="pa-0" v-if="item.uis">
177+
<v-list-item-content>
178+
<v-list-item-title>UIs</v-list-item-title>
179+
<v-list-item-subtitle>
180+
{{ item.uis_used }} / {{ item.uis }}
181+
</v-list-item-subtitle>
182+
</v-list-item-content>
183+
</v-list-item>
176184
</v-list>
177185
</v-col>
178186
</v-row>

0 commit comments

Comments
 (0)