Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
clive
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
clive
Commits
40b9b763
Commit
40b9b763
authored
10 months ago
by
Jakub Ziebinski
Browse files
Options
Downloads
Patches
Plain Diff
Add a details button to each account on the dashboard
parent
3e331cd8
No related branches found
No related tags found
2 merge requests
!399
V1.27.5.12 release
,
!367
Implementation of alarm management
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
clive/__private/ui/dashboard/dashboard.scss
+25
-0
25 additions, 0 deletions
clive/__private/ui/dashboard/dashboard.scss
clive/__private/ui/dashboard/dashboard_base.py
+13
-3
13 additions, 3 deletions
clive/__private/ui/dashboard/dashboard_base.py
with
38 additions
and
3 deletions
clive/__private/ui/dashboard/dashboard.scss
+
25
−
0
View file @
40b9b763
...
...
@@ -41,6 +41,31 @@ DashboardBase {
AccountInfo
{
width
:
auto
;
#account-alarms-and-details
{
width
:
auto
;
height
:
auto
;
AlarmDisplay
{
align
:
center
middle
;
width
:
100%
;
}
#account-info-container
{
width
:
auto
;
height
:
1
;
EllipsedStatic
{
width
:
16
;
text-align
:
center
;
}
OneLineButton
{
width
:
9
;
min-width
:
9
;
}
}
}
}
BalanceStats
{
...
...
This diff is collapsed.
Click to expand it.
clive/__private/ui/dashboard/dashboard_base.py
+
13
−
3
View file @
40b9b763
...
...
@@ -2,8 +2,9 @@ from __future__ import annotations
from
typing
import
TYPE_CHECKING
,
ClassVar
,
Final
,
Literal
from
textual
import
on
from
textual.binding
import
Binding
from
textual.containers
import
Container
,
Horizontal
,
ScrollableContainer
from
textual.containers
import
Container
,
Horizontal
,
ScrollableContainer
,
Vertical
from
textual.widgets
import
Label
,
Static
from
clive.__private.core.formatters.data_labels
import
MISSING_API_LABEL
...
...
@@ -14,6 +15,7 @@ from clive.__private.core.formatters.humanize import (
humanize_percent
,
)
from
clive.__private.storage.accounts
import
Account
,
AccountType
,
WorkingAccount
from
clive.__private.ui.account_details.account_details
import
AccountDetails
from
clive.__private.ui.config.config
import
Config
from
clive.__private.ui.get_css
import
get_relative_css_path
from
clive.__private.ui.operations.operations
import
Operations
...
...
@@ -25,6 +27,7 @@ from clive.__private.ui.widgets.clive_widget import CliveWidget
from
clive.__private.ui.widgets.ellipsed_static
import
EllipsedStatic
from
clive.__private.ui.widgets.header
import
AlarmDisplay
from
clive.__private.ui.widgets.no_content_available
import
NoContentAvailable
from
clive.__private.ui.widgets.one_line_button
import
OneLineButton
from
clive.models
import
Asset
if
TYPE_CHECKING
:
...
...
@@ -145,8 +148,11 @@ class ActivityStats(AccountReferencingWidget):
class
AccountInfo
(
Container
,
AccountReferencingWidget
):
def
compose
(
self
)
->
ComposeResult
:
yield
EllipsedStatic
(
f
"
{
self
.
_account
.
name
}
"
)
yield
AlarmDisplay
(
lambda
_
:
[
self
.
_account
],
id_
=
"
account-alarms
"
)
with
Vertical
(
id
=
"
account-alarms-and-details
"
):
with
Horizontal
(
id
=
"
account-info-container
"
):
yield
EllipsedStatic
(
f
"
{
self
.
_account
.
name
}
"
)
yield
OneLineButton
(
"
Details
"
,
id_
=
"
details-button
"
)
yield
AlarmDisplay
(
lambda
_
:
[
self
.
_account
],
id_
=
"
account-alarms
"
)
yield
Static
()
yield
Label
(
"
LAST:
"
)
yield
self
.
create_dynamic_label
(
...
...
@@ -156,6 +162,10 @@ class AccountInfo(Container, AccountReferencingWidget):
lambda
:
f
"
Account update:
{
humanize_datetime
(
self
.
_account
.
data
.
last_account_update
)
}
"
,
)
@on
(
OneLineButton
.
Pressed
,
"
#details-button
"
)
def
push_account_details_screen
(
self
)
->
None
:
self
.
app
.
push_screen
(
AccountDetails
(
self
.
_account
))
class
AccountRow
(
AccountReferencingWidget
):
def
compose
(
self
)
->
ComposeResult
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment