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

refactor(site): add minor workspace improvements#11822

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
BrunoQuaresma merged 1 commit intomainfrombq/improve-dots-bg
Jan 26, 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
2 changes: 2 additions & 0 deletionssite/src/@types/mui.d.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,10 +3,12 @@ import type { PaletteColor, PaletteColorOptions } from "@mui/material/styles";
declare module"@mui/material/styles"{
interfacePalette{
neutral:PaletteColor;
dots:string;
}

interfacePaletteOptions{
neutral?:PaletteColorOptions;
dots?:string;
}
}

Expand Down
2 changes: 1 addition & 1 deletionsite/src/components/Resources/AgentMetadata.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -248,7 +248,7 @@ const styles = {
},

metadataValueSuccess: (theme) => ({
color: theme.experimental.roles.success.outline,
color: theme.experimental.roles.success.fill,
}),

metadataValueError: (theme) => ({
Expand Down
14 changes: 7 additions & 7 deletionssite/src/components/Resources/AgentRow.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -509,6 +509,7 @@ const styles = {
border: `1px solid ${theme.palette.text.secondary}`,
backgroundColor: theme.palette.background.default,
borderRadius: 8,
boxShadow: theme.shadows[3],
}),

"agentRow-connected": (theme) => ({
Expand DownExpand Up@@ -562,14 +563,13 @@ const styles = {
}),

header: (theme) => ({
padding: "12px 24px",
padding: "16px 16px 0 32px",
display: "flex",
gap: 24,
alignItems: "center",
justifyContent: "space-between",
flexWrap: "wrap",
lineHeight: "1.5",
borderBottom: `1px solid ${theme.palette.divider}`,

[theme.breakpoints.down("md")]: {
gap: 16,
Expand All@@ -581,7 +581,7 @@ const styles = {
alignItems: "center",
gap: 24,
color: theme.palette.text.secondary,
fontSize:13,
fontSize:14,
}),

agentNameAndInfo: (theme) => ({
Expand All@@ -596,7 +596,7 @@ const styles = {
}),

content: {
padding:"32px 24px",
padding:32,
display: "flex",
flexDirection: "column",
gap: 32,
Expand DownExpand Up@@ -637,7 +637,7 @@ const styles = {
agentNameAndStatus: (theme) => ({
display: "flex",
alignItems: "center",
gap:12,
gap:16,

[theme.breakpoints.down("md")]: {
width: "100%",
Expand All@@ -652,7 +652,7 @@ const styles = {
fontWeight: 600,
flexShrink: 0,
width: "fit-content",
fontSize:14,
fontSize:16,
color: theme.palette.text.primary,

[theme.breakpoints.down("md")]: {
Expand DownExpand Up@@ -682,7 +682,7 @@ const styles = {
background: "transparent",
border: 0,
fontFamily: "inherit",
padding: "12px 24px",
padding: "16px 32px",
color: theme.palette.text.secondary,
cursor: "pointer",
display: "flex",
Expand Down
2 changes: 1 addition & 1 deletionsite/src/pages/WorkspacePage/ResourceMetadata.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -68,7 +68,7 @@ const styles = {
rowGap: 24,
marginBottom: 24,
fontSize: 14,
background: `linear-gradient(180deg, ${theme.palette.background.default}0%, rgba(0, 0, 0, 0) 100%)`,
background: `linear-gradient(180deg, ${theme.palette.background.default}25%, rgba(0, 0, 0, 0) 100%)`,
}),

item: () => ({
Expand Down
180 changes: 87 additions & 93 deletionssite/src/pages/WorkspacePage/Workspace.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -182,101 +182,97 @@ export const Workspace: FC<WorkspaceProps> = ({
<HistorySidebar workspace={workspace} />
)}

<div css={styles.content}>
<div css={styles.dotBackground}>
{selectedResource && (
<ResourceMetadata
resource={selectedResource}
css={{ margin: "-48px 0 24px -48px" }}
<div css={[styles.content, styles.dotsBackground]}>
{selectedResource && (
<ResourceMetadata
resource={selectedResource}
css={{ margin: "-32px -32px 0 -32px", marginBottom: 24 }}
/>
)}
<div
css={{
display: "flex",
flexDirection: "column",
gap: 24,
maxWidth: 24 * 50,
margin: "auto",
}}
>
{workspace.latest_build.status === "deleted" && (
<WorkspaceDeletedBanner
handleClick={() => navigate(`/templates`)}
/>
)}
<div
css={{
display: "flex",
flexDirection: "column",
gap: 24,
maxWidth: 24 * 50,
margin: "auto",
}}
>
{workspace.latest_build.status === "deleted" && (
<WorkspaceDeletedBanner
handleClick={() => navigate(`/templates`)}
/>
)}

{workspace.latest_build.job.error && (
<Alert
severity="error"
actions={
<Button
onClick={
canRetryDebugMode
? handleBuildRetryDebug
: handleBuildRetry
}
variant="text"
size="small"
>
Retry{canRetryDebugMode && " in debug mode"}
</Button>
}
>
<AlertTitle>Workspace build failed</AlertTitle>
<AlertDetail>{workspace.latest_build.job.error}</AlertDetail>
</Alert>
)}
{workspace.latest_build.job.error && (
<Alert
severity="error"
actions={
<Button
onClick={
canRetryDebugMode ? handleBuildRetryDebug : handleBuildRetry
}
variant="text"
size="small"
>
Retry{canRetryDebugMode && " in debug mode"}
</Button>
}
>
<AlertTitle>Workspace build failed</AlertTitle>
<AlertDetail>{workspace.latest_build.job.error}</AlertDetail>
</Alert>
)}

{transitionStats !== undefined && (
<WorkspaceBuildProgress
workspace={workspace}
transitionStats={transitionStats}
/>
)}
{transitionStats !== undefined && (
<WorkspaceBuildProgress
workspace={workspace}
transitionStats={transitionStats}
/>
)}

{buildLogs}
{buildLogs}

{selectedResource && (
<section
css={{ display: "flex", flexDirection: "column", gap: 24 }}
>
{selectedResource.agents?.map((agent) => (
<AgentRow
key={agent.id}
agent={agent}
workspace={workspace}
sshPrefix={sshPrefix}
showApps={permissions.updateWorkspace}
showBuiltinApps={permissions.updateWorkspace}
hideSSHButton={hideSSHButton}
hideVSCodeDesktopButton={hideVSCodeDesktopButton}
serverVersion={buildInfo?.version || ""}
serverAPIVersion={buildInfo?.agent_api_version || ""}
onUpdateAgent={handleUpdate} // On updating the workspace the agent version is also updated
/>
))}
{selectedResource && (
<section
css={{ display: "flex", flexDirection: "column", gap: 24 }}
>
{selectedResource.agents?.map((agent) => (
<AgentRow
key={agent.id}
agent={agent}
workspace={workspace}
sshPrefix={sshPrefix}
showApps={permissions.updateWorkspace}
showBuiltinApps={permissions.updateWorkspace}
hideSSHButton={hideSSHButton}
hideVSCodeDesktopButton={hideVSCodeDesktopButton}
serverVersion={buildInfo?.version || ""}
serverAPIVersion={buildInfo?.agent_api_version || ""}
onUpdateAgent={handleUpdate} // On updating the workspace the agent version is also updated
/>
))}

{(!selectedResource.agents ||
selectedResource.agents?.length === 0) && (
<div
css={{
display: "flex",
justifyContent: "center",
alignItems: "center",
width: "100%",
height: "100%",
}}
>
<div>
<h4 css={{ fontSize: 16, fontWeight: 500 }}>
No agents are currently assigned to this resource.
</h4>
</div>
{(!selectedResource.agents ||
selectedResource.agents?.length === 0) && (
<div
css={{
display: "flex",
justifyContent: "center",
alignItems: "center",
width: "100%",
height: "100%",
}}
>
<div>
<h4 css={{ fontSize: 16, fontWeight: 500 }}>
No agents are currently assigned to this resource.
</h4>
</div>
)}
</section>
)}
</div>
</div>
)}
</section>
)}
</div>
</div>
</div>
Expand All@@ -289,26 +285,24 @@ const countAgents = (resource: TypesGen.WorkspaceResource) => {

const styles = {
content: {
padding:24,
padding:32,
gridArea: "content",
overflowY: "auto",
position: "relative",
},

dotBackground: (theme) => ({
minHeight: "100%",
padding: 23,
dotsBackground: (theme) => ({
"--d": "1px",
background: `
radial-gradient(
circle at
var(--d)
var(--d),

${theme.palette.text.secondary} calc(var(--d) - 1px),
${theme.palette.dots} calc(var(--d) - 1px),
${theme.palette.background.default} var(--d)
)
0 0 /24px 24px
-2px -2px /16px 16px
`,
}),

Expand Down
1 change: 1 addition & 0 deletionssite/src/theme/dark/mui.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -54,6 +54,7 @@ const muiTheme = createTheme({
neutral: {
main: tw.zinc[50],
},
dots: tw.zinc[500],
},
typography: {
fontFamily: BODY_FONT_FAMILY,
Expand Down
1 change: 1 addition & 0 deletionssite/src/theme/darkBlue/mui.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -54,6 +54,7 @@ const muiTheme = createTheme({
neutral: {
main: tw.gray[50],
},
dots: tw.gray[500],
},
typography: {
fontFamily: BODY_FONT_FAMILY,
Expand Down
1 change: 1 addition & 0 deletionssite/src/theme/light/mui.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -56,6 +56,7 @@ const muiTheme = createTheme({
neutral: {
main: tw.zinc[950],
},
dots: tw.zinc[400],
},
typography: {
fontFamily: BODY_FONT_FAMILY,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp