diff --git a/mattermost/bathroom.tar.gz b/mattermost/bathroom.tar.gz index 8eba6fd..ca9c011 100644 --- a/mattermost/bathroom.tar.gz +++ b/mattermost/bathroom.tar.gz Binary files differ diff --git a/mattermost/bathroom.tar.gz b/mattermost/bathroom.tar.gz index 8eba6fd..ca9c011 100644 --- a/mattermost/bathroom.tar.gz +++ b/mattermost/bathroom.tar.gz Binary files differ diff --git a/mattermost/images/toilet_10_green.png b/mattermost/images/toilet_10_green.png new file mode 100755 index 0000000..a0cfeaa --- /dev/null +++ b/mattermost/images/toilet_10_green.png Binary files differ diff --git a/mattermost/bathroom.tar.gz b/mattermost/bathroom.tar.gz index 8eba6fd..ca9c011 100644 --- a/mattermost/bathroom.tar.gz +++ b/mattermost/bathroom.tar.gz Binary files differ diff --git a/mattermost/images/toilet_10_green.png b/mattermost/images/toilet_10_green.png new file mode 100755 index 0000000..a0cfeaa --- /dev/null +++ b/mattermost/images/toilet_10_green.png Binary files differ diff --git a/mattermost/images/toilet_7_green.png b/mattermost/images/toilet_7_green.png new file mode 100755 index 0000000..0b6737b --- /dev/null +++ b/mattermost/images/toilet_7_green.png Binary files differ diff --git a/mattermost/bathroom.tar.gz b/mattermost/bathroom.tar.gz index 8eba6fd..ca9c011 100644 --- a/mattermost/bathroom.tar.gz +++ b/mattermost/bathroom.tar.gz Binary files differ diff --git a/mattermost/images/toilet_10_green.png b/mattermost/images/toilet_10_green.png new file mode 100755 index 0000000..a0cfeaa --- /dev/null +++ b/mattermost/images/toilet_10_green.png Binary files differ diff --git a/mattermost/images/toilet_7_green.png b/mattermost/images/toilet_7_green.png new file mode 100755 index 0000000..0b6737b --- /dev/null +++ b/mattermost/images/toilet_7_green.png Binary files differ diff --git a/mattermost/images/toilet_8_green.png b/mattermost/images/toilet_8_green.png new file mode 100755 index 0000000..18f9b1e --- /dev/null +++ b/mattermost/images/toilet_8_green.png Binary files differ diff --git a/mattermost/bathroom.tar.gz b/mattermost/bathroom.tar.gz index 8eba6fd..ca9c011 100644 --- a/mattermost/bathroom.tar.gz +++ b/mattermost/bathroom.tar.gz Binary files differ diff --git a/mattermost/images/toilet_10_green.png b/mattermost/images/toilet_10_green.png new file mode 100755 index 0000000..a0cfeaa --- /dev/null +++ b/mattermost/images/toilet_10_green.png Binary files differ diff --git a/mattermost/images/toilet_7_green.png b/mattermost/images/toilet_7_green.png new file mode 100755 index 0000000..0b6737b --- /dev/null +++ b/mattermost/images/toilet_7_green.png Binary files differ diff --git a/mattermost/images/toilet_8_green.png b/mattermost/images/toilet_8_green.png new file mode 100755 index 0000000..18f9b1e --- /dev/null +++ b/mattermost/images/toilet_8_green.png Binary files differ diff --git a/mattermost/images/toilet_9_green.png b/mattermost/images/toilet_9_green.png new file mode 100755 index 0000000..e463140 --- /dev/null +++ b/mattermost/images/toilet_9_green.png Binary files differ diff --git a/mattermost/bathroom.tar.gz b/mattermost/bathroom.tar.gz index 8eba6fd..ca9c011 100644 --- a/mattermost/bathroom.tar.gz +++ b/mattermost/bathroom.tar.gz Binary files differ diff --git a/mattermost/images/toilet_10_green.png b/mattermost/images/toilet_10_green.png new file mode 100755 index 0000000..a0cfeaa --- /dev/null +++ b/mattermost/images/toilet_10_green.png Binary files differ diff --git a/mattermost/images/toilet_7_green.png b/mattermost/images/toilet_7_green.png new file mode 100755 index 0000000..0b6737b --- /dev/null +++ b/mattermost/images/toilet_7_green.png Binary files differ diff --git a/mattermost/images/toilet_8_green.png b/mattermost/images/toilet_8_green.png new file mode 100755 index 0000000..18f9b1e --- /dev/null +++ b/mattermost/images/toilet_8_green.png Binary files differ diff --git a/mattermost/images/toilet_9_green.png b/mattermost/images/toilet_9_green.png new file mode 100755 index 0000000..e463140 --- /dev/null +++ b/mattermost/images/toilet_9_green.png Binary files differ diff --git a/mattermost/images/toilet_red.png b/mattermost/images/toilet_red.png new file mode 100755 index 0000000..e810024 --- /dev/null +++ b/mattermost/images/toilet_red.png Binary files differ diff --git a/mattermost/bathroom.tar.gz b/mattermost/bathroom.tar.gz index 8eba6fd..ca9c011 100644 --- a/mattermost/bathroom.tar.gz +++ b/mattermost/bathroom.tar.gz Binary files differ diff --git a/mattermost/images/toilet_10_green.png b/mattermost/images/toilet_10_green.png new file mode 100755 index 0000000..a0cfeaa --- /dev/null +++ b/mattermost/images/toilet_10_green.png Binary files differ diff --git a/mattermost/images/toilet_7_green.png b/mattermost/images/toilet_7_green.png new file mode 100755 index 0000000..0b6737b --- /dev/null +++ b/mattermost/images/toilet_7_green.png Binary files differ diff --git a/mattermost/images/toilet_8_green.png b/mattermost/images/toilet_8_green.png new file mode 100755 index 0000000..18f9b1e --- /dev/null +++ b/mattermost/images/toilet_8_green.png Binary files differ diff --git a/mattermost/images/toilet_9_green.png b/mattermost/images/toilet_9_green.png new file mode 100755 index 0000000..e463140 --- /dev/null +++ b/mattermost/images/toilet_9_green.png Binary files differ diff --git a/mattermost/images/toilet_red.png b/mattermost/images/toilet_red.png new file mode 100755 index 0000000..e810024 --- /dev/null +++ b/mattermost/images/toilet_red.png Binary files differ diff --git a/mattermost/package.sh b/mattermost/package.sh index 7253322..229d77d 100755 --- a/mattermost/package.sh +++ b/mattermost/package.sh @@ -1,3 +1,3 @@ #! /usr/bin/env bash cd "$( dirname "${BASH_SOURCE[0]}" )" -tar -czvf bathroom.tar.gz plugin.json -C server bathroom-linux-amd64 -C ../webapp/dist main.js +tar -czvf bathroom.tar.gz plugin.json -C server bathroom-linux-amd64 -C ../webapp/dist main.js -C ../../images/ $(cd images && ls *.png) diff --git a/mattermost/bathroom.tar.gz b/mattermost/bathroom.tar.gz index 8eba6fd..ca9c011 100644 --- a/mattermost/bathroom.tar.gz +++ b/mattermost/bathroom.tar.gz Binary files differ diff --git a/mattermost/images/toilet_10_green.png b/mattermost/images/toilet_10_green.png new file mode 100755 index 0000000..a0cfeaa --- /dev/null +++ b/mattermost/images/toilet_10_green.png Binary files differ diff --git a/mattermost/images/toilet_7_green.png b/mattermost/images/toilet_7_green.png new file mode 100755 index 0000000..0b6737b --- /dev/null +++ b/mattermost/images/toilet_7_green.png Binary files differ diff --git a/mattermost/images/toilet_8_green.png b/mattermost/images/toilet_8_green.png new file mode 100755 index 0000000..18f9b1e --- /dev/null +++ b/mattermost/images/toilet_8_green.png Binary files differ diff --git a/mattermost/images/toilet_9_green.png b/mattermost/images/toilet_9_green.png new file mode 100755 index 0000000..e463140 --- /dev/null +++ b/mattermost/images/toilet_9_green.png Binary files differ diff --git a/mattermost/images/toilet_red.png b/mattermost/images/toilet_red.png new file mode 100755 index 0000000..e810024 --- /dev/null +++ b/mattermost/images/toilet_red.png Binary files differ diff --git a/mattermost/package.sh b/mattermost/package.sh index 7253322..229d77d 100755 --- a/mattermost/package.sh +++ b/mattermost/package.sh @@ -1,3 +1,3 @@ #! /usr/bin/env bash cd "$( dirname "${BASH_SOURCE[0]}" )" -tar -czvf bathroom.tar.gz plugin.json -C server bathroom-linux-amd64 -C ../webapp/dist main.js +tar -czvf bathroom.tar.gz plugin.json -C server bathroom-linux-amd64 -C ../webapp/dist main.js -C ../../images/ $(cd images && ls *.png) diff --git a/mattermost/plugin.json b/mattermost/plugin.json index 9437d22..de87152 100644 --- a/mattermost/plugin.json +++ b/mattermost/plugin.json @@ -14,10 +14,11 @@ {"key":"AdminUsers", "display_name":"Plugin admin users", "type":"text", "default":"", "help_text":"Space- or comma-separated list of users to notify with plugin debug message"}, {"key":"PingInterval", "display_name":"Ping interval", "type":"text", "default":"", "help_text":"Send a ping every X seconds to keep websockets alive through nginx (leave blank for none)"}, {"key":"DoorNames", "display_name":"Door names", "type":"text", "default":"", "help_text":"|-separated list of names of the office doors"}, - {"key":"InfoIcon", "display_name":"Info icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display at the left before all the door icons"}, - {"key":"UnknownIcon", "display_name":"Unknown icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors without their status set yet"}, - {"key":"OpenIcon", "display_name":"Open icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are open"}, - {"key":"ClosedIcon", "display_name":"Closed icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are closed"} + {"key":"InfoIcons", "display_name":"Info icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display at the left before all the door icons, 1 per door (or specify 1 for all)"}, + {"key":"UnknownIcons", "display_name":"Unknown icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors without their status set yet, 1 per door (or specify 1 for all)"}, + {"key":"OpenIcons", "display_name":"Open icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are open, 1 per door (or specify 1 for all)"}, + {"key":"ClosedIcons", "display_name":"Closed icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are closed, 1 per door (or specify 1 for all)"}, + {"key":"DoorOrder", "display_name":"Door order", "type":"text", "default":"", "help_text":"Order of the door IDs for display in the widget (comma separated)"} ] } } diff --git a/mattermost/bathroom.tar.gz b/mattermost/bathroom.tar.gz index 8eba6fd..ca9c011 100644 --- a/mattermost/bathroom.tar.gz +++ b/mattermost/bathroom.tar.gz Binary files differ diff --git a/mattermost/images/toilet_10_green.png b/mattermost/images/toilet_10_green.png new file mode 100755 index 0000000..a0cfeaa --- /dev/null +++ b/mattermost/images/toilet_10_green.png Binary files differ diff --git a/mattermost/images/toilet_7_green.png b/mattermost/images/toilet_7_green.png new file mode 100755 index 0000000..0b6737b --- /dev/null +++ b/mattermost/images/toilet_7_green.png Binary files differ diff --git a/mattermost/images/toilet_8_green.png b/mattermost/images/toilet_8_green.png new file mode 100755 index 0000000..18f9b1e --- /dev/null +++ b/mattermost/images/toilet_8_green.png Binary files differ diff --git a/mattermost/images/toilet_9_green.png b/mattermost/images/toilet_9_green.png new file mode 100755 index 0000000..e463140 --- /dev/null +++ b/mattermost/images/toilet_9_green.png Binary files differ diff --git a/mattermost/images/toilet_red.png b/mattermost/images/toilet_red.png new file mode 100755 index 0000000..e810024 --- /dev/null +++ b/mattermost/images/toilet_red.png Binary files differ diff --git a/mattermost/package.sh b/mattermost/package.sh index 7253322..229d77d 100755 --- a/mattermost/package.sh +++ b/mattermost/package.sh @@ -1,3 +1,3 @@ #! /usr/bin/env bash cd "$( dirname "${BASH_SOURCE[0]}" )" -tar -czvf bathroom.tar.gz plugin.json -C server bathroom-linux-amd64 -C ../webapp/dist main.js +tar -czvf bathroom.tar.gz plugin.json -C server bathroom-linux-amd64 -C ../webapp/dist main.js -C ../../images/ $(cd images && ls *.png) diff --git a/mattermost/plugin.json b/mattermost/plugin.json index 9437d22..de87152 100644 --- a/mattermost/plugin.json +++ b/mattermost/plugin.json @@ -14,10 +14,11 @@ {"key":"AdminUsers", "display_name":"Plugin admin users", "type":"text", "default":"", "help_text":"Space- or comma-separated list of users to notify with plugin debug message"}, {"key":"PingInterval", "display_name":"Ping interval", "type":"text", "default":"", "help_text":"Send a ping every X seconds to keep websockets alive through nginx (leave blank for none)"}, {"key":"DoorNames", "display_name":"Door names", "type":"text", "default":"", "help_text":"|-separated list of names of the office doors"}, - {"key":"InfoIcon", "display_name":"Info icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display at the left before all the door icons"}, - {"key":"UnknownIcon", "display_name":"Unknown icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors without their status set yet"}, - {"key":"OpenIcon", "display_name":"Open icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are open"}, - {"key":"ClosedIcon", "display_name":"Closed icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are closed"} + {"key":"InfoIcons", "display_name":"Info icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display at the left before all the door icons, 1 per door (or specify 1 for all)"}, + {"key":"UnknownIcons", "display_name":"Unknown icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors without their status set yet, 1 per door (or specify 1 for all)"}, + {"key":"OpenIcons", "display_name":"Open icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are open, 1 per door (or specify 1 for all)"}, + {"key":"ClosedIcons", "display_name":"Closed icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are closed, 1 per door (or specify 1 for all)"}, + {"key":"DoorOrder", "display_name":"Door order", "type":"text", "default":"", "help_text":"Order of the door IDs for display in the widget (comma separated)"} ] } } diff --git a/mattermost/plugin_templ.json b/mattermost/plugin_templ.json index 9299035..c60e17a 100644 --- a/mattermost/plugin_templ.json +++ b/mattermost/plugin_templ.json @@ -18,10 +18,11 @@ {"key":"AdminUsers", "display_name":"Plugin admin users", "type":"text", "default":"", "help_text":"Space- or comma-separated list of users to notify with plugin debug message"}, {"key":"PingInterval", "display_name":"Ping interval", "type":"text", "default":"", "help_text":"Send a ping every X seconds to keep websockets alive through nginx (leave blank for none)"}, {"key":"DoorNames", "display_name":"Door names", "type":"text", "default":"", "help_text":"|-separated list of names of the office doors"}, - {"key":"InfoIcon", "display_name":"Info icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display at the left before all the door icons"}, - {"key":"UnknownIcon", "display_name":"Unknown icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors without their status set yet"}, - {"key":"OpenIcon", "display_name":"Open icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are open"}, - {"key":"ClosedIcon", "display_name":"Closed icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are closed"} + {"key":"InfoIcons", "display_name":"Info icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display at the left before all the door icons, 1 per door (or specify 1 for all)"}, + {"key":"UnknownIcons", "display_name":"Unknown icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors without their status set yet, 1 per door (or specify 1 for all)"}, + {"key":"OpenIcons", "display_name":"Open icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are open, 1 per door (or specify 1 for all)"}, + {"key":"ClosedIcons", "display_name":"Closed icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are closed, 1 per door (or specify 1 for all)"}, + {"key":"DoorOrder", "display_name":"Door order", "type":"text", "default":"", "help_text":"Order of the door IDs for display in the widget (comma separated)"} ] } } diff --git a/mattermost/bathroom.tar.gz b/mattermost/bathroom.tar.gz index 8eba6fd..ca9c011 100644 --- a/mattermost/bathroom.tar.gz +++ b/mattermost/bathroom.tar.gz Binary files differ diff --git a/mattermost/images/toilet_10_green.png b/mattermost/images/toilet_10_green.png new file mode 100755 index 0000000..a0cfeaa --- /dev/null +++ b/mattermost/images/toilet_10_green.png Binary files differ diff --git a/mattermost/images/toilet_7_green.png b/mattermost/images/toilet_7_green.png new file mode 100755 index 0000000..0b6737b --- /dev/null +++ b/mattermost/images/toilet_7_green.png Binary files differ diff --git a/mattermost/images/toilet_8_green.png b/mattermost/images/toilet_8_green.png new file mode 100755 index 0000000..18f9b1e --- /dev/null +++ b/mattermost/images/toilet_8_green.png Binary files differ diff --git a/mattermost/images/toilet_9_green.png b/mattermost/images/toilet_9_green.png new file mode 100755 index 0000000..e463140 --- /dev/null +++ b/mattermost/images/toilet_9_green.png Binary files differ diff --git a/mattermost/images/toilet_red.png b/mattermost/images/toilet_red.png new file mode 100755 index 0000000..e810024 --- /dev/null +++ b/mattermost/images/toilet_red.png Binary files differ diff --git a/mattermost/package.sh b/mattermost/package.sh index 7253322..229d77d 100755 --- a/mattermost/package.sh +++ b/mattermost/package.sh @@ -1,3 +1,3 @@ #! /usr/bin/env bash cd "$( dirname "${BASH_SOURCE[0]}" )" -tar -czvf bathroom.tar.gz plugin.json -C server bathroom-linux-amd64 -C ../webapp/dist main.js +tar -czvf bathroom.tar.gz plugin.json -C server bathroom-linux-amd64 -C ../webapp/dist main.js -C ../../images/ $(cd images && ls *.png) diff --git a/mattermost/plugin.json b/mattermost/plugin.json index 9437d22..de87152 100644 --- a/mattermost/plugin.json +++ b/mattermost/plugin.json @@ -14,10 +14,11 @@ {"key":"AdminUsers", "display_name":"Plugin admin users", "type":"text", "default":"", "help_text":"Space- or comma-separated list of users to notify with plugin debug message"}, {"key":"PingInterval", "display_name":"Ping interval", "type":"text", "default":"", "help_text":"Send a ping every X seconds to keep websockets alive through nginx (leave blank for none)"}, {"key":"DoorNames", "display_name":"Door names", "type":"text", "default":"", "help_text":"|-separated list of names of the office doors"}, - {"key":"InfoIcon", "display_name":"Info icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display at the left before all the door icons"}, - {"key":"UnknownIcon", "display_name":"Unknown icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors without their status set yet"}, - {"key":"OpenIcon", "display_name":"Open icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are open"}, - {"key":"ClosedIcon", "display_name":"Closed icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are closed"} + {"key":"InfoIcons", "display_name":"Info icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display at the left before all the door icons, 1 per door (or specify 1 for all)"}, + {"key":"UnknownIcons", "display_name":"Unknown icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors without their status set yet, 1 per door (or specify 1 for all)"}, + {"key":"OpenIcons", "display_name":"Open icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are open, 1 per door (or specify 1 for all)"}, + {"key":"ClosedIcons", "display_name":"Closed icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are closed, 1 per door (or specify 1 for all)"}, + {"key":"DoorOrder", "display_name":"Door order", "type":"text", "default":"", "help_text":"Order of the door IDs for display in the widget (comma separated)"} ] } } diff --git a/mattermost/plugin_templ.json b/mattermost/plugin_templ.json index 9299035..c60e17a 100644 --- a/mattermost/plugin_templ.json +++ b/mattermost/plugin_templ.json @@ -18,10 +18,11 @@ {"key":"AdminUsers", "display_name":"Plugin admin users", "type":"text", "default":"", "help_text":"Space- or comma-separated list of users to notify with plugin debug message"}, {"key":"PingInterval", "display_name":"Ping interval", "type":"text", "default":"", "help_text":"Send a ping every X seconds to keep websockets alive through nginx (leave blank for none)"}, {"key":"DoorNames", "display_name":"Door names", "type":"text", "default":"", "help_text":"|-separated list of names of the office doors"}, - {"key":"InfoIcon", "display_name":"Info icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display at the left before all the door icons"}, - {"key":"UnknownIcon", "display_name":"Unknown icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors without their status set yet"}, - {"key":"OpenIcon", "display_name":"Open icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are open"}, - {"key":"ClosedIcon", "display_name":"Closed icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are closed"} + {"key":"InfoIcons", "display_name":"Info icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display at the left before all the door icons, 1 per door (or specify 1 for all)"}, + {"key":"UnknownIcons", "display_name":"Unknown icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors without their status set yet, 1 per door (or specify 1 for all)"}, + {"key":"OpenIcons", "display_name":"Open icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are open, 1 per door (or specify 1 for all)"}, + {"key":"ClosedIcons", "display_name":"Closed icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are closed, 1 per door (or specify 1 for all)"}, + {"key":"DoorOrder", "display_name":"Door order", "type":"text", "default":"", "help_text":"Order of the door IDs for display in the widget (comma separated)"} ] } } diff --git a/mattermost/server/bathroom-linux-amd64 b/mattermost/server/bathroom-linux-amd64 index 542b2a5..0f04c02 100755 --- a/mattermost/server/bathroom-linux-amd64 +++ b/mattermost/server/bathroom-linux-amd64 Binary files differ diff --git a/mattermost/bathroom.tar.gz b/mattermost/bathroom.tar.gz index 8eba6fd..ca9c011 100644 --- a/mattermost/bathroom.tar.gz +++ b/mattermost/bathroom.tar.gz Binary files differ diff --git a/mattermost/images/toilet_10_green.png b/mattermost/images/toilet_10_green.png new file mode 100755 index 0000000..a0cfeaa --- /dev/null +++ b/mattermost/images/toilet_10_green.png Binary files differ diff --git a/mattermost/images/toilet_7_green.png b/mattermost/images/toilet_7_green.png new file mode 100755 index 0000000..0b6737b --- /dev/null +++ b/mattermost/images/toilet_7_green.png Binary files differ diff --git a/mattermost/images/toilet_8_green.png b/mattermost/images/toilet_8_green.png new file mode 100755 index 0000000..18f9b1e --- /dev/null +++ b/mattermost/images/toilet_8_green.png Binary files differ diff --git a/mattermost/images/toilet_9_green.png b/mattermost/images/toilet_9_green.png new file mode 100755 index 0000000..e463140 --- /dev/null +++ b/mattermost/images/toilet_9_green.png Binary files differ diff --git a/mattermost/images/toilet_red.png b/mattermost/images/toilet_red.png new file mode 100755 index 0000000..e810024 --- /dev/null +++ b/mattermost/images/toilet_red.png Binary files differ diff --git a/mattermost/package.sh b/mattermost/package.sh index 7253322..229d77d 100755 --- a/mattermost/package.sh +++ b/mattermost/package.sh @@ -1,3 +1,3 @@ #! /usr/bin/env bash cd "$( dirname "${BASH_SOURCE[0]}" )" -tar -czvf bathroom.tar.gz plugin.json -C server bathroom-linux-amd64 -C ../webapp/dist main.js +tar -czvf bathroom.tar.gz plugin.json -C server bathroom-linux-amd64 -C ../webapp/dist main.js -C ../../images/ $(cd images && ls *.png) diff --git a/mattermost/plugin.json b/mattermost/plugin.json index 9437d22..de87152 100644 --- a/mattermost/plugin.json +++ b/mattermost/plugin.json @@ -14,10 +14,11 @@ {"key":"AdminUsers", "display_name":"Plugin admin users", "type":"text", "default":"", "help_text":"Space- or comma-separated list of users to notify with plugin debug message"}, {"key":"PingInterval", "display_name":"Ping interval", "type":"text", "default":"", "help_text":"Send a ping every X seconds to keep websockets alive through nginx (leave blank for none)"}, {"key":"DoorNames", "display_name":"Door names", "type":"text", "default":"", "help_text":"|-separated list of names of the office doors"}, - {"key":"InfoIcon", "display_name":"Info icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display at the left before all the door icons"}, - {"key":"UnknownIcon", "display_name":"Unknown icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors without their status set yet"}, - {"key":"OpenIcon", "display_name":"Open icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are open"}, - {"key":"ClosedIcon", "display_name":"Closed icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are closed"} + {"key":"InfoIcons", "display_name":"Info icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display at the left before all the door icons, 1 per door (or specify 1 for all)"}, + {"key":"UnknownIcons", "display_name":"Unknown icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors without their status set yet, 1 per door (or specify 1 for all)"}, + {"key":"OpenIcons", "display_name":"Open icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are open, 1 per door (or specify 1 for all)"}, + {"key":"ClosedIcons", "display_name":"Closed icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are closed, 1 per door (or specify 1 for all)"}, + {"key":"DoorOrder", "display_name":"Door order", "type":"text", "default":"", "help_text":"Order of the door IDs for display in the widget (comma separated)"} ] } } diff --git a/mattermost/plugin_templ.json b/mattermost/plugin_templ.json index 9299035..c60e17a 100644 --- a/mattermost/plugin_templ.json +++ b/mattermost/plugin_templ.json @@ -18,10 +18,11 @@ {"key":"AdminUsers", "display_name":"Plugin admin users", "type":"text", "default":"", "help_text":"Space- or comma-separated list of users to notify with plugin debug message"}, {"key":"PingInterval", "display_name":"Ping interval", "type":"text", "default":"", "help_text":"Send a ping every X seconds to keep websockets alive through nginx (leave blank for none)"}, {"key":"DoorNames", "display_name":"Door names", "type":"text", "default":"", "help_text":"|-separated list of names of the office doors"}, - {"key":"InfoIcon", "display_name":"Info icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display at the left before all the door icons"}, - {"key":"UnknownIcon", "display_name":"Unknown icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors without their status set yet"}, - {"key":"OpenIcon", "display_name":"Open icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are open"}, - {"key":"ClosedIcon", "display_name":"Closed icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are closed"} + {"key":"InfoIcons", "display_name":"Info icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display at the left before all the door icons, 1 per door (or specify 1 for all)"}, + {"key":"UnknownIcons", "display_name":"Unknown icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors without their status set yet, 1 per door (or specify 1 for all)"}, + {"key":"OpenIcons", "display_name":"Open icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are open, 1 per door (or specify 1 for all)"}, + {"key":"ClosedIcons", "display_name":"Closed icon url", "type":"text", "default":"", "help_text":"(Relative) URL of the icon to display for doors that are closed, 1 per door (or specify 1 for all)"}, + {"key":"DoorOrder", "display_name":"Door order", "type":"text", "default":"", "help_text":"Order of the door IDs for display in the widget (comma separated)"} ] } } diff --git a/mattermost/server/bathroom-linux-amd64 b/mattermost/server/bathroom-linux-amd64 index 542b2a5..0f04c02 100755 --- a/mattermost/server/bathroom-linux-amd64 +++ b/mattermost/server/bathroom-linux-amd64 Binary files differ diff --git a/mattermost/server/bathroom.go b/mattermost/server/bathroom.go index a540998..551bb65 100644 --- a/mattermost/server/bathroom.go +++ b/mattermost/server/bathroom.go @@ -97,10 +97,18 @@ DoorNames string doorNames []string - InfoIcon string - UnknownIcon string - OpenIcon string - ClosedIcon string + InfoIcons string + UnknownIcons string + OpenIcons string + ClosedIcons string + + infoIcons []string + unknownIcons []string + openIcons []string + closedIcons []string + + DoorOrder string + doorOrder []uint8 settingsJson map[string]interface{} } @@ -517,7 +525,6 @@ } newConfig.adminUsers = make([]*model.User, 0, 4) - split := splitWhitespaceOrComma.Split(newConfig.AdminUsers, -1) for _, un := range split { trimmed := strings.Trim(un, ", \t\n") @@ -530,7 +537,6 @@ } newConfig.doorNames = make([]string, 0, 4) - split = strings.Split(newConfig.DoorNames, "|") for _, un := range split { trimmed := strings.Trim(un, ", \t\n") @@ -539,6 +545,58 @@ } } + newConfig.infoIcons = make([]string, 0, 4) + split = strings.Split(newConfig.InfoIcons, ",") + for _, un := range split { + trimmed := strings.Trim(un, ", \t\n") + if trimmed != "" { + newConfig.infoIcons = append(newConfig.infoIcons, trimmed) + } + } + + newConfig.unknownIcons = make([]string, 0, 4) + split = strings.Split(newConfig.UnknownIcons, ",") + for _, un := range split { + trimmed := strings.Trim(un, ", \t\n") + if trimmed != "" { + newConfig.unknownIcons = append(newConfig.unknownIcons, trimmed) + } + } + + newConfig.openIcons = make([]string, 0, 4) + split = strings.Split(newConfig.OpenIcons, ",") + for _, un := range split { + trimmed := strings.Trim(un, ", \t\n") + if trimmed != "" { + newConfig.openIcons = append(newConfig.openIcons, trimmed) + } + } + + newConfig.closedIcons = make([]string, 0, 4) + split = strings.Split(newConfig.ClosedIcons, ",") + for _, un := range split { + trimmed := strings.Trim(un, ", \t\n") + if trimmed != "" { + newConfig.closedIcons = append(newConfig.closedIcons, trimmed) + } + } + + doorOrder := make([]uint8, 0, 4) + split = strings.Split(newConfig.DoorOrder, ",") + for _, un := range split { + trimmed := strings.Trim(un, ", \t\n") + if trimmed != "" { + id, err := strconv.ParseUint(trimmed, 10, 8) + if err != nil { + configErr = multierror.Append(configErr, errors.Wrap(err, "Invalid door order")) + doorOrder = nil + break + } + doorOrder = append(doorOrder, uint8(id)) + } + } + newConfig.doorOrder = doorOrder + min := func(a uint8, b uint8) uint8 { if a < b { return a @@ -552,11 +610,12 @@ } newConfig.settingsJson = map[string]interface{} { - "info_icon": newConfig.InfoIcon, - "unknown_icon": newConfig.UnknownIcon, - "open_icon": newConfig.OpenIcon, - "closed_icon": newConfig.ClosedIcon, + "info_icons": newConfig.infoIcons, + "unknown_icons": newConfig.unknownIcons, + "open_icons": newConfig.openIcons, + "closed_icons": newConfig.closedIcons, "doors": doorsJson, + "door_order": newConfig.doorOrder, } p.config = newConfig @@ -668,7 +727,9 @@ func (p *BathroomMonitorPlugin) ExecuteCommand(c *plugin.Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError) { userOptions := defaultUserOptions() + _ = userOptions + return nil, nil } func (p *BathroomMonitorPlugin) OnActivate() error {