From bd25a0574e6fde7aa19f438dd0d2533b24ee47ca Mon Sep 17 00:00:00 2001 From: MrDoobPG <46342172+MrDoobPG@users.noreply.github.com> Date: Sun, 12 Jan 2020 18:02:32 +0100 Subject: [PATCH] old ui rewrite mountcheck update ( read is docker uploader running ) 3 x index.php for replacing --- menu/functions/autoheal.yml | 43 +++ menu/pgui/templates/autoscan-index.php | 134 ++++---- menu/pgui/templates/index.php | 3 +- menu/pgui/templates/mountcheck.sh | 25 +- menu/pgui/templates/oldui.php | 427 +++++++++++++++++++++++++ 5 files changed, 551 insertions(+), 81 deletions(-) create mode 100644 menu/functions/autoheal.yml create mode 100644 menu/pgui/templates/oldui.php diff --git a/menu/functions/autoheal.yml b/menu/functions/autoheal.yml new file mode 100644 index 00000000..f569c329 --- /dev/null +++ b/menu/functions/autoheal.yml @@ -0,0 +1,43 @@ +#!/bin/bash +# Title: autoheal +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + - name: 'Set Known Facts' + set_fact: + pgrole: 'autoheal' + image: 'willfarrell/autoheal' + - name: 'Setting {{pgrole}} Volumes' + set_fact: + pg_volumes: + - '/var/run/docker.sock:/var/run/docker.sock' + - '/etc/localtime:/etc/localtime:ro' + + - name: 'Setting {{pgrole}} ENV' + set_fact: + pg_env: + AUTOHEAL_CONTAINER_LABEL: 'all' + AUTOHEAL_INTERVAL: '5' + AUTOHEAL_START_PERIOD: '0' + AUTOHEAL_DEFAULT_STOP_TIMEOUT: '10' + CURL_TIMEOUT: '30' + DOCKER_SOCK: '/var/run/docker.sock' + + # MAIN DEPLOYMENT ############################################################# + - name: 'Deploying {{pgrole}}' + docker_container: + name: '{{pgrole}}' + image: '{{image}}' + pull: yes + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + restart_policy: unless-stopped + networks: + - name: plexguide + aliases: + - 'autoheal' + state: started diff --git a/menu/pgui/templates/autoscan-index.php b/menu/pgui/templates/autoscan-index.php index add58506..09ace0e6 100644 --- a/menu/pgui/templates/autoscan-index.php +++ b/menu/pgui/templates/autoscan-index.php @@ -230,115 +230,97 @@
- -
-
- +
- - + - - + - - - + + - - + + - - - + + - - + +
  Union - RClone | Mount +   Union - RClone | Mount $output";?>   Blitz | Move +    Blitz | Move $output";?>
  /mnt/downloads +
  /mnt/downloads $output";?> -   /mnt/move +   /mnt/move $output";?>
   mergerfs +
   mergerfs $output";?> -   rClone +   rClone $output";?>
-

- -
-
+ + +
+ Basic Information +
- - + - - - + + $output";?> - + + + - + + - - + + $output";?> + + + + - - - - + - - +
  Edition +   Edition $output" ?>  Version - $output";?>  ServerID  Version - $output" ?>
  Traefik  ServerID + $output" ?>  Traefik $output";?>  GOAuth +
  GOAuth $output";?>  PortGuard +   PortGuard $output";?>
  OS - $output";?> -   Ansible $output";?>
  Used Space $output" ?>  GCE + $output";?>
-   GCE - - $output";?> - - - -   Docker - - - +   Docker $output";?>  Disk Space +   Disk Space $output";?>
- - -
- -
-
+ + +
+ TDrive | GDrive Section +
@@ -355,7 +337,7 @@ - +
@@ -391,7 +373,7 @@ - +

@@ -426,9 +408,9 @@ $output";?> - + - +
@@ -452,11 +434,9 @@ -
- diff --git a/menu/pgui/templates/index.php b/menu/pgui/templates/index.php index 8d9defa6..a480ee3b 100644 --- a/menu/pgui/templates/index.php +++ b/menu/pgui/templates/index.php @@ -184,7 +184,8 @@ RClone | Transport & Checks - +
+ diff --git a/menu/pgui/templates/mountcheck.sh b/menu/pgui/templates/mountcheck.sh index 0d9b9315..b21550f2 100644 --- a/menu/pgui/templates/mountcheck.sh +++ b/menu/pgui/templates/mountcheck.sh @@ -18,12 +18,35 @@ while true; do pgunioncheck=$(systemctl is-active pgunion) pgblitzcheck=$(systemctl is-active pgblitz) pgmovecheck=$(systemctl is-active pgmove) + + pgblitz=$(systemctl list-unit-files | grep pgblitz.service | awk '{ print $2 }') + pgmove=$(systemctl list-unit-files | grep pgmove.service | awk '{ print $2 }') upper=$(docker ps --format '{{.Names}}' | grep "uploader") + uppercheck="/opt/appdata/uploader/" + + rm -rf /var/plexguide/pg.blitz && touch /var/plexguide/pg.blitz + + if [[ "$pgmove" == "enabled" ]]; then + if [[ "$pgmovecheck" != "active" ]]; then + echo " 🔴 MOVE" >/var/plexguide/pg.blitz + else echo " ✅ MOVE" >/var/plexguide/pg.blitz; fi + elif [[ "$pgblitz" == "enabled" ]]; then + if [[ "$pgblitzcheck" != "active" ]]; then + echo " 🔴 BLITZ" >/var/plexguide/pg.blitz + else echo " ✅ BLITZ" >/var/plexguide/pg.blitz; fi + elif [[ -d "$uppercheck" ]]; then + if [[ "$upper" == "uploader" ]]; then + echo " ✅ Uploader" >/var/plexguide/pg.blitz + else echo " 🔴 Uploader" >/var/plexguide/pg.blitz; fi + else echo " 🔴 Not Operational UPLOADER" >/var/plexguide/pg.blitz + fi rm -rf /var/plexguide/pg.blitz && touch /var/plexguide/pg.blitz if [[ "$upper" == "uploader" ]]; then echo " ✅ Uploader" >/var/plexguide/pg.blitz - else echo " 🔴 Uploader" >/var/plexguide/pg.blitz ; fi + else echo " 🔴 Uploader" >/var/plexguide/pg.blitz; fi + + config="/opt/appdata/plexguide/rclone.conf" if grep -q "gdrive" $config; then if [[ "$gdrivecheck" != "active" ]]; then diff --git a/menu/pgui/templates/oldui.php b/menu/pgui/templates/oldui.php new file mode 100644 index 00000000..ae6a9f34 --- /dev/null +++ b/menu/pgui/templates/oldui.php @@ -0,0 +1,427 @@ + + + + + + + +Com-UI + + + + + +
+
  Union - RClone | Mount
+ + + + + +
+

+ Community UI
+ Auto-Refreshes Every 25 Seconds +
+
+

+
+
+ + + + + + + + +
+ + + + + + +
Upload via rClone
+ + + + + + +
+ +
$output";?>
+
+
+ + + + + + +

+ WARNING LOG
+ + + + + + +
+ + $output";?> +
+ + + + + +
RClone | Transport & Checks
+ + + + + + + + + + + + + + + + + + + +
  Union - RClone | Mount + $output";?>   Blitz | Move + $output";?>
  /mnt/downloads + $output";?> +   /mnt/move + $output";?>
   mergerfs + $output";?> +   rClone + $output";?>
+
+ + +
+ Basic Information +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  Edition + $output" ?>  Version + $output";?>
  ServerID + $output" ?>  Traefik + $output";?>
  GOAuth + $output";?>  PortGuard + $output";?>
  OS + $output";?>  Ansible + $output";?>
  Used Space + $output" ?>  GCE + $output";?>
  Docker + $output";?>  Disk Space + $output";?>
+ + + +
+ TDrive | GDrive Section +
+ + + + + + + + + +
  GDrive - RClone | Mount + + $output";?> + +   GCrypt - RClone | Mount + + $output";?> + +
+ + + + + + + + + +
  GDrive /wo Encryption + + $output";?> + +   GDrive /w Encyption + + $output";?> + +
+ + + + + + + + + +
  GDrive /wo Encryption files/folder + + $output";?> + +   GDrive /w Encyption file/folders + + $output";?> + +
+
+ + + + + + + + + +
  TDrive - RClone | Mount + + $output";?> + +   TCrypt - RClone | Mount + + $output";?> + +
+ + + + + + + + + +
  TDrive /wo Encryption + + $output";?> + +   TDrive /w Encryption + + $output";?> + +
+ + + + + + + + + +
  TDrive /wo Encryption files/folders + + $output";?> + +   TDrive /w Encryption files/folders + + $output";?> + +
+ +