Skip to content

Commit 8c640d4

Browse files
committed
desktop
1 parent 1725ddb commit 8c640d4

File tree

7 files changed

+199
-4
lines changed

7 files changed

+199
-4
lines changed

docs/.vuepress/components/Desktop.vue

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<script setup lang="ts">
2+
import { NButtonGroup, NImage, NSpace, NButton, NDropdown } from 'naive-ui';
3+
import { computed, ref } from 'vue';
4+
5+
const platform = navigator.platform.toLowerCase()
6+
const plat = ref<"win" | 'linux' | 'mac'>('win')
7+
if (platform.includes('win')) {
8+
plat.value = 'win'
9+
} else if (platform.includes('linux')) {
10+
plat.value = 'linux'
11+
} else if (platform.includes('mac')) {
12+
plat.value = 'mac'
13+
}
14+
15+
console.log(plat.value)
16+
17+
const res = await fetch('https://api.nn.ci/proxy/https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop-proxy.json')
18+
const data = await res.json()
19+
const version = (data.name as string).slice(1)
20+
const urls = {
21+
'win': `https://ghproxy.com/https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_x64_en-US.msi`,
22+
'linux': `https://ghproxy.com/https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_amd64.deb`,
23+
'mac': `https://ghproxy.com/https://github.com/alist-org/desktop-release/releases/latest/download/alist-desktop_${version}_x64.dmg`
24+
}
25+
26+
let text = {
27+
down: "Download"
28+
}
29+
30+
const raw = [
31+
{ key: 'win', label: 'Windows' },
32+
{ key: 'linux', label: 'Linux' },
33+
{ key: 'mac', label: 'MacOS' }
34+
]
35+
36+
const fullPlat = computed(() => {
37+
return raw.find(item => item.key === plat.value)?.label
38+
})
39+
40+
const options = computed(() => {
41+
return raw.map(item => {
42+
return {
43+
...item,
44+
label: `${item.label} ${plat.value === item.key ? '' : ''}`
45+
}
46+
})
47+
})
48+
49+
if (location.pathname.startsWith("/zh/")) {
50+
text = {
51+
down: "下载"
52+
}
53+
}
54+
55+
function down() {
56+
window.open(urls[plat.value], "_blank")
57+
}
58+
59+
function handleSelect(key) {
60+
plat.value = key
61+
}
62+
63+
</script>
64+
65+
<template>
66+
<NSpace align="center" vertical size="large">
67+
<NButtonGroup class="down">
68+
<NDropdown trigger="hover" :options="options" @select="handleSelect" size="large">
69+
<NButton size="large" type="primary" tertiary>💻{{ fullPlat }}</NButton>
70+
</NDropdown>
71+
<NButton size="large" @click="down" type="info" secondary>{{ text.down }}</NButton>
72+
</NButtonGroup>
73+
<NImage src="/img/guide/desktop.png"></NImage>
74+
</NSpace>
75+
</template>
76+
77+
<style scoped>
78+
.down {
79+
transform: scale(150%);
80+
margin-top: 30px;
81+
margin-bottom: 30px;
82+
}
83+
</style>

docs/.vuepress/components/NaiveClient.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,22 @@
22
33
import NaiveConfig from './NaiveConfig.vue';
44
import { ClientOnly } from '@vuepress/client';
5+
import { Suspense } from 'vue'
6+
import { NSpace, NSpin } from 'naive-ui'
57
68
</script>
79

810
<template>
911
<ClientOnly>
1012
<NaiveConfig>
11-
<slot />
13+
<Suspense>
14+
<slot />
15+
<template #fallback>
16+
<NSpace justify="center">
17+
<NSpin size="large" />
18+
</NSpace>
19+
</template>
20+
</Suspense>
1221
</NaiveConfig>
1322
</ClientOnly>
1423
</template>

docs/.vuepress/components/Pricing.vue

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,34 @@ let data = {
2222
text: "Sponsor",
2323
link: "/guide/sponsor.html",
2424
secondary: false,
25-
type: "success"
25+
type: "error"
2626
}
2727
]
2828
},
29+
{
30+
title: 'AList Desktop',
31+
price: '$8',
32+
features: [
33+
'All Open Source features',
34+
'Use a nice UI to manage the Alist program instead of the command line, and easily view logs',
35+
'The native start with system',
36+
'Automatically check for updates',
37+
'Quick view administrator information',
38+
'System Tray, close the window running background does not quit',
39+
'...'
40+
],
41+
btns: [
42+
{
43+
text: 'Download',
44+
link: 'https://github.com/alist-org/desktop-release/releases',
45+
},
46+
{
47+
text: 'Buy',
48+
link: 'https://mbd.pub/o/bread/ZJaTl5xy',
49+
type: 'success'
50+
}
51+
]
52+
},
2953
{
3054
title: 'Technical Support',
3155
price: 'Pay as you go',
@@ -67,9 +91,33 @@ if (location.pathname.startsWith("/zh/")) {
6791
text: "赞助",
6892
link: "/zh/guide/sponsor.html",
6993
secondary: false,
70-
type: "success"
94+
type: "error"
7195
}]
7296
},
97+
{
98+
title: 'AList桌面版',
99+
price: '¥50',
100+
features: [
101+
'所有开源功能',
102+
'使用好看的UI管理AList程序而不是命令行,方便的查看日志',
103+
'原生的开机自启',
104+
'自动检查更新',
105+
'快捷查看管理员信息',
106+
'系统托盘,关闭窗口后台运行不退出',
107+
'...'
108+
],
109+
btns: [
110+
{
111+
text: '下载',
112+
link: 'https://github.com/alist-org/desktop-release/releases',
113+
},
114+
{
115+
text: '购买',
116+
link: 'https://mbd.pub/o/bread/ZJaTl5xy',
117+
type: 'success'
118+
}
119+
]
120+
},
73121
{
74122
title: '技术支持',
75123
price: '按需付费',
@@ -119,7 +167,7 @@ function openLink(link: string) {
119167

120168
<style scoped>
121169
.list {
122-
min-height: 300px;
170+
min-height: 334px;
123171
}
124172
125173
.space>>>div {

docs/.vuepress/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,6 @@ export default defineUserConfig({
127127
"./components/aliyundrive/Callback.vue"
128128
),
129129
"@Pricing": path.resolve(__dirname, "./components/Pricing.vue"),
130+
"@Desktop": path.resolve(__dirname, "./components/Desktop.vue")
130131
},
131132
});
238 KB
Loading

docs/guide/install/desktop.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
# This is the icon of the page
3+
icon: computer
4+
# This control sidebar order
5+
order: 6
6+
# A page can have multiple categories
7+
category:
8+
- Guide
9+
# A page can have multiple tags
10+
tag:
11+
- Install
12+
- Guide
13+
# this page is sticky in article list
14+
sticky: true
15+
# this page will appear in starred articles
16+
star: true
17+
---
18+
19+
# AList Desktop
20+
21+
<NaiveClient>
22+
<Desktop />
23+
</NaiveClient>
24+
25+
<script setup lang="ts">
26+
import Desktop from "@Desktop";
27+
</script>

docs/zh/guide/install/desktop.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
# This is the icon of the page
3+
icon: computer
4+
# This control sidebar order
5+
order: 6
6+
# A page can have multiple categories
7+
category:
8+
- Guide
9+
# A page can have multiple tags
10+
tag:
11+
- Install
12+
- Guide
13+
# this page is sticky in article list
14+
sticky: true
15+
# this page will appear in starred articles
16+
star: true
17+
---
18+
19+
# AList 桌面版
20+
21+
<NaiveClient>
22+
<Desktop />
23+
</NaiveClient>
24+
25+
<script setup lang="ts">
26+
import Desktop from "@Desktop";
27+
</script>

0 commit comments

Comments
 (0)