Skip to content

Commit ed603ef

Browse files
committed
fix extensions
1 parent f2d2ab6 commit ed603ef

2 files changed

Lines changed: 22 additions & 9 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tableviewer",
33
"private": true,
4-
"version": "1.2.0",
4+
"version": "1.3.0",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src/components/datatable.vue

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
<n-data-table max-height="calc(100vh - 120px)" :columns="tb_headers" :data="tb_body" size="small"
2525
style="font-size:smaller;font-weight: 550;" />
2626
</div>
27-
<n-modal v-model:show="showModal" preset="dialog" negative-text="Cancel" positive-text="Ok" @positive-click="config_csv"
28-
title="Choose Separator">
27+
<n-modal v-model:show="showModal" preset="dialog" negative-text="Cancel" positive-text="Ok"
28+
@positive-click="config_csv" title="Choose Separator">
2929
<n-select v-model:value="csv_sep" :options="csv_sep_combos" />
3030
</n-modal>
3131
</template>
@@ -48,15 +48,15 @@ const tb_body = ref([]);
4848
4949
const filetype_options = [
5050
{
51-
label: 'parquet',
51+
label: 'parquet(s)',
5252
key: 'parquet'
5353
},
5454
{
55-
label: 'arrow',
55+
label: 'feather(s)',
5656
key: 'arrow'
5757
},
5858
{
59-
label: 'csv',
59+
label: 'csv(s)',
6060
key: 'csv'
6161
}
6262
]
@@ -101,14 +101,27 @@ async function execute_sql() {
101101
}
102102
}
103103
104+
interface ExtensionMapType {
105+
[key: string]: string[]; // Index signature: any string key maps to an array of strings
106+
}
107+
108+
const Extensions: ExtensionMapType = {
109+
"parquet": ["parquet",],
110+
"arrow": ["arrow", "ipc", "feather"],
111+
"csv": ["csv",],
112+
};
113+
104114
async function choose_filetype(key: string) {
105115
sql.value = "select * from LAST offset 0 limit 100";
106116
last_filetype.value = key;
107117
const selected = await open({
108118
multiple: true,
109119
filters: [{
110-
name: 'table file',
111-
extensions: [key,]
120+
name: 'Table File(s)',
121+
extensions: Extensions[key]
122+
}, {
123+
name: 'All File(s)',
124+
extensions: ["*",]
112125
}]
113126
});
114127
// console.log(selected);
@@ -138,7 +151,7 @@ async function config_csv() {
138151
139152
// modal
140153
const showModal = ref(false);
141-
const csv_sep = ref(';');
154+
const csv_sep = ref(',');
142155
const csv_sep_combos = [
143156
{
144157
label: "comma(,)",

0 commit comments

Comments
 (0)