Minor CyberPanel GUI and Updator CLI tweaks

This commit is contained in:
Luke S Thompson
2022-06-23 16:48:38 +10:00
committed by GitHub
5 changed files with 30 additions and 30 deletions

View File

@@ -145,7 +145,7 @@
<li> <li>
<b class="pull-right">{$ ramUsage $}%</b> <b class="pull-right">{$ ramUsage $}%</b>
<div class="progress-title"> <div class="progress-title">
{% trans "Ram Usage" %} {% trans "RAM Usage" %}
</div> </div>
<div class="progressbar-small progressbar" data-value="{$ ramUsage $}"> <div class="progressbar-small progressbar" data-value="{$ ramUsage $}">
<div class="progressbar-value bg-red tooltip-button" title="{$ ramUsage $}%"></div> <div class="progressbar-value bg-red tooltip-button" title="{$ ramUsage $}%"></div>
@@ -300,7 +300,7 @@
<a href="#" title="{% trans 'Server IP Address' %}"> <a href="#" title="{% trans 'Server IP Address' %}">
<i class="glyph-icon tooltip-button icon-laptop" title="{% trans 'Server IP Address' %}" <i class="glyph-icon tooltip-button icon-laptop" title="{% trans 'Server IP Address' %}"
data-original-title=".icon-laptop"></i> data-original-title=".icon-laptop"></i>
<span style="color: #db6868;font-weight: bold;">{{ ipAddress }}</span> <span style="color: #488a3f;font-weight: bold;">{{ ipAddress }}</span>
</a> </a>
<a href="{% url 'index' %}" title="{% trans 'Dashboard' %}"> <a href="{% url 'index' %}" title="{% trans 'Dashboard' %}">
<i class="glyph-icon icon-dashboard"></i> <i class="glyph-icon icon-dashboard"></i>

View File

@@ -8,11 +8,11 @@
<div class="container"> <div class="container">
<div id="page-title"> <div id="page-title">
<h2>{% trans "Version Management" %}</h2> <h2>{% trans "Version Management" %}</h2>
<p>{% trans "On this page you can manage versions and or upgrade to latest version of CyberPanel" %}</p> <p>{% trans "Here you can manage versions and check for updates to CyberPanel" %}</p>
</div> </div>
{% if Notecheck %} {% if Notecheck %}
<div class="alert alert-info"> <div class="alert alert-info">
<p style="color:red; font-weight: bold ;">{% trans "Note: Latest commit does not match, please upgrade." %}</p> <p style="color:red; font-weight: bold ;">{% trans "Note: Latest commit does not match, please upgrade CyberPanel." %}</p>
</div> </div>
{% endif %} {% endif %}
@@ -28,7 +28,7 @@
<form action="/" class="form-horizontal bordered-row"> <form action="/" class="form-horizontal bordered-row">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Current Version :" %}&nbsp&nbsp</label> <label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Current Version:" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ currentVersion }} </div> <div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ currentVersion }} </div>
</div> </div>
@@ -36,9 +36,9 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Build :" %}&nbsp&nbsp</label> <label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Build:" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ build }} </div> <div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ build }} </div>
<label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Current Commit :" %}&nbsp&nbsp</label> <label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Current Commit:" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ Currentcomt }} </div> <div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ Currentcomt }} </div>
</div> </div>
@@ -46,7 +46,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Latest Version :" %}&nbsp&nbsp</label> <label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Latest Version:" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ latestVersion }} </div> <div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ latestVersion }} </div>
@@ -54,9 +54,9 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Latest Build :" %}&nbsp&nbsp</label> <label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Latest Build:" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ latestBuild }} </div> <div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ latestBuild }} </div>
<label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Latest Commit :" %}&nbsp&nbsp</label> <label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Latest Commit:" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ latestcomit }} </div> <div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ latestcomit }} </div>
</div> </div>

View File

@@ -20,7 +20,7 @@ export LC_CTYPE=en_US.UTF-8
echo -e "\nFetching latest data from CyberPanel server...\n" echo -e "\nFetching latest data from CyberPanel server...\n"
echo -e "This may take few seconds..." echo -e "This may take few seconds..."
Server_Country="Unknow" Server_Country="Unknown"
Server_OS="" Server_OS=""
Server_OS_Version="" Server_OS_Version=""
Server_Provider='Undefined' Server_Provider='Undefined'
@@ -64,18 +64,18 @@ echo -e "\n${1}" >> /var/log/upgradeLogs.txt
Check_Root() { Check_Root() {
echo -e "\nChecking root privileges..." echo -e "\nChecking root privileges..."
if echo "$Sudo_Test" | grep SUDO >/dev/null; then if echo "$Sudo_Test" | grep SUDO >/dev/null; then
echo -e "\nYou are using SUDO , please run as root user...\n" echo -e "\nYou are using SUDO, please run as root user...\n"
echo -e "\nIf you don't have direct access to root user, please run \e[31msudo su -\e[39m command (do NOT miss the \e[31m-\e[39m at end or it will fail) and then run installation command again." echo -e "\nIf you don't have direct access to root user, please run \e[31msudo su -\e[39m command (do NOT miss the \e[31m-\e[39m at end or it will fail) and then run installation command again."
exit exit
fi fi
if [[ $(id -u) != 0 ]] >/dev/null; then if [[ $(id -u) != 0 ]] >/dev/null; then
echo -e "\nYou must run on root user to install CyberPanel...\n" echo -e "\nYou must run as root user to install CyberPanel...\n"
echo -e "or run following command: (do NOT miss the quotes)" echo -e "or run the following command: (do NOT miss the quotes)"
echo -e "\e[31msudo su -c \"sh <(curl https://cyberpanel.sh || wget -O - https://cyberpanel.sh)\"\e[39m" echo -e "\e[31msudo su -c \"sh <(curl https://cyberpanel.sh || wget -O - https://cyberpanel.sh)\"\e[39m"
exit 1 exit 1
else else
echo -e "\nYou are runing as root...\n" echo -e "\nYou are running as root...\n"
fi fi
} }
@@ -84,7 +84,7 @@ echo -e "Checking server location...\n"
Server_Country=$(curl --silent --max-time 10 -4 https://cyberpanel.sh/?country) Server_Country=$(curl --silent --max-time 10 -4 https://cyberpanel.sh/?country)
if [[ ${#Server_Country} != "2" ]] ; then if [[ ${#Server_Country} != "2" ]] ; then
Server_Country="Unknow" Server_Country="Unknown"
fi fi
if [[ "$Debug" = "On" ]] ; then if [[ "$Debug" = "On" ]] ; then
@@ -93,7 +93,7 @@ fi
if [[ "$*" = *"--mirror"* ]] ; then if [[ "$*" = *"--mirror"* ]] ; then
Server_Country="CN" Server_Country="CN"
echo -e "Force to use mirror server due to --mirror argument...\n" echo -e "Forced to use mirror server due to --mirror argument...\n"
fi fi
if [[ "$Server_Country" = *"CN"* ]] ; then if [[ "$Server_Country" = *"CN"* ]] ; then
@@ -104,7 +104,7 @@ fi
Check_OS() { Check_OS() {
if [[ ! -f /etc/os-release ]] ; then if [[ ! -f /etc/os-release ]] ; then
echo -e "Unable to detect the operating system...\n" echo -e "Unable to detect the Operating System...\n"
exit exit
fi fi
@@ -459,7 +459,7 @@ for i in {1..50};
sleep 30 sleep 30
fi fi
done done
#special made function for Gitee.com , for whatever reason , sometimes it fails to download this file #special made function for Gitee.com, for whatever reason sometimes it fails to download this file
} }
@@ -475,12 +475,12 @@ else
fi fi
if [[ -f /usr/local/CyberPanel/bin/python2 ]]; then if [[ -f /usr/local/CyberPanel/bin/python2 ]]; then
echo -e "\nPython 2 dectected, doing resetup...\n" echo -e "\nPython 2 dectected, doing re-setup...\n"
rm -rf /usr/local/CyberPanel/bin rm -rf /usr/local/CyberPanel/bin
virtualenv -p /usr/bin/python3 --system-site-packages /usr/local/CyberPanel virtualenv -p /usr/bin/python3 --system-site-packages /usr/local/CyberPanel
Check_Return Check_Return
elif [[ -d /usr/local/CyberPanel/bin/ ]]; then elif [[ -d /usr/local/CyberPanel/bin/ ]]; then
echo -e "\nNo need to resetup virtualenv at /usr/local/CyberPanel...\n" echo -e "\nNo need to re-setup virtualenv at /usr/local/CyberPanel...\n"
else else
echo -e "\nNothing found, need fresh setup...\n" echo -e "\nNothing found, need fresh setup...\n"
virtualenv -p /usr/bin/python3 --system-site-packages /usr/local/CyberPanel virtualenv -p /usr/bin/python3 --system-site-packages /usr/local/CyberPanel
@@ -542,9 +542,9 @@ fi
} }
Pre_Upgrade_Branch_Input() { Pre_Upgrade_Branch_Input() {
echo -e "\nPress Enter key to continue with latest version or Enter specific version such as: \e[31m1.9.4\e[39m , \e[31m1.9.5\e[39m ...etc" echo -e "\nPress the Enter key to continue with latest version, or enter specific version such as: \e[31m1.9.4\e[39m , \e[31m1.9.5\e[39m ...etc"
echo -e "\nIf nothing is input in 10 seconds , script will proceed with latest stable. " echo -e "\nIf nothing is input in 10 seconds, script will proceed with the latest stable version. "
echo -e "\nPlease press Enter key , or specify a version number ,or wait for 10 seconds timeout: " echo -e "\nPlease press the Enter key or specify a version number, or wait for 10 seconds: "
printf "%s" "" printf "%s" ""
read -r -t 10 Tmp_Input read -r -t 10 Tmp_Input
if [[ $Tmp_Input = "" ]]; then if [[ $Tmp_Input = "" ]]; then
@@ -563,7 +563,7 @@ if [[ -f /usr/local/CyberCP/bin/python2 ]]; then
virtualenv -p /usr/bin/python3 /usr/local/CyberCP virtualenv -p /usr/bin/python3 /usr/local/CyberCP
Check_Return Check_Return
elif [[ -d /usr/local/CyberCP/bin/ ]]; then elif [[ -d /usr/local/CyberCP/bin/ ]]; then
echo -e "\nNo need to resetup virtualenv at /usr/local/CyberCP...\n" echo -e "\nNo need to re-setup virtualenv at /usr/local/CyberCP...\n"
else else
virtualenv -p /usr/bin/python3 --system-site-packages /usr/local/CyberCP virtualenv -p /usr/bin/python3 --system-site-packages /usr/local/CyberCP
Check_Return Check_Return
@@ -731,7 +731,7 @@ if curl -I -XGET -k "https://127.0.0.1:${Panel_Port#*:}" | grep -q "200 OK" ; th
echo " CyberPanel Upgraded " echo " CyberPanel Upgraded "
echo "###################################################################" echo "###################################################################"
else else
echo -e "\nSeems something wrong with upgarde, please check...\n" echo -e "\nSeems something wrong with upgrade, please check...\n"
fi fi
rm -rf /root/cyberpanel_upgrade_tmp rm -rf /root/cyberpanel_upgrade_tmp
} }

View File

@@ -108,8 +108,8 @@
</div> </div>
<div ng-hide="successfullyCreated" class="alert alert-success"> <div ng-hide="successfullyCreated" class="alert alert-success">
<p>{% trans "Email with id :" %} {$ createdID <p>{% trans "Mailbox with username:" %} {$ createdID
$}{% trans " is successfully created." %}</p> $}{% trans " has been successfully created." %}</p>
</div> </div>
<div ng-hide="couldNotConnect" class="alert alert-danger"> <div ng-hide="couldNotConnect" class="alert alert-danger">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p> <p>{% trans "Could not connect to server. Please refresh this page." %}</p>

View File

@@ -92,7 +92,7 @@
</div> </div>
<div ng-hide="successfullyDeleted" class="alert alert-success"> <div ng-hide="successfullyDeleted" class="alert alert-success">
<p>{% trans "Email with id : {$ deletedID $} is successfully deleted." %}</p> <p>{% trans "Mailbox with username: {$ deletedID $} has been successfully deleted." %}</p>
</div> </div>
<div ng-hide="couldNotConnect" class="alert alert-danger"> <div ng-hide="couldNotConnect" class="alert alert-danger">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p> <p>{% trans "Could not connect to server. Please refresh this page." %}</p>