Skip to content

Commit 1ffd16c

Browse files
authored
Add Refetch data button in top menu (#51)
* Add refetch data button in top menu
1 parent dc88f4c commit 1ffd16c

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes to `cybercog/laravel-paket` will be documented in this file.
77
### Added
88

99
- ([#48]) Added repositories tab
10+
- ([#51]) Added refetch data button in top menu
1011

1112
## [1.4.0]
1213

@@ -57,6 +58,7 @@ All notable changes to `cybercog/laravel-paket` will be documented in this file.
5758
[1.2.0]: https://github.com/cybercog/laravel-paket/compare/1.1.0...1.2.0
5859
[1.1.0]: https://github.com/cybercog/laravel-paket/compare/1.0.0...1.1.0
5960

61+
[#51]: https://github.com/cybercog/laravel-paket/pull/51
6062
[#48]: https://github.com/cybercog/laravel-paket/pull/48
6163
[#47]: https://github.com/cybercog/laravel-paket/pull/47
6264
[#42]: https://github.com/cybercog/laravel-paket/pull/42

resources/js/components/TopMenu.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@
3232
<span :class="getJobsBadgeClass()"></span>
3333
</router-link>
3434
</div>
35-
<div class="hidden">
36-
<a href="#console" class="inline-block text-sm px-4 py-2 leading-none border rounded text-white border-white hover:border-transparent hover:text-indigo-900 hover:bg-white mt-4 lg:mt-0">Console</a>
35+
<div>
36+
<button class="p-2 rounded bg-indigo-500 text-indigo-100 hover:bg-indigo-700 hover:text-white" v-on:click="refetchData()" title="Refetch data">
37+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" class="fill-current w-4 h-4">
38+
<path d="M10 3v2a5 5 0 0 0-3.54 8.54l-1.41 1.41A7 7 0 0 1 10 3zm4.95 2.05A7 7 0 0 1 10 17v-2a5 5 0 0 0 3.54-8.54l1.41-1.41zM10 20l-4-4 4-4v8zm0-12V0l4 4-4 4z"></path>
39+
</svg>
40+
</button>
3741
</div>
3842
</div>
3943
</nav>
@@ -43,6 +47,12 @@
4347
<script>
4448
export default {
4549
methods: {
50+
async refetchData() {
51+
await this.$store.dispatch('collectRequirements');
52+
await this.$store.dispatch('collectRepositories');
53+
await this.$store.dispatch('collectJobs');
54+
},
55+
4656
getJobsBadgeClass() {
4757
const activeJobs = this.$store.getters.getActiveJobs();
4858

0 commit comments

Comments
 (0)