Skip to content

Commit

Permalink
#Changed#
Browse files Browse the repository at this point in the history
Optimize display of image canary
  • Loading branch information
hui.zhao committed Feb 29, 2020
1 parent 13ba523 commit d14f156
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 10 deletions.
9 changes: 9 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,12 @@ Based on [keepachangelog](https://keepachangelog.com/en/1.0.0/)
- Fixed for any bug fixes.
- Security in case of vulnerabilities.

### Git commit message

```text
#Changed#
This is first changed content
This is second changed content
#Deprecated#
xxxx
```
Binary file not shown.
28 changes: 25 additions & 3 deletions android-godeye-monitor-dashboard/src/imagecanary/imagecanary.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import '../App.css';

import { Card, Badge, Button, Input, Row } from 'antd'
import Util from "../libs/util";
import white_grey_bg from '../assets/white_grey_bg.png'

/**
* ImageCanary
Expand Down Expand Up @@ -61,10 +60,33 @@ class ImageCanary extends Component {
}

static renderImg(img_base64) {
const greyWhiteBgUrl = `url('data:image/svg+xml, \
<svg \
xmlns= "http://www.w3.org/2000/svg" \
width= "4" \
height= "4" \
fill-opacity= ".25"> \
\
<rect \
x= "2" \
width= "2" \
height= "2" \
/> \
\
<rect \
y= "2" \
width= "2" \
height= "2" \
/> \
</svg>')`;
if (img_base64) {
return (<Row type="flex" justify="center" align="middle" style={{ padding: 8, backgroundImage: `url("${white_grey_bg}")` }}><img src={`data:image/png;base64,${img_base64}`} alt="" /></Row>)
return (<Row type="flex" justify="center" align="middle" style={{
padding: 8, backgroundImage: greyWhiteBgUrl
}}><img src={`data:image/png;base64,${img_base64}`} alt="" /></Row>)
} else {
return (<Row type="flex" justify="center" align="middle" style={{ padding: 8, backgroundImage: `url("${white_grey_bg}")` }}><span style={{ color: Util.getGreen(), backgroundColor: "#fff", padding: 4 }}>No preview image</span></Row>)
return (<Row type="flex" justify="center" align="middle" style={{
padding: 8, backgroundImage: greyWhiteBgUrl
}}><span style={{ color: Util.getGreen(), backgroundColor: "#fff", padding: 4 }}>No preview image</span></Row>)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"main.css": "static/css/main.187d6dcc.css",
"main.css.map": "static/css/main.187d6dcc.css.map",
"main.js": "static/js/main.1d5bc8dc.js",
"main.js.map": "static/js/main.1d5bc8dc.js.map"
"main.js": "static/js/main.7465d551.js",
"main.js.map": "static/js/main.7465d551.js.map"
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>AndroidGodEye</title><link href="/static/css/main.187d6dcc.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="/static/js/main.1d5bc8dc.js"></script></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>AndroidGodEye</title><link href="/static/css/main.187d6dcc.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="/static/js/main.7465d551.js"></script></body></html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit d14f156

Please sign in to comment.