Add status page for drive formatting

This commit is contained in:
Taylor Helsper 2020-03-24 20:07:45 -05:00
parent 52332990f0
commit d446ca8b43
3 changed files with 14 additions and 6 deletions

View File

@ -68,6 +68,7 @@ proc createMyNodeFsOnBlockDevice {blockDevice} {
if [catch {
puts "Creating new partition table on ${blockDevice}"
runCommand echo "drive_formatting" > /mnt/hdd/mynode/.mynode_status
runCommand /usr/bin/format_drive.sh ${blockDevice}
after 5000

View File

@ -80,6 +80,8 @@ set -e
# Mount HDD (format if necessary)
while [ ! -f /mnt/hdd/.mynode ]
do
# Clear status
rm -f $MYNODE_DIR/.mynode_status
mount_drive.tcl || true
sleep 10
done

View File

@ -50,10 +50,11 @@ app.register_blueprint(mynode_settings)
### Definitions
STATE_DRIVE_MISSING = "drive_missing"
STATE_DRIVE_FORMATTING = "drive_formatting"
STATE_DRIVE_MOUNTED = "drive_mounted"
STATE_QUICKSYNC_DOWNLOAD = "quicksync_download"
STATE_QUICKSYNC_COPY = "quicksync_copy"
STATE_QUICKSYNC_RESET = "quicksync_reset"
STATE_QUICKSYNC_RESET = "quicksync_reset"
STATE_STABLE = "stable"
MYNODE_DIR = "/mnt/hdd/mynode"
@ -136,6 +137,14 @@ def index():
"ui_settings": read_ui_settings()
}
return render_template('state.html', **templateData)
elif status == STATE_DRIVE_FORMATTING:
templateData = {
"title": "myNode Drive Formatting",
"header_text": "Drive Formatting",
"subheader_text": "myNode is preparing the drive for use...",
"ui_settings": read_ui_settings()
}
return render_template('state.html', **templateData)
elif status == STATE_DRIVE_MOUNTED:
templateData = {
"title": "myNode Drive Mounted",
@ -353,11 +362,7 @@ def index():
# Find btcpayserver status
btcpayserver_status = "Merchant Tool"
if lnd_ready:
if is_installing_docker_images():
btcpayserver_status_color = "yellow"
btcpayserver_status = "Installing..."
else:
btcpayserver_status_color = get_service_status_color("btcpayserver")
btcpayserver_status_color = get_service_status_color("btcpayserver")
else:
btcpayserver_status = "Waiting on LND..."