|
1 | 1 | <!-- |
2 | | - - Copyright 2014-2018 the original author or authors. |
| 2 | + - Copyright 2014-2019 the original author or authors. |
3 | 3 | - |
4 | 4 | - Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | - you may not use this file except in compliance with the License. |
|
25 | 25 | </thead> |
26 | 26 | <tbody :key="`${dispatcherName}_mappings`"> |
27 | 27 | <template v-for="(mapping, idx) in handlerMappings"> |
28 | | - <template v-if="mapping.details"> |
| 28 | + <template v-if="mapping.details && mapping.details.requestMappingConditions"> |
29 | 29 | <tr :key="`${dispatcherName}_${idx}_pattern`"> |
30 | | - <td |
31 | | - :rowspan="2 + countNonEmptyArrays(mapping.details.requestMappingConditions, 'methods', 'consumes', 'produces', 'params', 'headers')" |
32 | | - > |
33 | | - <div v-for="pattern in mapping.details.requestMappingConditions.patterns" |
34 | | - :key="`${dispatcherName}_${idx}_${pattern}`" |
| 30 | + <td :rowspan="computeRowSpanForMapping(mapping)"> |
| 31 | + <div |
| 32 | + v-for="pattern in mapping.details.requestMappingConditions.patterns" |
| 33 | + :key="`${dispatcherName}_${idx}_${pattern}`" |
35 | 34 | > |
36 | 35 | <code v-text="pattern" /> |
37 | 36 | </div> |
38 | 37 | </td> |
39 | 38 | </tr> |
40 | | - |
41 | | - <tr v-if="mapping.details.requestMappingConditions.methods.length" |
42 | | - :key="`${dispatcherName}_${idx}_methods`" |
| 39 | + <tr |
| 40 | + v-if="mapping.details.requestMappingConditions.methods.length" |
| 41 | + :key="`${dispatcherName}_${idx}_methods`" |
43 | 42 | > |
44 | 43 | <th class="is-narrow"> |
45 | 44 | <small>Methods</small> |
46 | 45 | </th> |
47 | | - <td class="monospaced is-breakable" v-text="mapping.details.requestMappingConditions.methods.join(', ')" /> |
| 46 | + <td |
| 47 | + class="monospaced is-breakable" |
| 48 | + v-text="mapping.details.requestMappingConditions.methods.join(', ')" |
| 49 | + /> |
48 | 50 | </tr> |
49 | | - |
50 | | - <tr v-if="mapping.details.requestMappingConditions.consumes.length" |
51 | | - :key="`${dispatcherName}_${idx}_consumes`" |
| 51 | + <tr |
| 52 | + v-if="mapping.details.requestMappingConditions.consumes.length" |
| 53 | + :key="`${dispatcherName}_${idx}_consumes`" |
52 | 54 | > |
53 | 55 | <th class="is-narrow"> |
54 | 56 | <small>Consumes</small> |
55 | 57 | </th> |
56 | | - <td class="monospaced is-breakable" v-text="mediaTypePredicates(mapping.details.requestMappingConditions.consumes)" /> |
| 58 | + <td |
| 59 | + class="monospaced is-breakable" |
| 60 | + v-text="mediaTypePredicates(mapping.details.requestMappingConditions.consumes)" |
| 61 | + /> |
57 | 62 | </tr> |
58 | | - |
59 | | - <tr v-if="mapping.details.requestMappingConditions.produces.length" |
60 | | - :key="`${dispatcherName}_${idx}_produces`" |
| 63 | + <tr |
| 64 | + v-if="mapping.details.requestMappingConditions.produces.length" |
| 65 | + :key="`${dispatcherName}_${idx}_produces`" |
61 | 66 | > |
62 | 67 | <th class="is-narrow"> |
63 | 68 | <small>Produces</small> |
64 | 69 | </th> |
65 | | - <td class="monospaced is-breakable" v-text="mediaTypePredicates(mapping.details.requestMappingConditions.produces)" /> |
| 70 | + <td |
| 71 | + class="monospaced is-breakable" |
| 72 | + v-text="mediaTypePredicates(mapping.details.requestMappingConditions.produces)" |
| 73 | + /> |
66 | 74 | </tr> |
67 | | - |
68 | | - <tr v-if="mapping.details.requestMappingConditions.params.length" |
69 | | - :key="`${dispatcherName}_${idx}_params`" |
| 75 | + <tr |
| 76 | + v-if="mapping.details.requestMappingConditions.params.length" |
| 77 | + :key="`${dispatcherName}_${idx}_params`" |
70 | 78 | > |
71 | 79 | <th class="is-narrow"> |
72 | 80 | <small>Parameters</small> |
73 | 81 | </th> |
74 | | - <td class="monospaced is-breakable" v-text="paramPredicates(mapping.details.requestMappingConditions.params)" /> |
| 82 | + <td class="monospaced is-breakable" |
| 83 | + v-text="paramPredicates(mapping.details.requestMappingConditions.params)" |
| 84 | + /> |
75 | 85 | </tr> |
76 | | - |
77 | | - <tr v-if="mapping.details.requestMappingConditions.headers.length" |
78 | | - :key="`${dispatcherName}_${idx}_headers`" |
| 86 | + <tr |
| 87 | + v-if="mapping.details.requestMappingConditions.headers.length" |
| 88 | + :key="`${dispatcherName}_${idx}_headers`" |
79 | 89 | > |
80 | 90 | <th class="is-narrow"> |
81 | 91 | <small>Headers</small> |
82 | 92 | </th> |
83 | | - <td class="monospaced is-breakable" v-text="paramPredicates(mapping.details.requestMappingConditions.headers)" /> |
| 93 | + <td class="monospaced is-breakable" |
| 94 | + v-text="paramPredicates(mapping.details.requestMappingConditions.headers)" |
| 95 | + /> |
84 | 96 | </tr> |
85 | | - |
86 | 97 | <tr :key="`${dispatcherName}_${idx}_handler`"> |
87 | 98 | <th class="is-narrow"> |
88 | 99 | <small>Handler</small> |
89 | 100 | </th> |
90 | 101 | <td class="is-breakable" v-text="mapping.handler" /> |
91 | 102 | </tr> |
| 103 | + <tr |
| 104 | + v-if="mapping.details.handlerMethod" |
| 105 | + :key="`${dispatcherName}_${idx}_handlermethod`" |
| 106 | + > |
| 107 | + <th class="is-narrow"> |
| 108 | + <small>Handler Method</small> |
| 109 | + </th> |
| 110 | + <td |
| 111 | + class="is-breakable" |
| 112 | + v-text="`${mapping.details.handlerMethod.className}#${mapping.details.handlerMethod.name}`" |
| 113 | + /> |
| 114 | + </tr> |
92 | 115 | </template> |
93 | 116 | <tr v-else :key="`${dispatcherName}_${idx}`"> |
94 | 117 | <td><code v-text="mapping.predicate" /></td> |
|
112 | 135 | } |
113 | 136 | }, |
114 | 137 | methods: { |
| 138 | + computeRowSpanForMapping(mapping) { |
| 139 | + return 2 + this.countNonEmptyArrays(mapping.details.requestMappingConditions, 'methods', 'consumes', 'produces', 'params', 'headers') + (mapping.details.handlerMethod ? 1 : 0); |
| 140 | + }, |
115 | 141 | countNonEmptyArrays(obj, ...keys) { |
116 | 142 | return keys.map(key => obj[key]).filter(a => a && a.length).length; |
117 | 143 | }, |
|
0 commit comments