Поддержка Android в Download Center
This commit is contained in:
36
.gitea/build.yaml
Normal file
36
.gitea/build.yaml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
name: Build and Publish Landing Page
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: macos
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Install Node.js
|
||||||
|
uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: '22'
|
||||||
|
|
||||||
|
- name: Install npm dependencies
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Build the landing page
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Upload to SSH
|
||||||
|
uses: appleboy/scp-action@master
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.LAND_SSH_HOST }}
|
||||||
|
username: ${{ secrets.LAND_SSH_USERNAME }}
|
||||||
|
password: ${{ secrets.LAND_SSH_PASSWORD }}
|
||||||
|
port: 22
|
||||||
|
source: "dist/*"
|
||||||
|
target: "/var/www/html"
|
||||||
|
rm: true
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
"description": "Secure end-to-end encrypted messaging application",
|
"description": "Secure end-to-end encrypted messaging application",
|
||||||
"url": "https://rosetta.im",
|
"url": "https://rosetta.im",
|
||||||
"applicationCategory": "CommunicationApplication",
|
"applicationCategory": "CommunicationApplication",
|
||||||
"operatingSystem": ["Windows", "macOS", "Linux"],
|
"operatingSystem": ["Windows", "macOS", "Linux", "Android"],
|
||||||
"offers": {
|
"offers": {
|
||||||
"@type": "Offer",
|
"@type": "Offer",
|
||||||
"price": "0",
|
"price": "0",
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import classes from './DownloadCenter.module.css';
|
|||||||
import { RosettaLogo } from '../RosettaLogo/RosettaLogo';
|
import { RosettaLogo } from '../RosettaLogo/RosettaLogo';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { FaApple, FaWindows } from 'react-icons/fa';
|
import { FaApple, FaWindows } from 'react-icons/fa';
|
||||||
import { FcLinux } from 'react-icons/fc';
|
import { FcAndroidOs, FcLinux } from 'react-icons/fc';
|
||||||
import { Switch } from '../Switch/Switch';
|
import { Switch } from '../Switch/Switch';
|
||||||
import { IconDownload } from '@tabler/icons-react';
|
import { IconDownload } from '@tabler/icons-react';
|
||||||
|
|
||||||
@@ -40,7 +40,15 @@ const fetchUpdates = async (): Promise<DownloadFeature[]> => {
|
|||||||
arch: item.arch,
|
arch: item.arch,
|
||||||
version: item.version,
|
version: item.version,
|
||||||
link: new URL(item.downloadUrl, 'https://sdu.rosetta.im').toString(),
|
link: new URL(item.downloadUrl, 'https://sdu.rosetta.im').toString(),
|
||||||
}));
|
})).sort((a : any, b : any) => {
|
||||||
|
const platformOrder = ['darwin', 'linux', 'win32', 'android'];
|
||||||
|
const archOrder = ['arm64', 'x64', 'universal']
|
||||||
|
const platformComparison = platformOrder.indexOf(a.platform) - platformOrder.indexOf(b.platform);
|
||||||
|
if (platformComparison !== 0) {
|
||||||
|
return platformComparison;
|
||||||
|
}
|
||||||
|
return archOrder.indexOf(a.arch) - archOrder.indexOf(b.arch);
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to fetch updates:', error);
|
console.error('Failed to fetch updates:', error);
|
||||||
return [];
|
return [];
|
||||||
@@ -51,7 +59,7 @@ export function DownloadCenter() {
|
|||||||
const theme = useMantineTheme();
|
const theme = useMantineTheme();
|
||||||
const colorScheme = useComputedColorScheme();
|
const colorScheme = useComputedColorScheme();
|
||||||
const [kernels, setKernels] = useState<DownloadFeature[]>([]);
|
const [kernels, setKernels] = useState<DownloadFeature[]>([]);
|
||||||
const [targetPlatforms, setTargetPlatforms] = useState<string[]>(['darwin', 'linux', 'win32']);
|
const [targetPlatforms, setTargetPlatforms] = useState<string[]>(['darwin', 'linux', 'win32', 'android']);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchUpdates().then(setKernels);
|
fetchUpdates().then(setKernels);
|
||||||
@@ -61,7 +69,7 @@ export function DownloadCenter() {
|
|||||||
let targetPlatforms: string[] = [];
|
let targetPlatforms: string[] = [];
|
||||||
switch(value){
|
switch(value){
|
||||||
case 'All':
|
case 'All':
|
||||||
targetPlatforms = ['darwin', 'linux', 'win32'];
|
targetPlatforms = ['darwin', 'linux', 'win32', 'android'];
|
||||||
break;
|
break;
|
||||||
case 'Windows':
|
case 'Windows':
|
||||||
targetPlatforms = ['win32'];
|
targetPlatforms = ['win32'];
|
||||||
@@ -69,6 +77,9 @@ export function DownloadCenter() {
|
|||||||
case 'macOS':
|
case 'macOS':
|
||||||
targetPlatforms = ['darwin'];
|
targetPlatforms = ['darwin'];
|
||||||
break;
|
break;
|
||||||
|
case 'Android':
|
||||||
|
targetPlatforms = ['android'];
|
||||||
|
break;
|
||||||
case 'Linux':
|
case 'Linux':
|
||||||
targetPlatforms = ['linux'];
|
targetPlatforms = ['linux'];
|
||||||
break;
|
break;
|
||||||
@@ -84,6 +95,8 @@ export function DownloadCenter() {
|
|||||||
return 'Linux';
|
return 'Linux';
|
||||||
case 'win32':
|
case 'win32':
|
||||||
return 'Windows';
|
return 'Windows';
|
||||||
|
case 'android':
|
||||||
|
return 'Android';
|
||||||
default:
|
default:
|
||||||
return platform;
|
return platform;
|
||||||
}
|
}
|
||||||
@@ -97,6 +110,8 @@ export function DownloadCenter() {
|
|||||||
return arch === 'arm64' ? 'ARM64' : 'x64';
|
return arch === 'arm64' ? 'ARM64' : 'x64';
|
||||||
case 'win32':
|
case 'win32':
|
||||||
return arch === 'arm64' ? 'ARM64' : 'x64';
|
return arch === 'arm64' ? 'ARM64' : 'x64';
|
||||||
|
case 'android':
|
||||||
|
return 'universal';
|
||||||
default:
|
default:
|
||||||
return arch;
|
return arch;
|
||||||
}
|
}
|
||||||
@@ -111,6 +126,7 @@ export function DownloadCenter() {
|
|||||||
} />}
|
} />}
|
||||||
{feature.platform === 'linux' && <FcLinux size={50} />}
|
{feature.platform === 'linux' && <FcLinux size={50} />}
|
||||||
{feature.platform === 'win32' && <FaWindows size={50} color={theme.colors.blue[6]} />}
|
{feature.platform === 'win32' && <FaWindows size={50} color={theme.colors.blue[6]} />}
|
||||||
|
{feature.platform === 'android' && <FcAndroidOs size={50} />}
|
||||||
<Text fz="lg" ta={'center'} fw={500} mt="md">
|
<Text fz="lg" ta={'center'} fw={500} mt="md">
|
||||||
{translatePlatformToOsName(feature.platform)} - {translatePlatformAndArchToCpuName(feature.platform, feature.arch)}
|
{translatePlatformToOsName(feature.platform)} - {translatePlatformAndArchToCpuName(feature.platform, feature.arch)}
|
||||||
</Text>
|
</Text>
|
||||||
@@ -125,6 +141,7 @@ export function DownloadCenter() {
|
|||||||
</>}
|
</>}
|
||||||
{feature.platform == 'linux' && <>This version is for Linux and comes as an AppImage for the GUI versions.</>}
|
{feature.platform == 'linux' && <>This version is for Linux and comes as an AppImage for the GUI versions.</>}
|
||||||
{feature.platform == 'win32' && <>Download this version of you have computer on Windows 10 or later.</>}
|
{feature.platform == 'win32' && <>Download this version of you have computer on Windows 10 or later.</>}
|
||||||
|
{feature.platform == 'android' && <>This version is for Android devices and all architectures.</>}
|
||||||
</Text>
|
</Text>
|
||||||
<Button component={'a'} href={feature.link} variant={'subtle'} mt={'sm'} leftSection={
|
<Button component={'a'} href={feature.link} variant={'subtle'} mt={'sm'} leftSection={
|
||||||
<IconDownload size={16}></IconDownload>
|
<IconDownload size={16}></IconDownload>
|
||||||
@@ -148,7 +165,7 @@ export function DownloadCenter() {
|
|||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Flex justify={'center'} mt={'lg'}>
|
<Flex justify={'center'} mt={'lg'}>
|
||||||
<Switch onChange={switchTarget} data={['All', 'Windows', 'macOS', 'Linux']}></Switch>
|
<Switch onChange={switchTarget} data={['All', 'Windows', 'macOS', 'Linux', 'Android']}></Switch>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Flex gap="xl" justify={'center'} wrap={'wrap'} align={'center'} mt={50}>
|
<Flex gap="xl" justify={'center'} wrap={'wrap'} align={'center'} mt={50}>
|
||||||
|
|||||||
Reference in New Issue
Block a user