mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-26 10:45:57 +08:00
fix(electron): update settings styles (#10193)
This commit is contained in:
@@ -2,9 +2,10 @@ import {
|
|||||||
SettingHeader,
|
SettingHeader,
|
||||||
SettingWrapper,
|
SettingWrapper,
|
||||||
} from '@affine/component/setting-components';
|
} from '@affine/component/setting-components';
|
||||||
|
import { WorkspacePermissionService } from '@affine/core/modules/permissions';
|
||||||
import { WorkspaceService } from '@affine/core/modules/workspace';
|
import { WorkspaceService } from '@affine/core/modules/workspace';
|
||||||
import { useI18n } from '@affine/i18n';
|
import { useI18n } from '@affine/i18n';
|
||||||
import { useService } from '@toeverything/infra';
|
import { useLiveData, useService } from '@toeverything/infra';
|
||||||
|
|
||||||
import { EnableCloudPanel } from '../preference/enable-cloud';
|
import { EnableCloudPanel } from '../preference/enable-cloud';
|
||||||
import { BlobManagementPanel } from './blob-management';
|
import { BlobManagementPanel } from './blob-management';
|
||||||
@@ -18,6 +19,10 @@ export const WorkspaceSettingStorage = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
const workspace = useService(WorkspaceService).workspace;
|
const workspace = useService(WorkspaceService).workspace;
|
||||||
|
const workspacePermissionService = useService(
|
||||||
|
WorkspacePermissionService
|
||||||
|
).permission;
|
||||||
|
const isTeam = useLiveData(workspacePermissionService.isTeam$);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SettingHeader
|
<SettingHeader
|
||||||
@@ -25,23 +30,33 @@ export const WorkspaceSettingStorage = ({
|
|||||||
subtitle={t['com.affine.settings.workspace.storage.subtitle']()}
|
subtitle={t['com.affine.settings.workspace.storage.subtitle']()}
|
||||||
/>
|
/>
|
||||||
{workspace.flavour === 'local' ? (
|
{workspace.flavour === 'local' ? (
|
||||||
<EnableCloudPanel onCloseSetting={onCloseSetting} />
|
<>
|
||||||
|
<EnableCloudPanel onCloseSetting={onCloseSetting} />{' '}
|
||||||
|
{BUILD_CONFIG.isElectron && (
|
||||||
|
<SettingWrapper>
|
||||||
|
<DesktopExportPanel workspace={workspace} />
|
||||||
|
</SettingWrapper>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<SettingWrapper>
|
{isTeam ? (
|
||||||
<WorkspaceQuotaPanel />
|
<SettingWrapper>
|
||||||
</SettingWrapper>
|
<WorkspaceQuotaPanel />
|
||||||
|
</SettingWrapper>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{BUILD_CONFIG.isElectron && (
|
||||||
|
<SettingWrapper>
|
||||||
|
<DesktopExportPanel workspace={workspace} />
|
||||||
|
</SettingWrapper>
|
||||||
|
)}
|
||||||
|
|
||||||
<SettingWrapper>
|
<SettingWrapper>
|
||||||
<BlobManagementPanel />
|
<BlobManagementPanel />
|
||||||
</SettingWrapper>
|
</SettingWrapper>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{BUILD_CONFIG.isElectron && (
|
|
||||||
<SettingWrapper>
|
|
||||||
<DesktopExportPanel workspace={workspace} />
|
|
||||||
</SettingWrapper>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { ErrorMessage, Skeleton } from '@affine/component';
|
import { ErrorMessage, Skeleton } from '@affine/component';
|
||||||
import { SettingRow } from '@affine/component/setting-components';
|
import { SettingRow } from '@affine/component/setting-components';
|
||||||
import { WorkspacePermissionService } from '@affine/core/modules/permissions';
|
|
||||||
import { WorkspaceQuotaService } from '@affine/core/modules/quota';
|
import { WorkspaceQuotaService } from '@affine/core/modules/quota';
|
||||||
import { useI18n } from '@affine/i18n';
|
import { useI18n } from '@affine/i18n';
|
||||||
import { useLiveData, useService } from '@toeverything/infra';
|
import { useLiveData, useService } from '@toeverything/infra';
|
||||||
@@ -11,14 +10,6 @@ import * as styles from './style.css';
|
|||||||
|
|
||||||
export const WorkspaceQuotaPanel = () => {
|
export const WorkspaceQuotaPanel = () => {
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
const workspacePermissionService = useService(
|
|
||||||
WorkspacePermissionService
|
|
||||||
).permission;
|
|
||||||
const isTeam = useLiveData(workspacePermissionService.isTeam$);
|
|
||||||
|
|
||||||
if (!isTeam) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingRow
|
<SettingRow
|
||||||
|
|||||||
@@ -1426,10 +1426,10 @@
|
|||||||
"com.affine.settings.workspace.affine-ai.title": "AFFiNE AI",
|
"com.affine.settings.workspace.affine-ai.title": "AFFiNE AI",
|
||||||
"com.affine.settings.workspace.affine-ai.label": "Allow AFFiNE AI Assistant",
|
"com.affine.settings.workspace.affine-ai.label": "Allow AFFiNE AI Assistant",
|
||||||
"com.affine.settings.workspace.affine-ai.description": "Allow workspace members to use AFFiNE AI features. This setting doesn't affect billing. Workspace members use AFFiNE AI through their personal accounts.",
|
"com.affine.settings.workspace.affine-ai.description": "Allow workspace members to use AFFiNE AI features. This setting doesn't affect billing. Workspace members use AFFiNE AI through their personal accounts.",
|
||||||
"com.affine.settings.workspace.backup": "Achieved workspaces",
|
"com.affine.settings.workspace.backup": "Archived workspaces",
|
||||||
"com.affine.settings.workspace.backup.subtitle": "Management in local workspace backup files",
|
"com.affine.settings.workspace.backup.subtitle": "Manage archived local workspace files",
|
||||||
"com.affine.settings.workspace.backup.empty": "No backup files found",
|
"com.affine.settings.workspace.backup.empty": "No archived workspace files found",
|
||||||
"com.affine.settings.workspace.backup.delete": "Delete backup workspace",
|
"com.affine.settings.workspace.backup.delete": "Delete archived workspace",
|
||||||
"com.affine.settings.workspace.backup.delete.warning": "Are you sure you want to delete this workspace. This action cannot be undone. Make sure you no longer need them before proceeding.",
|
"com.affine.settings.workspace.backup.delete.warning": "Are you sure you want to delete this workspace. This action cannot be undone. Make sure you no longer need them before proceeding.",
|
||||||
"com.affine.settings.workspace.backup.delete.success": "Workspace backup deleted successfully",
|
"com.affine.settings.workspace.backup.delete.success": "Workspace backup deleted successfully",
|
||||||
"com.affine.settings.workspace.backup.import.success": "Workspace enabled successfully",
|
"com.affine.settings.workspace.backup.import.success": "Workspace enabled successfully",
|
||||||
|
|||||||
36
packages/frontend/native/index.d.ts
vendored
36
packages/frontend/native/index.d.ts
vendored
@@ -1,5 +1,27 @@
|
|||||||
/* auto-generated by NAPI-RS */
|
/* auto-generated by NAPI-RS */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
export declare class Application {
|
||||||
|
static tapGlobalAudio(excludedProcesses: Array<Application> | undefined | null, audioStreamCallback: ((err: Error | null, arg: Float32Array) => void)): AudioTapStream
|
||||||
|
get processId(): number
|
||||||
|
get bundleIdentifier(): string
|
||||||
|
get name(): string
|
||||||
|
get icon(): Buffer
|
||||||
|
get isRunning(): boolean
|
||||||
|
tapAudio(audioStreamCallback: ((err: Error | null, arg: Float32Array) => void)): AudioTapStream
|
||||||
|
}
|
||||||
|
|
||||||
|
export declare class ApplicationListChangedSubscriber {
|
||||||
|
unsubscribe(): void
|
||||||
|
}
|
||||||
|
|
||||||
|
export declare class ApplicationStateChangedSubscriber {
|
||||||
|
unsubscribe(): void
|
||||||
|
}
|
||||||
|
|
||||||
|
export declare class AudioTapStream {
|
||||||
|
stop(): void
|
||||||
|
}
|
||||||
|
|
||||||
export declare class DocStorage {
|
export declare class DocStorage {
|
||||||
constructor(path: string)
|
constructor(path: string)
|
||||||
validate(): Promise<boolean>
|
validate(): Promise<boolean>
|
||||||
@@ -38,6 +60,20 @@ export declare class DocStoragePool {
|
|||||||
clearClocks(universalId: string): Promise<void>
|
clearClocks(universalId: string): Promise<void>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export declare class RecordingPermissions {
|
||||||
|
audio: boolean
|
||||||
|
screen: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export declare class ShareableContent {
|
||||||
|
static onApplicationListChanged(callback: ((err: Error | null, ) => void)): ApplicationListChangedSubscriber
|
||||||
|
static onAppStateChanged(app: Application, callback: ((err: Error | null, ) => void)): ApplicationStateChangedSubscriber
|
||||||
|
constructor()
|
||||||
|
applications(): Array<Application>
|
||||||
|
applicationWithProcessId(processId: number): Application
|
||||||
|
checkRecordingPermissions(): RecordingPermissions
|
||||||
|
}
|
||||||
|
|
||||||
export declare class SqliteConnection {
|
export declare class SqliteConnection {
|
||||||
constructor(path: string)
|
constructor(path: string)
|
||||||
connect(): Promise<void>
|
connect(): Promise<void>
|
||||||
|
|||||||
@@ -364,8 +364,14 @@ if (!nativeBinding) {
|
|||||||
throw new Error(`Failed to load native binding`)
|
throw new Error(`Failed to load native binding`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports.Application = nativeBinding.Application
|
||||||
|
module.exports.ApplicationListChangedSubscriber = nativeBinding.ApplicationListChangedSubscriber
|
||||||
|
module.exports.ApplicationStateChangedSubscriber = nativeBinding.ApplicationStateChangedSubscriber
|
||||||
|
module.exports.AudioTapStream = nativeBinding.AudioTapStream
|
||||||
module.exports.DocStorage = nativeBinding.DocStorage
|
module.exports.DocStorage = nativeBinding.DocStorage
|
||||||
module.exports.DocStoragePool = nativeBinding.DocStoragePool
|
module.exports.DocStoragePool = nativeBinding.DocStoragePool
|
||||||
|
module.exports.RecordingPermissions = nativeBinding.RecordingPermissions
|
||||||
|
module.exports.ShareableContent = nativeBinding.ShareableContent
|
||||||
module.exports.SqliteConnection = nativeBinding.SqliteConnection
|
module.exports.SqliteConnection = nativeBinding.SqliteConnection
|
||||||
module.exports.mintChallengeResponse = nativeBinding.mintChallengeResponse
|
module.exports.mintChallengeResponse = nativeBinding.mintChallengeResponse
|
||||||
module.exports.ValidationResult = nativeBinding.ValidationResult
|
module.exports.ValidationResult = nativeBinding.ValidationResult
|
||||||
|
|||||||
Reference in New Issue
Block a user