/
krasninja
/
querycat
Обзор
Документация
Войти
/
krasninja
/
querycat
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/QueryCat.Cli/Infrastructure/WebServer.Info.cs
24 строки
899 B
Ivan Kozhin
Move js code to file
02 янв 2024, 06:22
02 янв 2024, 06:22
cd68aed
Код
Авторство
О чём код?
using System.Net; using System.Text.Json; using QueryCat.Backend.Core; using QueryCat.Backend.Core.Utils; namespace QueryCat.Cli.Infrastructure; internal partial class WebServer { private void HandleInfoApiAction(HttpListenerRequest request, HttpListenerResponse response) { var localPlugins = AsyncUtils.RunSync(async ct => await _executionThread.PluginsManager.ListAsync(localOnly: true, ct))!.ToList(); var dict = new WebServerReply { ["installedPlugins"] = localPlugins, ["version"] = Application.GetVersion(), ["os"] = System.Runtime.InteropServices.RuntimeInformation.OSDescription.Trim(), ["platform"] = Environment.Version, ["date"] = DateTimeOffset.Now, }; JsonSerializer.Serialize(response.OutputStream, dict, SourceGenerationContext.Default.WebServerReply); } }