Usman Nasir
2020-05-09 00:07:56 +05:00
parent 97ae6eca28
commit 157da73ae2
3 changed files with 55 additions and 11 deletions

View File

@@ -5836,7 +5836,7 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) {
$scope.autoCommitCurrent = response.data.autoCommitCurrent;
$scope.autoPushCurrent = response.data.autoPushCurrent;
$scope.emailLogsCurrent = response.data.emailLogsCurrent;
$scope.currentCommands = response.data.commands;
document.getElementById("currentCommands").value = response.data.commands;
$scope.webhookCommandCurrent = response.data.webhookCommandCurrent;
} else {
$scope.gitTracking = false;
@@ -6677,17 +6677,40 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) {
url = "/websites/saveGitConfigurations";
var data = {
domain: $("#domain").text(),
folder: $scope.folder,
autoCommit: $scope.autoCommit,
autoPush: $scope.autoPush,
emailLogs: $scope.emailLogs,
commands: $scope.commands,
commands: document.getElementById("currentCommands").value,
webhookCommand: $scope.webhookCommand
};
if ($scope.autoCommit === undefined){
$scope.autoCommitCurrent = 'Never';
}else{
$scope.autoCommitCurrent = $scope.autoCommit;
}
if ($scope.autoPush === undefined){
$scope.autoPushCurrent = 'Never';
}else{
$scope.autoPushCurrent = $scope.autoPush;
}
if ($scope.emailLogs === undefined){
$scope.emailLogsCurrent = false;
}else{
$scope.emailLogsCurrent = $scope.emailLogs;
}
if ($scope.webhookCommand === undefined){
$scope.webhookCommandCurrent = false;
}else{
$scope.webhookCommandCurrent = $scope.webhookCommand;
}
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')

View File

@@ -5836,7 +5836,7 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) {
$scope.autoCommitCurrent = response.data.autoCommitCurrent;
$scope.autoPushCurrent = response.data.autoPushCurrent;
$scope.emailLogsCurrent = response.data.emailLogsCurrent;
$scope.currentCommands = response.data.commands;
document.getElementById("currentCommands").value = response.data.commands;
$scope.webhookCommandCurrent = response.data.webhookCommandCurrent;
} else {
$scope.gitTracking = false;
@@ -6677,17 +6677,40 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) {
url = "/websites/saveGitConfigurations";
var data = {
domain: $("#domain").text(),
folder: $scope.folder,
autoCommit: $scope.autoCommit,
autoPush: $scope.autoPush,
emailLogs: $scope.emailLogs,
commands: $scope.commands,
commands: document.getElementById("currentCommands").value,
webhookCommand: $scope.webhookCommand
};
if ($scope.autoCommit === undefined){
$scope.autoCommitCurrent = 'Never';
}else{
$scope.autoCommitCurrent = $scope.autoCommit;
}
if ($scope.autoPush === undefined){
$scope.autoPushCurrent = 'Never';
}else{
$scope.autoPushCurrent = $scope.autoPush;
}
if ($scope.emailLogs === undefined){
$scope.emailLogsCurrent = false;
}else{
$scope.emailLogsCurrent = $scope.emailLogs;
}
if ($scope.webhookCommand === undefined){
$scope.webhookCommandCurrent = false;
}else{
$scope.webhookCommandCurrent = $scope.webhookCommand;
}
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')

View File

@@ -189,8 +189,7 @@
<option>Weekly</option>
</select>
</div>
<div class="current-pack ng-binding">Currently: {$ autoCommitCurrent
$}
<div class="current-pack ng-binding">Currently: {$ autoCommitCurrent $}
</div>
</div>
@@ -234,10 +233,9 @@
<div class="form-group">
<label class="col-sm-3 control-label">{% trans "Commands" %}</label>
<div class="col-sm-9">
<textarea ng-model="$parent.commands"
placeholder="Add Commands to run after every commit, each line must contain one command only."
<textarea id="currentCommands"
rows="4"
class="form-control">{$ currentCommands $}</textarea>
class="form-control"></textarea>
</div>
</div>