Skip to content

Commit 249d5e6

Browse files
authored
Merge pull request #83 from bfritscher/add-history-field
Add an optional history field list entry into config.json to populate history as bookmarks
2 parents 09250a4 + 245c83e commit 249d5e6

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,34 @@ Sample config.json (same data as saved in localStorage of the browser).
6666
"protocol": "https",
6767
"path": "",
6868
"tls": true
69-
}
69+
},
70+
"history": [
71+
{
72+
"apiKey": "abc",
73+
"node": {
74+
"host": "anotherhost",
75+
"port": "80",
76+
"protocol": "http",
77+
"path": "",
78+
"tls": false
79+
}
80+
},
81+
{
82+
"apiKey": "def",
83+
"node": {
84+
"host": "yetanotherhost",
85+
"port": "8080",
86+
"protocol": "http",
87+
"path": "",
88+
"tls": true
89+
}
90+
}
91+
]
7092
}
7193
```
7294

95+
The `history` is used to populate the client history to act as bookmarks.
96+
7397
### Desktop
7498

7599
With the desktop application everything except instant search will work without cors.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typesense-dashboard",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"description": "A Typesense Dashboard to manage and browse collections.",
55
"productName": "Typesense-Dashboard",
66
"author": "Boris Fritscher <boris@fritscher.ch>",

src/boot/checkAutoLoginConfig.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { defineBoot } from '#q-app/wrappers';
22
import axios from 'axios';
33
import { Platform } from 'quasar';
44
import { useNodeStore } from 'src/stores/node';
5+
import type { NodeLoginDataInterface } from 'src/stores/node';
56

67
export default defineBoot(({ store }) => {
78
if (Platform.is.electron) {
@@ -12,5 +13,13 @@ export default defineBoot(({ store }) => {
1213
if (response.data && response.data.apiKey) {
1314
nodeStore.login(response.data);
1415
}
16+
if (response.data && response.data.history) {
17+
response.data.history.forEach((historyItem: NodeLoginDataInterface) => {
18+
const historyJson = JSON.stringify(historyItem);
19+
if (!nodeStore.loginHistory.includes(historyJson)) {
20+
nodeStore.loginHistory.push(historyJson);
21+
}
22+
});
23+
}
1524
});
1625
});

0 commit comments

Comments
 (0)