Skip to content

Commit

Permalink
display size 4 GeoSite
Browse files Browse the repository at this point in the history
  • Loading branch information
Larvan2 committed May 8, 2023
1 parent 252f173 commit 95aaf0f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/api/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type RuleAPIItem = {
type: string;
payload: string;
proxy: string;
size: number;
};

function normalizeAPIResponse(json: { rules: Array<RuleAPIItem> }): Array<RuleItem> {
Expand Down
17 changes: 14 additions & 3 deletions src/components/Rule.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,31 @@
.a {
display: flex;
align-items: center;
font-size: 12px;
font-size: 1em;
opacity: 0.8;
}

.b {
flex-grow: 1;
padding: 10px 0;
font-family: 'Roboto Mono', Menlo, monospace;
font-size: 12px;
font-size: 1em;
@media (--breakpoint-not-small) {
font-size: 12px;
font-size: 1em;
}
}

.type {
width: 110px;
color: #3b5f76;
}

.size {
width: 110px;
color: #3b5f76a1;
}

.payloadAndSize {
display: inline-flex;
align-items: center;
}
10 changes: 7 additions & 3 deletions src/components/Rule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@ type Props = {
type?: string;
payload?: string;
proxy?: string;
size?: number;
};

function Rule({ type, payload, proxy, id }: Props) {
function Rule({ type, payload, proxy, id, size }: Props) {
const styleProxy = getStyleFor({ proxy });
return (
<div className={s0.rule}>
<div className={s0.left}>{id}</div>
<div>
<div className={s0.b}>{payload}</div>
<div className={s0.content}>
<div className={s0.payloadAndSize}>
<div className={s0.payload}>{payload}</div>
{type === 'GeoSite' && <div className={s0.size}> : {size}</div>}
</div>
<div className={s0.a}>
<div className={s0.type}>{type}</div>
<div style={styleProxy}>{proxy}</div>
Expand Down

0 comments on commit 95aaf0f

Please sign in to comment.