Improve task manager

This commit is contained in:
syuilo 2020-11-01 14:05:06 +09:00
parent 9195504329
commit a0f794e372
2 changed files with 98 additions and 50 deletions

View file

@ -1,6 +1,6 @@
<template> <template>
<div class="pxhvhrfw" v-size="{ max: [500] }"> <div class="pxhvhrfw" v-size="{ max: [500] }">
<button v-for="item in items" class="_button" @click="$emit('update:value', item.value)" :class="{ active: value === item.value }" :key="item.value"><Fa v-if="item.icon" :icon="item.icon" class="icon"/>{{ item.label }}</button> <button v-for="item in items" class="_button" @click="$emit('update:value', item.value)" :class="{ active: value === item.value }" :disabled="value === item.value" :key="item.value"><Fa v-if="item.icon" :icon="item.icon" class="icon"/>{{ item.label }}</button>
</div> </div>
</template> </template>
@ -29,11 +29,20 @@ export default defineComponent({
padding: 15px 12px 12px 12px; padding: 15px 12px 12px 12px;
border-bottom: solid 3px transparent; border-bottom: solid 3px transparent;
&:disabled {
opacity: 1 !important;
cursor: default;
}
&.active { &.active {
color: var(--accent); color: var(--accent);
border-bottom-color: var(--accent); border-bottom-color: var(--accent);
} }
&:not(.active):hover {
color: var(--fgHighlighted);
}
> .icon { > .icon {
margin-right: 6px; margin-right: 6px;
} }

View file

@ -6,6 +6,7 @@
<div class="qljqmnzj"> <div class="qljqmnzj">
<MkTab v-model:value="tab" :items="[{ label: 'Windows', value: 'windows', }, { label: 'Stream', value: 'stream', }, { label: 'Stream (Pool)', value: 'streamPool', }, { label: 'API', value: 'api', }]" style="border-bottom: solid 1px var(--divider);"/> <MkTab v-model:value="tab" :items="[{ label: 'Windows', value: 'windows', }, { label: 'Stream', value: 'stream', }, { label: 'Stream (Pool)', value: 'streamPool', }, { label: 'API', value: 'api', }]" style="border-bottom: solid 1px var(--divider);"/>
<div class="content">
<div v-if="tab === 'windows'" class="windows"> <div v-if="tab === 'windows'" class="windows">
<div class="header"> <div class="header">
<div>#ID</div> <div>#ID</div>
@ -48,6 +49,13 @@
</div> </div>
</div> </div>
</div> </div>
<footer>
<div><span class="label">Windows</span>{{ popups.length }}</div>
<div><span class="label">Stream</span>{{ connections.length }}</div>
<div><span class="label">Stream (Pool)</span>{{ pools.length }}</div>
</footer>
</div>
</XWindow> </XWindow>
</template> </template>
@ -108,6 +116,15 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
.qljqmnzj { .qljqmnzj {
display: flex;
flex-direction: column;
height: 100%;
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
> .content {
flex: 1;
overflow: auto;
> .windows, > .windows,
> .stream, > .stream,
> .streamPool { > .streamPool {
@ -118,7 +135,6 @@ export default defineComponent({
> div { > div {
display: table-row; display: table-row;
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
&.header { &.header {
opacity: 0.7; opacity: 0.7;
@ -129,5 +145,28 @@ export default defineComponent({
} }
} }
} }
}
> footer {
display: flex;
width: 100%;
padding: 8px 16px;
box-sizing: border-box;
border-top: solid 1px var(--divider);
font-size: 0.9em;
> div {
flex: 1;
> .label {
opacity: 0.7;
margin-right: 0.5em;
&:after {
content: ":";
}
}
}
}
} }
</style> </style>