Skip to content

Commit ccf5b25

Browse files
committed
feat: add refresh buttons to components index, logs, queue and scheduled
1 parent 3931205 commit ccf5b25

9 files changed

Lines changed: 55 additions & 4 deletions

File tree

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-index/index.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ Component.register('frosh-tools-tab-index', {
1313
}
1414
},
1515

16-
async created() {
17-
this.health = await this.FroshToolsService.healthStatus();
18-
this.isLoading = false;
16+
created() {
17+
this.createdComponent();
1918
},
2019

2120
computed: {
@@ -33,5 +32,17 @@ Component.register('frosh-tools-tab-index', {
3332
},
3433
];
3534
},
35+
},
36+
37+
methods: {
38+
async refresh() {
39+
this.isLoading = true;
40+
await this.createdComponent();
41+
},
42+
43+
async createdComponent() {
44+
this.health = await this.FroshToolsService.healthStatus();
45+
this.isLoading = false;
46+
},
3647
}
3748
})

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-index/template.twig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<sw-card-view>
22
<sw-card :title="$tc('frosh-tools.tabs.index.title')" :isLoading="isLoading" :large="true">
3+
4+
<template #toolbar>
5+
<!-- @todo: Make the refresh button fancy -->
6+
<sw-button variant="ghost" @click="refresh"><sw-icon :small="true" name="default-arrow-360-left"></sw-icon></sw-button>
7+
</template>
8+
39
<sw-data-grid
410
v-if="health"
511
:showSelection="false"

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-logs/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,22 @@ Component.register('frosh-tools-tab-logs', {
5757
},
5858

5959
methods: {
60+
async refresh() {
61+
this.isLoading = true;
62+
await this.createdComponent();
63+
await this.onFileSelected();
64+
},
65+
6066
async createdComponent() {
6167
this.logFiles = await this.FroshToolsService.getLogFiles();
6268
this.isLoading = false;
6369
},
6470

6571
async onFileSelected() {
72+
if (!this.selectedLogFile) {
73+
return;
74+
}
75+
6676
const logEntries = await this.FroshToolsService.getLogFile(
6777
this.selectedLogFile,
6878
(this.page - 1) * this.limit,

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-logs/template.twig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
@change="onFileSelected"
99
></sw-single-select>
1010

11+
<template #toolbar>
12+
<!-- @todo: Make the refresh button fancy -->
13+
<sw-button variant="ghost" @click="refresh"><sw-icon :small="true" name="default-arrow-360-left"></sw-icon></sw-button>
14+
</template>
15+
1116
<sw-data-grid
1217
:showSelection="false"
1318
:showActions="false"

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-queue/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ Component.register('frosh-tools-tab-queue', {
4444
},
4545

4646
methods: {
47+
async refresh() {
48+
this.isLoading = true;
49+
await this.createdComponent();
50+
},
4751
async createdComponent() {
4852
const criteria = new Criteria;
4953
criteria.addSorting(Criteria.sort('size', 'DESC'))

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-queue/template.twig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<sw-card-view>
22
<sw-card :title="$tc('frosh-tools.tabs.queue.title')" :isLoading="isLoading" :large="true">
3+
<template #toolbar>
4+
<!-- @todo: Make the refresh button fancy -->
5+
<sw-button variant="ghost" @click="refresh"><sw-icon :small="true" name="default-arrow-360-left"></sw-icon></sw-button>
6+
</template>
7+
38
<sw-entity-listing
49
:showSelection="false"
510
:fullPage="false"

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-scheduled/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ Component.register('frosh-tools-tab-scheduled', {
6262
},
6363

6464
methods: {
65+
async refresh() {
66+
this.isLoading = true;
67+
await this.createdComponent();
68+
},
6569
async createdComponent() {
6670
const criteria = new Criteria;
6771
criteria.addSorting(Criteria.sort('nextExecutionTime', 'ASC'));

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-scheduled/template.twig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<sw-card-view>
22
<sw-card :title="$tc('frosh-tools.tabs.scheduledTaskOverview.title')" :isLoading="isLoading" :large="true">
3+
4+
<template #toolbar>
5+
<!-- @todo: Make the refresh button fancy -->
6+
<sw-button variant="ghost" @click="refresh"><sw-icon :small="true" name="default-arrow-360-left"></sw-icon></sw-button>
7+
</template>
8+
39
<sw-entity-listing
410
:showSelection="false"
511
:fullPage="false"

src/Resources/public/administration/js/frosh-tools.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)