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

View File

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

View File

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

View File

@@ -2508,8 +2508,11 @@ class WebsiteManager:
else:
state = "Active"
dpkg = PackageAssignment.objects.get(user=website.admin)
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 }
if checker == 0: