diff --git a/packages/nc-gui/pages/projects/index.vue b/packages/nc-gui/pages/projects/index.vue index fd66af74ab..a6ead003cc 100644 --- a/packages/nc-gui/pages/projects/index.vue +++ b/packages/nc-gui/pages/projects/index.vue @@ -47,18 +47,6 @@ - - - - - - - - - - - - @@ -565,14 +444,6 @@ - - { - if (act === 'hideDialog') { - this.dialogShow = false - } else { - this.loading = 'export-zip' - let data - try { - data = await this.$store.dispatch('sqlMgr/ActSqlOp', [ - { - // dbAlias: 'db', - project_id: projectId, - env: '_noco' - }, - 'xcMetaTablesExportDbToZip', - null, - null, - { - responseType: 'blob' - } - ]) - const url = window.URL.createObjectURL( - new Blob([data], { type: 'application/zip' }) - ) - const link = document.createElement('a') - link.href = url - link.setAttribute('download', 'meta.zip') // or any other extension - document.body.appendChild(link) - link.click() - this.$toast - .success(`${this.$t('msg.toast.exportMetadata')}`) - .goAway(3000) - } catch (e) { - console.log(e) - this.$toast.error(e.message).goAway(3000) - } - this.dialogShow = false - this.loading = null - } - } - }, - async resetMeta(projectId) { - this.dialogShow = true - this.confirmMessage = 'Do you want to clear metadata from meta tables?' - this.confirmAction = async(act) => { - if (act === 'hideDialog') { - this.dialogShow = false - } else { - this.loading = 'reset-metadata' - try { - await this.$store.dispatch('sqlMgr/ActSqlOp', [ - { - // dbAlias: 'db', - env: '_noco', - project_id: projectId - }, - 'xcMetaTablesReset' - ]) - // this.$toast.success('Metadata cleared successfully').goAway(3000) - this.$toast - .success(`${this.$t('msg.toast.clearMetadata')}`) - .goAway(3000) - } catch (e) { - console.log(e) - this.$toast.error(e.message).goAway(3000) - } - this.dialogShow = false - this.loading = null - } - } - }, - async importMetaZip() { - const projectId = this.project_id - if ( - this.$refs.importFile && - this.$refs.importFile.files && - this.$refs.importFile.files[0] - ) { - const zipFile = this.$refs.importFile.files[0] - this.loading = 'import-zip' - try { - this.$refs.importFile.value = '' - await this.$store.dispatch('sqlMgr/ActUploadOld', [ - { - // dbAlias: 'db', - project_id: projectId, - env: '_noco' - }, - 'xcMetaTablesImportZipToLocalFsAndDb', - {}, - zipFile - ]) - // this.$toast.success('Successfully imported metadata').goAway(3000) - this.$toast - .success(`${this.$t('msg.toast.importMetadata')}`) - .goAway(3000) - await this.projectsLoad() - } catch (e) { - console.log(e) - this.$toast.error(e.message).goAway(3000) - } - this.dialogShow = false - this.loading = null - } - } } } @@ -1043,11 +809,11 @@ tr:hover .action-icons { .nc-container { position: relative; } -/deep/ .project-row .delete-icon { +/deep/ .project-row .icon { opacity: 0; transition: 0.2s opacity; } -/deep/ .project-row:hover .delete-icon { +/deep/ .project-row:hover .icon { opacity: 1; }