|
42 | 42 | </v-btn>
|
43 | 43 | </v-btn-toggle>
|
44 | 44 |
|
45 |
| - <v-simple-table v-if="tab === 'notOkServers'"> |
46 |
| - <template v-slot:default> |
47 |
| - <thead> |
48 |
| - <tr> |
49 |
| - <th style="width: 150px;">Server</th> |
50 |
| - <th style="width: 200px;">Task</th> |
51 |
| - <th style="width: calc(100% - 350px);">Error</th> |
52 |
| - </tr> |
53 |
| - </thead> |
54 |
| - <tbody> |
55 |
| - <tr v-if="!failedTasks || failedTasks.length === 0"> |
56 |
| - <td colspan="3" class="text-center">No failed tasks</td> |
57 |
| - </tr> |
58 |
| - <tr v-else v-for="(task, index) in failedTasks" :key="index"> |
59 |
| - <td style="width: 150px;">{{ task.host }}</td> |
60 |
| - <td style="width: 200px;">{{ task.task }}</td> |
61 |
| - <td> |
62 |
| - <div |
63 |
| - style="overflow: hidden; color: #ff5252; max-width: 400px; text-overflow: ellipsis"> |
64 |
| - {{ task.error }} |
65 |
| - </div> |
66 |
| - </td> |
67 |
| - </tr> |
| 45 | + <v-data-table |
| 46 | + v-if="tab === 'notOkServers'" |
| 47 | + hide-default-footer |
| 48 | + single-expand |
| 49 | + show-expand |
| 50 | + :headers="notOkServersHeaders" |
| 51 | + :items="failedTasks" |
| 52 | + :items-per-page="Number.MAX_VALUE" |
| 53 | + > |
| 54 | + <template v-slot:item.error="{ item }"> |
| 55 | + <div |
| 56 | + style="overflow: hidden; color: #ff5252; max-width: 400px; text-overflow: ellipsis"> |
| 57 | + {{ item.error }} |
| 58 | + </div> |
| 59 | + </template> |
| 60 | + <template v-slot:expanded-item="{ headers, item }"> |
| 61 | + <td |
| 62 | + :colspan="headers.length" |
| 63 | + > |
| 64 | + <pre style="overflow: auto; |
| 65 | + background: gray; |
| 66 | + font-size: 14px; |
| 67 | + color: white; |
| 68 | + border-radius: 10px; |
| 69 | + margin-top: 5px; margin-bottom: 5px;" |
68 | 70 |
|
69 |
| - </tbody> |
| 71 | + class="pa-2" |
| 72 | + >{{ item.error.trim() }}</pre> |
| 73 | + </td> |
70 | 74 | </template>
|
71 |
| - </v-simple-table> |
| 75 | + </v-data-table> |
| 76 | + |
| 77 | +<!-- <v-simple-table v-if="tab === 'notOkServers'">--> |
| 78 | +<!-- <template v-slot:default>--> |
| 79 | +<!-- <thead>--> |
| 80 | +<!-- <tr>--> |
| 81 | +<!-- <th style="width: 150px;">Server</th>--> |
| 82 | +<!-- <th style="width: 200px;">Task</th>--> |
| 83 | +<!-- <th style="width: calc(100% - 350px);">Error</th>--> |
| 84 | +<!-- </tr>--> |
| 85 | +<!-- </thead>--> |
| 86 | +<!-- <tbody>--> |
| 87 | +<!-- <tr v-if="!failedTasks || failedTasks.length === 0">--> |
| 88 | +<!-- <td colspan="3" class="text-center">No failed tasks</td>--> |
| 89 | +<!-- </tr>--> |
| 90 | + |
| 91 | +<!-- <tr v-else v-for="(task, index) in failedTasks" :key="index">--> |
| 92 | +<!-- <td style="width: 150px;">{{ task.host }}</td>--> |
| 93 | +<!-- <td style="width: 200px;">{{ task.task }}</td>--> |
| 94 | +<!-- <td>--> |
| 95 | +<!-- <div--> |
| 96 | +<!-- style="overflow: hidden; color: #ff5252; |
| 97 | +max-width: 400px; text-overflow: ellipsis">--> |
| 98 | +<!-- {{ task.error }}--> |
| 99 | +<!-- </div>--> |
| 100 | +<!-- </td>--> |
| 101 | +<!-- </tr>--> |
| 102 | + |
| 103 | +<!-- </tbody>--> |
| 104 | +<!-- </template>--> |
| 105 | +<!-- </v-simple-table>--> |
72 | 106 |
|
73 | 107 | <v-simple-table v-else-if="tab === 'allServers'">
|
74 | 108 | <template v-slot:default>
|
@@ -183,8 +217,21 @@ export default {
|
183 | 217 | okServers: 0,
|
184 | 218 | notOkServers: 0,
|
185 | 219 | tab: 'notOkServers',
|
186 |
| - failedTasks: null, |
| 220 | + failedTasks: [], |
187 | 221 | hosts: null,
|
| 222 | + notOkServersHeaders: [{ |
| 223 | + text: 'Server', |
| 224 | + value: 'host', |
| 225 | + sortable: false, |
| 226 | + }, { |
| 227 | + text: 'Task', |
| 228 | + value: 'task', |
| 229 | + sortable: false, |
| 230 | + }, { |
| 231 | + text: 'Error', |
| 232 | + value: 'error', |
| 233 | + sortable: false, |
| 234 | + }], |
188 | 235 | };
|
189 | 236 | },
|
190 | 237 |
|
|
0 commit comments