|
|
@ -66,10 +66,12 @@ |
|
|
|
<div class="d-flex mb-4 mt-7 justify-center"> |
|
|
|
<div class="d-flex mb-4 mt-7 justify-center"> |
|
|
|
<v-btn small |
|
|
|
<v-btn small |
|
|
|
:outlined="action.key !== 'save'" |
|
|
|
:outlined="action.key !== 'save'" |
|
|
|
v-for="action in formDetails.actions" @click="doAction(action)" |
|
|
|
v-for="action in formDetails.actions" |
|
|
|
|
|
|
|
@click="doAction(action)" |
|
|
|
:key="action.key" |
|
|
|
:key="action.key" |
|
|
|
:color="action.key === 'save' ? 'primary' : '' " |
|
|
|
:color="action.key === 'save' ? 'primary' : '' " |
|
|
|
:disabled="action.key === 'save' && !valid" |
|
|
|
:disabled="(action.key === 'save' && !valid) || (action.key === 'test' && testing)" |
|
|
|
|
|
|
|
:loading="action.key === 'test' && testing" |
|
|
|
>{{ action.label }} |
|
|
|
>{{ action.label }} |
|
|
|
</v-btn> |
|
|
|
</v-btn> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -91,7 +93,8 @@ export default { |
|
|
|
settings: null, |
|
|
|
settings: null, |
|
|
|
pluginId: null, |
|
|
|
pluginId: null, |
|
|
|
title: null, |
|
|
|
title: null, |
|
|
|
valid: null |
|
|
|
valid: null, |
|
|
|
|
|
|
|
testing: false |
|
|
|
}), |
|
|
|
}), |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
simpleAnim() { |
|
|
|
simpleAnim() { |
|
|
@ -146,17 +149,23 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
async testSettings() { |
|
|
|
async testSettings() { |
|
|
|
|
|
|
|
this.testing = true; |
|
|
|
try { |
|
|
|
try { |
|
|
|
await this.$store.dispatch('sqlMgr/ActSqlOp', [null, 'xcPluginTest', { |
|
|
|
const res = await this.$store.dispatch('sqlMgr/ActSqlOp', [null, 'xcPluginTest', { |
|
|
|
input: this.settings, |
|
|
|
input: this.settings, |
|
|
|
id: this.pluginId, |
|
|
|
id: this.pluginId, |
|
|
|
category: this.plugin.category, |
|
|
|
category: this.plugin.category, |
|
|
|
title: this.plugin.title |
|
|
|
title: this.plugin.title |
|
|
|
}]); |
|
|
|
}]); |
|
|
|
this.$toast.success('Successfully tested plugin settings').goAway(3000) |
|
|
|
if (res) { |
|
|
|
|
|
|
|
this.$toast.success('Successfully tested plugin settings').goAway(3000) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$toast.info('Invalid credentials').goAway(3000) |
|
|
|
|
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
this.$toast.error(e.message).goAway(3000); |
|
|
|
this.$toast[e.message === 'Not implemented' ? 'info' : 'error'](e.message).goAway(3000); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.testing = false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
async doAction(action) { |
|
|
|
async doAction(action) { |
|
|
|
switch (action.key) { |
|
|
|
switch (action.key) { |
|
|
@ -246,7 +255,5 @@ tbody tr:nth-of-type(odd) { |
|
|
|
background-color: transparent; |
|
|
|
background-color: transparent; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.form-input-label { |
|
|
|
|
|
|
|
padding-bottom: 16px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|
</style> |
|
|
|