mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
improvement: cron interface
This commit is contained in:
@@ -2830,6 +2830,8 @@ app.controller('manageCronController', function ($scope, $http) {
|
|||||||
$("#cronEditSuccess").hide();
|
$("#cronEditSuccess").hide();
|
||||||
$("#fetchCronFailure").hide();
|
$("#fetchCronFailure").hide();
|
||||||
|
|
||||||
|
$scope.websiteToBeModified = $("#domain").text();
|
||||||
|
|
||||||
$scope.fetchWebsites = function () {
|
$scope.fetchWebsites = function () {
|
||||||
|
|
||||||
$("#manageCronLoading").show();
|
$("#manageCronLoading").show();
|
||||||
@@ -2880,6 +2882,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
|||||||
$("#cronEditSuccess").hide();
|
$("#cronEditSuccess").hide();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
$scope.fetchWebsites();
|
||||||
|
|
||||||
$scope.fetchCron = function (cronLine) {
|
$scope.fetchCron = function (cronLine) {
|
||||||
|
|
||||||
@@ -3033,7 +3036,6 @@ app.controller('manageCronController', function ($scope, $http) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$scope.removeCron = function (line) {
|
$scope.removeCron = function (line) {
|
||||||
|
|
||||||
$("#manageCronLoading").show();
|
$("#manageCronLoading").show();
|
||||||
|
|||||||
@@ -2830,6 +2830,8 @@ app.controller('manageCronController', function ($scope, $http) {
|
|||||||
$("#cronEditSuccess").hide();
|
$("#cronEditSuccess").hide();
|
||||||
$("#fetchCronFailure").hide();
|
$("#fetchCronFailure").hide();
|
||||||
|
|
||||||
|
$scope.websiteToBeModified = $("#domain").text();
|
||||||
|
|
||||||
$scope.fetchWebsites = function () {
|
$scope.fetchWebsites = function () {
|
||||||
|
|
||||||
$("#manageCronLoading").show();
|
$("#manageCronLoading").show();
|
||||||
@@ -2880,6 +2882,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
|||||||
$("#cronEditSuccess").hide();
|
$("#cronEditSuccess").hide();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
$scope.fetchWebsites();
|
||||||
|
|
||||||
$scope.fetchCron = function (cronLine) {
|
$scope.fetchCron = function (cronLine) {
|
||||||
|
|
||||||
@@ -3033,7 +3036,6 @@ app.controller('manageCronController', function ($scope, $http) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$scope.removeCron = function (line) {
|
$scope.removeCron = function (line) {
|
||||||
|
|
||||||
$("#manageCronLoading").show();
|
$("#manageCronLoading").show();
|
||||||
|
|||||||
@@ -16,27 +16,19 @@
|
|||||||
<div class="panel">
|
<div class="panel">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<h3 class="title-hero">
|
<h3 class="title-hero">
|
||||||
{% trans "Cron Management" %} <img id="manageCronLoading" src="{% static 'images/loading.gif' %}">
|
{% trans "Cron Management" %} - <span id="domain">{{ domain }}</span> <img id="manageCronLoading" src="{% static 'images/loading.gif' %}">
|
||||||
</h3>
|
</h3>
|
||||||
<div class="example-box-wrapper">
|
<div class="example-box-wrapper">
|
||||||
|
|
||||||
|
|
||||||
<form action="/" class="form-horizontal bordered-row">
|
<form action="/" class="form-horizontal bordered-row">
|
||||||
|
|
||||||
|
<div style="padding-bottom: 0px; margin-bottom: 0px" class="form-group">
|
||||||
<div class="form-group">
|
<a style="margin-left: 1%" ng-click="addCronForm()" class="btn btn-border btn-alt border-blue btn-link font-blue" href="#" title=""><span>{% trans "Add Cron" %}</span></a>
|
||||||
<label class="col-sm-3 control-label">{% trans "Select Website" %} </label>
|
<a ng-click="fetchWebsites()" class="btn btn-border btn-alt border-blue btn-link font-blue" href="#" title=""><span>{% trans "Fetch Current Cron Jobs" %}</span></a>
|
||||||
<div class="col-sm-6">
|
|
||||||
<select ng-change="fetchWebsites()" ng-model="websiteToBeModified" class="form-control">
|
|
||||||
{% for items in websiteList %}
|
|
||||||
<option>{{ items }}</option>
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<button type="button" class="btn btn-primary" ng-click="fetchWebsites()" href=""><i class="glyph-icon icon-refresh" title="{% trans "Refresh" %}"></i></button>
|
|
||||||
<button type="button" class="btn btn-primary" ng-click="addCronForm()" href=""><i class="glyph-icon icon-plus" title="{% trans "Add Cron" %}"></i></button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
<!------ Modification form that appears after a click --------------->
|
<!------ Modification form that appears after a click --------------->
|
||||||
|
|
||||||
@@ -74,7 +66,6 @@
|
|||||||
<div id="modifyCronForm">
|
<div id="modifyCronForm">
|
||||||
<form action="/" class="form-horizontal bordered-row ng-scope ng-dirty ng-valid-parse ng-valid ng-valid-required">
|
<form action="/" class="form-horizontal bordered-row ng-scope ng-dirty ng-valid-parse ng-valid ng-valid-required">
|
||||||
<input type="hidden" ng-value="line" required="">
|
<input type="hidden" ng-value="line" required="">
|
||||||
<hr>
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">{% trans "Pre defined" %}</label>
|
<label class="col-sm-3 control-label">{% trans "Pre defined" %}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
|
|||||||
@@ -272,11 +272,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3 panel-body">
|
<div class="col-md-3 panel-body">
|
||||||
<a href="{% url 'listCron' %}" target="_blank" title="{% trans 'Add new Cron Job' %}"
|
<a href="{% url 'listCron' %}?domain={{ domain }}" target="_blank" title="{% trans 'Add new Cron Job' %}"
|
||||||
href="" title="{% trans 'List Domains' %}">
|
href="" title="{% trans 'List Domains' %}">
|
||||||
<img src="{% static 'images/icons/repeat.png' %}" width="65" class="mr-10">
|
<img src="{% static 'images/icons/repeat.png' %}" width="65" class="mr-10">
|
||||||
</a>
|
</a>
|
||||||
<a href="{% url 'listCron' %}" target="_blank" title="{% trans 'List Domains' %}"
|
<a href="{% url 'listCron' %}?domain={{ domain }}" target="_blank" title="{% trans 'Add new Cron Job' %}"
|
||||||
title="{% trans 'Add new Cron Job' %}">
|
title="{% trans 'Add new Cron Job' %}">
|
||||||
<span class="h4">{% trans "Cron Jobs" %}</span>
|
<span class="h4">{% trans "Cron Jobs" %}</span>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -131,9 +131,17 @@ class WebsiteManager:
|
|||||||
|
|
||||||
def listCron(self, request=None, userID=None, data=None):
|
def listCron(self, request=None, userID=None, data=None):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
admin = Administrator.objects.get(pk=userID)
|
||||||
|
|
||||||
|
if ACLManager.checkOwnership(request.GET.get('domain'), admin, currentACL) == 1:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
return ACLManager.loadError()
|
||||||
|
|
||||||
websitesName = ACLManager.findAllSites(currentACL, userID)
|
websitesName = ACLManager.findAllSites(currentACL, userID)
|
||||||
return render(request, 'websiteFunctions/listCron.html', {'websiteList': websitesName})
|
return render(request, 'websiteFunctions/listCron.html', {'domain': request.GET.get('domain'), 'websiteList': websitesName})
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user