Skip to content

Commit

Permalink
feat: Multiple UI improvements
Browse files Browse the repository at this point in the history
## Reports:
- Filter panel open when query not empty
- Select buttons replaced for switch and select
- Welcome screen for zero scans users
- Grayscaled secondary controls
- Minify paddings

## Scan:
- Server URL moved to "Settings" collapsed block
- Terminal window fits on first screen (any screen)
- Minify paddings
  • Loading branch information
popstas committed Dec 24, 2020
1 parent 512b67d commit e630fb5
Show file tree
Hide file tree
Showing 13 changed files with 660 additions and 216 deletions.
6 changes: 1 addition & 5 deletions components/Panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@
export default {
components: {},
props: ["icon", "title", "name"],
computed: {
tests() {
return this.$store.state.tests;
},
},
computed: {},
methods: {},
};
</script>
2 changes: 1 addition & 1 deletion components/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
.profile {
float: right;
margin: 10px 3px -10px 0;
margin: 20px 8px -20px 0;
a {
color: #000;
Expand Down
25 changes: 16 additions & 9 deletions components/ReportHistory.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div class="report-history" v-if="jsonUrlHistoryCount > 1">
<el-radio-group class="report-history__sort" v-model="currentJsonSort" size="mini">
<el-radio-button label="url">name</el-radio-button>
<el-radio-button label="added">date</el-radio-button>
<el-radio-button label="used">last used</el-radio-button>
</el-radio-group>
<el-select class="report-history__sort" v-model="currentJsonSort" size="mini">
<el-option value="url" label="sort by name">name</el-option>
<el-option value="added" label="sort by date">date</el-option>
<el-option value="used" label="sort by last used">last used</el-option>
</el-select>

<el-select size="mini" class="report-history__select" filterable placeholder="Report URL" v-model="itemsJsonUrl">
<el-option class="report-history__option"
Expand All @@ -17,8 +17,8 @@

<button :class="{'input-clear': true, hidden: !isCurrentJsonInHistory}" @click="removeCurrentFromHistory" title="Remove current report from history">&cross;</button>

<a :href="itemsJsonUrl" target="_blank">json</a>,
<a :href="getShareUrl(itemsJsonUrl)" target="_blank">share</a>
<a :href="getShareUrl(itemsJsonUrl)" target="_blank">share</a>,
<a :href="itemsJsonUrl" target="_blank">json</a>
<template v-if="$router.options.base == '/'">
, <a :href="shareProdUrl" target="_blank">prod</a>
</template>
Expand All @@ -27,14 +27,21 @@

<style lang="scss">
.report-history {
display: inline-block;
&__sort {
width: 128px;
margin: 4px 3px 0 0;
.el-radio-button__orig-radio:checked+.el-radio-button__inner {
input {
padding-left: 5px;
}
/* .el-radio-button__orig-radio:checked+.el-radio-button__inner {
background-color: #ccc;
border-color: #ccc;
box-shadow: -1px 0 0 0 #ccc;
}
} */
}
&__select {
Expand Down
5 changes: 5 additions & 0 deletions components/Toolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
@click="setPreset({name: 'none', columns: [$store.state.defaultField]});"
>✖ <span>remove all columns</span></button>

<button v-if="$store.state.columnPresets.default"
class="column-presets__button column-presets__button_icon"
@click="setPreset($store.state.columnPresets.default);"
><span>default columns</span></button>

<!-- <button
class="column-presets__button"
@click="getCSV"
Expand Down
13 changes: 9 additions & 4 deletions layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div>
<div id="panel">
<el-header height="64px">
<el-header height="65px">
<el-row>
<el-col :span="12">
<el-menu :default-active="activeIndex" class="" mode="horizontal" @select="handleSelect">
<el-menu :default-active="activeIndex" mode="horizontal" @select="handleSelect" class="header__menu">
<el-menu-item v-if="$store.state.serverUrl" index="1">Scan</el-menu-item>
<el-menu-item index="2">Results</el-menu-item>
</el-menu>
Expand Down Expand Up @@ -44,7 +44,7 @@ body {
overflow-x: auto;
}
footer {
padding: 20px;
padding: 20px 8px;
}
*, *:before, *:after {
Expand Down Expand Up @@ -108,7 +108,12 @@ export default {
components: {Profile},
computed: {
activeIndex() {
return $nuxt.$route.name === 'scan' ? '1' : '2';
const dict = {
scan: '1',
index: '2'
}
const val = dict[$nuxt.$route.name] || '0';
return val;
}
},
methods: {
Expand Down
7 changes: 7 additions & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ module.exports = {
'semantic-ui-vue/nuxt',
'@nuxtjs/axios',
'nuxt-socket-io',
'@nuxtjs/style-resources',
],

css: [
'element-ui/lib/theme-chalk/index.css'
],

styleResources: {
scss: [
'~/pages/index.scss',
]
},

plugins: [
'@/plugins/element-ui',
'@/plugins/localStorage',
Expand Down
Loading

0 comments on commit e630fb5

Please sign in to comment.