Skip to content

Commit

Permalink
Fix influx, prometheus, elastic, protocol; correct version embedding (#…
Browse files Browse the repository at this point in the history
…69)

* Fix influx, prometheus, elastic, protocol; correct version embedding in release; and placement of database description

* Drop console log
  • Loading branch information
eatonphil committed Oct 12, 2021
1 parent ad1729e commit ba29c9e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
8 changes: 4 additions & 4 deletions desktop/panel/database.ts
Expand Up @@ -89,13 +89,13 @@ export async function evalDatabase(
) {
const defaultPort = DEFAULT_PORT[connector.database.type];
// This is going to get annoying if one of these dbs ever has a non-HTTP protocol.
const { hostname, port } = new URL(
const { protocol, hostname, port } = new URL(
fullHttpURL(connector.database.address, undefined, defaultPort)
);
log.info(
`Connecting ${
serverId ? 'through tunnel ' : ''
}to ${hostname}:${port} for ${connector.database.type} query`
}to ${protocol}//${hostname}:${port} for ${connector.database.type} query`
);
return await tunnel(
project,
Expand Down Expand Up @@ -129,7 +129,7 @@ export async function evalDatabase(
return evalPrometheus(
content,
info.database.range,
host,
protocol + '//' + host,
port,
connector,
info
Expand All @@ -140,7 +140,7 @@ export async function evalDatabase(
return evalInflux(
content,
info.database.range,
host,
protocol + '//' + host,
port,
connector,
info
Expand Down
2 changes: 2 additions & 0 deletions desktop/panel/databases/prometheus.ts
@@ -1,4 +1,5 @@
import fetch from 'node-fetch';
import log from '../../../shared/log';
import { timestampsFromRange } from '../../../shared/sql';
import {
DatabaseConnectorInfo,
Expand Down Expand Up @@ -29,6 +30,7 @@ export async function evalPrometheus(
end.valueOf() / 1000
}&step=${panel.database.step}`;

log.info('Prometheus query: ' + endpoint);
const headers: Record<string, string> = {};
if (
connector.database.username ||
Expand Down
5 changes: 2 additions & 3 deletions desktop/scripts/release.build
@@ -1,10 +1,9 @@
rm -rf build
yarn
setenv UI_ESBUILD_ARGS "--minify"
yarn build-ui
prepend "window.DS_CONFIG_VERSION='{arg0}';" build/ui.js
prepend "window.DS_CONFIG_MODE='desktop';" build/ui.js
yarn build-desktop
prepend "window.DS_CONFIG_MODE='desktop';" build/ui.js
prepend "window.DS_CONFIG_VERSION='{arg0}';" build/ui.js
prepend "global.DS_CONFIG_VERSION='{arg0}';" build/desktop.js
yarn electron-packager --overwrite --out=releases --build-version={arg0} --app-version={arg0} . "DataStation Community Edition"
zip -9 -r releases/{os}-{arch}-{arg0}.zip "releases/DataStation Community Edition-{os}-{arch}"
9 changes: 7 additions & 2 deletions ui/components/Select.tsx
Expand Up @@ -33,6 +33,7 @@ export function Select({
used,
allowNone,
tooltip,
subtext,
}: {
value: string;
onChange: (value: string) => void;
Expand All @@ -43,6 +44,7 @@ export function Select({
used?: Array<string>;
allowNone?: string;
tooltip?: React.ReactNode;
subtext?: React.ReactNode;
}) {
let selectClass = 'select vertical-align-center';
if (className) {
Expand Down Expand Up @@ -78,7 +80,7 @@ export function Select({
}, [value, getOptionValues(children).join(',')]);

const select = (
<React.Fragment>
<div>
<select
className={`${label ? '' : className} select-container`}
value={value}
Expand All @@ -91,7 +93,10 @@ export function Select({
{children}
</select>
{tooltip && <Tooltip>{tooltip}</Tooltip>}
</React.Fragment>
<div>
<small>{subtext}</small>
</div>
</div>
);
if (label) {
return (
Expand Down
2 changes: 1 addition & 1 deletion ui/panels/DatabasePanel.tsx
Expand Up @@ -89,6 +89,7 @@ export function DatabasePanelDetails({
panel.database.connectorId = connectorId;
updatePanel(panel);
}}
subtext={VENDORS[connector.database.type]?.name}
>
{vendorsWithConnectors.map((g) => (
<optgroup label={g.label} key={g.label}>
Expand All @@ -100,7 +101,6 @@ export function DatabasePanelDetails({
</optgroup>
))}
</Select>
<small>{VENDORS[connector.database.type]?.name}</small>
</React.Fragment>
)}
</div>
Expand Down

0 comments on commit ba29c9e

Please sign in to comment.