Skip to content

Commit 0e74028

Browse files
authored
Merge branch 'main' into sec92-rate-limit-assistant
2 parents bbbebe0 + 01934d5 commit 0e74028

File tree

8 files changed

+366
-49
lines changed

8 files changed

+366
-49
lines changed

frontend/src/pages/application/Overview.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
:columns="cloudColumns"
2929
:rows="filteredRows"
3030
:show-search="true"
31+
:search="searchTerm"
3132
search-placeholder="Search Instances"
3233
:rows-selectable="true"
3334
@update:search="updateSearch"
@@ -174,6 +175,11 @@ export default {
174175
return this.teamMembership.role === Roles.Admin
175176
}
176177
},
178+
mounted () {
179+
if (this.$route?.query?.searchQuery) {
180+
this.searchTerm = this.$route.query.searchQuery
181+
}
182+
},
177183
methods: {
178184
selectedCloudRow (cloudInstance) {
179185
this.$router.push({

frontend/src/pages/team/Applications/components/Application.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
22
<ApplicationHeader :application="localApplication" />
33

4-
<InstancesWrapper :application="localApplication" :is-searching="isSearching" @delete-instance="onInstanceDelete" />
4+
<InstancesWrapper :application="localApplication" :search-query="searchQuery" @delete-instance="onInstanceDelete" />
55

6-
<DevicesWrapper :application="localApplication" :is-searching="isSearching" @delete-device="$emit('device-deleted')" />
6+
<DevicesWrapper :application="localApplication" :search-query="searchQuery" @delete-device="$emit('device-deleted')" />
77

88
<ConfirmInstanceDeleteDialog ref="confirmInstanceDeleteDialog" @confirm="onInstanceDeleted" />
99
</template>
@@ -29,10 +29,10 @@ export default {
2929
type: Object,
3030
required: true
3131
},
32-
isSearching: {
33-
type: Boolean,
32+
searchQuery: {
33+
type: String,
3434
required: false,
35-
default: false
35+
default: ''
3636
}
3737
},
3838
emits: ['instance-deleted', 'device-deleted'],

frontend/src/pages/team/Applications/components/compact/DevicesWrapper.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@
2727
>
2828
<DeviceTile :device="device" :application="application" @device-action="onDeviceAction" />
2929
</div>
30-
<div v-if="hasMoreDevices" class="has-more item-wrapper">
31-
<router-link :to="{name: 'ApplicationDevices', params: {id: application.id}}">
32-
<span>
33-
{{ remainingDevices }}
34-
More...
35-
</span>
36-
<ChevronRightIcon class="ff-icon" />
37-
</router-link>
38-
</div>
30+
<HasMoreTile
31+
v-if="hasMoreDevices"
32+
link-to="ApplicationDevices"
33+
:remaining="remainingDevices"
34+
:application="application"
35+
:search-query="searchQuery"
36+
/>
3937
</div>
4038

4139
<TeamDeviceCreateDialog
@@ -71,29 +69,28 @@
7169
</template>
7270

7371
<script>
74-
import { ChevronRightIcon } from '@heroicons/vue/solid'
75-
7672
import IconDeviceSolid from '../../../../../components/icons/DeviceSolid.js'
7773
import deviceActionsMixin from '../../../../../mixins/DeviceActions.js'
7874
import DeviceCredentialsDialog from '../../../Devices/dialogs/DeviceCredentialsDialog.vue'
7975
import TeamDeviceCreateDialog from '../../../Devices/dialogs/TeamDeviceCreateDialog.vue'
8076
8177
import DeviceTile from './DeviceTile.vue'
78+
import HasMoreTile from './HasMoreTile.vue'
8279
8380
export default {
8481
name: 'DevicesWrapper',
85-
components: { TeamDeviceCreateDialog, DeviceCredentialsDialog, ChevronRightIcon, IconDeviceSolid, DeviceTile },
82+
components: { HasMoreTile, TeamDeviceCreateDialog, DeviceCredentialsDialog, IconDeviceSolid, DeviceTile },
8683
mixins: [deviceActionsMixin],
8784
props: {
8885
application: {
8986
type: Object,
9087
required: true,
9188
default: null
9289
},
93-
isSearching: {
94-
type: Boolean,
90+
searchQuery: {
91+
type: String,
9592
required: false,
96-
default: false
93+
default: ''
9794
}
9895
},
9996
emits: ['delete-device'],
@@ -120,6 +117,9 @@ export default {
120117
},
121118
devices () {
122119
return this.application.devices.slice(0, 3)
120+
},
121+
isSearching () {
122+
return this.searchQuery.length > 0
123123
}
124124
},
125125
mounted () {
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<template>
2+
<div class="has-more item-wrapper" data-el="has-more-tile">
3+
<router-link :to="{name: linkTo, params: {id: application.id}, query: {searchQuery}}">
4+
<span>
5+
{{ remaining }}
6+
More...
7+
</span>
8+
<ChevronRightIcon class="ff-icon" />
9+
</router-link>
10+
</div>
11+
</template>
12+
13+
<script>
14+
import { ChevronRightIcon } from '@heroicons/vue/solid'
15+
16+
export default {
17+
name: 'HasMoreTile',
18+
components: { ChevronRightIcon },
19+
props: {
20+
application: {
21+
type: Object,
22+
required: true
23+
},
24+
remaining: {
25+
type: Number,
26+
required: true
27+
},
28+
linkTo: {
29+
type: String,
30+
required: true
31+
},
32+
searchQuery: {
33+
type: String,
34+
required: false,
35+
default: ''
36+
}
37+
}
38+
}
39+
</script>
40+
41+
<style scoped lang="scss">
42+
43+
</style>

frontend/src/pages/team/Applications/components/compact/InstancesWrapper.vue

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,37 @@
2727
>
2828
<InstanceTile :instance="instance" @delete-instance="$emit('delete-instance', $event)" />
2929
</div>
30-
<div v-if="hasMoreInstances" class="has-more item-wrapper">
31-
<router-link :to="{name: 'ApplicationInstances', params: {id: application.id}}">
32-
<span>
33-
{{ remainingInstances }}
34-
More...
35-
</span>
36-
<ChevronRightIcon class="ff-icon" />
37-
</router-link>
38-
</div>
30+
<HasMoreTile
31+
v-if="hasMoreInstances"
32+
link-to="ApplicationInstances"
33+
:remaining="remainingInstances"
34+
:application="application"
35+
:search-query="searchQuery"
36+
/>
3937
</div>
4038
</section>
4139
</template>
4240

4341
<script>
44-
import { ChevronRightIcon } from '@heroicons/vue/solid'
45-
4642
import IconNodeRedSolid from '../../../../../components/icons/NodeRedSolid.js'
4743
44+
import HasMoreTile from './HasMoreTile.vue'
45+
4846
import InstanceTile from './InstanceTile.vue'
4947
5048
export default {
5149
name: 'InstancesWrapper',
52-
components: { ChevronRightIcon, IconNodeRedSolid, InstanceTile },
50+
components: { HasMoreTile, IconNodeRedSolid, InstanceTile },
5351
props: {
5452
application: {
5553
type: Object,
5654
required: true,
5755
default: null
5856
},
59-
isSearching: {
60-
type: Boolean,
57+
searchQuery: {
58+
type: String,
6159
required: false,
62-
default: false
60+
default: ''
6361
}
6462
},
6563
emits: ['delete-instance'],
@@ -86,6 +84,9 @@ export default {
8684
},
8785
threeInstances () {
8886
return this.application.instanceCount === 3
87+
},
88+
isSearching () {
89+
return this.searchQuery.length > 0
8990
}
9091
}
9192
}

frontend/src/pages/team/Applications/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<li v-for="application in filteredApplications" :key="application.id" data-el="application-item">
4949
<ApplicationListItem
5050
:application="application"
51-
:is-searching="filterTerm.length > 0"
51+
:search-query="filterTerm"
5252
@instance-deleted="fetchData(false)"
5353
@device-deleted="fetchData(false)"
5454
/>

frontend/src/ui-components/components/data-table/DataTable.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export default {
194194
},
195195
filterTerm: {
196196
get () {
197-
return this.search
197+
return this.search || this.internalSearch
198198
},
199199
set (value) {
200200
const valueChanged = value !== this.internalSearch
@@ -259,6 +259,11 @@ export default {
259259
}
260260
}
261261
},
262+
mounted () {
263+
if (this.$route?.query?.searchQuery) {
264+
this.internalSearch = this.$route.query.searchQuery
265+
}
266+
},
262267
methods: {
263268
filterRows (rows) {
264269
const search = this.internalSearch

0 commit comments

Comments
 (0)