Duplication feature (Closes: #935)
This commit is contained in:
parent
2b6db9cd89
commit
82e306346f
|
@ -14,6 +14,10 @@
|
|||
buttons=[{
|
||||
"title": "addVhost",
|
||||
"icon": "plus-sign"
|
||||
},{
|
||||
"title": "duplicate",
|
||||
"action": "duplicateVhost",
|
||||
"icon": "copy"
|
||||
},{
|
||||
"title": "deleteEntry",
|
||||
"icon": "minus-sign"
|
||||
|
|
|
@ -379,6 +379,18 @@
|
|||
});
|
||||
};
|
||||
|
||||
$scope.duplicateVhost = function() {
|
||||
var name = $scope.domain ? ('.' + $scope.domain.data) : '.example.com';
|
||||
$scope.message = {
|
||||
"title": 'virtualHostName',
|
||||
"field": 'hostname'
|
||||
};
|
||||
$scope.showModal('prompt.html', name).then(function() {
|
||||
var name = $scope.result;
|
||||
return $scope.duplicateNode(name, 'virtualHost');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.addSamlIDP = function() {
|
||||
$scope.newTemplateNode('samlIDPMetaDataNode', 'samlPartnerName', 'idp-example');
|
||||
};
|
||||
|
@ -424,6 +436,18 @@
|
|||
return t;
|
||||
};
|
||||
|
||||
$scope.duplicateNode = function(name, type) {
|
||||
var cs = $scope.currentScope;
|
||||
while (cs.$modelValue.title != type + 's') {
|
||||
cs = cs.$parentNodeScope;
|
||||
}
|
||||
var t = JSON.parse(JSON.stringify($scope.currentNode));
|
||||
t.id = type + "s/" + 'new__' + name;
|
||||
t.title = name;
|
||||
cs.$modelValue.nodes.push(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
$scope.del = function(a, i) {
|
||||
a.splice(i, 1);
|
||||
};
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -165,6 +165,7 @@
|
|||
"domain": "Domain",
|
||||
"download": "Download",
|
||||
"downloadIt": "Download it",
|
||||
"duplicate": "Duplicate",
|
||||
"edit": "Edit",
|
||||
"editContent": "Edit content",
|
||||
"emptyConf": "Empty configuration",
|
||||
|
|
|
@ -165,6 +165,7 @@
|
|||
"domain": "Domaine",
|
||||
"download": "Télécharger",
|
||||
"downloadIt": "Télécharger",
|
||||
"duplicate": "Dupliquer",
|
||||
"edit": "Éditer",
|
||||
"editContent": "Éditer le contenu",
|
||||
"emptyConf": "Configuration vide",
|
||||
|
|
Loading…
Reference in New Issue
Block a user