-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add simple cover image to README.md * Add docs for widget creation * Restyle dashboard
- Loading branch information
Showing
20 changed files
with
201 additions
and
98 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
# WG Display | ||
|
||
[](https://github.com/eliabieri/wg_display/actions/workflows/cargo_test.yml) | ||
#### All that goes on in your city at one glance. Extensible, open-source and connected to the local community. | ||
|
||
## All that goes on in your city at one glance | ||
|
||
## Extensible, open-source and connected to the local community | ||
|
||
 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
pub mod models; | ||
pub mod widgets; | ||
pub mod widget_meta_data; |
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,30 @@ | ||
#[derive(PartialEq, Clone)] | ||
pub enum WidgetMetaData { | ||
Cafete, | ||
Aare, | ||
Time, | ||
Bernaqua, | ||
PublicTransport, | ||
} | ||
|
||
impl WidgetMetaData { | ||
pub fn name(&self) -> &'static str { | ||
match self { | ||
WidgetMetaData::Cafete => "Cafete", | ||
WidgetMetaData::Aare => "Aare", | ||
WidgetMetaData::Time => "Time", | ||
WidgetMetaData::Bernaqua => "Bernaqua", | ||
WidgetMetaData::PublicTransport => "Next departure", | ||
} | ||
} | ||
|
||
pub fn description(&self) -> &'static str { | ||
match self { | ||
WidgetMetaData::Cafete => "Events happening at the Cafete Club in Bern", | ||
WidgetMetaData::Aare => "The temperature of the Aare river in Bern", | ||
WidgetMetaData::Time => "The current time", | ||
WidgetMetaData::Bernaqua => "Occupancy of the Bernaqua facilities", | ||
WidgetMetaData::PublicTransport => "Next public transport departures", | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,18 @@ | ||
# Writing a new widget | ||
|
||
## What is a widget | ||
|
||
A widget represents an information displayed on the display. | ||
It has a name and a corresponding value, that is updated dinamically. | ||
Additionally, a widget consumes a configuration, that is entered by the user via the dashboard. | ||
|
||
## What is needed to build a widget | ||
|
||
- A Yew component that visualizes the configuration options in the dashboard. | ||
- An implementation of the `Widget` trait. In here, the value of the widget is fetched or computed. | ||
|
||
```text | ||
💡 Simple widgets can use the DefaultWidgetConfig component, that only allows for the widget to be enabled or disabled | ||
``` | ||
|
||
## Learning by example |
Oops, something went wrong.