mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 03:03:24 +08:00
Compact access-grant member/admin rows for denser editing (4.9.1-ops.12).
Use flex-wrap rows so phone, command, and delete stay tight and soft-wrap only when the panel is too narrow. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
87e44bd36e
commit
ec96b4d6eb
6 changed files with 109 additions and 60 deletions
|
|
@ -571,7 +571,7 @@ var React24 = __toESM(require("react"), 1);
|
|||
// package.json
|
||||
var package_default = {
|
||||
name: "dsh-im-ops",
|
||||
version: "4.9.1-ops.11",
|
||||
version: "4.9.1-ops.12",
|
||||
description: "Ops fork of dsh-im (all channels kept). Based on @xmanrui/dsh-im@4.9.1 \u2014 access/session policies owned here.",
|
||||
keywords: [
|
||||
"deepseek-harness",
|
||||
|
|
@ -928,6 +928,9 @@ var EN = Object.freeze({
|
|||
"\u547D\u4EE4\u6743\u9650": "Command permission",
|
||||
"\u53EF\u4EE5\u6267\u884C\u547D\u4EE4": "Can run commands",
|
||||
"\u4E0D\u53EF\u4EE5\u6267\u884C\u547D\u4EE4": "Cannot run commands",
|
||||
"\u53EF\u6267\u884C\u547D\u4EE4": "Can run commands",
|
||||
"\u4E0D\u53EF\u6267\u884C\u547D\u4EE4": "Cannot run commands",
|
||||
"\u6682\u65E0\u6635\u79F0": "No nickname",
|
||||
"\u767D\u540D\u5355\u7528\u6237": "Allowlisted users",
|
||||
"\u67E5\u770B\u767D\u540D\u5355\u8BF4\u660E": "View allowlist details",
|
||||
"\u547D\u4EE4\u6743\u9650\u4F8B\u5916": "Command permission exceptions",
|
||||
|
|
@ -12604,11 +12607,11 @@ function nicknameForPhone(contacts, phone) {
|
|||
const hit = (contacts ?? []).find((contact) => contact.phone === digits || contact.phone === phone);
|
||||
return typeof hit?.pushName === "string" ? hit.pushName.trim() : "";
|
||||
}
|
||||
function NicknameHint({ contacts, phone }) {
|
||||
function NicknameHint({ contacts, phone, shortEmpty = false }) {
|
||||
const nickname = nicknameForPhone(contacts, phone);
|
||||
return h2("span", {
|
||||
className: nickname ? "dim-accessNickname" : "dim-accessNickname dim-accessNicknameEmpty"
|
||||
}, nickname || "\u6682\u65E0\u6635\u79F0\uFF08\u79C1\u804A/@ \u540E\u4F1A\u81EA\u52A8\u8865\u9F50\uFF09");
|
||||
}, nickname || (shortEmpty ? "\u6682\u65E0\u6635\u79F0" : "\u6682\u65E0\u6635\u79F0\uFF08\u79C1\u804A/@ \u540E\u4F1A\u81EA\u52A8\u8865\u9F50\uFF09"));
|
||||
}
|
||||
function groupDisplayName(groupJid, groups) {
|
||||
const title = groups?.[groupJid]?.title;
|
||||
|
|
@ -12719,13 +12722,16 @@ function MemberRows({
|
|||
...nested ? {} : { disabled }
|
||||
},
|
||||
nested ? h2("h4", { className: "dim-accessSubblockTitle" }, title) : h2("legend", null, title),
|
||||
h2("ul", { className: "dim-accessUserList" }, members.map((member, index) => h2(
|
||||
h2("ul", { className: "dim-accessCompactList" }, members.map((member, index) => h2(
|
||||
"li",
|
||||
{ key: `member-${index}`, className: "dim-accessUserRow" },
|
||||
{
|
||||
key: `member-${index}`,
|
||||
className: "dim-accessCompactRow",
|
||||
"data-kind": "member"
|
||||
},
|
||||
h2(
|
||||
"label",
|
||||
{ className: "dim-accessField dim-accessUserId" },
|
||||
h2("span", null, "\u7535\u8BDD"),
|
||||
"div",
|
||||
{ className: "dim-accessCompactIdentity" },
|
||||
h2(PhoneTypeahead, {
|
||||
value: member.phone,
|
||||
contacts,
|
||||
|
|
@ -12733,32 +12739,33 @@ function MemberRows({
|
|||
placeholder: "8613800000000",
|
||||
onChange: (phone) => onChange(members.map((entry, i) => i === index ? { ...entry, phone } : entry))
|
||||
}),
|
||||
h2(NicknameHint, { contacts, phone: member.phone })
|
||||
h2(NicknameHint, { contacts, phone: member.phone, shortEmpty: true })
|
||||
),
|
||||
h2(
|
||||
"label",
|
||||
{ className: "dim-accessField dim-accessUserCommand" },
|
||||
h2("span", null, "\u547D\u4EE4\u6743\u9650"),
|
||||
h2(
|
||||
"select",
|
||||
{
|
||||
value: member.canExecuteCommands ? "allow" : "deny",
|
||||
onChange: (event) => onChange(members.map((entry, i) => i === index ? { ...entry, canExecuteCommands: event.target.value === "allow" } : entry))
|
||||
},
|
||||
h2("option", { value: "allow" }, "\u53EF\u4EE5\u6267\u884C\u547D\u4EE4"),
|
||||
h2("option", { value: "deny" }, "\u4E0D\u53EF\u4EE5\u6267\u884C\u547D\u4EE4")
|
||||
)
|
||||
"select",
|
||||
{
|
||||
className: "dim-accessCompactSelect",
|
||||
title: "\u547D\u4EE4\u6743\u9650",
|
||||
"aria-label": "\u547D\u4EE4\u6743\u9650",
|
||||
value: member.canExecuteCommands ? "allow" : "deny",
|
||||
disabled,
|
||||
onChange: (event) => onChange(members.map((entry, i) => i === index ? { ...entry, canExecuteCommands: event.target.value === "allow" } : entry))
|
||||
},
|
||||
h2("option", { value: "allow" }, "\u53EF\u6267\u884C\u547D\u4EE4"),
|
||||
h2("option", { value: "deny" }, "\u4E0D\u53EF\u6267\u884C\u547D\u4EE4")
|
||||
),
|
||||
h2("button", {
|
||||
type: "button",
|
||||
className: "dim-deliveryButton",
|
||||
className: "dim-deliveryButton dim-accessCompactDelete",
|
||||
"data-kind": "danger",
|
||||
disabled,
|
||||
onClick: () => onChange(members.filter((_, i) => i !== index))
|
||||
}, "\u5220\u9664")
|
||||
))),
|
||||
h2("button", {
|
||||
type: "button",
|
||||
className: "dim-deliveryButton",
|
||||
disabled,
|
||||
onClick: () => onChange([...members, { phone: "", canExecuteCommands: true }])
|
||||
}, "\u65B0\u589E\u7528\u6237")
|
||||
);
|
||||
|
|
@ -12781,15 +12788,19 @@ function AdminPhones({
|
|||
},
|
||||
nested ? h2("h4", { className: "dim-accessSubblockTitle" }, title) : h2("legend", null, title),
|
||||
help ? h2("p", { className: "dim-accessHint" }, help) : null,
|
||||
h2("ul", { className: "dim-accessUserList" }, phones.map((phone, index) => {
|
||||
h2("ul", { className: "dim-accessCompactList" }, phones.map((phone, index) => {
|
||||
const locked = lockedPhone && phone === lockedPhone;
|
||||
return h2(
|
||||
"li",
|
||||
{ key: `admin-${index}`, className: "dim-accessUserRow" },
|
||||
{
|
||||
key: `admin-${index}`,
|
||||
className: "dim-accessCompactRow",
|
||||
"data-kind": "admin",
|
||||
...locked ? { "data-locked": "true" } : {}
|
||||
},
|
||||
h2(
|
||||
"label",
|
||||
{ className: "dim-accessField dim-accessUserId" },
|
||||
h2("span", null, locked ? "\u7ED1\u5B9A\u8D26\u53F7\uFF08\u5168\u5C40\u7BA1\u7406\u5458\uFF09" : "\u7535\u8BDD"),
|
||||
"div",
|
||||
{ className: "dim-accessCompactIdentity" },
|
||||
h2(PhoneTypeahead, {
|
||||
value: phone,
|
||||
contacts,
|
||||
|
|
@ -12797,12 +12808,13 @@ function AdminPhones({
|
|||
placeholder: "8613800000000",
|
||||
onChange: (next) => onChange(phones.map((entry, i) => i === index ? next : entry))
|
||||
}),
|
||||
locked ? null : h2(NicknameHint, { contacts, phone })
|
||||
locked ? h2("span", { className: "dim-accessNickname" }, "\u7ED1\u5B9A\u8D26\u53F7\uFF08\u5168\u5C40\u7BA1\u7406\u5458\uFF09") : h2(NicknameHint, { contacts, phone, shortEmpty: true })
|
||||
),
|
||||
locked ? null : h2("button", {
|
||||
type: "button",
|
||||
className: "dim-deliveryButton",
|
||||
className: "dim-deliveryButton dim-accessCompactDelete",
|
||||
"data-kind": "danger",
|
||||
disabled,
|
||||
onClick: () => onChange(phones.filter((_, i) => i !== index))
|
||||
}, "\u5220\u9664")
|
||||
);
|
||||
|
|
@ -12810,6 +12822,7 @@ function AdminPhones({
|
|||
h2("button", {
|
||||
type: "button",
|
||||
className: "dim-deliveryButton",
|
||||
disabled,
|
||||
onClick: () => onChange([...phones, ""])
|
||||
}, "\u65B0\u589E\u7BA1\u7406\u5458")
|
||||
);
|
||||
|
|
@ -14667,6 +14680,15 @@ var CSS11 = String.raw`
|
|||
.dim-accessUsersEmpty { margin-top: 10px; padding: 15px 12px; border: 1px dashed var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 12px; line-height: 18px; text-align: center; }
|
||||
.dim-accessUserList { display: grid; gap: 9px; margin: 10px 0 0; padding: 0; list-style: none; }
|
||||
.dim-accessUserRow { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(145px, 180px) max-content; align-items: end; gap: 10px; padding: 11px; border: 1px solid var(--dsw-alias-border-l1, #eef0f3); border-radius: 9px; background: var(--dsw-alias-bg-module-platform, #f7f8fa); }
|
||||
.dim-accessCompactList { display: grid; gap: 0; margin: 8px 0 0; padding: 0; list-style: none; border: 1px solid var(--dsw-alias-border-l1, #eef0f3); border-radius: 8px; overflow: visible; background: var(--dsw-alias-bg-layer-1, #fff); }
|
||||
.dim-accessCompactRow { position: relative; z-index: 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; padding: 7px 8px; border: 0; border-bottom: 1px solid var(--dsw-alias-border-l1, #eef0f3); border-radius: 0; background: transparent; }
|
||||
.dim-accessCompactRow:last-child { border-bottom: 0; }
|
||||
.dim-accessCompactRow:focus-within { z-index: 5; background: color-mix(in srgb, var(--dsw-alias-bg-module-platform, #f7f8fa) 70%, transparent); }
|
||||
.dim-accessCompactIdentity { min-width: 0; flex: 1 1 160px; display: grid; gap: 2px; }
|
||||
.dim-accessCompactIdentity .dim-accessTypeahead > input { height: 32px; font-size: 12px; }
|
||||
.dim-accessCompactSelect { flex: 0 1 132px; width: auto; min-width: 108px; max-width: 160px; height: 32px; padding: 0 6px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-size: 12px; }
|
||||
.dim-accessCompactSelect:focus { outline: 2px solid color-mix(in srgb, var(--dsw-alias-state-business-primary, #3370ff) 28%, transparent); border-color: var(--dsw-alias-state-business-primary, #3370ff); }
|
||||
.dim-accessCompactDelete { flex: 0 0 auto; min-height: 32px; padding-inline: 10px; }
|
||||
.dim-accessDeleteUser { margin-bottom: 1px; }
|
||||
.dim-accessUnsupported { padding: 18px 14px; border: 1px dashed var(--dsw-alias-border-l2, #dfe1e5); border-radius: 9px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-module-platform, #f7f8fa); text-align: center; }
|
||||
.dim-accessUnsupported strong { color: var(--dsw-alias-label-primary, #1f2329); font-size: 13px; line-height: 20px; }
|
||||
|
|
@ -14692,7 +14714,7 @@ var CSS11 = String.raw`
|
|||
.dim-accessGroupHeading h3 { margin: 0; color: var(--dsw-alias-label-primary, #1f2329); font-size: 14px; line-height: 21px; font-weight: 650; }
|
||||
.dim-accessGroupJid { color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 11px; line-height: 16px; overflow-wrap: anywhere; }
|
||||
.dim-accessGroupTitleRow { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 10px; align-items: end; }
|
||||
.dim-accessNickname { display: block; margin-top: 4px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 18px; font-weight: 560; }
|
||||
.dim-accessNickname { display: block; margin-top: 0; color: var(--dsw-alias-label-secondary, #646a73); font-size: 11px; line-height: 15px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.dim-accessNicknameEmpty { color: var(--dsw-alias-label-tertiary, #8f959e); font-weight: 400; }
|
||||
.dim-accessUserRow { position: relative; z-index: 0; overflow: visible; }
|
||||
.dim-panel .dim-botCard .dim-cardFooter { margin-top: 0; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue