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();
|
||||
$("#fetchCronFailure").hide();
|
||||
|
||||
$scope.websiteToBeModified = $("#domain").text();
|
||||
|
||||
$scope.fetchWebsites = function () {
|
||||
|
||||
$("#manageCronLoading").show();
|
||||
@@ -2880,6 +2882,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
$("#cronEditSuccess").hide();
|
||||
}
|
||||
};
|
||||
$scope.fetchWebsites();
|
||||
|
||||
$scope.fetchCron = function (cronLine) {
|
||||
|
||||
@@ -3033,7 +3036,6 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$scope.removeCron = function (line) {
|
||||
|
||||
$("#manageCronLoading").show();
|
||||
|
||||
@@ -2830,6 +2830,8 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
$("#cronEditSuccess").hide();
|
||||
$("#fetchCronFailure").hide();
|
||||
|
||||
$scope.websiteToBeModified = $("#domain").text();
|
||||
|
||||
$scope.fetchWebsites = function () {
|
||||
|
||||
$("#manageCronLoading").show();
|
||||
@@ -2880,6 +2882,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
$("#cronEditSuccess").hide();
|
||||
}
|
||||
};
|
||||
$scope.fetchWebsites();
|
||||
|
||||
$scope.fetchCron = function (cronLine) {
|
||||
|
||||
@@ -3033,7 +3036,6 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$scope.removeCron = function (line) {
|
||||
|
||||
$("#manageCronLoading").show();
|
||||
|
||||
@@ -16,27 +16,19 @@
|
||||
<div class="panel">
|
||||
<div class="panel-body">
|
||||
<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>
|
||||
<div class="example-box-wrapper">
|
||||
|
||||
|
||||
<form action="/" class="form-horizontal bordered-row">
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Select Website" %} </label>
|
||||
<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 style="padding-bottom: 0px; margin-bottom: 0px" 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>
|
||||
<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>
|
||||
|
||||
<hr>
|
||||
|
||||
<!------ Modification form that appears after a click --------------->
|
||||
|
||||
@@ -74,7 +66,6 @@
|
||||
<div id="modifyCronForm">
|
||||
<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="">
|
||||
<hr>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Pre defined" %}</label>
|
||||
<div class="col-sm-6">
|
||||
|
||||
@@ -272,11 +272,11 @@
|
||||
</div>
|
||||
|
||||
<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' %}">
|
||||
<img src="{% static 'images/icons/repeat.png' %}" width="65" class="mr-10">
|
||||
</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' %}">
|
||||
<span class="h4">{% trans "Cron Jobs" %}</span>
|
||||
</a>
|
||||
|
||||
@@ -131,9 +131,17 @@ class WebsiteManager:
|
||||
|
||||
def listCron(self, request=None, userID=None, data=None):
|
||||
try:
|
||||
|
||||
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)
|
||||
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:
|
||||
return HttpResponse(str(msg))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user