|
|
@ -1011,7 +1011,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
mixins: [colors], |
|
|
|
mixins: [colors], |
|
|
|
layout: 'empty', |
|
|
|
layout: 'empty', |
|
|
|
data () { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
testSuccess: false, |
|
|
|
testSuccess: false, |
|
|
|
projectCreated: false, |
|
|
|
projectCreated: false, |
|
|
@ -1369,23 +1369,23 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
...mapGetters({ sqlMgr: 'sqlMgr/sqlMgr' }), |
|
|
|
...mapGetters({ sqlMgr: 'sqlMgr/sqlMgr' }), |
|
|
|
isTitle () { |
|
|
|
isTitle() { |
|
|
|
return this.project.title && this.project.title.trim().length |
|
|
|
return this.project.title && this.project.title.trim().length |
|
|
|
}, |
|
|
|
}, |
|
|
|
envStatusValid () { |
|
|
|
envStatusValid() { |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
this.project.envs && |
|
|
|
this.project.envs && |
|
|
|
Object.values(this.project.envs).every(this.getEnvironmentStatusAggregatedNew) |
|
|
|
Object.values(this.project.envs).every(this.getEnvironmentStatusAggregatedNew) |
|
|
|
) |
|
|
|
) |
|
|
|
}, |
|
|
|
}, |
|
|
|
typeIcon () { |
|
|
|
typeIcon() { |
|
|
|
if (this.project.projectType) { |
|
|
|
if (this.project.projectType) { |
|
|
|
return this.projectTypes.find(({ value }) => value === this.project.projectType) |
|
|
|
return this.projectTypes.find(({ value }) => value === this.project.projectType) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return { icon: 'mdi-server', iconColor: 'primary' } |
|
|
|
return { icon: 'mdi-server', iconColor: 'primary' } |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
databaseNamesReverse () { |
|
|
|
databaseNamesReverse() { |
|
|
|
return Object.entries(this.databaseNames).reduce((newObj, [value, key]) => { |
|
|
|
return Object.entries(this.databaseNames).reduce((newObj, [value, key]) => { |
|
|
|
newObj[key] = value |
|
|
|
newObj[key] = value |
|
|
|
return newObj |
|
|
|
return newObj |
|
|
@ -1393,7 +1393,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
async enableAllSchemas () { |
|
|
|
async enableAllSchemas() { |
|
|
|
this.$toast.info('Enabled all schemas').goAway(3000) |
|
|
|
this.$toast.info('Enabled all schemas').goAway(3000) |
|
|
|
this.allSchemas = true |
|
|
|
this.allSchemas = true |
|
|
|
await this.$axios({ |
|
|
|
await this.$axios({ |
|
|
@ -1405,23 +1405,23 @@ export default { |
|
|
|
...mapActions({ |
|
|
|
...mapActions({ |
|
|
|
loadProjects: 'project/loadProjects' |
|
|
|
loadProjects: 'project/loadProjects' |
|
|
|
}), |
|
|
|
}), |
|
|
|
onAdvancePanelToggle () { |
|
|
|
onAdvancePanelToggle() { |
|
|
|
if (this.$refs.monacoEditor) { |
|
|
|
if (this.$refs.monacoEditor) { |
|
|
|
setTimeout(() => this.$refs.monacoEditor.resizeLayout(), 400) |
|
|
|
setTimeout(() => this.$refs.monacoEditor.resizeLayout(), 400) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
getProjectEditTooltip () { |
|
|
|
getProjectEditTooltip() { |
|
|
|
// return `Opens ${path.join(this.project.folder, 'config.xc.json')} and edit - its really simple`; |
|
|
|
// return `Opens ${path.join(this.project.folder, 'config.xc.json')} and edit - its really simple`; |
|
|
|
}, |
|
|
|
}, |
|
|
|
openJsonInSystemEditor () { |
|
|
|
openJsonInSystemEditor() { |
|
|
|
// shell.openItem(path.join(this.project.folder, 'config.xc.json')); |
|
|
|
// shell.openItem(path.join(this.project.folder, 'config.xc.json')); |
|
|
|
}, |
|
|
|
}, |
|
|
|
readFileContent (db, obj, key, index) { |
|
|
|
readFileContent(db, obj, key, index) { |
|
|
|
readFile(this.$refs[`${key}FilePath`][index], (data) => { |
|
|
|
readFile(this.$refs[`${key}FilePath`][index], (data) => { |
|
|
|
Vue.set(db.connection[obj], key, data) |
|
|
|
Vue.set(db.connection[obj], key, data) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
selectFile (db, obj, key, index) { |
|
|
|
selectFile(db, obj, key, index) { |
|
|
|
this.$refs[key][index].click() |
|
|
|
this.$refs[key][index].click() |
|
|
|
|
|
|
|
|
|
|
|
// console.log(obj, key); |
|
|
|
// console.log(obj, key); |
|
|
@ -1437,7 +1437,7 @@ export default { |
|
|
|
// Vue.set(db.connection[obj], key, file[0].toString()) |
|
|
|
// Vue.set(db.connection[obj], key, file[0].toString()) |
|
|
|
// } |
|
|
|
// } |
|
|
|
}, |
|
|
|
}, |
|
|
|
onPanelToggle (panelIndex, envKey) { |
|
|
|
onPanelToggle(panelIndex, envKey) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.panel !== undefined) { |
|
|
|
if (this.panel !== undefined) { |
|
|
|
const panelContainer = this.$refs.panelContainer |
|
|
|
const panelContainer = this.$refs.panelContainer |
|
|
@ -1455,14 +1455,14 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
scrollToTop () { |
|
|
|
scrollToTop() { |
|
|
|
document.querySelector('html').scrollTop = 0 |
|
|
|
document.querySelector('html').scrollTop = 0 |
|
|
|
}, |
|
|
|
}, |
|
|
|
showDBTabInEnvPanel (panelIndex, tabIndex) { |
|
|
|
showDBTabInEnvPanel(panelIndex, tabIndex) { |
|
|
|
this.panel = panelIndex |
|
|
|
this.panel = panelIndex |
|
|
|
Vue.set(this.databases, panelIndex, tabIndex) |
|
|
|
Vue.set(this.databases, panelIndex, tabIndex) |
|
|
|
}, |
|
|
|
}, |
|
|
|
getProjectJson () { |
|
|
|
getProjectJson() { |
|
|
|
console.log('Project json before creating', this.project) |
|
|
|
console.log('Project json before creating', this.project) |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -1574,7 +1574,7 @@ export default { |
|
|
|
return xcConfig |
|
|
|
return xcConfig |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
constructProjectJsonFromProject (project) { |
|
|
|
constructProjectJsonFromProject(project) { |
|
|
|
// const {projectJson: envs, ...rest} = project; |
|
|
|
// const {projectJson: envs, ...rest} = project; |
|
|
|
|
|
|
|
|
|
|
|
// let p = {...rest, ...envs}; |
|
|
|
// let p = {...rest, ...envs}; |
|
|
@ -1634,7 +1634,7 @@ export default { |
|
|
|
delete p.mailer |
|
|
|
delete p.mailer |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async createOrUpdateProject () { |
|
|
|
async createOrUpdateProject() { |
|
|
|
const projectJson = this.getProjectJson() |
|
|
|
const projectJson = this.getProjectJson() |
|
|
|
delete projectJson.folder |
|
|
|
delete projectJson.folder |
|
|
|
|
|
|
|
|
|
|
@ -1693,7 +1693,7 @@ export default { |
|
|
|
this.projectReloading = false |
|
|
|
this.projectReloading = false |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
mtdDialogGetEnvNameSubmit (envName, cookie) { |
|
|
|
mtdDialogGetEnvNameSubmit(envName, cookie) { |
|
|
|
console.log(envName) |
|
|
|
console.log(envName) |
|
|
|
this.dialogGetEnvName.dialogShow = false |
|
|
|
this.dialogGetEnvName.dialogShow = false |
|
|
|
if (envName in this.project.envs) { |
|
|
|
if (envName in this.project.envs) { |
|
|
@ -1736,15 +1736,15 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mtdDialogGetEnvNameCancel () { |
|
|
|
mtdDialogGetEnvNameCancel() { |
|
|
|
console.log('mtdDialogGetTableNameCancel cancelled') |
|
|
|
console.log('mtdDialogGetTableNameCancel cancelled') |
|
|
|
this.dialogGetEnvName.dialogShow = false |
|
|
|
this.dialogGetEnvName.dialogShow = false |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
addNewEnvironment () { |
|
|
|
addNewEnvironment() { |
|
|
|
this.dialogGetEnvName.dialogShow = true |
|
|
|
this.dialogGetEnvName.dialogShow = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
addNewDB (envKey, panelIndex) { |
|
|
|
addNewDB(envKey, panelIndex) { |
|
|
|
const len = this.project.envs[envKey].db.length |
|
|
|
const len = this.project.envs[envKey].db.length |
|
|
|
// eslint-disable-next-line no-unused-vars |
|
|
|
// eslint-disable-next-line no-unused-vars |
|
|
|
const lastDbName = `${this.project.title}_${envKey}_${len}` |
|
|
|
const lastDbName = `${this.project.title}_${envKey}_${len}` |
|
|
@ -1785,10 +1785,10 @@ export default { |
|
|
|
this.databases[panelIndex] = newlyCreatedIndex |
|
|
|
this.databases[panelIndex] = newlyCreatedIndex |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
testConnectionMethodSubmit () { |
|
|
|
testConnectionMethodSubmit() { |
|
|
|
this.dialog.show = false |
|
|
|
this.dialog.show = false |
|
|
|
}, |
|
|
|
}, |
|
|
|
selectDir (ev) { |
|
|
|
selectDir(ev) { |
|
|
|
// console.log(ev) |
|
|
|
// console.log(ev) |
|
|
|
// const file = dialog.showOpenDialog({ |
|
|
|
// const file = dialog.showOpenDialog({ |
|
|
|
// properties: ['openDirectory'] |
|
|
|
// properties: ['openDirectory'] |
|
|
@ -1799,7 +1799,7 @@ export default { |
|
|
|
// this.userSelectedDir = true |
|
|
|
// this.userSelectedDir = true |
|
|
|
// } |
|
|
|
// } |
|
|
|
}, |
|
|
|
}, |
|
|
|
selectSqliteFile (db) { |
|
|
|
selectSqliteFile(db) { |
|
|
|
// console.log(ev) |
|
|
|
// console.log(ev) |
|
|
|
// const file = dialog.showOpenDialog({ |
|
|
|
// const file = dialog.showOpenDialog({ |
|
|
|
// properties: ["openFile"] |
|
|
|
// properties: ["openFile"] |
|
|
@ -1809,7 +1809,7 @@ export default { |
|
|
|
// } |
|
|
|
// } |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getDbStatusColor (db) { |
|
|
|
getDbStatusColor(db) { |
|
|
|
switch (db.ui.setup) { |
|
|
|
switch (db.ui.setup) { |
|
|
|
case -1: |
|
|
|
case -1: |
|
|
|
return 'red' |
|
|
|
return 'red' |
|
|
@ -1825,7 +1825,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getDbStatusTooltip (db) { |
|
|
|
getDbStatusTooltip(db) { |
|
|
|
switch (db.ui.setup) { |
|
|
|
switch (db.ui.setup) { |
|
|
|
case -1: |
|
|
|
case -1: |
|
|
|
return 'DB Connection NOT successful' |
|
|
|
return 'DB Connection NOT successful' |
|
|
@ -1840,7 +1840,7 @@ export default { |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
async newTestConnection (db, env, panelIndex) { |
|
|
|
async newTestConnection(db, env, panelIndex) { |
|
|
|
console.log(this.project.envs[env][0]) |
|
|
|
console.log(this.project.envs[env][0]) |
|
|
|
if ( |
|
|
|
if ( |
|
|
|
db.connection.host === 'localhost' && |
|
|
|
db.connection.host === 'localhost' && |
|
|
@ -1931,7 +1931,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
sendAdvancedConfig (connection) { |
|
|
|
sendAdvancedConfig(connection) { |
|
|
|
if (!connection.ssl) { return false } |
|
|
|
if (!connection.ssl) { return false } |
|
|
|
let sendAdvancedConfig = false |
|
|
|
let sendAdvancedConfig = false |
|
|
|
const sslOptions = Object.values(connection.ssl).filter(el => !!el) |
|
|
|
const sslOptions = Object.values(connection.ssl).filter(el => !!el) |
|
|
@ -1944,7 +1944,7 @@ export default { |
|
|
|
return sendAdvancedConfig |
|
|
|
return sendAdvancedConfig |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
handleSSL (db, creating = true) { |
|
|
|
handleSSL(db, creating = true) { |
|
|
|
console.log('handleSSL', db) |
|
|
|
console.log('handleSSL', db) |
|
|
|
const sendAdvancedConfig = this.sendAdvancedConfig(db.connection) |
|
|
|
const sendAdvancedConfig = this.sendAdvancedConfig(db.connection) |
|
|
|
if (!sendAdvancedConfig) { |
|
|
|
if (!sendAdvancedConfig) { |
|
|
@ -1963,8 +1963,8 @@ export default { |
|
|
|
// } |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
getDatabaseForTestConnection (dbType) {}, |
|
|
|
getDatabaseForTestConnection(dbType) {}, |
|
|
|
async testConnection (db, env, panelIndex) { |
|
|
|
async testConnection(db, env, panelIndex) { |
|
|
|
this.$store.commit('notification/MutToggleProgressBar', true) |
|
|
|
this.$store.commit('notification/MutToggleProgressBar', true) |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (!(await this.newTestConnection(db, env, panelIndex))) { |
|
|
|
if (!(await this.newTestConnection(db, env, panelIndex))) { |
|
|
@ -2020,17 +2020,17 @@ export default { |
|
|
|
this.$store.commit('notification/MutToggleProgressBar', false) |
|
|
|
this.$store.commit('notification/MutToggleProgressBar', false) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
getEnvironmentStatusAggregated (dbs) { |
|
|
|
getEnvironmentStatusAggregated(dbs) { |
|
|
|
return dbs.every(db => db.ui.setup === 1) |
|
|
|
return dbs.every(db => db.ui.setup === 1) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getEnvironmentStatusAggregatedNew (dbs) { |
|
|
|
getEnvironmentStatusAggregatedNew(dbs) { |
|
|
|
return dbs.db.every(db => db.ui.setup === 1) |
|
|
|
return dbs.db.every(db => db.ui.setup === 1) |
|
|
|
}, |
|
|
|
}, |
|
|
|
openFirstPanel () { |
|
|
|
openFirstPanel() { |
|
|
|
if (!this.edit) { this.panel = 0 } |
|
|
|
if (!this.edit) { this.panel = 0 } |
|
|
|
}, |
|
|
|
}, |
|
|
|
onDatabaseTypeChanged (client, db1, index, env) { |
|
|
|
onDatabaseTypeChanged(client, db1, index, env) { |
|
|
|
for (const env in this.project.envs) { |
|
|
|
for (const env in this.project.envs) { |
|
|
|
if (this.project.envs[env].db.length > index) { |
|
|
|
if (this.project.envs[env].db.length > index) { |
|
|
|
const db = this.project.envs[env].db[index] |
|
|
|
const db = this.project.envs[env].db[index] |
|
|
@ -2071,13 +2071,13 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
selectDatabaseClient (database, index = 0) { |
|
|
|
selectDatabaseClient(database, index = 0) { |
|
|
|
if (this.client) { this.client[index] = database } |
|
|
|
if (this.client) { this.client[index] = database } |
|
|
|
}, |
|
|
|
}, |
|
|
|
setDBStatus (db, status) { |
|
|
|
setDBStatus(db, status) { |
|
|
|
db.ui.setup = status |
|
|
|
db.ui.setup = status |
|
|
|
}, |
|
|
|
}, |
|
|
|
removeDBFromEnv (db, env, panelIndex, dbIndex) { |
|
|
|
removeDBFromEnv(db, env, panelIndex, dbIndex) { |
|
|
|
console.log(db, env, panelIndex, dbIndex) |
|
|
|
console.log(db, env, panelIndex, dbIndex) |
|
|
|
|
|
|
|
|
|
|
|
for (const env in this.project.envs) { |
|
|
|
for (const env in this.project.envs) { |
|
|
@ -2086,15 +2086,15 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
removeEnv (envKey) { |
|
|
|
removeEnv(envKey) { |
|
|
|
delete this.project.envs[envKey] |
|
|
|
delete this.project.envs[envKey] |
|
|
|
Vue.set(this.project, 'envs', { ...this.project.envs }) |
|
|
|
Vue.set(this.project, 'envs', { ...this.project.envs }) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
fetch ({ store, params }) {}, |
|
|
|
fetch({ store, params }) {}, |
|
|
|
beforeCreated () {}, |
|
|
|
beforeCreated() {}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
'project.title' (newValue, oldValue) { |
|
|
|
'project.title'(newValue, oldValue) { |
|
|
|
if (!newValue) { return } |
|
|
|
if (!newValue) { return } |
|
|
|
if (!this.edit) { |
|
|
|
if (!this.edit) { |
|
|
|
// Vue.set(this.project, 'folder', slash(path.join(this.baseFolder, newValue))) |
|
|
|
// Vue.set(this.project, 'folder', slash(path.join(this.baseFolder, newValue))) |
|
|
@ -2121,7 +2121,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
'project.envs': { |
|
|
|
'project.envs': { |
|
|
|
deep: true, |
|
|
|
deep: true, |
|
|
|
handler (envs) { |
|
|
|
handler(envs) { |
|
|
|
if (typeof envs === 'object' && envs) { |
|
|
|
if (typeof envs === 'object' && envs) { |
|
|
|
Object.entries(envs).forEach(([key, env]) => { |
|
|
|
Object.entries(envs).forEach(([key, env]) => { |
|
|
|
let res = 1 |
|
|
|
let res = 1 |
|
|
@ -2153,7 +2153,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
async created () { |
|
|
|
async created() { |
|
|
|
this.compErrorMessage = |
|
|
|
this.compErrorMessage = |
|
|
|
this.compErrorMessages[Math.floor(Math.random() * this.compErrorMessages.length)] |
|
|
|
this.compErrorMessages[Math.floor(Math.random() * this.compErrorMessages.length)] |
|
|
|
|
|
|
|
|
|
|
@ -2218,8 +2218,8 @@ export default { |
|
|
|
// } |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
beforeMount () {}, |
|
|
|
beforeMount() {}, |
|
|
|
mounted () { |
|
|
|
mounted() { |
|
|
|
this.$set( |
|
|
|
this.$set( |
|
|
|
this.project, |
|
|
|
this.project, |
|
|
|
'title', |
|
|
|
'title', |
|
|
@ -2236,12 +2236,12 @@ export default { |
|
|
|
input.focus() |
|
|
|
input.focus() |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
beforeDestroy () {}, |
|
|
|
beforeDestroy() {}, |
|
|
|
destroy () {}, |
|
|
|
destroy() {}, |
|
|
|
validate ({ params }) { |
|
|
|
validate({ params }) { |
|
|
|
return true |
|
|
|
return true |
|
|
|
}, |
|
|
|
}, |
|
|
|
head () { |
|
|
|
head() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
title: this.$t('projects.ext_db.head.title') |
|
|
|
title: this.$t('projects.ext_db.head.title') |
|
|
|
} |
|
|
|
} |
|
|
|