mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Merge branch 'retgits-master'
This commit is contained in:
commit
3aec59b150
87
_site/content/posts/modules/trello.md
Normal file
87
_site/content/posts/modules/trello.md
Normal file
@ -0,0 +1,87 @@
|
||||
---
|
||||
title: "Trello"
|
||||
date: 2018-05-10T10:44:35-07:00
|
||||
draft: false
|
||||
---
|
||||
|
||||
Displays all Trello cards on specified lists.
|
||||
|
||||
<img src="/imgs/modules/trello.png" width="640" height="188" alt="trello screenshot" />
|
||||
|
||||
## Source Code
|
||||
|
||||
```bash
|
||||
wtf/trello/
|
||||
```
|
||||
|
||||
## Required ENV Variables
|
||||
|
||||
<span class="caption">Key:</span> `WTF_TRELLO_APP_KEY` <br />
|
||||
<span class="caption">Value:</span> Your Trello App Key. <br />
|
||||
<span class="caption">Key:</span> `WTF_TRELLO_ACCESS_TOKEN` <br />
|
||||
<span class="caption">Value:</span> Your Trello Access Token. <br />
|
||||
|
||||
_You can get your API key at: trello.com/app-key._
|
||||
|
||||
## Keyboard Commands
|
||||
|
||||
None.
|
||||
|
||||
## Configuration
|
||||
|
||||
### Single Trello List
|
||||
|
||||
```yaml
|
||||
trello:
|
||||
board: Main
|
||||
enabled: true
|
||||
list: "Todo"
|
||||
position:
|
||||
height: 1
|
||||
left: 2
|
||||
top: 0
|
||||
width: 1
|
||||
refreshInterval: 3600
|
||||
username: myname
|
||||
```
|
||||
|
||||
### Multiple Trello Lists
|
||||
|
||||
If you want to monitor multiple Trello lists, use the following
|
||||
configuration (note the difference in `list`):
|
||||
|
||||
```yaml
|
||||
trello:
|
||||
board: Main
|
||||
enabled: true
|
||||
list: ["Todo", "Done"]
|
||||
position:
|
||||
height: 1
|
||||
left: 2
|
||||
top: 0
|
||||
width: 1
|
||||
refreshInterval: 3600
|
||||
username: myname
|
||||
```
|
||||
|
||||
### Attributes
|
||||
|
||||
`board` <br />
|
||||
The name of the Trello board. <br />
|
||||
|
||||
`enabled` <br />
|
||||
Determines whether or not this module is executed and if its data displayed onscreen. <br />
|
||||
Values: `true`, `false`.
|
||||
|
||||
`list` <br />
|
||||
The Trello lists to fetch cards from. <br />
|
||||
|
||||
`refreshInterval` <br />
|
||||
How often, in seconds, this module will update its data. <br />
|
||||
Values: A positive integer, `0..n`.
|
||||
|
||||
`username` <br />
|
||||
Your Trello username. <br />
|
||||
|
||||
`position` <br />
|
||||
Where in the grid this module's widget will be displayed. <br />
|
BIN
_site/static/imgs/modules/todo.png
Normal file
BIN
_site/static/imgs/modules/todo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 46 KiB |
BIN
_site/static/imgs/modules/trello.png
Normal file
BIN
_site/static/imgs/modules/trello.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
@ -46,6 +46,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -89,6 +89,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
BIN
docs/imgs/modules/trello.png
Normal file
BIN
docs/imgs/modules/trello.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
@ -88,6 +88,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -283,6 +283,19 @@ Configuration Single Jira Project jira:colors:rows:even:&#34;lightblue&#
|
||||
jira:colors:rows:even:&#34;lightblue&#34;odd:&#34;white&#34;domain:&#34;https://umbrellacorp.atlassian.net&#34;email:&#34;chriscummer@me.com&#34;enabled:truejql:&#34;issueType = Story&#34;position:top:4left:1height:1width:2project:[&#34;ProjectA&#34;,&#34;ProjectB&#34;]refreshInterval:900username:&#34;chris.cummer&#34;verifyServerCertificate:true Attributes colors.rows.even Define the foreground color for even-numbered rows. Values: Any X11 color name.</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>Trello</title>
|
||||
<link>https://wtfutil.com/posts/modules/trello/</link>
|
||||
<pubDate>Thu, 10 May 2018 10:44:35 -0700</pubDate>
|
||||
|
||||
<guid>https://wtfutil.com/posts/modules/trello/</guid>
|
||||
<description>Displays all Trello cards on specified lists.
|
||||
Source Code wtf/trello/ Required ENV Variables Key: WTF_TRELLO_APP_KEY Value: Your Trello App Key. Key: WTF_TRELLO_ACCESS_TOKEN Value: Your Trello Access Token. You can get your API key at: trello.com/app-key.
|
||||
Keyboard Commands None.
|
||||
Configuration Single Trello List trello:board:Mainenabled:truelist:&#34;Todo&#34;position:height:1left:2top:0width:1refreshInterval:3600username:myname Multiple Trello Lists If you want to monitor multiple Trello lists, use the following configuration (note the difference in list):
|
||||
trello:board:Mainenabled:truelist:[&#34;Todo&#34;,&#34;Done&#34;]position:height:1left:2top:0width:1refreshInterval:3600username:myname Attributes board The name of the Trello board.</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>Google Calendar</title>
|
||||
<link>https://wtfutil.com/posts/modules/gcal/</link>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -89,6 +89,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -237,6 +238,13 @@
|
||||
|
||||
<time class="pull-right post-list">May 10, 2018</time>
|
||||
|
||||
</span>
|
||||
</li><li>
|
||||
<span>
|
||||
<a href="https://wtfutil.com/posts/modules/trello/">Trello</a>
|
||||
|
||||
<time class="pull-right post-list">May 10, 2018</time>
|
||||
|
||||
</span>
|
||||
</li><li>
|
||||
<span>
|
||||
|
@ -283,6 +283,19 @@ Configuration Single Jira Project jira:colors:rows:even:&#34;lightblue&#
|
||||
jira:colors:rows:even:&#34;lightblue&#34;odd:&#34;white&#34;domain:&#34;https://umbrellacorp.atlassian.net&#34;email:&#34;chriscummer@me.com&#34;enabled:truejql:&#34;issueType = Story&#34;position:top:4left:1height:1width:2project:[&#34;ProjectA&#34;,&#34;ProjectB&#34;]refreshInterval:900username:&#34;chris.cummer&#34;verifyServerCertificate:true Attributes colors.rows.even Define the foreground color for even-numbered rows. Values: Any X11 color name.</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>Trello</title>
|
||||
<link>https://wtfutil.com/posts/modules/trello/</link>
|
||||
<pubDate>Thu, 10 May 2018 10:44:35 -0700</pubDate>
|
||||
|
||||
<guid>https://wtfutil.com/posts/modules/trello/</guid>
|
||||
<description>Displays all Trello cards on specified lists.
|
||||
Source Code wtf/trello/ Required ENV Variables Key: WTF_TRELLO_APP_KEY Value: Your Trello App Key. Key: WTF_TRELLO_ACCESS_TOKEN Value: Your Trello Access Token. You can get your API key at: trello.com/app-key.
|
||||
Keyboard Commands None.
|
||||
Configuration Single Trello List trello:board:Mainenabled:truelist:&#34;Todo&#34;position:height:1left:2top:0width:1refreshInterval:3600username:myname Multiple Trello Lists If you want to monitor multiple Trello lists, use the following configuration (note the difference in list):
|
||||
trello:board:Mainenabled:truelist:[&#34;Todo&#34;,&#34;Done&#34;]position:height:1left:2top:0width:1refreshInterval:3600username:myname Attributes board The name of the Trello board.</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>Google Calendar</title>
|
||||
<link>https://wtfutil.com/posts/modules/gcal/</link>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
205
docs/posts/modules/trello/index.html
Normal file
205
docs/posts/modules/trello/index.html
Normal file
@ -0,0 +1,205 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us" class="wf-firasans-n4-active wf-active">
|
||||
<head>
|
||||
<link href="http://gmpg.org/xfn/11" rel="profile">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<!-- Enable responsiveness on mobile devices -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
|
||||
|
||||
<meta name="generator" content="Hugo 0.38.2" />
|
||||
|
||||
<title>Trello | WTF - A Terminal Dashboard</title>
|
||||
<meta content="Trello - WTF - A Terminal Dashboard" property="og:title">
|
||||
<meta content=" - " property="og:description">
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="//cdn.rawgit.com/milligram/milligram/master/dist/milligram.min.css">
|
||||
<link href="https://fonts.googleapis.com/css?family=Fira+Sans:300,300i,400,400i|Roboto+Mono:300,300i,400,400i" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://wtfutil.com/css/print.css" media="print">
|
||||
<link rel="stylesheet" href="https://wtfutil.com/css/poole.css">
|
||||
<link rel="stylesheet" href="https://wtfutil.com/css/hyde.css">
|
||||
<link rel="stylesheet" href="https://wtfutil.com/css/syntax.css">
|
||||
<link rel="stylesheet" href="https://wtfutil.com/css/wtf.css">
|
||||
<!-- Font-Awesome -->
|
||||
<script defer src="https://use.fontawesome.com/releases/v5.0.9/js/all.js" integrity="sha384-8iPTk2s/jMVj81dnzb/iFR2sdA7u06vHJyyLlAd4snFpCl/SnyUjRrbdJsw1pGIl" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Customised CSS -->
|
||||
<link rel="stylesheet" href="https://wtfutil.com/css/custom.css">
|
||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<!-- Icons -->
|
||||
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144-precomposed.png">
|
||||
<link rel="shortcut icon" href="/favicon.png">
|
||||
|
||||
<script async defer src="https://buttons.github.io/buttons.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="sidebar">
|
||||
<div class="container">
|
||||
<div class="sidebar-about text-center">
|
||||
|
||||
<a href="https://wtfutil.com/"> <img src="/img/wtf.png" alt="WFT Logo" class="" width=""> </a>
|
||||
<p class="lead">
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 style="color: white;">Content</h3>
|
||||
|
||||
<ul style="list-style-type: none;">
|
||||
<li class="sidebar-list-item-1"><a href="/posts/overview/">Overview</a></li>
|
||||
<li class="sidebar-list-item-1"><a href="/posts/installation/">Installation</a></li>
|
||||
<li class="sidebar-list-item-1"><a href="/posts/configuration/">Configuration</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/configuration/attributes/">Attributes</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/configuration/iterm2/">iTerm2</a></li>
|
||||
<li class="sidebar-list-item-1"><a href="https://github.com/senorprogrammer/wtf/releases">Releases</a></li>
|
||||
</ul>
|
||||
|
||||
<ul style="list-style-type: none;">
|
||||
<li class="sidebar-list-item-1"><a href="/posts/modules/">Modules</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/bamboohr/">BambooHR</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/cryptocurrencies/bittrex/">Bittrex</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/cryptocurrencies/blockfolio/">Blockfolio</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/circleci/">CircleCI</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/clocks/">Clocks</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/cryptocurrencies/cryptolive/">CryptoLive</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/cmdrunner/">CmdRunner</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/git/">Git</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/github/">GitHub</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/gitlab/">Gitlab</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/gcal/">Google Calendar</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/gspreadsheet">Google Spreadsheet</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/ipapi/">IP-API</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/ipinfo/">IPInfo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/jenkins/">Jenkins</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/jira/">Jira</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/logger/">Logger</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/newrelic/">New Relic</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/opsgenie/">OpsGenie</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/power/">Power</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/prettyweather/">PrettyWeather</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<p class="copyright">
|
||||
© 2018 Chris Cummer.
|
||||
<br />
|
||||
<a href="https://creativecommons.org/licenses/by/4.0">Some Rights Reserved</a>.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content container">
|
||||
<div class="post">
|
||||
<h1>Trello</h1>
|
||||
|
||||
<div class="col-sm-12 col-md-12">
|
||||
<span class="text-left post-date meta">
|
||||
|
||||
|
||||
May 10, 2018
|
||||
|
||||
|
||||
|
||||
|
||||
<br/>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<p>Displays all Trello cards on specified lists.</p>
|
||||
|
||||
<p><img src="/imgs/modules/trello.png" width="640" height="188" alt="trello screenshot" /></p>
|
||||
|
||||
<h2 id="source-code">Source Code</h2>
|
||||
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/trello/</code></pre></div>
|
||||
<h2 id="required-env-variables">Required ENV Variables</h2>
|
||||
|
||||
<p><span class="caption">Key:</span> <code>WTF_TRELLO_APP_KEY</code> <br />
|
||||
<span class="caption">Value:</span> Your Trello App Key. <br />
|
||||
<span class="caption">Key:</span> <code>WTF_TRELLO_ACCESS_TOKEN</code> <br />
|
||||
<span class="caption">Value:</span> Your Trello Access Token. <br /></p>
|
||||
|
||||
<p><em>You can get your API key at: trello.com/app-key.</em></p>
|
||||
|
||||
<h2 id="keyboard-commands">Keyboard Commands</h2>
|
||||
|
||||
<p>None.</p>
|
||||
|
||||
<h2 id="configuration">Configuration</h2>
|
||||
|
||||
<h3 id="single-trello-list">Single Trello List</h3>
|
||||
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">trello<span class="p">:</span><span class="w">
|
||||
</span><span class="w"> </span>board<span class="p">:</span><span class="w"> </span>Main<span class="w">
|
||||
</span><span class="w"> </span>enabled<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
|
||||
</span><span class="w"> </span>list<span class="p">:</span><span class="w"> </span><span class="s2">"Todo"</span><span class="w">
|
||||
</span><span class="w"> </span>position<span class="p">:</span><span class="w">
|
||||
</span><span class="w"> </span>height<span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
|
||||
</span><span class="w"> </span>left<span class="p">:</span><span class="w"> </span><span class="m">2</span><span class="w">
|
||||
</span><span class="w"> </span>top<span class="p">:</span><span class="w"> </span><span class="m">0</span><span class="w">
|
||||
</span><span class="w"> </span>width<span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
|
||||
</span><span class="w"> </span>refreshInterval<span class="p">:</span><span class="w"> </span><span class="m">3600</span><span class="w">
|
||||
</span><span class="w"> </span>username<span class="p">:</span><span class="w"> </span>myname</code></pre></div>
|
||||
<h3 id="multiple-trello-lists">Multiple Trello Lists</h3>
|
||||
|
||||
<p>If you want to monitor multiple Trello lists, use the following
|
||||
configuration (note the difference in <code>list</code>):</p>
|
||||
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">trello<span class="p">:</span><span class="w">
|
||||
</span><span class="w"> </span>board<span class="p">:</span><span class="w"> </span>Main<span class="w">
|
||||
</span><span class="w"> </span>enabled<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
|
||||
</span><span class="w"> </span>list<span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"Todo"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Done"</span><span class="p">]</span><span class="w">
|
||||
</span><span class="w"> </span>position<span class="p">:</span><span class="w">
|
||||
</span><span class="w"> </span>height<span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
|
||||
</span><span class="w"> </span>left<span class="p">:</span><span class="w"> </span><span class="m">2</span><span class="w">
|
||||
</span><span class="w"> </span>top<span class="p">:</span><span class="w"> </span><span class="m">0</span><span class="w">
|
||||
</span><span class="w"> </span>width<span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
|
||||
</span><span class="w"> </span>refreshInterval<span class="p">:</span><span class="w"> </span><span class="m">3600</span><span class="w">
|
||||
</span><span class="w"> </span>username<span class="p">:</span><span class="w"> </span>myname</code></pre></div>
|
||||
<h3 id="attributes">Attributes</h3>
|
||||
|
||||
<p><code>board</code> <br />
|
||||
The name of the Trello board. <br /></p>
|
||||
|
||||
<p><code>enabled</code> <br />
|
||||
Determines whether or not this module is executed and if its data displayed onscreen. <br />
|
||||
Values: <code>true</code>, <code>false</code>.</p>
|
||||
|
||||
<p><code>list</code> <br />
|
||||
The Trello lists to fetch cards from. <br /></p>
|
||||
|
||||
<p><code>refreshInterval</code> <br />
|
||||
How often, in seconds, this module will update its data. <br />
|
||||
Values: A positive integer, <code>0..n</code>.</p>
|
||||
|
||||
<p><code>username</code> <br />
|
||||
Your Trello username. <br /></p>
|
||||
|
||||
<p><code>position</code> <br />
|
||||
Where in the grid this module’s widget will be displayed. <br /></p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -87,6 +87,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -97,6 +97,11 @@
|
||||
<lastmod>2018-05-10T10:44:35-07:00</lastmod>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://wtfutil.com/posts/modules/trello/</loc>
|
||||
<lastmod>2018-05-10T10:44:35-07:00</lastmod>
|
||||
</url>
|
||||
|
||||
<url>
|
||||
<loc>https://wtfutil.com/posts/modules/gcal/</loc>
|
||||
<lastmod>2018-05-10T08:25:33-07:00</lastmod>
|
||||
|
@ -89,6 +89,7 @@
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/security/">Security</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/textfile/">Text File</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/todo/">Todo</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/trello/">Trello</a></li>
|
||||
<li class="sidebar-list-item-2"><a href="/posts/modules/weather/">Weather</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
8
trello/card.go
Normal file
8
trello/card.go
Normal file
@ -0,0 +1,8 @@
|
||||
package trello
|
||||
|
||||
type TrelloCard struct {
|
||||
ID string
|
||||
Name string
|
||||
List string
|
||||
Description string
|
||||
}
|
98
trello/client.go
Normal file
98
trello/client.go
Normal file
@ -0,0 +1,98 @@
|
||||
package trello
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/adlio/trello"
|
||||
"github.com/senorprogrammer/wtf/wtf"
|
||||
)
|
||||
|
||||
func GetCards(client *trello.Client, lists map[string]string) (*SearchResult, error) {
|
||||
boardID, err := getBoardID(client)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
lists, err = getListIDs(client, boardID, lists)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
searchResult := &SearchResult{Total: 0}
|
||||
searchResult.TrelloCards = make(map[string][]TrelloCard)
|
||||
|
||||
for listName, listID := range lists {
|
||||
cards, err := getCardsOnList(client, listID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
searchResult.Total = searchResult.Total + len(cards)
|
||||
cardArray := make([]TrelloCard, 0)
|
||||
for _, card := range cards {
|
||||
trelloCard := TrelloCard{
|
||||
ID: card.ID,
|
||||
List: listName,
|
||||
Name: card.Name,
|
||||
Description: card.Desc,
|
||||
}
|
||||
cardArray = append(cardArray, trelloCard)
|
||||
}
|
||||
searchResult.TrelloCards[listName] = cardArray
|
||||
}
|
||||
|
||||
return searchResult, nil
|
||||
}
|
||||
|
||||
func getBoardID(client *trello.Client) (string, error) {
|
||||
member, err := client.GetMember(wtf.Config.UString("wtf.mods.trello.username"), trello.Defaults())
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
boards, err := member.GetBoards(trello.Defaults())
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
for _, board := range boards {
|
||||
if board.Name == wtf.Config.UString("wtf.mods.trello.board") {
|
||||
return board.ID, nil
|
||||
}
|
||||
}
|
||||
|
||||
return "", fmt.Errorf("could not find board with name %s", wtf.Config.UString("wtf.mods.trello.board"))
|
||||
}
|
||||
|
||||
func getListIDs(client *trello.Client, boardID string, lists map[string]string) (map[string]string, error) {
|
||||
board, err := client.GetBoard(boardID, trello.Defaults())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
boardLists, err := board.GetLists(trello.Defaults())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, list := range boardLists {
|
||||
if _, ok := lists[list.Name]; ok {
|
||||
lists[list.Name] = list.ID
|
||||
}
|
||||
}
|
||||
|
||||
return lists, nil
|
||||
}
|
||||
|
||||
func getCardsOnList(client *trello.Client, listID string) ([]*trello.Card, error) {
|
||||
list, err := client.GetList(listID, trello.Defaults())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cards, err := list.GetCards(trello.Defaults())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return cards, nil
|
||||
}
|
6
trello/search_result.go
Normal file
6
trello/search_result.go
Normal file
@ -0,0 +1,6 @@
|
||||
package trello
|
||||
|
||||
type SearchResult struct {
|
||||
Total int
|
||||
TrelloCards map[string][]TrelloCard
|
||||
}
|
81
trello/widget.go
Normal file
81
trello/widget.go
Normal file
@ -0,0 +1,81 @@
|
||||
package trello
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/adlio/trello"
|
||||
"github.com/senorprogrammer/wtf/wtf"
|
||||
)
|
||||
|
||||
type Widget struct {
|
||||
wtf.TextWidget
|
||||
}
|
||||
|
||||
func NewWidget() *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" Trello ", "trello", false),
|
||||
}
|
||||
|
||||
return &widget
|
||||
}
|
||||
|
||||
/* -------------------- Exported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) Refresh() {
|
||||
client := trello.NewClient(os.Getenv("WTF_TRELLO_APP_KEY"), os.Getenv("WTF_TRELLO_ACCESS_TOKEN"))
|
||||
|
||||
// Get the cards
|
||||
searchResult, err := GetCards(client, getLists())
|
||||
widget.UpdateRefreshedAt()
|
||||
|
||||
if err != nil {
|
||||
widget.View.SetWrap(true)
|
||||
widget.View.SetTitle(fmt.Sprintf("%s", widget.Name))
|
||||
fmt.Fprintf(widget.View, "%v", err)
|
||||
} else {
|
||||
widget.View.SetWrap(false)
|
||||
widget.View.SetTitle(
|
||||
fmt.Sprintf(
|
||||
"[white]%s: [green]%s ",
|
||||
widget.Name,
|
||||
wtf.Config.UString("wtf.mods.trello.board"),
|
||||
),
|
||||
)
|
||||
widget.View.SetText(fmt.Sprintf("%s", widget.contentFrom(searchResult)))
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
func (widget *Widget) contentFrom(searchResult *SearchResult) string {
|
||||
str := ""
|
||||
|
||||
for list, cardArray := range searchResult.TrelloCards {
|
||||
str = fmt.Sprintf("%s [red]Cards in %s[white]\n", str, list)
|
||||
for _, card := range cardArray {
|
||||
str = fmt.Sprintf("%s [green]%s[white]\n", str, card.Name)
|
||||
}
|
||||
str = fmt.Sprintf("%s\n", str)
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
func getLists() map[string]string {
|
||||
list := make(map[string]string)
|
||||
// see if project is set to a single string
|
||||
configPath := "wtf.mods.trello.list"
|
||||
singleList, err := wtf.Config.String(configPath)
|
||||
if err == nil {
|
||||
list[singleList] = ""
|
||||
return list
|
||||
}
|
||||
// else, assume list
|
||||
multiList := wtf.Config.UList(configPath)
|
||||
for _, proj := range multiList {
|
||||
if str, ok := proj.(string); ok {
|
||||
list[str] = ""
|
||||
}
|
||||
}
|
||||
return list
|
||||
}
|
3
wtf.go
3
wtf.go
@ -38,6 +38,7 @@ import (
|
||||
"github.com/senorprogrammer/wtf/system"
|
||||
"github.com/senorprogrammer/wtf/textfile"
|
||||
"github.com/senorprogrammer/wtf/todo"
|
||||
"github.com/senorprogrammer/wtf/trello"
|
||||
"github.com/senorprogrammer/wtf/weatherservices/prettyweather"
|
||||
"github.com/senorprogrammer/wtf/weatherservices/weather"
|
||||
"github.com/senorprogrammer/wtf/wtf"
|
||||
@ -213,6 +214,8 @@ func addWidget(app *tview.Application, pages *tview.Pages, widgetName string) {
|
||||
Widgets = append(Widgets, textfile.NewWidget(app, pages))
|
||||
case "todo":
|
||||
Widgets = append(Widgets, todo.NewWidget(app, pages))
|
||||
case "trello":
|
||||
Widgets = append(Widgets, trello.NewWidget())
|
||||
case "weather":
|
||||
Widgets = append(Widgets, weather.NewWidget(app, pages))
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user