mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 16:06:01 +00:00
export html file both from web page and electron
This commit is contained in:
@@ -339,16 +339,15 @@ module.exports = {
|
||||
},
|
||||
|
||||
generateDbDiffReport_meta: 'post',
|
||||
async generateDbDiffReport({ sourceConid, sourceDatabase, targetConid, targetDatabase }) {
|
||||
async generateDbDiffReport({ filePath, sourceConid, sourceDatabase, targetConid, targetDatabase }) {
|
||||
const unifiedDiff = await this.getUnifiedDiff({ sourceConid, sourceDatabase, targetConid, targetDatabase });
|
||||
|
||||
const diffJson = parse(unifiedDiff);
|
||||
// $: diffHtml = html(diffJson, { outputFormat: 'side-by-side', drawFileList: false });
|
||||
const diffHtml = html(diffJson, { outputFormat: 'side-by-side' });
|
||||
|
||||
const fileName = `${uuidv1()}.html`;
|
||||
await fs.writeFile(path.join(uploadsdir(), fileName), diff2htmlPage(diffHtml));
|
||||
await fs.writeFile(filePath, diff2htmlPage(diffHtml));
|
||||
|
||||
return fileName;
|
||||
return true;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user