mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-24 04:06:09 +03:00
parent
6147cd30b5
commit
ef01b6255e
@ -39,6 +39,7 @@ import type { WorkspaceEngineStorageProvider } from '../providers/engine';
|
|||||||
import { BroadcastChannelAwarenessConnection } from './engine/awareness-broadcast-channel';
|
import { BroadcastChannelAwarenessConnection } from './engine/awareness-broadcast-channel';
|
||||||
import { CloudAwarenessConnection } from './engine/awareness-cloud';
|
import { CloudAwarenessConnection } from './engine/awareness-cloud';
|
||||||
import { CloudBlobStorage } from './engine/blob-cloud';
|
import { CloudBlobStorage } from './engine/blob-cloud';
|
||||||
|
import { StaticBlobStorage } from './engine/blob-static';
|
||||||
import { CloudDocEngineServer } from './engine/doc-cloud';
|
import { CloudDocEngineServer } from './engine/doc-cloud';
|
||||||
import { CloudStaticDocStorage } from './engine/doc-cloud-static';
|
import { CloudStaticDocStorage } from './engine/doc-cloud-static';
|
||||||
|
|
||||||
@ -254,7 +255,7 @@ export class CloudWorkspaceFlavourProviderService
|
|||||||
return this.storageProvider.getBlobStorage(workspaceId);
|
return this.storageProvider.getBlobStorage(workspaceId);
|
||||||
},
|
},
|
||||||
getRemoteBlobStorages() {
|
getRemoteBlobStorages() {
|
||||||
return [new CloudBlobStorage(workspaceId)];
|
return [new CloudBlobStorage(workspaceId), new StaticBlobStorage()];
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ import { applyUpdate, encodeStateAsUpdate } from 'yjs';
|
|||||||
|
|
||||||
import type { WorkspaceEngineStorageProvider } from '../providers/engine';
|
import type { WorkspaceEngineStorageProvider } from '../providers/engine';
|
||||||
import { BroadcastChannelAwarenessConnection } from './engine/awareness-broadcast-channel';
|
import { BroadcastChannelAwarenessConnection } from './engine/awareness-broadcast-channel';
|
||||||
|
import { StaticBlobStorage } from './engine/blob-static';
|
||||||
|
|
||||||
export const LOCAL_WORKSPACE_LOCAL_STORAGE_KEY = 'affine-local-workspace';
|
export const LOCAL_WORKSPACE_LOCAL_STORAGE_KEY = 'affine-local-workspace';
|
||||||
const LOCAL_WORKSPACE_CHANGED_BROADCAST_CHANNEL_KEY =
|
const LOCAL_WORKSPACE_CHANGED_BROADCAST_CHANNEL_KEY =
|
||||||
@ -170,7 +171,7 @@ export class LocalWorkspaceFlavourProvider
|
|||||||
return this.storageProvider.getBlobStorage(workspaceId);
|
return this.storageProvider.getBlobStorage(workspaceId);
|
||||||
},
|
},
|
||||||
getRemoteBlobStorages() {
|
getRemoteBlobStorages() {
|
||||||
return [];
|
return [new StaticBlobStorage()];
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ const parseSnapshot = async () => {
|
|||||||
Object.entries(unarchivedFiles).forEach(([name, fileObj]) => {
|
Object.entries(unarchivedFiles).forEach(([name, fileObj]) => {
|
||||||
if (name.includes('MACOSX') || name.includes('__MACOSX')) return;
|
if (name.includes('MACOSX') || name.includes('__MACOSX')) return;
|
||||||
|
|
||||||
if (name.startsWith('assets/') && !fileObj.dir) {
|
if (name.includes('assets/') && !fileObj.dir) {
|
||||||
assetsFiles.push(fileObj);
|
assetsFiles.push(fileObj);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -116,11 +116,11 @@ const parseSnapshot = async () => {
|
|||||||
const extname = path.extname(file.name);
|
const extname = path.extname(file.name);
|
||||||
|
|
||||||
assetsExtentionMap[
|
assetsExtentionMap[
|
||||||
file.name.replace('assets/', '').replace(extname, '')
|
file.name.replace(/.*assets\//, '').replace(extname, '')
|
||||||
] = extname;
|
] = extname;
|
||||||
|
|
||||||
await fs.writeFile(
|
await fs.writeFile(
|
||||||
join(ASSETS_PATH, file.name.replace('assets/', '')),
|
join(ASSETS_PATH, file.name.replace(/.*assets\//, '')),
|
||||||
buffer
|
buffer
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user