New "post" storage (#733)

This commit is contained in:
Xavier Guimard 2016-02-13 12:31:01 +00:00
parent 9cf699bddb
commit 365701ee49
9 changed files with 40 additions and 28 deletions

View File

@ -20,4 +20,4 @@ describe('Lemonldap::NG', function() {
expect(browser.getCurrentUrl()).toMatch(new RegExp('^http://test1.example.com(:' + process.env.TESTWEBSERVERPORT + ')?'));
});
});
});
});

View File

@ -258,7 +258,7 @@ sub virtualHosts {
$res->{type} = 'rule';
}
elsif ( $query eq 'post' ) {
$res->{data} = [ split( /\|/, $vhk->{$r} ) ];
$res->{data} = $vhk->{$r};
$res->{type} = 'post';
}
push @$resp, $res;

View File

@ -218,13 +218,6 @@ sub _scanNodes {
if ( $base eq 'virtualHosts' ) {
hdebug(" virtualhost");
if ( $target =~ /^(?:locationRules|exportedHeaders|post)$/ ) {
if ( $target eq 'post'
and defined $leaf->{data}
and ref( $leaf->{data} ) eq 'ARRAY' )
{
hdebug(' post value');
$leaf->{data} = join '|', @{ $leaf->{data} };
}
if ( $leaf->{cnodes} ) {
hdebug(' unopened subnode');
$self->newConf->{$target}->{$key} =

View File

@ -9,19 +9,26 @@
</tr>
<tr>
<th><span trspan="postTargetUrl"></span></th>
<td><input id="pi2" class="form-control" ng-model="currentNode.data[0]"/></td>
<td><input id="pi2" class="form-control" ng-model="currentNode.data.target"/></td>
</tr>
<tr>
<th><span trspan="jqueryUrl"></span></th>
<td><input id="pi3" class="form-control" ng-model="currentNode.data[1]"/></td>
<td><input id="pi3" class="form-control" ng-model="currentNode.data.jqueryUrl"/></td>
</tr>
<tr>
<th><span trspan="jqueryFormSelector"></span></th>
<td><input id="pi4" class="form-control" ng-model="currentNode.data[2]"/></td>
<td><input id="pi4" class="form-control" ng-model="currentNode.data.formSelector"/></td>
</tr>
<tr>
<th><span trspan="jqueryButtonSelector"></span></th>
<td><input id="pi5" class="form-control" ng-model="currentNode.data[3]"/></td>
<td><input id="pi5" class="form-control" ng-model="currentNode.data.buttonSelector"/></td>
</tr>
<tr>
<th colspan="2" trspan="postedVars"></th>
</tr>
<tr ng-repeat="v in currentNode.data.vars">
<td><input class="form-control" ng-model="v[0]"/></td>
<td><input class="form-control" ng-model="v[1]"/></td>
</tr>
</table>
</div>
@ -29,6 +36,9 @@
buttons=[{
'title': 'newPost',
'icon': 'plus-sign'
},{
'title': 'newPostVar',
'icon': 'plus-sign'
},{
'title': 'deleteEntry',
'icon': 'minus-sign'

View File

@ -14,20 +14,20 @@
</thead>
<tbody>
<tr ng-repeat="s in currentNode.nodes">
<td ng-if="s.re!='default'">
<td>
<input class="form-control" ng-model="s.title"/>
</td>
<td ng-if="s.re!='default'">
<input class="form-control" ng-model="s.data[0]"/>
<td>
<input class="form-control" ng-model="s.data.target"/>
</td>
<td ng-if="s.re!='default'">
<input class="form-control" ng-model="s.data[1]"/>
<td>
<input class="form-control" ng-model="s.data.jqueryUrl"/>
</td>
<td ng-if="s.re!='default'">
<input class="form-control" ng-model="s.data[2]"/>
<td>
<input class="form-control" ng-model="s.data.formSelector"/>
</td>
<td ng-if="s.re!='default'">
<input class="form-control" ng-model="s.data[3]"/>
<td>
<input class="form-control" ng-model="s.data.buttonSelector"/>
</td>
<td>
<span class="link text-danger glyphicon glyphicon-minus-sign" ng-click="del(currentNode.nodes,$index)"/>

View File

@ -259,7 +259,7 @@
"data": 'Message',
"type": "grant"
});
}
};
/* Add rules entry */
$scope.newRule = function() {
@ -274,18 +274,23 @@
"data": 'accept',
"type": "rule"
});
}
};
/* Add form replay */
$scope.newPost = function() {
var node = $scope._findContainer();
node.nodes.push({
"id": node.id + '/n' + (id++),
"title": "https://my/form",
"data": [],
"title": "/absolute/path/to/form",
"data": {},
"type": "post"
});
}
};
$scope.newPostVar = function() {
if (typeof $scope.currentNode.data.vars === 'undefined') $scope.currentNode.data.vars = [];
$scope.currentNode.data.vars.push(['var1', '$uid']);
};
/* Add auth chain entry to authChoice */
$scope.newAuthChoice = function() {

File diff suppressed because one or more lines are too long

View File

@ -325,6 +325,7 @@
"newEntry": "New entry",
"newGrantRule": "New grant rule",
"newPost": "New form replay",
"newPostVar": "New variable",
"newRSAKey": "New keys",
"newRule": "New rule",
"next": "Next",
@ -486,6 +487,7 @@
"portalSkinRules": "Skin display rules",
"portalUserAttr": "User attribute",
"post": "Form replay",
"postedVars": "Variables to post",
"postUrl": "Form URL",
"postTargetUrl": "Form target URL (optional)",
"previous": "Previous",

View File

@ -325,6 +325,7 @@
"newEntry": "Nouvelle entrée",
"newGrantRule": "Nouvelle règle d'accès",
"newPost": "Nouveau rejeu de formulaire",
"newPostVar": "Nouvelle variable",
"newRSAKey": "Nouvelles clefs",
"newRule": "Nouvelle règle",
"next": "Suivante",
@ -486,6 +487,7 @@
"portalSkinRules": "Règles d'affichage du thème visuel",
"portalUserAttr": "Attribut de l'utilisateur",
"post": "Rejeu de formulaires",
"postedVars": "Variables à poster",
"postUrl": "URL du formulaire",
"postTargetUrl": "URL cible du formulaire (optionnel)",
"previous": "Précédente",