code revision

This commit is contained in:
2025-08-06 15:25:47 -07:00
parent fc220beeac
commit c6edbbeba7
19 changed files with 10039 additions and 0 deletions

543
assets/css/admin.css Normal file
View File

@@ -0,0 +1,543 @@
/* Twilio WP Plugin Admin Styles */
.twp-dashboard {
margin-top: 20px;
}
.twp-stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.twp-stat-card {
background: #fff;
border: 1px solid #ccd0d4;
border-radius: 4px;
padding: 20px;
text-align: center;
}
.twp-stat-card h3 {
margin: 0 0 10px 0;
font-size: 14px;
color: #666;
font-weight: normal;
}
.twp-stat-value {
font-size: 32px;
font-weight: bold;
color: #2271b1;
}
.twp-recent-activity {
background: #fff;
border: 1px solid #ccd0d4;
border-radius: 4px;
padding: 20px;
}
.twp-recent-activity h2 {
margin-top: 0;
}
.twp-status {
display: inline-block;
padding: 3px 8px;
border-radius: 3px;
font-size: 12px;
font-weight: 600;
}
.twp-status.active {
background: #d4f4dd;
color: #00a32a;
}
.twp-status.inactive {
background: #fef8ee;
color: #996800;
}
/* Modal Styles */
.twp-modal {
position: fixed;
z-index: 9999;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
}
.twp-modal-content {
background: #fff;
padding: 30px;
border-radius: 8px;
width: 90%;
max-width: 600px;
max-height: 80vh;
overflow-y: auto;
}
.twp-modal-content.large {
max-width: 900px;
}
.twp-modal-content h2 {
margin-top: 0;
}
.twp-modal-content label {
display: block;
margin-top: 15px;
margin-bottom: 5px;
font-weight: 600;
}
.twp-modal-content input[type="text"],
.twp-modal-content input[type="number"],
.twp-modal-content input[type="time"],
.twp-modal-content input[type="url"],
.twp-modal-content select,
.twp-modal-content textarea {
width: 100%;
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
}
.twp-modal-content select[multiple] {
height: 120px;
}
.modal-buttons {
margin-top: 20px;
display: flex;
gap: 10px;
justify-content: flex-end;
}
/* Queue Grid */
.twp-queue-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 20px;
}
.twp-queue-card {
background: #fff;
border: 1px solid #ccd0d4;
border-radius: 4px;
padding: 20px;
}
.twp-queue-card h3 {
margin-top: 0;
margin-bottom: 15px;
color: #2271b1;
}
.queue-stats {
margin-bottom: 15px;
}
.queue-stats .stat {
display: flex;
justify-content: space-between;
margin-bottom: 8px;
padding-bottom: 8px;
border-bottom: 1px solid #f0f0f0;
}
.queue-stats .label {
color: #666;
}
.queue-stats .value {
font-weight: 600;
}
.queue-actions {
display: flex;
gap: 10px;
}
/* Workflow Builder */
.workflow-builder-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 30px;
margin: 20px 0;
}
.workflow-info-grid {
display: grid;
grid-template-columns: 1fr 1fr 200px;
gap: 20px;
margin-bottom: 20px;
padding-bottom: 20px;
border-bottom: 1px solid #ddd;
}
.workflow-steps,
.workflow-preview {
border: 1px solid #ddd;
border-radius: 4px;
padding: 15px;
min-height: 400px;
}
.workflow-steps h3,
.workflow-preview h3 {
margin-top: 0;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 1px solid #ddd;
}
.step-types-toolbar {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
gap: 10px;
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid #eee;
}
.step-btn {
display: flex;
flex-direction: column;
align-items: center;
padding: 10px 5px;
border: 2px solid #ddd;
background: #fff;
border-radius: 4px;
cursor: pointer;
transition: all 0.2s;
}
.step-btn:hover {
border-color: #2271b1;
background: #f0f6fc;
}
.step-btn .dashicons {
font-size: 20px;
margin-bottom: 5px;
}
.workflow-steps-container {
min-height: 200px;
}
.workflow-step {
background: #f7f7f7;
border: 1px solid #ddd;
border-radius: 4px;
padding: 15px;
margin-bottom: 10px;
position: relative;
cursor: move;
}
.workflow-step.dragging {
opacity: 0.5;
transform: rotate(5deg);
}
.workflow-step .step-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.workflow-step .step-type {
font-weight: 600;
color: #2271b1;
display: flex;
align-items: center;
gap: 8px;
}
.workflow-step .step-number {
background: #2271b1;
color: white;
border-radius: 50%;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
font-weight: bold;
}
.workflow-step .step-actions {
display: flex;
gap: 5px;
}
.workflow-step .step-actions button {
padding: 2px 8px;
font-size: 12px;
}
.workflow-step-content {
margin-top: 10px;
padding-top: 10px;
border-top: 1px solid #ddd;
color: #666;
font-size: 14px;
}
/* Workflow Preview */
.workflow-flow-chart {
text-align: center;
}
.flow-start {
background: #2271b1;
color: white;
padding: 10px 20px;
border-radius: 20px;
display: inline-block;
margin-bottom: 20px;
font-weight: 600;
}
.flow-step {
background: #f0f6fc;
border: 2px solid #2271b1;
border-radius: 8px;
padding: 10px 15px;
margin: 10px 0;
position: relative;
}
.flow-step::before {
content: '↓';
position: absolute;
top: -15px;
left: 50%;
transform: translateX(-50%);
background: white;
padding: 0 5px;
color: #2271b1;
font-size: 18px;
font-weight: bold;
}
.flow-step:first-child::before {
display: none;
}
/* Step Configuration Forms */
#step-config-content {
min-height: 200px;
}
.step-config-section {
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid #eee;
}
.step-config-section:last-child {
border-bottom: none;
}
.step-config-section h4 {
margin: 0 0 10px 0;
color: #2271b1;
}
.ivr-options {
border: 1px solid #ddd;
border-radius: 4px;
overflow: hidden;
}
.ivr-option {
display: grid;
grid-template-columns: 50px 1fr 120px 100px;
align-items: center;
padding: 10px;
border-bottom: 1px solid #ddd;
background: #fafafa;
}
.ivr-option:last-child {
border-bottom: none;
}
.ivr-option input[type="text"],
.ivr-option select {
border: 1px solid #ccc;
border-radius: 3px;
padding: 5px 8px;
}
.add-ivr-option {
padding: 10px;
text-align: center;
background: #f0f6fc;
border-top: 2px dashed #2271b1;
cursor: pointer;
}
.add-ivr-option:hover {
background: #e6f3ff;
}
/* Phone Numbers Page */
.twp-numbers-actions {
margin-bottom: 20px;
display: flex;
gap: 10px;
}
.twp-numbers-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 20px;
margin-top: 20px;
}
.twp-number-card {
background: #fff;
border: 1px solid #ccd0d4;
border-radius: 4px;
padding: 20px;
}
.twp-number-card .number {
font-size: 18px;
font-weight: 600;
color: #2271b1;
margin-bottom: 10px;
}
.twp-number-card .number-info {
margin-bottom: 15px;
}
.twp-number-card .number-info .label {
color: #666;
font-weight: 600;
margin-right: 5px;
}
.twp-number-actions {
display: flex;
gap: 10px;
margin-top: 15px;
}
.twp-search-form {
background: #f9f9f9;
border: 1px solid #ddd;
border-radius: 4px;
padding: 20px;
margin-bottom: 20px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 15px;
align-items: end;
}
.twp-search-form label {
display: block;
margin-bottom: 5px;
font-weight: 600;
}
#search-results {
margin-top: 20px;
}
.available-number {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 15px;
border: 1px solid #ddd;
border-radius: 4px;
margin-bottom: 10px;
background: #fff;
}
.available-number .number {
font-weight: 600;
color: #2271b1;
}
.available-number .capabilities {
font-size: 12px;
color: #666;
}
.available-number .price {
font-weight: 600;
color: #d63638;
}
/* Responsive Design */
@media (max-width: 768px) {
.twp-stats-grid {
grid-template-columns: 1fr;
}
.twp-queue-grid {
grid-template-columns: 1fr;
}
.workflow-builder-container {
grid-template-columns: 1fr;
}
}
/* Loading Spinner */
.twp-spinner {
display: inline-block;
width: 20px;
height: 20px;
border: 3px solid #f3f3f3;
border-top: 3px solid #2271b1;
border-radius: 50%;
animation: twp-spin 1s linear infinite;
}
@keyframes twp-spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Notification Styles */
.twp-notice {
padding: 12px;
margin: 15px 0;
border-left: 4px solid;
background: #fff;
}
.twp-notice.success {
border-color: #00a32a;
background: #d4f4dd;
}
.twp-notice.error {
border-color: #d63638;
background: #f4e2e2;
}
.twp-notice.warning {
border-color: #dba617;
background: #fef8ee;
}

1591
assets/js/admin.js Normal file

File diff suppressed because it is too large Load Diff