-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8091 from tinyspeck/sarabee-workflow-details
[vtadmin-web] Add initial Stream view, render streams on Workflow view
- Loading branch information
Showing
12 changed files
with
296 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Copyright 2021 The Vitess Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
.headingMeta { | ||
display: flex; | ||
} | ||
|
||
.headingMeta span { | ||
display: inline-block; | ||
line-height: 2; | ||
|
||
&::after { | ||
color: var(--colorScaffoldingHighlight); | ||
content: '/'; | ||
display: inline-block; | ||
margin: 0 1.2rem; | ||
} | ||
|
||
&:last-child::after { | ||
content: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/** | ||
* Copyright 2021 The Vitess Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { Link, useParams } from 'react-router-dom'; | ||
|
||
import { useWorkflow } from '../../hooks/api'; | ||
import { useDocumentTitle } from '../../hooks/useDocumentTitle'; | ||
import { formatStreamKey, getStreams } from '../../util/workflows'; | ||
import { Code } from '../Code'; | ||
import { ContentContainer } from '../layout/ContentContainer'; | ||
import { NavCrumbs } from '../layout/NavCrumbs'; | ||
import { WorkspaceHeader } from '../layout/WorkspaceHeader'; | ||
import { WorkspaceTitle } from '../layout/WorkspaceTitle'; | ||
import style from './Stream.module.scss'; | ||
|
||
interface RouteParams { | ||
clusterID: string; | ||
keyspace: string; | ||
streamID: string; | ||
tabletCell: string; | ||
tabletUID: string; | ||
workflowName: string; | ||
} | ||
|
||
export const Stream = () => { | ||
const params = useParams<RouteParams>(); | ||
const { data: workflow } = useWorkflow( | ||
{ | ||
clusterID: params.clusterID, | ||
keyspace: params.keyspace, | ||
name: params.workflowName, | ||
}, | ||
{ refetchInterval: 1000 } | ||
); | ||
|
||
const streamID = parseInt(params.streamID, 10); | ||
const tabletUID = parseInt(params.tabletUID, 10); | ||
const tabletAlias = { cell: params.tabletCell, uid: tabletUID }; | ||
const streamKey = formatStreamKey({ id: streamID, tablet: tabletAlias }); | ||
|
||
useDocumentTitle(`${streamKey} (${params.workflowName})`); | ||
|
||
const stream = getStreams(workflow).find( | ||
(s) => s.id === streamID && s.tablet?.cell === tabletAlias.cell && s.tablet?.uid === tabletAlias.uid | ||
); | ||
|
||
return ( | ||
<div> | ||
<WorkspaceHeader> | ||
<NavCrumbs> | ||
<Link to="/workflows">Workflows</Link> | ||
<Link to={`/workflow/${params.clusterID}/${params.keyspace}/${params.workflowName}`}> | ||
{params.workflowName} | ||
</Link> | ||
</NavCrumbs> | ||
|
||
<WorkspaceTitle className="font-family-monospace">{streamKey}</WorkspaceTitle> | ||
<div className={style.headingMeta}> | ||
<span> | ||
Cluster: <code>{params.clusterID}</code> | ||
</span> | ||
<span> | ||
Target keyspace: <code>{params.keyspace}</code> | ||
</span> | ||
</div> | ||
</WorkspaceHeader> | ||
<ContentContainer> | ||
<Code code={JSON.stringify(stream, null, 2)} /> | ||
</ContentContainer> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* Copyright 2021 The Vitess Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
.headingMeta { | ||
display: flex; | ||
} | ||
|
||
.headingMeta span { | ||
display: inline-block; | ||
line-height: 2; | ||
|
||
&::after { | ||
color: var(--colorScaffoldingHighlight); | ||
content: '/'; | ||
display: inline-block; | ||
margin: 0 1.2rem; | ||
} | ||
|
||
&:last-child::after { | ||
content: none; | ||
} | ||
} | ||
|
||
.streamTable { | ||
margin: 0 0 48px 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.