├── src └── CymaticLabs.InfluxDB.Studio │ ├── Resources │ ├── CQ_Interval_Info.txt │ ├── BF_Interval_Info.txt │ ├── CQ_FillType_Info.txt │ ├── RP_Duration_Info.txt │ ├── BF_Filters_Info.txt │ ├── AppIcon.ico │ ├── influxdb-logo.png │ ├── CQ_Resample_Info.txt │ ├── ImagesFinal │ │ ├── Date.png │ │ ├── Info.png │ │ ├── Stats.png │ │ ├── Time.png │ │ ├── Users.png │ │ ├── Refresh.png │ │ ├── Series.png │ │ ├── TagKeys.png │ │ ├── BackFill.png │ │ ├── Connection.png │ │ ├── CreateUser.png │ │ ├── Database.png │ │ ├── Disconnect.png │ │ ├── DropSeries.png │ │ ├── DropUser.png │ │ ├── EditUser.png │ │ ├── FieldKeys.png │ │ ├── KillQuery.png │ │ ├── NewQuery.png │ │ ├── Password.png │ │ ├── RunQuery.png │ │ ├── ShowSeries.png │ │ ├── TagValues.png │ │ ├── Diagnostics.png │ │ ├── DropDatabase.png │ │ ├── Measurement.png │ │ ├── ShowQueries.png │ │ ├── ContinuousQuery.png │ │ ├── CreateDatabase.png │ │ ├── DropMeasurement.png │ │ ├── EditConnection.png │ │ ├── EditPrivilege.png │ │ ├── GrantPrivilege.png │ │ ├── RetentionPolicy.png │ │ ├── CreateConnection.png │ │ ├── DropContinuousQuery.png │ │ ├── DropRetentionPolicy.png │ │ ├── EditRetentionPolicy.png │ │ ├── CreateContinuousQuery.png │ │ └── CreateRetentionPolicy.png │ ├── CQ_ResampleFor_Info.txt │ ├── CQ_ResampleEvery_Info.txt │ ├── BF_Source_Info.txt │ ├── CQ_Source_Info.txt │ ├── BF_Destination_Info.txt │ ├── CQ_Destination_Info.txt │ ├── CQ_Tags_Info.txt │ └── CQ_Subquery_Info.txt │ ├── Program.cs │ ├── Data │ ├── InfluxDbFillTypes.cs │ ├── InfluxDbTimePrecisions.cs │ ├── InfluxDbPrivileges.cs │ ├── InfluxDbUser.cs │ ├── InfluxDbTagValue.cs │ ├── InfluxDbGrant.cs │ ├── InfluxDbFieldKey.cs │ ├── InfluxDbTimeUnits.cs │ ├── InfluxDbContinuousQuery.cs │ ├── InfluxDbRetentionPolicy.cs │ ├── InfluxDbApiResponse.cs │ ├── InfluxDbClientFactory.cs │ ├── InfluxDbPingResponse.cs │ ├── InfluxDbPoint.cs │ ├── InfluxDbRunningQuery.cs │ ├── SslIgnoreValidator.cs │ ├── InfluxDbBackfillParams.cs │ ├── InfluxDbCqParams.cs │ ├── InfluxDbSeries.cs │ ├── InfluxDbStats.cs │ ├── InfluxDbConnection.cs │ ├── InfluxDbDiagnostics.cs │ └── InfluxDbHelper.cs │ ├── Properties │ ├── Settings.settings │ ├── AssemblyInfo.cs │ └── Settings.Designer.cs │ ├── packages.config │ ├── Dialogs │ ├── UserPasswordDialog.cs │ ├── CreateDatabaseDialog.cs │ ├── EditUserDialog.cs │ ├── AboutDialog.cs │ ├── CreateUserDialog.cs │ ├── EditPrivilegeDialog.cs │ ├── GrantPrivilegeDialog.cs │ ├── CreateDatabaseDialog.Designer.cs │ ├── RetentionPolicyDialog.cs │ ├── UserPasswordDialog.Designer.cs │ └── EditUserDialog.Designer.cs │ ├── Controls │ ├── RequestControl.Designer.cs │ ├── TagKeysControl.Designer.cs │ ├── FieldKeysControl.Designer.cs │ ├── ExtendedTabControl.Designer.cs │ ├── ExtendedTabPage.cs │ ├── SeriesControl.Designer.cs │ ├── RequestControl.cs │ ├── TagKeysControl.cs │ ├── FieldKeysControl.cs │ ├── DiagnosticsControl.cs │ ├── TagValuesControl.cs │ ├── SeriesControl.cs │ ├── TagValuesControl.Designer.cs │ ├── StatsControl.Designer.cs │ ├── QueryControl.cs │ ├── StatsControl.cs │ ├── QueryControl.Designer.cs │ ├── RunningQueriesControl.cs │ ├── QueryControl.resx │ ├── DiagnosticsControl.resx │ ├── ExtendedTabControl.resx │ ├── StatsControl.resx │ ├── SeriesControl.resx │ ├── TagValuesControl.resx │ └── ContinuousQueryControl.resx │ └── App.config ├── docs └── img │ ├── Databases_CQ_1.png │ ├── Databases_CQ_2.png │ ├── Databases_CQ_3.png │ ├── Databases_CQ_4.png │ ├── Databases_Drop_1.png │ ├── Databases_Drop_2.png │ ├── AppForm_InitialView.png │ ├── ConnectionsDialog_1.png │ ├── Connections_DropUser.png │ ├── Connections_EditUser.png │ ├── Databases_Backfill_1.png │ ├── Databases_Backfill_2.png │ ├── Databases_DropCQ_1.png │ ├── Databases_RunQuery_1.png │ ├── Databases_RunQuery_2.png │ ├── Databases_RunQuery_3.png │ ├── Connections_ShowUsers.png │ ├── Connections_ContextMenu.png │ ├── Connections_CreateUser_1.png │ ├── Connections_CreateUser_2.png │ ├── Connections_Diagnostics_1.png │ ├── Connections_Diagnostics_2.png │ ├── Measurements_DropSeries.png │ ├── Measurements_RunQuery_1.png │ ├── Measurements_ShowSeries.png │ ├── Measurements_ShowTagKeys.png │ ├── Measurements_ExportQuery_1.png │ ├── Measurements_ShowFieldKeys.png │ ├── Measurements_ShowTagValues.png │ ├── Connections_ChangeUserPassword.png │ ├── Connections_CreateDatabase_1.png │ ├── Connections_CreateDatabase_2.png │ ├── Connections_EditUserPrivilege.png │ ├── Databases_ExportQueryResults.png │ ├── ManageConnectionsDialog_Blank.png │ ├── Measurements_DropMeasurement.png │ ├── Connections_GrantUserPrivilege_1.png │ ├── Connections_GrantUserPrivilege_2.png │ └── ManageConnectionsDialog_WithLocalhost.png ├── .gitignore ├── CymaticLabs.InfluxDB.sln └── LICENSE /src/CymaticLabs.InfluxDB.Studio/Resources/CQ_Interval_Info.txt: -------------------------------------------------------------------------------- 1 | The CQ's interval: 1h, 30m, 45s, etc. -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/BF_Interval_Info.txt: -------------------------------------------------------------------------------- 1 | The Back Fill's interval: 1h, 30m, 45s, etc. -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/CQ_FillType_Info.txt: -------------------------------------------------------------------------------- 1 | how empty values will be treated using: fill() -------------------------------------------------------------------------------- /docs/img/Databases_CQ_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Databases_CQ_1.png -------------------------------------------------------------------------------- /docs/img/Databases_CQ_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Databases_CQ_2.png -------------------------------------------------------------------------------- /docs/img/Databases_CQ_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Databases_CQ_3.png -------------------------------------------------------------------------------- /docs/img/Databases_CQ_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Databases_CQ_4.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/RP_Duration_Info.txt: -------------------------------------------------------------------------------- 1 | The duration of the retention policy: 1h, 30m, 45s, etc. -------------------------------------------------------------------------------- /docs/img/Databases_Drop_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Databases_Drop_1.png -------------------------------------------------------------------------------- /docs/img/Databases_Drop_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Databases_Drop_2.png -------------------------------------------------------------------------------- /docs/img/AppForm_InitialView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/AppForm_InitialView.png -------------------------------------------------------------------------------- /docs/img/ConnectionsDialog_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/ConnectionsDialog_1.png -------------------------------------------------------------------------------- /docs/img/Connections_DropUser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Connections_DropUser.png -------------------------------------------------------------------------------- /docs/img/Connections_EditUser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Connections_EditUser.png -------------------------------------------------------------------------------- /docs/img/Databases_Backfill_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Databases_Backfill_1.png -------------------------------------------------------------------------------- /docs/img/Databases_Backfill_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Databases_Backfill_2.png -------------------------------------------------------------------------------- /docs/img/Databases_DropCQ_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Databases_DropCQ_1.png -------------------------------------------------------------------------------- /docs/img/Databases_RunQuery_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Databases_RunQuery_1.png -------------------------------------------------------------------------------- /docs/img/Databases_RunQuery_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Databases_RunQuery_2.png -------------------------------------------------------------------------------- /docs/img/Databases_RunQuery_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Databases_RunQuery_3.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/BF_Filters_Info.txt: -------------------------------------------------------------------------------- 1 | A comma-separated list of "WHERE" filters to apply to the query. -------------------------------------------------------------------------------- /docs/img/Connections_ShowUsers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Connections_ShowUsers.png -------------------------------------------------------------------------------- /docs/img/Connections_ContextMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Connections_ContextMenu.png -------------------------------------------------------------------------------- /docs/img/Connections_CreateUser_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Connections_CreateUser_1.png -------------------------------------------------------------------------------- /docs/img/Connections_CreateUser_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Connections_CreateUser_2.png -------------------------------------------------------------------------------- /docs/img/Connections_Diagnostics_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Connections_Diagnostics_1.png -------------------------------------------------------------------------------- /docs/img/Connections_Diagnostics_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Connections_Diagnostics_2.png -------------------------------------------------------------------------------- /docs/img/Measurements_DropSeries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Measurements_DropSeries.png -------------------------------------------------------------------------------- /docs/img/Measurements_RunQuery_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Measurements_RunQuery_1.png -------------------------------------------------------------------------------- /docs/img/Measurements_ShowSeries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Measurements_ShowSeries.png -------------------------------------------------------------------------------- /docs/img/Measurements_ShowTagKeys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Measurements_ShowTagKeys.png -------------------------------------------------------------------------------- /docs/img/Measurements_ExportQuery_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Measurements_ExportQuery_1.png -------------------------------------------------------------------------------- /docs/img/Measurements_ShowFieldKeys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Measurements_ShowFieldKeys.png -------------------------------------------------------------------------------- /docs/img/Measurements_ShowTagValues.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Measurements_ShowTagValues.png -------------------------------------------------------------------------------- /docs/img/Connections_ChangeUserPassword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Connections_ChangeUserPassword.png -------------------------------------------------------------------------------- /docs/img/Connections_CreateDatabase_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Connections_CreateDatabase_1.png -------------------------------------------------------------------------------- /docs/img/Connections_CreateDatabase_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Connections_CreateDatabase_2.png -------------------------------------------------------------------------------- /docs/img/Connections_EditUserPrivilege.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Connections_EditUserPrivilege.png -------------------------------------------------------------------------------- /docs/img/Databases_ExportQueryResults.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Databases_ExportQueryResults.png -------------------------------------------------------------------------------- /docs/img/ManageConnectionsDialog_Blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/ManageConnectionsDialog_Blank.png -------------------------------------------------------------------------------- /docs/img/Measurements_DropMeasurement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Measurements_DropMeasurement.png -------------------------------------------------------------------------------- /docs/img/Connections_GrantUserPrivilege_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Connections_GrantUserPrivilege_1.png -------------------------------------------------------------------------------- /docs/img/Connections_GrantUserPrivilege_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/Connections_GrantUserPrivilege_2.png -------------------------------------------------------------------------------- /docs/img/ManageConnectionsDialog_WithLocalhost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/docs/img/ManageConnectionsDialog_WithLocalhost.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/AppIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/AppIcon.ico -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/influxdb-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/influxdb-logo.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/CQ_Resample_Info.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/CQ_Resample_Info.txt -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Date.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Date.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Info.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Stats.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Stats.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Time.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Users.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/CQ_ResampleFor_Info.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/CQ_ResampleFor_Info.txt -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Refresh.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Series.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Series.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/TagKeys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/TagKeys.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/CQ_ResampleEvery_Info.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/CQ_ResampleEvery_Info.txt -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/BackFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/BackFill.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Connection.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/CreateUser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/CreateUser.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Database.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Disconnect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Disconnect.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/DropSeries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/DropSeries.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/DropUser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/DropUser.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/EditUser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/EditUser.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/FieldKeys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/FieldKeys.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/KillQuery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/KillQuery.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/NewQuery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/NewQuery.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Password.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/RunQuery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/RunQuery.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/ShowSeries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/ShowSeries.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/TagValues.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/TagValues.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/BF_Source_Info.txt: -------------------------------------------------------------------------------- 1 | This is the source measurement for data selected by the Back Fill. 2 | Select or type in the name of the existing measurement for the query. -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Diagnostics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Diagnostics.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/DropDatabase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/DropDatabase.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Measurement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/Measurement.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/ShowQueries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/ShowQueries.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/CQ_Source_Info.txt: -------------------------------------------------------------------------------- 1 | This is the source measurement for data selected by the Continuous Query. 2 | Select or type in the name of the existing measurement for the query. -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/ContinuousQuery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/ContinuousQuery.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/CreateDatabase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/CreateDatabase.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/DropMeasurement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/DropMeasurement.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/EditConnection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/EditConnection.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/EditPrivilege.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/EditPrivilege.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/GrantPrivilege.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/GrantPrivilege.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/RetentionPolicy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/RetentionPolicy.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/BF_Destination_Info.txt: -------------------------------------------------------------------------------- 1 | The destination measurement will store the results of the Back Fill. 2 | Select an existing measurement or type in the name of a new destination. -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/CreateConnection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/CreateConnection.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/CQ_Destination_Info.txt: -------------------------------------------------------------------------------- 1 | The destination measurement will store the results of the Continuous Query. 2 | Select an existing measurement or type in the name of a new destination. -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/DropContinuousQuery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/DropContinuousQuery.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/DropRetentionPolicy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/DropRetentionPolicy.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/EditRetentionPolicy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/EditRetentionPolicy.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/CreateContinuousQuery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/CreateContinuousQuery.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/CreateRetentionPolicy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CymaticLabs/InfluxDBStudio/HEAD/src/CymaticLabs.InfluxDB.Studio/Resources/ImagesFinal/CreateRetentionPolicy.png -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/CQ_Tags_Info.txt: -------------------------------------------------------------------------------- 1 | By default, all INTO queries convert any tags in the source measurement to fields in the destination measurement. 2 | Type a comma-separated list of tag names to preserve in the destination measurement: tag1, tag2, tag3, etc. -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Resources/CQ_Subquery_Info.txt: -------------------------------------------------------------------------------- 1 | CQ's need at least one subquery/downsampler to be created. 2 | To add additional subqueries/downsamplers that will run as part of the CQ, 3 | click the "Add Subquery" button. Click the "X" button on the subquery tabs 4 | to remove unwanted subqueries. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.bak 3 | *.old 4 | *.disabled 5 | *.zip 6 | unity/* 7 | packages/* 8 | # allow packages/repositories.config only 9 | !packages/repositories.config 10 | [Dd]ebug/ 11 | [Rr]elease/ 12 | [Bb]in/ 13 | [Oo]bj/ 14 | *.suo 15 | *.user 16 | .vs/config/applicationhost.config 17 | src/*.Testing/*.xml 18 | ImagesRaw/ -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace CymaticLabs.InfluxDB.Studio 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new AppForm()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbFillTypes.cs: -------------------------------------------------------------------------------- 1 | namespace CymaticLabs.InfluxDB.Data 2 | { 3 | /// 4 | /// Different InfluxDB fill types. 5 | /// 6 | public enum InfluxDbFillTypes 7 | { 8 | /// 9 | /// Exhibits the same behavior as the default (sets NULL as the value for intervals with no data). 10 | /// 11 | Null, 12 | 13 | /// 14 | /// Reports the value of the previous "time window". 15 | /// 16 | Previous, 17 | 18 | /// 19 | /// Suppresses timestamps and values where the value is null (won't add downsampled points for intervals with no data). 20 | /// 21 | None 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbTimePrecisions.cs: -------------------------------------------------------------------------------- 1 | namespace CymaticLabs.InfluxDB.Data 2 | { 3 | /// 4 | /// Different InfluxDB supported time precisions. 5 | /// 6 | public enum InfluxDbTimePrecisions 7 | { 8 | /// 9 | /// Unsupported or unspecified time precision. 10 | /// 11 | None, 12 | 13 | /// 14 | /// Microsecond precision (us/μs). 15 | /// 16 | Microseconds, 17 | 18 | /// 19 | /// Millisecond precision: (ms); InfluxDB default. 20 | /// 21 | Milliseconds, 22 | 23 | /// 24 | /// Seconds: (s). 25 | /// 26 | Seconds, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbPrivileges.cs: -------------------------------------------------------------------------------- 1 | namespace CymaticLabs.InfluxDB.Data 2 | { 3 | /// 4 | /// Different user database permissions. 5 | /// 6 | public enum InfluxDbPrivileges 7 | { 8 | /// 9 | /// No privileges specified; uninitialized privilege. 10 | /// 11 | None = 0, 12 | 13 | /// 14 | /// User can only read from the database. 15 | /// 16 | Read = 1, 17 | 18 | /// 19 | /// User can only write to the database. 20 | /// 21 | Write = 2, 22 | 23 | /// 24 | /// User can read and write to and from the database. 25 | /// 26 | All = 4, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | False 10 | 11 | 12 | hh:mm:ss tt 13 | 14 | 15 | M/dd/yyyy 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CymaticLabs.InfluxDB.Data 4 | { 5 | /// 6 | /// A InfluxDB database user. 7 | /// 8 | public class InfluxDbUser 9 | { 10 | #region Fields 11 | 12 | /// 13 | /// The user's name. 14 | /// 15 | public readonly string Name; 16 | 17 | /// 18 | /// Whether or not the user is a database administrator. 19 | /// 20 | public readonly bool IsAdmin; 21 | 22 | #endregion Fields 23 | 24 | #region Constructors 25 | 26 | public InfluxDbUser(string name, bool isAdmin) 27 | { 28 | if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullException("name"); 29 | Name = name; 30 | IsAdmin = isAdmin; 31 | } 32 | 33 | #endregion Constructors 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbTagValue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CymaticLabs.InfluxDB.Data 4 | { 5 | /// 6 | /// Represents a tag value from a database measurement. 7 | /// 8 | public class InfluxDbTagValue 9 | { 10 | #region Fields 11 | 12 | /// 13 | /// The name of the tag that the value belongs to. 14 | /// 15 | public readonly string Name; 16 | 17 | /// 18 | /// The value for the tag. 19 | /// 20 | public readonly string Value; 21 | 22 | #endregion Fields 23 | 24 | #region Constructors 25 | 26 | public InfluxDbTagValue(string name, string value) 27 | { 28 | if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullException("name"); 29 | Name = name; 30 | Value = value; 31 | } 32 | 33 | #endregion Constructors 34 | 35 | #region Methods 36 | 37 | #endregion Methods 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbGrant.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CymaticLabs.InfluxDB.Data 4 | { 5 | /// 6 | /// InfluxDB server granted database privileges. 7 | /// 8 | public class InfluxDbGrant 9 | { 10 | #region Fields 11 | 12 | /// 13 | /// The database name the granted privilege is for. 14 | /// 15 | public readonly string Database; 16 | 17 | /// 18 | /// The granted database privilege. 19 | /// 20 | public readonly InfluxDbPrivileges Privilege; 21 | 22 | #endregion Fields 23 | 24 | #region Constructors 25 | 26 | public InfluxDbGrant(string database, InfluxDbPrivileges privilege = InfluxDbPrivileges.None) 27 | { 28 | if (string.IsNullOrWhiteSpace(database)) throw new ArgumentNullException("database"); 29 | Database = database; 30 | Privilege = privilege; 31 | } 32 | 33 | #endregion Constructors 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /CymaticLabs.InfluxDB.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CymaticLabs.InfluxDB.Studio", "src\CymaticLabs.InfluxDB.Studio\CymaticLabs.InfluxDB.Studio.csproj", "{0578E050-27C9-4345-A6C9-EBAA887611D2}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {0578E050-27C9-4345-A6C9-EBAA887611D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {0578E050-27C9-4345-A6C9-EBAA887611D2}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {0578E050-27C9-4345-A6C9-EBAA887611D2}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {0578E050-27C9-4345-A6C9-EBAA887611D2}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbFieldKey.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CymaticLabs.InfluxDB.Data 4 | { 5 | /// 6 | /// Represents a field key from a database measurement. 7 | /// 8 | public class InfluxDbFieldKey 9 | { 10 | #region Fields 11 | 12 | /// 13 | /// The name/key of the field. 14 | /// 15 | public readonly string Name; 16 | 17 | /// 18 | /// The field's type. 19 | /// 20 | public readonly string Type; 21 | 22 | #endregion Fields 23 | 24 | #region Constructors 25 | 26 | public InfluxDbFieldKey(string name, string type) 27 | { 28 | if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullException("name"); 29 | if (string.IsNullOrWhiteSpace(type)) throw new ArgumentNullException("type"); 30 | Name = name; 31 | Type = type; 32 | } 33 | 34 | #endregion Constructors 35 | 36 | #region Methods 37 | 38 | #endregion Methods 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 CymaticLabs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbTimeUnits.cs: -------------------------------------------------------------------------------- 1 | namespace CymaticLabs.InfluxDB.Data 2 | { 3 | /// 4 | /// Different time interval units supported by InfluxDb: u, ms, s, m, h, d, w. 5 | /// 6 | public enum InfluxDbTimeUnits 7 | { 8 | /// 9 | /// No interval specified or an unknown/unsupported interval. 10 | /// 11 | None, 12 | 13 | /// 14 | /// Microsecond: u 15 | /// 16 | Microseconds, 17 | 18 | /// 19 | /// Millisecond: ms 20 | /// 21 | Milliseconds, 22 | 23 | /// 24 | /// Seconds: s 25 | /// 26 | Seconds, 27 | 28 | /// 29 | /// Minutes: m 30 | /// 31 | Minutes, 32 | 33 | /// 34 | /// Hours: h 35 | /// 36 | Hours, 37 | 38 | /// 39 | /// Days: d 40 | /// 41 | Days, 42 | 43 | /// 44 | /// Weeks: w 45 | /// 46 | Weeks, 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbContinuousQuery.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CymaticLabs.InfluxDB.Data 4 | { 5 | /// 6 | /// An InfluxDB continuous query. 7 | /// 8 | public class InfluxDbContinuousQuery 9 | { 10 | #region Fields 11 | 12 | #endregion Fields 13 | 14 | #region Properties 15 | 16 | /// 17 | /// Gets the name of the continous query. 18 | /// 19 | public string Name { get; private set; } 20 | 21 | /// 22 | /// Gets the body of the continous query. 23 | /// 24 | public string Query { get; private set; } 25 | 26 | #endregion Properties 27 | 28 | #region Constructors 29 | 30 | public InfluxDbContinuousQuery(string name, string query) 31 | { 32 | if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullException("name"); 33 | if (string.IsNullOrWhiteSpace(query)) throw new ArgumentNullException("query"); 34 | 35 | Name = name; 36 | Query = query; 37 | } 38 | 39 | #endregion Constructors 40 | 41 | #region Methods 42 | 43 | #endregion Methods 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbRetentionPolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CymaticLabs.InfluxDB.Data 8 | { 9 | /// 10 | /// Represents a retention policy for a given database. 11 | /// 12 | public class InfluxDbRetentionPolicy 13 | { 14 | /// 15 | /// RP name. 16 | /// 17 | public string Name { get; set; } 18 | 19 | /// 20 | /// RP database. 21 | /// 22 | public string Database { get; set; } 23 | 24 | /// 25 | /// RP duration. 26 | /// 27 | public string Duration { get; set; } 28 | 29 | /// 30 | /// RP shard group duration. 31 | /// 32 | public string ShardGroupDuration { get; set; } 33 | 34 | /// 35 | /// RP replication copies. 36 | /// 37 | public int ReplicationCopies { get; set; } 38 | 39 | /// 40 | /// RP replication copies. 41 | /// 42 | public bool Default { get; set; } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Dialogs/UserPasswordDialog.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | using CymaticLabs.InfluxDB.Data; 3 | 4 | namespace CymaticLabs.InfluxDB.Studio.Dialogs 5 | { 6 | /// 7 | /// Used to update an InfluxDB user's password. 8 | /// 9 | public partial class UserPasswordDialog : Form 10 | { 11 | #region Fields 12 | 13 | #endregion Fields 14 | 15 | #region Properties 16 | 17 | /// 18 | /// Gets the dialog's password text. 19 | /// 20 | public string Password 21 | { 22 | get { return password.Text; } 23 | } 24 | 25 | #endregion Properties 26 | 27 | #region Constructors 28 | 29 | public UserPasswordDialog() 30 | { 31 | InitializeComponent(); 32 | } 33 | 34 | #endregion Constructors 35 | 36 | #region Methods 37 | 38 | /// 39 | /// Binds the dialog to a user. 40 | /// 41 | /// The user to bind to. 42 | public void BindToUser(InfluxDbUser user) 43 | { 44 | usernameValue.Text = user.Name; 45 | password.Text = null; 46 | } 47 | 48 | #endregion Methods 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/RequestControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CymaticLabs.InfluxDB.Studio.Controls 2 | { 3 | partial class RequestControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | components = new System.ComponentModel.Container(); 32 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 33 | } 34 | 35 | #endregion 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/TagKeysControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CymaticLabs.InfluxDB.Studio.Controls 2 | { 3 | partial class TagKeysControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | components = new System.ComponentModel.Container(); 32 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 33 | } 34 | 35 | #endregion 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbApiResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | 4 | namespace CymaticLabs.InfluxDB.Data 5 | { 6 | /// 7 | /// Represents a response from an InfluxDB API request. 8 | /// 9 | public class InfluxDbApiResponse 10 | { 11 | #region Fields 12 | 13 | /// 14 | /// The body of the response. 15 | /// 16 | public readonly string Body; 17 | 18 | /// 19 | /// The HTTP status code of the API response. 20 | /// 21 | public readonly HttpStatusCode StatusCode; 22 | 23 | /// 24 | /// Whether or not the request was successful. 25 | /// 26 | public readonly bool Success; 27 | 28 | #endregion Fields 29 | 30 | #region Constructors 31 | 32 | public InfluxDbApiResponse(string body, HttpStatusCode statusCode, bool success) 33 | { 34 | if (string.IsNullOrWhiteSpace(body)) throw new ArgumentNullException("body"); 35 | Body = body; 36 | StatusCode = statusCode; 37 | Success = success; 38 | } 39 | 40 | #endregion Constructors 41 | 42 | #region Methods 43 | 44 | #endregion Methods 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/FieldKeysControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CymaticLabs.InfluxDB.Studio.Controls 2 | { 3 | partial class FieldKeysControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | components = new System.ComponentModel.Container(); 32 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 33 | } 34 | 35 | #endregion 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Dialogs/CreateDatabaseDialog.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace CymaticLabs.InfluxDB.Studio.Dialogs 4 | { 5 | /// 6 | /// Dialog window used to create a new database. 7 | /// 8 | public partial class CreateDatabaseDialog : Form 9 | { 10 | #region Fields 11 | 12 | #endregion Fields 13 | 14 | #region Properties 15 | 16 | /// 17 | /// Gets or sets the connection name displayed in the dialog. 18 | /// 19 | public string ConnectionName 20 | { 21 | get { return connectionLabel.Text; } 22 | set { connectionLabel.Text = value; } 23 | } 24 | 25 | /// 26 | /// Gets or sets the database name in the dialog's textbox. 27 | /// 28 | public string DatabaseName 29 | { 30 | get { return textBox.Text; } 31 | set { textBox.Text = value; textBox.Focus(); } 32 | } 33 | 34 | #endregion Properties 35 | 36 | #region Constructors 37 | 38 | public CreateDatabaseDialog() 39 | { 40 | InitializeComponent(); 41 | } 42 | 43 | #endregion Constructors 44 | 45 | #region Methods 46 | 47 | #endregion Methods 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbClientFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CymaticLabs.InfluxDB.Data 4 | { 5 | /// 6 | /// Factory class for creating InfluxDB clients. 7 | /// 8 | public static class InfluxDbClientFactory 9 | { 10 | #region Fields 11 | 12 | #endregion Fields 13 | 14 | #region Properties 15 | 16 | #endregion Properties 17 | 18 | #region Constructors 19 | 20 | #endregion Constructors 21 | 22 | #region Methods 23 | 24 | /// 25 | /// Creates a new InfluxDB client using the default client implementation. 26 | /// 27 | /// The connection information to use when creating the client. 28 | /// An InfluxDB client that can be used to communicate with the InfluxDB server API. 29 | public static InfluxDbClient Create(InfluxDbConnection connection) 30 | { 31 | if (connection == null) throw new ArgumentNullException("connection"); 32 | 33 | // TODO Support config/dependency injected concrete client type 34 | return new InfluxDataNetClient(connection); 35 | } 36 | 37 | #endregion Methods 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Dialogs/EditUserDialog.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | using CymaticLabs.InfluxDB.Data; 3 | 4 | namespace CymaticLabs.InfluxDB.Studio.Dialogs 5 | { 6 | /// 7 | /// Dialog used for editing/updating InfluxDB users. 8 | /// 9 | public partial class EditUserDialog : Form 10 | { 11 | #region Fields 12 | 13 | #endregion Fields 14 | 15 | #region Properties 16 | 17 | #endregion Properties 18 | 19 | #region Constructors 20 | 21 | public EditUserDialog() 22 | { 23 | InitializeComponent(); 24 | } 25 | 26 | #endregion Constructors 27 | 28 | #region Methods 29 | 30 | /// 31 | /// Binds the dialog to a user. 32 | /// 33 | /// The user to bind to. 34 | public void BindToUser(InfluxDbUser user) 35 | { 36 | usernameValue.Text = user.Name; 37 | adminCheckBox.Checked = user.IsAdmin; 38 | } 39 | 40 | /// 41 | /// Creates and returns a new InfluxDB user from the dialog values. 42 | /// 43 | public InfluxDbUser CreateUserFromDialog() 44 | { 45 | return new InfluxDbUser(usernameValue.Text, adminCheckBox.Checked); 46 | } 47 | 48 | #endregion Methods 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/ExtendedTabControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CymaticLabs.InfluxDB.Studio.Controls 2 | { 3 | partial class ExtendedTabControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.SuspendLayout(); 32 | // 33 | // ExtendedTabControl 34 | // 35 | this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ExtendedTabControl_MouseUp); 36 | this.ResumeLayout(false); 37 | 38 | } 39 | 40 | #endregion 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/ExtendedTabPage.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Windows.Forms; 3 | 4 | namespace CymaticLabs.InfluxDB.Studio.Controls 5 | { 6 | /// 7 | /// Custom tab page that allows for extra rendering and functionality. 8 | /// 9 | public class ExtendedTabPage : TabPage 10 | { 11 | #region Fields 12 | 13 | #endregion Fields 14 | 15 | #region Properties 16 | 17 | /// 18 | /// Gets or sets the optional tab image to render. 19 | /// 20 | public Image TabImage { get; set; } 21 | 22 | /// 23 | /// Gets the current contained within the tab, if any. 24 | /// 25 | public RequestControl RequestControl 26 | { 27 | get { return Controls.Count > 0 ? Controls[0] as RequestControl : null; } 28 | } 29 | 30 | #endregion Properties 31 | 32 | #region Constructors 33 | 34 | public ExtendedTabPage() 35 | : this(null, null) 36 | { } 37 | 38 | public ExtendedTabPage(string tabText) 39 | : this(tabText, null) 40 | { } 41 | 42 | public ExtendedTabPage(string tabText, Image tabImage) 43 | : base(tabText) 44 | { 45 | TabImage = tabImage; 46 | } 47 | 48 | #endregion Constructors 49 | 50 | #region Methods 51 | 52 | #endregion Methods 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbPingResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CymaticLabs.InfluxDB.Data 4 | { 5 | /// 6 | /// Represents the reply from a ping message sent to an InfluxDB server. 7 | /// 8 | public class InfluxDbPingResponse 9 | { 10 | #region Fields 11 | 12 | #endregion Fields 13 | 14 | #region Properties 15 | 16 | /// 17 | /// Gets whether or not the ping request was successfully received. 18 | /// 19 | public bool Success { get; private set; } 20 | 21 | /// 22 | /// Gets the amount of time it took for the server to respond to the ping request. 23 | /// 24 | public TimeSpan ResponseTime { get; private set; } 25 | 26 | /// 27 | /// Gets the InfluxDB version that the server responded with. 28 | /// 29 | public string Version { get; private set; } 30 | 31 | #endregion Properties 32 | 33 | #region Constructors 34 | 35 | public InfluxDbPingResponse(bool success, TimeSpan responseTime, string version) 36 | { 37 | if (string.IsNullOrWhiteSpace(version)) throw new ArgumentNullException("version"); 38 | Success = success; 39 | ResponseTime = responseTime; 40 | Version = version; 41 | } 42 | 43 | #endregion Constructors 44 | 45 | #region Methods 46 | 47 | #endregion Methods 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Dialogs/AboutDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace CymaticLabs.InfluxDB.Studio.Dialogs 5 | { 6 | /// 7 | /// Application about dialog. 8 | /// 9 | public partial class AboutDialog : Form 10 | { 11 | #region Fields 12 | 13 | #endregion Fields 14 | 15 | #region Properties 16 | 17 | #endregion Properties 18 | 19 | #region Constructors 20 | 21 | public AboutDialog() 22 | { 23 | InitializeComponent(); 24 | } 25 | 26 | #endregion Constructors 27 | 28 | #region Event Handlers 29 | 30 | // Form Load 31 | private void AboutDialog_Load(object sender, EventArgs e) 32 | { 33 | // Apply the current version number 34 | versionLabel.Text = AppForm.Settings.Version; 35 | } 36 | 37 | // Launch project link 38 | private void projectLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 39 | { 40 | System.Diagnostics.Process.Start("https://github.com/CymaticLabs/InfluxDBStudio"); 41 | } 42 | 43 | // Launch InfluxData.Net link 44 | private void influxDataNetLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 45 | { 46 | System.Diagnostics.Process.Start("https://github.com/pootzko/InfluxData.Net"); 47 | } 48 | 49 | #endregion Event Handlers 50 | 51 | #region Methods 52 | 53 | #endregion Methods 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/SeriesControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CymaticLabs.InfluxDB.Studio.Controls 2 | { 3 | partial class SeriesControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.SuspendLayout(); 32 | // 33 | // SeriesControl 34 | // 35 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 36 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 37 | this.Name = "SeriesControl"; 38 | this.Controls.SetChildIndex(this.listView, 0); 39 | this.ResumeLayout(false); 40 | 41 | } 42 | 43 | #endregion 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/RequestControl.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using System.Windows.Forms; 3 | using CymaticLabs.InfluxDB.Data; 4 | 5 | namespace CymaticLabs.InfluxDB.Studio.Controls 6 | { 7 | /// 8 | /// Base class for controls that contain and carry out an InfluxDB API request. 9 | /// 10 | public partial class RequestControl : UserControl 11 | { 12 | #region Fields 13 | 14 | /// 15 | /// Text check mark used in UI. 16 | /// 17 | public const string CheckMark = "✓"; 18 | 19 | #endregion Fields 20 | 21 | #region Properties 22 | 23 | /// 24 | /// Gets or sets the InfluxDB connection associated 25 | /// with the request. 26 | /// 27 | public InfluxDbClient InfluxDbClient { get; set; } 28 | 29 | /// 30 | /// Gets or sets the name of the database associated with the request. 31 | /// 32 | public string Database { get; set; } 33 | 34 | #endregion Properties 35 | 36 | #region Constructors 37 | 38 | public RequestControl() 39 | { 40 | InitializeComponent(); 41 | } 42 | 43 | #endregion Constructors 44 | 45 | #region Methods 46 | 47 | /// 48 | /// When overriden in derived classes, executes an InfluxDB API request and processes the result. 49 | /// 50 | public virtual async Task ExecuteRequestAsync() { } 51 | 52 | #endregion Methods 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbPoint.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace CymaticLabs.InfluxDB.Data 5 | { 6 | /// 7 | /// Represents a point in an InfluxDB database/measurement/series. 8 | /// 9 | public class InfluxDbPoint 10 | { 11 | #region Fields 12 | 13 | /// 14 | /// Gets the name of the measurement to use. 15 | /// 16 | public readonly string Measurement; 17 | 18 | /// 19 | /// Gets the points list of tag values. 20 | /// 21 | public readonly IDictionary Tags; 22 | 23 | /// 24 | /// Gets the points list of field values. 25 | /// 26 | public readonly IDictionary Fields; 27 | 28 | /// 29 | /// Gets the point's time stamp. 30 | /// 31 | public readonly DateTime TimeStamp; 32 | 33 | #endregion Fields 34 | 35 | #region Constructors 36 | 37 | public InfluxDbPoint(string measurement, 38 | IDictionary tags, IDictionary fields, DateTime? timeStamp = null) 39 | { 40 | if (string.IsNullOrWhiteSpace(measurement)) throw new ArgumentNullException("measurement"); 41 | Measurement = measurement; 42 | Tags = tags; 43 | Fields = fields; 44 | if (timeStamp == null) timeStamp = DateTime.UtcNow; 45 | TimeStamp = (DateTime)timeStamp; 46 | } 47 | 48 | #endregion Constructors 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbRunningQuery.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CymaticLabs.InfluxDB.Data 8 | { 9 | /// 10 | /// Stores information about a presently running query on the InfluxDB server. 11 | /// 12 | public class InfluxDbRunningQuery 13 | { 14 | #region Fields 15 | 16 | #endregion Fields 17 | 18 | #region Properties 19 | 20 | /// 21 | /// The query's process ID. 22 | /// 23 | public int PID { get; private set; } 24 | 25 | /// 26 | /// The database the query is running against. 27 | /// 28 | public string Database { get; private set; } 29 | 30 | /// 31 | /// How long the query has been running on the server. 32 | /// 33 | public string Duration { get; private set; } 34 | 35 | /// 36 | /// The body of the query that is running. 37 | /// 38 | public string Query { get; private set; } 39 | 40 | #endregion Properties 41 | 42 | #region Constructors 43 | 44 | public InfluxDbRunningQuery(int pid, string database, string durartion, string query) 45 | { 46 | PID = pid; 47 | Database = database; 48 | Duration = durartion; 49 | Query = query; 50 | } 51 | 52 | #endregion Constructors 53 | 54 | #region Methods 55 | 56 | #endregion Methods 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/TagKeysControl.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Threading.Tasks; 3 | using System.Windows.Forms; 4 | 5 | namespace CymaticLabs.InfluxDB.Studio.Controls 6 | { 7 | /// 8 | /// Renders the tag keys for a given measurement. 9 | /// 10 | public partial class TagKeysControl : MeasurementControl 11 | { 12 | #region Fields 13 | 14 | #endregion Fields 15 | 16 | #region Properties 17 | 18 | public override string ExportFileNameStem { get { return "tag_keys"; } } 19 | 20 | #endregion Properties 21 | 22 | #region Constructors 23 | 24 | public TagKeysControl() 25 | { 26 | InitializeComponent(); 27 | } 28 | 29 | #endregion Constructors 30 | 31 | #region Methods 32 | 33 | protected async override Task OnExecuteQuery() 34 | { 35 | // Get tag keys from the server 36 | var tagKeys = await InfluxDbClient.GetTagKeysAsync(Database, Measurement); 37 | if (tagKeys == null || tagKeys.Count() == 0) return; 38 | 39 | // Add default row count column 40 | listView.Columns.Add(new ColumnHeader() { Text = "#" }); 41 | 42 | // Add tag key column 43 | listView.Columns.Add(new ColumnHeader() { Text = "tagKey" }); 44 | 45 | // Add values 46 | var rowCount = 0; 47 | 48 | foreach (var tagKey in tagKeys) 49 | { 50 | listView.Items.Add(new ListViewItem(new string[] { (++rowCount).ToString(), tagKey }) { Tag = tagKey }); 51 | } 52 | } 53 | 54 | #endregion Methods 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CymaticLabs.InfluxDB.Studio")] 9 | [assembly: AssemblyDescription("Visual IDE for managing InfluxDB")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CymaticLabs.InfluxDB.Studio")] 13 | [assembly: AssemblyCopyright("Copyright © Michael Everett/Cymatic Labs 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0578e050-27c9-4345-a6c9-ebaa887611d2")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.2.0.0")] 36 | [assembly: AssemblyFileVersion("0.2.0.0")] 37 | 38 | // Enable log4net using app.config 39 | [assembly: log4net.Config.XmlConfigurator(Watch = true)] 40 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/FieldKeysControl.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Threading.Tasks; 3 | using System.Windows.Forms; 4 | 5 | namespace CymaticLabs.InfluxDB.Studio.Controls 6 | { 7 | /// 8 | /// Renders the field keys for a given measurement. 9 | /// 10 | public partial class FieldKeysControl : MeasurementControl 11 | { 12 | #region Fields 13 | 14 | #endregion Fields 15 | 16 | #region Properties 17 | 18 | public override string ExportFileNameStem { get { return "field_keys"; } } 19 | 20 | #endregion Properties 21 | 22 | #region Constructors 23 | 24 | public FieldKeysControl() 25 | { 26 | InitializeComponent(); 27 | } 28 | 29 | #endregion Constructors 30 | 31 | #region Methods 32 | 33 | protected async override Task OnExecuteQuery() 34 | { 35 | // Get field keys from the server 36 | var fieldKeys = await InfluxDbClient.GetFieldKeysAsync(Database, Measurement); 37 | if (fieldKeys == null || fieldKeys.Count() == 0) return; 38 | 39 | // Add default row count column 40 | listView.Columns.Add(new ColumnHeader() { Text = "#" }); 41 | 42 | // Add tag key column 43 | listView.Columns.Add(new ColumnHeader() { Text = "fieldKey" }); 44 | 45 | // Add tag key column 46 | listView.Columns.Add(new ColumnHeader() { Text = "fieldType" }); 47 | 48 | // Add values 49 | var rowCount = 0; 50 | 51 | foreach (var fk in fieldKeys) 52 | { 53 | listView.Items.Add(new ListViewItem(new string[] { (++rowCount).ToString(), fk.Name, fk.Type }) {Tag = fk }); 54 | } 55 | } 56 | 57 | #endregion Methods 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/SslIgnoreValidator.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Net.Security; 3 | using System.Security.Cryptography.X509Certificates; 4 | 5 | namespace CymaticLabs.InfluxDB.Data 6 | { 7 | /// 8 | /// Utility class used to ignore verifying SSL/TLS certificates. 9 | /// 10 | public static class SslIgnoreValidator 11 | { 12 | // Whether or not the SSL validator override has been enabled or not 13 | private static bool enabled = false; 14 | 15 | // Whether or not to allow untrusted SSL/TLS certificates. 16 | private static bool allowUntrusted = false; 17 | 18 | /// 19 | /// Gets whether or not to allow untrusted SSL/TLS certificates. 20 | /// 21 | public static bool AllowUntrusted 22 | { 23 | get { return allowUntrusted; } 24 | 25 | set 26 | { 27 | allowUntrusted = value; 28 | 29 | // Configure untrusted allowances as needed 30 | if (allowUntrusted && !enabled) 31 | { 32 | OverrideValidation(); 33 | enabled = true; 34 | } 35 | } 36 | } 37 | 38 | // Custom validation method 39 | private static bool OnValidateCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) 40 | { 41 | if (sslPolicyErrors != SslPolicyErrors.None) 42 | { 43 | if (!allowUntrusted && sslPolicyErrors == SslPolicyErrors.RemoteCertificateChainErrors) 44 | { 45 | return false; 46 | } 47 | } 48 | 49 | return true; 50 | } 51 | 52 | // Overrides SSL/TLS certificate validation. 53 | static void OverrideValidation() 54 | { 55 | ServicePointManager.ServerCertificateValidationCallback = OnValidateCertificate; 56 | ServicePointManager.Expect100Continue = true; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbBackfillParams.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace CymaticLabs.InfluxDB.Data 5 | { 6 | /// 7 | /// Contains parameter values needed to run a backfill query. 8 | /// 9 | public class InfluxDbBackfillParams 10 | { 11 | #region Properties 12 | 13 | /// 14 | /// Gets or sets the InfluxDB downsampling functions/fields for the "SELECT" part of the query. 15 | /// 16 | public IEnumerable SubQueries { get; set; } 17 | 18 | /// 19 | /// Gets or sets the name of the destination measurement to insert values into. 20 | /// 21 | public string Destination { get; set; } 22 | 23 | /// 24 | /// Gets or sets the name of the source measurement to select values from. 25 | /// 26 | public string Source { get; set; } 27 | 28 | /// 29 | /// Gets or sets the back fill query interval (1d, 2h, 30m, 15s, etc.). 30 | /// 31 | public string Interval { get; set; } 32 | 33 | /// 34 | /// Time from boundary. 35 | /// 36 | public DateTime FromTime { get; set; } 37 | 38 | /// 39 | /// Time to boundary. 40 | /// 41 | public DateTime ToTime { get; set; } 42 | 43 | /// 44 | /// List of "WHERE" clause filters. 45 | /// 46 | public IList Filters { get; set; } 47 | 48 | /// 49 | /// Gets or sets the list of tags to carry over to the destination measurement. 50 | /// This is an optional property. 51 | /// 52 | public IEnumerable Tags { get; set; } 53 | 54 | /// 55 | /// Gets or sets the fill type for time intervals with no data. 56 | /// 57 | public InfluxDbFillTypes FillType { get; set; } 58 | 59 | #endregion Properties 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Dialogs/CreateUserDialog.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | using CymaticLabs.InfluxDB.Data; 3 | 4 | namespace CymaticLabs.InfluxDB.Studio.Dialogs 5 | { 6 | /// 7 | /// Dialog used for creating new InfluxDB users. 8 | /// 9 | public partial class CreateUserDialog : Form 10 | { 11 | #region Fields 12 | 13 | #endregion Fields 14 | 15 | #region Properties 16 | 17 | /// 18 | /// Gets the user name from the dialog window. 19 | /// 20 | public string Username 21 | { 22 | get { return username.Text; } 23 | } 24 | 25 | /// 26 | /// Gets the password from the dialog window. 27 | /// 28 | public string Password 29 | { 30 | get { return password.Text; } 31 | } 32 | 33 | #endregion Properties 34 | 35 | #region Constructors 36 | 37 | public CreateUserDialog() 38 | { 39 | InitializeComponent(); 40 | } 41 | 42 | #endregion Constructors 43 | 44 | #region Methods 45 | 46 | /// 47 | /// Clears the username and password fields of the dialog. 48 | /// 49 | public void ClearCreateValues() 50 | { 51 | username.Text = null; 52 | password.Text = null; 53 | adminCheckBox.Checked = false; 54 | } 55 | 56 | /// 57 | /// Creates and returns a new InfluxDB user from the dialog values. 58 | /// 59 | public InfluxDbUser CreateUserFromDialog() 60 | { 61 | // Validate user name 62 | if (string.IsNullOrWhiteSpace(Username)) 63 | { 64 | AppForm.DisplayError("User name cannot be blank.", "Bad User Name"); 65 | return null; 66 | } 67 | 68 | // Validate password 69 | if (string.IsNullOrWhiteSpace(Password)) 70 | { 71 | AppForm.DisplayError("Password cannot be blank.", "Bad Password"); 72 | return null; 73 | } 74 | 75 | return new InfluxDbUser(username.Text, adminCheckBox.Checked); 76 | } 77 | 78 | #endregion Methods 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbCqParams.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace CymaticLabs.InfluxDB.Data 4 | { 5 | /// 6 | /// Contains the parameters necessary to create a new InfluxDB Continuous Query. 7 | /// 8 | public class InfluxDbCqParams 9 | { 10 | #region Properties 11 | 12 | /// 13 | /// Gets or sets the name of the continuous query. 14 | /// 15 | public string Name { get; set; } 16 | 17 | /// 18 | /// Gets or sets the name of the database the continuous query is for. 19 | /// 20 | public string Database { get; set; } 21 | 22 | /// 23 | /// Gets or sets the list of the continuous query's subqueries/downsamplers. 24 | /// 25 | /// MEAN("raw_field") AS avg_field 26 | public IEnumerable SubQueries { get; set; } 27 | 28 | /// 29 | /// Gets or sets the name of the destination measurement to insert continuous query values into. 30 | /// 31 | public string Destination { get; set; } 32 | 33 | /// 34 | /// Gets or sets the name of the source measurement to select values from. 35 | /// 36 | public string Source { get; set; } 37 | 38 | /// 39 | /// Gets or sets the continuous query interval (1d, 2h, 30m, 15s, etc.). 40 | /// 41 | public string Interval { get; set; } 42 | 43 | /// 44 | /// Gets or sets the list of tags to carry over to the destination measurement. 45 | /// This is an optional property. 46 | /// 47 | public IEnumerable Tags { get; set; } 48 | 49 | /// 50 | /// Gets or sets the fill type for time intervals with no data. 51 | /// 52 | public InfluxDbFillTypes FillType { get; set; } 53 | 54 | /// 55 | /// Gets or sets the RESAMPLE EVERY interval which is part of continuous query advanced syntax. 56 | /// This is an optional property. 57 | /// 58 | public string ResampleEveryInterval { get; set; } 59 | 60 | /// 61 | /// Gets or sets the RESAMPLE FOR interval which is part of continuous query advanced syntax. 62 | /// This is an optional property. 63 | /// 64 | public string ResampleForInterval { get; set; } 65 | 66 | #endregion Properties 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/DiagnosticsControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using CymaticLabs.InfluxDB.Data; 4 | 5 | namespace CymaticLabs.InfluxDB.Studio.Controls 6 | { 7 | /// 8 | /// Renders InfluxDB server diagnostics information. 9 | /// 10 | public partial class DiagnosticsControl : RequestControl 11 | { 12 | #region Fields 13 | 14 | #endregion Fields 15 | 16 | #region Properties 17 | 18 | #endregion Properties 19 | 20 | #region Constructors 21 | 22 | public DiagnosticsControl() 23 | { 24 | InitializeComponent(); 25 | } 26 | 27 | #endregion Constructors 28 | 29 | #region Methods 30 | 31 | /// 32 | /// Binds the control to server diagnostics information. 33 | /// 34 | public async override Task ExecuteRequestAsync() 35 | { 36 | if (InfluxDbClient == null) throw new Exception("No InfluxDB client available."); 37 | 38 | // Clear current values 39 | var blank = "-"; 40 | 41 | // System 42 | pidValue.Text = blank; 43 | currentTimeValue.Text = blank; 44 | startedValue.Text = blank; 45 | uptimeValue.Text = blank; 46 | 47 | // Build 48 | branchValue.Text = blank; 49 | commitValue.Text = blank; 50 | buildVersionValue.Text = blank; 51 | 52 | // Runtime 53 | goArchValue.Text = blank; 54 | goMaxProcsValue.Text = blank; 55 | goOsValue.Text = blank; 56 | goVersionValue.Text = blank; 57 | 58 | // Network 59 | hostnameValue.Text = blank; 60 | 61 | // Query new values 62 | var diagnostics = await InfluxDbClient.GetDiagnosticsAsync(); 63 | if (diagnostics == null) return; 64 | 65 | // System 66 | pidValue.Text = diagnostics.PID.ToString(); 67 | currentTimeValue.Text = diagnostics.CurrentTime.ToString(); 68 | startedValue.Text = diagnostics.Started.ToString(); 69 | var ut = diagnostics.Uptime; 70 | uptimeValue.Text = string.Format("{0}d {1}h {2}m {3}s {4}ms", ut.Days, ut.Hours, ut.Minutes, ut.Seconds, ut.Milliseconds); 71 | 72 | // Build 73 | branchValue.Text = diagnostics.Branch; 74 | commitValue.Text = diagnostics.Commit; 75 | buildVersionValue.Text = diagnostics.BuildVersion; 76 | 77 | // Runtime 78 | goArchValue.Text = diagnostics.GoArch; 79 | goMaxProcsValue.Text = diagnostics.GoMaxProc.ToString(); 80 | goOsValue.Text = diagnostics.GoOs; 81 | goVersionValue.Text = diagnostics.GoVersion; 82 | 83 | // Network 84 | hostnameValue.Text = diagnostics.Hostname; 85 | } 86 | 87 | #endregion Methods 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Dialogs/EditPrivilegeDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using CymaticLabs.InfluxDB.Data; 4 | 5 | namespace CymaticLabs.InfluxDB.Studio.Dialogs 6 | { 7 | /// 8 | /// Dialog used to edit InfluxDB users database privileges. 9 | /// 10 | public partial class EditPrivilegeDialog : Form 11 | { 12 | #region Fields 13 | 14 | InfluxDbGrant grant; 15 | 16 | #endregion Fields 17 | 18 | #region Properties 19 | 20 | /// 21 | /// Gets the username of the InfluxDB user who will have the privilege edited. 22 | /// 23 | public string Username { get; private set; } 24 | 25 | /// 26 | /// Gets the database of the InfluxDB the privilege is for. 27 | /// 28 | public string Database { get; private set; } 29 | 30 | /// 31 | /// Gets the currently selected privilege in the dialog. 32 | /// 33 | public InfluxDbPrivileges SelectedPrivilege 34 | { 35 | get 36 | { 37 | if (privilegeComboBox.SelectedItem == null) return InfluxDbPrivileges.None; 38 | return (InfluxDbPrivileges)privilegeComboBox.SelectedItem; 39 | } 40 | } 41 | 42 | #endregion Properties 43 | 44 | #region Constructors 45 | 46 | public EditPrivilegeDialog() 47 | { 48 | InitializeComponent(); 49 | 50 | // Setup the privilege drop down with values dynamically 51 | foreach (InfluxDbPrivileges p in Enum.GetValues(typeof(InfluxDbPrivileges))) 52 | { 53 | privilegeComboBox.Items.Add(p); 54 | } 55 | 56 | privilegeComboBox.SelectedIndex = 0; 57 | } 58 | 59 | #endregion Constructors 60 | 61 | #region Methods 62 | 63 | /// 64 | /// Binds the dialog to a user. 65 | /// 66 | /// The privilege grant to bind to. 67 | public void BindToGrant(string username, InfluxDbGrant grant) 68 | { 69 | if (string.IsNullOrWhiteSpace(username)) throw new ArgumentNullException("username"); 70 | if (grant == null) throw new ArgumentNullException("grant"); 71 | 72 | // Bind user details 73 | Username = usernameValue.Text = username; 74 | Database = databaseValue.Text = grant.Database; 75 | 76 | for (var i = 0; i < privilegeComboBox.Items.Count; i++) 77 | { 78 | var p = (InfluxDbPrivileges)privilegeComboBox.Items[i]; 79 | 80 | if (p == grant.Privilege) 81 | { 82 | privilegeComboBox.SelectedIndex = i; 83 | break; 84 | } 85 | } 86 | } 87 | 88 | #endregion Methods 89 | 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | False 31 | 32 | 33 | hh:mm:ss tt 34 | 35 | 36 | M/dd/yyyy 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CymaticLabs.InfluxDB.Studio.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("")] 29 | public string ConnectionsJson { 30 | get { 31 | return ((string)(this["ConnectionsJson"])); 32 | } 33 | set { 34 | this["ConnectionsJson"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 41 | public bool AllowUntrustedSsl { 42 | get { 43 | return ((bool)(this["AllowUntrustedSsl"])); 44 | } 45 | set { 46 | this["AllowUntrustedSsl"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("hh:mm:ss tt")] 53 | public string TimeFormat { 54 | get { 55 | return ((string)(this["TimeFormat"])); 56 | } 57 | set { 58 | this["TimeFormat"] = value; 59 | } 60 | } 61 | 62 | [global::System.Configuration.UserScopedSettingAttribute()] 63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 64 | [global::System.Configuration.DefaultSettingValueAttribute("M/dd/yyyy")] 65 | public string DateFormat { 66 | get { 67 | return ((string)(this["DateFormat"])); 68 | } 69 | set { 70 | this["DateFormat"] = value; 71 | } 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbSeries.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace CymaticLabs.InfluxDB.Data 5 | { 6 | /// 7 | /// Represents the result of an InfluxDB query. 8 | /// 9 | public class InfluxDbSeries 10 | { 11 | #region Fields 12 | 13 | // Internal look-up of a column's index given its name 14 | Dictionary columnIndexByName; 15 | 16 | #endregion Fields 17 | 18 | #region Properties 19 | 20 | /// 21 | /// Gets the name of the resulting series. 22 | /// 23 | public string Name { get; private set; } 24 | 25 | /// 26 | /// Gets the list of column names for the result. 27 | /// 28 | public IList Columns { get; private set; } 29 | 30 | /// 31 | /// Gets the tag results for the query. 32 | /// 33 | public IDictionary Tags { get; private set; } 34 | 35 | /// 36 | /// Gets the values for the query where the first level is the row and the second the columns. 37 | /// 38 | public IList> Values { get; private set; } 39 | 40 | #endregion Properties 41 | 42 | #region Constructors 43 | 44 | public InfluxDbSeries(string name, IList columns, IDictionary tags, IList> values) 45 | { 46 | //if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullException("name"); 47 | if (columns == null) throw new ArgumentNullException("columns"); 48 | if (tags == null) throw new ArgumentNullException("tags"); 49 | if (values == null) throw new ArgumentNullException("values"); 50 | 51 | Name = name; 52 | Columns = columns; 53 | Tags = tags; 54 | Values = values; 55 | 56 | columnIndexByName = new Dictionary(); 57 | 58 | // Cache column name/index look-up 59 | if (columns.Count > 0) 60 | { 61 | for (var i = 0; i < columns.Count; i++) 62 | { 63 | var colName = columns[i]; 64 | if (!columnIndexByName.ContainsKey(colName)) columnIndexByName.Add(colName, i); 65 | } 66 | } 67 | } 68 | 69 | #endregion Constructors 70 | 71 | #region Methods 72 | 73 | /// 74 | /// Gets a column's index in the list given its name. 75 | /// 76 | /// The column name to get the index for. 77 | /// The column's index in the list if found, otherwise -1. 78 | public int GetColumnIndex(string name) 79 | { 80 | if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullException("name"); 81 | return columnIndexByName.ContainsKey(name) ? columnIndexByName[name] : -1; 82 | } 83 | 84 | #endregion Methods 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbStats.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CymaticLabs.InfluxDB.Data 8 | { 9 | /// 10 | /// Represents a collection of InfluxDB server statistics. 11 | /// 12 | public class InfluxDbStats 13 | { 14 | #region Fields 15 | 16 | #endregion Fields 17 | 18 | #region Properties 19 | 20 | /// 21 | /// A list of server stats related to Continuous Queries. 22 | /// 23 | public IEnumerable CQ { get; set; } 24 | 25 | /// 26 | /// A list of server stats related to the database engine. 27 | /// 28 | public IEnumerable Engine { get; set; } 29 | 30 | /// 31 | /// A list of server stats related to shards. 32 | /// 33 | public IEnumerable Shard { get; set; } 34 | 35 | /// 36 | /// A list of server stats related to the HTTP process. 37 | /// 38 | public IEnumerable Httpd { get; set; } 39 | 40 | /// 41 | /// A list of server stats related to WAL storage. 42 | /// 43 | public IEnumerable WAL { get; set; } 44 | 45 | /// 46 | /// A list of server stats related to database writes. 47 | /// 48 | public IEnumerable Write { get; set; } 49 | 50 | /// 51 | /// A list of server stats related to the GoLang runtime. 52 | /// 53 | public IEnumerable Runtime { get; set; } 54 | 55 | /// 56 | /// A list of server stats related to databases. 57 | /// 58 | public IEnumerable Database { get; set; } 59 | 60 | /// 61 | /// A list of server stats related to the query executor. 62 | /// 63 | public IEnumerable QueryExecutor { get; set; } 64 | 65 | /// 66 | /// A list of server stats related to subscriptions. 67 | /// 68 | public IEnumerable Subscriber { get; set; } 69 | 70 | /// 71 | /// A list of server stats related to the TSM1 cache. 72 | /// 73 | public IEnumerable Tsm1Cache { get; set; } 74 | 75 | /// 76 | /// A list of server stats related to the TSM1 filestore. 77 | /// 78 | public IEnumerable Tsm1Filestore { get; set; } 79 | 80 | /// 81 | /// A list of server stats related to the TSM1 WAL storage. 82 | /// 83 | public IEnumerable Tsm1Wal { get; set; } 84 | 85 | #endregion Properties 86 | 87 | #region Constructors 88 | 89 | #endregion Constructors 90 | 91 | #region Methods 92 | 93 | #endregion Methods 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/TagValuesControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using System.Windows.Forms; 5 | 6 | namespace CymaticLabs.InfluxDB.Studio.Controls 7 | { 8 | /// 9 | /// Renders the tag values for a given measurement. 10 | /// 11 | public partial class TagValuesControl : MeasurementControl 12 | { 13 | #region Fields 14 | 15 | #endregion Fields 16 | 17 | #region Properties 18 | 19 | public override string ExportFileNameStem 20 | { 21 | get { return string.Format("tag_values_{0}", tagKeysComboBox.SelectedItem as string); } 22 | } 23 | 24 | #endregion Properties 25 | 26 | #region Constructors 27 | 28 | public TagValuesControl() 29 | { 30 | InitializeComponent(); 31 | } 32 | 33 | #endregion Constructors 34 | 35 | #region Event Handlers 36 | 37 | // Handle changes to tag key 38 | private async void tagKeysComboBox_SelectedIndexChanged(object sender, EventArgs e) 39 | { 40 | await ExecuteRequestAsync(); 41 | } 42 | 43 | #endregion Event Handlers 44 | 45 | #region Methods 46 | 47 | protected async override Task OnExecuteQuery() 48 | { 49 | // Fetch tag keys if the drop down has not yet been populated 50 | if (tagKeysComboBox.Items.Count == 0) 51 | { 52 | // Get the current list of tag keys for the measurement 53 | var tagKeys = await InfluxDbClient.GetTagKeysAsync(Database, Measurement); 54 | 55 | if (tagKeys != null && tagKeys.Count() > 0) 56 | { 57 | foreach (var tag in tagKeys) tagKeysComboBox.Items.Add(tag); 58 | tagKeysComboBox.SelectedItem = tagKeys.First(); 59 | } 60 | } 61 | else 62 | { 63 | await BindTagValues(); 64 | } 65 | } 66 | 67 | // Queries tag values for the selected tag key and displays them 68 | async Task BindTagValues() 69 | { 70 | // Clear the current items 71 | listView.Items.Clear(); 72 | 73 | // Get the values for the current tag key 74 | var selectedTag = tagKeysComboBox.SelectedItem as string; 75 | 76 | if (selectedTag != null) 77 | { 78 | var tagValues = await InfluxDbClient.GetTagValuesAsync(Database, Measurement, selectedTag); 79 | 80 | // Add default row count column 81 | listView.Columns.Add(new ColumnHeader() { Text = "#" }); 82 | 83 | // Add tag value column 84 | listView.Columns.Add(new ColumnHeader() { Text = "tagValue" }); 85 | 86 | // Add each value to the list 87 | var rowCount = 0; 88 | 89 | foreach (var tv in tagValues) 90 | { 91 | listView.Items.Add(new ListViewItem(new string[] { (++rowCount).ToString(), tv.Value }) { Tag = tv }); 92 | } 93 | } 94 | } 95 | 96 | #endregion Methods 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Dialogs/GrantPrivilegeDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using System.Windows.Forms; 5 | 6 | using CymaticLabs.InfluxDB.Data; 7 | 8 | namespace CymaticLabs.InfluxDB.Studio.Dialogs 9 | { 10 | /// 11 | /// Dialog used to grant InfluxDB users a new privilege. 12 | /// 13 | public partial class GrantPrivilegeDialog : Form 14 | { 15 | #region Fields 16 | 17 | #endregion Fields 18 | 19 | #region Properties 20 | 21 | /// 22 | /// Gets the InfluxDB user who will have the privilege granted. 23 | /// 24 | public InfluxDbUser User { get; private set; } 25 | 26 | /// 27 | /// Gets or sets the InfluxDB client to use. 28 | /// 29 | public InfluxDbClient InfluxDbClient { get; set; } 30 | 31 | /// 32 | /// Gets the currently selected database name in the dialog. 33 | /// 34 | public string SelectedDatabase 35 | { 36 | get 37 | { 38 | if (databaseComboBox.SelectedItem == null) return null; 39 | return (string)databaseComboBox.SelectedItem; 40 | } 41 | } 42 | 43 | /// 44 | /// Gets the currently selected privilege in the dialog. 45 | /// 46 | public InfluxDbPrivileges SelectedPrivilege 47 | { 48 | get 49 | { 50 | if (privilegeComboBox.SelectedItem == null) return InfluxDbPrivileges.None; 51 | return (InfluxDbPrivileges)privilegeComboBox.SelectedItem; 52 | } 53 | } 54 | 55 | #endregion Properties 56 | 57 | #region Constructors 58 | 59 | public GrantPrivilegeDialog() 60 | { 61 | InitializeComponent(); 62 | 63 | // Setup the privilege drop down with values dynamically 64 | foreach (InfluxDbPrivileges p in Enum.GetValues(typeof(InfluxDbPrivileges))) 65 | { 66 | if (p == InfluxDbPrivileges.None) continue; 67 | privilegeComboBox.Items.Add(p); 68 | } 69 | 70 | privilegeComboBox.SelectedIndex = 0; 71 | } 72 | 73 | #endregion Constructors 74 | 75 | #region Methods 76 | 77 | /// 78 | /// Binds the dialog to a user. 79 | /// 80 | /// The user to bind to. 81 | public async Task BindToUser(InfluxDbUser user) 82 | { 83 | // Bind user details 84 | User = user; 85 | usernameValue.Text = user.Name; 86 | 87 | // Bind the database list 88 | await BindDatabases(); 89 | } 90 | 91 | // Binds the database drop down to the list of database for the current connection 92 | async Task BindDatabases() 93 | { 94 | // Clear current list of databases 95 | databaseComboBox.Items.Clear(); 96 | 97 | // Get the total list of databases 98 | var dbNames = await InfluxDbClient.GetDatabaseNamesAsync(); 99 | if (dbNames.Count() == 0) return; 100 | 101 | databaseComboBox.BeginUpdate(); 102 | 103 | foreach (var db in dbNames) 104 | { 105 | databaseComboBox.Items.Add(db); 106 | } 107 | 108 | databaseComboBox.EndUpdate(); 109 | 110 | // Select the first database 111 | databaseComboBox.SelectedIndex = 0; 112 | } 113 | 114 | #endregion Methods 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/SeriesControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace CymaticLabs.InfluxDB.Studio.Controls 8 | { 9 | /// 10 | /// Renders series information for a given measurement. 11 | /// 12 | public partial class SeriesControl : MeasurementControl 13 | { 14 | #region Fields 15 | 16 | #endregion Fields 17 | 18 | #region Properties 19 | 20 | public override string ExportFileNameStem { get { return "series"; } } 21 | 22 | #endregion Properties 23 | 24 | #region Constructors 25 | 26 | public SeriesControl() 27 | { 28 | InitializeComponent(); 29 | } 30 | 31 | #endregion Constructors 32 | 33 | #region Methods 34 | 35 | protected override async Task OnExecuteQuery() 36 | { 37 | // Get the names of the series 38 | var seriesSetNames = await InfluxDbClient.GetSeriesNamesAsync(Database, Measurement); 39 | if (seriesSetNames.Count() == 0) return; 40 | 41 | var columnNameToIndex = new Dictionary(); 42 | var columnList = new List(); 43 | var seriesValues = new List>(); 44 | 45 | // First column is just a row number 46 | var rowCol = new ColumnHeader() { Text = "#" }; 47 | columnList.Add(rowCol); 48 | listView.Columns.Add(rowCol); 49 | 50 | // Build the column list and parse series values 51 | foreach (var seriesName in seriesSetNames) 52 | { 53 | // Parse the series data 54 | var parsedSeries = seriesName.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); 55 | var values = new Dictionary(); 56 | seriesValues.Add(values); 57 | 58 | foreach (var pair in parsedSeries) 59 | { 60 | var parsedPair = pair.Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries); 61 | var name = parsedPair[0]; 62 | if (name == Measurement || parsedPair.Length == 1) continue; // ignore measurement name 63 | var value = parsedPair[1]; 64 | 65 | // Create an column name -> index look up table, normalizing names/tags 66 | if (!columnNameToIndex.ContainsKey(name)) 67 | { 68 | columnNameToIndex.Add(name, columnList.Count); 69 | var col = new ColumnHeader() { Text = name }; 70 | columnList.Add(col); 71 | listView.Columns.Add(col); 72 | } 73 | 74 | // Add this value pair to the series entry 75 | values.Add(name, value); 76 | } 77 | } 78 | 79 | // Go through each entry and render its values in the correct column 80 | for (var i = 0; i < seriesValues.Count; i++) 81 | { 82 | var values = seriesValues[i]; 83 | var li = new ListViewItem((i + 1).ToString()) { Tag = values }; 84 | listView.Items.Add(li); 85 | 86 | for (var x = 1; x < columnList.Count; x++) 87 | { 88 | var col = columnList[x]; 89 | var name = col.Text; 90 | var sli = new ListViewItem.ListViewSubItem(li, values.ContainsKey(name) ? values[name] : null); 91 | li.SubItems.Add(sli); 92 | } 93 | } 94 | } 95 | 96 | #endregion Methods 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbConnection.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace CymaticLabs.InfluxDB.Data 4 | { 5 | /// 6 | /// Represents the connection information required to connect to a specific InfluxDB server. 7 | /// 8 | public class InfluxDbConnection 9 | { 10 | #region Fields 11 | 12 | #endregion Fields 13 | 14 | #region Properties 15 | 16 | /// 17 | /// Sets the unique ID of the connction instance. Ideally this value 18 | /// does not changed once assigned. 19 | /// 20 | public string Id { get; set; } 21 | 22 | /// 23 | /// Gets or sets the human-readable name of the connection. 24 | /// 25 | public string Name { get; set; } 26 | 27 | /// 28 | /// Gets or sets the host URL for the InfluxDB server to connect to. 29 | /// 30 | public string Host { get; set; } 31 | 32 | /// 33 | /// Gets or sets the port number to use when connecting to the InfluxDB server. 34 | /// 35 | public ushort Port { get; set; } 36 | 37 | /// 38 | /// The name of the preferred database to use (optional). 39 | /// 40 | public string Database { get; set; } 41 | 42 | /// 43 | /// Gets or sets the username to use when connecting to the InfluxDB server. 44 | /// 45 | public string Username { get; set; } 46 | 47 | /// 48 | /// Gets or sets the password to use when connecting to the InfluxDB server. 49 | /// 50 | public string Password { get; set; } 51 | 52 | /// 53 | /// Gets whether or not to use SSL to communicate with the InfluxDB server. 54 | /// 55 | public bool UseSsl { get; set; } 56 | 57 | /// 58 | /// Gets the combined/unified host connection string including protocol and port number for 59 | /// HTTP API access to the InfluxDB server. 60 | /// 61 | [JsonIgnore] 62 | public string HttpConnectionString 63 | { 64 | get 65 | { 66 | return string.Format("{0}://{1}:{2}", UseSsl ? "https" : "http", Host, Port); 67 | } 68 | } 69 | 70 | #endregion Properties 71 | 72 | #region Constructors 73 | 74 | /// 75 | /// Creates an InfluxDB connection with the provided configuration details. 76 | /// 77 | /// A unique ID to assign the connection. 78 | /// The human-readable name for the connection. 79 | /// The host URL for the InfluxDB server to connect to. 80 | /// The port number to use when connecting to the InfluxDB server. 81 | /// The username to use when connecting to the InfluxDB server. 82 | /// The password to use when connecting to the InfluxDB server. 83 | /// Whether or not to use SSL to communicate with the InfluxDB server. 84 | /// The name of the preferred database to use (optional). 85 | public InfluxDbConnection(string id, string name, string host, ushort port, 86 | string username, string password, bool useSsl = true, string database = null) 87 | { 88 | Id = id; 89 | Name = name; 90 | Host = host; 91 | Port = port; 92 | Username = username; 93 | Password = password; 94 | UseSsl = useSsl; 95 | Database = database; 96 | } 97 | 98 | #endregion Constructors 99 | 100 | #region Methods 101 | 102 | #endregion Methods 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/TagValuesControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CymaticLabs.InfluxDB.Studio.Controls 2 | { 3 | partial class TagValuesControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.toolStrip1 = new System.Windows.Forms.ToolStrip(); 32 | this.tagKeysLabel = new System.Windows.Forms.ToolStripLabel(); 33 | this.tagKeysComboBox = new System.Windows.Forms.ToolStripComboBox(); 34 | this.toolStrip1.SuspendLayout(); 35 | this.SuspendLayout(); 36 | // 37 | // listView 38 | // 39 | this.listView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 40 | | System.Windows.Forms.AnchorStyles.Left) 41 | | System.Windows.Forms.AnchorStyles.Right))); 42 | this.listView.Dock = System.Windows.Forms.DockStyle.None; 43 | this.listView.Location = new System.Drawing.Point(0, 28); 44 | this.listView.Size = new System.Drawing.Size(773, 449); 45 | // 46 | // toolStrip1 47 | // 48 | this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 49 | this.tagKeysLabel, 50 | this.tagKeysComboBox}); 51 | this.toolStrip1.Location = new System.Drawing.Point(0, 0); 52 | this.toolStrip1.Name = "toolStrip1"; 53 | this.toolStrip1.Size = new System.Drawing.Size(773, 25); 54 | this.toolStrip1.TabIndex = 2; 55 | this.toolStrip1.Text = "toolStrip"; 56 | // 57 | // tagKeysLabel 58 | // 59 | this.tagKeysLabel.Name = "tagKeysLabel"; 60 | this.tagKeysLabel.Size = new System.Drawing.Size(56, 22); 61 | this.tagKeysLabel.Text = "tag keys: "; 62 | // 63 | // tagKeysComboBox 64 | // 65 | this.tagKeysComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 66 | this.tagKeysComboBox.Name = "tagKeysComboBox"; 67 | this.tagKeysComboBox.Size = new System.Drawing.Size(121, 25); 68 | this.tagKeysComboBox.SelectedIndexChanged += new System.EventHandler(this.tagKeysComboBox_SelectedIndexChanged); 69 | // 70 | // TagValuesControl 71 | // 72 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 73 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 74 | this.Controls.Add(this.toolStrip1); 75 | this.Name = "TagValuesControl"; 76 | this.Controls.SetChildIndex(this.listView, 0); 77 | this.Controls.SetChildIndex(this.toolStrip1, 0); 78 | this.toolStrip1.ResumeLayout(false); 79 | this.toolStrip1.PerformLayout(); 80 | this.ResumeLayout(false); 81 | this.PerformLayout(); 82 | 83 | } 84 | 85 | #endregion 86 | 87 | private System.Windows.Forms.ToolStrip toolStrip1; 88 | private System.Windows.Forms.ToolStripComboBox tagKeysComboBox; 89 | private System.Windows.Forms.ToolStripLabel tagKeysLabel; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/StatsControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CymaticLabs.InfluxDB.Studio.Controls 2 | { 3 | partial class StatsControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.toolStrip1 = new System.Windows.Forms.ToolStrip(); 32 | this.selectStatLabel = new System.Windows.Forms.ToolStripLabel(); 33 | this.statsComboBox = new System.Windows.Forms.ToolStripComboBox(); 34 | this.tabControl = new System.Windows.Forms.TabControl(); 35 | this.toolStrip1.SuspendLayout(); 36 | this.SuspendLayout(); 37 | // 38 | // toolStrip1 39 | // 40 | this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 41 | this.selectStatLabel, 42 | this.statsComboBox}); 43 | this.toolStrip1.Location = new System.Drawing.Point(0, 0); 44 | this.toolStrip1.Name = "toolStrip1"; 45 | this.toolStrip1.Size = new System.Drawing.Size(633, 25); 46 | this.toolStrip1.TabIndex = 0; 47 | this.toolStrip1.Text = "toolStrip1"; 48 | // 49 | // selectStatLabel 50 | // 51 | this.selectStatLabel.Name = "selectStatLabel"; 52 | this.selectStatLabel.Size = new System.Drawing.Size(85, 22); 53 | this.selectStatLabel.Text = "Select Statistic:"; 54 | // 55 | // statsComboBox 56 | // 57 | this.statsComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 58 | this.statsComboBox.Name = "statsComboBox"; 59 | this.statsComboBox.Size = new System.Drawing.Size(121, 25); 60 | this.statsComboBox.SelectedIndexChanged += new System.EventHandler(this.statsComboBox_SelectedIndexChanged); 61 | // 62 | // tabControl 63 | // 64 | this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 65 | | System.Windows.Forms.AnchorStyles.Left) 66 | | System.Windows.Forms.AnchorStyles.Right))); 67 | this.tabControl.Location = new System.Drawing.Point(0, 32); 68 | this.tabControl.Name = "tabControl"; 69 | this.tabControl.SelectedIndex = 0; 70 | this.tabControl.Size = new System.Drawing.Size(633, 465); 71 | this.tabControl.TabIndex = 1; 72 | // 73 | // StatsControl 74 | // 75 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 76 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 77 | this.Controls.Add(this.tabControl); 78 | this.Controls.Add(this.toolStrip1); 79 | this.Name = "StatsControl"; 80 | this.Size = new System.Drawing.Size(633, 497); 81 | this.toolStrip1.ResumeLayout(false); 82 | this.toolStrip1.PerformLayout(); 83 | this.ResumeLayout(false); 84 | this.PerformLayout(); 85 | 86 | } 87 | 88 | #endregion 89 | 90 | private System.Windows.Forms.ToolStrip toolStrip1; 91 | private System.Windows.Forms.ToolStripComboBox statsComboBox; 92 | private System.Windows.Forms.TabControl tabControl; 93 | private System.Windows.Forms.ToolStripLabel selectStatLabel; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/QueryControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | using ScintillaNET; 7 | using CymaticLabs.InfluxDB.Data; 8 | 9 | namespace CymaticLabs.InfluxDB.Studio.Controls 10 | { 11 | /// 12 | /// A control that executes an InfluxDB query and displays the results. 13 | /// 14 | public partial class QueryControl : RequestControl 15 | { 16 | #region Fields 17 | 18 | // Used for timing operations. 19 | System.Diagnostics.Stopwatch stopWatch; 20 | 21 | // Used to give resulting rows an ID number 22 | int resultsCount = 0; 23 | 24 | #endregion Fields 25 | 26 | #region Properties 27 | 28 | /// 29 | /// Gets or sets the query editor's text. 30 | /// 31 | public string EditorText 32 | { 33 | get { return queryEditor.Text; } 34 | set { queryEditor.Text = value; } 35 | } 36 | 37 | #endregion Properties 38 | 39 | #region Constructors 40 | 41 | public QueryControl() 42 | { 43 | stopWatch = new System.Diagnostics.Stopwatch(); 44 | 45 | InitializeComponent(); 46 | 47 | // Clear query results text 48 | resultsLabel.Text = null; 49 | 50 | // Set query editor styles, InfluxDB is SQL like, so use those 51 | queryEditor.Styles[Style.Sql.Identifier].ForeColor = Color.Blue; 52 | queryEditor.Styles[Style.Sql.String].ForeColor = Color.Red; 53 | queryEditor.Styles[Style.Sql.Number].ForeColor = Color.Magenta; 54 | queryEditor.Styles[Style.Sql.QuotedIdentifier].ForeColor = Color.Red; 55 | } 56 | 57 | #endregion Constructors 58 | 59 | #region Methods 60 | 61 | /// 62 | /// Runs the current query against the configured connection and database. 63 | /// 64 | public override async Task ExecuteRequestAsync() 65 | { 66 | if (InfluxDbClient == null) throw new Exception("No InfluxDB client available."); 67 | 68 | // Reset the results count 69 | resultsCount = 0; 70 | 71 | // Get the database and the query 72 | var query = EditorText.Trim(); 73 | bool isAggregate = query.ToLower().Contains("group by"); 74 | 75 | // Clear the current results 76 | tabControl.Controls.Clear(); 77 | 78 | // Start timing... 79 | stopWatch.Restart(); 80 | 81 | // Execute the query 82 | var results = await InfluxDbClient.QueryAsync(Database, query); 83 | 84 | // Stop timing... 85 | stopWatch.Stop(); 86 | 87 | // If there are results 88 | if (results != null && results.Count() > 0) 89 | { 90 | var tabCount = 0; 91 | var tabLabel = isAggregate ? "Group" : "Results"; 92 | 93 | foreach (var result in results) 94 | { 95 | // Create a new tab page to hold the query results control 96 | var tab = new TabPage(string.Format("{0} {1}", tabLabel, ++tabCount)); 97 | 98 | // Create a new query results control 99 | var queryResultsControl = new QueryResultsControl(); 100 | queryResultsControl.InfluxDbClient = InfluxDbClient; 101 | queryResultsControl.Database = Database; 102 | queryResultsControl.Dock = DockStyle.Fill; 103 | tab.Controls.Add(queryResultsControl); 104 | 105 | // Add the tab to the control 106 | tabControl.TabPages.Add(tab); 107 | 108 | // Render the results and increment the global total 109 | resultsCount += queryResultsControl.UpdateResults(result); 110 | } 111 | } 112 | 113 | // Show stat results of query 114 | resultsLabel.Text = string.Format("results: {0}, response time: {1:0} ms", resultsCount, stopWatch.Elapsed.TotalMilliseconds); 115 | } 116 | 117 | #endregion Methods 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbDiagnostics.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | 4 | namespace CymaticLabs.InfluxDB.Data 5 | { 6 | /// 7 | /// Contains diagnostics information for an InfluxDB server. 8 | /// 9 | public class InfluxDbDiagnostics 10 | { 11 | #region Properties 12 | 13 | /// 14 | /// The host name of the InfluxDB server. 15 | /// 16 | public string Hostname { get; set; } 17 | 18 | /// 19 | /// The InfluxDB branch. 20 | /// 21 | public string Branch { get; set; } 22 | 23 | /// 24 | /// The InfluxDB commit. 25 | /// 26 | public string Commit { get; set; } 27 | 28 | /// 29 | /// The InfluxDB build version. 30 | /// 31 | public string BuildVersion { get; set; } 32 | 33 | /// 34 | /// The time at which the InfluxDB process was started. 35 | /// 36 | public DateTime Started { get; set; } 37 | 38 | /// 39 | /// The current InfluxDB server time. 40 | /// 41 | public DateTime CurrentTime { get; set; } 42 | 43 | /// 44 | /// The uptime of the InfluxDB process. 45 | /// 46 | public TimeSpan Uptime { get; set; } 47 | 48 | /// 49 | /// The InfluxDB process ID. 50 | /// 51 | public long PID { get; set; } 52 | 53 | /// 54 | /// The architecture of the InfluxDB GO runtime. 55 | /// 56 | public string GoArch { get; set; } 57 | 58 | /// 59 | /// The maximum number of processors available to the InfluxDB GO runtime. 60 | /// 61 | public long GoMaxProc { get; set; } 62 | 63 | /// 64 | /// The operating system of the InfluxDB GO runtime. 65 | /// 66 | public string GoOs { get; set; } 67 | 68 | /// 69 | /// The version of the InfluxDB GO runtime. 70 | /// 71 | public string GoVersion { get; set; } 72 | 73 | #endregion Properties 74 | 75 | #region Methods 76 | 77 | /// 78 | /// Parses a GO duration string. This is the type of string returned from an InfluxDB 79 | /// diagnostics query's "uptime" value. 80 | /// 81 | /// The duration string to parse. 82 | /// A positive if parses was successful, otherwise a negative one. 83 | public static TimeSpan ParseGoDuration(string duration) 84 | { 85 | try 86 | { 87 | int h = -1, m = -1, s = -1, ms = -1; 88 | Regex regex = new Regex("([0-9\\.]+)(.)"); 89 | var matches = regex.Matches(duration); 90 | 91 | foreach (Match match in matches) 92 | { 93 | var value = match.Groups[1].Value; 94 | var units = match.Groups[2].Value; 95 | 96 | if (units == "h") 97 | { 98 | h = int.Parse(value); 99 | } 100 | else if (units == "m") 101 | { 102 | m = int.Parse(value); 103 | } 104 | else if (units == "s") 105 | { 106 | var parsedSeconds = value.Split(new char[] { '.' }, StringSplitOptions.RemoveEmptyEntries); 107 | s = int.Parse(parsedSeconds[0]); 108 | 109 | //if (parsedSeconds.Length == 2) 110 | //{ 111 | // var _ms = parsedSeconds[1]; 112 | // if (_ms.Length > 3) _ms = _ms.Substring(0, 3); 113 | // ms = int.Parse(_ms); 114 | //} 115 | } 116 | } 117 | 118 | return new TimeSpan(0, h > 0 ? h : 0, m > 0 ? m : 0, s > 0 ? s : 0, ms > 0 ? ms : 0); 119 | } 120 | catch 121 | { 122 | return new TimeSpan(0, 0, -1); 123 | } 124 | } 125 | 126 | #endregion Methods 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Dialogs/CreateDatabaseDialog.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CymaticLabs.InfluxDB.Studio.Dialogs 2 | { 3 | partial class CreateDatabaseDialog 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CreateDatabaseDialog)); 32 | this.textBox = new System.Windows.Forms.TextBox(); 33 | this.cancelButton = new System.Windows.Forms.Button(); 34 | this.createButton = new System.Windows.Forms.Button(); 35 | this.connectionLabel = new System.Windows.Forms.Label(); 36 | this.SuspendLayout(); 37 | // 38 | // textBox 39 | // 40 | this.textBox.Location = new System.Drawing.Point(12, 43); 41 | this.textBox.Name = "textBox"; 42 | this.textBox.Size = new System.Drawing.Size(309, 20); 43 | this.textBox.TabIndex = 0; 44 | // 45 | // cancelButton 46 | // 47 | this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 48 | this.cancelButton.Location = new System.Drawing.Point(246, 69); 49 | this.cancelButton.Name = "cancelButton"; 50 | this.cancelButton.Size = new System.Drawing.Size(75, 23); 51 | this.cancelButton.TabIndex = 2; 52 | this.cancelButton.Text = "Cancel"; 53 | this.cancelButton.UseVisualStyleBackColor = true; 54 | // 55 | // createButton 56 | // 57 | this.createButton.DialogResult = System.Windows.Forms.DialogResult.OK; 58 | this.createButton.Location = new System.Drawing.Point(165, 69); 59 | this.createButton.Name = "createButton"; 60 | this.createButton.Size = new System.Drawing.Size(75, 23); 61 | this.createButton.TabIndex = 1; 62 | this.createButton.Text = "Create"; 63 | this.createButton.UseVisualStyleBackColor = true; 64 | // 65 | // connectionLabel 66 | // 67 | this.connectionLabel.AutoSize = true; 68 | this.connectionLabel.Location = new System.Drawing.Point(13, 13); 69 | this.connectionLabel.Name = "connectionLabel"; 70 | this.connectionLabel.Size = new System.Drawing.Size(92, 13); 71 | this.connectionLabel.TabIndex = 2; 72 | this.connectionLabel.Text = "Connection Name"; 73 | // 74 | // CreateDatabaseDialog 75 | // 76 | this.AcceptButton = this.createButton; 77 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 78 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 79 | this.CancelButton = this.cancelButton; 80 | this.ClientSize = new System.Drawing.Size(333, 105); 81 | this.ControlBox = false; 82 | this.Controls.Add(this.connectionLabel); 83 | this.Controls.Add(this.createButton); 84 | this.Controls.Add(this.cancelButton); 85 | this.Controls.Add(this.textBox); 86 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; 87 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 88 | this.Name = "CreateDatabaseDialog"; 89 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 90 | this.Text = "Create Database"; 91 | this.ResumeLayout(false); 92 | this.PerformLayout(); 93 | 94 | } 95 | 96 | #endregion 97 | 98 | private System.Windows.Forms.TextBox textBox; 99 | private System.Windows.Forms.Button cancelButton; 100 | private System.Windows.Forms.Button createButton; 101 | private System.Windows.Forms.Label connectionLabel; 102 | } 103 | } -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Dialogs/RetentionPolicyDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using CymaticLabs.InfluxDB.Data; 4 | 5 | namespace CymaticLabs.InfluxDB.Studio.Dialogs 6 | { 7 | /// 8 | /// Dialog used for creating Retention Policies. 9 | /// 10 | public partial class RetentionPolicyDialog : Form 11 | { 12 | #region Fields 13 | 14 | // Whether or not the policy is being created or altered/updated. 15 | bool isCreating = true; 16 | 17 | #endregion Fields 18 | 19 | #region Properties 20 | 21 | /// 22 | /// Gets the policy name value from the dialog. 23 | /// 24 | public string PolicyName 25 | { 26 | get { return nameTextBox.Text; } 27 | } 28 | 29 | /// 30 | /// Gets the policy duration value from the dialog. 31 | /// 32 | public string PolicyDuration 33 | { 34 | get { return durationTextBox.Text; } 35 | } 36 | 37 | /// 38 | /// Gets the policy replication value from the dialog. 39 | /// 40 | public int PolicyReplication 41 | { 42 | get { return (int)replicationNumeric.Value; } 43 | } 44 | 45 | /// 46 | /// Gets the policy "default" flag value from the dialog. 47 | /// 48 | public bool PolicyDefault 49 | { 50 | get { return defaultCheckBox.Checked; } 51 | } 52 | 53 | /// 54 | /// Gets whether or not the policy is being created or altered/updated. 55 | /// 56 | public bool IsCreating 57 | { 58 | get { return isCreating; } 59 | 60 | set 61 | { 62 | isCreating = value; 63 | nameTextBox.ReadOnly = !isCreating; 64 | createButton.Text = isCreating ? "Create" : "Update"; 65 | } 66 | } 67 | 68 | #endregion Properties 69 | 70 | #region Constructors 71 | 72 | public RetentionPolicyDialog() 73 | { 74 | InitializeComponent(); 75 | } 76 | 77 | #endregion Constructors 78 | 79 | #region Event Handlers 80 | 81 | // Handle form load 82 | private void CreateRetentionPolicyDialog_Load(object sender, EventArgs e) 83 | { 84 | // Setup help/info tool tips 85 | durationToolTip.SetToolTip(durationInfo, Properties.Resources.RP_Duration_Info); 86 | } 87 | 88 | // Handle form closing 89 | private void RetentionPolicyDialog_FormClosing(object sender, FormClosingEventArgs e) 90 | { 91 | try 92 | { 93 | // If the user is closing/canceling the form, nothing to do 94 | if (DialogResult != DialogResult.OK) return; 95 | 96 | // Validate values 97 | if (!ValidatePolicyValues()) 98 | { 99 | e.Cancel = true; 100 | return; 101 | } 102 | } 103 | catch (Exception ex) 104 | { 105 | AppForm.DisplayException(ex); 106 | } 107 | } 108 | 109 | #endregion Event Handlers 110 | 111 | #region Methods 112 | 113 | /// 114 | /// Clears out/resets the form's current values. 115 | /// 116 | public void ResetPolicyValues() 117 | { 118 | IsCreating = true; 119 | nameTextBox.Text = null; 120 | durationTextBox.Text = null; 121 | replicationNumeric.Value = 1; 122 | defaultCheckBox.Checked = false; 123 | } 124 | 125 | /// 126 | /// Binds the dialog to the supplied retention policy. 127 | /// 128 | /// The retention policy to bind to. 129 | public void BindToPolicy(InfluxDbRetentionPolicy policy) 130 | { 131 | nameTextBox.ReadOnly = false; 132 | nameTextBox.Text = policy.Name; 133 | durationTextBox.Text = policy.Duration; 134 | replicationNumeric.Value = policy.ReplicationCopies; 135 | defaultCheckBox.Checked = policy.Default; 136 | IsCreating = false; 137 | } 138 | 139 | // Validates the form values 140 | bool ValidatePolicyValues() 141 | { 142 | // Name 143 | if (string.IsNullOrWhiteSpace(nameTextBox.Text)) 144 | { 145 | AppForm.DisplayError("Retention Policy name cannot be blank."); 146 | return false; 147 | } 148 | 149 | // Duration 150 | var duration = durationTextBox.Text; 151 | 152 | if (string.IsNullOrWhiteSpace(duration)) 153 | { 154 | AppForm.DisplayError("Duration cannot be blank. It should be an InfluxDB time interval value such as: 1d, 2h, 10m, 30s, etc."); 155 | return false; 156 | } 157 | 158 | duration = duration.Trim(); 159 | 160 | if (!InfluxDbHelper.IsTimeIntervalValid(duration)) 161 | { 162 | AppForm.DisplayError("Duration value is invalid. It should be an InfluxDB time interval value such as: 1d, 2h, 10m, 30s, etc."); 163 | return false; 164 | } 165 | 166 | return true; 167 | } 168 | 169 | #endregion Methods 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/StatsControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using CymaticLabs.InfluxDB.Data; 11 | 12 | namespace CymaticLabs.InfluxDB.Studio.Controls 13 | { 14 | /// 15 | /// Control that displays InfluxDB server stats. 16 | /// 17 | public partial class StatsControl : RequestControl 18 | { 19 | #region Fields 20 | 21 | #endregion Fields 22 | 23 | #region Properties 24 | 25 | /// 26 | /// Gets the currently selected (if any) statistic name. 27 | /// 28 | public string SelectedStatistic { get; private set; } 29 | 30 | /// 31 | /// Gets the current statistics data for the control. 32 | /// 33 | public InfluxDbStats CurrentStatistics { get; private set; } 34 | 35 | #endregion Properties 36 | 37 | #region Constructors 38 | 39 | public StatsControl() 40 | { 41 | InitializeComponent(); 42 | } 43 | 44 | #endregion Constructors 45 | 46 | #region Event Handlers 47 | 48 | // Handles changes to stat name 49 | private void statsComboBox_SelectedIndexChanged(object sender, EventArgs e) 50 | { 51 | var lastStatistic = SelectedStatistic; 52 | SelectedStatistic = statsComboBox.SelectedItem == null ? null : statsComboBox.SelectedItem.ToString(); 53 | if (lastStatistic != SelectedStatistic) BindSelectedStats(); 54 | } 55 | 56 | #endregion Event Handlers 57 | 58 | #region Methods 59 | 60 | /// 61 | /// Runs the current query against the configured connection and database. 62 | /// 63 | public override async Task ExecuteRequestAsync() 64 | { 65 | if (InfluxDbClient == null) throw new Exception("No InfluxDB client available."); 66 | 67 | // Clear list items 68 | statsComboBox.Items.Clear(); 69 | 70 | // Clear the current results 71 | tabControl.Controls.Clear(); 72 | 73 | // Execute the query 74 | CurrentStatistics = await InfluxDbClient.GetStatsAsync(); 75 | 76 | // Use reflection to dynamically create results 77 | foreach (var pi in CurrentStatistics.GetType().GetProperties()) 78 | { 79 | var value = pi.GetValue(CurrentStatistics); 80 | var statResult = value as IEnumerable; 81 | if (value == null || statResult == null || statResult.Count() == 0) continue; // no results/not supported 82 | statsComboBox.Items.Add(pi.Name); 83 | } 84 | 85 | // Restore selection if one existed 86 | if (!string.IsNullOrWhiteSpace(SelectedStatistic)) 87 | { 88 | for (var i = 0; i < statsComboBox.Items.Count; i++) 89 | { 90 | var item = statsComboBox.Items[i]; 91 | 92 | if (item.ToString() == SelectedStatistic) 93 | { 94 | statsComboBox.SelectedIndex = i; 95 | BindSelectedStats(); 96 | break; 97 | } 98 | } 99 | } 100 | // Otherwise just select the first result 101 | else 102 | { 103 | statsComboBox.SelectedIndex = 0; 104 | } 105 | } 106 | 107 | // Displays the statistic data for the selected statistic 108 | void BindSelectedStats() 109 | { 110 | // Clear current tab list 111 | tabControl.TabPages.Clear(); 112 | 113 | if (string.IsNullOrWhiteSpace(SelectedStatistic) || statsComboBox.SelectedItem == null) return; 114 | IEnumerable statResults = null; 115 | 116 | // Use reflection to get the selected statistic 117 | statResults = (from pi in CurrentStatistics.GetType().GetProperties() 118 | where pi.Name == SelectedStatistic 119 | select pi.GetValue(CurrentStatistics) as IEnumerable).FirstOrDefault(); 120 | 121 | if (statResults == null) return; 122 | 123 | var tabCount = 0; 124 | 125 | // Go through each result data set for the current stat and create tab'd result set. 126 | foreach (var series in statResults) 127 | { 128 | // Create a new tab page to hold the query results control 129 | var tab = new TabPage(string.Format("{0} {1}", series.Name, ++tabCount)); 130 | //var tab = new TabPage(string.Format("{0}", series.Name)); 131 | 132 | // Create a new query results control 133 | var queryResultsControl = new QueryResultsControl(); 134 | queryResultsControl.InfluxDbClient = InfluxDbClient; 135 | //queryResultsControl.Database = Database; 136 | queryResultsControl.Dock = DockStyle.Fill; 137 | tab.Controls.Add(queryResultsControl); 138 | 139 | // Add the tab to the control 140 | tabControl.TabPages.Add(tab); 141 | 142 | // Display result data 143 | queryResultsControl.UpdateResults(series); 144 | } 145 | } 146 | 147 | #endregion Methods 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/QueryControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CymaticLabs.InfluxDB.Studio.Controls 2 | { 3 | partial class QueryControl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.splitContainer1 = new System.Windows.Forms.SplitContainer(); 32 | this.queryEditor = new ScintillaNET.Scintilla(); 33 | this.panel1 = new System.Windows.Forms.Panel(); 34 | this.resultsLabel = new System.Windows.Forms.Label(); 35 | this.tabControl = new System.Windows.Forms.TabControl(); 36 | ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); 37 | this.splitContainer1.Panel1.SuspendLayout(); 38 | this.splitContainer1.Panel2.SuspendLayout(); 39 | this.splitContainer1.SuspendLayout(); 40 | this.panel1.SuspendLayout(); 41 | this.SuspendLayout(); 42 | // 43 | // splitContainer1 44 | // 45 | this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; 46 | this.splitContainer1.Location = new System.Drawing.Point(0, 0); 47 | this.splitContainer1.Name = "splitContainer1"; 48 | this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; 49 | // 50 | // splitContainer1.Panel1 51 | // 52 | this.splitContainer1.Panel1.Controls.Add(this.queryEditor); 53 | this.splitContainer1.Panel1.Controls.Add(this.panel1); 54 | // 55 | // splitContainer1.Panel2 56 | // 57 | this.splitContainer1.Panel2.Controls.Add(this.tabControl); 58 | this.splitContainer1.Size = new System.Drawing.Size(916, 645); 59 | this.splitContainer1.SplitterDistance = 162; 60 | this.splitContainer1.TabIndex = 0; 61 | // 62 | // queryEditor 63 | // 64 | this.queryEditor.Dock = System.Windows.Forms.DockStyle.Fill; 65 | this.queryEditor.Lexer = ScintillaNET.Lexer.Sql; 66 | this.queryEditor.Location = new System.Drawing.Point(0, 0); 67 | this.queryEditor.Name = "queryEditor"; 68 | this.queryEditor.Size = new System.Drawing.Size(916, 128); 69 | this.queryEditor.TabIndex = 0; 70 | // 71 | // panel1 72 | // 73 | this.panel1.Controls.Add(this.resultsLabel); 74 | this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; 75 | this.panel1.Location = new System.Drawing.Point(0, 128); 76 | this.panel1.Name = "panel1"; 77 | this.panel1.Size = new System.Drawing.Size(916, 34); 78 | this.panel1.TabIndex = 0; 79 | // 80 | // resultsLabel 81 | // 82 | this.resultsLabel.AutoSize = true; 83 | this.resultsLabel.Location = new System.Drawing.Point(3, 12); 84 | this.resultsLabel.Name = "resultsLabel"; 85 | this.resultsLabel.Padding = new System.Windows.Forms.Padding(4, 0, 4, 0); 86 | this.resultsLabel.Size = new System.Drawing.Size(45, 13); 87 | this.resultsLabel.TabIndex = 0; 88 | this.resultsLabel.Text = "results"; 89 | // 90 | // tabControl 91 | // 92 | this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill; 93 | this.tabControl.Location = new System.Drawing.Point(0, 0); 94 | this.tabControl.Name = "tabControl"; 95 | this.tabControl.SelectedIndex = 0; 96 | this.tabControl.Size = new System.Drawing.Size(916, 479); 97 | this.tabControl.TabIndex = 1; 98 | // 99 | // QueryControl 100 | // 101 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 102 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 103 | this.Controls.Add(this.splitContainer1); 104 | this.Name = "QueryControl"; 105 | this.Size = new System.Drawing.Size(916, 645); 106 | this.splitContainer1.Panel1.ResumeLayout(false); 107 | this.splitContainer1.Panel2.ResumeLayout(false); 108 | ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); 109 | this.splitContainer1.ResumeLayout(false); 110 | this.panel1.ResumeLayout(false); 111 | this.panel1.PerformLayout(); 112 | this.ResumeLayout(false); 113 | 114 | } 115 | 116 | #endregion 117 | 118 | private System.Windows.Forms.SplitContainer splitContainer1; 119 | private System.Windows.Forms.Panel panel1; 120 | private ScintillaNET.Scintilla queryEditor; 121 | private System.Windows.Forms.Label resultsLabel; 122 | private System.Windows.Forms.TabControl tabControl; 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/RunningQueriesControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using ScintillaNET; 11 | using CymaticLabs.InfluxDB.Data; 12 | 13 | namespace CymaticLabs.InfluxDB.Studio.Controls 14 | { 15 | public partial class RunningQueriesControl : RequestControl 16 | { 17 | #region Fields 18 | 19 | #endregion Fields 20 | 21 | #region Properties 22 | 23 | /// 24 | /// Gets the currently selected running query, if any. 25 | /// 26 | public InfluxDbRunningQuery SelectedQuery { get; private set; } 27 | 28 | #endregion Properties 29 | 30 | #region Constructors 31 | 32 | public RunningQueriesControl() 33 | { 34 | InitializeComponent(); 35 | 36 | // Set query editor styles, InfluxDB is SQL like, so use those 37 | queryEditor.Styles[Style.Sql.Identifier].ForeColor = Color.Blue; 38 | queryEditor.Styles[Style.Sql.String].ForeColor = Color.Red; 39 | queryEditor.Styles[Style.Sql.Number].ForeColor = Color.Magenta; 40 | queryEditor.Styles[Style.Sql.QuotedIdentifier].ForeColor = Color.Red; 41 | } 42 | 43 | #endregion Constructors 44 | 45 | #region Event Handlers 46 | 47 | // Handle query selection change 48 | private void listView_SelectedIndexChanged(object sender, EventArgs e) 49 | { 50 | if (listView.SelectedItems.Count == 0) 51 | { 52 | queryEditor.ReadOnly = false; 53 | queryEditor.Text = null; 54 | queryEditor.ReadOnly = true; 55 | killQueryButton.Enabled = killQueryToolStripMenuItem.Enabled = false; 56 | SelectedQuery = null; 57 | } 58 | else 59 | { 60 | SelectedQuery = (InfluxDbRunningQuery)listView.SelectedItems[0].Tag; 61 | queryEditor.ReadOnly = false; 62 | queryEditor.Text = SelectedQuery.Query; 63 | queryEditor.ReadOnly = true; 64 | killQueryButton.Enabled = killQueryToolStripMenuItem.Enabled = true; 65 | } 66 | } 67 | 68 | // Handle kill query 69 | private async void killQueryButton_Click(object sender, EventArgs e) 70 | { 71 | await KillQuery(); 72 | } 73 | 74 | private async void killQueryToolStripMenuItem_Click(object sender, EventArgs e) 75 | { 76 | await KillQuery(); 77 | } 78 | 79 | #endregion Event Handlers 80 | 81 | #region Methods 82 | 83 | #region Commands 84 | 85 | // Kills the selected query 86 | async Task KillQuery() 87 | { 88 | try 89 | { 90 | if (listView.SelectedItems.Count == 0) return; 91 | var pid = ((InfluxDbRunningQuery)listView.SelectedItems[0].Tag).PID; 92 | var response = await InfluxDbClient.KillQueryAsync(pid); 93 | 94 | if (!response.Success && !response.Body.Contains("query interrupted")) 95 | { 96 | AppForm.DisplayError(response.Body); 97 | } 98 | else 99 | { 100 | listView.BeginUpdate(); 101 | listView.SelectedItems[0].Remove(); 102 | listView.EndUpdate(); 103 | } 104 | 105 | UpdateUIState(); 106 | } 107 | catch (Exception ex) 108 | { 109 | AppForm.DisplayException(ex); 110 | } 111 | } 112 | 113 | #endregion Commands 114 | 115 | #region User Interface 116 | 117 | void UpdateUIState() 118 | { 119 | killQueryButton.Enabled = killQueryToolStripMenuItem.Enabled = listView.SelectedItems.Count > 0; 120 | } 121 | 122 | #endregion User Interface 123 | 124 | public async override Task ExecuteRequestAsync() 125 | { 126 | if (InfluxDbClient == null) throw new Exception("No InfluxDB client available."); 127 | 128 | // Clear current items 129 | listView.Items.Clear(); 130 | 131 | // Start redraw 132 | listView.BeginUpdate(); 133 | 134 | // Query and render 135 | var queries = await InfluxDbClient.GetRunningQueriesAsync(); 136 | 137 | foreach (var q in queries) 138 | { 139 | listView.Items.Add(new ListViewItem(new string[] 140 | { 141 | q.PID.ToString(), 142 | q.Duration, 143 | q.Database.ToString(), 144 | q.Query 145 | }) { Tag = q }); 146 | } 147 | 148 | // Restore selection 149 | if (SelectedQuery != null) 150 | { 151 | var pid = SelectedQuery.PID.ToString(); 152 | 153 | foreach (ListViewItem li in listView.Items) 154 | { 155 | if (li.Text == pid) 156 | { 157 | li.Selected = true; 158 | SelectedQuery = (InfluxDbRunningQuery)li.Tag; 159 | } 160 | } 161 | } 162 | 163 | // Resize each column 164 | //if (listView.Columns.Count > 0) 165 | //{ 166 | // var columnWidth = (Width - 12) / listView.Columns.Count; 167 | // if (columnWidth < 96) columnWidth = 96; 168 | // foreach (ColumnHeader col in listView.Columns) col.Width = columnWidth; 169 | //} 170 | 171 | // Render 172 | listView.EndUpdate(); 173 | 174 | UpdateUIState(); 175 | } 176 | 177 | #endregion Methods 178 | } 179 | } 180 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Dialogs/UserPasswordDialog.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CymaticLabs.InfluxDB.Studio.Dialogs 2 | { 3 | partial class UserPasswordDialog 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UserPasswordDialog)); 32 | this.saveButton = new System.Windows.Forms.Button(); 33 | this.cancelButton = new System.Windows.Forms.Button(); 34 | this.password = new System.Windows.Forms.TextBox(); 35 | this.label1 = new System.Windows.Forms.Label(); 36 | this.usernameValue = new System.Windows.Forms.Label(); 37 | this.usernameLabel = new System.Windows.Forms.Label(); 38 | this.SuspendLayout(); 39 | // 40 | // saveButton 41 | // 42 | this.saveButton.DialogResult = System.Windows.Forms.DialogResult.OK; 43 | this.saveButton.Location = new System.Drawing.Point(180, 71); 44 | this.saveButton.Name = "saveButton"; 45 | this.saveButton.Size = new System.Drawing.Size(75, 23); 46 | this.saveButton.TabIndex = 1; 47 | this.saveButton.Text = "Save"; 48 | this.saveButton.UseVisualStyleBackColor = true; 49 | // 50 | // cancelButton 51 | // 52 | this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 53 | this.cancelButton.Location = new System.Drawing.Point(261, 71); 54 | this.cancelButton.Name = "cancelButton"; 55 | this.cancelButton.Size = new System.Drawing.Size(75, 23); 56 | this.cancelButton.TabIndex = 2; 57 | this.cancelButton.Text = "Cancel"; 58 | this.cancelButton.UseVisualStyleBackColor = true; 59 | // 60 | // password 61 | // 62 | this.password.Location = new System.Drawing.Point(79, 43); 63 | this.password.Name = "password"; 64 | this.password.Size = new System.Drawing.Size(256, 20); 65 | this.password.TabIndex = 0; 66 | this.password.UseSystemPasswordChar = true; 67 | // 68 | // label1 69 | // 70 | this.label1.AutoSize = true; 71 | this.label1.Location = new System.Drawing.Point(12, 46); 72 | this.label1.Name = "label1"; 73 | this.label1.Size = new System.Drawing.Size(56, 13); 74 | this.label1.TabIndex = 10; 75 | this.label1.Text = "Password:"; 76 | // 77 | // usernameValue 78 | // 79 | this.usernameValue.AutoSize = true; 80 | this.usernameValue.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 81 | this.usernameValue.Location = new System.Drawing.Point(76, 17); 82 | this.usernameValue.Name = "usernameValue"; 83 | this.usernameValue.Size = new System.Drawing.Size(11, 13); 84 | this.usernameValue.TabIndex = 11; 85 | this.usernameValue.Text = "-"; 86 | // 87 | // usernameLabel 88 | // 89 | this.usernameLabel.AutoSize = true; 90 | this.usernameLabel.Location = new System.Drawing.Point(12, 17); 91 | this.usernameLabel.Name = "usernameLabel"; 92 | this.usernameLabel.Size = new System.Drawing.Size(32, 13); 93 | this.usernameLabel.TabIndex = 12; 94 | this.usernameLabel.Text = "User:"; 95 | // 96 | // UserPasswordDialog 97 | // 98 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 99 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 100 | this.ClientSize = new System.Drawing.Size(349, 103); 101 | this.ControlBox = false; 102 | this.Controls.Add(this.saveButton); 103 | this.Controls.Add(this.cancelButton); 104 | this.Controls.Add(this.password); 105 | this.Controls.Add(this.label1); 106 | this.Controls.Add(this.usernameValue); 107 | this.Controls.Add(this.usernameLabel); 108 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; 109 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 110 | this.Name = "UserPasswordDialog"; 111 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 112 | this.Text = "Change Password"; 113 | this.ResumeLayout(false); 114 | this.PerformLayout(); 115 | 116 | } 117 | 118 | #endregion 119 | 120 | private System.Windows.Forms.Button saveButton; 121 | private System.Windows.Forms.Button cancelButton; 122 | private System.Windows.Forms.TextBox password; 123 | private System.Windows.Forms.Label label1; 124 | private System.Windows.Forms.Label usernameValue; 125 | private System.Windows.Forms.Label usernameLabel; 126 | } 127 | } -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/QueryControl.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/DiagnosticsControl.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Dialogs/EditUserDialog.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CymaticLabs.InfluxDB.Studio.Dialogs 2 | { 3 | partial class EditUserDialog 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditUserDialog)); 32 | this.saveButton = new System.Windows.Forms.Button(); 33 | this.cancelButton = new System.Windows.Forms.Button(); 34 | this.usernameLabel = new System.Windows.Forms.Label(); 35 | this.usernameValue = new System.Windows.Forms.Label(); 36 | this.adminCheckBox = new System.Windows.Forms.CheckBox(); 37 | this.adminLabel = new System.Windows.Forms.Label(); 38 | this.SuspendLayout(); 39 | // 40 | // saveButton 41 | // 42 | this.saveButton.DialogResult = System.Windows.Forms.DialogResult.OK; 43 | this.saveButton.Location = new System.Drawing.Point(128, 79); 44 | this.saveButton.Name = "saveButton"; 45 | this.saveButton.Size = new System.Drawing.Size(75, 23); 46 | this.saveButton.TabIndex = 8; 47 | this.saveButton.Text = "Save"; 48 | this.saveButton.UseVisualStyleBackColor = true; 49 | // 50 | // cancelButton 51 | // 52 | this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 53 | this.cancelButton.Location = new System.Drawing.Point(209, 79); 54 | this.cancelButton.Name = "cancelButton"; 55 | this.cancelButton.Size = new System.Drawing.Size(75, 23); 56 | this.cancelButton.TabIndex = 9; 57 | this.cancelButton.Text = "Cancel"; 58 | this.cancelButton.UseVisualStyleBackColor = true; 59 | // 60 | // usernameLabel 61 | // 62 | this.usernameLabel.AutoSize = true; 63 | this.usernameLabel.Location = new System.Drawing.Point(12, 17); 64 | this.usernameLabel.Name = "usernameLabel"; 65 | this.usernameLabel.Size = new System.Drawing.Size(38, 13); 66 | this.usernameLabel.TabIndex = 6; 67 | this.usernameLabel.Text = "Name:"; 68 | // 69 | // usernameValue 70 | // 71 | this.usernameValue.AutoSize = true; 72 | this.usernameValue.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 73 | this.usernameValue.Location = new System.Drawing.Point(76, 17); 74 | this.usernameValue.Name = "usernameValue"; 75 | this.usernameValue.Size = new System.Drawing.Size(11, 13); 76 | this.usernameValue.TabIndex = 6; 77 | this.usernameValue.Text = "-"; 78 | // 79 | // adminCheckBox 80 | // 81 | this.adminCheckBox.AutoSize = true; 82 | this.adminCheckBox.Location = new System.Drawing.Point(79, 45); 83 | this.adminCheckBox.Name = "adminCheckBox"; 84 | this.adminCheckBox.Size = new System.Drawing.Size(15, 14); 85 | this.adminCheckBox.TabIndex = 10; 86 | this.adminCheckBox.UseVisualStyleBackColor = true; 87 | // 88 | // adminLabel 89 | // 90 | this.adminLabel.AutoSize = true; 91 | this.adminLabel.Location = new System.Drawing.Point(12, 45); 92 | this.adminLabel.Name = "adminLabel"; 93 | this.adminLabel.Size = new System.Drawing.Size(39, 13); 94 | this.adminLabel.TabIndex = 5; 95 | this.adminLabel.Text = "Admin:"; 96 | // 97 | // EditUserDialog 98 | // 99 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 100 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 101 | this.ClientSize = new System.Drawing.Size(296, 114); 102 | this.ControlBox = false; 103 | this.Controls.Add(this.adminCheckBox); 104 | this.Controls.Add(this.saveButton); 105 | this.Controls.Add(this.cancelButton); 106 | this.Controls.Add(this.adminLabel); 107 | this.Controls.Add(this.usernameValue); 108 | this.Controls.Add(this.usernameLabel); 109 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; 110 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 111 | this.Name = "EditUserDialog"; 112 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 113 | this.Text = "Edit User"; 114 | this.ResumeLayout(false); 115 | this.PerformLayout(); 116 | 117 | } 118 | 119 | #endregion 120 | 121 | private System.Windows.Forms.Button saveButton; 122 | private System.Windows.Forms.Button cancelButton; 123 | private System.Windows.Forms.Label usernameLabel; 124 | private System.Windows.Forms.Label usernameValue; 125 | private System.Windows.Forms.CheckBox adminCheckBox; 126 | private System.Windows.Forms.Label adminLabel; 127 | } 128 | } -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/ExtendedTabControl.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | False 122 | 123 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/StatsControl.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/SeriesControl.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Data/InfluxDbHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | 4 | namespace CymaticLabs.InfluxDB.Data 5 | { 6 | /// 7 | /// Static helper class for InfluxDB-related operations. 8 | /// 9 | public static class InfluxDbHelper 10 | { 11 | #region Fields 12 | 13 | //public const string 14 | 15 | /// 16 | /// The string units for seconds in InfluxDB. 17 | /// 18 | public const string SecondsUnit = "s"; 19 | 20 | /// 21 | /// The string units for milliseconds in InfluxDB. 22 | /// 23 | public const string MillisecondsUnit = "ms"; 24 | 25 | /// 26 | /// The string units for microseconds in InfluxDB. 27 | /// 28 | public const string MicrosecondsUnit = "u"; 29 | 30 | /// 31 | /// Regex used to validate time interval strings: 1h, 15m, 30s, etc. 32 | /// 33 | public static readonly Regex IntervalRegex = new Regex("([0-9\\.]+)(.)"); 34 | 35 | #endregion Fields 36 | 37 | #region Properties 38 | 39 | #endregion Properties 40 | 41 | #region Constructors 42 | 43 | #endregion Constructors 44 | 45 | #region Methods 46 | 47 | /// 48 | /// Determine whether or not an InfluxDB time interval string is valid: 49 | /// "1h", "30m", "15s", etc. 50 | /// 51 | /// The time interval string to validate. 52 | /// True if the string is a valid time interval, False if not. 53 | public static bool IsTimeIntervalValid(string timeInterval) 54 | { 55 | // Null string 56 | if (string.IsNullOrWhiteSpace(timeInterval)) return false; 57 | 58 | // Make sure the leading character is a number 59 | var fc = timeInterval[0]; 60 | 61 | if (fc != '0' && fc != '1' && fc != '2' && fc != '3' && fc != '4' && fc != '5' && fc != '6' && fc != '7' && fc != '8' && fc != '9') 62 | return false; 63 | 64 | // Make sure the last character is a valid time unit character 65 | var lc = timeInterval[timeInterval.Length - 1]; 66 | 67 | if (lc != 's' && lc != 'u' && lc != 'm' && lc != 'h' && lc != 'd' && lc != 'w') 68 | return false; 69 | 70 | // Otherwise parse with regex 71 | var matches = IntervalRegex.Match(timeInterval); 72 | 73 | // We should have just one match 74 | if (matches.Captures.Count != 1) return false; 75 | 76 | // We should have 3 groups: combined match, value match, units match ("10m", "10", "m") 77 | if (matches.Groups.Count != 3) return false; 78 | 79 | // Validate numeric value 80 | var rawValue = matches.Groups[1].Value; 81 | 82 | // Attempt to parse the value 83 | uint value; 84 | if (!uint.TryParse(rawValue, out value)) return false; 85 | 86 | // Validate units 87 | var units = matches.Groups[2].Value; 88 | return ConvertTimeUnit(units) != InfluxDbTimeUnits.None; 89 | } 90 | 91 | /// 92 | /// Converts a string time unit ("s", "m", "h", "d", etc.) into a value. 93 | /// 94 | /// The string unit to convert. 95 | /// Whether or not the method will throw an exception if an invalid unit value is provided. 96 | /// The matching enumeration value. 97 | /// if an invalid value is supplied and 'throwIfInvalid' is false. 98 | public static InfluxDbTimeUnits ConvertTimeUnit(string unit, bool throwIfInvalid = false) 99 | { 100 | if (string.IsNullOrWhiteSpace(unit)) throw new ArgumentNullException("unit"); 101 | 102 | switch (unit.ToLower()) 103 | { 104 | case "u": 105 | return InfluxDbTimeUnits.Microseconds; 106 | 107 | case "ms": 108 | return InfluxDbTimeUnits.Milliseconds; 109 | 110 | case "s": 111 | return InfluxDbTimeUnits.Seconds; 112 | 113 | case "m": 114 | return InfluxDbTimeUnits.Minutes; 115 | 116 | case "h": 117 | return InfluxDbTimeUnits.Hours; 118 | 119 | case "d": 120 | return InfluxDbTimeUnits.Days; 121 | 122 | case "w": 123 | return InfluxDbTimeUnits.Weeks; 124 | } 125 | 126 | // Throw if requested 127 | if (throwIfInvalid) throw new ArgumentException("invalid time unit string: " + unit); 128 | 129 | // Otherwise just return "None" 130 | return InfluxDbTimeUnits.None; 131 | } 132 | 133 | /// 134 | /// Converts a value into its matching InfluxDB time unit string: 135 | /// "m", "s", "h", "d", etc. 136 | /// 137 | /// 138 | /// 139 | public static string ConvertTimeUnit(InfluxDbTimeUnits unit) 140 | { 141 | switch (unit) 142 | { 143 | case InfluxDbTimeUnits.Days: 144 | return "d"; 145 | 146 | case InfluxDbTimeUnits.Hours: 147 | return "h"; 148 | 149 | case InfluxDbTimeUnits.Microseconds: 150 | return "u"; 151 | 152 | case InfluxDbTimeUnits.Milliseconds: 153 | return "ms"; 154 | 155 | case InfluxDbTimeUnits.Minutes: 156 | return "m"; 157 | 158 | case InfluxDbTimeUnits.Seconds: 159 | return "s"; 160 | 161 | case InfluxDbTimeUnits.Weeks: 162 | return "w"; 163 | } 164 | 165 | throw new NotSupportedException("Unsupported time unit value: " + unit.ToString()); 166 | } 167 | 168 | #endregion Methods 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/TagValuesControl.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 295, 17 125 | 126 | -------------------------------------------------------------------------------- /src/CymaticLabs.InfluxDB.Studio/Controls/ContinuousQueryControl.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 115, 17 125 | 126 | --------------------------------------------------------------------------------