Skip to content

Commit

Permalink
Added documentation link to build option menus.
Browse files Browse the repository at this point in the history
  • Loading branch information
Slyke committed Nov 13, 2020
1 parent fd37cb8 commit 0898c74
Show file tree
Hide file tree
Showing 20 changed files with 223 additions and 51 deletions.
13 changes: 12 additions & 1 deletion .templates/adminer/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def main():
import sys
from blessed import Terminal

from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine
from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine, padText
from deps.consts import servicesDirectory, templatesDirectory
from deps.common_functions import getExternalPorts, getInternalPorts, checkPortConflicts, enterPortNumberWithWhiptail

Expand All @@ -33,6 +33,8 @@ def main():
except:
hideHelpText = False

documentationHint = 'https://sensorsiot.github.io/IOTstack/Containers/Adminer'

# runtime vars
portConflicts = []

Expand Down Expand Up @@ -213,6 +215,15 @@ def mainRender(needsRender, menu, selection):
print(term.center("{bv} [Enter] to run command or save input {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} [Escape] to go back to build stack menu {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center(commonEmptyLine(renderMode)))
if len(documentationHint) > 1:
if len(documentationHint) > 56:
documentationAndPadding = padText(documentationHint, 71)
print(term.center("{bv} Documentation: {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
else:
documentationAndPadding = padText(documentationHint, 56)
print(term.center("{bv} Documentation: {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonBottomBorder(renderMode)))

Expand Down
13 changes: 12 additions & 1 deletion .templates/blynk_server/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def main():
import sys
from blessed import Terminal

from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine
from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine, padText
from deps.consts import servicesDirectory, templatesDirectory
from deps.common_functions import getExternalPorts, getInternalPorts, checkPortConflicts, enterPortNumberWithWhiptail

Expand All @@ -38,6 +38,8 @@ def main():
except:
hideHelpText = False

documentationHint = 'https://sensorsiot.github.io/IOTstack/Containers/Blynk_server'

# runtime vars
portConflicts = []

Expand Down Expand Up @@ -225,6 +227,15 @@ def mainRender(needsRender, menu, selection):
print(term.center("{bv} [Enter] to run command or save input {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} [Escape] to go back to build stack menu {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center(commonEmptyLine(renderMode)))
if len(documentationHint) > 1:
if len(documentationHint) > 56:
documentationAndPadding = padText(documentationHint, 71)
print(term.center("{bv} Documentation: {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
else:
documentationAndPadding = padText(documentationHint, 56)
print(term.center("{bv} Documentation: {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonBottomBorder(renderMode)))

Expand Down
13 changes: 12 additions & 1 deletion .templates/grafana/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def main():
import os
import time
from blessed import Terminal
from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine
from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine, padText
from deps.consts import servicesDirectory, templatesDirectory, volumesDirectory
from deps.common_functions import getExternalPorts, getInternalPorts, checkPortConflicts, enterPortNumberWithWhiptail

Expand All @@ -31,6 +31,8 @@ def main():
except:
hideHelpText = False

documentationHint = 'https://sensorsiot.github.io/IOTstack/Containers/Adminer'

# This lets the menu know whether to put " >> Options " or not
# This function is REQUIRED.
def checkForOptionsHook():
Expand Down Expand Up @@ -204,6 +206,15 @@ def mainRender(needsRender, menu, selection):
print(term.center("{bv} [Enter] to run command or save input {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} [Escape] to go back to build stack menu {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center(commonEmptyLine(renderMode)))
if len(documentationHint) > 1:
if len(documentationHint) > 56:
documentationAndPadding = padText(documentationHint, 71)
print(term.center("{bv} Documentation: {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
else:
documentationAndPadding = padText(documentationHint, 56)
print(term.center("{bv} Documentation: {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonBottomBorder(renderMode)))

Expand Down
13 changes: 12 additions & 1 deletion .templates/home_assistant/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def main():
import sys
from blessed import Terminal

from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine
from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine, padText
from deps.consts import servicesDirectory, templatesDirectory
from deps.common_functions import getExternalPorts, getInternalPorts, checkPortConflicts, enterPortNumberWithWhiptail

Expand All @@ -36,6 +36,8 @@ def main():
except:
hideHelpText = False

documentationHint = 'https://sensorsiot.github.io/IOTstack/Containers/Home-Assistant'

# runtime vars
portConflicts = []

Expand Down Expand Up @@ -216,6 +218,15 @@ def mainRender(needsRender, menu, selection):
print(term.center("{bv} [Enter] to run command or save input {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} [Escape] to go back to build stack menu {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center(commonEmptyLine(renderMode)))
if len(documentationHint) > 1:
if len(documentationHint) > 56:
documentationAndPadding = padText(documentationHint, 71)
print(term.center("{bv} Documentation: {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
else:
documentationAndPadding = padText(documentationHint, 56)
print(term.center("{bv} Documentation: {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonBottomBorder(renderMode)))

Expand Down
13 changes: 12 additions & 1 deletion .templates/influxdb/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def main():
import subprocess
from blessed import Terminal

from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine
from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine, padText
from deps.consts import servicesDirectory, templatesDirectory, servicesFileName, buildSettingsFileName
from deps.common_functions import getExternalPorts, checkPortConflicts, generateRandomString

Expand All @@ -39,6 +39,8 @@ def main():
except:
hideHelpText = False

documentationHint = 'https://sensorsiot.github.io/IOTstack/Containers/InfluxDB'

# runtime vars
portConflicts = []

Expand Down Expand Up @@ -290,6 +292,15 @@ def mainRender(needsRender, menu, selection):
print(term.center("{bv} [Enter] to run command or save input {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} [Escape] to go back to build stack menu {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center(commonEmptyLine(renderMode)))
if len(documentationHint) > 1:
if len(documentationHint) > 56:
documentationAndPadding = padText(documentationHint, 71)
print(term.center("{bv} Documentation: {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
else:
documentationAndPadding = padText(documentationHint, 56)
print(term.center("{bv} Documentation: {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonBottomBorder(renderMode)))

Expand Down
4 changes: 2 additions & 2 deletions .templates/influxdb/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
environment:
- INFLUXDB_REPORTING_DISABLED=false
- INFLUXDB_HTTP_AUTH_ENABLED=false
- INFLUX_USERNAME=influxadminuser
- INFLUX_PASSWORD=%randomPassword%
# - INFLUX_USERNAME=influxadminuser
# - INFLUX_PASSWORD=%randomPassword%
# - INFLUXDB_UDP_ENABLED=false
# - INFLUXDB_UDP_BIND_ADDRESS=0.0.0.0:8086
# - INFLUXDB_UDP_DATABASE=udp
Expand Down
13 changes: 12 additions & 1 deletion .templates/mariadb/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def main():
import subprocess
from blessed import Terminal

from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine
from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine, padText
from deps.consts import servicesDirectory, templatesDirectory, servicesFileName, buildSettingsFileName
from deps.common_functions import getExternalPorts, checkPortConflicts, generateRandomString

Expand All @@ -39,6 +39,8 @@ def main():
except:
hideHelpText = False

documentationHint = 'https://sensorsiot.github.io/IOTstack/Containers/MariaDB'

# runtime vars
portConflicts = []

Expand Down Expand Up @@ -295,6 +297,15 @@ def mainRender(needsRender, menu, selection):
print(term.center("{bv} [Enter] to run command or save input {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} [Escape] to go back to build stack menu {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center(commonEmptyLine(renderMode)))
if len(documentationHint) > 1:
if len(documentationHint) > 56:
documentationAndPadding = padText(documentationHint, 71)
print(term.center("{bv} Documentation: {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
else:
documentationAndPadding = padText(documentationHint, 56)
print(term.center("{bv} Documentation: {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonBottomBorder(renderMode)))

Expand Down
2 changes: 2 additions & 0 deletions .templates/mosquitto/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def main():
except:
hideHelpText = False

# documentationHint = 'https://sensorsiot.github.io/IOTstack/Containers/Mosquitto'

# runtime vars
portConflicts = []

Expand Down
13 changes: 12 additions & 1 deletion .templates/motioneye/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def main():
import sys
from blessed import Terminal

from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine
from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine, padText
from deps.consts import servicesDirectory, templatesDirectory
from deps.common_functions import getExternalPorts, getInternalPorts, checkPortConflicts, enterPortNumberWithWhiptail

Expand All @@ -37,6 +37,8 @@ def main():
except:
hideHelpText = False

documentationHint = 'https://sensorsiot.github.io/IOTstack/Containers/MotionEye'

# runtime vars
portConflicts = []

Expand Down Expand Up @@ -229,6 +231,15 @@ def mainRender(needsRender, menu, selection):
print(term.center("{bv} [Enter] to run command or save input {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} [Escape] to go back to build stack menu {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center(commonEmptyLine(renderMode)))
if len(documentationHint) > 1:
if len(documentationHint) > 56:
documentationAndPadding = padText(documentationHint, 71)
print(term.center("{bv} Documentation: {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
else:
documentationAndPadding = padText(documentationHint, 56)
print(term.center("{bv} Documentation: {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonBottomBorder(renderMode)))

Expand Down
13 changes: 12 additions & 1 deletion .templates/nextcloud/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def main():
import subprocess

from blessed import Terminal
from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine
from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine, padText
from deps.consts import servicesDirectory, templatesDirectory, volumesDirectory, buildSettingsFileName, buildCache, servicesFileName
from deps.common_functions import getExternalPorts, getInternalPorts, checkPortConflicts, enterPortNumberWithWhiptail, generateRandomString

Expand All @@ -40,6 +40,8 @@ def main():
except:
hideHelpText = False

documentationHint = 'https://sensorsiot.github.io/IOTstack/Containers/NextCloud'

# runtime vars
portConflicts = []

Expand Down Expand Up @@ -328,6 +330,15 @@ def mainRender(needsRender, menu, selection):
print(term.center("{bv} [Enter] to run command or save input {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} [Escape] to go back to build stack menu {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center(commonEmptyLine(renderMode)))
if len(documentationHint) > 1:
if len(documentationHint) > 56:
documentationAndPadding = padText(documentationHint, 71)
print(term.center("{bv} Documentation: {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
else:
documentationAndPadding = padText(documentationHint, 56)
print(term.center("{bv} Documentation: {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonBottomBorder(renderMode)))

Expand Down
13 changes: 12 additions & 1 deletion .templates/nodered/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def main():
import signal
import sys
from blessed import Terminal
from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine
from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine, padText
from deps.consts import servicesDirectory, templatesDirectory
from deps.common_functions import getExternalPorts, getInternalPorts, checkPortConflicts, enterPortNumberWithWhiptail

Expand All @@ -34,6 +34,8 @@ def main():
except:
hideHelpText = False

documentationHint = 'https://sensorsiot.github.io/IOTstack/Containers/Node-RED'

yaml = ruamel.yaml.YAML()
yaml.preserve_quotes = True

Expand Down Expand Up @@ -296,6 +298,15 @@ def mainRender(needsRender, menu, selection):
print(term.center("{bv} [Enter] to run command or save input {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} [Escape] to go back to build stack menu {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center(commonEmptyLine(renderMode)))
if len(documentationHint) > 1:
if len(documentationHint) > 56:
documentationAndPadding = padText(documentationHint, 71)
print(term.center("{bv} Documentation: {bv}".format(bv=specialChars[renderMode]["borderVertical"])))
print(term.center("{bv} {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
else:
documentationAndPadding = padText(documentationHint, 56)
print(term.center("{bv} Documentation: {dap} {bv}".format(bv=specialChars[renderMode]["borderVertical"], dap=documentationAndPadding)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonEmptyLine(renderMode)))
print(term.center(commonBottomBorder(renderMode)))

Expand Down
Loading

0 comments on commit 0898c74

Please sign in to comment.