Skip to content

Commit

Permalink
dataset update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuth committed Oct 4, 2022
1 parent 9a592a2 commit ee4ba79
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 13 deletions.
5 changes: 3 additions & 2 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ export default {
};

data = data.map((x) => {
x.segments = x.name.split("--");
x.segments = (x.display_name || x.name).split("--");
x.level = x.segments.length;
return x;
});
Expand All @@ -537,6 +537,7 @@ export default {
};
bundles[cand.id] = {
name: segs,
dataset_name: x.name,
mongocollection: x.mongocollection,
};
parent_obj.children.push(cand);
Expand Down Expand Up @@ -581,7 +582,7 @@ export default {

get_image_url(src) {
var path = ''
if (src.file.indexOf('://') >= 0 && src.block_id) {
if (src.file.indexOf('://') >= 0) {
let ext = (src.url || src.orig_path || '').split('.').pop()
let segs = src.file.split('://')
path = `/images/${segs[0]}/${segs[1].replace('$', src.block_id) || src.block_id}/image.${ext.length <= 4 ? ext : 'data'}`
Expand Down
4 changes: 3 additions & 1 deletion src/locales/chs.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,7 @@
"success": "成功",
"latest-imported": "最近导入",
"new-folder": "新建文件夹",
"folder-name": "文件夹名称"
"folder-name": "文件夹名称",
"display-name": "显示名称",
"mongocollection": "数据库集合名"
}
4 changes: 3 additions & 1 deletion src/locales/cht.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,7 @@
"success": "成功",
"latest-imported": "最近導入",
"new-folder": "新資料夾",
"folder-name": "資料夾名"
"folder-name": "資料夾名",
"display-name": "顯示名",
"mongocollection": "資料庫集合名"
}
4 changes: 3 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,7 @@
"success": "Success",
"latest-imported": "Latest Imported",
"new-folder": "New Folder",
"folder-name": "Folder Name"
"folder-name": "Folder Name",
"display-name": "Display Name",
"mongocollection": "MongoDB Collection Name"
}
4 changes: 3 additions & 1 deletion src/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,7 @@
"success": "完了",
"latest-imported": "最新の輸入",
"new-folder": "新しいフォルダ",
"folder-name": "フォルダ名"
"folder-name": "フォルダ名",
"display-name": "表示名",
"mongocollection": "データベースコレクション"
}
13 changes: 9 additions & 4 deletions src/views/DatasetList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<v-list-item :key="ds._id">
<v-list-item-content>
<v-list-item-title>
{{ ds.name }}

{{ ds.display_name || ds.name }}
<span v-if="ds.display_name">({{ ds.name }})</span>
<v-btn
class="oper"
icon
Expand Down Expand Up @@ -37,12 +37,17 @@
</v-col>
<v-col>
<ParamInput
:arg="{ name: '名称', type: '', default: '' }"
:arg="{ name: $t('name'), type: '', default: '' }"
v-model="input_coll.name"
/></v-col>
<v-col>
<ParamInput
:arg="{ name: '数据库', type: '', default: '' }"
:arg="{ name: $t('display-name'), type: '', default: '' }"
v-model="input_coll.display_name"
/></v-col>
<v-col>
<ParamInput
:arg="{ name: $t('mongocollection'), type: '', default: '' }"
v-model="input_coll.mongocollection"
/></v-col>
</v-row>
Expand Down
6 changes: 3 additions & 3 deletions src/views/SearchForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ export default {
if (selected.length > 0) {
var datasets = selected
.filter((x) => !x.source)
.map((x) => api.escape_regex(x.name)),
.map((x) => api.escape_regex(x.dataset_name)),
sourcefiles = selected
.filter((x) => x.source)
.map((x) => ({
file: x.source.split(":", 2).pop(),
dataset: x.name,
dataset: x.dataset_name,
})),
req_datasets = "",
req_sourcefiles = "";
Expand All @@ -151,7 +151,7 @@ export default {
);
if (datasets.length > 0) {
req_datasets = "dataset%`^" + datasets.join("|^") + "`";
req_datasets = "dataset%`^" + datasets.map(x => x == '' ? '$' : api.escape_regex(x)).join("|^") + "`";
}
if (sourcefiles.length > 0) {
req_sourcefiles = sourcefiles
Expand Down

0 comments on commit ee4ba79

Please sign in to comment.