From d446ca8b43addc6ca990527304e92c226ba1b6d2 Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Tue, 24 Mar 2020 20:07:45 -0500 Subject: [PATCH] Add status page for drive formatting --- rootfs/standard/usr/bin/mount_drive.tcl | 1 + rootfs/standard/usr/bin/mynode_startup.sh | 2 ++ rootfs/standard/var/www/mynode/mynode.py | 17 +++++++++++------ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/rootfs/standard/usr/bin/mount_drive.tcl b/rootfs/standard/usr/bin/mount_drive.tcl index ac8f5cde..631d10a9 100755 --- a/rootfs/standard/usr/bin/mount_drive.tcl +++ b/rootfs/standard/usr/bin/mount_drive.tcl @@ -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 diff --git a/rootfs/standard/usr/bin/mynode_startup.sh b/rootfs/standard/usr/bin/mynode_startup.sh index 9278d76b..6675deca 100755 --- a/rootfs/standard/usr/bin/mynode_startup.sh +++ b/rootfs/standard/usr/bin/mynode_startup.sh @@ -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 diff --git a/rootfs/standard/var/www/mynode/mynode.py b/rootfs/standard/var/www/mynode/mynode.py index 16bd2995..86f66091 100644 --- a/rootfs/standard/var/www/mynode/mynode.py +++ b/rootfs/standard/var/www/mynode/mynode.py @@ -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..."