-
Notifications
You must be signed in to change notification settings - Fork 788
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0e6743
commit adc9e91
Showing
8 changed files
with
238 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from textual.app import App, ComposeResult | ||
from textual.binding import Binding | ||
from textual.widgets import TabbedContent, DataTable | ||
|
||
|
||
class Dashboard(App): | ||
"""Dashboard""" | ||
|
||
BINDINGS = [ | ||
("d", "toggle_dark", "Toggle dark mode"), | ||
Binding("ctrl+q", "app.quit", "Quit", show=True), | ||
] | ||
TITLE = "Dashboard" | ||
CSS = """ | ||
DataTable { | ||
height: auto; | ||
} | ||
""" | ||
|
||
def compose(self) -> ComposeResult: | ||
"""Create child widgets for the app.""" | ||
with TabbedContent("Workflows"): | ||
yield DataTable(id="table") | ||
|
||
def on_mount(self) -> None: | ||
table = self.query_one(DataTable) | ||
table.add_columns("Id", "Description", "Status", "Result Id") | ||
for row in [(1, 2, 3, 4), ("a", "b", "c", "d"), ("fee", "fy", "fo", "fum")]: | ||
table.add_row(key=row[0], *row) | ||
|
||
|
||
if __name__ == "__main__": | ||
app = Dashboard() | ||
app.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters