aboutsummaryrefslogtreecommitdiff
blob: 1ee9aae35698340bf69cb588efbc25daa1b0dd9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<div>
    <div data-ng-repeat="option in properties" class="form-group" data-ng-controller="ProviderConfigCtrl">
        <label class="col-md-2 control-label">{{:: option.label | translate}}</label>

        <div class="col-md-6" data-ng-if="option.type == 'String'">
            <input class="form-control" type="text" data-ng-model="config[ option.name ]" >
        </div>
        <div class="col-md-6" data-ng-if="option.type == 'Password'">
            <input class="form-control" type="password" data-ng-model="config[ option.name ]" >
        </div>
        <div class="col-md-6" data-ng-if="option.type == 'boolean'">
            <input ng-model="config[ option.name ]" value="'true'" name="option.name" id="option.name" onoffswitchstring on-text="{{:: 'onText' | translate}}" off-text="{{:: 'offText' | translate}}"/>
        </div>
        <div class="col-md-6" data-ng-if="option.type == 'List'">
            <select ng-model="config[ option.name ]" ng-options="data for data in option.options">
                <option value="" selected> {{:: 'selectOne' | translate}} </option>
            </select>
        </div>
        <div class="col-md-6" data-ng-if="option.type == 'Role'">
            <div class="row">
                <div class="col-md-8">
                    <input kc-no-reserved-chars class="form-control" type="text" data-ng-model="config[ option.name ]" >
                </div>
                <div class="col-md-2">
                    <button type="button" data-ng-click="openRoleSelector(option.name, config)" class="btn btn-default" tooltip-placement="top" tooltip-trigger="mouseover mouseout" tooltip="{{:: 'selectRole.tooltip' | translate}}">{{:: 'selectRole.label' | translate}}</button>
                </div>
            </div>
        </div>
        <div class="col-md-4" data-ng-if="option.type == 'ClientList'">
            <input type="hidden" ui-select2="clientsUiSelect" id="clients" data-ng-init="initSelectedClient(option.name, config)" data-ng-model="selectedClient" data-ng-change="changeClient(option.name, config, selectedClient, false);" data-placeholder="{{:: 'selectOne' | translate}}...">
            </input>
        </div>

        <div class="col-md-6" data-ng-if="option.type == 'Script'">
            <div ng-model="config[option.name]" placeholder="Enter your script..." ui-ace="{ onLoad : initEditor, useWrapMode: true, showGutter: true, theme:'github', mode: 'javascript'}">
                {{config[option.name]}}
            </div>
        </div>

        <div class="col-sm-6" data-ng-if="option.type == 'MultivaluedString'">
            <div class="input-group" ng-repeat="(i, currentOption) in config[option.name] track by $index">
                <input class="form-control" ng-model="config[option.name][i]">
                <div class="input-group-btn" data-ng-if="$index < config[option.name].length - 1">
                    <button class="btn btn-default" type="button" data-ng-click="deleteValueFromMultivalued(option.name, $index)"><span class="fa fa-minus"></span></button>
                </div>

                <div class="input-group-btn" data-ng-if="$index === config[option.name].length - 1">
                    <button class="btn btn-default" type="button" data-ng-click="addValueToMultivalued(option.name)"><span class="fa fa-plus"></span></button>
                </div>
            </div>

        </div>

        <div class="col-md-6" data-ng-if="option.type == 'Text'">
            <textarea class="form-control" data-ng-model="config[ option.name ]"/>
        </div>

        <div class="col-md-6" data-ng-if="option.type == 'Map'">
            <table class="table table-striped table-bordered">
                <thead>
                <tr>
                    <th>{{:: 'key' | translate}}</th>
                    <th>{{:: 'value' | translate}}</th>
                    <th>{{:: 'actions' | translate}}</th>
                </tr>
                </thead>

                <tbody>
                <tr ng-repeat="mapEntry in jsonParseMap(option.name)">
                    <td>{{mapEntry['key']}}</td>
                    <td><input ng-model="mapEntry['value']"
                               ng-change="updateMapEntry(option.name, mapEntry['key'], mapEntry['value'])"
                               class="form-control" type="text" name="{{mapEntry['key']}}" id="mapValue-{{option.name}}-{{mapEntry['key']}}"/></td>
                    <td class="kc-action-cell" id="removeMapEntry-{{option.name}}" data-ng-click="removeMapEntry(option.name, mapEntry['key'])">{{:: 'delete' | translate}}
                    </td>
                </tr>
                <tr>
                    <td><input ng-model="newMapEntries[option.name].key" class="form-control" type="text" id="newMapEntryKey-{{option.name}}"/></td>
                    <td><input ng-model="newMapEntries[option.name].value" class="form-control" type="text" id="newMapEntryValue-{{option.name}}"/></td>
                    <td class="kc-action-cell" id="addMapEntry-{{option.name}}" data-ng-click="addMapEntry(option.name)"
                        data-ng-disabled="!newMapEntry.key.length || !newMapEntry.value.length">{{:: 'add' | translate}}
                    </td>
                </tr>

                </tbody>
            </table>
        </div>

        <kc-tooltip>{{:: option.helpText | translate}}</kc-tooltip>
    </div>
</div>