From 54e22d212e1fa651903dc90788e534924ee0fa04 Mon Sep 17 00:00:00 2001 From: Pranav C Balan Date: Wed, 2 Jun 2021 19:29:42 +0530 Subject: [PATCH] refactor: code refactoring Signed-off-by: Pranav C Balan --- .../nc-gui/components/createOrEditProject.vue | 38 ++-- .../project/settings/appearance.vue | 4 +- packages/nc-gui/store/sqlMgr.js | 183 ------------------ 3 files changed, 23 insertions(+), 202 deletions(-) diff --git a/packages/nc-gui/components/createOrEditProject.vue b/packages/nc-gui/components/createOrEditProject.vue index a881d8a43f..a89bab7724 100644 --- a/packages/nc-gui/components/createOrEditProject.vue +++ b/packages/nc-gui/components/createOrEditProject.vue @@ -9,8 +9,6 @@ v-model="valid"> - -
+ {{ db.ui.ssl.cert }} + + {{ db.ui.ssl.key }} + {{ db.ui.ssl.ca }} @@ -1208,19 +1210,21 @@ export default { // shell.openItem(path.join(this.project.folder, 'config.xc.json')); }, - selectFile(db, obj, key) { + selectFile(db, obj, key, index) { + // this.$refs[key][index].click() + // console.log(obj, key); - const file = dialog.showOpenDialog({ - properties: ["openFile"] - }); - console.log(typeof file, file, typeof file[0]); - if (file && file[0]) { - let fileName = path.basename(file[0]); - db.ui[obj][key] = fileName; - Vue.set(db.ui[obj], key, fileName) - //db.connection[obj][key] = file[0].toString(); - Vue.set(db.connection[obj], key, file[0].toString()) - } + // const file = dialog.showOpenDialog({ + // properties: ["openFile"] + // }); + // console.log(typeof file, file, typeof file[0]); + // if (file && file[0]) { + // let fileName = path.basename(file[0]); + // db.ui[obj][key] = fileName; + // Vue.set(db.ui[obj], key, fileName) + // //db.connection[obj][key] = file[0].toString(); + // Vue.set(db.connection[obj], key, file[0].toString()) + // } }, onPanelToggle(panelIndex, envKey) { this.$nextTick(() => { diff --git a/packages/nc-gui/components/project/settings/appearance.vue b/packages/nc-gui/components/project/settings/appearance.vue index a65e5b03cb..4818ae85ff 100644 --- a/packages/nc-gui/components/project/settings/appearance.vue +++ b/packages/nc-gui/components/project/settings/appearance.vue @@ -24,7 +24,7 @@ - + Show Screensaver diff --git a/packages/nc-gui/store/sqlMgr.js b/packages/nc-gui/store/sqlMgr.js index 401d2584a3..e687ea3f7e 100644 --- a/packages/nc-gui/store/sqlMgr.js +++ b/packages/nc-gui/store/sqlMgr.js @@ -440,189 +440,6 @@ export const actions = { }; -// -// class SqlMgr { -// -// constructor(store) { -// this.$axios = axios.create({ -// baseURL: 'http://localhost:8080', -// }); -// this.store = store; -// } -// -// -// get token() { -// // return this.store.rootGetters['users/GtrToken'] -// } -// -// async projectOpen() { -// // setInterval(async () => console.log('token', await this.store.dispatch('ActGetToken')), 1000); -// // await new Promise(resolve => setTimeout(resolve, 500)) -// // console.log(await this.store.dispatch('ActGetToken')) -// // return (await this.$axios.post('/xc?q=projectOpen', {api: 'PROJECT_READ_BY_WEB'}, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// } -// -// async sqlOp(args, api, opArgs) { -// // try { -// // return (await this.$axios.post('/xc?q=sqlOp_' + api, {api, ...args, args: opArgs}, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// // } catch (e) { -// // throw new Error(e.response.data.msg); -// // } -// } -// -// async sqlOpPlus(args, api, opArgs) { -// // try { -// // return (await this.$axios.post('/xc?q=sqlOpPlus_' + api, {api, ...args, args: opArgs, sqlOpPlus: true}, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// // } catch (e) { -// // throw new Error(e.response.data.msg); -// // } -// } -// -// async projectGenerateBackend(opArgs) { -// // return (await this.$axios.post('/xc?q=projectGenerateBackend', {api: 'projectGenerateBackend', args: opArgs}, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// } -// -// async projectGenerateBackendGql(opArgs) { -// // return (await this.$axios.post('/xc?q=projectGenerateBackendGql', { -// // api: 'projectGenerateBackendGql', -// // args: opArgs -// // }, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// } -// -// async projectGetTsPolicyPath(opArgs) { -// // return (await this.$axios.post('/xc?q=projectGetTsPolicyPath', {api: 'projectGetTsPolicyPath', args: opArgs}, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// } -// -// -// async projectGetGqlPolicyPath(opArgs) { -// // return (await this.$axios.post('/xc?q=projectGetGqlPolicyPath', { -// // api: 'projectGetGqlPolicyPath', -// // args: opArgs -// // }, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// } -// -// -// async projectGetPolicyPath(opArgs) { -// // return (await this.$axios.post('/xc?q=projectGetPolicyPath', {api: 'projectGetPolicyPath', args: opArgs}, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// } -// -// -// async xcRoutesPolicyGet(opArgs) { -// // return (await this.$axios.post('/xc?q=xcRoutesPolicyGet', { -// // api: 'xcRoutesPolicyGet', -// // args: opArgs -// // }, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// } -// -// async projectGetGrpcPolicyFromDb(opArgs) { -// // return (await this.$axios.post('/xc?q=projectGetGrpcPolicyFromDb', { -// // api: 'projectGetGrpcPolicyFromDb', -// // args: opArgs -// // }, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// } -// -// async xcRpcPolicyUpdate(opArgs) { -// // return (await this.$axios.post('/xc?q=xcRpcPolicyUpdate', { -// // api: 'xcRpcPolicyUpdate', -// // args: opArgs -// // }, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// } -// -// async xcRoutesPolicyUpdate(opArgs) { -// // return (await this.$axios.post('/xc?q=xcRoutesPolicyUpdate', { -// // api: 'xcRoutesPolicyUpdate', -// // args: opArgs -// // }, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// } -// -// async xcResolverPolicyGet(opArgs) { -// // return (await this.$axios.post('/xc?q=xcResolverPolicyGet', { -// // api: 'xcResolverPolicyGet', -// // args: opArgs -// // }, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// } -// -// async xcResolverPolicyUpdate(opArgs) { -// // return (await this.$axios.post('/xc?q=xcResolverPolicyUpdate', { -// // api: 'xcResolverPolicyUpdate', -// // args: opArgs -// // }, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// } -// -// async importFresh(opArgs) { -// // return (await this.$axios.post('/xc?q=importFresh', {api: 'importFresh', args: opArgs}, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// } -// -// async writeFile(opArgs) { -// // return (await this.$axios.post('/xc?q=writeFile', {api: 'writeFile', args: opArgs}, { -// // headers: { -// // 'xc-auth': await this.store.dispatch('ActGetToken') -// // } -// // })).data; -// } -// -// -// } /** * @copyright Copyright (c) 2021, Xgene Cloud Ltd *