Skip to content

Commit

Permalink
Internal Upgrade
Browse files Browse the repository at this point in the history
Trying to add internal Upgrade of CyberPanel
  • Loading branch information
master3395 committed Oct 15, 2023
1 parent 964141f commit 30bfdda
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 171 deletions.
135 changes: 64 additions & 71 deletions baseTemplate/templates/baseTemplate/versionManagment.html
Original file line number Diff line number Diff line change
@@ -1,87 +1,80 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "Version Management - CyberPanel" %}"{% endblock %}
{% block title %}{% trans "Version Management - CyberPanel" %}*{% endblock %}
{% block content %}

{% load static %}

<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">
<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 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">


<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>

</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>

</div>


</div>
{% endif %}

<div class="panel">
<div class="panel-body">
<h3 class="title-hero">
CyberPanel
</h3>
<div ng-controller="versionManagment" class="example-box-wrapper">
<form action="{% url 'upgrade_cyberpanel' %}" method="post">
{% csrf_token %}
<button type="submit">Upgrade CyberPanel</button>
</form>
<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 class="col-sm-12">
<textarea ng-model="upgradeLog" rows="30" class="form-control">{{ logs }}</textarea>
</div>
</div>



</form>




</div>
</div>
</div>
</div>



<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">
<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 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>
</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 %}
24 changes: 12 additions & 12 deletions baseTemplate/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
from . import views

urlpatterns = [
url(r'^$', views.renderBase, name='index'),
url(r'^getSystemStatus$',views.getSystemStatus, name='getSystemInformation'),
url(r'^getAdminStatus',views.getAdminStatus, name='getSystemInformation'),
url(r'^getLoadAverage',views.getLoadAverage, name='getLoadAverage'),
url(r'^versionManagment',views.versionManagment, name='versionManagment'),
url(r'^design', views.design, name='design'),
url(r'^getthemedata', views.getthemedata, name='getthemedata'),
path('', views.renderBase, name='index'),
path('getSystemStatus', views.getSystemStatus, name='getSystemInformation'),
path('getAdminStatus', views.getAdminStatus, name='getSystemInformation'),
path('getLoadAverage', views.getLoadAverage, name='getLoadAverage'),
path('versionManagment', views.versionManagement, name='versionManagement'),
path('design', views.design, name='design'),
path('getthemedata', views.getthemedata, name='getthemedata'),

#url(r'^upgrade',views.upgrade, name='upgrade'),
# Add this URL pattern for 'upgrade_cyberpanel'
path('upgrade_cyberpanel', views.upgrade_cyberpanel, name='upgrade_cyberpanel'),

url(r'^UpgradeStatus',views.upgradeStatus, name='UpgradeStatus'),
url(r'^upgradeVersion',views.upgradeVersion, name='upgradeVersion'),

]
path('UpgradeStatus', views.upgradeStatus, name='UpgradeStatus'),
path('upgradeVersion', views.upgradeVersion, name='upgradeVersion'),
]
Loading

0 comments on commit 30bfdda

Please sign in to comment.