Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ packages/*
*.user
.vs/config/applicationhost.config
src/*.Testing/*.xml
ImagesRaw/
ImagesRaw/
.vs/*
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# InfluxDB Studio
# CymaticLabs/InfluxDBStudio seems to not be maintained anymore. I wanted to make a change and have sumbitted a [PR](https://github.com/CymaticLabs/InfluxDBStudio/pull/42). I've forked it here so I can continue to change for my use if needed.


# InfluxDB Studio
**InfluxDB Studio is a UI management tool for [the InfluxDB time series database](https://www.influxdata.com/time-series-platform/influxdb/).**

Its inspiration comes from other similar database management tools such as [SQL Server Management Studio](https://en.wikipedia.org/wiki/SQL_Server_Management_Studio)
Expand Down Expand Up @@ -162,7 +165,7 @@ Using **aggregation (GROUP BY)** in queries will group the series results into t
The results of most query windows in InfluxDB Studio can be exported to file. **Right-click** in the results table and choose from the available export options.
Data can be exported in either **CSV** or **JSON** format. Choosing **Export All** will export the entire set of returned rows to file. Alternatively you can
export just the selected rows by using **CTRL + Left Click** and **Shift + Left Click** to select the rows you want to export and then choosing **Export Selected**
in the export context menu.
in the export context menu. Upon saving you can select the chararcter to use as the CSV delimiter.

![Exporting Database Results](docs/img/Databases_ExportQueryResults.png?raw=true "Exporting Database Results")

Expand Down Expand Up @@ -240,7 +243,7 @@ Using **aggregation (GROUP BY)** in queries will group the series results into t
The results of most query windows in InfluxDB Studio can be exported to file. **Right-click** in the results table and choose from the available export options.
Data can be exported in either **CSV** or **JSON** format. Choosing **Export All** will export the entire set of returned rows to file. Alternatively you can
export just the selected rows by using **CTRL + Left Click** and **Shift + Left Click** to select the rows you want to export and then choosing **Export Selected**
in the export context menu.
in the export context menu. Upon saving you can select the chararcter to use as the CSV delimiter.

![Exporting Measurement Results](docs/img/Measurements_ExportQuery_1.png?raw=true "Exporting Measurement Results")

Expand Down
29 changes: 16 additions & 13 deletions src/CymaticLabs.InfluxDB.Studio/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,22 @@
</assemblyBinding>
</runtime>
<userSettings>
<CymaticLabs.InfluxDB.Studio.Properties.Settings>
<setting name="ConnectionsJson" serializeAs="String">
<value />
</setting>
<setting name="AllowUntrustedSsl" serializeAs="String">
<value>False</value>
</setting>
<setting name="TimeFormat" serializeAs="String">
<value>hh:mm:ss tt</value>
</setting>
<setting name="DateFormat" serializeAs="String">
<value>M/dd/yyyy</value>
</setting>
<CymaticLabs.InfluxDB.Studio.Properties.Settings>
<setting name="ConnectionsJson" serializeAs="String">
<value />
</setting>
<setting name="AllowUntrustedSsl" serializeAs="String">
<value>False</value>
</setting>
<setting name="TimeFormat" serializeAs="String">
<value>hh:mm:ss tt</value>
</setting>
<setting name="DateFormat" serializeAs="String">
<value>M/dd/yyyy</value>
</setting>
<setting name="CsvDelimiter" serializeAs="String">
<value>,</value>
</setting>
</CymaticLabs.InfluxDB.Studio.Properties.Settings>
</userSettings>
<log4net>
Expand Down
24 changes: 24 additions & 0 deletions src/CymaticLabs.InfluxDB.Studio/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public class AppSettings
// Internal app date format setting
string dateFormat;

// Internal CSV delimiter
string csvDelimiter;

#endregion Fields

#region Properties
Expand Down Expand Up @@ -87,6 +90,24 @@ public string DateFormat
}
}

/// <summary>
/// Gets the current Csv Delimiter setting.
/// </summary>
public string CsvDelimiter
{
get { return csvDelimiter; }

set
{
if (csvDelimiter != value)
{
csvDelimiter = value;
Properties.Settings.Default.CsvDelimiter = csvDelimiter;
Properties.Settings.Default.Save(); // update settings file
}
}
}

/// <summary>
/// Gets or sets whether or not the application should allow untrusted SSL certificates
/// when communicating to InfluxDB servers.
Expand Down Expand Up @@ -121,6 +142,7 @@ public AppSettings()
timeFormat = TimeFormat12Hour;
dateFormat = DateFormatMonth;
allowUntrustedSsl = false;
csvDelimiter = ",";
Connections = new List<InfluxDbConnection>();

// Set the version string
Expand All @@ -142,6 +164,7 @@ public void LoadAll()
timeFormat = Properties.Settings.Default.TimeFormat;
dateFormat = Properties.Settings.Default.DateFormat;
allowUntrustedSsl = Properties.Settings.Default.AllowUntrustedSsl;
csvDelimiter = Properties.Settings.Default.CsvDelimiter;
LoadConnections();
}

Expand All @@ -153,6 +176,7 @@ public void SaveAll()
Properties.Settings.Default.TimeFormat = TimeFormat;
Properties.Settings.Default.DateFormat = DateFormat;
Properties.Settings.Default.AllowUntrustedSsl = AllowUntrustedSsl;
Properties.Settings.Default.CsvDelimiter = csvDelimiter;
SaveConnections();
}

Expand Down
13 changes: 8 additions & 5 deletions src/CymaticLabs.InfluxDB.Studio/Controls/MeasurementControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using CymaticLabs.InfluxDB.Studio.Dialogs;
using Newtonsoft.Json;

namespace CymaticLabs.InfluxDB.Studio.Controls
Expand Down Expand Up @@ -73,6 +74,8 @@ protected void exportSelectedJsonMenuItem_Click(object sender, EventArgs e)
// Exports series data to CSV
protected virtual async Task ExportToCsv(bool onlySelected = false)
{
SelectCsvDelimiter.SelectCsv(this.ParentForm);

// Configure save dialog and open
saveFileDialog.FileName = string.Format("{0}_{1}.csv", Measurement, ExportFileNameStem);
saveFileDialog.Filter = "CSV files|*.csv|All files|*.*";
Expand All @@ -90,7 +93,7 @@ protected virtual async Task ExportToCsv(bool onlySelected = false)
for (var i = 1; i < listView.Columns.Count; i++)
{
sb.Append(listView.Columns[i].Text);
if (i < listView.Columns.Count - 1) sb.Append(",");
if (i < listView.Columns.Count - 1) sb.Append(AppForm.Settings.CsvDelimiter);
}

await sw.WriteLineAsync(sb.ToString());
Expand All @@ -107,7 +110,7 @@ protected virtual async Task ExportToCsv(bool onlySelected = false)
{
var sli = li.SubItems[i];
sb.Append(sli.Text);
if (i < li.SubItems.Count - 1) sb.Append(",");
if (i < li.SubItems.Count - 1) sb.Append(AppForm.Settings.CsvDelimiter);
}

await sw.WriteLineAsync(sb.ToString());
Expand Down Expand Up @@ -186,9 +189,9 @@ public async override Task ExecuteRequestAsync()
/// <summary>
/// When overriden in derived classes, executes the custom query and databinding operations for the query.
/// </summary>
protected async virtual Task OnExecuteQuery()
{
}
#pragma warning disable 1998
protected async virtual Task OnExecuteQuery() { }
#pragma warning restore 1998

#endregion Methods
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.IO;
using Newtonsoft.Json;
using CymaticLabs.InfluxDB.Data;
using CymaticLabs.InfluxDB.Studio.Dialogs;

namespace CymaticLabs.InfluxDB.Studio.Controls
{
Expand Down Expand Up @@ -183,6 +184,8 @@ async Task ExportToCsv(bool onlySelected = false)
{
try
{
SelectCsvDelimiter.SelectCsv(this.ParentForm);

// Configure save dialog and open
saveFileDialog.FileName = string.Format("{0}.csv", InfluxDbClient.Connection.Name + "_" + Database);
saveFileDialog.Filter = "CSV files|*.csv|All files|*.*";
Expand All @@ -200,7 +203,7 @@ async Task ExportToCsv(bool onlySelected = false)
for (var i = 1; i < listView.Columns.Count; i++)
{
sb.Append(listView.Columns[i].Text);
if (i < listView.Columns.Count - 1) sb.Append(",");
if (i < listView.Columns.Count - 1) sb.Append(AppForm.Settings.CsvDelimiter);
}

await sw.WriteLineAsync(sb.ToString());
Expand All @@ -217,7 +220,7 @@ async Task ExportToCsv(bool onlySelected = false)
{
var sli = li.SubItems[i];
sb.Append(sli.Text);
if (i < li.SubItems.Count - 1) sb.Append(",");
if (i < li.SubItems.Count - 1) sb.Append(AppForm.Settings.CsvDelimiter);
}

await sw.WriteLineAsync(sb.ToString());
Expand Down
2 changes: 2 additions & 0 deletions src/CymaticLabs.InfluxDB.Studio/Controls/RequestControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public RequestControl()
/// <summary>
/// When overriden in derived classes, executes an InfluxDB API request and processes the result.
/// </summary>
#pragma warning disable 1998
public virtual async Task ExecuteRequestAsync() { }
#pragma warning restore 1998

#endregion Methods
}
Expand Down
Loading