mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-09 23:06:16 +01:00
lunch container done
This commit is contained in:
@@ -1177,18 +1177,33 @@ class ContainerManager(multi.Thread):
|
|||||||
|
|
||||||
|
|
||||||
name = data['name']
|
name = data['name']
|
||||||
|
WPusername = data['WPusername']
|
||||||
|
WPemail = data['WPemail']
|
||||||
|
WPpasswd = data['WPpasswd']
|
||||||
|
|
||||||
dockersite = DockerSites.objects.get(SiteName=name)
|
dockersite = DockerSites.objects.get(SiteName=name)
|
||||||
#-------------------------delete or create docker site wala function call krna hai dekh kr kya kya data pass ho ga
|
|
||||||
# passdata = {}
|
passdata ={}
|
||||||
# passdata["JobID"] = None
|
data['JobID'] = ''
|
||||||
# passdata['name'] = name
|
data['Domain'] = dockersite.admin.domain
|
||||||
# passdata['numberOfLines'] = 50
|
data['domain'] = dockersite.admin.domain
|
||||||
# da = Docker_Sites(None, passdata)
|
data['WPemal'] = WPemail
|
||||||
# retdata = da.ContainerLogs()
|
data['Owner'] = dockersite.admin.admin.userName
|
||||||
|
data['userID'] = userID
|
||||||
|
data['MysqlCPU'] = dockersite.CPUsMySQL
|
||||||
|
data['MYsqlRam'] = dockersite.MemoryMySQL
|
||||||
|
data['SiteCPU'] = dockersite.CPUsSite
|
||||||
|
data['SiteRam'] = dockersite.MemorySite
|
||||||
|
data['sitename'] = dockersite.SiteName
|
||||||
|
data['WPusername'] = WPusername
|
||||||
|
data['WPpasswd'] = WPpasswd
|
||||||
|
data['externalApp'] = dockersite.admin.externalApp
|
||||||
|
|
||||||
|
da = Docker_Sites(None, passdata)
|
||||||
|
da.RebuildApp()
|
||||||
|
|
||||||
|
|
||||||
data_ret = {'status': 1, 'error_message': 'None', 'data':"retdata"}
|
data_ret = {'status': 1, 'error_message': 'None',}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|||||||
@@ -10534,6 +10534,7 @@ app.controller('listDockersite', function ($scope, $http) {
|
|||||||
|
|
||||||
app.controller('ListDockersitecontainer', function ($scope, $http) {
|
app.controller('ListDockersitecontainer', function ($scope, $http) {
|
||||||
$scope.conatinerview = true
|
$scope.conatinerview = true
|
||||||
|
$scope.cyberPanelLoading = true;
|
||||||
$scope.getcontainer = function () {
|
$scope.getcontainer = function () {
|
||||||
url = "/docker/getDockersiteList";
|
url = "/docker/getDockersiteList";
|
||||||
|
|
||||||
@@ -10602,7 +10603,7 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
|
|||||||
$scope.cid = response.data.data[1].id
|
$scope.cid = response.data.data[1].id
|
||||||
$scope.appcpuUsage = 5
|
$scope.appcpuUsage = 5
|
||||||
$scope.appmemoryUsage = 9
|
$scope.appmemoryUsage = 9
|
||||||
$scope.name = response.data.data[1].name
|
$scope.cName = response.data.data[1].name
|
||||||
$scope.port = response.data.data[1].name
|
$scope.port = response.data.data[1].name
|
||||||
$scope.getcontainerlog(containerid)
|
$scope.getcontainerlog(containerid)
|
||||||
} else {
|
} else {
|
||||||
@@ -10678,10 +10679,14 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
|
|||||||
|
|
||||||
|
|
||||||
$scope.recreateappcontainer = function () {
|
$scope.recreateappcontainer = function () {
|
||||||
|
$scope.cyberPanelLoading = false;
|
||||||
var url = "/docker/recreateappcontainer";
|
var url = "/docker/recreateappcontainer";
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
'name': $('#sitename').html(),
|
'name': $('#sitename').html(),
|
||||||
|
'WPusername': $scope.WPUsername,
|
||||||
|
'WPemail': $scope.adminEmail,
|
||||||
|
'WPpasswd': $scope.WPPassword,
|
||||||
};
|
};
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
@@ -10695,13 +10700,15 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
|
|||||||
|
|
||||||
function ListInitialData(response) {
|
function ListInitialData(response) {
|
||||||
$scope.conatinerview = false
|
$scope.conatinerview = false
|
||||||
$scope.logs = response.data.data[1];
|
$scope.cyberPanelLoading = true;
|
||||||
|
|
||||||
|
$scope.getcontainer()
|
||||||
|
|
||||||
|
|
||||||
if (response.data.status === 1) {
|
if (response.data.status === 1) {
|
||||||
new PNotify({
|
new PNotify({
|
||||||
title: 'Success!',
|
title: 'Success!',
|
||||||
text: 'Container info fetched.',
|
text: 'Container recreated',
|
||||||
type: 'success'
|
type: 'success'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -10716,6 +10723,8 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cantLoadInitialData(response) {
|
function cantLoadInitialData(response) {
|
||||||
|
$scope.cyberPanelLoading = true;
|
||||||
|
|
||||||
new PNotify({
|
new PNotify({
|
||||||
title: 'Operation Failed!',
|
title: 'Operation Failed!',
|
||||||
text: 'Connect disrupted, refresh the page.',
|
text: 'Connect disrupted, refresh the page.',
|
||||||
@@ -10723,4 +10732,141 @@ app.controller('ListDockersitecontainer', function ($scope, $http) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.refreshStatus = function () {
|
||||||
|
url = "/docker/getContainerStatus";
|
||||||
|
var data = {name: $scope.cName};
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$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 {
|
||||||
|
new PNotify({
|
||||||
|
title: 'Unable to complete request',
|
||||||
|
text: response.data.error_message,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialData(response) {
|
||||||
|
PNotify.error({
|
||||||
|
title: 'Unable to complete request',
|
||||||
|
text: "Problem in connecting to server"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
$scope.cAction = function (action) {
|
||||||
|
$('#actionLoading').show();
|
||||||
|
url = "/docker/doContainerAction";
|
||||||
|
var data = {name: $scope.cName, action: action};
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
|
||||||
|
|
||||||
|
|
||||||
|
function ListInitialData(response) {
|
||||||
|
console.log(response);
|
||||||
|
|
||||||
|
if (response.data.containerActionStatus === 1) {
|
||||||
|
new PNotify({
|
||||||
|
title: 'Success!',
|
||||||
|
text: 'Action completed',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
$scope.status = response.data.status;
|
||||||
|
$scope.refreshStatus()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
new PNotify({
|
||||||
|
title: 'Unable to complete request',
|
||||||
|
text: response.data.error_message,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
$('#actionLoading').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialData(response) {
|
||||||
|
PNotify.error({
|
||||||
|
title: 'Unable to complete request',
|
||||||
|
text: "Problem in connecting to server"
|
||||||
|
});
|
||||||
|
$('#actionLoading').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
$scope.cRemove = function () {
|
||||||
|
(new PNotify({
|
||||||
|
title: 'Confirmation Needed',
|
||||||
|
text: 'Are you sure?',
|
||||||
|
icon: 'fa fa-question-circle',
|
||||||
|
hide: false,
|
||||||
|
confirm: {
|
||||||
|
confirm: true
|
||||||
|
},
|
||||||
|
buttons: {
|
||||||
|
closer: false,
|
||||||
|
sticker: false
|
||||||
|
},
|
||||||
|
history: {
|
||||||
|
history: false
|
||||||
|
}
|
||||||
|
})).get().on('pnotify.confirm', function () {
|
||||||
|
$('#actionLoading').show();
|
||||||
|
|
||||||
|
url = "/docker/delContainer";
|
||||||
|
var data = {name: $scope.cName, unlisted: false};
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
|
||||||
|
function ListInitialData(response) {
|
||||||
|
if (response.data.delContainerStatus === 1) {
|
||||||
|
new PNotify({
|
||||||
|
title: 'Container deleted!',
|
||||||
|
text: 'Redirecting...',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
window.location.href = '/docker/listContainers';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
new PNotify({
|
||||||
|
title: 'Unable to complete request',
|
||||||
|
text: response.data.error_message,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$('#actionLoading').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialData(response) {
|
||||||
|
PNotify.error({
|
||||||
|
title: 'Unable to complete request',
|
||||||
|
text: "Problem in connecting to server"
|
||||||
|
});
|
||||||
|
$('#actionLoading').hide();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -196,11 +196,19 @@
|
|||||||
</div>
|
</div>
|
||||||
<div ng-hide="conatinerview">
|
<div ng-hide="conatinerview">
|
||||||
<div>
|
<div>
|
||||||
<div class="container">
|
|
||||||
|
|
||||||
<div id="page-title" ng-init="cName='{{ name }}'">
|
|
||||||
{# <h2 id="domainNamePage">{% trans "Manage Container" %}</h2>#}
|
<div id="page-title">
|
||||||
<p>{% trans "Currently managing: " %} {$ name $}</p>
|
<h2 id="domainNamePage">{% trans "Currently managing: " %} {$ cName $}
|
||||||
|
<button class="btn btn-warning pull-right" data-toggle="modal"
|
||||||
|
data-target="#Recreatedockerapp"><i
|
||||||
|
class="fa fa-refresh btn-icon"></i> Recreate
|
||||||
|
</button>
|
||||||
|
</h2>
|
||||||
|
<p>
|
||||||
|
{% trans "Container ID" %}: {$ cid $}
|
||||||
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -251,58 +259,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="panel">
|
|
||||||
<div class="panel-body">
|
|
||||||
<div class="example-box-wrapper">
|
|
||||||
{% trans "Container ID" %}: {$ cid $}
|
|
||||||
<br>
|
|
||||||
{% trans "Image" %}: {{ image }}
|
|
||||||
<span ng-show="'{{ image }}' == 'unknown:unknown'"
|
|
||||||
title="Actions involving container recreation cannot be executed">
|
|
||||||
<i class="fa fa-warning btn-icon"></i>
|
|
||||||
</span>
|
|
||||||
<br>
|
|
||||||
{% if ports %}
|
|
||||||
{% trans "Ports" %}: <br>
|
|
||||||
{% for iport, eport in ports.items %}
|
|
||||||
{{ iport }} {% trans "to" %} {{ eport }}<br>
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{# <button class="btn btn-warning" data-toggle="modal"#}
|
|
||||||
{# data-target="#settings"><i#}
|
|
||||||
{# class="fa fa-gear btn-icon"></i> Settings#}
|
|
||||||
{# </button>#}
|
|
||||||
<button class="btn btn-warning" ng-click="recreateappcontainer()"><i
|
|
||||||
class="fa fa-refresh btn-icon"></i> Recreate
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="example-box-wrapper">
|
|
||||||
|
|
||||||
<div class="panel panel-body">
|
|
||||||
|
|
||||||
<h3 class="content-box-header">
|
|
||||||
{% trans "Actions" %}
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="content-box-wrapper">
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
@@ -314,7 +270,8 @@
|
|||||||
<b>Status:</b> <span ng-bind="status"></span>
|
<b>Status:</b> <span ng-bind="status"></span>
|
||||||
<span ng-click='refreshStatus()' style="cursor:pointer;"
|
<span ng-click='refreshStatus()' style="cursor:pointer;"
|
||||||
class="pull-right"
|
class="pull-right"
|
||||||
title="Refresh status"><i class="fa fa-refresh btn-icon"></i></span>
|
title="Refresh status"><i
|
||||||
|
class="fa fa-refresh btn-icon"></i></span>
|
||||||
<hr>
|
<hr>
|
||||||
<button ng-disabled="status=='running'" class="btn btn-primary"
|
<button ng-disabled="status=='running'" class="btn btn-primary"
|
||||||
ng-click="cAction('start')"><i
|
ng-click="cAction('start')"><i
|
||||||
@@ -336,33 +293,76 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="panel">
|
</div>
|
||||||
<div class="panel-body">
|
</div>
|
||||||
<div class="example-box-wrapper">
|
|
||||||
<h3 class="title-hero" ng-init="rPolicy='{{ restartPolicy }}'">Other
|
|
||||||
Actions</h3>
|
</div>
|
||||||
<b>Restart on system reboot:</b> <span ng-bind="rPolicy"></span>
|
</div>
|
||||||
<hr>
|
<div id="Recreatedockerapp" class="modal fade" role="dialog">
|
||||||
<a href="/docker/exportContainer/?name={{ name }}"
|
<div class="modal-dialog modal-lg">
|
||||||
class="btn btn-primary">Export
|
<!-- Modal content-->
|
||||||
file</a>
|
<div class="modal-content">
|
||||||
<button class="btn btn-primary" ng-disabled="loadingTop"
|
<div class="modal-header">
|
||||||
ng-click="showTop()">
|
<button type="button" class="close"
|
||||||
View Process
|
data-dismiss="modal">×
|
||||||
|
</button>
|
||||||
|
<h4 class="modal-title">{% trans "Backup logs" %} <img
|
||||||
|
ng-hide="cyberPanelLoading"
|
||||||
|
src="{% static 'images/loading.gif' %}">
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form name="websiteCreationForm" action="/"
|
||||||
|
id="createPackages"
|
||||||
|
class="form-horizontal bordered-row panel-body">
|
||||||
|
<div ng-hide="installationDetailsForm"
|
||||||
|
class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Username" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input name="Username" type="text"
|
||||||
|
class="form-control"
|
||||||
|
ng-model="WPUsername"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ng-hide="installationDetailsForm"
|
||||||
|
class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Email" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input type="email" name="email"
|
||||||
|
class="form-control"
|
||||||
|
ng-model="adminEmail" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ng-hide="installationDetailsForm"
|
||||||
|
class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Password" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<input name="password" type="password"
|
||||||
|
class="form-control"
|
||||||
|
ng-model="WPPassword"
|
||||||
|
required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button class="btn btn-warning"
|
||||||
|
ng-click="recreateappcontainer()"> Recreate
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-default"
|
||||||
|
data-dismiss="modal"> Close
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="example-box-wrapper">
|
<div class="example-box-wrapper">
|
||||||
|
|
||||||
|
|||||||
@@ -109,6 +109,29 @@
|
|||||||
class="form-horizontal bordered-row panel-body">
|
class="form-horizontal bordered-row panel-body">
|
||||||
|
|
||||||
|
|
||||||
|
<div ng-hide="installationDetailsForm" class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Select Package" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select ng-model="packageForWebsite" class="form-control">
|
||||||
|
{% for items in packageList %}
|
||||||
|
<option>{{ items }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-hide="installationDetailsForm" class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">{% trans "Select Owner" %}</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select ng-model="websiteOwner" class="form-control">
|
||||||
|
{% for items in owernList %}
|
||||||
|
<option>{{ items }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div ng-hide="installationDetailsForm" class="form-group">
|
<div ng-hide="installationDetailsForm" class="form-group">
|
||||||
<label class="col-sm-3 control-label">{% trans "Domain Name" %}</label>
|
<label class="col-sm-3 control-label">{% trans "Domain Name" %}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
@@ -158,7 +181,9 @@
|
|||||||
OpenLiteSpeed + Apache (Backend) (For Ubuntu 22 and AlmaLinux 8)
|
OpenLiteSpeed + Apache (Backend) (For Ubuntu 22 and AlmaLinux 8)
|
||||||
{% else %}
|
{% else %}
|
||||||
<input ng-model="apacheBackend" type="checkbox" value="" disabled>
|
<input ng-model="apacheBackend" type="checkbox" value="" disabled>
|
||||||
OpenLiteSpeed + Apache (Backend) (For Ubuntu 22 and AlmaLinux 8) - <strong><a href="https://go.cyberpanel.net/ApacheRev">Premium Feature</a> <i class="p fa fa-external-link btn-icon"> </i></strong>
|
OpenLiteSpeed + Apache (Backend) (For Ubuntu 22 and AlmaLinux 8) -
|
||||||
|
<strong><a href="https://go.cyberpanel.net/ApacheRev">Premium Feature</a> <i
|
||||||
|
class="p fa fa-external-link btn-icon"> </i></strong>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user