aboutsummaryrefslogtreecommitdiff
blob: 4df12073b771574f3a9de61c456104c3371e2433 (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2">

    <h1>
        <span>{{:: 'partial-import' | translate}}</span>
        <kc-tooltip>{{:: 'partial-import.tooltip' | translate}}</kc-tooltip>
    </h1>

    <form class="form-horizontal" name="partialImportForm" novalidate>
        <fieldset class="border-top">
            <div class="form-group">
                <label for="name" class="col-sm-2 control-label">{{:: 'exported-json-file' | translate}}</label>

                <div class="col-md-6" data-ng-hide="importing">
                    <label for="import-file" class="btn btn-default">{{:: 'select-file'| translate}} <i class="pficon pficon-import"></i></label>
                    <input id="import-file" type="file" class="hidden" kc-on-read-file="importFile($fileContent)"/>
                </div>

                <div class="col-md-6" data-ng-show="importing">
                    <button class="btn btn-default" data-ng-click="viewImportDetails()">{{:: 'view-details'| translate}}</button>
                    <button class="btn btn-default" data-ng-click="reset()">{{:: 'clear-import'| translate}}</button>
                </div>
            </div>

            <div class="form-group" data-ng-show="importing && isMultiRealm && !hasResults()">
                <label for="fromRealm" class="col-md-2 control-label">{{:: 'import-from-realm' | translate}}</label>
                <div class="col-md-2">
                    <div>
                        <select id="fromRealm" ng-model="fileContent" class="form-control" 
                                ng-options="item as item.realm for item in rawContent">
                        </select>
                    </div>
                </div>
            </div>

            <div class="form-group" data-ng-show="importing && hasArray('users') && !hasResults()">
                <label class="col-md-2 control-label" for="importUsers">{{:: 'import-users' | translate}} ({{itemCount('users')}})</label>
                <div class="col-sm-6">
                    <input ng-model="importUsers" name="importUsers" id="importUsers" onoffswitch on-text="{{:: 'onText'| translate}}" off-text="{{:: 'offText'| translate}}"/>
                </div>
            </div>

            <div class="form-group" data-ng-show="importing && hasArray('groups') && !hasResults()">
                <label class="col-md-2 control-label" for="importGroups">{{:: 'import-groups' | translate}} ({{itemCount('groups')}})</label>
                <div class="col-sm-6">
                    <input ng-model="importGroups" name="importGroups" id="importGroups" onoffswitch on-text="{{:: 'onText'| translate}}" off-text="{{:: 'offText'| translate}}"/>
                </div>
            </div>
            
            <div class="form-group" data-ng-show="importing && hasArray('clients') && !hasResults()">
                <label class="col-md-2 control-label" for="importClients">{{:: 'import-clients' | translate}} ({{itemCount('clients')}})</label>
                <div class="col-sm-6">
                    <input ng-model="importClients" name="importClients" id="importClients" onoffswitch on-text="{{:: 'onText'| translate}}" off-text="{{:: 'offText'| translate}}"/>
                </div>
            </div>

            <div class="form-group" data-ng-show="importing && hasArray('identityProviders') && !hasResults()">
                <label class="col-md-2 control-label" for="importIdentityProviders">{{:: 'import-identity-providers' | translate}} ({{itemCount('identityProviders')}})</label>
                <div class="col-sm-6">
                    <input ng-model="importIdentityProviders" name="importIdentityProviders" id="importIdentityProviders" onoffswitch on-text="{{:: 'onText'| translate}}" off-text="{{:: 'offText'| translate}}"/>
                </div>
            </div>

            <div class="form-group" data-ng-show="importing && hasRealmRoles() && !hasResults()">
                <label class="col-md-2 control-label" for="importRealmRoles">{{:: 'import-realm-roles' | translate}} ({{itemCount('roles.realm')}})</label>
                <div class="col-sm-6">
                    <input ng-model="importRealmRoles" name="importRealmRoles" id="importRealmRoles" onoffswitch on-text="{{:: 'onText'| translate}}" off-text="{{:: 'offText'| translate}}"/>
                </div>
            </div>

            <div class="form-group" data-ng-show="importing && hasClientRoles() && !hasResults()">
                <label class="col-md-2 control-label" for="importClientRoles">{{:: 'import-client-roles' | translate}} ({{itemCount('roles.client')}})</label>
                <div class="col-sm-6">
                    <input ng-model="importClientRoles" name="importClientRoles" id="importClientRoles" onoffswitch on-text="{{:: 'onText'| translate}}" off-text="{{:: 'offText'| translate}}"/>
                </div>
            </div>

            <div class="form-group" data-ng-show="importing && hasResources() && !hasResults()">
                <label for="ifResourceExists" class="col-md-2 control-label">{{:: 'if-resource-exists' | translate}}</label>
                <div class="col-md-2">
                    <div>
                        <select id="ifResourceExists" ng-model="ifResourceExists" class="form-control">
                            <option value="FAIL">{{:: 'fail' | translate}}</option>
                            <option value="SKIP">{{:: 'skip' | translate}}</option>
                            <option value="OVERWRITE">{{:: 'overwrite' | translate}}</option>
                        </select>
                    </div>
                </div>
                <kc-tooltip>{{:: 'if-resource-exists.tooltip' | translate}}</kc-tooltip>
            </div>
        </fieldset>

        <div class="form-group" data-ng-show="importing && hasResources() && !hasResults()">
            <div class="col-md-10 col-md-offset-2">
                <button kc-save data-ng-disabled="!changed">{{:: 'import'| translate}}</button>
            </div>
        </div>

        <div class="form-group" data-ng-show="hasResults()">
            {{successMessage()}}
            <table class="table table-striped table-bordered">
                <thead>
                    <tr>
                        <th>{{:: 'action' | translate}}</th>
                        <th>{{:: 'type' | translate}}</th>
                        <th>{{:: 'name' | translate}}</th>
                        <th>{{:: 'id' | translate}}</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="result in resultsPage()" >
                        <td ng-show="result.action == 'OVERWRITTEN'"><span class="label label-danger">{{result.action}}</span></td>
                        <td ng-show="result.action == 'SKIPPED'"><span class="label label-warning">{{result.action}}</span></td>
                        <td ng-show="result.action == 'ADDED'"><span class="label label-success">{{result.action}}</span></td>
                        <td>{{result.resourceType}}</td>
                        <td>{{result.resourceName}}</td>
                        <td>{{result.id}}</td>
                    </tr>
                </tbody>
            </table>
            
            <div class="table-nav">
                <button data-ng-click="setFirstPage()" class="first" ng-disabled="">{{:: 'first-page' | translate}}</button>
                <button data-ng-click="setPreviousPage()" class="prev" ng-disabled="!hasPrevious()">{{:: 'previous-page' | translate}}</button>
                <button data-ng-click="setNextPage()" class="next" ng-disabled="!hasNext()">{{:: 'next-page' | translate}}</button>
            </div>
        </div>
    </form>
</div>

<kc-menu></kc-menu>