@saltcorn/server 0.6.4-beta.2 → 0.6.4-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/resetpw.js +7 -7
- package/locales/en.json +3 -1
- package/package.json +15 -15
- package/public/flatpickr.min.js +2 -2
- package/public/gridedit.js +169 -221
- package/public/luxon.min.js +1 -0
- package/public/saltcorn.js +70 -7
- package/public/tabulator.min.js +3 -0
- package/public/tabulator_bootstrap4.min.css +2 -0
- package/routes/list.js +176 -89
- package/routes/plugins.js +2 -0
- package/wrapper.js +5 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.tabulator{position:relative;border:1px solid #dee2e6;font-size:16px;text-align:left;overflow:hidden;-webkit-transform:translatez(0);-moz-transform:translatez(0);-ms-transform:translatez(0);-o-transform:translatez(0);transform:translatez(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableholder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitDataTable]{display:inline-block}.tabulator.tabulator-block-select{user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:1px solid #dee2e6;background-color:#fff;color:#555;font-weight:700;white-space:nowrap;overflow:hidden;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-col{display:inline-block;position:relative;box-sizing:border-box;border-right:1px solid #aaa;background:#fff;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #dee2e6;background:#e6e6e6;pointer-events:none}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;position:relative;padding:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-menu-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder{position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{box-sizing:border-box;width:100%;border:1px solid #999;padding:1px;background:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-menu-button+.tabulator-title-editor{width:calc(100% - 22px)}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{display:flex;align-items:center;position:absolute;top:0;bottom:0;right:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{position:relative;display:flex;border-top:1px solid #aaa;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col:first-child .tabulator-col-resize-handle.prev{display:none}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{position:relative;box-sizing:border-box;margin-top:2px;width:100%;text-align:center}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea{height:auto!important}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg{margin-top:3px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear{width:0;height:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover{cursor:pointer;background-color:#e6e6e6}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter{color:#bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-top:none;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-col-sorter{color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-top:none;border-bottom:6px solid #666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-col-sorter{color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:none;border-top:6px solid #666;color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{writing-mode:vertical-rl;text-orientation:mixed;display:flex;align-items:center;justify-content:center}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title{transform:rotate(180deg)}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title{padding-right:0;padding-top:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title{padding-right:0;padding-bottom:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter{justify-content:center;left:0;right:0;top:4px;bottom:auto}.tabulator .tabulator-header .tabulator-frozen{display:inline-block;position:absolute;z-index:10}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #dee2e6}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #dee2e6}.tabulator .tabulator-header .tabulator-calcs-holder{box-sizing:border-box;min-width:600%;background:#fff!important;border-top:1px solid #dee2e6;border-bottom:1px solid #aaa;overflow:hidden}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:#fff!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{min-width:600%}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableholder{position:relative;width:100%;white-space:nowrap;overflow:auto;-webkit-overflow-scrolling:touch}.tabulator .tabulator-tableholder:focus{outline:none}.tabulator .tabulator-tableholder .tabulator-placeholder{box-sizing:border-box;display:flex;align-items:center;width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%;min-width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder span{display:inline-block;margin:0 auto;padding:10px;color:#ccc;font-weight:700;font-size:20px}.tabulator .tabulator-tableholder .tabulator-table{position:relative;display:inline-block;background-color:#fff;white-space:nowrap;overflow:visible;color:#333}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs{font-weight:700;background:#ececec!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border-bottom:2px solid #dee2e6}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border-top:2px solid #dee2e6}.tabulator .tabulator-footer{padding:5px 10px;border-top:1px solid #dee2e6;background-color:#e6e6e6;text-align:right;color:#555;font-weight:700;white-space:nowrap;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-footer .tabulator-calcs-holder{box-sizing:border-box;width:calc(100% + 20px);margin:-5px -10px 5px;text-align:left;background:#f3f3f3!important;border-bottom:1px solid #dee2e6;border-top:1px solid #dee2e6;overflow:hidden}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{background:#f3f3f3!important}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{margin-bottom:-5px;border-bottom:none}.tabulator .tabulator-footer .tabulator-paginator{color:#555;font-family:inherit;font-weight:inherit;font-size:inherit}.tabulator .tabulator-footer .tabulator-page-size{display:inline-block;margin:0 5px;padding:2px 5px;border:1px solid #dee2e6;border-radius:3px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{display:inline-block;margin:0 2px;padding:2px 5px;border:1px solid #dee2e6;border-radius:3px;background:hsla(0,0%,100%,.2)}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{cursor:pointer;background:rgba(0,0,0,.2);color:#fff}.tabulator .tabulator-col-resize-handle{position:absolute;right:0;top:0;bottom:0;width:5px}.tabulator .tabulator-col-resize-handle.prev{left:0;right:auto}.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}.tabulator .tabulator-loader{position:absolute;display:flex;align-items:center;top:0;left:0;z-index:100;height:100%;width:100%;background:rgba(0,0,0,.4);text-align:center}.tabulator .tabulator-loader .tabulator-loader-msg{display:inline-block;margin:0 auto;padding:10px 20px;border-radius:10px;background:#fff;font-weight:700;font-size:16px}.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-loading{border:4px solid #333;color:#000}.tabulator .tabulator-loader .tabulator-loader-msg.tabulator-error{border:4px solid #d00;color:#590000}.tabulator-row{position:relative;box-sizing:border-box;min-height:24px;background-color:#fff}.tabulator-row.tabulator-row-even{background-color:#f9f9f9}.tabulator-row.tabulator-selectable:hover{background-color:#f5f5f5;cursor:pointer}.tabulator-row.tabulator-selected{background-color:#9abcea}.tabulator-row.tabulator-selected:hover{background-color:#769bcc;cursor:pointer}.tabulator-row.tabulator-row-moving{border:1px solid #000;background:#fff}.tabulator-row.tabulator-moving{position:absolute;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6;pointer-events:none;z-index:15}.tabulator-row .tabulator-row-resize-handle{position:absolute;right:0;bottom:0;left:0;height:5px}.tabulator-row .tabulator-row-resize-handle.prev{top:0;bottom:auto}.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}.tabulator-row .tabulator-frozen{display:inline-block;position:absolute;background-color:inherit;z-index:10}.tabulator-row .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #dee2e6}.tabulator-row .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #dee2e6}.tabulator-row .tabulator-responsive-collapse{box-sizing:border-box;padding:5px;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.tabulator-row .tabulator-responsive-collapse:empty{display:none}.tabulator-row .tabulator-responsive-collapse table{font-size:16px}.tabulator-row .tabulator-responsive-collapse table tr td{position:relative}.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type{padding-right:10px}.tabulator-row .tabulator-cell{display:inline-block;position:relative;box-sizing:border-box;padding:4px;border-right:1px solid #dee2e6;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1d68cd;outline:none;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{border:1px;background:transparent}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #d00}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{border:1px;background:transparent;color:#d00}.tabulator-row .tabulator-cell:first-child .tabulator-col-resize-handle.prev{display:none}.tabulator-row .tabulator-cell.tabulator-row-handle{display:inline-flex;align-items:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box{width:80%}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar{width:100%;height:3px;margin-top:2px;background:#666}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #dee2e6;border-bottom:2px solid #dee2e6}.tabulator-row .tabulator-cell .tabulator-data-tree-control{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{display:inline-flex;align-items:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;height:15px;width:15px;border-radius:20px;background:#666;color:#fff;font-weight:700;font-size:1.1em}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{opacity:.7}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close{display:initial}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open,.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{display:inline-block;height:14px;width:14px;border-radius:14px}.tabulator-row.tabulator-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #dee2e6;border-top:1px solid #999;padding:5px 5px 5px 10px;background:#ccc;font-weight:700;min-width:100%}.tabulator-row.tabulator-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-row.tabulator-group.tabulator-group-level-1{padding-left:30px}.tabulator-row.tabulator-group.tabulator-group-level-2{padding-left:50px}.tabulator-row.tabulator-group.tabulator-group-level-3{padding-left:70px}.tabulator-row.tabulator-group.tabulator-group-level-4{padding-left:90px}.tabulator-row.tabulator-group.tabulator-group-level-5{padding-left:110px}.tabulator-row.tabulator-group .tabulator-group-toggle{display:inline-block}.tabulator-row.tabulator-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-row.tabulator-group span{margin-left:10px;color:#d00}.tabulator-menu{position:absolute;display:inline-block;box-sizing:border-box;background:#fff;border:1px solid #dee2e6;box-shadow:0 0 5px 0 rgba(0,0,0,.2);font-size:16px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-menu .tabulator-menu-item{position:relative;box-sizing:border-box;padding:5px 10px;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{cursor:pointer;background:#f9f9f9}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu{padding-right:25px}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu:after{display:inline-block;position:absolute;top:calc(5px + .4em);right:10px;height:7px;width:7px;content:"";border-color:#dee2e6;border-style:solid;border-width:1px 1px 0 0;vertical-align:top;transform:rotate(45deg)}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #dee2e6}.tabulator-edit-select-list{position:absolute;display:inline-block;box-sizing:border-box;max-height:200px;border:1px solid #dee2e6;font-size:16px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-edit-select-list .tabulator-edit-select-list-item{padding:4px;color:#333}.tabulator-edit-select-list .tabulator-edit-select-list-item.active{background:#1d68cd}.tabulator-edit-select-list .tabulator-edit-select-list-item.focused{outline:1px solid #1d68cd}.tabulator-edit-select-list .tabulator-edit-select-list-item:hover{cursor:pointer;background:#1d68cd}.tabulator-edit-select-list .tabulator-edit-select-list-notice{padding:4px;color:#333;text-align:center}.tabulator-edit-select-list .tabulator-edit-select-list-group{border-bottom:1px solid #dee2e6;padding:6px 4px 4px;color:#333;font-weight:700}.tabulator.tabulator-ltr{direction:ltr}.tabulator.tabulator-rtl{text-align:initial;direction:rtl}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{border-left:1px solid #aaa;border-right:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{margin-right:0;margin-left:-1px}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:0;padding-left:25px}.tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-arrow{left:8px;right:auto}.tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{position:static}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell{border-right:initial;border-left:1px solid #dee2e6}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch{margin-right:0;margin-left:5px;border-bottom-left-radius:0;border-bottom-right-radius:1px;border-left:initial;border-right:2px solid #dee2e6}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control{margin-right:0;margin-left:5px}.tabulator.tabulator-rtl .tabulator-col-resize-handle{position:absolute;left:0;right:auto}.tabulator.tabulator-rtl .tabulator-col-resize-handle.prev{right:0;left:auto}.tabulator-print-fullscreen{position:absolute;top:0;bottom:0;left:0;right:0;z-index:10000}body.tabulator-print-fullscreen-hide>:not(.tabulator-print-fullscreen){display:none!important}.tabulator-print-table{border-collapse:collapse}.tabulator-print-table .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #dee2e6;border-bottom:2px solid #dee2e6}.tabulator-print-table .tabulator-print-table-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #dee2e6;border-top:1px solid #999;padding:5px 5px 5px 10px;background:#ccc;font-weight:700;min-width:100%}.tabulator-print-table .tabulator-print-table-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td{padding-left:30px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td{padding-left:50px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td{padding-left:70px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td{padding-left:90px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td{padding-left:110px!important}.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle{display:inline-block}.tabulator-print-table .tabulator-print-table-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-print-table .tabulator-print-table-group span{margin-left:10px;color:#d00}.tabulator-print-table .tabulator-data-tree-control{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0,0,0,.1);overflow:hidden}.tabulator-print-table .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0,0,0,.2)}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator{background-color:#fff;border:none}.tabulator .tabulator-header{border-top:1px solid #dee2e6;border-bottom:2px solid #dee2e6;color:inherit}.tabulator .tabulator-header .tabulator-col{border-right:none;background-color:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{padding:12px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{right:0}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{border-top:1px solid #dee2e6}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input{padding:.375rem .75rem;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;font-size:1rem;line-height:1.5;color:#495057}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input:focus{color:#495057;background-color:#fff;border:1px solid #1d68cd;outline:0}.tabulator .tabulator-header .tabulator-calcs-holder{width:100%;border-bottom:1px solid #dee2e6}.tabulator .tabulator-tableholder .tabulator-placeholder span{color:#000}.tabulator .tabulator-footer,.tabulator .tabulator-footer .tabulator-paginator,.tabulator .tabulator-tableholder .tabulator-table{color:inherit}.tabulator .tabulator-footer .tabulator-pages{margin:0}.tabulator .tabulator-footer .tabulator-page{margin:5px 0 0;padding:8px 12px}.tabulator .tabulator-footer .tabulator-page[data-page=first]{border-top-left-radius:4px;border-bottom-left-radius:4px}.tabulator .tabulator-footer .tabulator-page[data-page=last]{border:1px solid #dee2e6;border-top-right-radius:4px;border-bottom-right-radius:4px}.tabulator .tabulator-footer .tabulator-page.active{border-color:#007bff;background-color:#007bff;color:#fff}.tabulator .tabulator-footer .tabulator-page:disabled{border-color:#dee2e6;background:#fff;color:#6c757d}.tabulator .tabulator-footer .tabulator-page:not(.disabled):hover{border-color:#dee2e6;background:#e9ecef;color:#0056b3}.tabulator.thead-dark .tabulator-header,.tabulator.thead-dark .tabulator-header .tabulator-col{border-color:#32383e;background-color:#212529;color:#fff}.tabulator.table-dark{background-color:#212529}.tabulator.table-dark:not(.thead-light) .tabulator-header,.tabulator.table-dark:not(.thead-light) .tabulator-header .tabulator-col{border-color:#32383e;background-color:#212529;color:#fff}.tabulator.table-dark .tabulator-tableholder{color:#fff}.tabulator.table-dark .tabulator-row{border-color:#32383e;background-color:#212529;color:#fff}.tabulator.table-dark .tabulator-row:hover{background-color:#32383e}.tabulator.table-dark .tabulator-row:hover .tabulator-cell{background-color:hsla(0,0%,100%,.075)}.tabulator.table-dark .tabulator-row.tabulator-selected{background-color:#9abcea}.tabulator.table-dark .tabulator-footer{border-color:#32383e!important}.tabulator.table-dark .tabulator-footer .tabulator-calcs-holder{border-color:#32383e!important;background:#212529!important}.tabulator.table-dark .tabulator-footer .tabulator-calcs-holder .tabulator-row{border-color:#32383e!important;background-color:#212529!important;color:#fff!important}.tabulator.table-striped:not(.table-dark) .tabulator-row:nth-child(2n){background-color:#f9f9f9}.tabulator.table-striped:not(.table-dark) .tabulator-row:nth-child(2n).tabulator-selected{background-color:#9abcea}.tabulator.table-striped:not(.table-dark) .tabulator-row:nth-child(2n).tabulator-selectable:hover{background-color:#f5f5f5;cursor:pointer}.tabulator.table-striped:not(.table-dark) .tabulator-row:nth-child(2n).tabulator-selected:hover{background-color:#769bcc;cursor:pointer}.tabulator.table-striped.table-dark .tabulator-row:nth-child(2n) .tabulator-cell{background-color:hsla(0,0%,100%,.05)}.tabulator.table-bordered{border:1px solid #dee2e6}.tabulator.table-bordered .tabulator-header .tabulator-col,.tabulator.table-bordered .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{border-right:1px solid #dee2e6}.tabulator.table-borderless .tabulator-header,.tabulator.table-borderless .tabulator-row{border:none}.tabulator.table-sm .tabulator-header .tabulator-col .tabulator-col-content{padding:5px!important}.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row{min-height:26px}.tabulator.table-sm .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell{padding:5px!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-primary{background:#b8daff!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-secondary{background:#d6d8db!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-success{background:#c3e6cb!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-info{background:#bee5eb!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-warning{background:#ffeeba!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-danger{background:#f5c6cb!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-light{background:#fdfdfe!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-dark{background:#c6c8ca!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.table-active{background:#f5f5f5!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-primary{background:#007bff!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-secondary{background:#6c757d!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-success{background:#28a745!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-info{background:#17a2b8!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-warning{background:#ffc107!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-danger{background:#dc3545!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-light{background:#f8f9fa!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-dark{background:#343a40!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.bg-active{background:#f5f5f5!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-primary{background:#b8daff!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-secondary{background:#d6d8db!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-success{background:#c3e6cb!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-info{background:#bee5eb!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-warning{background:#ffeeba!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-danger{background:#f5c6cb!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-light{background:#fdfdfe!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-dark{background:#c6c8ca!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.table-active{background:#f5f5f5!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-primary{background:#007bff!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-secondary{background:#6c757d!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-success{background:#28a745!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-info{background:#17a2b8!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-warning{background:#ffc107!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-danger{background:#dc3545!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-light{background:#f8f9fa!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-dark{background:#343a40!important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.bg-active{background:#f5f5f5!important}.tabulator-row{min-height:40px;border-bottom:1px solid #dee2e6}.tabulator-row .tabulator-cell{padding:12px;border-right:none}.tabulator-row .tabulator-cell:last-of-type{border-right:none}.tabulator-row .tabulator-cell .tabulator-data-tree-control{border:1px solid #ccc}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after,.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand,.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#ccc}.tabulator-row.tabulator-group{background:#fafafa}.tabulator-row.tabulator-group span{color:#666}.tabulator-edit-select-list{background:#fff}.tabulator-edit-select-list .tabulator-edit-select-list-item.active{color:#fff}.tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused{outline:1px solid hsla(0,0%,100%,.5)}.tabulator-edit-select-list .tabulator-edit-select-list-item:hover{color:#fff}.tabulator-edit-select-list .tabulator-edit-select-list-group,.tabulator-edit-select-list .tabulator-edit-select-list-notice{color:inherit}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{text-align:initial;border-left:initial}.tabulator-print-table .tabulator-print-table-group{background:#fafafa}.tabulator-print-table .tabulator-print-table-group span{color:#666}.tabulator-print-table .tabulator-data-tree-control{color:inherit}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after,.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand,.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#ccc}
|
|
2
|
+
/*# sourceMappingURL=tabulator_bootstrap4.min.css.map */
|
package/routes/list.js
CHANGED
|
@@ -17,6 +17,7 @@ const {
|
|
|
17
17
|
script,
|
|
18
18
|
domReady,
|
|
19
19
|
div,
|
|
20
|
+
i,
|
|
20
21
|
text,
|
|
21
22
|
button,
|
|
22
23
|
input,
|
|
@@ -120,44 +121,71 @@ router.post(
|
|
|
120
121
|
* @param field
|
|
121
122
|
* @returns {{name, title}}
|
|
122
123
|
*/
|
|
123
|
-
const
|
|
124
|
-
|
|
124
|
+
const typeToGridType = (t, field) => {
|
|
125
|
+
const jsgField = { field: field.name, title: field.label, editor: true };
|
|
125
126
|
if (t.name === "String" && field.attributes && field.attributes.options) {
|
|
126
|
-
jsgField.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
jsgField.
|
|
132
|
-
if (!field.required) jsgField.items.unshift("");
|
|
127
|
+
jsgField.editor = "select";
|
|
128
|
+
|
|
129
|
+
const values = field.attributes.options.split(",").map((o) => o.trim());
|
|
130
|
+
if (!field.required) values.unshift("");
|
|
131
|
+
|
|
132
|
+
jsgField.editorParams = { values };
|
|
133
133
|
} else if (t === "Key" || t === "File") {
|
|
134
|
-
jsgField.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
jsgField.
|
|
139
|
-
|
|
140
|
-
jsgField.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
134
|
+
jsgField.editor = "select";
|
|
135
|
+
const values = {};
|
|
136
|
+
|
|
137
|
+
field.options.forEach(({ label, value }) => (values[value] = label));
|
|
138
|
+
jsgField.editorParams = { values };
|
|
139
|
+
jsgField.formatterParams = { values };
|
|
140
|
+
jsgField.formatter = "__lookupIntToString";
|
|
141
|
+
} else if (t.name === "Float" || t.name === "Integer") {
|
|
142
|
+
jsgField.editor = "number";
|
|
143
|
+
jsgField.sorter = "number";
|
|
144
|
+
jsgField.hozAlign = "right";
|
|
145
|
+
jsgField.headerHozAlign = "right";
|
|
146
|
+
jsgField.editorParams = {
|
|
147
|
+
step: t.name === "Integer" ? 1 : undefined,
|
|
148
|
+
min:
|
|
149
|
+
typeof field.attributes.min !== "undefined"
|
|
150
|
+
? field.attributes.min
|
|
151
|
+
: undefined,
|
|
152
|
+
max:
|
|
153
|
+
typeof field.attributes.max !== "undefined"
|
|
154
|
+
? field.attributes.max
|
|
155
|
+
: undefined,
|
|
156
|
+
};
|
|
157
|
+
} else if (t.name === "Bool") {
|
|
158
|
+
jsgField.editor = "tickCross";
|
|
159
|
+
jsgField.formatter = "tickCross";
|
|
160
|
+
jsgField.hozAlign = "center";
|
|
161
|
+
jsgField.vertAlign = "center";
|
|
162
|
+
jsgField.editorParams = field.required ? {} : { tristate: true };
|
|
163
|
+
jsgField.formatterParams = field.required ? {} : { allowEmpty: true };
|
|
164
|
+
} else if (t.name === "Date") {
|
|
165
|
+
jsgField.sorter = "date";
|
|
166
|
+
jsgField.sorterParams = {
|
|
167
|
+
format: "iso",
|
|
168
|
+
};
|
|
169
|
+
jsgField.editor = "__flatpickerEditor";
|
|
170
|
+
jsgField.formatter = "datetime";
|
|
171
|
+
jsgField.formatterParams = {
|
|
172
|
+
inputFormat: "iso",
|
|
173
|
+
};
|
|
174
|
+
} else if (t.name === "Color") {
|
|
175
|
+
jsgField.editor = "__colorEditor";
|
|
176
|
+
jsgField.formatter = "__colorFormatter";
|
|
177
|
+
jsgField.hozAlign = "center";
|
|
178
|
+
jsgField.vertAlign = "center";
|
|
179
|
+
} else if (t.name === "JSON") {
|
|
180
|
+
jsgField.formatter = "__jsonFormatter";
|
|
181
|
+
jsgField.editor = "__jsonEditor";
|
|
182
|
+
}
|
|
183
|
+
|
|
154
184
|
if (field.calculated) {
|
|
155
|
-
jsgField.
|
|
156
|
-
jsgField.inserting = false;
|
|
185
|
+
jsgField.editor = false;
|
|
157
186
|
}
|
|
158
187
|
if (field.primary_key) {
|
|
159
|
-
jsgField.
|
|
160
|
-
jsgField.editing = false;
|
|
188
|
+
jsgField.editor = false;
|
|
161
189
|
}
|
|
162
190
|
return jsgField;
|
|
163
191
|
};
|
|
@@ -186,6 +214,12 @@ jsGrid.fields.versions = VersionsField;
|
|
|
186
214
|
`;
|
|
187
215
|
// end of versionsField
|
|
188
216
|
|
|
217
|
+
const arrangeIdFirst = (flds) => {
|
|
218
|
+
const noId = flds.filter((f) => f.name !== "id");
|
|
219
|
+
const id = flds.find((f) => f.name === "id");
|
|
220
|
+
return [id, ...noId];
|
|
221
|
+
};
|
|
222
|
+
|
|
189
223
|
/**
|
|
190
224
|
* Table Data List Viewer (GET handler))
|
|
191
225
|
* @name get/:tname
|
|
@@ -214,35 +248,48 @@ router.get(
|
|
|
214
248
|
const keyfields = fields
|
|
215
249
|
.filter((f) => f.type === "Key" || f.type === "File")
|
|
216
250
|
.map((f) => ({ name: f.name, type: f.reftype }));
|
|
217
|
-
const jsfields = fields.map((f) =>
|
|
251
|
+
const jsfields = arrangeIdFirst(fields).map((f) =>
|
|
252
|
+
typeToGridType(f.type, f)
|
|
253
|
+
);
|
|
218
254
|
if (table.versioned) {
|
|
219
|
-
jsfields.push({
|
|
255
|
+
jsfields.push({
|
|
256
|
+
field: "_versions",
|
|
257
|
+
title: "Versions",
|
|
258
|
+
formatter: "__versionsFormatter",
|
|
259
|
+
});
|
|
220
260
|
}
|
|
221
|
-
jsfields.push({
|
|
261
|
+
jsfields.push({
|
|
262
|
+
formatter: "buttonCross",
|
|
263
|
+
title: i({ class: "far fa-trash-alt" }),
|
|
264
|
+
width: 40,
|
|
265
|
+
hozAlign: "center",
|
|
266
|
+
headerSort: false,
|
|
267
|
+
cellClick: "__delete_tabulator_row",
|
|
268
|
+
});
|
|
222
269
|
res.sendWrap(
|
|
223
270
|
{
|
|
224
271
|
title: req.__(`%s data table`, table.name),
|
|
225
272
|
headers: [
|
|
226
273
|
//jsgrid - grid editor external component
|
|
227
274
|
{
|
|
228
|
-
script: `/static_assets/${db.connectObj.version_tag}/
|
|
275
|
+
script: `/static_assets/${db.connectObj.version_tag}/tabulator.min.js`,
|
|
229
276
|
},
|
|
230
277
|
// date flat picker external component
|
|
231
278
|
{
|
|
232
279
|
script: `/static_assets/${db.connectObj.version_tag}/flatpickr.min.js`,
|
|
233
280
|
},
|
|
281
|
+
{
|
|
282
|
+
script: `/static_assets/${db.connectObj.version_tag}/luxon.min.js`,
|
|
283
|
+
},
|
|
234
284
|
// main logic for grid editor is here
|
|
235
285
|
{
|
|
236
286
|
script: `/static_assets/${db.connectObj.version_tag}/gridedit.js`,
|
|
237
287
|
},
|
|
238
288
|
//css for jsgrid - grid editor external component
|
|
239
289
|
{
|
|
240
|
-
css: `/static_assets/${db.connectObj.version_tag}/
|
|
241
|
-
},
|
|
242
|
-
// css theme for jsgrid - grid editor external component
|
|
243
|
-
{
|
|
244
|
-
css: `/static_assets/${db.connectObj.version_tag}/jsgrid-theme.min.css`,
|
|
290
|
+
css: `/static_assets/${db.connectObj.version_tag}/tabulator_bootstrap4.min.css`,
|
|
245
291
|
},
|
|
292
|
+
|
|
246
293
|
// css for date flat picker external component
|
|
247
294
|
{
|
|
248
295
|
css: `/static_assets/${db.connectObj.version_tag}/flatpickr.min.css`,
|
|
@@ -258,65 +305,103 @@ router.get(
|
|
|
258
305
|
{ href: `/table/${table.id || table.name}`, text: table.name },
|
|
259
306
|
{ text: req.__("Data") },
|
|
260
307
|
],
|
|
261
|
-
right:
|
|
262
|
-
{ class: "dropdown" },
|
|
308
|
+
right:
|
|
263
309
|
button(
|
|
264
310
|
{
|
|
265
|
-
class: "btn btn-sm btn-
|
|
266
|
-
|
|
267
|
-
type: "button",
|
|
268
|
-
id: "btnHideCols",
|
|
269
|
-
"data-toggle": "dropdown",
|
|
270
|
-
"aria-haspopup": "true",
|
|
271
|
-
"aria-expanded": "false",
|
|
311
|
+
class: "btn btn-sm btn-primary mr-2",
|
|
312
|
+
onClick: "add_tabulator_row()",
|
|
272
313
|
},
|
|
273
|
-
"
|
|
274
|
-
|
|
314
|
+
i({ class: "fas fa-plus mr-1" }),
|
|
315
|
+
"Add row"
|
|
316
|
+
) +
|
|
275
317
|
div(
|
|
276
|
-
{
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
318
|
+
{ class: "dropdown d-inline" },
|
|
319
|
+
button(
|
|
320
|
+
{
|
|
321
|
+
class: "btn btn-sm btn-outline-secondary dropdown-toggle",
|
|
322
|
+
"data-boundary": "viewport",
|
|
323
|
+
type: "button",
|
|
324
|
+
id: "btnHideCols",
|
|
325
|
+
"data-toggle": "dropdown",
|
|
326
|
+
"aria-haspopup": "true",
|
|
327
|
+
"aria-expanded": "false",
|
|
328
|
+
},
|
|
329
|
+
"Show/hide fields"
|
|
330
|
+
),
|
|
331
|
+
div(
|
|
332
|
+
{
|
|
333
|
+
class: "dropdown-menu",
|
|
334
|
+
"aria-labelledby": "btnHideCols",
|
|
335
|
+
},
|
|
336
|
+
form(
|
|
337
|
+
{ class: "px-2" },
|
|
338
|
+
fields.map((f) =>
|
|
339
|
+
div(
|
|
340
|
+
{ class: "form-check" },
|
|
341
|
+
input({
|
|
342
|
+
type: "checkbox",
|
|
343
|
+
onChange: `showHideCol('${f.name}', this)`,
|
|
344
|
+
class: "form-check-input",
|
|
345
|
+
checked: true,
|
|
346
|
+
}),
|
|
347
|
+
label(f.name)
|
|
348
|
+
)
|
|
292
349
|
)
|
|
293
350
|
)
|
|
294
351
|
)
|
|
295
|
-
)
|
|
296
|
-
),
|
|
352
|
+
),
|
|
297
353
|
},
|
|
298
354
|
{
|
|
299
355
|
type: "blank",
|
|
300
356
|
contents: div(
|
|
301
|
-
script(`var edit_fields=${JSON.stringify(jsfields)};`),
|
|
302
|
-
script(domReady(versionsField(table.name))),
|
|
357
|
+
//script(`var edit_fields=${JSON.stringify(jsfields)};`),
|
|
358
|
+
//script(domReady(versionsField(table.name))),
|
|
303
359
|
script(
|
|
304
|
-
domReady(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
table.versioned
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
360
|
+
domReady(`
|
|
361
|
+
const columns=${JSON.stringify(jsfields)};
|
|
362
|
+
columns.forEach(col=>{
|
|
363
|
+
Object.entries(col).forEach(([k,v])=>{
|
|
364
|
+
if(typeof v === "string" && v.startsWith("__"))
|
|
365
|
+
col[k] = window[v.substring(2)];
|
|
366
|
+
})
|
|
367
|
+
})
|
|
368
|
+
window.tabulator_table = new Tabulator("#jsGrid", {
|
|
369
|
+
ajaxURL:"/api/${table.name}${
|
|
370
|
+
table.versioned ? "?versioncount=on" : ""
|
|
371
|
+
}",
|
|
372
|
+
layout:"fitColumns",
|
|
373
|
+
columns,
|
|
374
|
+
height:"100%",
|
|
375
|
+
pagination:true,
|
|
376
|
+
paginationSize:20,
|
|
377
|
+
initialSort:[
|
|
378
|
+
{column:"id", dir:"asc"},
|
|
379
|
+
],
|
|
380
|
+
ajaxResponse:function(url, params, response){
|
|
381
|
+
|
|
382
|
+
return response.success; //return the tableData property of a response json object
|
|
383
|
+
},
|
|
384
|
+
});
|
|
385
|
+
window.tabulator_table.on("cellEdited", function(cell){
|
|
386
|
+
const row = cell.getRow().getData()
|
|
387
|
+
$.ajax({
|
|
388
|
+
type: "POST",
|
|
389
|
+
url: "/api/${table.name}/" + (row.id||""),
|
|
390
|
+
data: row,
|
|
391
|
+
headers: {
|
|
392
|
+
"CSRF-Token": _sc_globalCsrf,
|
|
393
|
+
},
|
|
394
|
+
error: tabulator_error_handler,
|
|
395
|
+
}).done(function (resp) {
|
|
396
|
+
//if (item._versions) item._versions = +item._versions + 1;
|
|
397
|
+
//data.resolve(fixKeys(item));
|
|
398
|
+
if(resp.success &&typeof resp.success ==="number" && !row.id) {
|
|
399
|
+
window.tabulator_table.updateRow(cell.getRow(), {id: resp.success});
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
});
|
|
403
|
+
});
|
|
404
|
+
window.tabulator_table_name="${table.name}";`)
|
|
320
405
|
),
|
|
321
406
|
div({ id: "jsGridNotify" }),
|
|
322
407
|
|
|
@@ -328,3 +413,5 @@ router.get(
|
|
|
328
413
|
);
|
|
329
414
|
})
|
|
330
415
|
);
|
|
416
|
+
|
|
417
|
+
// TODO: increment version count
|
package/routes/plugins.js
CHANGED
|
@@ -51,6 +51,7 @@ const fs = require("fs");
|
|
|
51
51
|
const path = require("path");
|
|
52
52
|
const { get_latest_npm_version } = require("@saltcorn/data/models/config");
|
|
53
53
|
const { flash_restart } = require("../markup/admin.js");
|
|
54
|
+
const { sleep } = require("@saltcorn/data/utils");
|
|
54
55
|
|
|
55
56
|
/**
|
|
56
57
|
* @type {object}
|
|
@@ -967,6 +968,7 @@ router.post(
|
|
|
967
968
|
plugin_db.name
|
|
968
969
|
)
|
|
969
970
|
);
|
|
971
|
+
await sleep(1000); // Allow other workers to load this plugin
|
|
970
972
|
res.redirect(`/plugins/configure/${plugin_db.name}`);
|
|
971
973
|
} else {
|
|
972
974
|
req.flash("success", req.__(`Plugin %s installed`, plugin.name));
|
package/wrapper.js
CHANGED
|
@@ -174,12 +174,15 @@ const get_headers = (req, version_tag, description, extras = []) => {
|
|
|
174
174
|
from_cfg.push({ style: state.getConfig("page_custom_css", "") });
|
|
175
175
|
if (state.getConfig("page_custom_html", ""))
|
|
176
176
|
from_cfg.push({ headerTag: state.getConfig("page_custom_html", "") });
|
|
177
|
-
|
|
177
|
+
const state_headers = [];
|
|
178
|
+
for (const hs of Object.values(state.headers)) {
|
|
179
|
+
state_headers.push(...hs);
|
|
180
|
+
}
|
|
178
181
|
return [
|
|
179
182
|
...stdHeaders,
|
|
180
183
|
...iconHeader,
|
|
181
184
|
...meta_description,
|
|
182
|
-
...
|
|
185
|
+
...state_headers,
|
|
183
186
|
...extras,
|
|
184
187
|
...from_cfg,
|
|
185
188
|
];
|