forked from Postcatlab/docs.postcat.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.model.ts
88 lines (88 loc) · 2.33 KB
/
global.model.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
const version = "1.8.2",
resourceUrl = "https://github.com/eolinker/eoapi/releases/latest/download";
export let packages = [
{
id: "win",
text: "Windows",
icon: "windows",
link: `${resourceUrl}/Eoapi-Setup-${version}.exe`,
target: "_self",
},
{
id: "mac",
text: "MacOS(Intel)",
icon: "apple",
link: `${resourceUrl}/Eoapi-${version}.dmg`,
target: "_self",
},
{
id: "mac",
text: "MacOS(M1)",
icon: "apple",
link: `${resourceUrl}/Eoapi-${version}-arm64.dmg`,
target: "_self",
},
];
// const getDynamicLink = {
// findLinkInSingleAssets(assets, item) {
// let result = "";
// let assetIndex = assets.findIndex(
// (asset) =>
// new RegExp(`${item.suffix}$`, "g").test(asset.browser_download_url) &&
// (!item.keyword || asset.browser_download_url.includes(item.keyword))
// );
// if (assetIndex === -1) {
// return result;
// }
// result = assets[assetIndex].browser_download_url;
// assets.splice(assetIndex, 1);
// return result;
// },
// findLink(allAssets, item) {
// let result = "";
// allAssets.some((assets) => {
// result = this.findLinkInSingleAssets(assets, item);
// return result;
// });
// return result;
// },
// getDownloadResource() {
// fetch("https://api.github.com/repos/eolinker/eoapi/releases")
// .then((response) => response.json())
// .then((data) => {
// [...this.resourceInfo]
// .sort((a1, a2) => a2.suffix.length - a1.suffix.length)
// .forEach((item) => {
// item.link = this.findLink(
// data.map((val) => val.assets),
// item
// );
// });
// // console.log(this.resourceInfo);
// });
// },
// };
// let resourceInfo = [
// {
// id: "win",
// name: "Windows 客户端",
// icon: "windows",
// keyword: "Setup",
// suffix: "exe",
// link: `${resourceUrl}/eoapi-Setup-${version}.exe`,
// },
// {
// id: "mac",
// name: "macOS(Intel) 客户端",
// icon: "mac",
// suffix: "dmg",
// link: `${resourceUrl}/eoapi-${version}.dmg`,
// },
// {
// id: "mac",
// name: "macOS(M1) 客户端",
// icon: "mac",
// suffix: "arm64.dmg",
// link: `${resourceUrl}/eoapi-${version}-arm64.dmg`,
// },
// ];