mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 05:26:00 +00:00
diagram color, export follows current theme
This commit is contained in:
@@ -155,8 +155,8 @@ module.exports = {
|
||||
},
|
||||
|
||||
exportDiagram_meta: true,
|
||||
async exportDiagram({ filePath, html, css }) {
|
||||
await fs.writeFile(filePath, getDiagramExport(html, css));
|
||||
async exportDiagram({ filePath, html, css, themeType, themeClassName }) {
|
||||
await fs.writeFile(filePath, getDiagramExport(html, css, themeType, themeClassName));
|
||||
return true;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
const getDiagramExport = (html,css) => {
|
||||
return `<html>
|
||||
const getDiagramExport = (html, css, themeType, themeClassName) => {
|
||||
return `<html>
|
||||
<meta charset='utf-8'>
|
||||
|
||||
<head>
|
||||
<style>
|
||||
${css}
|
||||
|
||||
body {
|
||||
background: var(--theme-bg-1);
|
||||
color: var(--theme-font-1);
|
||||
}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" href='https://cdn.jsdelivr.net/npm/@mdi/font@6.5.95/css/materialdesignicons.css' />
|
||||
</head>
|
||||
|
||||
<body class='theme-light'>
|
||||
<body class='${themeType == 'dark' ? 'theme-type-dark' : 'theme-type-light'} ${themeClassName}'>
|
||||
${html}
|
||||
</body>
|
||||
|
||||
</html>`;
|
||||
};
|
||||
|
||||
module.exports = getDiagramExport;
|
||||
|
||||
};
|
||||
|
||||
module.exports = getDiagramExport;
|
||||
|
||||
Reference in New Issue
Block a user