Files
2026-02-22 09:40:08 +03:00

836 lines
25 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Медодс. Электронное подписание</title>
<style>
:root {
--el-color-primary: #409eff;
--el-color-success: #67c23a;
--el-color-warning: #e6a23c;
--el-color-danger: #f56c6c;
--el-color-info: #909399;
--el-text-color-primary: #303133;
--el-text-color-regular: #606266;
--el-text-color-secondary: #909399;
--el-text-color-placeholder: #c0c4cc;
--el-border-color-light: #e4e7ed;
--el-border-color-lighter: #ebeef5;
--el-border-color-extra-light: #f2f6fc;
--el-background-color-base: #f5f7fa;
--el-font-family: Verdana, Arial, Helvetica, sans-serif;
}
body {
width: 500px;
padding: 12px;
font-family: var(--el-font-family);
font-size: 13px;
color: var(--el-text-color-primary);
margin: 0;
background: var(--el-background-color-base);
}
.container {
background: white;
border-radius: 8px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
padding: 16px;
}
h3 {
margin: 0 0 16px 0;
color: var(--el-text-color-primary);
font-size: 16px;
font-weight: 600;
text-align: center;
padding-bottom: 12px;
border-bottom: 1px solid var(--el-border-color-lighter);
}
/* Accordion */
.accordion {
border: 1px solid var(--el-border-color-lighter);
border-radius: 6px;
overflow: hidden;
margin-top: 16px;
}
.accordion-header {
display: flex;
align-items: center;
padding: 3px 12px;
background: var(--el-background-color-base);
cursor: pointer;
border-bottom: 1px solid var(--el-border-color-lighter);
user-select: none;
transition: background-color 0.2s;
}
.accordion-header:hover {
background: var(--el-border-color-extra-light);
}
.accordion-icon {
margin-right: 8px;
font-size: 16px;
}
.accordion-title {
font-weight: 500;
font-size: 13px;
flex: 1;
}
.accordion-chevron {
font-size: 12px;
transition: transform 0.2s;
}
.accordion-content {
padding: 12px;
background: white;
display: none;
}
.accordion.expanded .accordion-content {
display: block;
}
.accordion.expanded .accordion-chevron {
transform: rotate(180deg);
}
.status-success {
color: var(--el-color-success);
}
.status-warning {
color: var(--el-color-warning);
}
/* Server info - compact */
.server-info {
font-size: 12px;
position: relative;
}
.server-field {
display: flex;
align-items: center;
/*margin-bottom: 8px;*/
min-height: 24px;
padding-right: 70px;
}
.server-label {
font-weight: 500;
color: var(--el-text-color-primary);
width: 75px;
flex-shrink: 0;
padding-right: 5px;
text-align: right;
}
.server-value {
color: var(--el-text-color-regular);
flex: 1;
padding: 2px 0;
padding-left: 5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 120px;
}
.server-input {
flex: 1;
height: 24px;
padding: 0 8px;
border: 1px solid var(--el-border-color-light);
border-radius: 4px;
font-size: 12px;
background: white;
outline: none;
display: none;
margin-left: 5px;
max-width: 120px;
}
.server-input.visible {
display: block;
}
.server-input:focus {
border-color: var(--el-color-primary);
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
}
.server-input.error {
border-color: var(--el-color-danger);
background: #fff5f5;
}
.server-value.hidden {
display: none;
}
/* Action buttons - positioned to the right of fields */
.action-buttons {
position: absolute;
top: 0;
right: 0;
display: flex;
flex-direction: column;
gap: 4px;
}
.action-btn {
width: 26px;
height: 26px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
font-size: 13px;
border: 1px solid var(--el-border-color-light);
background: white;
padding: 0;
transition: all 0.15s;
}
.action-btn:hover {
background: var(--el-border-color-extra-light);
}
.edit-btn {
color: var(--el-color-primary);
}
.edit-btn:hover {
background: #ebf8ff;
border-color: var(--el-color-primary);
}
.save-btn {
color: var(--el-color-success);
border-color: var(--el-color-success);
background: #f0fff4;
}
.save-btn:hover:not(.disabled) {
background: #e1f3d8;
}
.save-btn.disabled {
color: var(--el-text-color-placeholder);
border-color: var(--el-border-color-light);
background: var(--el-background-color-base);
cursor: not-allowed;
}
.cancel-btn {
color: var(--el-text-color-secondary);
}
.cancel-btn:hover {
background: #fed7d7;
border-color: var(--el-color-danger);
color: var(--el-color-danger);
}
/* Auth warning */
.auth-warning {
display: none;
padding: 12px;
background: #fdf6ec;
border: 1px solid #faecd8;
border-radius: 4px;
color: var(--el-color-warning);
font-size: 12px;
text-align: center;
margin-bottom: 12px;
}
.auth-warning.visible {
display: block;
}
/* Filters section - two rows */
.filters-section {
margin-bottom: 12px;
}
.filters-row {
display: flex;
gap: 8px;
margin-bottom: 12px;
}
.filter-group {
flex: 1;
min-width: 0;
position: relative;
}
.select-wrapper {
position: relative;
border: 1px solid var(--el-border-color-light);
border-radius: 4px;
background: white;
transition: all 0.2s;
}
.select-wrapper:hover {
border-color: var(--el-color-primary);
}
.select-wrapper.focused {
border-color: var(--el-color-primary);
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
}
.m-label {
position: absolute;
top: -7px;
left: 8px;
font-size: 11px;
color: var(--el-text-color-secondary);
background: white;
padding: 0 4px;
line-height: 1;
font-weight: 500;
z-index: 1;
pointer-events: none;
}
.m-select {
width: 100%;
height: 34px;
padding: 8px 24px 8px 8px;
border: none;
background: none;
font-size: 12px;
color: var(--el-text-color-regular);
outline: none;
cursor: pointer;
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
font-family: var(--el-font-family);
}
.m-select:focus {
outline: none;
}
.select-arrow {
position: absolute;
right: 8px;
top: 50%;
transform: translateY(-50%);
pointer-events: none;
color: var(--el-text-color-placeholder);
font-size: 12px;
}
/* Table header section */
.table-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
position: relative;
}
.controls {
display: flex;
gap: 8px;
align-items: center;
flex-shrink: 0;
z-index: 1;
}
.all-documents-btn {
height: 26px;
padding: 0 10px;
border: 1px solid var(--el-border-color-light);
border-radius: 4px;
background: white;
color: var(--el-text-color-regular);
font-size: 12px;
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
gap: 4px;
white-space: nowrap;
flex-shrink: 0;
font-family: var(--el-font-family);
}
.all-documents-btn:hover {
background: var(--el-background-color-base);
border-color: var(--el-border-color-lighter);
}
.search-container {
flex: 1;
min-width: 0;
margin: 0 12px;
position: relative;
}
.search-input {
width: 100%;
height: 28px;
padding: 2px 28px 2px 8px;
border: 1px solid var(--el-border-color-light);
border-radius: 4px;
font-size: 12px;
background: white;
outline: none;
transition: all 0.2s;
box-sizing: border-box;
font-family: var(--el-font-family);
}
.search-input:focus {
border-color: var(--el-color-primary);
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
}
.search-clear {
position: absolute;
right: 4px;
top: 50%;
transform: translateY(-50%);
background: none;
border: none;
color: var(--el-text-color-placeholder);
cursor: pointer;
font-size: 16px;
padding: 0;
width: 18px;
height: 18px;
display: flex;
align-items: center;
justify-content: center;
display: none;
border-radius: 50%;
transition: all 0.2s;
}
.search-clear.visible {
display: flex;
}
.search-clear:hover {
color: var(--el-text-color-secondary);
background: var(--el-background-color-base);
}
/* Refresh button */
.refresh-btn {
height: 26px;
padding: 0 10px;
border: 1px solid var(--el-border-color-light);
border-radius: 4px;
background: white;
color: var(--el-text-color-regular);
font-size: 12px;
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
gap: 4px;
white-space: nowrap;
flex-shrink: 0;
font-family: var(--el-font-family);
}
.refresh-btn:hover {
background: var(--el-background-color-base);
border-color: var(--el-border-color-lighter);
}
.refresh-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
/* Table section */
.table-section {
display: none;
margin-top: 16px;
}
.table-section.visible {
display: block;
}
/* Table */
.table-container {
border: 1px solid var(--el-border-color-lighter);
border-radius: 6px;
overflow: hidden;
max-height: 300px;
overflow-y: auto;
}
.data-table {
width: 100%;
border-collapse: collapse;
font-size: 12px;
table-layout: fixed;
font-family: var(--el-font-family);
}
.data-table thead {
background: var(--el-background-color-base);
border-bottom: 1px solid var(--el-border-color-lighter);
}
.data-table th {
padding: 10px 8px;
text-align: left;
font-weight: 600;
color: var(--el-text-color-primary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.data-table th:nth-child(1) {
width: 30%;
text-align: left;
}
.data-table th:nth-child(2) {
width: 45%;
text-align: center;
}
.data-table th:nth-child(3) {
width: 25%;
text-align: right;
}
.data-table tbody tr {
border-bottom: 1px solid var(--el-border-color-extra-light);
transition: background-color 0.2s;
}
.data-table tbody tr:hover {
background: var(--el-background-color-base);
}
.data-table td {
padding: 10px 8px;
vertical-align: top;
word-wrap: break-word;
overflow-wrap: break-word;
}
.data-table td:nth-child(1) {
text-align: left;
max-width: 150px;
}
.data-table td:nth-child(2) {
text-align: center;
}
.data-table td:nth-child(3) {
text-align: right;
}
.document-name {
font-weight: 500;
color: var(--el-text-color-primary);
margin-bottom: 0;
word-break: break-word;
line-height: 1.4;
font-family: var(--el-font-family);
}
.document-date {
font-size: 11px;
color: var(--el-text-color-secondary);
margin-top: 4px;
line-height: 1.3;
display: block;
font-family: var(--el-font-family);
}
.document-docs {
display: flex;
flex-direction: column;
gap: 3px;
align-items: center;
}
.doc-item {
font-size: 11px;
color: var(--el-text-color-regular);
background: #fdf6ec;
padding: 3px 6px;
border-radius: 3px;
width: 100%;
max-width: 220px;
box-sizing: border-box;
word-break: break-all;
overflow-wrap: break-word;
text-align: center;
white-space: normal;
border: 1px solid #faecd8;
font-family: var(--el-font-family);
}
.status-container {
display: flex;
flex-direction: column;
align-items: flex-end;
position: relative;
}
.document-status {
display: inline-flex;
align-items: center;
padding: 6px 8px;
border-radius: 4px;
font-size: 11px;
font-weight: 500;
white-space: normal;
word-break: break-word;
text-align: right;
line-height: 1.4;
margin-bottom: 0;
font-family: var(--el-font-family);
word-wrap: break-word;
overflow-wrap: break-word;
hyphens: auto;
position: relative;
max-width: 120px;
}
.status-date {
font-size: 11px;
color: var(--el-text-color-secondary);
margin-top: 4px;
line-height: 1.3;
text-align: right;
display: block;
font-family: var(--el-font-family);
}
.status-completed {
background: #f0f9eb;
color: var(--el-color-success);
border: 1px solid #e1f3d8;
}
.status-processing {
background: #ecf5ff;
color: var(--el-color-primary);
border: 1px solid #d9ecff;
}
.status-error {
background: #fef0f0;
color: var(--el-color-danger);
border: 1px solid #fde2e2;
}
.status-waiting {
background: #fdf6ec;
color: var(--el-color-warning);
border: 1px solid #faecd8;
}
/* Empty state */
.empty-state {
padding: 40px 20px;
text-align: center;
color: var(--el-text-color-placeholder);
font-size: 13px;
font-family: var(--el-font-family);
}
.empty-state.hidden {
display: none;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/* Utility classes */
.visible {
display: block !important;
}
.hidden {
display: none !important;
}
.table-section.hidden {
display: none !important;
}
.table-section.visible {
display: block !important;
}
</style>
</head>
<body>
<div class="container">
<h3>Медодс. Электронное подписание</h3>
<!-- Auth warning -->
<div id="authWarning" class="auth-warning">
Для загрузки данных необходимо войти в Медодс
</div>
<!-- Table section -->
<div id="tableSection" class="table-section">
<!-- Table header with search and buttons -->
<div class="table-header">
<button id="allDocumentsBtn" class="all-documents-btn" title="Все документы">
🔎 Расширенный поиск
</button>
<div class="search-container">
<input type="text" id="searchInput" class="search-input" placeholder="Поиск ...">
<button id="searchClear" class="search-clear" title="Очистить поиск">×</button>
</div>
<div class="controls">
<button id="refreshBtn" class="refresh-btn">
<span>🔄 Обновить</span>
</button>
</div>
</div>
<!-- Filters in two rows -->
<div class="filters-section">
<div class="filters-row">
<div class="filter-group">
<div class="select-wrapper" id="esiaFilterWrapper">
<span class="m-label">Подписание</span>
<select id="esiaFilter" class="m-select">
<option value="all">Все</option>
<option value="esia">Только ЕСИА</option>
<option value="not_esia">Только не ЕСИА</option>
</select>
<span class="select-arrow"></span>
</div>
</div>
<div class="filter-group">
<div class="select-wrapper" id="senderFilterWrapper">
<span class="m-label">Отправитель</span>
<select id="senderFilter" class="m-select">
<option value="all">Все</option>
<option value="my">Только мои</option>
<option value="not_my">Только не мои</option>
</select>
<span class="select-arrow"></span>
</div>
</div>
</div>
<div class="filters-row">
<div class="filter-group">
<div class="select-wrapper" id="statusFilterWrapper">
<span class="m-label">Статус</span>
<select id="statusFilter" class="m-select">
<option value="all">Все</option>
<option value="processing">В обработке</option>
<option value="completed">Завершено</option>
</select>
<span class="select-arrow"></span>
</div>
</div>
<div class="filter-group">
<div class="select-wrapper" id="periodFilterWrapper">
<span class="m-label">Период</span>
<select id="periodFilter" class="m-select">
<option value="today">Сегодня</option>
<option value="3days">За 3 дня</option>
<option value="7days">За 7 дней</option>
</select>
<span class="select-arrow"></span>
</div>
</div>
</div>
</div>
<div class="table-container">
<table class="data-table" id="documentsTable">
<thead>
<tr>
<th>ФИО клиента</th>
<th>Документы на подписание</th>
<th>Статус</th>
</tr>
</thead>
<tbody id="tableBody">
<!-- Данные будут добавляться динамически -->
</tbody>
</table>
<div id="emptyState" class="empty-state hidden">
Нет документов
</div>
</div>
</div>
<!-- Server settings accordion -->
<div id="serverAccordion" class="accordion">
<div class="accordion-header" id="accordionHeader">
<span class="accordion-icon" id="accordionIcon">⚠️</span>
<span class="accordion-title" id="accordionTitle">Настройка сервера</span>
<span class="accordion-chevron"></span>
</div>
<div class="accordion-content" id="accordionContent">
<div class="server-info">
<div class="server-field">
<span class="server-label">IP Сервера:</span>
<span id="currentServerIp" class="server-value">не настроен</span>
<input id="editServerIp" class="server-input" type="text" placeholder="127.0.0.1"
maxlength="15">
</div>
<div class="server-field">
<span class="server-label">Порт:</span>
<span id="currentServerPort" class="server-value">не настроен</span>
<input id="editServerPort" class="server-input" type="number" placeholder="8000" min="1"
max="65535">
</div>
<!-- Edit button (shows when viewing settings) -->
<div class="action-buttons" id="viewButtons">
<button class="action-btn edit-btn" id="editButton" title="Редактировать">⚙️</button>
<button class="action-btn edit-btn hidden" id="adminButton"
title="Администрирование">🔑</button>
</div>
<!-- Save/Cancel buttons (shows when editing) -->
<div class="action-buttons hidden" id="editButtons">
<button class="action-btn save-btn disabled" id="saveOptions" title="Сохранить"></button>
<button class="action-btn cancel-btn" id="cancelOptions" title="Отменить"></button>
</div>
</div>
</div>
</div>
</div>
<script src="popup.js"></script>
</body>
</html>