Skip to content

Commit

Permalink
feat(filter): пресеты фильтров
Browse files Browse the repository at this point in the history
  • Loading branch information
popstas committed Sep 6, 2018
1 parent 74bcf16 commit 66020ed
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Быстрый фильтр по домену
- Сортировка по любому полю
- Подсветка результатов валидации site-info (каждая колонка)
- Пресеты колонок и фильтров

## Полезные фильтры:
- [Друпалы без кронов](https://dev.viasite.ru/viasite-projects/?q=site_info.engine%3Adrupal%20site_info.cron%3A0%20prod%3A1)
Expand Down Expand Up @@ -42,6 +43,4 @@ $ npm run generate

## TODO:
- запоминание выбранных фильтров
- пресеты фильтров
- менять в урле фильтр
- пресеты колонок
29 changes: 28 additions & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
<input class="filter__query" placeholder="query" v-model="q" title="Например:
site_info.engine:bitrix prod:1"/>

<div class="filter-presets">
filters:
<button
v-for="preset in filterPresets" :key="preset.name"
@click="q = preset.q" v-html="preset.name"></button>
</div>

<div class="column-presets">
columns:
<button
Expand Down Expand Up @@ -59,6 +66,12 @@
text-align: center;
}
.filter {
&__query {
padding: 5px;
width: 600px;
}
}
.VuePagination {
text-align: center;
}
Expand Down Expand Up @@ -174,7 +187,21 @@ export default {
name: 'cron',
columns: ['domain_idn', 'host', 'prod', 'site_info.cron']
}
}
},
filterPresets: [
{
name: 'bitrix',
q: 'site_info.engine:bitrix prod:1'
},
{
name: 'without cron',
q: 'site_info.engine:drupal prod:1 site_info.cron:0'
},
{
name: 'without git',
q: 'prod:1 site_info.git:0'
}
]
};
},
Expand Down

0 comments on commit 66020ed

Please sign in to comment.