diff --git a/object/vectorset.go b/object/vectorset.go index 46ac15c..dc0b2c3 100644 --- a/object/vectorset.go +++ b/object/vectorset.go @@ -14,7 +14,10 @@ type Vectorset struct { DisplayName string `xorm:"varchar(100)" json:"displayName"` Url string `xorm:"varchar(100)" json:"url"` + FileName string `xorm:"varchar(100)" json:"fileName"` + FileSize string `xorm:"varchar(100)" json:"fileSize"` Dimension int `json:"dimension"` + Count int `json:"count"` Vectors []*Vector `xorm:"mediumtext" json:"vectors"` } diff --git a/web/src/VectorsetEditPage.js b/web/src/VectorsetEditPage.js index bf7934f..354d62a 100644 --- a/web/src/VectorsetEditPage.js +++ b/web/src/VectorsetEditPage.js @@ -84,6 +84,26 @@ class VectorsetEditPage extends React.Component { }} /> + + + {i18next.t("vectorset:File name")}: + + + { + this.updateVectorsetField('fileName', e.target.value); + }} /> + + + + + {i18next.t("vectorset:File size")}: + + + { + this.updateVectorsetField('fileSize', e.target.value); + }} /> + + {i18next.t("vectorset:Dimension")}: @@ -99,16 +119,18 @@ class VectorsetEditPage extends React.Component { {i18next.t("vectorset:Count")}: - + { + this.updateVectorsetField('count', value); + }} /> - {i18next.t("vectorset:Vectors")}: + {i18next.t("vectorset:Example vectors")}: { this.updateVectorsetField('vectors', value)}} /> diff --git a/web/src/VectorsetListPage.js b/web/src/VectorsetListPage.js index 67331d2..87ac7fd 100644 --- a/web/src/VectorsetListPage.js +++ b/web/src/VectorsetListPage.js @@ -35,7 +35,10 @@ class VectorsetListPage extends React.Component { createdTime: moment().format(), displayName: `Vectorset ${this.state.vectorsets.length}`, url: "https://github.com/Embedding/Chinese-Word-Vectors", + fileName: "sgns.target.word-word.dynwin5.thr10.neg5.dim300.iter5", + fileSize: "1.69 GB", dimension: 128, + count: 10000, vectors: [], } } @@ -108,6 +111,20 @@ class VectorsetListPage extends React.Component { ) } }, + { + title: i18next.t("vectorset:File name"), + dataIndex: 'fileName', + key: 'fileName', + width: '200px', + sorter: (a, b) => a.fileName.localeCompare(b.fileName), + }, + { + title: i18next.t("vectorset:File size"), + dataIndex: 'fileSize', + key: 'fileSize', + width: '120px', + sorter: (a, b) => a.fileSize.localeCompare(b.fileSize), + }, { title: i18next.t("vectorset:Dimension"), dataIndex: 'dimension', @@ -116,7 +133,7 @@ class VectorsetListPage extends React.Component { sorter: (a, b) => a.dimension - b.dimension, }, { - title: i18next.t("vectorset:Vectors"), + title: i18next.t("vectorset:Example vectors"), dataIndex: 'vectors', key: 'vectors', // width: '120px', @@ -131,9 +148,6 @@ class VectorsetListPage extends React.Component { key: 'count', width: '120px', sorter: (a, b) => a.count - b.count, - render: (text, record, index) => { - return record.vectors.length; - } }, { title: i18next.t("general:Action"), diff --git a/web/src/locales/en/data.json b/web/src/locales/en/data.json index 582bd17..2eab30b 100644 --- a/web/src/locales/en/data.json +++ b/web/src/locales/en/data.json @@ -31,6 +31,8 @@ "Count": "Count", "Dimension": "Dimension", "Edit Vectorset": "Edit Vectorset", - "Vectors": "Vectors" + "Example vectors": "Example vectors", + "File name": "File name", + "File size": "File size" } } \ No newline at end of file diff --git a/web/src/locales/zh/data.json b/web/src/locales/zh/data.json index 96d675d..4f4bb02 100644 --- a/web/src/locales/zh/data.json +++ b/web/src/locales/zh/data.json @@ -31,6 +31,8 @@ "Count": "个数", "Dimension": "维度", "Edit Vectorset": "编辑向量集", - "Vectors": "向量" + "Example vectors": "示例向量", + "File name": "文件名", + "File size": "文件大小" } } \ No newline at end of file