diff --git a/LANCommander.Server/UI/Pages/Settings/Scripts.razor b/LANCommander.Server/UI/Pages/Settings/Scripts.razor index 18192ed1..673393d0 100644 --- a/LANCommander.Server/UI/Pages/Settings/Scripts.razor +++ b/LANCommander.Server/UI/Pages/Settings/Scripts.razor @@ -16,12 +16,15 @@
+ + + - + - + Hours @@ -33,6 +36,8 @@ @code { + string RootPath = Path.GetPathRoot(Directory.GetCurrentDirectory()); + void Save() { try @@ -50,4 +55,14 @@ Logger.LogError(ex, "An unknown error occurred."); } } + + void OnPathSelected(string path) + { + var appPath = Directory.GetCurrentDirectory(); + + if (path != null && path.StartsWith(appPath)) + path = path.Substring(appPath.Length).TrimStart(Path.DirectorySeparatorChar).TrimEnd(Path.DirectorySeparatorChar); + + Settings.Value.Server.Scripts.Snippets.StoragePath = path; + } } \ No newline at end of file