Fix db connection test result, #1590
This commit is contained in:
@@ -49,8 +49,8 @@ export const ConfigEditor = (props: Props) => {
|
|||||||
.then((ds) => {
|
.then((ds) => {
|
||||||
if (ds) {
|
if (ds) {
|
||||||
const selectedDs = getDirectDBDatasources().find((dsOption) => dsOption.id === ds.id);
|
const selectedDs = getDirectDBDatasources().find((dsOption) => dsOption.id === ds.id);
|
||||||
setSelectedDBDatasource({ label: selectedDs.name, value: selectedDs.id });
|
setSelectedDBDatasource({ label: selectedDs?.name, value: selectedDs?.id });
|
||||||
setCurrentDSType(selectedDs.type);
|
setCurrentDSType(selectedDs?.type);
|
||||||
onOptionsChange({
|
onOptionsChange({
|
||||||
...options,
|
...options,
|
||||||
jsonData: {
|
jsonData: {
|
||||||
@@ -64,8 +64,8 @@ export const ConfigEditor = (props: Props) => {
|
|||||||
const selectedDs = getDirectDBDatasources().find(
|
const selectedDs = getDirectDBDatasources().find(
|
||||||
(dsOption) => dsOption.id === options.jsonData.dbConnectionDatasourceId
|
(dsOption) => dsOption.id === options.jsonData.dbConnectionDatasourceId
|
||||||
);
|
);
|
||||||
setSelectedDBDatasource({ label: selectedDs.name, value: selectedDs.id });
|
setSelectedDBDatasource({ label: selectedDs?.name, value: selectedDs?.id });
|
||||||
setCurrentDSType(selectedDs.type);
|
setCurrentDSType(selectedDs?.type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
@@ -225,13 +225,13 @@ export const ConfigEditor = (props: Props) => {
|
|||||||
<h3 className="page-heading">Other</h3>
|
<h3 className="page-heading">Other</h3>
|
||||||
<Switch
|
<Switch
|
||||||
label="Disable acknowledges for read-only users"
|
label="Disable acknowledges for read-only users"
|
||||||
labelClass="width-16"
|
labelClass="width-20"
|
||||||
checked={options.jsonData.disableReadOnlyUsersAck}
|
checked={options.jsonData.disableReadOnlyUsersAck}
|
||||||
onChange={jsonDataSwitchHandler('disableReadOnlyUsersAck', options, onOptionsChange)}
|
onChange={jsonDataSwitchHandler('disableReadOnlyUsersAck', options, onOptionsChange)}
|
||||||
/>
|
/>
|
||||||
<Switch
|
<Switch
|
||||||
label="Disable data alignment"
|
label="Disable data alignment"
|
||||||
labelClass="width-16"
|
labelClass="width-20"
|
||||||
checked={!!options.jsonData.disableDataAlignment}
|
checked={!!options.jsonData.disableDataAlignment}
|
||||||
onChange={jsonDataSwitchHandler('disableDataAlignment', options, onOptionsChange)}
|
onChange={jsonDataSwitchHandler('disableDataAlignment', options, onOptionsChange)}
|
||||||
tooltip="Data alignment feature aligns points based on item update interval.
|
tooltip="Data alignment feature aligns points based on item update interval.
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ export class Zabbix implements ZabbixConnector {
|
|||||||
.then((testResult) => {
|
.then((testResult) => {
|
||||||
if (testResult) {
|
if (testResult) {
|
||||||
dbConnectorStatus = {
|
dbConnectorStatus = {
|
||||||
dsType: this.dbConnector.datasourceTypeName,
|
dsType: this.dbConnector.datasourceTypeName || this.dbConnector.datasourceTypeId,
|
||||||
dsName: this.dbConnector.datasourceName,
|
dsName: this.dbConnector.datasourceName,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user