Merge pull request #898 from lsthompson/stable

Minor CyberPanel GUI and Updator CLI tweaks
This commit is contained in:
Usman Nasir
2022-07-06 08:31:33 +05:00
committed by GitHub
5 changed files with 80 additions and 90 deletions

View File

@@ -145,7 +145,7 @@
<li>
<b class="pull-right">{$ ramUsage $}%</b>
<div class="progress-title">
{% trans "Ram Usage" %}
{% trans "RAM Usage" %}
</div>
<div class="progressbar-small progressbar" data-value="{$ ramUsage $}">
<div class="progressbar-value bg-red tooltip-button" title="{$ ramUsage $}%"></div>
@@ -304,7 +304,7 @@
<a id="sidebar-menu-item-server-ip-address" href="#" title="{% trans 'Server IP Address' %}">
<i class="glyph-icon tooltip-button icon-laptop" title="{% trans 'Server IP Address' %}"
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 id="sidebar-menu-item-dashboard" href="{% url 'index' %}" title="{% trans 'Dashboard' %}">
<i class="glyph-icon icon-dashboard"></i>

View File

@@ -1,97 +1,87 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "Version Management - CyberPanel" %}{% endblock %}
{% block title %}{% trans "Version Management - CyberPanel" %}"{% endblock %}
{% block content %}
{% load static %}
{% load static %}
<div class="container">
<div id="page-title">
<h2>{% trans "Version Management" %}</h2>
<p>{% trans "On this page you can manage versions and or upgrade to latest version of CyberPanel" %}</p>
</div>
{% if Notecheck %}
<div class="container">
<div id="page-title">
<h2>{% trans "Version Management" %}</h2>
<p>{% trans "Here you can manage versions and check for updates to CyberPanel" %}</p>
</div>
{% if Notecheck %}
<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>
{% endif %}
<div class="panel">
<div class="panel-body">
<h3 class="title-hero">
CyberPanel
</h3>
<div ng-controller="versionManagment" class="example-box-wrapper">
<div class="panel">
<div class="panel-body">
<h3 class="title-hero">
CyberPanel
</h3>
<div ng-controller="versionManagment" class="example-box-wrapper">
<form action="/" class="form-horizontal bordered-row">
<div class="form-group">
<form action="/" class="form-horizontal bordered-row">
<div class="form-group">
<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>
<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>
</div>
<div class="form-group">
<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>
<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>
<div class="form-group">
<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>
<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>
<div class="form-group">
<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>
<div class="form-group">
<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>
<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>
{% comment %}<label class="col-sm-3 control-label "
style="margin: 0px!important; padding: 0px!important;">{% trans "# commits since update :" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9"
style="margin: 0px!important; padding: 0px!important;">{{ numCommits }} </div>{% endcomment %}
</div>
<div ng-hide="upgradelogBox" class="form-group">
<div class="col-sm-12">
<textarea ng-model="upgradeLog" rows="30" class="form-control">{{ logs }}</textarea>
</div>
</div>
</form>
<div class="form-group">
<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>
</div>
<div class="form-group">
<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>
<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>
<div ng-hide="upgradelogBox" class="form-group">
<div class="col-sm-12">
<textarea ng-model="upgradeLog" rows="30" class="form-control">{{ logs }}</textarea>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -20,7 +20,7 @@ export LC_CTYPE=en_US.UTF-8
echo -e "\nFetching latest data from CyberPanel server...\n"
echo -e "This may take few seconds..."
Server_Country="Unknow"
Server_Country="Unknown"
Server_OS=""
Server_OS_Version=""
Server_Provider='Undefined'
@@ -64,18 +64,18 @@ echo -e "\n${1}" >> /var/log/upgradeLogs.txt
Check_Root() {
echo -e "\nChecking root privileges..."
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."
exit
fi
if [[ $(id -u) != 0 ]] >/dev/null; then
echo -e "\nYou must run on root user to install CyberPanel...\n"
echo -e "or run following command: (do NOT miss the quotes)"
echo -e "\nYou must run as root user to install CyberPanel...\n"
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"
exit 1
else
echo -e "\nYou are runing as root...\n"
echo -e "\nYou are running as root...\n"
fi
}
@@ -84,7 +84,7 @@ echo -e "Checking server location...\n"
Server_Country=$(curl --silent --max-time 10 -4 https://cyberpanel.sh/?country)
if [[ ${#Server_Country} != "2" ]] ; then
Server_Country="Unknow"
Server_Country="Unknown"
fi
if [[ "$Debug" = "On" ]] ; then
@@ -93,7 +93,7 @@ fi
if [[ "$*" = *"--mirror"* ]] ; then
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
if [[ "$Server_Country" = *"CN"* ]] ; then
@@ -104,7 +104,7 @@ fi
Check_OS() {
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
fi
@@ -474,7 +474,7 @@ for i in {1..50};
sleep 30
fi
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
}
@@ -490,12 +490,12 @@ else
fi
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
virtualenv -p /usr/bin/python3 --system-site-packages /usr/local/CyberPanel
Check_Return
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
echo -e "\nNothing found, need fresh setup...\n"
virtualenv -p /usr/bin/python3 --system-site-packages /usr/local/CyberPanel
@@ -562,9 +562,9 @@ fi
}
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 "\nIf nothing is input in 10 seconds , script will proceed with latest stable. "
echo -e "\nPlease press Enter key , or specify a version number ,or wait for 10 seconds timeout: "
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 the latest stable version. "
echo -e "\nPlease press the Enter key or specify a version number, or wait for 10 seconds: "
printf "%s" ""
read -r -t 10 Tmp_Input
if [[ $Tmp_Input = "" ]]; then
@@ -583,7 +583,7 @@ if [[ -f /usr/local/CyberCP/bin/python2 ]]; then
virtualenv -p /usr/bin/python3 /usr/local/CyberCP
Check_Return
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
virtualenv -p /usr/bin/python3 --system-site-packages /usr/local/CyberCP
Check_Return
@@ -751,7 +751,7 @@ if curl -I -XGET -k "https://127.0.0.1:${Panel_Port#*:}" | grep -q "200 OK" ; th
echo " CyberPanel Upgraded "
echo "###################################################################"
else
echo -e "\nSeems something wrong with upgarde, please check...\n"
echo -e "\nSeems something wrong with upgrade, please check...\n"
fi
rm -rf /root/cyberpanel_upgrade_tmp
}

View File

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

View File

@@ -92,7 +92,7 @@
</div>
<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 ng-hide="couldNotConnect" class="alert alert-danger">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>