improve UI & greptile review fixes

This commit is contained in:
x032205
2025-10-22 03:35:33 -04:00
parent 52352fc00a
commit e6a76187a2
5 changed files with 19 additions and 23 deletions
@@ -125,25 +125,25 @@ export const GatewayCliDeploymentMethod = () => {
accessTokenTrustedIps: [{ ipAddress: "0.0.0.0/0" }, { ipAddress: "::/0" }] accessTokenTrustedIps: [{ ipAddress: "0.0.0.0/0" }, { ipAddress: "::/0" }]
}); });
createNotification({ createNotification({
text: "Automatically enabled token authentication for this identity.", text: "Token authentication has been automatically enabled for the selected identity. By default, it is configured to allow all IP addresses with a default token TTL of 30 days. You can manage these settings in Access Control.",
type: "info" type: "warning"
}); });
} }
const token = await createToken({ const token = await createToken({
identityId: validatedIdentity.id, identityId: validatedIdentity.id,
name: "gateway token (autogenerated)" name: `gateway token for ${name} (autogenerated)`
}); });
setIdentityToken(token.accessToken); setIdentityToken(token.accessToken);
createNotification({ createNotification({
text: "Automatically generated a token for this identity.", text: "Automatically generated a token for the selected identity.",
type: "info" type: "info"
}); });
setStep("command"); setStep("command");
} catch (err) { } catch (err) {
console.error(err); console.error(err);
createNotification({ createNotification({
text: "Failed to generate token for identity", text: "Failed to generate token for the selected identity",
type: "error" type: "error"
}); });
setIdentityToken(""); setIdentityToken("");
@@ -27,21 +27,19 @@ export const GatewayDeploymentMethodSelect = ({ onSelect }: Props) => {
return ( return (
<div className="grid h-118 grid-cols-4 content-start gap-2"> <div className="grid h-118 grid-cols-4 content-start gap-2">
{deploymentOptions.map((option) => { {deploymentOptions.map((option) => {
const { image, name } = option; const { image, name, method } = option;
return ( return (
<button <button
key={method}
type="button" type="button"
onClick={() => handleResourceSelect(option.method)} onClick={() => handleResourceSelect(method)}
className="group relative flex h-28 cursor-pointer flex-col items-center justify-center rounded-md border border-mineshaft-600 bg-mineshaft-700 p-4 duration-200 hover:bg-mineshaft-600" className="group relative flex h-28 cursor-pointer flex-col items-center justify-center rounded-md border border-mineshaft-600 bg-mineshaft-700 p-4 duration-200 hover:bg-mineshaft-600"
> >
<div className="relative"> <div className="relative">
<img <img
src={`/images/integrations/${image}`} src={`/images/integrations/${image}`}
style={{ className="mt-auto w-12"
width: "50px"
}}
className="mt-auto"
alt={`${name} logo`} alt={`${name} logo`}
/> />
</div> </div>
@@ -94,7 +94,7 @@ export const RelayTab = withPermission(
replace: true replace: true
}); });
} }
}, [action]); }, [action, handlePopUpOpen, navigate]);
const deleteRelayById = useDeleteRelayById(); const deleteRelayById = useDeleteRelayById();
@@ -104,25 +104,25 @@ export const RelayCliDeploymentMethod = () => {
accessTokenTrustedIps: [{ ipAddress: "0.0.0.0/0" }, { ipAddress: "::/0" }] accessTokenTrustedIps: [{ ipAddress: "0.0.0.0/0" }, { ipAddress: "::/0" }]
}); });
createNotification({ createNotification({
text: "Automatically enabled token authentication for this identity.", text: "Token authentication has been automatically enabled for the selected identity. By default, it is configured to allow all IP addresses with a default token TTL of 30 days. You can manage these settings in Access Control.",
type: "info" type: "warning"
}); });
} }
const token = await createToken({ const token = await createToken({
identityId: validatedIdentity.id, identityId: validatedIdentity.id,
name: "relay token (autogenerated)" name: `relay token for ${name} (autogenerated)`
}); });
setIdentityToken(token.accessToken); setIdentityToken(token.accessToken);
createNotification({ createNotification({
text: "Automatically generated a token for this identity.", text: "Automatically generated a token for the selected identity.",
type: "info" type: "info"
}); });
setStep("command"); setStep("command");
} catch (err) { } catch (err) {
console.error(err); console.error(err);
createNotification({ createNotification({
text: "Failed to generate token for identity", text: "Failed to generate token for the selected identity",
type: "error" type: "error"
}); });
setIdentityToken(""); setIdentityToken("");
@@ -27,21 +27,19 @@ export const RelayDeploymentMethodSelect = ({ onSelect }: Props) => {
return ( return (
<div className="grid h-118 grid-cols-4 content-start gap-2"> <div className="grid h-118 grid-cols-4 content-start gap-2">
{deploymentOptions.map((option) => { {deploymentOptions.map((option) => {
const { image, name } = option; const { image, name, method } = option;
return ( return (
<button <button
key={method}
type="button" type="button"
onClick={() => handleResourceSelect(option.method)} onClick={() => handleResourceSelect(method)}
className="group relative flex h-28 cursor-pointer flex-col items-center justify-center rounded-md border border-mineshaft-600 bg-mineshaft-700 p-4 duration-200 hover:bg-mineshaft-600" className="group relative flex h-28 cursor-pointer flex-col items-center justify-center rounded-md border border-mineshaft-600 bg-mineshaft-700 p-4 duration-200 hover:bg-mineshaft-600"
> >
<div className="relative"> <div className="relative">
<img <img
src={`/images/integrations/${image}`} src={`/images/integrations/${image}`}
style={{ className="mt-auto w-12"
width: "50px"
}}
className="mt-auto"
alt={`${name} logo`} alt={`${name} logo`}
/> />
</div> </div>