|
21 | 21 | {% endif %} |
22 | 22 | </p> |
23 | 23 |
|
| 24 | + |
24 | 25 | <form method="post" |
25 | 26 | action="{{ routes.urlAdminTestFederationDiscovery }}" |
26 | | - class="pure-form pure-form-stacked"> |
| 27 | + class="pure-form pure-form-stacked form-with-loading-state"> |
27 | 28 |
|
28 | 29 | <fieldset> |
| 30 | + <legend>{{ 'Basic options'|trans }}</legend> |
29 | 31 | <label for="trustAnchorId">{{ 'Trust Anchor ID'|trans }}</label> |
30 | 32 | <input type="text" |
31 | 33 | name="trustAnchorId" |
|
35 | 37 | value="{{ trustAnchorId|default }}" |
36 | 38 | > |
37 | 39 | <span class="pure-form-message">Use any Trust Anchor ID for discovery</span> |
| 40 | + </fieldset> |
38 | 41 |
|
39 | | - <label for="forceRefresh">{{ 'Force refresh?'|trans }}</label> |
40 | | - <input type="checkbox" |
41 | | - name="forceRefresh" |
42 | | - id="forceRefresh" value="1" |
43 | | - {{ forceRefresh ? 'checked' : '' }} |
44 | | - > |
45 | | - <span class="pure-form-message"> |
46 | | - {% trans %}Check if you want to force the refresh of entities in federation.{% endtrans %} |
47 | | - </span> |
| 42 | + <details> |
| 43 | + <summary><strong>{{ 'Filtering'|trans }}</strong></summary> |
| 44 | + <fieldset> |
| 45 | + <label for="filterEntityTypes">{{ 'Entity Types'|trans }}</label> |
| 46 | + <select name="filterEntityTypes[]" id="filterEntityTypes" multiple class="full-width" style="height: 100px;"> |
| 47 | + {% for option in entityTypeOptions %} |
| 48 | + <option value="{{ option }}" {{ option in filterEntityTypes ? 'selected' : '' }}>{{ option }}</option> |
| 49 | + {% endfor %} |
| 50 | + </select> |
48 | 51 |
|
49 | | - <br> |
50 | | - <button type="submit" class="pure-button ">{{ (actionText|default('Submit'))|trans }}</button> |
51 | | - </fieldset> |
| 52 | + <label for="filterTrustMarkTypes">{{ 'Trust Mark Types (one per line)'|trans }}</label> |
| 53 | + <textarea name="filterTrustMarkTypes" id="filterTrustMarkTypes" class="full-width">{{ filterTrustMarkTypes }}</textarea> |
| 54 | + |
| 55 | + <label for="filterQuery">{{ 'Search Query'|trans }}</label> |
| 56 | + <input type="text" name="filterQuery" id="filterQuery" value="{{ filterQuery }}" class="full-width"> |
| 57 | + </fieldset> |
| 58 | + </details> |
| 59 | + |
| 60 | + <details> |
| 61 | + <summary><strong>{{ 'Sorting'|trans }}</strong></summary> |
| 62 | + <fieldset> |
| 63 | + <label for="sortBy">{{ 'Sort by'|trans }}</label> |
| 64 | + <select name="sortBy" id="sortBy" class="full-width"> |
| 65 | + <option value="entity_id" {{ sortBy == 'entity_id' ? 'selected' : '' }}>{{ 'Entity ID'|trans }}</option> |
| 66 | + <option value="display_name" {{ sortBy == 'display_name' ? 'selected' : '' }}>{{ 'Display Name'|trans }}</option> |
| 67 | + <option value="organization_name" {{ sortBy == 'organization_name' ? 'selected' : '' }}>{{ 'Organization Name'|trans }}</option> |
| 68 | + </select> |
| 69 | + |
| 70 | + <label for="sortOrder_asc" class="pure-radio"> |
| 71 | + <input type="radio" name="sortOrder" id="sortOrder_asc" value="asc" {{ sortOrder == 'asc' ? 'checked' : '' }}> |
| 72 | + {{ 'Ascending'|trans }} |
| 73 | + </label> |
| 74 | + <label for="sortOrder_desc" class="pure-radio"> |
| 75 | + <input type="radio" name="sortOrder" id="sortOrder_desc" value="desc" {{ sortOrder == 'desc' ? 'checked' : '' }}> |
| 76 | + {{ 'Descending'|trans }} |
| 77 | + </label> |
| 78 | + </fieldset> |
| 79 | + </details> |
| 80 | + |
| 81 | + <details> |
| 82 | + <summary><strong>{{ 'Pagination'|trans }}</strong></summary> |
| 83 | + <fieldset> |
| 84 | + <label for="pageLimit">{{ 'Page limit'|trans }}</label> |
| 85 | + <input type="number" name="pageLimit" id="pageLimit" value="{{ pageLimit }}" min="1" max="500"> |
| 86 | + <input type="hidden" name="pageFrom" value=""> |
| 87 | + </fieldset> |
| 88 | + </details> |
| 89 | + |
| 90 | + <br> |
| 91 | + <button type="submit" class="pure-button pure-button-primary" data-loading-text="{{ 'Discovering...'|trans }}">{{ (actionText|default('Submit'))|trans }}</button> |
52 | 92 | </form> |
53 | 93 |
|
54 | 94 | {% if isFormSubmitted|default %} |
| 95 | + <br> |
| 96 | + |
| 97 | + <hr> |
55 | 98 | <h4>{{ 'Log messages'|trans }}</h4> |
56 | 99 | <p> |
57 | 100 | {% if logMessages|default %} |
|
63 | 106 | {% endif %} |
64 | 107 | </p> |
65 | 108 |
|
66 | | - <h4>{{ 'Entities'|trans }}</h4> |
67 | | - <p> |
| 109 | + <div class="pure-g"> |
| 110 | + <div class="pure-u-1-2"> |
| 111 | + <h4>{{ 'Entities'|trans }}</h4> |
| 112 | + </div> |
| 113 | + <div class="pure-u-1-2" style="text-align: right;"> |
| 114 | + <p><strong>{{ 'Total matching entities:'|trans }} {{ totalCount }}</strong></p> |
| 115 | + </div> |
| 116 | + </div> |
| 117 | + |
68 | 118 | {% if entities|default %} |
69 | | - <code class="code-box code-box-content"> |
70 | | - {{- entities|json_encode(constant('JSON_PRETTY_PRINT') b-or constant('JSON_UNESCAPED_SLASHES')) -}} |
71 | | - </code> |
| 119 | + <table class="pure-table pure-table-horizontal full-width"> |
| 120 | + <thead> |
| 121 | + <tr> |
| 122 | + <th>{{ 'Entity ID'|trans }}</th> |
| 123 | + <th>{{ 'Display Name'|trans }}</th> |
| 124 | + <th>{{ 'Types'|trans }}</th> |
| 125 | + </tr> |
| 126 | + </thead> |
| 127 | + <tbody> |
| 128 | + {% for entity in entities %} |
| 129 | + <tr> |
| 130 | + <td style="word-break: break-all;">{{ entity.id }}</td> |
| 131 | + <td> |
| 132 | + {% set displayName = '' %} |
| 133 | + {% for type in entityTypeOptions %} |
| 134 | + {% if entity.payload.metadata[type].display_name is defined and displayName == '' %} |
| 135 | + {% set displayName = entity.payload.metadata[type].display_name %} |
| 136 | + {% endif %} |
| 137 | + {% endfor %} |
| 138 | + {{ displayName }} |
| 139 | + </td> |
| 140 | + <td> |
| 141 | + {% set types = [] %} |
| 142 | + {% for type in entityTypeOptions %} |
| 143 | + {% if entity.payload.metadata[type] is defined %} |
| 144 | + {% set types = types|merge([type]) %} |
| 145 | + {% endif %} |
| 146 | + {% endfor %} |
| 147 | + {{ types|join(', ') }} |
| 148 | + </td> |
| 149 | + </tr> |
| 150 | + {% endfor %} |
| 151 | + </tbody> |
| 152 | + </table> |
| 153 | + |
| 154 | + {% if nextPageToken %} |
| 155 | + <br> |
| 156 | + <form method="post" action="{{ routes.urlAdminTestFederationDiscovery }}" class="form-with-loading-state"> |
| 157 | + <input type="hidden" name="trustAnchorId" value="{{ trustAnchorId }}"> |
| 158 | + <input type="hidden" name="forceRefresh" value="{{ forceRefresh ? '1' : '0' }}"> |
| 159 | + {% for type in filterEntityTypes %} |
| 160 | + <input type="hidden" name="filterEntityTypes[]" value="{{ type }}"> |
| 161 | + {% endfor %} |
| 162 | + <input type="hidden" name="filterTrustMarkTypes" value="{{ filterTrustMarkTypes }}"> |
| 163 | + <input type="hidden" name="filterQuery" value="{{ filterQuery }}"> |
| 164 | + <input type="hidden" name="sortBy" value="{{ sortBy }}"> |
| 165 | + <input type="hidden" name="sortOrder" value="{{ sortOrder }}"> |
| 166 | + <input type="hidden" name="pageLimit" value="{{ pageLimit }}"> |
| 167 | + <input type="hidden" name="pageFrom" value="{{ nextPageToken }}"> |
| 168 | + <button type="submit" class="pure-button pure-button-primary" data-loading-text="{{ 'Loading...'|trans }}">{{ 'Next page'|trans }}</button> |
| 169 | + </form> |
| 170 | + {% endif %} |
72 | 171 | {% else %} |
73 | | - {{ 'No entities were found during the process.'|trans }} |
| 172 | + <p>{{ 'No entities were found matching the criteria.'|trans }}</p> |
74 | 173 | {% endif %} |
75 | | - </p> |
76 | 174 |
|
77 | 175 | {% endif %} |
78 | 176 |
|
|
0 commit comments