Can tab over tiles

This commit is contained in:
Alicia Sykes
2019-08-24 18:24:04 +01:00
parent 5e56e0c3c7
commit 7ffc35afb6
3 changed files with 40 additions and 19 deletions

View File

@@ -24,6 +24,10 @@ import * as linkData from './../data/item-data.json'
export default {
name: 'home',
props: {
title: { default: 'Panel', type: String },
subtitle: { default: 'All your server management tools in one place', type: String }
},
components: {
Header,
FilterTile,
@@ -39,18 +43,19 @@ export default {
searching (searchTile) {
this.searchTile = searchTile
},
getDomainFromUrl (url) {
var urlPattern = /^(?:https?:\/\/)?(?:w{3}\.)?([a-z\d\.-]+)\.(?:[a-z\.]{2,10})(?:[/\w\.-]*)*/;
var domainPattern = url.match(urlPattern);
return domainPattern? domainPattern[1] : ''
},
filterTiles (allTiles) {
return allTiles.filter(tile => {
const searchTerm = this.searchTile.toLowerCase()
return tile.title.toLowerCase().includes(searchTerm) ||
tile.description.toLowerCase().includes(searchTerm) ||
tile.url.toLowerCase().includes(searchTerm)
tile.provider.toLowerCase().includes(searchTerm) ||
this.getDomainFromUrl(tile.url).includes(searchTerm)
})
}
},
props: {
title: { default: 'Panel', type: String },
subtitle: { default: 'All your server management tools in one place', type: String }
}
}
</script>