-
Notifications
You must be signed in to change notification settings - Fork 213
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 #928 from akto-api-security/fix/fix_endpoint_name_ui
Better inventory UI
- Loading branch information
Showing
9 changed files
with
157 additions
and
66 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
43 changes: 43 additions & 0 deletions
43
apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/GetPrettifyEndpoint.jsx
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,43 @@ | ||
import { Avatar, Badge, Box, HorizontalStack, Text, Tooltip } from '@shopify/polaris' | ||
import React, { useRef, useState } from 'react' | ||
import func from '@/util/func' | ||
import transform from '../onboarding/transform' | ||
import observeFunc from "./transform" | ||
function GetPrettifyEndpoint({method,url, isNew}){ | ||
const ref = useRef(null) | ||
const [copyActive, setCopyActive] = useState(false) | ||
return( | ||
<div style={{display: 'flex', gap: '4px'}} ref={ref} onMouseEnter={() => setCopyActive(true)} onMouseLeave={() => setCopyActive(false)}> | ||
<Box width="54px"> | ||
<HorizontalStack align="end"> | ||
<span style={{color: transform.getTextColor(method), fontSize: "14px", fontWeight: 500, lineHeight: '20px'}}>{method}</span> | ||
</HorizontalStack> | ||
</Box> | ||
<Box width="30vw"> | ||
<div style={{display: "flex", justifyContent: "space-between", gap:"24px"}}> | ||
<div style={{display: "flex"}}> | ||
<Box> | ||
<Text variant="bodyMd" fontWeight="medium" breakWord>{observeFunc.getTruncatedUrl(url)}</Text> | ||
</Box> | ||
{copyActive ? | ||
<div onClick={(e) => {e.stopPropagation();func.copyToClipboard(url, ref, "URL copied");}}> | ||
<Tooltip content="Copy endpoint" dismissOnMouseOut> | ||
<div className="reduce-size"> | ||
<Avatar size="extraSmall" source="/public/copy_icon.svg" /> | ||
</div> | ||
</Tooltip> | ||
<Box ref={ref} /> | ||
</div> | ||
:null} | ||
</div> | ||
<Box> | ||
{isNew ? <Badge size="small">New</Badge> : null} | ||
</Box> | ||
</div> | ||
</Box> | ||
</div> | ||
) | ||
} | ||
|
||
|
||
export default GetPrettifyEndpoint |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.