mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-20 17:13:49 +00:00
style(group-editor): size forge and log target controls
Keep source hosts, platform selectors and remove actions aligned without stretching short controls across the dialog. Wrap component roots explicitly so their internal markup cannot break the grid.
This commit is contained in:
1 parent
5b24c7ec27
commit
96f8fce9bf
3 files changed
+100
-79
No files matched your search
+15
-9
@@ -719,6 +719,14 @@
|
||||
@apply w-full;
|
||||
}
|
||||
|
||||
.ctl-md {
|
||||
@apply w-full max-w-64;
|
||||
}
|
||||
|
||||
.ctl-stack {
|
||||
@apply mt-2 flex w-full max-w-md flex-col gap-2;
|
||||
}
|
||||
|
||||
.target-row {
|
||||
@apply mb-2 grid grid-cols-[minmax(130px,1fr)_auto] items-center gap-2 rounded-sm border border-border bg-surface-2 p-2.5 max-sm:grid-cols-[1fr_auto];
|
||||
grid-template-areas:
|
||||
@@ -749,31 +757,29 @@
|
||||
}
|
||||
|
||||
.forge-source-row {
|
||||
@apply mb-2 grid items-center gap-2 rounded-sm border border-border bg-surface-2 p-2.5;
|
||||
@apply mb-2 grid items-center gap-2 rounded-lg border border-border bg-surface-2 p-2.5;
|
||||
grid-template-areas:
|
||||
"host type del"
|
||||
"name name name";
|
||||
grid-template-columns: 1fr auto auto;
|
||||
grid-template-columns: minmax(0, 1fr) 8rem auto;
|
||||
}
|
||||
|
||||
.forge-source-row .f-host {
|
||||
grid-area: host;
|
||||
}
|
||||
|
||||
.forge-source-row .select.forge-type {
|
||||
.forge-source-row .f-type {
|
||||
grid-area: type;
|
||||
@apply w-[110px];
|
||||
}
|
||||
|
||||
.forge-source-row .f-del {
|
||||
grid-area: del;
|
||||
}
|
||||
|
||||
.forge-source-row .f-name {
|
||||
grid-area: name;
|
||||
}
|
||||
|
||||
.forge-source-row > .icon-btn {
|
||||
grid-area: del;
|
||||
justify-self: end;
|
||||
}
|
||||
|
||||
.node-editor {
|
||||
@apply mb-1;
|
||||
}
|
||||
|
||||
@@ -66,35 +66,41 @@
|
||||
<span class="lbl-note">{{ t("groupEditor.forgeSourcesNote") }}</span></label
|
||||
>
|
||||
<div v-for="(s, i) in form.forgeSources" :key="i" class="forge-source-row">
|
||||
<RcInput
|
||||
v-model="s.host"
|
||||
type="text"
|
||||
class="[grid-area:host]"
|
||||
:placeholder="t('groupEditor.forgeSourcesHost')"
|
||||
/>
|
||||
<RcSelect
|
||||
v-model="s.type"
|
||||
class="w-[110px] [grid-area:type]"
|
||||
:options="[
|
||||
{ label: 'GitHub', value: 'github' },
|
||||
{ label: 'Gitea', value: 'gitea' },
|
||||
]"
|
||||
/>
|
||||
<div class="f-host">
|
||||
<RcInput
|
||||
v-model="s.host"
|
||||
type="text"
|
||||
:placeholder="t('groupEditor.forgeSourcesHost')"
|
||||
/>
|
||||
</div>
|
||||
<div class="f-type">
|
||||
<RcSelect
|
||||
v-model="s.type"
|
||||
:options="[
|
||||
{ label: 'GitHub', value: 'github' },
|
||||
{ label: 'Gitea', value: 'gitea' },
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
<RcButton
|
||||
type="button"
|
||||
variant="destructive"
|
||||
variant="ghost"
|
||||
color="error"
|
||||
size="icon"
|
||||
class="[grid-area:del] justify-self-end"
|
||||
class="f-del h-9 w-9 text-muted hover:text-bad"
|
||||
:title="t('groupEditor.forgeSourcesRemove')"
|
||||
:aria-label="t('groupEditor.forgeSourcesRemove')"
|
||||
@click="removeForgeSource(s)"
|
||||
>
|
||||
✕
|
||||
<Trash2 :size="15" />
|
||||
</RcButton>
|
||||
<RcInput
|
||||
v-model="s.name"
|
||||
type="text"
|
||||
class="[grid-area:name]"
|
||||
:placeholder="t('groupEditor.forgeSourcesName')"
|
||||
/>
|
||||
<div class="f-name">
|
||||
<RcInput
|
||||
v-model="s.name"
|
||||
type="text"
|
||||
:placeholder="t('groupEditor.forgeSourcesName')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<RcButton type="button" variant="ghost" class="add-filter" @click="addForgeSource">
|
||||
{{ t("groupEditor.forgeSourcesAdd") }}
|
||||
@@ -159,12 +165,14 @@
|
||||
>{{ t("groupEditor.installationId") }}
|
||||
<span class="lbl-note">{{ t("groupEditor.installationIdNote") }}</span></label
|
||||
>
|
||||
<RcInput
|
||||
v-model="form.installationId"
|
||||
type="text"
|
||||
inputmode="numeric"
|
||||
:placeholder="t('groupEditor.installationIdPlaceholder')"
|
||||
/>
|
||||
<div class="ctl-md">
|
||||
<RcInput
|
||||
v-model="form.installationId"
|
||||
type="text"
|
||||
inputmode="numeric"
|
||||
:placeholder="t('groupEditor.installationIdPlaceholder')"
|
||||
/>
|
||||
</div>
|
||||
<div class="hint">{{ t("groupEditor.installationIdHint") }}</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -175,48 +183,52 @@
|
||||
>{{ t("groupEditor.logTarget") }}
|
||||
<span class="lbl-note">{{ t("groupEditor.logTargetNote") }}</span></label
|
||||
>
|
||||
<RcSelect
|
||||
:model-value="form.logPlatform || 'none'"
|
||||
:options="[
|
||||
{ label: t('groupEditor.logDisabled'), value: 'none' },
|
||||
{ label: 'Discord', value: 'discord' },
|
||||
{ label: 'Telegram', value: 'telegram' },
|
||||
{ label: t('groupEditor.logFeishu'), value: 'feishu' },
|
||||
]"
|
||||
@update:model-value="
|
||||
form.logPlatform = ($event === 'none' ? '' : $event) as
|
||||
'' | 'discord' | 'telegram' | 'feishu'
|
||||
"
|
||||
/>
|
||||
<template v-if="form.logPlatform === 'discord'">
|
||||
<RcInput
|
||||
v-model="form.logChannelId"
|
||||
type="text"
|
||||
class="mt-2"
|
||||
:placeholder="t('routeEditor.channelPlaceholder')"
|
||||
<div class="ctl-md">
|
||||
<RcSelect
|
||||
:model-value="form.logPlatform || 'none'"
|
||||
:options="[
|
||||
{ label: t('groupEditor.logDisabled'), value: 'none' },
|
||||
{ label: 'Discord', value: 'discord' },
|
||||
{ label: 'Telegram', value: 'telegram' },
|
||||
{ label: t('groupEditor.logFeishu'), value: 'feishu' },
|
||||
]"
|
||||
@update:model-value="
|
||||
form.logPlatform = ($event === 'none' ? '' : $event) as
|
||||
'' | 'discord' | 'telegram' | 'feishu'
|
||||
"
|
||||
/>
|
||||
<RcInput
|
||||
v-model="form.logThreadId"
|
||||
type="text"
|
||||
class="mt-2"
|
||||
:placeholder="t('routeEditor.threadPlaceholder')"
|
||||
/>
|
||||
</template>
|
||||
<template v-else-if="form.logPlatform === 'telegram' || form.logPlatform === 'feishu'">
|
||||
<RcInput
|
||||
v-model="form.logChatId"
|
||||
type="text"
|
||||
class="mt-2"
|
||||
:placeholder="t('routeEditor.chatPlaceholder')"
|
||||
/>
|
||||
<RcInput
|
||||
v-if="form.logPlatform === 'telegram'"
|
||||
v-model="form.logTopicId"
|
||||
type="text"
|
||||
class="mt-2"
|
||||
:placeholder="t('routeEditor.topicPlaceholder')"
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
<div v-if="form.logPlatform" class="ctl-stack">
|
||||
<template v-if="form.logPlatform === 'discord'">
|
||||
<RcInput
|
||||
v-model="form.logChannelId"
|
||||
type="text"
|
||||
:placeholder="t('routeEditor.channelPlaceholder')"
|
||||
/>
|
||||
<RcInput
|
||||
v-model="form.logThreadId"
|
||||
type="text"
|
||||
:placeholder="t('routeEditor.threadPlaceholder')"
|
||||
/>
|
||||
</template>
|
||||
<template v-else>
|
||||
<RcInput
|
||||
v-model="form.logChatId"
|
||||
type="text"
|
||||
:placeholder="
|
||||
form.logPlatform === 'telegram'
|
||||
? t('routeEditor.chatPlaceholder')
|
||||
: t('routeEditor.feishuChatPlaceholder')
|
||||
"
|
||||
/>
|
||||
<RcInput
|
||||
v-if="form.logPlatform === 'telegram'"
|
||||
v-model="form.logTopicId"
|
||||
type="text"
|
||||
:placeholder="t('routeEditor.topicPlaceholder')"
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
<div class="hint">{{ t("groupEditor.logTargetHint") }}</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -237,6 +249,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, watch } from "vue";
|
||||
import { Trash2 } from "lucide-vue-next";
|
||||
import type { ForgeSource, Group } from "~/types";
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -337,6 +337,7 @@ const en: Dict = {
|
||||
"groupEditor.forgeSourcesHost": "git.example.com",
|
||||
"groupEditor.forgeSourcesName": "Optional display name",
|
||||
"groupEditor.forgeSourcesAdd": "+ Add host",
|
||||
"groupEditor.forgeSourcesRemove": "Remove host",
|
||||
"groupEditor.forgeSourcesHint":
|
||||
"Events whose repository host matches an entry are labeled in the message footer with its display name (or the host when none is set) — e.g. git1.example.com and git2.example.com for two Gitea instances. GitHub events match github.com.",
|
||||
"groupEditor.errForgeSourceHost": "Every forge host must be a valid hostname",
|
||||
@@ -745,6 +746,7 @@ const zh: Dict = {
|
||||
"groupEditor.forgeSourcesHost": "git.example.com",
|
||||
"groupEditor.forgeSourcesName": "可选显示名称",
|
||||
"groupEditor.forgeSourcesAdd": "+ 添加主机",
|
||||
"groupEditor.forgeSourcesRemove": "删除主机",
|
||||
"groupEditor.forgeSourcesHint":
|
||||
"仓库主机与条目匹配的事件,会在消息底部用该条目的显示名称标注(未填名称则用主机名)——例如两个 Gitea 实例可分别填 git1.example.com 和 git2.example.com。GitHub 事件匹配 github.com。",
|
||||
"groupEditor.errForgeSourceHost": "每个来源主机必须是有效的主机名",
|
||||
|
||||
Reference in new issue
Block a user