This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class TestController : ControllerBase
|
||||
{
|
||||
[HttpGet]
|
||||
[Produces("text/html")]
|
||||
public ContentResult GetSchema()
|
||||
{
|
||||
var html = @"
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<title>Схема подключения</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 40px;
|
||||
background: #f0f2f5;
|
||||
}
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
background: white;
|
||||
padding: 30px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
||||
}
|
||||
h1 {
|
||||
color: #2c3e50;
|
||||
border-bottom: 3px solid #3498db;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.node {
|
||||
background: #3498db;
|
||||
color: white;
|
||||
padding: 15px;
|
||||
margin: 10px;
|
||||
border-radius: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='container'>
|
||||
<h1>Схема подключения устройства</h1>
|
||||
<p>Эта страница возвращается из Web API контроллера</p>
|
||||
|
||||
<div style='text-align: center; margin: 30px 0;'>
|
||||
<div class='node'>Маршрутизатор</div>
|
||||
<div style='margin: 20px;'>↓</div>
|
||||
<div class='node'>Коммутатор</div>
|
||||
<div style='margin: 20px; display: flex; justify-content: space-around;'>
|
||||
<div>
|
||||
<div class='node'>Сервер</div>
|
||||
<div class='node'>Компьютер 1</div>
|
||||
<div class='node'>Компьютер 2</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p><strong>Время генерации:</strong> " + DateTime.Now.ToString("HH:mm:ss") + @"</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>";
|
||||
|
||||
return Content(html, "text/html; charset=utf-8");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user