Skip to content

Commit 200309a

Browse files
committed
Merge branch 'new-branch' of github.com:zilliztech/codelabs into add-api-server
2 parents 500fc73 + f3b6550 commit 200309a

File tree

9 files changed

+91
-184
lines changed

9 files changed

+91
-184
lines changed

bin/claat-darwin-amd64

-80 Bytes
Binary file not shown.

bin/claat-linux-amd64

-4 KB
Binary file not shown.

codelabs/install-milvus-cpu/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Duration: 4
5858

5959
Go to [dockerhub](https://hub.docker.com/r/milvusdb/milvus/tags), ensure which version of milvus are you going to install. Click the copy button. Full docker pull command will be copied.
6060

61-
![dockerhub-milvus](pic/pic.png 'dockerhub-milvus')
61+
![dockerhub-milvus](img/pic.png 'dockerhub-milvus')
6262

6363
## Pull Milvus Image
6464

@@ -120,7 +120,7 @@ milvusdb/milvus:1.0.0-cpu-d030521-1ea92e
120120
```
121121

122122
You can see someting like this, and we are done
123-
![dockerhub-milvus](pic/done.png 'dockerhub-milvus')
123+
![dockerhub-milvus](img/done.png 'dockerhub-milvus')
124124

125125
If you want run milvus in the background, add option '-d'
126126

generate.js

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
const fs = require('fs');
22
const args = require('yargs').argv;
33

4-
// Basic config
5-
const CODELABS_SOURCE_DIR = './codelabs';
6-
const MD_PICS_BASE_DIR = './public/images';
7-
84
// get project name via args.env
95
const project = args.env || 'milvus';
106

117
// copy milvus header and footer to components
128
// new folder path is src/component/commonComponents
139
copyComponents();
1410

15-
copyPics();
16-
1711
// copy common component
1812
function copyComponents() {
1913
const [baseSrcDir, baseTarDir] = [
@@ -64,34 +58,3 @@ function copyComponents() {
6458
copyFile(srcPath, tarPath);
6559
});
6660
}
67-
68-
function copyPics() {
69-
const articlePicsPaths = fs.readdirSync(CODELABS_SOURCE_DIR).map(path => ({
70-
path: `${CODELABS_SOURCE_DIR}/${path}/pic`,
71-
id: path,
72-
}));
73-
74-
articlePicsPaths.forEach(({ path, id }) => {
75-
const isPicFolderExist = fs.existsSync(path);
76-
if (isPicFolderExist) {
77-
fs.readdirSync(path).forEach(picPath => {
78-
const pic = fs.readFileSync(`${path}/${picPath}`, 'binary');
79-
80-
isnewPicFolderExist = fs.existsSync(`${MD_PICS_BASE_DIR}/${id}`);
81-
if (!isnewPicFolderExist) {
82-
fs.mkdirSync(`${MD_PICS_BASE_DIR}/${id}`);
83-
}
84-
fs.writeFileSync(
85-
`${MD_PICS_BASE_DIR}/${id}/${picPath}`,
86-
pic,
87-
'binary',
88-
err => {
89-
if (err) {
90-
console.log(err);
91-
}
92-
}
93-
);
94-
});
95-
}
96-
});
97-
}

src/components/card/index.jsx

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1-
import { Link, Typography, Stack, Box } from "@mui/material";
2-
import { format } from "date-fns";
3-
import classes from "./index.module.less";
4-
import Image from "next/image";
1+
import { Link, Typography, Stack, Box } from '@mui/material';
2+
import { format } from 'date-fns';
3+
import classes from './index.module.less';
4+
import Image from 'next/image';
55

66
export default function TutorialCard(props) {
7-
const { title, duration, updated, url } = props;
7+
const { title, duration, updated, url, id } = props;
8+
const pdfLink = `https://github.com/zilliztech/codelabs/raw/master/pdf/${id}.pdf`
89

910
return (
1011
<Box className={classes.tutorialCardWrapper}>
1112
<Typography component="p" className={classes.cardHeader}>
1213
{title}
1314
</Typography>
15+
1416
<Stack
1517
direction="row"
1618
justifyContent="space-between"
1719
className={classes.cardDuration}
1820
>
1921
<Typography component="span">{duration} min</Typography>
2022
<Typography component="span">
21-
Updated {format(new Date(updated), "LLL dd, yyyy")}
23+
Updated {format(new Date(updated), 'LLL dd, yyyy')}
2224
</Typography>
2325
</Stack>
2426
<Stack
@@ -28,6 +30,44 @@ export default function TutorialCard(props) {
2830
className={classes.cardFooter}
2931
>
3032
<Image src="/images/milvus.svg" width={32} height={32} alt="Milvus" />
33+
<Link
34+
href={`${pdfLink}`}
35+
target="_blank"
36+
title={`Download ${id}.pdf`}
37+
underline="none"
38+
>
39+
<svg width="32" height="32" viewBox="0 0 256 256">
40+
<g transform="translate(128 128) scale(0.72 0.72)">
41+
<g transform="translate(-175.05 -175.05000000000004) scale(3.89 3.89)">
42+
<path
43+
d="M 45 47.357 c -0.633 0 -1.228 -0.246 -1.676 -0.693 l -10.63 -10.63 c -0.681 -0.68 -0.882 -1.694 -0.514 -2.583 c 0.369 -0.889 1.228 -1.463 2.19 -1.463 h 2.682 v -8.751 c 0 -1.307 1.063 -2.371 2.37 -2.371 h 11.155 c 1.308 0 2.371 1.063 2.371 2.371 v 8.751 h 2.682 c 0.964 0 1.823 0.575 2.19 1.465 c 0.367 0.888 0.165 1.901 -0.515 2.581 l -10.63 10.63 C 46.229 47.111 45.633 47.357 45 47.357 z M 35.89 34.987 l 9.11 9.11 l 9.109 -9.11 h -2.661 c -0.828 0 -1.5 -0.671 -1.5 -1.5 v -9.622 h -9.896 v 9.622 c 0 0.829 -0.671 1.5 -1.5 1.5 H 35.89 z"
44+
transform=" matrix(1 0 0 1 0 0) "
45+
strokeLinecap="round"
46+
/>
47+
<path
48+
d="M 77.474 17.28 L 61.526 1.332 C 60.668 0.473 59.525 0 58.311 0 H 15.742 c -2.508 0 -4.548 2.04 -4.548 4.548 v 80.904 c 0 2.508 2.04 4.548 4.548 4.548 h 58.516 c 2.508 0 4.549 -2.04 4.549 -4.548 V 20.496 C 78.807 19.281 78.333 18.138 77.474 17.28 z M 61.073 5.121 l 12.611 12.612 H 62.35 c -0.704 0 -1.276 -0.573 -1.276 -1.277 V 5.121 z M 15.742 3 h 42.332 v 13.456 c 0 2.358 1.918 4.277 4.276 4.277 h 13.457 v 33.2 H 14.194 V 4.548 C 14.194 3.694 14.888 3 15.742 3 z M 74.258 87 H 15.742 c -0.854 0 -1.548 -0.694 -1.548 -1.548 V 56.934 h 61.613 v 28.519 C 75.807 86.306 75.112 87 74.258 87 z"
49+
transform=" matrix(1 0 0 1 0 0) "
50+
strokeLinecap="round"
51+
/>
52+
<path
53+
d="M 31.116 62.679 h -5.944 c -0.829 0 -1.5 0.672 -1.5 1.5 v 9.854 v 6.748 c 0 0.828 0.671 1.5 1.5 1.5 s 1.5 -0.672 1.5 -1.5 v -5.248 h 4.444 c 2.392 0 4.338 -1.946 4.338 -4.338 v -4.177 C 35.454 64.625 33.508 62.679 31.116 62.679 z M 32.454 71.194 c 0 0.737 -0.6 1.338 -1.338 1.338 h -4.444 v -6.854 h 4.444 c 0.738 0 1.338 0.601 1.338 1.339 V 71.194 z"
54+
transform=" matrix(1 0 0 1 0 0) "
55+
strokeLinecap="round"
56+
/>
57+
<path
58+
d="M 46.109 82.28 h -5.652 c -0.829 0 -1.5 -0.672 -1.5 -1.5 V 64.179 c 0 -0.828 0.671 -1.5 1.5 -1.5 h 5.652 c 2.553 0 4.63 2.077 4.63 4.63 V 77.65 C 50.739 80.203 48.662 82.28 46.109 82.28 z M 41.957 79.28 h 4.152 c 0.898 0 1.63 -0.731 1.63 -1.63 V 67.309 c 0 -0.898 -0.731 -1.63 -1.63 -1.63 h -4.152 V 79.28 z"
59+
transform=" matrix(1 0 0 1 0 0) "
60+
strokeLinecap="round"
61+
/>
62+
<path
63+
d="M 64.828 62.679 h -8.782 c -0.828 0 -1.5 0.672 -1.5 1.5 V 80.78 c 0 0.828 0.672 1.5 1.5 1.5 s 1.5 -0.672 1.5 -1.5 v -6.801 h 4.251 c 0.828 0 1.5 -0.672 1.5 -1.5 s -0.672 -1.5 -1.5 -1.5 h -4.251 v -5.301 h 7.282 c 0.828 0 1.5 -0.672 1.5 -1.5 S 65.656 62.679 64.828 62.679 z"
64+
transform=" matrix(1 0 0 1 0 0) "
65+
strokeLinecap="round"
66+
/>
67+
</g>
68+
</g>
69+
</svg>
70+
</Link>
3171
<Link
3272
href={`/${url}`}
3373
target="_self"

src/components/card/index.module.less

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@
4040

4141
.cardFooter {
4242
padding: 8px 0;
43-
43+
position: relative;
44+
svg {
45+
position: absolute;
46+
right: 72px;
47+
top: 10px;
48+
fill: #999;
49+
&:hover {
50+
fill: #4fc4f9;
51+
}
52+
}
4453
.linkBtn {
4554
background-color: #4fc4f9;
4655
padding: 8px 16px;

0 commit comments

Comments
 (0)