diff --git a/api/app/lib/controllers/metadataAcquisition/adapter.js b/api/app/lib/controllers/metadataAcquisition/adapter.js index b25ef50..5fad233 100644 --- a/api/app/lib/controllers/metadataAcquisition/adapter.js +++ b/api/app/lib/controllers/metadataAcquisition/adapter.js @@ -1,6 +1,6 @@ 'use strict'; const { Pool } = require('pg'); -// 新增模型 +// 测试数据库连接 function checkConnect(opts) { return async function (ctx, next) { diff --git a/scripts/0.0.7/05_alter_backups.sql b/scripts/0.0.7/05_alter_backups.sql new file mode 100644 index 0000000..5a40fba --- /dev/null +++ b/scripts/0.0.7/05_alter_backups.sql @@ -0,0 +1,18 @@ + +comment on column backups.databases is '备份数据源地址'; + + +alter table backups + add restore_databases jsonb; + + +alter table backups + add restore_start timestamp with time zone; + +comment on column backups.restore_start is '备份开始时间'; + +alter table backups + add restore_end timestamp with time zone; + +comment on column backups.restore_end is '备份结束时间'; + diff --git a/web/client/src/sections/backups/components/backupsModal.js b/web/client/src/sections/backups/components/backupsModal.js index 2da7418..67bddf3 100644 --- a/web/client/src/sections/backups/components/backupsModal.js +++ b/web/client/src/sections/backups/components/backupsModal.js @@ -33,7 +33,8 @@ export default (props) => { onCancel: () => { }, }} onFinish={async (values) => { - values.databases = dataSources?.rows?.find(s => s.id == values?.databases?.value)?.config; + let database = dataSources?.rows?.find(s => s.id == values?.databases?.value) + values.databases = { displayName: database?.name, ...database?.config }; values.createTime = moment(); values.state = '备份中'; values.title = title; diff --git a/web/client/src/sections/backups/containers/backupTask.js b/web/client/src/sections/backups/containers/backupTask.js index 2af76f3..adf2242 100644 --- a/web/client/src/sections/backups/containers/backupTask.js +++ b/web/client/src/sections/backups/containers/backupTask.js @@ -58,7 +58,7 @@ function Member(props) { dataIndex: 'database', fixed: 'left', width: '7%', - render: (text, record) => record?.databases?.database + render: (text, record) => record?.databases?.displayName }, { title: '备份信息',