Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: show more detailed provisioner version info#14593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
aslilac merged 11 commits intomainfromprovisioner-version-popups
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,7 +31,7 @@ const Example: Story = {
await step("click to open", async () => {
await userEvent.click(canvas.getByRole("button"));
await waitFor(() =>
expect(screen.getByText(/v99\.999\.9999/i)).toBeInTheDocument(),
expect(screen.getByText(/v2\.99\.99/i)).toBeInTheDocument(),
);
});
},
Expand Down
68 changes: 64 additions & 4 deletionssite/src/modules/provisioners/ProvisionerGroup.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
import { useTheme } from "@emotion/react";
import {type Interpolation, type Theme,useTheme } from "@emotion/react";
import Business from "@mui/icons-material/Business";
import Person from "@mui/icons-material/Person";
import Button from "@mui/material/Button";
import Link from "@mui/material/Link";
import Tooltip from "@mui/material/Tooltip";
import type { BuildInfoResponse, ProvisionerDaemon } from "api/typesGenerated";
import { DropdownArrow } from "components/DropdownArrow/DropdownArrow";
import { Pill } from "components/Pill/Pill";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "components/Popover/Popover";
import { type FC, useState } from "react";
import { createDayString } from "utils/createDayString";
import { docs } from "utils/docs";
import { ProvisionerTag } from "./ProvisionerTag";

type ProvisionerGroupType = "builtin" | "psk" | "key";
Expand DownExpand Up@@ -159,14 +166,51 @@ export const ProvisionerGroup: FC<ProvisionerGroupProps> = ({
width: 310,
}}
>
<div css={{ lineHeight:"160%" }}>
<div css={{ lineHeight:1.6 }}>
<h4 css={{ fontWeight: 500, margin: 0 }}>{provisioner.name}</h4>
<span css={{ color: theme.palette.text.secondary }}>
<span
css={{ color: theme.palette.text.secondary, fontSize: 13 }}
>
{type === "builtin" ? (
<span>Built-in</span>
) : (
<>
{upToDate ? "Up to date" : provisioner.version} &mdash;{" "}
<Popover mode="hover">
<PopoverTrigger>
<span>
{buildInfo
? provisioner.version === buildInfo.version
? "Up to date"
: "Out of date"
: provisioner.version}
</span>
</PopoverTrigger>
<PopoverContent
transformOrigin={{ vertical: -8, horizontal: 0 }}
css={{
"& .MuiPaper-root": {
padding: "20px 20px 8px",
maxWidth: 340,
},
}}
>
<h4 css={styles.title}>Release version</h4>
<p css={styles.text}>{provisioner.version}</p>
<h4 css={styles.title}>Protocol version</h4>
<p css={styles.text}>{provisioner.api_version}</p>
{provisioner.api_version !==
buildInfo?.provisioner_api_version && (
<p css={[styles.text, { fontSize: 13 }]}>
This provisioner is out of date. You may
experience issues when using a provisioner version
that doesn’t match your Coder deployment. Please
upgrade to a newer version.{" "}
<Link href={docs("/")}>Learn more…</Link>
</p>
)}
</PopoverContent>
</Popover>{" "}
&mdash;{" "}
{provisioner.last_seen_at && (
<span data-chromatic="ignore">
Last seen {createDayString(provisioner.last_seen_at)}
Expand DownExpand Up@@ -211,3 +255,19 @@ export const ProvisionerGroup: FC<ProvisionerGroupProps> = ({
</div>
);
};

const styles = {
title: (theme) => ({
marginTop: 0,
marginBottom: 0,
color: theme.palette.text.primary,
fontSize: 14,
lineHeight: "150%",
fontWeight: 600,
}),

text: (theme) => ({
marginTop: 0,
marginBottom: 12,
}),
} satisfies Record<string, Interpolation<Theme>>;
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,6 +26,19 @@ export const Provisioners: Story = {
psk: [MockProvisioner, MockUserProvisioner, MockProvisionerWithTags],
userAuth: [],
keys: new Map([
[
"ベン",
[
MockProvisioner,
{
...MockProvisioner2,
version: "2.0.0",
api_version: "1.0",
warnings: [{ code: "EUNKNOWN", message: "私は時代遅れです" }],
},
],
],
["ジャイデン", [MockProvisioner, MockProvisioner2]],
[
"ケイラ",
[
Expand Down
2 changes: 1 addition & 1 deletionsite/src/testHelpers/entities.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -217,7 +217,7 @@ export const MockBuildInfo: TypesGen.BuildInfoResponse = {
agent_api_version:"1.0",
provisioner_api_version:"1.1",
external_url:"file:///mock-url",
version:"v99.999.9999+c9cdf14",
version:"v2.99.99",
dashboard_url:"https:///mock-url",
workspace_proxy:false,
upgrade_message:"My custom upgrade message",
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp