add projects
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 13s

This commit is contained in:
2026-03-18 15:37:59 +03:00
parent ed55e77e98
commit bf51924adb
158 changed files with 82479 additions and 1 deletions
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\AspireApp1.ServiceDefaults\AspireApp1.ServiceDefaults.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,39 @@
var builder = WebApplication.CreateBuilder(args);
// Add service defaults & Aspire components.
builder.AddServiceDefaults();
// Add services to the container.
builder.Services.AddProblemDetails();
var app = builder.Build();
// Configure the HTTP request pipeline.
app.UseExceptionHandler();
var summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
app.MapGet("/weatherforecast", () =>
{
var forecast = Enumerable.Range(1, 5).Select(index =>
new WeatherForecast
(
DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
Random.Shared.Next(-20, 55),
summaries[Random.Shared.Next(summaries.Length)]
))
.ToArray();
return forecast;
});
app.MapDefaultEndpoints();
app.Run();
record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
{
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
@@ -0,0 +1,25 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "weatherforecast",
"applicationUrl": "http://localhost:5591",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "weatherforecast",
"applicationUrl": "https://localhost:7393;http://localhost:5591",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireHost>true</IsAspireHost>
<UserSecretsId>3f9766cb-c165-44c4-8148-a83f07561b0f</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\AspireApp1.ApiService\AspireApp1.ApiService.csproj" />
<ProjectReference Include="..\AspireApp1.Web\AspireApp1.Web.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost" Version="8.0.0" />
<PackageReference Include="Aspire.Hosting.Redis" Version="8.0.0" />
</ItemGroup>
</Project>
+12
View File
@@ -0,0 +1,12 @@
var builder = DistributedApplication.CreateBuilder(args);
var cache = builder.AddRedis("cache");
var apiService = builder.AddProject<Projects.AspireApp1_ApiService>("apiservice");
builder.AddProject<Projects.AspireApp1_Web>("webfrontend")
.WithExternalHttpEndpoints()
.WithReference(cache)
.WithReference(apiService);
builder.Build().Run();
@@ -0,0 +1,29 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:17052;http://localhost:15100",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21236",
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22278"
}
},
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:15100",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19111",
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20146"
}
}
}
}
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Aspire.Hosting.Dcp": "Warning"
}
}
}
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireSharedProject>true</IsAspireSharedProject>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.3.0" />
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="8.0.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.8.0" />
</ItemGroup>
</Project>
@@ -0,0 +1,111 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Logging;
using OpenTelemetry;
using OpenTelemetry.Metrics;
using OpenTelemetry.Trace;
namespace Microsoft.Extensions.Hosting;
// Adds common .NET Aspire services: service discovery, resilience, health checks, and OpenTelemetry.
// This project should be referenced by each service project in your solution.
// To learn more about using this project, see https://aka.ms/dotnet/aspire/service-defaults
public static class Extensions
{
public static IHostApplicationBuilder AddServiceDefaults(this IHostApplicationBuilder builder)
{
builder.ConfigureOpenTelemetry();
builder.AddDefaultHealthChecks();
builder.Services.AddServiceDiscovery();
builder.Services.ConfigureHttpClientDefaults(http =>
{
// Turn on resilience by default
http.AddStandardResilienceHandler();
// Turn on service discovery by default
http.AddServiceDiscovery();
});
return builder;
}
public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicationBuilder builder)
{
builder.Logging.AddOpenTelemetry(logging =>
{
logging.IncludeFormattedMessage = true;
logging.IncludeScopes = true;
});
builder.Services.AddOpenTelemetry()
.WithMetrics(metrics =>
{
metrics.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddRuntimeInstrumentation();
})
.WithTracing(tracing =>
{
tracing.AddAspNetCoreInstrumentation()
// Uncomment the following line to enable gRPC instrumentation (requires the OpenTelemetry.Instrumentation.GrpcNetClient package)
//.AddGrpcClientInstrumentation()
.AddHttpClientInstrumentation();
});
builder.AddOpenTelemetryExporters();
return builder;
}
private static IHostApplicationBuilder AddOpenTelemetryExporters(this IHostApplicationBuilder builder)
{
var useOtlpExporter = !string.IsNullOrWhiteSpace(builder.Configuration["OTEL_EXPORTER_OTLP_ENDPOINT"]);
if (useOtlpExporter)
{
builder.Services.AddOpenTelemetry().UseOtlpExporter();
}
// Uncomment the following lines to enable the Azure Monitor exporter (requires the Azure.Monitor.OpenTelemetry.AspNetCore package)
//if (!string.IsNullOrEmpty(builder.Configuration["APPLICATIONINSIGHTS_CONNECTION_STRING"]))
//{
// builder.Services.AddOpenTelemetry()
// .UseAzureMonitor();
//}
return builder;
}
public static IHostApplicationBuilder AddDefaultHealthChecks(this IHostApplicationBuilder builder)
{
builder.Services.AddHealthChecks()
// Add a default liveness check to ensure app is responsive
.AddCheck("self", () => HealthCheckResult.Healthy(), ["live"]);
return builder;
}
public static WebApplication MapDefaultEndpoints(this WebApplication app)
{
// Adding health checks endpoints to applications in non-development environments has security implications.
// See https://aka.ms/dotnet/aspire/healthchecks for details before enabling these endpoints in non-development environments.
if (app.Environment.IsDevelopment())
{
// All health checks must pass for app to be considered ready to accept traffic after starting
app.MapHealthChecks("/health");
// Only health checks tagged with the "live" tag must pass for app to be considered alive
app.MapHealthChecks("/alive", new HealthCheckOptions
{
Predicate = r => r.Tags.Contains("live")
});
}
return app;
}
}
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Aspire.Hosting.Testing" Version="8.0.0" />
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AspireApp1.AppHost\AspireApp1.AppHost.csproj" />
</ItemGroup>
<ItemGroup>
<Using Include="Aspire.Hosting.Testing" />
<Using Include="Xunit" />
</ItemGroup>
</Project>
+22
View File
@@ -0,0 +1,22 @@
using System.Net;
namespace AspireApp1.Tests;
public class WebTests
{
[Fact]
public async Task GetWebResourceRootReturnsOkStatusCode()
{
// Arrange
var appHost = await DistributedApplicationTestingBuilder.CreateAsync<Projects.AspireApp1_AppHost>();
await using var app = await appHost.BuildAsync();
await app.StartAsync();
// Act
var httpClient = app.CreateHttpClient("webfrontend");
var response = await httpClient.GetAsync("/");
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
}
}
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\AspireApp1.ServiceDefaults\AspireApp1.ServiceDefaults.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Aspire.StackExchange.Redis.OutputCaching" Version="8.0.0" />
</ItemGroup>
</Project>
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="/" />
<link rel="stylesheet" href="bootstrap/bootstrap.min.css" />
<link rel="stylesheet" href="app.css" />
<link rel="stylesheet" href="AspireApp1.Web.styles.css" />
<link rel="icon" type="image/png" href="favicon.png" />
<HeadOutlet />
</head>
<body>
<Routes />
<script src="_framework/blazor.web.js"></script>
</body>
</html>
@@ -0,0 +1,23 @@
@inherits LayoutComponentBase
<div class="page">
<div class="sidebar">
<NavMenu />
</div>
<main>
<div class="top-row px-4">
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
</div>
<article class="content px-4">
@Body
</article>
</main>
</div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
@@ -0,0 +1,96 @@
.page {
position: relative;
display: flex;
flex-direction: column;
}
main {
flex: 1;
}
.sidebar {
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}
.top-row {
background-color: #f7f7f7;
border-bottom: 1px solid #d6d5d5;
justify-content: flex-end;
height: 3.5rem;
display: flex;
align-items: center;
}
.top-row ::deep a, .top-row ::deep .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
text-decoration: none;
}
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
text-decoration: underline;
}
.top-row ::deep a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}
@media (max-width: 640.98px) {
.top-row {
justify-content: space-between;
}
.top-row ::deep a, .top-row ::deep .btn-link {
margin-left: 0;
}
}
@media (min-width: 641px) {
.page {
flex-direction: row;
}
.sidebar {
width: 250px;
height: 100vh;
position: sticky;
top: 0;
}
.top-row {
position: sticky;
top: 0;
z-index: 1;
}
.top-row.auth ::deep a:first-child {
flex: 1;
text-align: right;
width: 0;
}
.top-row, article {
padding-left: 2rem !important;
padding-right: 1.5rem !important;
}
}
#blazor-error-ui {
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
display: none;
left: 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;
}
#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
top: 0.5rem;
}
@@ -0,0 +1,29 @@
<div class="top-row ps-3 navbar navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="">AspireApp1</a>
</div>
</div>
<input type="checkbox" title="Navigation menu" class="navbar-toggler" />
<div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
<nav class="flex-column">
<div class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<span class="bi bi-house-door-fill" aria-hidden="true"></span> Home
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="counter">
<span class="bi bi-plus-square-fill" aria-hidden="true"></span> Counter
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="weather">
<span class="bi bi-list-nested" aria-hidden="true"></span> Weather
</NavLink>
</div>
</nav>
</div>
@@ -0,0 +1,102 @@
.navbar-toggler {
appearance: none;
cursor: pointer;
width: 3.5rem;
height: 2.5rem;
color: white;
position: absolute;
top: 0.5rem;
right: 1rem;
border: 1px solid rgba(255, 255, 255, 0.1);
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
}
.navbar-toggler:checked {
background-color: rgba(255, 255, 255, 0.5);
}
.top-row {
height: 3.5rem;
background-color: rgba(0,0,0,0.4);
}
.navbar-brand {
font-size: 1.1rem;
}
.bi {
display: inline-block;
position: relative;
width: 1.25rem;
height: 1.25rem;
margin-right: 0.75rem;
top: -1px;
background-size: cover;
}
.bi-house-door-fill {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E");
}
.bi-plus-square-fill {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E");
}
.bi-list-nested {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
}
.nav-item {
font-size: 0.9rem;
padding-bottom: 0.5rem;
}
.nav-item:first-of-type {
padding-top: 1rem;
}
.nav-item:last-of-type {
padding-bottom: 1rem;
}
.nav-item ::deep a {
color: #d7d7d7;
border-radius: 4px;
height: 3rem;
display: flex;
align-items: center;
line-height: 3rem;
}
.nav-item ::deep a.active {
background-color: rgba(255,255,255,0.37);
color: white;
}
.nav-item ::deep a:hover {
background-color: rgba(255,255,255,0.1);
color: white;
}
.nav-scrollable {
display: none;
}
.navbar-toggler:checked ~ .nav-scrollable {
display: block;
}
@media (min-width: 641px) {
.navbar-toggler {
display: none;
}
.nav-scrollable {
/* Never collapse the sidebar for wide screens */
display: block;
/* Allow sidebar to scroll for tall menus */
height: calc(100vh - 3.5rem);
overflow-y: auto;
}
}
@@ -0,0 +1,19 @@
@page "/counter"
@rendermode InteractiveServer
<PageTitle>Counter</PageTitle>
<h1>Counter</h1>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
}
@@ -0,0 +1,38 @@
@page "/Error"
@using System.Diagnostics
<PageTitle>Error</PageTitle>
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@requestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
@code{
[CascadingParameter]
public HttpContext? HttpContext { get; set; }
private string? requestId;
private bool ShowRequestId => !string.IsNullOrEmpty(requestId);
protected override void OnInitialized()
{
requestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
}
}
@@ -0,0 +1,7 @@
@page "/"
<PageTitle>Home</PageTitle>
<h1>Hello, world!</h1>
Welcome to your new app.
@@ -0,0 +1,49 @@
@page "/weather"
@attribute [StreamRendering(true)]
@attribute [OutputCache(Duration = 5)]
@inject WeatherApiClient WeatherApi
<PageTitle>Weather</PageTitle>
<h1>Weather</h1>
<p>This component demonstrates showing data loaded from a backend API service.</p>
@if (forecasts == null)
{
<p><em>Loading...</em></p>
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
}
@code {
private WeatherForecast[]? forecasts;
protected override async Task OnInitializedAsync()
{
forecasts = await WeatherApi.GetWeatherAsync();
}
}
@@ -0,0 +1,6 @@
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
</Router>
@@ -0,0 +1,11 @@
@using System.Net.Http
@using System.Net.Http.Json
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.AspNetCore.OutputCaching
@using Microsoft.JSInterop
@using AspireApp1.Web
@using AspireApp1.Web.Components
+42
View File
@@ -0,0 +1,42 @@
using AspireApp1.Web;
using AspireApp1.Web.Components;
var builder = WebApplication.CreateBuilder(args);
// Add service defaults & Aspire components.
builder.AddServiceDefaults();
builder.AddRedisOutputCache("cache");
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.Services.AddHttpClient<WeatherApiClient>(client =>
{
// This URL uses "https+http://" to indicate HTTPS is preferred over HTTP.
// Learn more about service discovery scheme resolution at https://aka.ms/dotnet/sdschemes.
client.BaseAddress = new("https+http://apiservice");
});
var app = builder.Build();
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error", createScopeForErrors: true);
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseAntiforgery();
app.UseOutputCache();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.MapDefaultEndpoints();
app.Run();
@@ -0,0 +1,23 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5164",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7290;http://localhost:5164",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
@@ -0,0 +1,29 @@
namespace AspireApp1.Web;
public class WeatherApiClient(HttpClient httpClient)
{
public async Task<WeatherForecast[]> GetWeatherAsync(int maxItems = 10, CancellationToken cancellationToken = default)
{
List<WeatherForecast>? forecasts = null;
await foreach (var forecast in httpClient.GetFromJsonAsAsyncEnumerable<WeatherForecast>("/weatherforecast", cancellationToken))
{
if (forecasts?.Count >= maxItems)
{
break;
}
if (forecast is not null)
{
forecasts ??= [];
forecasts.Add(forecast);
}
}
return forecasts?.ToArray() ?? [];
}
}
public record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
{
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
+25
View File
@@ -0,0 +1,25 @@
h1:focus {
outline: none;
}
.valid.modified:not([type=checkbox]) {
outline: 1px solid #26b050;
}
.invalid {
outline: 1px solid #e51640;
}
.validation-message {
color: #e51640;
}
.blazor-error-boundary {
background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
padding: 1rem 1rem 1rem 3.7rem;
color: white;
}
.blazor-error-boundary::after {
content: "An error has occurred."
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+23
View File
@@ -0,0 +1,23 @@
using LC_AddCheckToDb.Models;
using Microsoft.EntityFrameworkCore;
namespace LC_AddCheckToDb;
public partial class Db : DbContext
{
public Db() => Database.EnsureCreated();
public virtual DbSet<Error> Error { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
//optionsBuilder.UseNpgsql("Host=172.24.12.201;Port=5432;Database=Notifications;Username=postgres;Password=4NUDZhJ7");
optionsBuilder.UseSqlite("Data Source=C:\\Users\\mastankov\\Desktop\\ForMonitoring\\Soft\\LC_Api\\Error.db");
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}
+15
View File
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.5" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
</ItemGroup>
</Project>
+24
View File
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LC_AddCheckToDb.Models
{
internal class Cams
{
public string Id { get; set; }
public string Type { get; set; }
public string Ip { get; set; }
public string Access { get; set; }
public string ImgUrl { get; set; }
public string RecPoint { get; set; }
public string ChannelRec { get; set; }
public string SwitchConnect { get; set; }
public string SwitchPort { get; set; }
public string Name { get; set; }
public string Groupe { get; set; }
}
}
+34
View File
@@ -0,0 +1,34 @@
using System.ComponentModel.DataAnnotations;
using System.Reflection.Metadata;
namespace LC_AddCheckToDb.Models
{
public class Error
{
[Key]
public int Id { get; set; }
public typeDev TypeDev { get; set; }
public int? MsgId { get; set; }
public statusDev? Status { get; set; }
public string? Name { get; set; }
public string? Ip { get; set; }
public DateTime? DataError { get; set; }
}
public enum typeDev
{
Unknown = 0,
Camera,
SABRA,
vServer,
Server,
Switch,
DVR,
ARM
}
public enum statusDev
{
Off = 0,
On,
Unknown
}
}
+96
View File
@@ -0,0 +1,96 @@
using LC_AddCheckToDb.Models;
using Microsoft.VisualBasic.FileIO;
namespace LC_AddCheckToDb.Models
{
internal class Program
{
#if DEBUG
private static void Main()
{
string[] args = ["172.24.12.211", "неактивен"];
#else
private static void Main(string[] args)
{
if (args.Length == 0)
return;
#endif
List<Error> _error = new List<Error>();
using (var db = new Db())
{
var status = statusDev.Unknown;
var ip = args[0].Trim();
if (args[1].Trim().Contains("не"))
{
status = 0;
using (TextFieldParser parser = new TextFieldParser("spb_devices.csv"))
{
parser.TextFieldType = FieldType.Delimited;
parser.SetDelimiters(";");
while (!parser.EndOfData)
{
string[] fields = parser.ReadFields();
typeDev _type;
switch (fields[0])
{
case "Camera":
_type = typeDev.Camera;
break;
case "SABRA":
_type = typeDev.SABRA;
break;
case "vServer":
_type = typeDev.vServer;
break;
case "Server":
_type = typeDev.Server;
break;
case "Switch":
_type = typeDev.Switch;
break;
case "DVR":
_type = typeDev.DVR;
break;
case "ARM":
_type = typeDev.ARM;
break;
default:
_type = typeDev.Unknown;
break;
}
var I = new Error()
{
Id = 0,
Status = statusDev.On,
Name = fields[3],
Ip = fields[1],
MsgId = 0,
TypeDev = _type,
DataError = DateTime.Now.ToUniversalTime()
};
_error.Add(I);
}
}
var dev = _error.Where(d => d.Ip == args[0]).First();
dev.Status = status;
db.Error.Add(dev);
db.SaveChanges();
}
else
{
status = statusDev.On;
var dev = db.Error.Where(d => d.Ip == args[0] && d.Status == statusDev.Off).FirstOrDefault();
if (dev != null)
{
dev.Status = status;
db.Error.Update(dev);
db.SaveChanges();
}
}
}
Console.WriteLine("0");
}
}
}
+13
View File
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "8.0.5",
"commands": [
"dotnet-ef"
],
"rollForward": false
}
}
}
+21
View File
@@ -0,0 +1,21 @@
using System.ComponentModel.DataAnnotations;
namespace LC_Api
{
public class Cam
{
[Key]
public string? Id { get; set; }
public string? Type { get; set; }
public string? Ip { get; set; }
public string? Access { get; set; }
public string? ImgUrl { get; set; }
public string? RecPoint { get; set; }
public string? ChannelRec { get; set; }
public string? SwitchConnect { get; set; }
public string? SwitchPort { get; set; }
public string? Name { get; set; }
public string? Map { get; set; }
}
}
+24
View File
@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore;
namespace LC_Api;
public partial class Db : DbContext
{
public Db() => Database.EnsureCreated();
public virtual DbSet<Error> Errors { get; set; }
public virtual DbSet<Cam> Cams { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
//optionsBuilder.UseNpgsql("Host=172.24.12.201;Port=5432;Database=Notifications;Username=postgres;Password=4NUDZhJ7");
optionsBuilder.UseSqlite("Data Source=Error.db");
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}
+34
View File
@@ -0,0 +1,34 @@
using System.ComponentModel.DataAnnotations;
namespace LC_Api
{
public class Error
{
[Key]
public Guid Id { get; set; }
public string? TypeDev { get; set; }
public int MsgId { get; set; }
public string? Status { get; set; }
public string? Name { get; set; }
public string? Ip { get; set; }
public string? Map { get; set; }
public DateTime? DataError { get; set; }
}
public enum typeDev
{
Unknown = 0,
Camera,
SABRA,
vServer,
Server,
Switch,
DVR,
ARM
}
public enum statusDev
{
Off = 0,
On,
Unknown
}
}
BIN
View File
Binary file not shown.
Binary file not shown.
+17
View File
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.6" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
<PackageReference Include="Telegram.Bot" Version="19.0.0" />
</ItemGroup>
</Project>
+6
View File
@@ -0,0 +1,6 @@
@LC_Api_HostAddress = http://localhost:5224
GET {{LC_Api_HostAddress}}/weatherforecast/
Accept: application/json
###
+176
View File
@@ -0,0 +1,176 @@
using Telegram.Bot;
using Telegram.Bot.Exceptions;
using Telegram.Bot.Polling;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;
using System.Text.Json;
using Telegram.Bot.Types.ReplyMarkups;
namespace LC_Api
{
public class Program
{
public static string token = "7055214362:AAFL1aroXt1S00pACH6jMs7OiNQtmK8pI_Y";
public static TelegramBotClient botClient = null;
public static void Main(string[] args)
{
botClient = new TelegramBotClient(token);
using CancellationTokenSource cts = new();
var builder = WebApplication.CreateBuilder(args);
using var db = new Db();
builder.Services.AddAuthorization();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseAuthorization();
app.MapGet("/", () => "status:ok");
app.MapGet("/error", () =>
{
var re = db.Errors.ToList();
if (re.Count > 0)
{
return re;
}
return null;
});
app.MapGet("/error/{countDay}", (int countDay) =>
{
DateTime d = DateTime.Now.AddDays(-countDay);
List<Error> re;
switch (countDay)
{
case 0:
re = db.Errors.Where(e => e.DataError == DateTime.Now).ToList();
break;
case 3:
re = db.Errors.Where(e => e.DataError <= DateTime.Now && e.DataError > d).ToList();
break;
case 7:
re = db.Errors.Where(e => e.DataError <= DateTime.Now && e.DataError > d).ToList();
break;
default:
re = new List<Error>();
break;
}
//var data = content.Content.ToString();
//var er = JsonSerializer.Deserialize<Error>(content);
//db.Error.Add(content);
//db.SaveChanges();
return re;
});
app.MapPost("/error", async (Error content) =>
{
var txt = string.Empty;
content.DataError = DateTime.Now;
InlineKeyboardMarkup inlineKeyboard = new(new[]
{
new []
{
InlineKeyboardButton.WithCallbackData(text: "Перезагрузить", callbackData: $"reboot|{content.Ip}")
}
});
if (content.Status == "off")
{
txt = "<b>‼ НЕИСПРАВНОСТЬ ‼</b>\n" +
$"----------------------------------------------\n" +
$"<b>Объект:</b> {content.Map}\n" +
$"<b>Устройство:</b> {content.TypeDev}\n" +
$"<b>Имя:</b> {content.Name}\n" +
$"<b>Адрес:</b> {content.Ip}\n" +
$"<b>Состояние:</b> 🔴 - не доступна\n" +
$"----------------------------------------------";
var msgId = botClient.SendTextMessageAsync(chatId: 6882856105, parseMode: ParseMode.Html, replyMarkup: inlineKeyboard, text: txt).Result.MessageId;
content.MsgId = msgId;
db.Errors.Add(content);
db.SaveChanges();
}
else if (content.Status == "error")
{
var re = db.Errors.SingleOrDefault(e => e.Ip == content.Ip && e.Status == "off");
if (re != null)
{
re.Status = "error";
re.DataError = content.DataError;
txt = "<b>⚠ ВНИМАНИЕ ⚠</b>\n" +
$"----------------------------------------------\n" +
$"<b>Объект:</b> {content.Map}\n" +
$"<b>Устройство:</b> {content.TypeDev}\n" +
$"<b>Имя:</b> {content.Name}\n" +
$"<b>Адрес:</b> {content.Ip}\n" +
$"<b>Состояние:</b> 🟡 - ошибка\n" +
$"----------------------------------------------";
//var mi = Convert.ToInt32(re.MsgId);
//await botClient.DeleteMessageAsync(6882856105, mi);
var msgId = botClient.EditMessageTextAsync(6882856105, re.MsgId, txt, parseMode: ParseMode.Html);
re.MsgId = msgId.Id;
db.SaveChanges();
}
else
{
txt = "<b>⚠ ВНИМАНИЕ ⚠</b>\n" +
$"----------------------------------------------\n" +
$"<b>Объект:</b> {content.Map}\n" +
$"<b>Устройство:</b> {content.TypeDev}\n" +
$"<b>Имя:</b> {content.Name}\n" +
$"<b>Адрес:</b> {content.Ip}\n" +
$"<b>Состояние:</b> 🟡 - ошибка\n" +
$"----------------------------------------------";
var msgId = botClient.SendTextMessageAsync(chatId: 6882856105, parseMode: ParseMode.Html, text: txt).Result.MessageId;
content.MsgId = msgId;
db.Errors.Add(content);
db.SaveChanges();
}
}
else
{
var re = db.Errors.FirstOrDefault(e => e.Ip == content.Ip && (e.Status == "off" || e.Status == "error") && e.Name == content.Name);
if (re != null)
{
re.Status = "on";
re.DataError = content.DataError;
txt = "<b>✅ ИСПРАВНО ✅</b>\n" +
$"----------------------------------------------\n" +
$"<b>Объект:</b> {content.Map}\n" +
$"<b>Устройство:</b> {content.TypeDev}\n" +
$"<b>Имя:</b> {content.Name}\n" +
$"<b>Адрес:</b> {content.Ip}\n" +
$"<b>Состояние:</b> 🟢 - исправно\n" +
$"----------------------------------------------";
var msgId = botClient.DeleteMessageAsync(6882856105, re.MsgId);// EditMessageTextAsync(6882856105, re.MsgId, txt, parseMode: ParseMode.Html);
re.MsgId = msgId.Id;
}
db.SaveChanges();
}
return;
});
app.Run();
}
private static async Task HandlePollingErrorAsync(ITelegramBotClient client, Exception exception, CancellationToken token)
{
throw new NotImplementedException();
}
private static async Task HandleUpdateAsync(ITelegramBotClient client, Update update, CancellationToken token)
{
return;
}
}
}
+31
View File
@@ -0,0 +1,31 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:10075",
"sslPort": 0
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5224",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
+8
View File
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
+28
View File
@@ -0,0 +1,28 @@
using LC_Bot.Models;
using Microsoft.EntityFrameworkCore;
namespace LC_Bot;
public partial class Db : DbContext
{
public virtual DbSet<Cam> Cams { get; set; }
public virtual DbSet<Error> Errors { get; set; }
public Db() => Database.EnsureCreated();
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
#if DEBUG
optionsBuilder.UseSqlite("Data Source=Error.db");
#else
optionsBuilder.UseSqlite(@"Data Source=C:\Users\mastankov\Desktop\ForMonitoring\Soft\LC_Api\Error.db");
#endif
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

+22
View File
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ApplicationIcon>LCS_logo.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Content Include="LCS_logo.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.6" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
<PackageReference Include="Selenium.WebDriver" Version="4.21.0" />
<PackageReference Include="Telegram.Bot" Version="19.0.0" />
</ItemGroup>
</Project>
+21
View File
@@ -0,0 +1,21 @@
using System.ComponentModel.DataAnnotations;
namespace LC_Bot.Models
{
public class Cam
{
[Key]
public string? Id { get; set; }
public string? Type { get; set; }
public string? Ip { get; set; }
public string? Access { get; set; }
public string? ImgUrl { get; set; }
public string? RecPoint { get; set; }
public string? ChannelRec { get; set; }
public string? SwitchConnect { get; set; }
public string? SwitchPort { get; set; }
public string? Name { get; set; }
public string? Map { get; set; }
}
}
+19
View File
@@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
namespace LC_Bot.Models
{
public class Error
{
[Key]
public Guid Id { get; set; }
public string? TypeDev { get; set; }
public int MsgId { get; set; }
public string? Status { get; set; }
public string? Name { get; set; }
public string? Ip { get; set; }
public string? Map { get; set; }
public DateTime? DataError { get; set; }
}
}
+121
View File
@@ -0,0 +1,121 @@
using System.Net;
using System;
using Telegram.Bot;
using Telegram.Bot.Exceptions;
using Telegram.Bot.Polling;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;
using LC_Bot;
using LC_Bot.Models;
using Telegram.Bot.Types.ReplyMarkups;
using static System.Net.Mime.MediaTypeNames;
using System.Reflection.Metadata;
internal class Program
{
//public static string token = "6964910806:AAH5EuJq9vNm0D2KwvcEnmuvPYd7_sYa5aI"; //Новый
public static string token = "7055214362:AAFL1aroXt1S00pACH6jMs7OiNQtmK8pI_Y"; //Старый
public static TelegramBotClient botClient = null;
public static string txt;
private static async Task Main(string[] args)
{
using Db db = new Db();
botClient = new TelegramBotClient(token);
using CancellationTokenSource cts = new();
ReceiverOptions receiverOptions = new()
{
AllowedUpdates = Array.Empty<UpdateType>() // receive all update types except ChatMember related updates
};
botClient.StartReceiving(updateHandler: HandleUpdateAsync, pollingErrorHandler: HandlePollingErrorAsync, receiverOptions: receiverOptions, cancellationToken: cts.Token);
var me = await botClient.GetMeAsync();
Console.WriteLine($"Start listening for @{me.Username}");
Console.ReadLine();
cts.Cancel();
}
private static async Task HandleUpdateAsync(ITelegramBotClient botClient, Update update, CancellationToken cancellationToken)
{
long chatId = 0;
if (update.Type == UpdateType.Message)
{
chatId = update.Message.Chat.Id;
var msg = update.Message;
if (msg.Type == MessageType.Text)
{
var textMsg = msg.Text.Split("@")[0];
Console.WriteLine($"Received a '{textMsg}' message in chat {chatId}.");
if (textMsg == "/start")
{
await botClient.SendTextMessageAsync(
chatId: chatId,
text: $"Привет, {msg.From.FirstName}!\r\nБот работает исправно!");
return;
}
if (textMsg == "/test")
{
string ip = "172.24.12.10";
string name = "ТК83";
txt = "<b>‼ НЕИСПРАВНОСТЬ ‼</b>\n" +
$"----------------------------------------------\n" +
$"<b>Объект:</b> SPB\n" +
$"<b>Устройство:</b> TEST\n" +
$"<b>Имя:</b> {name}\n" +
$"<b>Адрес:</b> {ip}\n" +
$"<b>Состояние:</b> 🔴 - не доступна\n" +
$"----------------------------------------------";
InlineKeyboardMarkup inlineKeyboard = new(new[]
{
new []
{
InlineKeyboardButton.WithCallbackData(text: "Перезагрузить", callbackData: $"reboot|{ip}")
}
});
var msgId = botClient.SendTextMessageAsync(chatId: 6882856105, parseMode: ParseMode.Html,replyMarkup:inlineKeyboard, text: txt).Result.MessageId;
Console.WriteLine(msgId);
return;
}
}
return;
}
else if (update.Type == UpdateType.CallbackQuery)
{
chatId = update.CallbackQuery.Message.Chat.Id;
var msgCB = update.CallbackQuery;
txt = msgCB.Message.Text;
Console.WriteLine($"Received a '{update.CallbackQuery.Data}' message in chat {chatId}.");
if (msgCB.Data.StartsWith("reboot"))
{
var m = msgCB.Data.Split("|");
var reb = new Reboot(m[1]);
if (reb.Start())
{
txt.Replace("<b>🔄 ПЕРЕЗАГРУЗКА 🔄</b>\n", "<b>🔄✅ ПЕРЕЗАГРУЖЕН ✅🔄</b>\n");
botClient.EditMessageTextAsync(chatId,msgCB.Message.MessageId, txt, parseMode: ParseMode.Html);
}
else
{
txt.Replace("<b>🔄 ПЕРЕЗАГРУЗКА 🔄</b>\n", "<b>‼️‼️ ОШИБКА БОТА ‼️‼️</b>\n");
botClient.EditMessageTextAsync(chatId, msgCB.Message.MessageId, txt, parseMode: ParseMode.Html);
}
}
}
else return;
}
private static Task HandlePollingErrorAsync(ITelegramBotClient botClient, Exception exception, CancellationToken cancellationToken)
{
var ErrorMessage = exception switch
{
ApiRequestException apiRequestException
=> $"Telegram API Error:\n[{apiRequestException.ErrorCode}]\n{apiRequestException.Message}",
_ => exception.ToString()
};
//Console.WriteLine(ErrorMessage);
return Task.CompletedTask;
}
}
+71
View File
@@ -0,0 +1,71 @@
using OpenQA.Selenium;
using OpenQA.Selenium.Edge;
using Telegram.Bot;
namespace LC_Bot
{
internal class Reboot
{
private readonly string _ip;
private int _id;
EdgeDriver driver;
public Reboot(string ip)
{
_ip = ip;
var options = new EdgeOptions();
//options.AddArgument("-headless");
var service = EdgeDriverService.CreateDefaultService();
service.HideCommandPromptWindow = true;
driver = new EdgeDriver(options);
driver.Manage().Window.Minimize();
}
public bool Start()
{
using Db db = new Db();
var o = db.Cams.FirstOrDefault(c => c.Ip == _ip);
_id = db.Errors.Where(c => c.Ip == _ip && c.Status == "off").First().MsgId;
if (o != null)
{
int port = Convert.ToInt32(o.SwitchPort);
driver.Navigate().GoToUrl($"http://{o.SwitchConnect}/doc/page/login.asp");
Thread.Sleep(500);
try
{
var retext = Program.txt.Replace("<b>‼ НЕИСПРАВНОСТЬ ‼</b>\n", "<b>🔄 ПЕРЕЗАГРУЗКА 🔄</b>\n");
Program.botClient.EditMessageTextAsync(6882856105, _id, retext, parseMode: Telegram.Bot.Types.Enums.ParseMode.Html);
var ch = driver.FindElement(By.Id("details-button"));
if (ch != null)
{
driver.FindElement(By.Id("details-button")).Click();
driver.FindElement(By.Id("proceed-link")).Click();
Thread.Sleep(500);
}
driver.FindElement(By.Id("username")).SendKeys("admin");
driver.FindElement(By.Id("password")).SendKeys("4NUDZhJ7");
driver.FindElement(By.XPath("//button[@type='button']")).Click();
Thread.Sleep(500);
driver.Navigate().GoToUrl($"https://{o.SwitchConnect}/doc/page/switchConfig.asp");
Thread.Sleep(1000);
var ofnik = driver.FindElement(By.XPath($"//div[contains(@ng-click,'changeSwitch({port - 1}, 4, 4)')]"));
ofnik.Click();
Thread.Sleep(1000);
driver.FindElement(By.XPath("//button[contains(@class,'btn-save')]")).Click();
Thread.Sleep(1000);
ofnik.Click();
Thread.Sleep(1000);
driver.FindElement(By.XPath("//button[contains(@class,'btn-save')]")).Click();
Thread.Sleep(500);
driver.Quit();
return true;
}
catch (Exception)
{
return false;
}
}
else return false;
}
}
}
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+633
View File
@@ -0,0 +1,633 @@
namespace LC_ConfigCamer
{
partial class Form1
{
/// <summary>
/// Обязательная переменная конструктора.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Код, автоматически созданный конструктором форм Windows
/// <summary>
/// Требуемый метод для поддержки конструктора — не изменяйте
/// содержимое этого метода с помощью редактора кода.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.btn_check_params = new System.Windows.Forms.Button();
this.btn_start = new System.Windows.Forms.Button();
this.tb_log = new System.Windows.Forms.TextBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.lbl_valid_new_pass = new System.Windows.Forms.Label();
this.tb_new_pass = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label3 = new System.Windows.Forms.Label();
this.tb_list_old_pass = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.lbl_count_cams_in_list = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.btn_opent_file = new System.Windows.Forms.Button();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.groupBox9 = new System.Windows.Forms.GroupBox();
this.btn_check_params1 = new System.Windows.Forms.Button();
this.btn_start1 = new System.Windows.Forms.Button();
this.textBox2 = new System.Windows.Forms.TextBox();
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.label10 = new System.Windows.Forms.Label();
this.tb_pass = new System.Windows.Forms.TextBox();
this.groupBox7 = new System.Windows.Forms.GroupBox();
this.rb_Conn_Ssh = new System.Windows.Forms.RadioButton();
this.rb_Conn_Web = new System.Windows.Forms.RadioButton();
this.label9 = new System.Windows.Forms.Label();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.rb_SetSync_Time = new System.Windows.Forms.RadioButton();
this.rb_GetCheck_Time = new System.Windows.Forms.RadioButton();
this.label8 = new System.Windows.Forms.Label();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.btn_opent_file1 = new System.Windows.Forms.Button();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.groupBox9.SuspendLayout();
this.groupBox8.SuspendLayout();
this.groupBox7.SuspendLayout();
this.groupBox6.SuspendLayout();
this.groupBox5.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Margin = new System.Windows.Forms.Padding(4);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(1051, 528);
this.tabControl1.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.groupBox4);
this.tabPage1.Controls.Add(this.groupBox3);
this.tabPage1.Controls.Add(this.groupBox2);
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Location = new System.Drawing.Point(4, 25);
this.tabPage1.Margin = new System.Windows.Forms.Padding(4);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(4);
this.tabPage1.Size = new System.Drawing.Size(1043, 499);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "ПАРОЛЬ";
this.tabPage1.UseVisualStyleBackColor = true;
//
// groupBox4
//
this.groupBox4.Controls.Add(this.btn_check_params);
this.groupBox4.Controls.Add(this.btn_start);
this.groupBox4.Controls.Add(this.tb_log);
this.groupBox4.Location = new System.Drawing.Point(471, 9);
this.groupBox4.Margin = new System.Windows.Forms.Padding(4);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Padding = new System.Windows.Forms.Padding(4);
this.groupBox4.Size = new System.Drawing.Size(557, 471);
this.groupBox4.TabIndex = 3;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Ход операций";
//
// btn_check_params
//
this.btn_check_params.Enabled = false;
this.btn_check_params.Location = new System.Drawing.Point(8, 423);
this.btn_check_params.Margin = new System.Windows.Forms.Padding(4);
this.btn_check_params.Name = "btn_check_params";
this.btn_check_params.Size = new System.Drawing.Size(239, 41);
this.btn_check_params.TabIndex = 2;
this.btn_check_params.Text = "Проверить параметры";
this.btn_check_params.UseVisualStyleBackColor = true;
this.btn_check_params.Click += new System.EventHandler(this.btn_check_params_Click);
//
// btn_start
//
this.btn_start.Enabled = false;
this.btn_start.Location = new System.Drawing.Point(311, 423);
this.btn_start.Margin = new System.Windows.Forms.Padding(4);
this.btn_start.Name = "btn_start";
this.btn_start.Size = new System.Drawing.Size(239, 41);
this.btn_start.TabIndex = 1;
this.btn_start.Text = "Запуск процесса";
this.btn_start.UseVisualStyleBackColor = true;
this.btn_start.Click += new System.EventHandler(this.btn_start_Click);
//
// tb_log
//
this.tb_log.Location = new System.Drawing.Point(8, 25);
this.tb_log.Margin = new System.Windows.Forms.Padding(4);
this.tb_log.Multiline = true;
this.tb_log.Name = "tb_log";
this.tb_log.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tb_log.Size = new System.Drawing.Size(540, 390);
this.tb_log.TabIndex = 0;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.lbl_valid_new_pass);
this.groupBox3.Controls.Add(this.tb_new_pass);
this.groupBox3.Controls.Add(this.label4);
this.groupBox3.Enabled = false;
this.groupBox3.Location = new System.Drawing.Point(11, 327);
this.groupBox3.Margin = new System.Windows.Forms.Padding(4);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Padding = new System.Windows.Forms.Padding(4);
this.groupBox3.Size = new System.Drawing.Size(451, 153);
this.groupBox3.TabIndex = 2;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Новый пароль";
//
// lbl_valid_new_pass
//
this.lbl_valid_new_pass.AutoSize = true;
this.lbl_valid_new_pass.ForeColor = System.Drawing.Color.Green;
this.lbl_valid_new_pass.Location = new System.Drawing.Point(197, 101);
this.lbl_valid_new_pass.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lbl_valid_new_pass.Name = "lbl_valid_new_pass";
this.lbl_valid_new_pass.Size = new System.Drawing.Size(0, 16);
this.lbl_valid_new_pass.TabIndex = 2;
//
// tb_new_pass
//
this.tb_new_pass.Location = new System.Drawing.Point(8, 121);
this.tb_new_pass.Margin = new System.Windows.Forms.Padding(4);
this.tb_new_pass.Name = "tb_new_pass";
this.tb_new_pass.Size = new System.Drawing.Size(433, 22);
this.tb_new_pass.TabIndex = 1;
this.tb_new_pass.TextChanged += new System.EventHandler(this.tb_new_pass_TextChanged);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(12, 25);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(406, 64);
this.label4.TabIndex = 0;
this.label4.Text = "Введите новый пароль для камеры. Пароль должен состоять,\r\nминимум, из 8 знаков. Д" +
"олжны присутствовать большие и\r\nмаленьки буквы, цифры, спецыальные знаки.\r\nНе до" +
"пустимы точки, запятые и пробелы.";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.tb_list_old_pass);
this.groupBox2.Enabled = false;
this.groupBox2.Location = new System.Drawing.Point(11, 168);
this.groupBox2.Margin = new System.Windows.Forms.Padding(4);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Padding = new System.Windows.Forms.Padding(4);
this.groupBox2.Size = new System.Drawing.Size(451, 153);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Пароли для входа";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(8, 20);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(388, 64);
this.label3.TabIndex = 1;
this.label3.Text = "Введите пароль, который используются в камерах из\r\nсписка. Перед паролем и после " +
"не должно быть пробелов.\r\n\r\nПроверьте, чтоб не было пой строки.";
//
// tb_list_old_pass
//
this.tb_list_old_pass.Location = new System.Drawing.Point(8, 121);
this.tb_list_old_pass.Margin = new System.Windows.Forms.Padding(4);
this.tb_list_old_pass.Name = "tb_list_old_pass";
this.tb_list_old_pass.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.tb_list_old_pass.Size = new System.Drawing.Size(433, 22);
this.tb_list_old_pass.TabIndex = 0;
this.tb_list_old_pass.TextChanged += new System.EventHandler(this.tb_list_old_pass_TextChanged);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.lbl_count_cams_in_list);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.btn_opent_file);
this.groupBox1.Location = new System.Drawing.Point(11, 7);
this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
this.groupBox1.Size = new System.Drawing.Size(452, 153);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Список камер";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 25);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(390, 64);
this.label2.TabIndex = 3;
this.label2.Text = resources.GetString("label2.Text");
//
// lbl_count_cams_in_list
//
this.lbl_count_cams_in_list.AutoSize = true;
this.lbl_count_cams_in_list.Location = new System.Drawing.Point(349, 122);
this.lbl_count_cams_in_list.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lbl_count_cams_in_list.Name = "lbl_count_cams_in_list";
this.lbl_count_cams_in_list.Size = new System.Drawing.Size(14, 16);
this.lbl_count_cams_in_list.TabIndex = 2;
this.lbl_count_cams_in_list.Text = "0";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(119, 122);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(209, 16);
this.label1.TabIndex = 1;
this.label1.Text = "Количество выбранных камер: ";
//
// btn_opent_file
//
this.btn_opent_file.Location = new System.Drawing.Point(8, 116);
this.btn_opent_file.Margin = new System.Windows.Forms.Padding(4);
this.btn_opent_file.Name = "btn_opent_file";
this.btn_opent_file.Size = new System.Drawing.Size(100, 28);
this.btn_opent_file.TabIndex = 0;
this.btn_opent_file.Text = "... ОБЗОР";
this.btn_opent_file.UseVisualStyleBackColor = true;
this.btn_opent_file.Click += new System.EventHandler(this.btn_opent_file_Click);
//
// tabPage2
//
this.tabPage2.Controls.Add(this.groupBox9);
this.tabPage2.Controls.Add(this.groupBox8);
this.tabPage2.Controls.Add(this.groupBox7);
this.tabPage2.Controls.Add(this.groupBox6);
this.tabPage2.Controls.Add(this.groupBox5);
this.tabPage2.Location = new System.Drawing.Point(4, 25);
this.tabPage2.Margin = new System.Windows.Forms.Padding(4);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(4);
this.tabPage2.Size = new System.Drawing.Size(1043, 499);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "ВРЕМЯ";
this.tabPage2.UseVisualStyleBackColor = true;
//
// groupBox9
//
this.groupBox9.Controls.Add(this.btn_check_params1);
this.groupBox9.Controls.Add(this.btn_start1);
this.groupBox9.Controls.Add(this.textBox2);
this.groupBox9.Location = new System.Drawing.Point(427, 8);
this.groupBox9.Margin = new System.Windows.Forms.Padding(4);
this.groupBox9.Name = "groupBox9";
this.groupBox9.Padding = new System.Windows.Forms.Padding(4);
this.groupBox9.Size = new System.Drawing.Size(557, 482);
this.groupBox9.TabIndex = 6;
this.groupBox9.TabStop = false;
this.groupBox9.Text = "Ход операций";
//
// btn_check_params1
//
this.btn_check_params1.Enabled = false;
this.btn_check_params1.Location = new System.Drawing.Point(8, 433);
this.btn_check_params1.Margin = new System.Windows.Forms.Padding(4);
this.btn_check_params1.Name = "btn_check_params1";
this.btn_check_params1.Size = new System.Drawing.Size(239, 41);
this.btn_check_params1.TabIndex = 2;
this.btn_check_params1.Text = "Проверить параметры";
this.btn_check_params1.UseVisualStyleBackColor = true;
this.btn_check_params1.Click += new System.EventHandler(this.btn_check_params1_Click);
//
// btn_start1
//
this.btn_start1.Enabled = false;
this.btn_start1.Location = new System.Drawing.Point(309, 433);
this.btn_start1.Margin = new System.Windows.Forms.Padding(4);
this.btn_start1.Name = "btn_start1";
this.btn_start1.Size = new System.Drawing.Size(239, 41);
this.btn_start1.TabIndex = 1;
this.btn_start1.Text = "Запуск процесса";
this.btn_start1.UseVisualStyleBackColor = true;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(8, 25);
this.textBox2.Margin = new System.Windows.Forms.Padding(4);
this.textBox2.Multiline = true;
this.textBox2.Name = "textBox2";
this.textBox2.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.textBox2.Size = new System.Drawing.Size(540, 400);
this.textBox2.TabIndex = 0;
//
// groupBox8
//
this.groupBox8.Controls.Add(this.label10);
this.groupBox8.Controls.Add(this.tb_pass);
this.groupBox8.Enabled = false;
this.groupBox8.Location = new System.Drawing.Point(9, 407);
this.groupBox8.Margin = new System.Windows.Forms.Padding(4);
this.groupBox8.Name = "groupBox8";
this.groupBox8.Padding = new System.Windows.Forms.Padding(4);
this.groupBox8.Size = new System.Drawing.Size(410, 83);
this.groupBox8.TabIndex = 5;
this.groupBox8.TabStop = false;
this.groupBox8.Text = "Пароли для входа";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(8, 20);
this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(187, 16);
this.label10.TabIndex = 1;
this.label10.Text = "Введите пароль к УЗ admin.";
//
// tb_pass
//
this.tb_pass.Location = new System.Drawing.Point(8, 53);
this.tb_pass.Margin = new System.Windows.Forms.Padding(4);
this.tb_pass.Name = "tb_pass";
this.tb_pass.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.tb_pass.Size = new System.Drawing.Size(361, 22);
this.tb_pass.TabIndex = 0;
//
// groupBox7
//
this.groupBox7.Controls.Add(this.rb_Conn_Ssh);
this.groupBox7.Controls.Add(this.rb_Conn_Web);
this.groupBox7.Controls.Add(this.label9);
this.groupBox7.Enabled = false;
this.groupBox7.Location = new System.Drawing.Point(9, 260);
this.groupBox7.Margin = new System.Windows.Forms.Padding(4);
this.groupBox7.Name = "groupBox7";
this.groupBox7.Padding = new System.Windows.Forms.Padding(4);
this.groupBox7.Size = new System.Drawing.Size(410, 139);
this.groupBox7.TabIndex = 4;
this.groupBox7.TabStop = false;
this.groupBox7.Text = "Подключение";
//
// rb_Conn_Ssh
//
this.rb_Conn_Ssh.AutoSize = true;
this.rb_Conn_Ssh.Location = new System.Drawing.Point(7, 109);
this.rb_Conn_Ssh.Name = "rb_Conn_Ssh";
this.rb_Conn_Ssh.Size = new System.Drawing.Size(56, 20);
this.rb_Conn_Ssh.TabIndex = 3;
this.rb_Conn_Ssh.Text = "SSH";
this.rb_Conn_Ssh.UseVisualStyleBackColor = true;
//
// rb_Conn_Web
//
this.rb_Conn_Web.AutoSize = true;
this.rb_Conn_Web.Checked = true;
this.rb_Conn_Web.Location = new System.Drawing.Point(7, 83);
this.rb_Conn_Web.Name = "rb_Conn_Web";
this.rb_Conn_Web.Size = new System.Drawing.Size(136, 20);
this.rb_Conn_Web.TabIndex = 2;
this.rb_Conn_Web.TabStop = true;
this.rb_Conn_Web.Text = "WEB-интерфейс";
this.rb_Conn_Web.UseVisualStyleBackColor = true;
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(8, 20);
this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(288, 48);
this.label9.TabIndex = 1;
this.label9.Text = "Как производить подключение?\r\n(у камер и DVR HikVision не рекомендуется\r\nиспользо" +
"вать SSH)";
//
// groupBox6
//
this.groupBox6.Controls.Add(this.rb_SetSync_Time);
this.groupBox6.Controls.Add(this.rb_GetCheck_Time);
this.groupBox6.Controls.Add(this.label8);
this.groupBox6.Enabled = false;
this.groupBox6.Location = new System.Drawing.Point(9, 150);
this.groupBox6.Margin = new System.Windows.Forms.Padding(4);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Padding = new System.Windows.Forms.Padding(4);
this.groupBox6.Size = new System.Drawing.Size(410, 102);
this.groupBox6.TabIndex = 2;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "Параметр";
//
// rb_SetSync_Time
//
this.rb_SetSync_Time.AutoSize = true;
this.rb_SetSync_Time.Location = new System.Drawing.Point(7, 69);
this.rb_SetSync_Time.Name = "rb_SetSync_Time";
this.rb_SetSync_Time.Size = new System.Drawing.Size(240, 20);
this.rb_SetSync_Time.TabIndex = 3;
this.rb_SetSync_Time.TabStop = true;
this.rb_SetSync_Time.Text = "Установить / Синхронизировать";
this.rb_SetSync_Time.UseVisualStyleBackColor = true;
//
// rb_GetCheck_Time
//
this.rb_GetCheck_Time.AutoSize = true;
this.rb_GetCheck_Time.Checked = true;
this.rb_GetCheck_Time.Location = new System.Drawing.Point(7, 43);
this.rb_GetCheck_Time.Name = "rb_GetCheck_Time";
this.rb_GetCheck_Time.Size = new System.Drawing.Size(174, 20);
this.rb_GetCheck_Time.TabIndex = 2;
this.rb_GetCheck_Time.TabStop = true;
this.rb_GetCheck_Time.Text = "Получить / Проверить";
this.rb_GetCheck_Time.UseVisualStyleBackColor = true;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(8, 20);
this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(173, 16);
this.label8.TabIndex = 1;
this.label8.Text = "Что сделать с временем?";
//
// groupBox5
//
this.groupBox5.Controls.Add(this.label5);
this.groupBox5.Controls.Add(this.label6);
this.groupBox5.Controls.Add(this.label7);
this.groupBox5.Controls.Add(this.btn_opent_file1);
this.groupBox5.Location = new System.Drawing.Point(9, 8);
this.groupBox5.Margin = new System.Windows.Forms.Padding(4);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Padding = new System.Windows.Forms.Padding(4);
this.groupBox5.Size = new System.Drawing.Size(410, 134);
this.groupBox5.TabIndex = 1;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "Список камер";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(9, 25);
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(390, 64);
this.label5.TabIndex = 3;
this.label5.Text = resources.GetString("label5.Text");
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(333, 105);
this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(14, 16);
this.label6.TabIndex = 2;
this.label6.Text = "0";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(116, 105);
this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(209, 16);
this.label7.TabIndex = 1;
this.label7.Text = "Количество выбранных камер: ";
//
// btn_opent_file1
//
this.btn_opent_file1.Location = new System.Drawing.Point(11, 99);
this.btn_opent_file1.Margin = new System.Windows.Forms.Padding(4);
this.btn_opent_file1.Name = "btn_opent_file1";
this.btn_opent_file1.Size = new System.Drawing.Size(100, 28);
this.btn_opent_file1.TabIndex = 0;
this.btn_opent_file1.Text = "... ОБЗОР";
this.btn_opent_file1.UseVisualStyleBackColor = true;
this.btn_opent_file1.Click += new System.EventHandler(this.btn_opent_file_Click);
//
// openFileDialog1
//
this.openFileDialog1.FileName = "list_cam.csv";
this.openFileDialog1.Filter = "CSV файл|*.csv";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(841, 422);
this.Controls.Add(this.tabControl1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(4);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "НАСТРАИВАТЕЛЬ | ver. 0.0.1";
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.groupBox9.ResumeLayout(false);
this.groupBox9.PerformLayout();
this.groupBox8.ResumeLayout(false);
this.groupBox8.PerformLayout();
this.groupBox7.ResumeLayout(false);
this.groupBox7.PerformLayout();
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btn_opent_file;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Label lbl_count_cams_in_list;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox tb_list_old_pass;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.TextBox tb_new_pass;
private System.Windows.Forms.Button btn_check_params;
private System.Windows.Forms.Button btn_start;
private System.Windows.Forms.Label lbl_valid_new_pass;
public System.Windows.Forms.TextBox tb_log;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Button btn_opent_file1;
private System.Windows.Forms.GroupBox groupBox7;
private System.Windows.Forms.RadioButton rb_Conn_Ssh;
private System.Windows.Forms.RadioButton rb_Conn_Web;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.RadioButton rb_SetSync_Time;
private System.Windows.Forms.RadioButton rb_GetCheck_Time;
private System.Windows.Forms.GroupBox groupBox8;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox tb_pass;
private System.Windows.Forms.GroupBox groupBox9;
private System.Windows.Forms.Button btn_check_params1;
private System.Windows.Forms.Button btn_start1;
public System.Windows.Forms.TextBox textBox2;
}
}
+128
View File
@@ -0,0 +1,128 @@
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LC_ConfigCamer
{
public partial class Form1 : Form
{
public static string[] arr_ip;
public static string old_pass, new_pass;
public static TextBox tb;
public static bool Web_Conn = true, GetOrCheck = true;
public Form1()
{
InitializeComponent();
tb = tb_log;
#if DEBUG
tb_list_old_pass.Text = "vg5-_kcc";
tb_new_pass.Text = "vg5-_kcc";
var a1 = Environment.CurrentDirectory;
System.Windows.Forms.MessageBox.Show(a1);
#endif
}
private void btn_opent_file_Click(object sender, EventArgs e)
{
Array.Clear(arr_ip, 0, arr_ip.Length);
if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
return;
string filename = openFileDialog1.FileName;
var fileStream = openFileDialog1.OpenFile();
var fileText = string.Empty;
using (StreamReader reader = new StreamReader(fileStream))
{
fileText = reader.ReadToEnd();
}
arr_ip = fileText.Replace("\r", "").Split('\n');// new char[] { '\r', '\n' });
lbl_count_cams_in_list.Text = arr_ip.Count().ToString();
Log_add($"Получен список ip. {arr_ip.Count()} шт.");
groupBox2.Enabled = true;
}
private void tb_list_old_pass_TextChanged(object sender, EventArgs e)
{
groupBox3.Enabled = true;
}
private void tb_new_pass_TextChanged(object sender, EventArgs e)
{
if (tb_new_pass.Text.Length < 8)
{
lbl_valid_new_pass.Text = "ПЛОХОЙ ПАРОЛЬ";
lbl_valid_new_pass.ForeColor = System.Drawing.Color.Crimson;
btn_check_params.Enabled = false;
}
else
{
lbl_valid_new_pass.Text = "ОК";
lbl_valid_new_pass.ForeColor = System.Drawing.Color.Green;
btn_check_params.Enabled = true;
}
}
private void btn_check_params_Click(object sender, EventArgs e)
{
try
{
old_pass = tb_list_old_pass.Text;
new_pass = tb_new_pass.Text;
btn_start.Enabled = true;
Log_add($"Получен старый пароль: {old_pass}");
Log_add($"Получен новый пароль: {new_pass}");
}
catch (Exception)
{
MessageBox.Show("Что-то не так! Перепроверь все!");
}
}
private void btn_start_Click(object sender, EventArgs e)
{
var Set_New_Pass = new Selenium_Work(arr_ip, old_pass, new_pass);
Set_New_Pass.Start();
}
private void btn_check_params1_Click(object sender, EventArgs e)
{
try
{
new_pass = tb_new_pass.Text;
btn_start.Enabled = true;
Log_add($"Получен новый пароль: {new_pass}");
if(rb_Conn_Ssh.Checked) Web_Conn=false;
else Web_Conn=true;
Log_add($"Получен параметр соединения");
if (rb_SetSync_Time.Checked) GetOrCheck = false;
else GetOrCheck = true;
Log_add($"Получен параметр действия");
}
catch (Exception)
{
MessageBox.Show("Что-то не так! Перепроверь все!");
}
}
public static Task Log_add(string txt, bool err = false)
{
var new_txt = string.Empty;
if (err)
new_txt = " ! | " + txt;
else
new_txt = " - | " + txt;
var temp_txt = tb.Text;
tb.Text = temp_txt + $"{DateTime.Now:T} | {new_txt}" + Environment.NewLine;
return Task.CompletedTask;
}
}
}
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

+181
View File
@@ -0,0 +1,181 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A07EA5C9-9E54-4455-A8FF-2F8D6DAD7ED1}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>LC_ConfigCamer</RootNamespace>
<AssemblyName>LC_ConfigCamer</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>C:\Users\astankovmi\Nextcloud\AmiCode\WorkApps\ConfigCamer\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>LCS_logo.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>1315103038AF81885727D2920806F5D7EC8A5E91</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>LC_ConfigCamer_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=8.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.8.0.5\lib\net462\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Channels, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Channels.8.0.0\lib\net462\System.Threading.Channels.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WebDriver, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.4.41.0\lib\net462\WebDriver.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Selenium_Work.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="LC_ConfigCamer_TemporaryKey.pfx" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="LCS_logo.ico" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.8 %28x86 и x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Selenium.WebDriver.4.41.0\build\Selenium.WebDriver.targets" Condition="Exists('..\packages\Selenium.WebDriver.4.41.0\build\Selenium.WebDriver.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их. Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Selenium.WebDriver.4.41.0\build\Selenium.WebDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.WebDriver.4.41.0\build\Selenium.WebDriver.targets'))" />
</Target>
</Project>
+22
View File
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LC_ConfigCamer
{
internal static class Program
{
/// <summary>
/// Главная точка входа для приложения.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
+36
View File
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Общие сведения об этой сборке предоставляются следующим набором
// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
// связанных со сборкой.
[assembly: AssemblyTitle("LC_ConfigCamer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LC_ConfigCamer")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
// COM, следует установить атрибут ComVisible в TRUE для этого типа.
[assembly: ComVisible(false)]
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
[assembly: Guid("a07ea5c9-9e54-4455-a8ff-2f8d6dad7ed1")]
// Сведения о версии сборки состоят из указанных ниже четырех значений:
//
// Основной номер версии
// Дополнительный номер версии
// Номер сборки
// Редакция
//
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+63
View File
@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace LC_ConfigCamer.Properties {
using System;
/// <summary>
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
/// </summary>
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
// с помощью такого средства, как ResGen или Visual Studio.
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
// с параметром /str или перестройте свой проект VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LC_ConfigCamer.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
+117
View File
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+26
View File
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace LC_ConfigCamer.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
+144
View File
@@ -0,0 +1,144 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Firefox;
namespace LC_ConfigCamer
{
internal class Selenium_Work
{
public string[] Ip_list { get; set; }
public string Old_pass { get; set; }
public string New_Pass { get; set; }
FirefoxDriver driver;
public Selenium_Work(string[] ip, string old_pass, string new_pass)
{
Ip_list = ip;
Old_pass = old_pass;
New_Pass = new_pass;
}
public async void Start()
{
FirefoxOptions options = new FirefoxOptions();
//options.AddArgument("-headless");
FirefoxDriverService service = FirefoxDriverService.CreateDefaultService();
service.HideCommandPromptWindow = true;
driver = new FirefoxDriver(Environment.CurrentDirectory, options);
for (int i = 0; i < Ip_list.Count(); i++)
{
driver.Navigate().GoToUrl($"http://{Ip_list[i]}");
await Form1.Log_add($"Открыл Web-интерфейс камеры {Ip_list[i]}");
Thread.Sleep(500);
#region Ввод логин пароль
driver.FindElement(By.XPath("//*[@id=\"username\"]")).SendKeys("admin");
driver.FindElement(By.XPath("//*[@id='password']")).SendKeys(Old_pass);
try
{
driver.FindElement(By.XPath("//*[@id=\"login\"]/table/tbody/tr/td[2]/div/div[5]/button")).Click();
}
catch (Exception)
{
MessageBox.Show("Не нашел XPath кнопки входа");
}
await Form1.Log_add($"Ввел логин и пароль");
Thread.Sleep(2000);
#endregion
if (CheckXPath("/html/body/div[2]/table/tbody/tr/td[2]/div/div[2]/div/label"))
{
await Form1.Log_add($"Не правильный пароль к {Ip_list[i]}", true);
await Form1.Log_add($"===================================", true);
continue;
}
else
{
#region Переход в конфигурацию
driver.Navigate().GoToUrl($"http://{Ip_list[i]}/doc/page/config.asp");
await Form1.Log_add($"Перешел в режим конфигурации");
Thread.Sleep(1000);
#endregion
#region Выбрать пользователя и нажать ИЗМЕНИТЬ
driver.FindElement(By.Name("user")).Click();
await Form1.Log_add($"Перешел в настройки пользователей");
Thread.Sleep(1000);
if (CheckXPath("/html/body/div[4]/div[1]/div/div/div[1]/div/div[1]/div[2]/div/div[2]/div"))
driver.FindElement(By.XPath("/html/body/div[4]/div[1]/div/div/div[1]/div/div[1]/div[2]/div/div[2]/div")).Click();
else
MessageBox.Show("Ткнуть на строку admin");
Thread.Sleep(500);
if (CheckXPath("/html/body/div[4]/div[1]/div/div/div[1]/div/div[1]/div[1]/span[2]/button[2]"))
driver.FindElement(By.XPath("/html/body/div[4]/div[1]/div/div/div[1]/div/div[1]/div[1]/span[2]/button[2]")).Click();
//else if (await CheckXPath("/html/body/div[3]/div[1]/div/div/div[1]/div/div/div[1]/span[2]/button[2]"))
// driver.FindElement(By.XPath("/html/body/div[4]/div[1]/div/div/div[1]/div/div[1]/div[1]/span[2]/button[3]")).Click();
//else if (await CheckXPath("/html/body/div[4]/div[1]/div/div/div[1]/div/div[1]/div[1]/span[2]/button[2]"))
// driver.FindElement(By.XPath("/html/body/div[4]/div[1]/div/div/div[1]/div/div[1]/div[1]/span[2]/button[3]")).Click();
else
MessageBox.Show("Ткнуть изменить");
await Form1.Log_add($"Открыл изменение настроек пользователя");
Thread.Sleep(1000);
#endregion
#region Изменение пароля
if (CheckXPath("/html/body/div[1]/div/table/tbody/tr[2]/td[2]/div/table/tbody/tr[2]/td[2]/div/div[1]/div[4]/div[1]/span[2]/input"))
{
var el = driver.FindElement(By.XPath("/html/body/div[1]/div/table/tbody/tr[2]/td[2]/div/table/tbody/tr[2]/td[2]/div/div[1]/div[4]/div[1]/span[2]/input"));
el.Clear(); el.SendKeys(Old_pass);
await Form1.Log_add($"Ввел старый пароль");
}
else
{
MessageBox.Show("Ввод старого пароля");
}
if (CheckXPath("/html/body/div[1]/div/table/tbody/tr[2]/td[2]/div/table/tbody/tr[2]/td[2]/div/div[1]/div[4]/div[2]/span[2]/input"))
{
var el = driver.FindElement(By.XPath("/html/body/div[1]/div/table/tbody/tr[2]/td[2]/div/table/tbody/tr[2]/td[2]/div/div[1]/div[4]/div[2]/span[2]/input"));
el.Clear(); el.SendKeys(New_Pass);
el = driver.FindElement(By.XPath("/html/body/div[1]/div/table/tbody/tr[2]/td[2]/div/table/tbody/tr[2]/td[2]/div/div[1]/div[4]/div[4]/span[2]/input"));
el.Clear(); el.SendKeys(New_Pass);
await Form1.Log_add($"Ввел 2 раза новый пароль");
}
else
{
MessageBox.Show("Ввод нового пароля");
}
driver.FindElement(By.XPath("//html/body/div[1]/div/table/tbody/tr[2]/td[2]/div/table/tbody/tr[3]/td/div/button[1]")).Click();
await Form1.Log_add($"Сохранил изменения.");
await Form1.Log_add($"===================================");
#endregion
continue;
}
}
driver.Quit();
}
private bool CheckXPath(string xPath)
{
try
{
_ = driver.FindElement(By.XPath(xPath));
return true;
}
catch (Exception)
{
return false;
}
}
}
}
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net48" />
<package id="Selenium.WebDriver" version="4.41.0" targetFramework="net48" />
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
<package id="System.Memory" version="4.5.5" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net48" />
<package id="System.Text.Encodings.Web" version="8.0.0" targetFramework="net48" />
<package id="System.Text.Json" version="8.0.5" targetFramework="net48" />
<package id="System.Threading.Channels" version="8.0.0" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net48" />
</packages>
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.3" newVersion="8.0.0.3" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+30
View File
@@ -0,0 +1,30 @@
using System;
namespace LC_Error
{
internal class Error
{
public int Id { get; set; }
public typeDev TypeDev { get; set; }
public int? MsgId { get; set; }
public statusDev? Status { get; set; }
public string Name { get; set; }
public string Ip { get; set; }
public DateTime? DataError { get; set; }
}
public enum typeDev
{
Unknown = 0,
Camera,
Server,
Workstation,
Rack_server
}
public enum statusDev
{
Off = 0,
On,
Unknown
}
}
+137
View File
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{84DFC2EF-9A72-434E-A5FA-0E02F2BDCD16}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>LC_Error</RootNamespace>
<AssemblyName>LC_Error</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>C:\AmiCode\ReleaseApp\LC_Error\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>A2FDD76764C6084BC8374F48A668368B5306DA34</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>LC_Error_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.5\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.IO.Pipelines, Version=10.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.10.0.5\lib\net462\System.IO.Pipelines.dll</HintPath>
</Reference>
<Reference Include="System.Memory, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Json, Version=10.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.Json.10.0.5\lib\net462\System.Net.Http.Json.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web, Version=10.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.10.0.5\lib\net462\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=10.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.10.0.5\lib\net462\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Error.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="LC_Error_TemporaryKey.pfx" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.8 %28x86 и x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\System.ValueTuple.4.6.2\build\net471\System.ValueTuple.targets" Condition="Exists('..\packages\System.ValueTuple.4.6.2\build\net471\System.ValueTuple.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их. Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\System.ValueTuple.4.6.2\build\net471\System.ValueTuple.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.ValueTuple.4.6.2\build\net471\System.ValueTuple.targets'))" />
</Target>
</Project>
+70
View File
@@ -0,0 +1,70 @@
using System;
using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;
namespace LC_Error
{
internal class Program
{
static HttpClient httpClient = new HttpClient();
static int _type;
static int _status;
static string _name;
static string _ip;
static async Task Main(string[] args)
{
CheckType(args[0]);
CheckStatus(args[1]);
_name = args[2];
_ip = args[3];
var e = new Error()
{
Id = 0,
TypeDev = (typeDev)_type,
MsgId = 0,
Status = (statusDev)_status,
Name = _name,
Ip = _ip,
DataError = DateTime.Now,
};
JsonContent content = JsonContent.Create(e);
// отправляем запрос
var response = await httpClient.PostAsync("http://172.24.6.242/api/error", content);
}
static void CheckType(string type)
{
switch (type)
{
case "Camera":
_type = 1;
break;
case "Server":
_type = 2;
break;
case "Workstation":
_type = 3;
break;
case "Rack server":
_type = 4;
break;
default:
_type = 0;
break;
}
}
static void CheckStatus(string status)
{
if (status.Contains("не"))
_status = 0;
else
_status = 1;
}
}
}
+36
View File
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Общие сведения об этой сборке предоставляются следующим набором
// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
// связанные с этой сборкой.
[assembly: AssemblyTitle("LC_Error")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LC_Error")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
// из модели COM задайте для атрибута ComVisible этого типа значение true.
[assembly: ComVisible(false)]
// Следующий GUID представляет идентификатор typelib, если этот проект доступен из модели COM
[assembly: Guid("84dfc2ef-9a72-434e-a5fa-0e02f2bdcd16")]
// Сведения о версии сборки состоят из указанных ниже четырех значений:
//
// Основной номер версии
// Дополнительный номер версии
// Номер сборки
// Номер редакции
//
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl.AsyncInterfaces" version="10.0.5" targetFramework="net48" />
<package id="System.Buffers" version="4.6.1" targetFramework="net48" />
<package id="System.IO.Pipelines" version="10.0.5" targetFramework="net48" />
<package id="System.Memory" version="4.6.3" targetFramework="net48" />
<package id="System.Net.Http.Json" version="10.0.5" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net48" />
<package id="System.Text.Encodings.Web" version="10.0.5" targetFramework="net48" />
<package id="System.Text.Json" version="10.0.5" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.6.3" targetFramework="net48" />
<package id="System.ValueTuple" version="4.6.2" targetFramework="net48" />
</packages>
+13
View File
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "8.0.7",
"commands": [
"dotnet-ef"
],
"rollForward": false
}
}
}
+32
View File
@@ -0,0 +1,32 @@
using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using Web.Models;
namespace Web.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
public IActionResult Index()
{
return View();
}
public IActionResult Privacy()
{
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
}
+9
View File
@@ -0,0 +1,9 @@
namespace Web.Models
{
public class ErrorViewModel
{
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
}
+27
View File
@@ -0,0 +1,27 @@
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();
+40
View File
@@ -0,0 +1,40 @@
{
"profiles": {
"http": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "http://localhost:5000",
"sqlDebugging": true
},
"https": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "https://localhost:7000;http://localhost:5000",
"sqlDebugging": true
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:8000",
"sslPort": 44302
}
}
}
+8
View File
@@ -0,0 +1,8 @@
@{
ViewData["Title"] = "Home Page";
}
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://learn.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>
+6
View File
@@ -0,0 +1,6 @@
@{
ViewData["Title"] = "Privacy Policy";
}
<h1>@ViewData["Title"]</h1>
<p>Use this page to detail your site's privacy policy.</p>
+6
View File
@@ -0,0 +1,6 @@
@*
For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
*@
<p>Тестовая встраиваимая часть</p>
+25
View File
@@ -0,0 +1,25 @@
@model ErrorViewModel
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
+137
View File
@@ -0,0 +1,137 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@* <title>@ViewData["Title"] - Web</title> *@
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link rel="stylesheet" href="~/Web.styles.css" asp-append-version="true" />
</head>
<body>
@*
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">СКАЙ-НЕТ</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Главная</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Настройки</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
*@
<div class="row">
<div class="col-xxl-1 col-xl-2 col-lg-3 col-3">
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto link-body-emphasis text-decoration-none">
<svg class="bi pe-none me-2" width="40" height="32"><use xlink:href="#bootstrap" /></svg>
<span class="fs-4">Sidebar</span>
</a>
<hr>
</div>
<div class="col-sm-9">
<div class="row">
<div class="card">
<div class="">@RenderBody()</div>
</div>
</div>
</div>
</div>
@* <div class="container">
<div class="col">
<div class="d-flex flex-column flex-shrink-0 p-3 bg-body-tertiary">
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto link-body-emphasis text-decoration-none">
<svg class="bi pe-none me-2" width="40" height="32"><use xlink:href="#bootstrap" /></svg>
<span class="fs-4">Sidebar</span>
</a>
<hr>
<ul class="nav nav-pills flex-column mb-auto">
<li class="nav-item">
<a href="#" class="nav-link active" aria-current="page">
<svg class="bi pe-none me-2" width="16" height="16"><use xlink:href="#home" /></svg>
Home
</a>
</li>
<li>
<a href="#" class="nav-link link-body-emphasis">
<svg class="bi pe-none me-2" width="16" height="16"><use xlink:href="#speedometer2" /></svg>
Dashboard
</a>
</li>
<li>
<a href="#" class="nav-link link-body-emphasis">
<svg class="bi pe-none me-2" width="16" height="16"><use xlink:href="#table" /></svg>
Orders
</a>
</li>
<li>
<a href="#" class="nav-link link-body-emphasis">
<svg class="bi pe-none me-2" width="16" height="16"><use xlink:href="#grid" /></svg>
Products
</a>
</li>
<li>
<a href="#" class="nav-link link-body-emphasis">
<svg class="bi pe-none me-2" width="16" height="16"><use xlink:href="#people-circle" /></svg>
Customers
</a>
</li>
</ul>
<hr>
<div class="dropdown">
<a href="#" class="d-flex align-items-center link-body-emphasis text-decoration-none dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<img src="https://github.com/mdo.png" alt="" width="32" height="32" class="rounded-circle me-2">
<strong>mdo</strong>
</a>
<ul class="dropdown-menu text-small shadow">
<li><a class="dropdown-item" href="#">New project...</a></li>
<li><a class="dropdown-item" href="#">Settings</a></li>
<li><a class="dropdown-item" href="#">Profile</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Sign out</a></li>
</ul>
</div>
</div>
</div>
<div class="col-10">
@RenderBody()
</div>
<div class="col-10">
@RenderBody()
</div>
</div>
</div> *@
@*
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2024 - Web - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</div>
</footer>
*@
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>
+48
View File
@@ -0,0 +1,48 @@
/* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */
a.navbar-brand {
white-space: normal;
text-align: center;
word-break: break-all;
}
a {
color: #0077cc;
}
.btn-primary {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.border-top {
border-top: 1px solid #e5e5e5;
}
.border-bottom {
border-bottom: 1px solid #e5e5e5;
}
.box-shadow {
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}
button.accept-policy {
font-size: 1rem;
line-height: inherit;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
white-space: nowrap;
line-height: 60px;
}
@@ -0,0 +1,2 @@
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
+3
View File
@@ -0,0 +1,3 @@
@using Web
@using Web.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+3
View File
@@ -0,0 +1,3 @@
@{
Layout = "_Layout";
}
+22
View File
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Content Remove="Views\Home\test.cshtml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.6" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.2" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
</ItemGroup>
</Project>
+8
View File
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
+22
View File
@@ -0,0 +1,22 @@
html {
font-size: 14px;
}
@media (min-width: 768px) {
html {
font-size: 16px;
}
}
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 60px;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

+4
View File
@@ -0,0 +1,4 @@
// Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.
// Write your JavaScript code.
+22
View File
@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2011-2021 Twitter, Inc.
Copyright (c) 2011-2021 The Bootstrap Authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Some files were not shown because too many files have changed in this diff Show More