Поддержка 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",
|
||||
"url": "https://rosetta.im",
|
||||
"applicationCategory": "CommunicationApplication",
|
||||
"operatingSystem": ["Windows", "macOS", "Linux"],
|
||||
"operatingSystem": ["Windows", "macOS", "Linux", "Android"],
|
||||
"offers": {
|
||||
"@type": "Offer",
|
||||
"price": "0",
|
||||
|
||||
@@ -12,7 +12,7 @@ import classes from './DownloadCenter.module.css';
|
||||
import { RosettaLogo } from '../RosettaLogo/RosettaLogo';
|
||||
import { useEffect, useState } from 'react';
|
||||
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 { IconDownload } from '@tabler/icons-react';
|
||||
|
||||
@@ -40,7 +40,15 @@ const fetchUpdates = async (): Promise<DownloadFeature[]> => {
|
||||
arch: item.arch,
|
||||
version: item.version,
|
||||
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) {
|
||||
console.error('Failed to fetch updates:', error);
|
||||
return [];
|
||||
@@ -51,7 +59,7 @@ export function DownloadCenter() {
|
||||
const theme = useMantineTheme();
|
||||
const colorScheme = useComputedColorScheme();
|
||||
const [kernels, setKernels] = useState<DownloadFeature[]>([]);
|
||||
const [targetPlatforms, setTargetPlatforms] = useState<string[]>(['darwin', 'linux', 'win32']);
|
||||
const [targetPlatforms, setTargetPlatforms] = useState<string[]>(['darwin', 'linux', 'win32', 'android']);
|
||||
|
||||
useEffect(() => {
|
||||
fetchUpdates().then(setKernels);
|
||||
@@ -61,7 +69,7 @@ export function DownloadCenter() {
|
||||
let targetPlatforms: string[] = [];
|
||||
switch(value){
|
||||
case 'All':
|
||||
targetPlatforms = ['darwin', 'linux', 'win32'];
|
||||
targetPlatforms = ['darwin', 'linux', 'win32', 'android'];
|
||||
break;
|
||||
case 'Windows':
|
||||
targetPlatforms = ['win32'];
|
||||
@@ -69,6 +77,9 @@ export function DownloadCenter() {
|
||||
case 'macOS':
|
||||
targetPlatforms = ['darwin'];
|
||||
break;
|
||||
case 'Android':
|
||||
targetPlatforms = ['android'];
|
||||
break;
|
||||
case 'Linux':
|
||||
targetPlatforms = ['linux'];
|
||||
break;
|
||||
@@ -84,6 +95,8 @@ export function DownloadCenter() {
|
||||
return 'Linux';
|
||||
case 'win32':
|
||||
return 'Windows';
|
||||
case 'android':
|
||||
return 'Android';
|
||||
default:
|
||||
return platform;
|
||||
}
|
||||
@@ -97,6 +110,8 @@ export function DownloadCenter() {
|
||||
return arch === 'arm64' ? 'ARM64' : 'x64';
|
||||
case 'win32':
|
||||
return arch === 'arm64' ? 'ARM64' : 'x64';
|
||||
case 'android':
|
||||
return 'universal';
|
||||
default:
|
||||
return arch;
|
||||
}
|
||||
@@ -111,6 +126,7 @@ export function DownloadCenter() {
|
||||
} />}
|
||||
{feature.platform === 'linux' && <FcLinux size={50} />}
|
||||
{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">
|
||||
{translatePlatformToOsName(feature.platform)} - {translatePlatformAndArchToCpuName(feature.platform, feature.arch)}
|
||||
</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 == '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>
|
||||
<Button component={'a'} href={feature.link} variant={'subtle'} mt={'sm'} leftSection={
|
||||
<IconDownload size={16}></IconDownload>
|
||||
@@ -148,7 +165,7 @@ export function DownloadCenter() {
|
||||
</Text>
|
||||
|
||||
<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 gap="xl" justify={'center'} wrap={'wrap'} align={'center'} mt={50}>
|
||||
|
||||
Reference in New Issue
Block a user