Skip to content

Commit d89a433

Browse files
committed
update desktop related
1 parent 18485b0 commit d89a433

File tree

2 files changed

+52
-45
lines changed

2 files changed

+52
-45
lines changed

docs/.vuepress/components/Desktop.vue

Lines changed: 50 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,91 @@
11
<script setup lang="ts">
2-
import { NButtonGroup, NImage, NSpace, NButton, NDropdown } from "naive-ui";
3-
import { computed, ref } from "vue";
4-
import { api } from "./api";
2+
import { NButtonGroup, NImage, NSpace, NButton, NDropdown } from "naive-ui"
3+
import { computed, ref } from "vue"
4+
// import { api } from "./api";
55
6-
const platform = navigator.platform.toLowerCase();
7-
const plat = ref<"win" | "linux" | "mac">("win");
8-
if (platform.includes("win")) {
9-
plat.value = "win";
10-
} else if (platform.includes("linux")) {
11-
plat.value = "linux";
12-
} else if (platform.includes("mac")) {
13-
plat.value = "mac_arm64";
14-
}
15-
16-
console.log(plat.value);
17-
18-
const res = await fetch(
19-
`https://ad-api.nn.ci/v0/app/latest`
20-
);
21-
const data = await res.json();
22-
const version = data.version as string;
23-
24-
let text = {
25-
down: "Download",
26-
website: "Website",
27-
};
6+
const proxy = "https://mirror.ghproxy.com/"
7+
const res = await fetch(`https://ad-api.nn.ci/v0/app/latest`)
8+
const data = await res.json()
9+
const version = data.version as string
2810
2911
const raw = [
30-
{
31-
key: "win",
32-
label: "Windows",
33-
url: `https://mirror.ghproxy.com/https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_x64_en-US.msi`,
34-
},
3512
{
3613
key: "mac_arm64",
3714
label: "MacOS (Apple Silicon)",
38-
url: `https://mirror.ghproxy.com/https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_aarch64.dmg`,
15+
url: `https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_aarch64.dmg`,
3916
},
4017
{
4118
key: "mac_x64",
4219
label: "MacOS (Intel)",
43-
url: `https://mirror.ghproxy.com/https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_x64.dmg`,
20+
url: `https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_x64.dmg`,
21+
},
22+
{
23+
key: "win_x64",
24+
label: "Windows (X64)",
25+
url: `https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_x64_en-US.msi`,
26+
},
27+
{
28+
key: "win_arm64",
29+
label: "Windows (ARM64)",
30+
url: `https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_arm64-setup.exe`,
4431
},
4532
{
4633
key: "linux",
4734
label: "Linux",
48-
url: `https://mirror.ghproxy.com/https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_amd64.deb`,
35+
url: `https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_$version_amd64.deb`,
4936
},
50-
];
37+
] as const
38+
39+
type Plat = (typeof raw)[number]["key"]
40+
41+
const platform = navigator.platform.toLowerCase()
42+
const plat = ref<Plat>("win_x64")
43+
if (platform.includes("win")) {
44+
plat.value = "win_x64"
45+
} else if (platform.includes("linux")) {
46+
plat.value = "linux"
47+
} else if (platform.includes("mac")) {
48+
plat.value = "mac_arm64"
49+
}
50+
51+
console.log(plat.value)
52+
53+
let text = {
54+
down: "Download",
55+
website: "Website",
56+
}
5157
5258
const fullPlat = computed(() => {
53-
return raw.find((item) => item.key === plat.value)?.label;
54-
});
59+
return raw.find((item) => item.key === plat.value)?.label
60+
})
5561
5662
const options = computed(() => {
5763
return raw.map((item) => {
5864
return {
5965
...item,
6066
label: `${item.label} ${plat.value === item.key ? "" : ""}`,
61-
};
62-
});
63-
});
67+
}
68+
})
69+
})
6470
6571
if (location.pathname.startsWith("/zh/")) {
6672
text = {
6773
down: "下载",
6874
website: "官网",
69-
};
75+
}
7076
}
7177
7278
function down() {
73-
window.open(raw.find((item) => item.key === plat.value)?.url, "_blank");
79+
const href = raw.find((item) => item.key === plat.value)?.url
80+
window.open(`${proxy}${href}`, "_blank")
7481
}
7582
7683
function handleSelect(key) {
77-
plat.value = key;
84+
plat.value = key
7885
}
7986
8087
function openWebsite() {
81-
window.open("https://ad.nn.ci/", "_blank");
88+
window.open("https://ad.nn.ci/", "_blank")
8289
}
8390
</script>
8491

docs/.vuepress/components/Pricing.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ let data = {
2828
},
2929
{
3030
title: 'AList Desktop',
31-
price: '10',
31+
price: '9.99',
3232
features: [
3333
'All Open Source features',
3434
'Use a nice UI to manage the Alist program instead of the command line, and easily view logs',
@@ -46,7 +46,7 @@ let data = {
4646
},
4747
{
4848
text: 'Buy',
49-
link: 'https://r.nn.ci/ad',
49+
link: 'https://store.nn.ci/checkout/buy/51dca247-20df-4991-8104-54ca534bcc82',
5050
type: 'success'
5151
}
5252
]

0 commit comments

Comments
 (0)