Merge branch 'main' of https://git.innov.energy/Innovenergy/git_trunk
This commit is contained in:
commit
6bf6399ed2
|
@ -317,7 +317,7 @@ public class Controller : ControllerBase
|
||||||
var session = Db.GetSession(authToken);
|
var session = Db.GetSession(authToken);
|
||||||
|
|
||||||
// TODO: automatic BadRequest when properties are null during deserialization
|
// TODO: automatic BadRequest when properties are null during deserialization
|
||||||
var installation = Db.GetFolderById(installationAccess.InstallationId);
|
var installation = Db.GetInstallationById(installationAccess.InstallationId);
|
||||||
var user = Db.GetUserById(installationAccess.UserId);
|
var user = Db.GetUserById(installationAccess.UserId);
|
||||||
|
|
||||||
return session.GrantUserAccessTo(user, installation)
|
return session.GrantUserAccessTo(user, installation)
|
||||||
|
|
|
@ -52,14 +52,13 @@ public static class ExoCmd
|
||||||
//return $"{key};{secret}";
|
//return $"{key};{secret}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async void RevokeReadKey(this Installation installation)
|
public static async Task RevokeReadKey(this Installation installation)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await Exo
|
await Exo
|
||||||
.WithArguments("iam access-key revoke " + installation.S3Key + " -f " + " -C " + ConfigFile)
|
.WithArguments("iam access-key revoke " + installation.S3Key + " -f " + " -C " + ConfigFile)
|
||||||
.ExecuteAsync();
|
.ExecuteAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,7 +16,8 @@ public static class InstallationMethods
|
||||||
|
|
||||||
public static async Task<Boolean> RenewS3Credentials(this Installation installation)
|
public static async Task<Boolean> RenewS3Credentials(this Installation installation)
|
||||||
{
|
{
|
||||||
installation.RevokeReadKey();
|
if(installation.S3Key != "") await installation.RevokeReadKey();
|
||||||
|
|
||||||
var (key, secret) = await installation.CreateReadKey();
|
var (key, secret) = await installation.CreateReadKey();
|
||||||
|
|
||||||
if (installation.S3WriteKey == "" || installation.S3WriteSecret == "")
|
if (installation.S3WriteKey == "" || installation.S3WriteSecret == "")
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace InnovEnergy.App.Backend.Database;
|
||||||
|
|
||||||
public static partial class Db
|
public static partial class Db
|
||||||
{
|
{
|
||||||
internal const String DbPath = "./db.sqlite";
|
// internal const String DbPath = "./db.sqlite";
|
||||||
|
|
||||||
private static SQLiteConnection Connection { get; } = ((Func<SQLiteConnection>)(() =>
|
private static SQLiteConnection Connection { get; } = ((Func<SQLiteConnection>)(() =>
|
||||||
{
|
{
|
||||||
|
@ -169,7 +169,7 @@ public static partial class Db
|
||||||
|
|
||||||
private static void DeleteStaleSessions()
|
private static void DeleteStaleSessions()
|
||||||
{
|
{
|
||||||
var deadline = DateTime.Now - Session.MaxAge;
|
var deadline = DateTime.Now.AddDays((-1)*Session.MaxAge.Days);
|
||||||
Sessions.Delete(s => s.LastSeen < deadline);
|
Sessions.Delete(s => s.LastSeen < deadline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ public static class SnakeGameSs
|
||||||
{
|
{
|
||||||
public static async Task PlaySnake()
|
public static async Task PlaySnake()
|
||||||
{
|
{
|
||||||
var tickRate = TimeSpan.FromMilliseconds(100);
|
var tickRate = TimeSpan.FromMilliseconds(90);
|
||||||
var snakeGame = new SnakeGame();
|
var snakeGame = new SnakeGame();
|
||||||
|
|
||||||
using (var cts = new CancellationTokenSource())
|
using (var cts = new CancellationTokenSource())
|
||||||
|
@ -86,7 +86,7 @@ public static class SnakeGameSs
|
||||||
public void Render()
|
public void Render()
|
||||||
{
|
{
|
||||||
Console.SetCursorPosition(Position.Left, Position.Top);
|
Console.SetCursorPosition(Position.Left, Position.Top);
|
||||||
Console.Write("🍏");
|
Console.Write("🐜");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,8 +272,8 @@ public static class SnakeGameSs
|
||||||
const int numberOfColumns = 20;
|
const int numberOfColumns = 20;
|
||||||
|
|
||||||
var random = new Random();
|
var random = new Random();
|
||||||
var top = random.Next(0, numberOfRows + 1);
|
var top = random.Next(1, numberOfRows);
|
||||||
var left = random.Next(0, numberOfColumns + 1);
|
var left = random.Next(1, numberOfColumns);
|
||||||
var position = new Position(top, left);
|
var position = new Position(top, left);
|
||||||
var apple = new Apple(position);
|
var apple = new Apple(position);
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
export const axiosConfigWithoutToken = axios.create({
|
export const axiosConfigWithoutToken = axios.create({
|
||||||
baseURL: "https://localhost:7087/api",
|
baseURL: "https://monitor.innov.energy/api",
|
||||||
});
|
});
|
||||||
|
|
||||||
const axiosConfig = axios.create({
|
const axiosConfig = axios.create({
|
||||||
baseURL: "https://localhost:7087/api",
|
baseURL: "https://monitor.innov.energy/api",
|
||||||
});
|
});
|
||||||
|
|
||||||
axiosConfig.defaults.params = {};
|
axiosConfig.defaults.params = {};
|
||||||
axiosConfig.interceptors.request.use(
|
axiosConfig.interceptors.request.use(
|
||||||
(config) => {
|
(config) => {
|
||||||
|
|
Loading…
Reference in New Issue