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: add terminal links#1636

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
code-asher merged 2 commits intomainfromcode-asher/terminal-links
May 23, 2022
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
19 changes: 16 additions & 3 deletionssite/src/components/Resources/Resources.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,9 +6,10 @@ import TableHead from "@material-ui/core/TableHead"
import TableRow from "@material-ui/core/TableRow"
import useTheme from "@material-ui/styles/useTheme"
import React from "react"
import { WorkspaceResource } from "../../api/typesGenerated"
import {Workspace,WorkspaceResource } from "../../api/typesGenerated"
import { getDisplayAgentStatus } from "../../util/workspace"
import { TableHeaderRow } from "../TableHeaders/TableHeaders"
import { TerminalLink } from "../TerminalLink/TerminalLink"
import { WorkspaceSection } from "../WorkspaceSection/WorkspaceSection"

const Language = {
Expand All@@ -17,14 +18,16 @@ const Language = {
agentsLabel: "Agents",
agentLabel: "Agent",
statusLabel: "Status",
accessLabel: "Access",
}

interface ResourcesProps {
resources?: WorkspaceResource[]
getResourcesError?: Error
workspace: Workspace
}

export const Resources: React.FC<ResourcesProps> = ({ resources, getResourcesError }) => {
export const Resources: React.FC<ResourcesProps> = ({ resources, getResourcesError, workspace }) => {
const styles = useStyles()
const theme: Theme = useTheme()

Expand All@@ -39,6 +42,7 @@ export const Resources: React.FC<ResourcesProps> = ({ resources, getResourcesErr
<TableCell>{Language.resourceLabel}</TableCell>
<TableCell className={styles.agentColumn}>{Language.agentLabel}</TableCell>
<TableCell>{Language.statusLabel}</TableCell>
<TableCell>{Language.accessLabel}</TableCell>
</TableHeaderRow>
</TableHead>
<TableBody>
Expand All@@ -55,7 +59,7 @@ export const Resources: React.FC<ResourcesProps> = ({ resources, getResourcesErr
return (
<TableRow>
<TableCell className={styles.resourceNameCell}>{resource.name}</TableCell>
<TableCell colSpan={2}></TableCell>
<TableCell colSpan={3}></TableCell>
</TableRow>
)
}
Expand All@@ -78,6 +82,15 @@ export const Resources: React.FC<ResourcesProps> = ({ resources, getResourcesErr
{getDisplayAgentStatus(theme, agent).status}
</span>
</TableCell>
<TableCell>
{agent.status === "connected" && (
<TerminalLink
workspaceName={workspace.name}
agentName={agent.name}
userName={workspace.owner_name}
/>
)}
</TableCell>
</TableRow>
)
})
Expand Down
2 changes: 1 addition & 1 deletionsite/src/components/Workspace/Workspace.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -68,7 +68,7 @@ export const Workspace: React.FC<WorkspaceProps> = ({
<Stack direction="row" spacing={3} className={styles.layout}>
<Stack spacing={3} className={styles.main}>
<WorkspaceStats workspace={workspace} />
<Resources resources={resources} getResourcesError={getResourcesError} />
<Resources resources={resources} getResourcesError={getResourcesError}workspace={workspace}/>
<WorkspaceSection title="Timeline" contentsProps={{ className: styles.timelineContents }}>
<BuildsTable builds={builds} className={styles.timelineTable} />
</WorkspaceSection>
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp