first commit

This commit is contained in:
Awey01 2024-09-11 14:15:45 +00:00
parent 9ab2ee130e
commit 9501fb5a43
2 changed files with 513 additions and 0 deletions

View File

@ -0,0 +1,26 @@
from frappe.core.doctype.report.report import Report
import datetime
import frappe
class CustomReport(Report):
def execute_script_report(self, filters):
# Custom threshold, could be set from a config file or environment variable
threshold = 9999999
res = []
start_time = datetime.datetime.now()
# The JOB
if self.is_standard == "Yes":
res = self.execute_module(filters)
else:
res = self.execute_script(filters)
# automatically set as prepared
execution_time = (datetime.datetime.now() - start_time).total_seconds()
if execution_time > threshold and not self.prepared_report:
frappe.enqueue(enable_prepared_report, report=self.name)
frappe.cache.hset("report_execution_time", self.name, execution_time)
return res

View File

@ -0,0 +1,487 @@
/* Colours */
:root {
--background-color: #e0e0e0;
--button-color: #f0f0f3;
--shadow-color: #a3b1c6;
--highlight-color: #ffffff;
--text-color: #36414c;
}
/* Neomorphic button styles */
.btn {
color: var(--text-color) !important;
background-color: var(--button-color) !important;
border-radius: 12px !important;
box-shadow: 9px 9px 16px var(--shadow-color), -9px -9px 16px var(--highlight-color) !important;
transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-in-out !important;
cursor: pointer !important;
position: relative;
overflow: hidden;
border: none !important;
z-index: 1 !important;
}
.btn::after {
content: "" !important;
position: absolute !important;
width: 0 !important;
height: 100% !important;
top: 0 !important;
right: 0 !important;
z-index: -1 !important;
background-color: var(--highlight-color) !important;
border-radius: 12px !important;
box-shadow: inset 2px 2px 2px 0px rgba(255, 255, 255, .5) ,
7px 7px 20px 0px rgba(0, 0, 0, .1) ,
4px 4px 5px 0px rgba(0, 0, 0, .1) !important;
transition: all 0.3s ease !important;
}
.btn:hover::after {
left: 0 !important;
width: 100% !important;
}
.form-footer {
position: relative; /* Ensure the footer is positioned relative for absolute positioning inside */
}
.form-footer .scroll-to-top {
position: absolute;
height: 28px;
right: 10px; /* Adjust this value to position the button correctly */
bottom: 10px; /* Adjust this value to position the button correctly */
}
.form-footer .scroll-to-top:active {
top: auto !important; /* Override any top value set by active state */
bottom: 10px !important; /* Ensure the bottom value is consistent */
}
.btn:active {
top: 2px;
box-shadow: inset 0px -2px 5px rgba(255, 255, 255, .5),
inset 0px 2px 5px rgba(0, 0, 0, .15);
background-color: var(--background-color) !important;
}
/* Neomorphic input field styles */
input[type="text"], input[type="password"], textarea, .form-control {
background-color: #f0f0f3 !important;
border: none !important;
border-radius: 12px !important;
color: var(--text-color) !important;
box-shadow: inset 1px 1px 5px #BABECC, inset -5px -5px 10px #FFF;
transition: box-shadow 0.2s ease, background-color 0.2s ease !important;
width: 100% !important;
box-sizing: border-box !important;
margin-bottom: 10px !important;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus, .form-control:focus {
outline: none !important;
box-shadow: inset 3px 3px 6px #babec6, inset -3px -3px 6px #ffffff !important;
}
/* Styles for additional elements (icons, animations) from the example */
.box {
display: flex !important;
justify-content: center !important;
align-items: center !important;
background: #eee !important;
padding: 20px !important;
height: 200px !important;
width: 200px !important;
border-radius: 20px !important;
box-shadow: 8px 8px 20px #ddd, -8px -8px 20px #fff, -6px -6px 20px #fff inset, 8px 8px 20px #ddd inset !important;
cursor: pointer !important;
transition: all 0.5s ease-out !important;
}
.box {
animation: shake 2s infinite ease-in-out !important;
animation-direction: alternate !important;
}
@keyframes shake {
from {
transform: translate3d(10px, 0, 0) !important;
}
to {
transform: translate3d(0, 0, 0) !important;
}
}
/* Neomorphic circular animation styles */
.box2 {
position: relative !important;
height: 300px !important;
width: 300px !important;
border-radius: 50% !important;
background: #eee !important;
box-shadow: 6px 6px 20px #ddd, -6px -6px 20px #fff !important;
animation: rotate 5s infinite linear !important;
}
.circle {
position: absolute !important;
top: 0 !important;
right: -20% !important;
height: 150px !important;
width: 150px !important;
border-radius: 50% !important;
background: #eee !important;
box-shadow: 6px 6px 20px #ddd, -6px -6px 20px #fff !important;
animation: rotate 1s infinite linear !important;
}
@keyframes rotate {
from {
transform: rotate(0deg) !important;
}
to {
transform: rotate(360deg) !important;
}
}
.search-bar .search-icon {
margin-top: -5px !important;
}
/* Neomorphic styles for plus buttons */
.add-assignment-btn, .add-attachment-btn, .add-tags-btn, .share-doc-btn {
color: var(--text-color);
background-color: var(--button-color);
border-radius: 50% !important;
box-shadow: 9px 9px 16px var(--shadow-color), -9px -9px 16px var(--highlight-color) !important;
transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-in-out;
cursor: pointer;
width: 30px !important;
height: 30px !important;
display: flex;
justify-content: center;
align-items: center;
border: none;
padding: 0;
}
.add-assignment-btn svg, .add-attachment-btn svg, .add-tags-btn svg, .share-doc-btn svg {
fill: var(--text-color);
width: 15px;
height: 15px;
}
.add-assignment-btn:hover, .add-attachment-btn:hover, .add-tags-btn:hover, .share-doc-btn:hover {
box-shadow: 6px 6px 16px var(--shadow-color), -6px -6px 16px var(--highlight-color);
}
.add-assignment-btn:after, .add-attachment-btn:after, .add-tags-btn:after, .share-doc-btn:after {
content: "";
position: absolute;
width: 0;
height: 100%;
top: 0;
right: 0;
z-index: -1;
background-color: #663dff;
border-radius: 50%;
box-shadow: inset 2px 2px 2px 0px rgba(255, 255, 255, .5),
7px 7px 20px 0px rgba(0, 0, 0, .1),
4px 4px 5px 0px rgba(0, 0, 0, .1);
transition: all 0.3s ease;
}
.add-assignment-btn:hover:after, .add-attachment-btn:hover:after, .add-tags-btn:hover:after, .share-doc-btn:hover:after {
left: 0;
width: 100%;
}
.add-assignment-btn:active, .add-attachment-btn:active, .add-tags-btn:active, .share-doc-btn:active {
box-shadow: inset 3px 3px 6px var(--shadow-color), inset -3px -3px 6px var(--highlight-color);
background-color: var(--background-color);
}
/* Neomorphic styles for toggle switches */
input[type="checkbox"] {
-webkit-appearance: none !important;
-moz-appearance: none !important;
appearance: none !important;
width: 40px !important;
height: 20px !important;
background-color: #f0f0f3 !important;
border-radius: 20px !important;
position: relative !important;
cursor: pointer !important;
box-shadow: 4px 4px 6px #babec6, -4px -4px 6px #ffffff !important;
transition: background-color 0.4s ease, box-shadow 0.4s ease !important;
margin-right: 10px !important;
/* margin-top: 4px !important; */
margin-bottom: 4px !important;
outline: none !important;
border: none !important;
/* z-index: 99 !important; */
}
input[type="checkbox"]::after {
content: "" !important;
width: 18px !important;
height: 18px !important;
background-color: #ffffff !important;
border-radius: 50% !important;
position: absolute !important;
top: 1px !important;
left: 1px !important;
box-shadow: 2px 2px 4px #babec6, -2px -2px 4px #ffffff !important;
transition: left 0.4s ease, box-shadow 0.4s ease, transform 0.2s ease !important;
border: none !important;
}
input[type="checkbox"]:checked {
background-color: #4caf50 !important;
background-image: none !important;
box-shadow: 4px 4px 6px #babec6, -4px -4px 6px #ffffff !important;
}
input[type="checkbox"]:checked::after {
left: 20px !important;
transform: scale(1.1) !important;
box-shadow: 2px 2px 4px #babec6, -2px -2px 4px #ffffff !important;
}
input[type="checkbox"]:focus {
outline: none !important;
box-shadow: 4px 4px 6px #babec6, -4px -4px 6px #ffffff !important;
}
input[type="checkbox"]:active::after {
transform: scale(0.9) !important;
box-shadow: inset 2px 2px 4px #babec6, inset -2px -2px 4px #ffffff !important;
}
.form-links .document-link .btn-new {
box-shadow: 9px 9px 16px var(--shadow-color), -9px -9px 16px var(--highlight-color) !important;
}
.form-links .document-link .document-link-badge, .form-links .document-link .report-link-badge {
box-shadow: 9px 9px 16px var(--shadow-color), -9px -9px 16px var(--highlight-color) !important;
}
.btn-group > .btn:not(:last-child):not(.dropdown-toggle), div#driver-popover-item .driver-popover-footer .btn-group > button:not(:last-child):not(.dropdown-toggle),
.btn-group > .btn-group:not(:last-child) > .btn,
div#driver-popover-item .driver-popover-footer .btn-group > .btn-group:not(:last-child) > button {
margin: 0px 9px 0px 0px !important;
}
.grid-row-check {
margin-top: -1px !important;
}
/* Neomorphic styles for primary button */
.btn-primary {
color: var(--highlight-color) !important;
background-color: var(--primary-color) !important;
}
.btn-primary:hover {
box-shadow: 6px 6px 16px var(--shadow-color), -6px -6px 16px var(--highlight-color) !important;
}
.btn-primary:hover::after {
left: 0 !important;
width: 100% !important;
}
.btn-primary:active {
box-shadow: inset 3px 3px 6px var(--shadow-color), inset -3px -3px 6px var(--highlight-color) !important;
background-color: var(--background-color) !important;
}
.btn-primary::after {
content: "" !important;
position: absolute !important;
width: 0 !important;
height: 100% !important;
top: 0 !important;
right: 0 !important;
z-index: -1 !important;
background-color: #36414c !important;
border-radius: 12px !important;
box-shadow: inset 2px 2px 2px 0px rgba(255, 255, 255, .5) ,
7px 7px 20px 0px rgba(0, 0, 0, .1) ,
4px 4px 5px 0px rgba(0, 0, 0, .1) !important;
transition: all 0.3s ease !important;
}
@media (min-width: 1200px) {
.container-xl, .container-lg, .container-md, .container-sm, .container {
max-width: 1920px !important;
}
}
.btn.btn-danger, div#driver-popover-item .driver-popover-footer button.btn-danger {
background-color: var(--danger) !important;
color: #fff !important;
}
.btn-danger::after {
content: "" !important;
position: absolute !important;
width: 0 !important;
height: 100% !important;
top: 0 !important;
right: 0 !important;
z-index: -1 !important;
background-color: #ff0000 !important;
border-radius: 12px !important;
box-shadow: inset 2px 2px 2px 0px rgba(255, 255, 255, .5) ,
7px 7px 20px 0px rgba(0, 0, 0, .1) ,
4px 4px 5px 0px rgba(0, 0, 0, .1) !important;
transition: all 0.3s ease !important;
}
.grid-header-toolbar .row-actions button:not(:last-child) {
margin-left: 15px !important;
margin-bottom: var(--margin-xs) !important;
}
.grid-row-check::after {
opacity: 1 !important;
}
.sr-only {
display: none !important;
}
.new-timeline .timeline-item .action-buttons {
overflow: unset !important;
}
/* Общие стили для неоморфического эффекта */
.sidebar-item-container .item-anchor {
transition: transform 0.4s ease-in-out, box-shadow 0.4s ease-in-out, font-weight 0.4s ease-in-out !important;
display: flex;
align-items: center;
padding: 10px;
border-radius: 10px;
background: transparent !important; /* Прозрачный фон */
box-shadow: none !important; /* Убираем тень для самого элемента */
text-decoration: none;
color: inherit;
margin-bottom: 6px; /* Добавляем отступ снизу */
overflow: visible !important; /* Убираем ограничение переполнения */
}
.sidebar-item-content {
display: flex;
align-items: center;
overflow: visible !important; /* Убираем ограничение переполнения */
}
.sidebar-item-icon {
display: flex;
align-items: center;
justify-content: center;
width: 30px; /* Уменьшаем ширину */
height: 30px; /* Уменьшаем высоту */
margin-right: 10px;
border-radius: 50%;
background: transparent !important; /* Прозрачный фон для иконок */
box-shadow: 5px 5px 10px rgba(55, 84, 170, .2),
-5px -5px 10px rgba(255, 255, 255, 1),
inset 0px 0px 4px rgba(255, 255, 255, .3),
inset 5px 5px 10px rgba(55, 84, 170, 0),
inset -5px -5px 10px rgba(255, 255, 255, 0),
0px 0px 4px rgba(255, 255, 255, 0) !important; /* Менее размытые и компактные тени */
line-height: 30px; /* Центрирование иконок по вертикали */
position: relative; /* Для смещения по top */
transition: box-shadow 0.2s ease-in-out, top 0.2s ease-in-out, border 0.2s ease-in-out !important; /* Плавный переход для тени и смещения */
}
.sidebar-item-label {
flex-grow: 1; /* Расширяем текст до доступного пространства */
display: flex;
align-items: center;
}
/* Эффекты при наведении */
.sidebar-item-container .item-anchor:hover .sidebar-item-icon {
box-shadow: 2px 2px 10px rgba(55, 84, 170, .4),
-2px -2px 10px rgba(255, 255, 255, 1) !important; /* Более выраженные тени при наведении */
transition: box-shadow 0.2s ease-in-out !important; /* Плавный переход для тени */
}
/* Эффекты при нажатии и удержании */
.sidebar-item-container .item-anchor:active .sidebar-item-icon,
.sidebar-item-container .item-anchor.active .sidebar-item-icon {
box-shadow: inset 7px 7px 15px rgba(55, 84, 170, .15),
inset -7px -7px 20px rgba(255, 255, 255, 1),
0px 0px 4px rgba(255, 255, 255, .2) !important; /* Вдавливание иконки */
top: 2px !important; /* Смещение вниз для эффекта нажатия */
border: 1px solid rgba(0, 0, 0, 0.1) !important; /* Легкая рамка при нажатии */
transition: box-shadow 100 ease-in-out, top 100 ease-in-out, border 100 ease-in-out !important; /* Плавный переход для тени, смещения и рамки */
}
/* Сброс состояния иконки после отпускания */
.sidebar-item-container .item-anchor:not(:active):not(:active) .sidebar-item-icon {
box-shadow: 5px 5px 10px rgba(55, 84, 170, .2),
-5px -5px 10px rgba(255, 255, 255, 1),
inset 0px 0px 4px rgba(255, 255, 255, .3)
inset 5px 5px 10px rgba(55, 84, 170, 0),
inset -5px -5px 10px rgba(255, 255, 255, 0),
0px 0px 4px rgba(255, 255, 255, 0) !important; /* Сброс внешних теней после отпускания */
top: 0 !important; /* Сброс смещения */
border: 1px solid transparent !important; /* Прозрачная рамка после отпускания */
transition: box-shadow 100 ease-in-out, top 100 ease-in-out, border 100 ease-in-out !important; /* Плавный переход для тени, смещения и рамки */
}
.standard-sidebar .standard-sidebar-item svg,
.desk-sidebar .standard-sidebar-item svg,
.search-dialog .search-results .search-sidebar .standard-sidebar-item svg {
margin-right: 5px !important;
}
.widget.links-widget-box {
display: flex !important;
flex-direction: column !important;
min-height: 1px !important;
padding: 15px !important;
border-radius: 12px !important;
height: 100% !important;
background-color: #ffffff !important; /* Фон теперь постоянный */
border: none !important;
margin-right: 10px !important;
margin-bottom: 10px !important;
transition: box-shadow 0.3s ease, background-color 0.3s ease; /* Плавный переход для эффектов */
box-shadow: 8px 8px 16px rgba(190, 190, 190, 0.5),
-8px -8px 16px rgba(255, 255, 255, 0.5) !important; /* Основные тени */
}
.widget.links-widget-box:hover {
box-shadow: 10px 10px 22px rgba(190, 190, 190, 1),
-10px -10px 22px rgba(255, 255, 255, 1) !important; /* Усиленные тени при наведении */
}
.grid-row-check {
margin-top: -2px !important; /* Adjust this value as needed to position the checkbox correctly */
}