@@ -3,8 +3,9 @@ import { Vue, Options } from 'vue-class-component';
33import { Prop } from ' vue-property-decorator' ;
44import windows from ' @client/assets/images/windows_colorful.png' ;
55import macOS from ' @client/assets/images/macos_colorful.png' ;
6- import linux from ' @client/assets/images/linux_colorful.png' ;
76import DownloadButton from ' ./download-button.vue' ;
7+ import { ReleasesConfig } from ' @client/utils/data.config' ;
8+ import platformUtil from ' @client/utils/platform.util' ;
89
910@Options ({
1011 components: {
@@ -18,54 +19,70 @@ export default class ReleaseItem extends Vue {
1819 switch (this .platform ) {
1920 case ' windows' :
2021 return windows ;
21- case ' macOS ' :
22+ case ' mac ' :
2223 return macOS ;
23- case ' linux' :
24- return linux ;
2524 default :
2625 return ' ' ;
2726 }
2827 }
2928
3029 get downloadLink(): string {
31- switch (this .platform ) {
32- case ' windows' :
33- return ' https://example.com/windows-download' ;
34- case ' mac' :
35- return ' https://example.com/macos-download' ;
36- case ' linux' :
37- return ' https://example.com/linux-download' ;
38- default :
39- return ' ' ;
40- }
30+ const arch = platformUtil .getArchitecture ();
31+ const downloadLink = new ReleasesConfig (process .env .VITE_VERSION as string ).downloadSingleSystemLink (
32+ this .platform ,
33+ arch ,
34+ );
35+ return downloadLink ;
4136 }
4237
4338 get otherLinks(): Array <{ type: string ; items: Array <{ arch: string ; name: string ; link: string }> }> {
4439 switch (this .platform ) {
4540 case ' windows' :
4641 return [
4742 {
48- type: ' Installer ' ,
43+ type: ' Intel ' ,
4944 items: [
50- { arch: ' x64' , name: ' Windows 10' , link: ' https://example.com/windows-10' },
51- { arch: ' arm64' , name: ' Windows 11' , link: ' https://example.com/windows-11' },
45+ {
46+ arch: ' x64' ,
47+ name: ' Windows (Intel)' ,
48+ link: new ReleasesConfig (process .env .VITE_VERSION as string ).downloadSingleSystemLink (' windows' , ' x64' ),
49+ },
5250 ],
5351 },
5452 {
55- type: ' Portable ' ,
53+ type: ' Apple Silicon ' ,
5654 items: [
57- { arch: ' x64' , name: ' Windows 10' , link: ' https://example.com/windows-10-msi' },
58- { arch: ' arm64' , name: ' Windows 11' , link: ' https://example.com/windows-11-msi' },
55+ {
56+ arch: ' arm64' ,
57+ name: ' Windows (Apple Silicon)' ,
58+ link: new ReleasesConfig (process .env .VITE_VERSION as string ).downloadSingleSystemLink (
59+ ' windows' ,
60+ ' arm64' ,
61+ ),
62+ },
5963 ],
6064 },
6165 ];
62- case ' macOS ' :
66+ case ' mac ' :
6367 return [
6468 {
65- type: ' .dmg ' ,
69+ type: ' Apple Silicon ' ,
6670 items: [
67- { arch: ' x64' , name: ' macOS Big Sur' , link: ' https://example.com/macos-big-sur' },
68- { arch: ' arm64' , name: ' macOS Monterey' , link: ' https://example.com/macos-monterey' },
71+ {
72+ arch: ' arm64' ,
73+ name: ' macOS (Apple Silicon)' ,
74+ link: new ReleasesConfig (process .env .VITE_VERSION as string ).downloadSingleSystemLink (' mac' , ' arm64' ),
75+ },
76+ ],
77+ },
78+ {
79+ type: ' Intel' ,
80+ items: [
81+ {
82+ arch: ' x64' ,
83+ name: ' macOS (Intel)' ,
84+ link: new ReleasesConfig (process .env .VITE_VERSION as string ).downloadSingleSystemLink (' mac' , ' x64' ),
85+ },
6986 ],
7087 },
7188 ];
@@ -78,10 +95,10 @@ export default class ReleaseItem extends Vue {
7895 switch (this .platform ) {
7996 case ' windows' :
8097 return ` version ${process .env .VITE_VERSION } for .exe ` ;
81- case ' macOS ' :
98+ case ' mac ' :
8299 return ` version ${process .env .VITE_VERSION } for .dmg ` ;
83100 default :
84- return ` version ${ process . env . VITE_VERSION } for .exe ` ;
101+ return null ;
85102 }
86103 }
87104}
0 commit comments