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,47 +6,55 @@
<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 v-if="tab === 'windows'" class="windows"> <div class="content">
<div class="header"> <div v-if="tab === 'windows'" class="windows">
<div>#ID</div> <div class="header">
<div>Component</div> <div>#ID</div>
<div>Action</div> <div>Component</div>
<div>Action</div>
</div>
<div v-for="p in popups">
<div>#{{ p.id }}</div>
<div>{{ p.component.name ? p.component.name : '<anonymous>' }}</div>
<div><button class="_textButton" @click="killPopup(p)">Kill</button></div>
</div>
</div> </div>
<div v-for="p in popups"> <div v-if="tab === 'stream'" class="stream">
<div>#{{ p.id }}</div> <div class="header">
<div>{{ p.component.name ? p.component.name : '<anonymous>' }}</div> <div>#ID</div>
<div><button class="_textButton" @click="killPopup(p)">Kill</button></div> <div>Ch</div>
</div> <div>Handle</div>
</div> <div>In</div>
<div v-if="tab === 'stream'" class="stream"> <div>Out</div>
<div class="header"> </div>
<div>#ID</div> <div v-for="c in connections">
<div>Ch</div> <div>#{{ c.id }}</div>
<div>Handle</div> <div>{{ c.channel }}</div>
<div>In</div> <div v-if="c.users !== null">(shared)<span v-if="c.name">{{ ' ' + c.name }}</span></div>
<div>Out</div> <div v-else>{{ c.name ? c.name : '<anonymous>' }}</div>
</div> <div>{{ c.in }}</div>
<div v-for="c in connections"> <div>{{ c.out }}</div>
<div>#{{ c.id }}</div> </div>
<div>{{ c.channel }}</div> </div>
<div v-if="c.users !== null">(shared)<span v-if="c.name">{{ ' ' + c.name }}</span></div> <div v-if="tab === 'streamPool'" class="streamPool">
<div v-else>{{ c.name ? c.name : '<anonymous>' }}</div> <div class="header">
<div>{{ c.in }}</div> <div>#ID</div>
<div>{{ c.out }}</div> <div>Ch</div>
</div> <div>Users</div>
</div> </div>
<div v-if="tab === 'streamPool'" class="streamPool"> <div v-for="p in pools">
<div class="header"> <div>#{{ p.id }}</div>
<div>#ID</div> <div>{{ p.channel }}</div>
<div>Ch</div> <div>{{ p.users }}</div>
<div>Users</div> </div>
</div>
<div v-for="p in pools">
<div>#{{ p.id }}</div>
<div>{{ p.channel }}</div>
<div>{{ p.users }}</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> </div>
</XWindow> </XWindow>
</template> </template>
@ -108,24 +116,55 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
.qljqmnzj { .qljqmnzj {
> .windows, display: flex;
> .stream, flex-direction: column;
> .streamPool { height: 100%;
display: table; font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
> .content {
flex: 1;
overflow: auto;
> .windows,
> .stream,
> .streamPool {
display: table;
width: 100%;
padding: 16px;
box-sizing: border-box;
> div {
display: table-row;
&.header {
opacity: 0.7;
}
> * {
display: table-cell;
}
}
}
}
> footer {
display: flex;
width: 100%; width: 100%;
padding: 16px; padding: 8px 16px;
box-sizing: border-box; box-sizing: border-box;
border-top: solid 1px var(--divider);
font-size: 0.9em;
> div { > div {
display: table-row; flex: 1;
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
&.header { > .label {
opacity: 0.7; opacity: 0.7;
} margin-right: 0.5em;
> * { &:after {
display: table-cell; content: ":";
}
} }
} }
} }