feat(platform): Update platform naming and add keywords and custom HTML fields

This commit is contained in:
web@ppanel 2025-02-22 23:35:30 +07:00
parent 557c5cdc29
commit 6384237782
4 changed files with 13 additions and 5 deletions

View File

@ -14,6 +14,8 @@ export const useGlobalStore = create<GlobalStore>((set) => ({
site_name: '',
site_desc: '',
site_logo: '',
keywords: '',
custom_html: '',
},
verify: {
turnstile_site_key: '',

View File

@ -45,7 +45,7 @@ import Subscribe from '../subscribe/page';
const platforms: (keyof API.ApplicationPlatform)[] = [
'windows',
'mac',
'macos',
'linux',
'ios',
'android',
@ -106,7 +106,7 @@ export default function Content() {
icon={`${
{
windows: 'mdi:microsoft-windows',
mac: 'uil:apple',
macos: 'uil:apple',
linux: 'uil:linux',
ios: 'simple-icons:ios',
android: 'uil:android',
@ -261,6 +261,7 @@ export default function Content() {
toast.success(
<>
<p>{t('copySuccess')}</p>
<br />
<p>{t('manualImportMessage')}</p>
</>,
);
@ -307,7 +308,10 @@ export default function Content() {
<Link href={app.url}>{t('download')}</Link>
</Button>
<CopyToClipboard text={url} onCopy={handleCopy}>
<CopyToClipboard
text={getAppSubLink(application.subscribe_type, url) || url}
onCopy={handleCopy}
>
<Button size='sm' className='rounded-l-none p-2'>
{t('import')}
</Button>

View File

@ -20,6 +20,8 @@ export const useGlobalStore = create<GlobalStore>((set, get) => ({
site_name: '',
site_desc: '',
site_logo: '',
keywords: '',
custom_html: '',
},
verify: {
turnstile_site_key: '',

View File

@ -56,13 +56,13 @@ export function Logout() {
}
}
export function getPlatform(): 'windows' | 'mac' | 'linux' | 'android' | 'ios' | 'harmony' {
export function getPlatform(): 'windows' | 'macos' | 'linux' | 'android' | 'ios' | 'harmony' {
const parser = new UAParser();
const os = parser.getOS();
const osName = os.name?.toLowerCase() || '';
if (osName.includes('windows')) return 'windows';
if (osName.includes('mac')) return 'mac';
if (osName.includes('mac')) return 'macos';
if (
osName.includes('linux') ||
osName.includes('ubuntu') ||