1.0.0.0824d1

Former-commit-id: 5d07a107ccac442857998d0831862729f7c918a6
Former-commit-id: 9bd256f8bec365f0eb936f170d87168daff857b8
TSXN
wanggang 5 years ago
parent b257395d65
commit 70f343297a

@ -0,0 +1,50 @@
using Infrastructure.Extensions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace IoTCenter.Api
{
[ApiVersion("1.0")]
[Route("api/v{version:apiVersion}/[controller]/[action]")]
[ApiController]
public class InfluxController : ControllerBase
{
private readonly IConfiguration _cfg;
private readonly IHttpClientFactory _httpClientFactory;
public InfluxController(IConfiguration cfg, IHttpClientFactory httpClientFactory)
{
this._cfg = cfg;
this._httpClientFactory = httpClientFactory;
}
[HttpPost]
[Produces("application/json")]
public async Task<string> Query()
{
var server = this._cfg["influxdb:url"];
var url = $"{server}/query";
var data = new Dictionary<string, string>();
foreach (var item in this.Request.Form)
{
try
{
data.Add(item.Key, Encoding.UTF8.GetString(Convert.FromBase64String(item.Value.ToString())));
}
catch (Exception ex)
{
ex.PrintStack();
data.Add(item.Key, item.Value.ToString());
}
}
using var content = new FormUrlEncodedContent(data);
var client = _httpClientFactory.CreateClient();
return await client.PostAsync(url, content).Result.Content.ReadAsStringAsync();
}
}
}

@ -1,4 +1,4 @@
using System.Reflection;
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0821d2")]
[assembly: AssemblyInformationalVersion("1.0.0.0824d1")]

@ -319,7 +319,7 @@
</a>
</li>
<li class="nav-item">
<a class="nav-link" target="_blank" href="/influxdbui/">
<a class="nav-link" target="_blank" href="/influxui/">
<i class="far fa-circle nav-icon"></i>
<p>
influxdb

@ -75,7 +75,7 @@ http {
proxy_pass http://172.172.0.102/;
}
location ^~ /influxdbui/ {
location ^~ /influxui/ {
proxy_pass http://172.172.0.104:8083/;
}

@ -75,7 +75,7 @@ http {
proxy_pass http://host.docker.internal:9003/;
}
location ^~ /influxdbui/ {
location ^~ /influxui/ {
proxy_pass http://host.docker.internal:8083/;
}

@ -31,7 +31,7 @@ http {
index index.html;
}
location ~* ^/(dfs|live|video|influxdb|UserCenter|IoTCenter|JobServer|portainer|minio|mysqlui|influxdbui|phpredisadmin|srs)/ {
location ~* ^/(dfs|live|video|influxdb|UserCenter|IoTCenter|JobServer|portainer|minio|mysqlui|influxui|phpredisadmin|srs)/ {
proxy_pass http://gateway;
}

@ -1 +1 @@
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up --remove-orphans -d
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up --remove-orphans --force-recreate -d
Loading…
Cancel
Save