Enhance database export functionality and update CSS styles
This commit is contained in:
@@ -1443,11 +1443,16 @@ export default function App() {
|
|||||||
|
|
||||||
const handleExportDatabase = useCallback(async () => {
|
const handleExportDatabase = useCallback(async () => {
|
||||||
setDbExportStatus(null);
|
setDbExportStatus(null);
|
||||||
const destinationPath = await save({
|
const selectedPath = await save({
|
||||||
defaultPath: buildDatabaseExportFilename(),
|
defaultPath: buildDatabaseExportFilename(),
|
||||||
filters: [{ name: "SQLite Database", extensions: ["db", "sqlite"] }]
|
filters: [{ name: "SQLite Database", extensions: ["db", "sqlite"] }]
|
||||||
});
|
});
|
||||||
if (!destinationPath) return;
|
if (!selectedPath) return;
|
||||||
|
|
||||||
|
const destinationPath =
|
||||||
|
selectedPath.endsWith(".db") || selectedPath.endsWith(".sqlite")
|
||||||
|
? selectedPath
|
||||||
|
: `${selectedPath}.db`;
|
||||||
|
|
||||||
setDbExporting(true);
|
setDbExporting(true);
|
||||||
let snapshotPath: string | null = null;
|
let snapshotPath: string | null = null;
|
||||||
|
|||||||
@@ -1061,6 +1061,8 @@ body:not([data-theme="light"]) .markdown-preview {
|
|||||||
inset: 0;
|
inset: 0;
|
||||||
display: grid;
|
display: grid;
|
||||||
place-items: center;
|
place-items: center;
|
||||||
|
padding: 16px;
|
||||||
|
overflow: auto;
|
||||||
z-index: 30;
|
z-index: 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1073,7 +1075,8 @@ body:not([data-theme="light"]) .markdown-preview {
|
|||||||
.settings-panel {
|
.settings-panel {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
width: min(420px, 92vw);
|
width: min(420px, calc(100vw - 32px));
|
||||||
|
max-height: calc(100vh - 32px);
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
background: var(--bg-elevated);
|
background: var(--bg-elevated);
|
||||||
@@ -1082,6 +1085,7 @@ body:not([data-theme="light"]) .markdown-preview {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-panel__header {
|
.settings-panel__header {
|
||||||
@@ -1094,6 +1098,16 @@ body:not([data-theme="light"]) .markdown-preview {
|
|||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.settings-panel__body {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 16px;
|
||||||
|
min-height: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding-right: 4px;
|
||||||
|
margin-right: -4px;
|
||||||
|
}
|
||||||
|
|
||||||
.settings-panel__section {
|
.settings-panel__section {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -1160,6 +1174,19 @@ body:not([data-theme="light"]) .markdown-preview {
|
|||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.settings-panel__status {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-panel__status--success {
|
||||||
|
color: var(--ink);
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-panel__status--error {
|
||||||
|
color: #d36b6b;
|
||||||
|
}
|
||||||
|
|
||||||
body[data-theme="light"] .editor__textarea-wrap:focus-within {
|
body[data-theme="light"] .editor__textarea-wrap:focus-within {
|
||||||
border-color: var(--accent-strong);
|
border-color: var(--accent-strong);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user