slim fit filters to tool bar

This commit is contained in:
Peter Olu 2022-05-04 09:43:48 +01:00
parent 36f3adf6de
commit 7708087180
2 changed files with 30 additions and 16 deletions

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<div class="dashboard-tool flex-h"> <div class="dashboard-tool flex-h">
<div class="dashboard-tool flex-h"> <div class="flex-h">
<div class="flex-h"> <div class="flex-h">
<div class="selectors-item" v-if="key !== 10"> <div class="selectors-item" v-if="key !== 10">
<el-tooltip <el-tooltip
@ -24,9 +24,11 @@ limitations under the License. -->
placement="top-start" placement="top-start"
> >
<el-button <el-button
style="margin-left: 4px" v-if="!selectedSelector.length || selectedSelector === '$service'"
@click="setSelectedSelector('$service')" @click="setSelectedSelector('$service')"
class="tool-btn"
type="secondary" type="secondary"
size="xs"
> >
<Icon size="sm" iconName="playlist_add" /> <Icon size="sm" iconName="playlist_add" />
</el-button> </el-button>
@ -45,7 +47,7 @@ limitations under the License. -->
<el-button <el-button
style="margin-left: 4px" style="margin-left: 4px"
v-if="selectedSelector === '$service'" v-if="selectedSelector === '$service'"
class="search-btn" class="search-btn tool-btn"
size="small" size="small"
type="danger" type="danger"
@click="closeSelector" @click="closeSelector"
@ -55,6 +57,7 @@ limitations under the License. -->
</div> </div>
<div class="selectors-item" v-if="key === 3 || key === 4"> <div class="selectors-item" v-if="key === 3 || key === 4">
<el-tooltip <el-tooltip
v-if="!selectedSelector.length || selectedSelector === '$endpoint'"
class="box-item" class="box-item"
effect="dark" effect="dark"
content="Endpoint" content="Endpoint"
@ -63,6 +66,7 @@ limitations under the License. -->
<el-button <el-button
style="margin-left: 4px" style="margin-left: 4px"
@click="setSelectedSelector('$endpoint')" @click="setSelectedSelector('$endpoint')"
class="tool-btn"
type="secondary" type="secondary"
> >
<Icon size="sm" iconName="view" /> <Icon size="sm" iconName="view" />
@ -88,7 +92,7 @@ limitations under the License. -->
['EndpointRelation', 'Endpoint'].includes(dashboardStore.entity) ['EndpointRelation', 'Endpoint'].includes(dashboardStore.entity)
" "
/> />
<!-- <el-button <el-button
style="margin-left: 4px" style="margin-left: 4px"
v-if="selectedSelector === '$endpoint'" v-if="selectedSelector === '$endpoint'"
class="search-btn" class="search-btn"
@ -97,7 +101,7 @@ limitations under the License. -->
@click="closeSelector" @click="closeSelector"
> >
<Icon iconSize="sm" iconName="cancel" /> <Icon iconSize="sm" iconName="cancel" />
</el-button> --> </el-button>
</div> </div>
<div class="selectors-item" v-if="key === 2 || key === 4"> <div class="selectors-item" v-if="key === 2 || key === 4">
<span class="label">$DestinationService</span> <span class="label">$DestinationService</span>
@ -431,6 +435,7 @@ async function getServices() {
} }
async function changeService(service: any) { async function changeService(service: any) {
selectedSelector.value = ""
if (service[0]) { if (service[0]) {
states.currentService = service[0].value; states.currentService = service[0].value;
selectorStore.setCurrentService(service[0]); selectorStore.setCurrentService(service[0]);
@ -450,6 +455,7 @@ function changeDestService(service: any) {
} }
function changePods(pod: any) { function changePods(pod: any) {
selectedSelector.value = ""
if (pod[0]) { if (pod[0]) {
selectorStore.setCurrentPod(pod[0]); selectorStore.setCurrentPod(pod[0]);
} else { } else {
@ -705,6 +711,7 @@ watch(
background: rgb(240, 242, 245); background: rgb(240, 242, 245);
border-bottom: 1px solid #dfe4e8; border-bottom: 1px solid #dfe4e8;
justify-content: space-between; justify-content: space-between;
align-items: center;
} }
.switch { .switch {
@ -751,4 +758,8 @@ watch(
.selectorPod { .selectorPod {
width: 300px; width: 300px;
} }
.tool-btn{
height: 18px;
}
</style> </style>

View File

@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<div class="flex-h row"> <div class="flex-h">
<div class="flex-h"> <div class="flex-h">
<el-tooltip <el-tooltip
v-if="!activeFilter.length || activeFilter === 'service'" v-if="!activeFilter.length || activeFilter === 'service'"
@ -22,7 +22,7 @@ limitations under the License. -->
content="Service" content="Service"
placement="top-start" placement="top-start"
> >
<el-button @click="setFilter('service')" type="secondary"> <el-button class="filter-btn" @click="setFilter('service')" type="secondary">
<Icon size="sm" iconName="cloud_queue" /> <Icon size="sm" iconName="cloud_queue" />
</el-button> </el-button>
</el-tooltip> </el-tooltip>
@ -34,7 +34,7 @@ limitations under the License. -->
content="Instance" content="Instance"
placement="top-start" placement="top-start"
> >
<el-button @click="setFilter('instance')" type="secondary"> <el-button class="filter-btn" @click="setFilter('instance')" type="secondary">
<Icon size="sm" iconName="storage" /> <Icon size="sm" iconName="storage" />
</el-button> </el-button>
</el-tooltip> </el-tooltip>
@ -46,7 +46,7 @@ limitations under the License. -->
content="Status" content="Status"
placement="top-start" placement="top-start"
> >
<el-button @click="setFilter('status')" type="secondary"> <el-button class="filter-btn" @click="setFilter('status')" type="secondary">
<Icon size="sm" iconName="device_hub" /> <Icon size="sm" iconName="device_hub" />
</el-button> </el-button>
</el-tooltip> </el-tooltip>
@ -58,7 +58,7 @@ limitations under the License. -->
content="Duration" content="Duration"
placement="top-start" placement="top-start"
> >
<el-button @click="setFilter('duration')" type="secondary"> <el-button class="filter-btn" @click="setFilter('duration')" type="secondary">
<Icon size="sm" iconName="av_timer" /> <Icon size="sm" iconName="av_timer" />
</el-button> </el-button>
</el-tooltip> </el-tooltip>
@ -70,7 +70,7 @@ limitations under the License. -->
content="Trace ID" content="Trace ID"
placement="top-start" placement="top-start"
> >
<el-button @click="setFilter('traceId')" type="secondary"> <el-button class="filter-btn" @click="setFilter('traceId')" type="secondary">
<Icon size="sm" iconName="timeline" /> <Icon size="sm" iconName="timeline" />
</el-button> </el-button>
</el-tooltip> </el-tooltip>
@ -82,7 +82,7 @@ limitations under the License. -->
content="Tags" content="Tags"
placement="top-start" placement="top-start"
> >
<el-button @click="setFilter('tags')" type="secondary"> <el-button class="filter-btn" @click="setFilter('tags')" type="secondary">
<Icon size="sm" iconName="epic" /> <Icon size="sm" iconName="epic" />
</el-button> </el-button>
</el-tooltip> </el-tooltip>
@ -153,7 +153,7 @@ limitations under the License. -->
/> />
<el-button <el-button
v-if="activeFilter" v-if="activeFilter"
class="search-btn" class="search-btn filter-btn"
size="small" size="small"
type="primary" type="primary"
@click="searchTraces" @click="searchTraces"
@ -163,7 +163,7 @@ limitations under the License. -->
</el-button> </el-button>
<el-button <el-button
v-if="activeFilter" v-if="activeFilter"
class="search-btn" class="search-btn filter-btn"
size="small" size="small"
type="danger" type="danger"
@click="cancelSearch" @click="cancelSearch"
@ -352,7 +352,7 @@ watch(
} }
.search-btn { .search-btn {
margin-left: 20px; margin-left: 20px;
cursor: pointer; cursor: pointer;
} }
.wrap-filters { .wrap-filters {
@ -362,9 +362,12 @@ watch(
// flex-direction: column; // flex-direction: column;
align-items: center; align-items: center;
.filter { .filter {
margin: 5px 0; margin: 0;
} }
} }
.filter-btn {
height: 18px;
}
</style> </style>
// //