This is an automated email from the ASF dual-hosted git repository.
hsluoyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/casbin-gateway.git
The following commit(s) were added to refs/heads/master by this push:
new a707226 fix(agent): fall back to vendor install page when no package
manager is available
a707226 is described below
commit a707226efafbfa7098cba1f90bc64931f4210e39
Author: Yang Luo <[email protected]>
AuthorDate: Fri Sep 4 00:01:49 2026 +0800
fix(agent): fall back to vendor install page when no package manager is
available
---
web/src/components/ToolInstallRow.tsx | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/web/src/components/ToolInstallRow.tsx
b/web/src/components/ToolInstallRow.tsx
index 81205e1..f1f2e68 100644
--- a/web/src/components/ToolInstallRow.tsx
+++ b/web/src/components/ToolInstallRow.tsx
@@ -44,6 +44,7 @@ export function ToolInstallRow({
const plan = entry.install;
const running = job?.running === true;
const failed = job !== undefined && !job.running && !job.ok;
+ const fallbackUrl = !plan.available ? entry.installUrl : undefined;
return (
<div className="bg-card hover:border-foreground/25 space-y-2 rounded-xl
border p-3 shadow-xs transition-colors">
@@ -56,7 +57,7 @@ export function ToolInstallRow({
/>
<span className="min-w-0 flex-1 truncate text-sm
font-medium">{entry.name}</span>
- {entry.installUrl ? (
+ {entry.installUrl && !fallbackUrl ? (
<SimpleTooltip title={i18next.t("agent:Install page")}>
<a
href={entry.installUrl}
@@ -71,17 +72,23 @@ export function ToolInstallRow({
) : null}
<SimpleTooltip
- title={plan.available ? plan.command : plan.detail}
+ title={plan.available ? plan.command : fallbackUrl ?
i18next.t("agent:Install page") : plan.detail}
>
<span className="shrink-0">
<Button
size="sm"
variant={failed ? "outline" : "default"}
- disabled={!plan.available || running}
+ disabled={(!plan.available && !fallbackUrl) || running}
loading={busy || running}
- onClick={() => onInstall(entry.agentId)}
+ onClick={() => {
+ if (plan.available) {
+ onInstall(entry.agentId);
+ } else if (fallbackUrl) {
+ window.open(fallbackUrl, "_blank", "noreferrer");
+ }
+ }}
>
- <Download />
+ {fallbackUrl ? <ExternalLink /> : <Download />}
{i18next.t(
running ? "agent:Installing" : failed ? "agent:Retry" :
"agent:Install",
)}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]