JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
fix(Web-frontend): Show/Hide plaintext for Cli Token in skill source management (ClawHub)
openJiuwen-bote325af11cbd8
diff --git a/jiuwenswarm/channels/web/frontend/src/features/ClawHubSearchModal/index.tsx b/jiuwenswarm/channels/web/frontend/src/features/ClawHubSearchModal/index.tsxindex 8983179b54..e36ad7e92e 100644--- a/jiuwenswarm/channels/web/frontend/src/features/ClawHubSearchModal/index.tsx+++ b/jiuwenswarm/channels/web/frontend/src/features/ClawHubSearchModal/index.tsx@@ -81,6 +81,7 @@ export function ClawHubSearchModal({const [installingSlug, setInstallingSlug] = useState<string | null>(null);const [installedSlugs, setInstalledSlugs] = useState<Set<string>>(new Set());const [tokenLoading, setTokenLoading] = useState(true);+ const [showToken, setShowToken] = useState(false);const withSession = useCallback((params?: Record<string, unknown>) => ({@@ -448,13 +449,32 @@ export function ClawHubSearchModal({<label className="block text-sm font-medium text-text mb-2">{t("skills.clawhub.tokenLabel")}</label>- <input- type="password"- value={token}- onChange={(e) => setToken(e.target.value)}- placeholder={t("skills.clawhub.tokenPlaceholder")}- className="w-full px-3 py-2 rounded-md bg-secondary border border-border text-sm text-text placeholder:text-text-muted"- />+ <div className="relative">+ <input+ type={showToken ? "text" : "password"}+ value={token}+ onChange={(e) => setToken(e.target.value)}+ placeholder={t("skills.clawhub.tokenPlaceholder")}+ className="w-full px-3 py-2 pr-10 rounded-md bg-secondary border border-border text-sm text-text placeholder:text-text-muted"+ />+ <button+ type="button"+ onClick={() => setShowToken(!showToken)}+ className="absolute right-3 top-1/2 -translate-y-1/2 text-text-muted hover:text-text transition-colors"+ aria-label={showToken ? t("common.hide") : t("common.show")}+ >+ {showToken ? (+ <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />+ </svg>+ ) : (+ <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />+ </svg>+ )}+ </button>+ </div></div><div className="flex items-center gap-3 justify-end"><buttondiff --git a/jiuwenswarm/channels/web/frontend/src/features/SourceManagerModal/index.tsx b/jiuwenswarm/channels/web/frontend/src/features/SourceManagerModal/index.tsxindex 3f9aedf0e4..0b28ede2cb 100644--- a/jiuwenswarm/channels/web/frontend/src/features/SourceManagerModal/index.tsx+++ b/jiuwenswarm/channels/web/frontend/src/features/SourceManagerModal/index.tsx@@ -27,6 +27,7 @@ export function SourceManagerModal({const [tokenLoading, setTokenLoading] = useState(false);const [tokenSaving, setTokenSaving] = useState(false);const [hasToken, setHasToken] = useState(false);+ const [showToken, setShowToken] = useState(false);const withSession = useCallback((params?: Record<string, unknown>) => ({@@ -180,13 +181,32 @@ export function SourceManagerModal({<label className="block text-sm font-medium text-text mb-2">{t("skills.clawhub.tokenLabel")}</label>- <input- type="password"- value={clawhubToken}- onChange={(e) => setClawhubToken(e.target.value)}- placeholder={t("skills.clawhub.tokenPlaceholder")}- className="w-full px-3 py-2 rounded-md bg-card border border-border text-sm text-text placeholder:text-text-muted"- />+ <div className="relative">+ <input+ type={showToken ? "text" : "password"}+ value={clawhubToken}+ onChange={(e) => setClawhubToken(e.target.value)}+ placeholder={t("skills.clawhub.tokenPlaceholder")}+ className="w-full px-3 py-2 pr-10 rounded-md bg-card border border-border text-sm text-text placeholder:text-text-muted"+ />+ <button+ type="button"+ onClick={() => setShowToken(!showToken)}+ className="absolute right-3 top-1/2 -translate-y-1/2 text-text-muted hover:text-text transition-colors"+ aria-label={showToken ? t("common.hide") : t("common.show")}+ >+ {showToken ? (+ <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />+ </svg>+ ) : (+ <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />+ </svg>+ )}+ </button>+ </div></div><div className="flex items-center justify-between">{hasToken && (