Skip to content

Commit

Permalink
update desktop related
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jan 6, 2024
1 parent 18485b0 commit d89a433
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 45 deletions.
93 changes: 50 additions & 43 deletions docs/.vuepress/components/Desktop.vue
Original file line number Diff line number Diff line change
@@ -1,84 +1,91 @@
<script setup lang="ts">
import { NButtonGroup, NImage, NSpace, NButton, NDropdown } from "naive-ui";
import { computed, ref } from "vue";
import { api } from "./api";
import { NButtonGroup, NImage, NSpace, NButton, NDropdown } from "naive-ui"
import { computed, ref } from "vue"
// import { api } from "./api";
const platform = navigator.platform.toLowerCase();
const plat = ref<"win" | "linux" | "mac">("win");
if (platform.includes("win")) {
plat.value = "win";
} else if (platform.includes("linux")) {
plat.value = "linux";
} else if (platform.includes("mac")) {
plat.value = "mac_arm64";
}
console.log(plat.value);
const res = await fetch(
`https://ad-api.nn.ci/v0/app/latest`
);
const data = await res.json();
const version = data.version as string;
let text = {
down: "Download",
website: "Website",
};
const proxy = "https://mirror.ghproxy.com/"
const res = await fetch(`https://ad-api.nn.ci/v0/app/latest`)
const data = await res.json()
const version = data.version as string
const raw = [
{
key: "win",
label: "Windows",
url: `https://mirror.ghproxy.com/https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_x64_en-US.msi`,
},
{
key: "mac_arm64",
label: "MacOS (Apple Silicon)",
url: `https://mirror.ghproxy.com/https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_aarch64.dmg`,
url: `https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_aarch64.dmg`,
},
{
key: "mac_x64",
label: "MacOS (Intel)",
url: `https://mirror.ghproxy.com/https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_x64.dmg`,
url: `https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_x64.dmg`,
},
{
key: "win_x64",
label: "Windows (X64)",
url: `https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_x64_en-US.msi`,
},
{
key: "win_arm64",
label: "Windows (ARM64)",
url: `https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_arm64-setup.exe`,
},
{
key: "linux",
label: "Linux",
url: `https://mirror.ghproxy.com/https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_amd64.deb`,
url: `https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_$version_amd64.deb`,
},
];
] as const
type Plat = (typeof raw)[number]["key"]
const platform = navigator.platform.toLowerCase()
const plat = ref<Plat>("win_x64")
if (platform.includes("win")) {
plat.value = "win_x64"
} else if (platform.includes("linux")) {
plat.value = "linux"
} else if (platform.includes("mac")) {
plat.value = "mac_arm64"
}
console.log(plat.value)
let text = {
down: "Download",
website: "Website",
}
const fullPlat = computed(() => {
return raw.find((item) => item.key === plat.value)?.label;
});
return raw.find((item) => item.key === plat.value)?.label
})
const options = computed(() => {
return raw.map((item) => {
return {
...item,
label: `${item.label} ${plat.value === item.key ? "" : ""}`,
};
});
});
}
})
})
if (location.pathname.startsWith("/zh/")) {
text = {
down: "下载",
website: "官网",
};
}
}
function down() {
window.open(raw.find((item) => item.key === plat.value)?.url, "_blank");
const href = raw.find((item) => item.key === plat.value)?.url
window.open(`${proxy}${href}`, "_blank")
}
function handleSelect(key) {
plat.value = key;
plat.value = key
}
function openWebsite() {
window.open("https://ad.nn.ci/", "_blank");
window.open("https://ad.nn.ci/", "_blank")
}
</script>

Expand Down
4 changes: 2 additions & 2 deletions docs/.vuepress/components/Pricing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let data = {
},
{
title: 'AList Desktop',
price: '10',
price: '9.99',
features: [
'All Open Source features',
'Use a nice UI to manage the Alist program instead of the command line, and easily view logs',
Expand All @@ -46,7 +46,7 @@ let data = {
},
{
text: 'Buy',
link: 'https://r.nn.ci/ad',
link: 'https://store.nn.ci/checkout/buy/51dca247-20df-4991-8104-54ca534bcc82',
type: 'success'
}
]
Expand Down

0 comments on commit d89a433

Please sign in to comment.