lunch local

This commit is contained in:
Hassan Hashmi
2023-12-28 23:18:54 +05:00
parent d626ab49e7
commit 6e16902894
4 changed files with 54 additions and 27 deletions

View File

@@ -10533,9 +10533,13 @@ app.controller('listDockersite', function ($scope, $http) {
}); });
app.controller('ListDockersitecontainer', function ($scope, $http) { app.controller('ListDockersitecontainer', function ($scope, $http) {
$scope.conatinerview = true
$scope.cyberPanelLoading = true; $scope.cyberPanelLoading = true;
$scope.conatinerview = true
$('#cyberpanelLoading').hide();
$scope.getcontainer = function () { $scope.getcontainer = function () {
$('#cyberpanelLoading').show();
url = "/docker/getDockersiteList"; url = "/docker/getDockersiteList";
var data = {'name': $('#sitename').html()}; var data = {'name': $('#sitename').html()};
@@ -10550,9 +10554,11 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
function ListInitialData(response) { function ListInitialData(response) {
$('#cyberpanelLoading').hide();
if (response.data.status === 1) { if (response.data.status === 1) {
$scope.cyberPanelLoading = true;
var finalData = JSON.parse(response.data.data[1]); var finalData = JSON.parse(response.data.data[1]);
$scope.ContainerList = finalData; $scope.ContainerList = finalData;
@@ -10566,6 +10572,9 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
} }
function cantLoadInitialData(response) { function cantLoadInitialData(response) {
$scope.cyberPanelLoading = true;
$('#cyberpanelLoading').hide();
new PNotify({ new PNotify({
title: 'Operation Failed!', title: 'Operation Failed!',
text: 'Connect disrupted, refresh the page.', text: 'Connect disrupted, refresh the page.',
@@ -10575,9 +10584,15 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
} }
$scope.getcontainer() $scope.getcontainer()
$scope.cyberPanelLoading = true;
$scope.Lunchcontainer = function (containerid) { $scope.Lunchcontainer = function (containerid) {
// $scope.listcontainerview = true // $scope.listcontainerview = true
$scope.cyberpanelLoading = false
$('#cyberpanelLoading').show();
var url = "/docker/getContainerAppinfo"; var url = "/docker/getContainerAppinfo";
var data = { var data = {
@@ -10595,12 +10610,14 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
function ListInitialData(response) { function ListInitialData(response) {
$scope.conatinerview = false $scope.cyberpanelLoading = true
$('#cyberpanelLoading').hide();
// console.log(response); // console.log(response);
if (response.data.status === 1) { if (response.data.status === 1) {
console.log(response.data.data); console.log(response.data.data);
$scope.cid = response.data.data[1].id $scope.cid = response.data.data[1].id
$scope.status = response.data.data[1].status
$scope.appcpuUsage = 5 $scope.appcpuUsage = 5
$scope.appmemoryUsage = 9 $scope.appmemoryUsage = 9
$scope.cName = response.data.data[1].name $scope.cName = response.data.data[1].name
@@ -10618,6 +10635,8 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
} }
function cantLoadInitialData(response) { function cantLoadInitialData(response) {
$scope.cyberpanelLoading = true
$('#cyberpanelLoading').hide();
new PNotify({ new PNotify({
title: 'Operation Failed!', title: 'Operation Failed!',
text: 'Connect disrupted, refresh the page.', text: 'Connect disrupted, refresh the page.',
@@ -10628,7 +10647,8 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
$scope.getcontainerlog = function (containerid) { $scope.getcontainerlog = function (containerid) {
// $scope.listcontainerview = true $scope.cyberpanelLoading = false
var url = "/docker/getContainerApplog"; var url = "/docker/getContainerApplog";
@@ -10647,7 +10667,9 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
function ListInitialData(response) { function ListInitialData(response) {
$scope.cyberpanelLoading = true
$scope.conatinerview = false $scope.conatinerview = false
$('#cyberpanelLoading').hide();
$scope.logs = response.data.data[1]; $scope.logs = response.data.data[1];
@@ -10669,6 +10691,10 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
} }
function cantLoadInitialData(response) { function cantLoadInitialData(response) {
$scope.cyberpanelLoading = true
$('#cyberpanelLoading').hide();
$scope.conatinerview = false
new PNotify({ new PNotify({
title: 'Operation Failed!', title: 'Operation Failed!',
text: 'Connect disrupted, refresh the page.', text: 'Connect disrupted, refresh the page.',
@@ -10743,12 +10769,12 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
}; };
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData); $http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
function ListInitialData(response) { function ListInitialData(response) {
if (response.data.containerStatus === 1) { if (response.data.containerStatus === 1) {
console.log(response.data.status); console.log(response.data.status);
$scope.status = response.data.status; $scope.status = response.data.status;
} } else {
else {
new PNotify({ new PNotify({
title: 'Unable to complete request', title: 'Unable to complete request',
text: response.data.error_message, text: response.data.error_message,
@@ -10790,8 +10816,7 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
}); });
$scope.status = response.data.status; $scope.status = response.data.status;
$scope.refreshStatus() $scope.refreshStatus()
} } else {
else {
new PNotify({ new PNotify({
title: 'Unable to complete request', title: 'Unable to complete request',
text: response.data.error_message, text: response.data.error_message,
@@ -10839,6 +10864,7 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
}; };
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData); $http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
function ListInitialData(response) { function ListInitialData(response) {
if (response.data.delContainerStatus === 1) { if (response.data.delContainerStatus === 1) {
new PNotify({ new PNotify({
@@ -10847,8 +10873,7 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
type: 'success' type: 'success'
}); });
window.location.href = '/docker/listContainers'; window.location.href = '/docker/listContainers';
} } else {
else {
new PNotify({ new PNotify({
title: 'Unable to complete request', title: 'Unable to complete request',
text: response.data.error_message, text: response.data.error_message,

View File

@@ -17,7 +17,8 @@
<div class="container" ng-controller="ListDockersitecontainer"> <div class="container" ng-controller="ListDockersitecontainer">
<div id="page-title"> <div id="page-title">
<h2 id="domainNamePage">{% trans "Containers" %} <h2 id="domainNamePage">{% trans "Containers" %} <img id="cyberpanelLoading" ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
<a class="pull-right btn btn-primary" href="{% url "CreateDockersite" %}">Create</a> <a class="pull-right btn btn-primary" href="{% url "CreateDockersite" %}">Create</a>
</h2> </h2>
<p>{% trans "Manage containers on server" %}</p> <p>{% trans "Manage containers on server" %}</p>
@@ -42,7 +43,7 @@
{# <th>Owner</th>#} {# <th>Owner</th>#}
{# <th>Image</th>#} {# <th>Image</th>#}
{# <th>Tag</th>#} {# <th>Tag</th>#}
<th>Actions</th> {# <th>Actions</th>#}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -55,12 +56,12 @@
{# <td ng-bind="web.admin"></td>#} {# <td ng-bind="web.admin"></td>#}
{# <td ng-bind="web.image"></td>#} {# <td ng-bind="web.image"></td>#}
{# <td ng-bind="web.tag"></td>#} {# <td ng-bind="web.tag"></td>#}
<td> {# <td>#}
<button class="btn btn-primary" ng-click="delContainer(web.name)"><i {# <button class="btn btn-primary" ng-click="delContainer(web.name)"><i#}
class="fa fa-trash btn-icon"></i></button> {# class="fa fa-trash btn-icon"></i></button>#}
{# <button class="btn btn-primary" ng-click="showLog(web.name)"><i#} {# <button class="btn btn-primary" ng-click="showLog(web.name)"><i#}
{# class="fa fa-file btn-icon"></i></button>#} {# class="fa fa-file btn-icon"></i></button>#}
</td> {# </td>#}
</tr> </tr>
</tbody> </tbody>
@@ -263,7 +264,7 @@
<div class="panel"> <div class="panel">
<div class="panel-body"> <div class="panel-body">
<div class="example-box-wrapper"> <div class="example-box-wrapper">
<h3 class="title-hero" ng-init="status='{{ status }}'">Main Actions <h3 class="title-hero" >Main Actions
<img id="actionLoading" src="/static/images/loading.gif" <img id="actionLoading" src="/static/images/loading.gif"
style="display: none;width: 20px;"> style="display: none;width: 20px;">
</h3> </h3>
@@ -286,8 +287,7 @@
ng-click="cAction('stop')"><i ng-click="cAction('stop')"><i
class="fa fa-stop btn-icon"></i> Stop class="fa fa-stop btn-icon"></i> Stop
</button> </button>
<button class="btn btn-primary" ng-click="cRemove()">Remove
</button>
</div> </div>
</div> </div>
</div> </div>
@@ -308,7 +308,7 @@
<button type="button" class="close" <button type="button" class="close"
data-dismiss="modal">&times; data-dismiss="modal">&times;
</button> </button>
<h4 class="modal-title">{% trans "Backup logs" %} <img <h4 class="modal-title">{% trans "Recreate Container" %} <img
ng-hide="cyberPanelLoading" ng-hide="cyberPanelLoading"
src="{% static 'images/loading.gif' %}"> src="{% static 'images/loading.gif' %}">
</h4> </h4>

View File

@@ -90,10 +90,10 @@
<strong>CPU: </strong> <strong>CPU: </strong>
<span ng-bind="web.CPU" style="text-transform: none"></span> <span ng-bind="web.CPU" style="text-transform: none"></span>
</div> </div>
<div class="col-md-3 content-box-header"> {# <div class="col-md-3 content-box-header">#}
{##}
<span ng-bind="web.phpVersion"></span> {# <span ng-bind="web.phpVersion"></span>#}
</div> {# </div>#}
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
@@ -129,8 +129,7 @@
&times; &times;
</button> </button>
<h4 class="modal-title">Delete Package <h4 class="modal-title">Delete Package
<img ng-hide="cyberpanelLoading"
src="{% static 'images/loading.gif' %}">
</h4> </h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">

View File

@@ -2508,8 +2508,11 @@ class WebsiteManager:
else: else:
state = "Active" state = "Active"
dpkg = PackageAssignment.objects.get(user=website.admin)
dic = {'id':items.pk, 'domain': website.domain, 'adminEmail': website.adminEmail, 'ipAddress': ipAddress, dic = {'id':items.pk, 'domain': website.domain, 'adminEmail': website.adminEmail, 'ipAddress': ipAddress,
'admin': website.admin.userName, 'package': website.package.packageName, 'state': state, 'admin': website.admin.userName, 'package': dpkg.package.Name, 'state': state,
'CPU': int(items.CPUsMySQL)+int(items.CPUsSite), 'Ram': int(items.MemorySite)+int(items.MemoryMySQL), 'phpVersion': PHPVersionActual } 'CPU': int(items.CPUsMySQL)+int(items.CPUsSite), 'Ram': int(items.MemorySite)+int(items.MemoryMySQL), 'phpVersion': PHPVersionActual }
if checker == 0: if checker == 0: