@saltcorn/server 0.6.3-beta.3 → 0.6.4-beta.3
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/app.js +3 -1
- package/auth/resetpw.js +7 -7
- package/auth/routes.js +1 -1
- package/locales/en.json +870 -860
- package/package.json +17 -14
- package/public/gridedit.js +162 -221
- package/public/saltcorn.js +137 -12
- package/public/tabulator.min.js +3 -0
- package/public/tabulator_bootstrap4.min.css +2 -0
- package/restart_watcher.js +1 -1
- package/routes/admin.js +9 -3
- package/routes/api.js +10 -5
- package/routes/fields.js +31 -2
- package/routes/files.js +2 -1
- package/routes/homepage.js +1 -1
- package/routes/list.js +169 -87
- package/routes/packs.js +1 -1
- package/routes/pageedit.js +7 -4
- package/routes/plugins.js +1 -1
- package/routes/scapi.js +1 -1
- package/routes/tables.js +3 -1
- package/routes/tenant.js +19 -9
- package/routes/view.js +2 -0
- package/routes/viewedit.js +1 -1
- package/serve.js +38 -27
- 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/restart_watcher.js
CHANGED
|
@@ -8,7 +8,7 @@ const { spawnSync } = require("child_process");
|
|
|
8
8
|
const watch = require("node-watch");
|
|
9
9
|
const Plugin = require("@saltcorn/data/models/plugin");
|
|
10
10
|
const db = require("@saltcorn/data/db");
|
|
11
|
-
const { eachTenant } = require("@saltcorn/
|
|
11
|
+
const { eachTenant } = require("@saltcorn/admin-models/models/tenant");
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* packages that should trigger a server re-start
|
package/routes/admin.js
CHANGED
|
@@ -5,14 +5,19 @@
|
|
|
5
5
|
*/
|
|
6
6
|
const Router = require("express-promise-router");
|
|
7
7
|
|
|
8
|
-
const {
|
|
8
|
+
const {
|
|
9
|
+
isAdmin,
|
|
10
|
+
error_catcher,
|
|
11
|
+
getGitRevision,
|
|
12
|
+
setTenant,
|
|
13
|
+
} = require("./utils.js");
|
|
9
14
|
const Table = require("@saltcorn/data/models/table");
|
|
10
15
|
const Plugin = require("@saltcorn/data/models/plugin");
|
|
11
16
|
const File = require("@saltcorn/data/models/file");
|
|
12
17
|
const { spawn } = require("child_process");
|
|
13
18
|
const User = require("@saltcorn/data/models/user");
|
|
14
19
|
const path = require("path");
|
|
15
|
-
const { getAllTenants } = require("@saltcorn/
|
|
20
|
+
const { getAllTenants } = require("@saltcorn/admin-models/models/tenant");
|
|
16
21
|
const { post_btn, renderForm } = require("@saltcorn/markup");
|
|
17
22
|
const {
|
|
18
23
|
div,
|
|
@@ -41,7 +46,7 @@ const {
|
|
|
41
46
|
get_process_init_time,
|
|
42
47
|
} = require("@saltcorn/data/db/state");
|
|
43
48
|
const { loadAllPlugins } = require("../load_plugins");
|
|
44
|
-
const { create_backup, restore } = require("@saltcorn/
|
|
49
|
+
const { create_backup, restore } = require("@saltcorn/admin-models/models/backup");
|
|
45
50
|
const fs = require("fs");
|
|
46
51
|
const load_plugins = require("../load_plugins");
|
|
47
52
|
const {
|
|
@@ -518,6 +523,7 @@ router.post(
|
|
|
518
523
|
*/
|
|
519
524
|
router.post(
|
|
520
525
|
"/restore",
|
|
526
|
+
setTenant, // TODO why is this needed?????
|
|
521
527
|
isAdmin,
|
|
522
528
|
error_catcher(async (req, res) => {
|
|
523
529
|
const newPath = File.get_new_path();
|
package/routes/api.js
CHANGED
|
@@ -28,6 +28,7 @@ const passport = require("passport");
|
|
|
28
28
|
const {
|
|
29
29
|
stateFieldsToWhere,
|
|
30
30
|
readState,
|
|
31
|
+
strictParseInt,
|
|
31
32
|
} = require("@saltcorn/data/plugin-helper");
|
|
32
33
|
|
|
33
34
|
/**
|
|
@@ -121,9 +122,13 @@ router.get(
|
|
|
121
122
|
"/:tableName/",
|
|
122
123
|
//passport.authenticate("api-bearer", { session: false }),
|
|
123
124
|
error_catcher(async (req, res, next) => {
|
|
124
|
-
|
|
125
|
-
const { fields, versioncount, ...req_query } = req.query;
|
|
126
|
-
const table = await Table.findOne(
|
|
125
|
+
let { tableName } = req.params;
|
|
126
|
+
const { fields, versioncount, approximate, ...req_query } = req.query;
|
|
127
|
+
const table = await Table.findOne(
|
|
128
|
+
strictParseInt(tableName)
|
|
129
|
+
? { id: strictParseInt(tableName) }
|
|
130
|
+
: { name: tableName }
|
|
131
|
+
);
|
|
127
132
|
if (!table) {
|
|
128
133
|
res.status(404).json({ error: req.__("Not found") });
|
|
129
134
|
return;
|
|
@@ -152,8 +157,8 @@ router.get(
|
|
|
152
157
|
const tbl_fields = await table.getFields();
|
|
153
158
|
const qstate = await stateFieldsToWhere({
|
|
154
159
|
fields: tbl_fields,
|
|
155
|
-
approximate:
|
|
156
|
-
state:
|
|
160
|
+
approximate: !!approximate,
|
|
161
|
+
state: req_query,
|
|
157
162
|
});
|
|
158
163
|
rows = await table.getRows(qstate);
|
|
159
164
|
} else {
|
package/routes/fields.js
CHANGED
|
@@ -27,6 +27,7 @@ const expressionBlurb = require("../markup/expression_blurb");
|
|
|
27
27
|
const { readState } = require("@saltcorn/data/plugin-helper");
|
|
28
28
|
const { wizardCardTitle } = require("../markup/forms.js");
|
|
29
29
|
const FieldRepeat = require("@saltcorn/data/models/fieldrepeat");
|
|
30
|
+
const { applyAsync } = require("@saltcorn/data/utils");
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* @type {object}
|
|
@@ -624,10 +625,38 @@ router.post(
|
|
|
624
625
|
const { tableName, fieldName, fieldview } = req.params;
|
|
625
626
|
const table = await Table.findOne({ name: tableName });
|
|
626
627
|
const fields = await table.getFields();
|
|
627
|
-
const field = fields.find((f) => f.name === fieldName);
|
|
628
|
-
const formula = field.expression;
|
|
629
628
|
const row = { ...req.body };
|
|
630
629
|
readState(row, fields);
|
|
630
|
+
|
|
631
|
+
if (fieldName.includes(".")) {
|
|
632
|
+
//join field
|
|
633
|
+
const kpath = fieldName.split(".");
|
|
634
|
+
|
|
635
|
+
if (kpath.length === 2 && row[kpath[0]]) {
|
|
636
|
+
const field = fields.find((f) => f.name === kpath[0]);
|
|
637
|
+
const reftable = await Table.findOne({ name: field.reftable_name });
|
|
638
|
+
const targetField = (await reftable.getFields()).find(
|
|
639
|
+
(f) => f.name === kpath[1]
|
|
640
|
+
);
|
|
641
|
+
const fv = targetField.type.fieldviews[fieldview];
|
|
642
|
+
const q = { [reftable.pk_name]: row[kpath[0]] };
|
|
643
|
+
const refRow = await reftable.getRow(q);
|
|
644
|
+
const configuration = req.query;
|
|
645
|
+
let configFields = [];
|
|
646
|
+
if (fv.configFields)
|
|
647
|
+
configFields = await applyAsync(fv.configFields, targetField);
|
|
648
|
+
readState(configuration, configFields);
|
|
649
|
+
res.send(fv.run(refRow[kpath[1]], req, configuration));
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
res.send("");
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
const field = fields.find((f) => f.name === fieldName);
|
|
657
|
+
|
|
658
|
+
const formula = field.expression;
|
|
659
|
+
|
|
631
660
|
let result;
|
|
632
661
|
try {
|
|
633
662
|
if (field.stored) {
|
package/routes/files.js
CHANGED
|
@@ -17,7 +17,7 @@ const {
|
|
|
17
17
|
post_btn,
|
|
18
18
|
post_delete_btn,
|
|
19
19
|
} = require("@saltcorn/markup");
|
|
20
|
-
const { isAdmin, error_catcher } = require("./utils.js");
|
|
20
|
+
const { isAdmin, error_catcher, setTenant } = require("./utils.js");
|
|
21
21
|
const {
|
|
22
22
|
span,
|
|
23
23
|
h5,
|
|
@@ -240,6 +240,7 @@ router.post(
|
|
|
240
240
|
*/
|
|
241
241
|
router.post(
|
|
242
242
|
"/upload",
|
|
243
|
+
setTenant, // TODO why is this needed?????
|
|
243
244
|
error_catcher(async (req, res) => {
|
|
244
245
|
let jsonResp = {};
|
|
245
246
|
const min_role_upload = getState().getConfig("min_role_upload", 1);
|
package/routes/homepage.js
CHANGED
|
@@ -13,7 +13,7 @@ const Page = require("@saltcorn/data/models/page");
|
|
|
13
13
|
const { link, renderForm, mkTable, post_btn } = require("@saltcorn/markup");
|
|
14
14
|
const { ul, li, div, small, a, h5, p, i } = require("@saltcorn/markup/tags");
|
|
15
15
|
const Table = require("@saltcorn/data/models/table");
|
|
16
|
-
const { fetch_available_packs } = require("@saltcorn/
|
|
16
|
+
const { fetch_available_packs } = require("@saltcorn/admin-models/models/pack");
|
|
17
17
|
const { restore_backup } = require("../markup/admin");
|
|
18
18
|
const { get_latest_npm_version } = require("@saltcorn/data/models/config");
|
|
19
19
|
const packagejson = require("../package.json");
|
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,40 +121,65 @@ 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.editor = "__flatpickerEditor";
|
|
167
|
+
jsgField.formatter = "__isoDateTimeFormatter";
|
|
168
|
+
} else if (t.name === "Color") {
|
|
169
|
+
jsgField.editor = "__colorEditor";
|
|
170
|
+
jsgField.formatter = "__colorFormatter";
|
|
171
|
+
jsgField.hozAlign = "center";
|
|
172
|
+
jsgField.vertAlign = "center";
|
|
173
|
+
} else if (t.name === "JSON") {
|
|
174
|
+
jsgField.formatter = "__jsonFormatter";
|
|
175
|
+
jsgField.editor = "__jsonEditor";
|
|
176
|
+
}
|
|
177
|
+
|
|
154
178
|
if (field.calculated) {
|
|
155
|
-
jsgField.
|
|
156
|
-
|
|
179
|
+
jsgField.editor = false;
|
|
180
|
+
}
|
|
181
|
+
if (field.primary_key) {
|
|
182
|
+
jsgField.editor = false;
|
|
157
183
|
}
|
|
158
184
|
return jsgField;
|
|
159
185
|
};
|
|
@@ -182,6 +208,12 @@ jsGrid.fields.versions = VersionsField;
|
|
|
182
208
|
`;
|
|
183
209
|
// end of versionsField
|
|
184
210
|
|
|
211
|
+
const arrangeIdFirst = (flds) => {
|
|
212
|
+
const noId = flds.filter((f) => f.name !== "id");
|
|
213
|
+
const id = flds.find((f) => f.name === "id");
|
|
214
|
+
return [id, ...noId];
|
|
215
|
+
};
|
|
216
|
+
|
|
185
217
|
/**
|
|
186
218
|
* Table Data List Viewer (GET handler))
|
|
187
219
|
* @name get/:tname
|
|
@@ -210,18 +242,31 @@ router.get(
|
|
|
210
242
|
const keyfields = fields
|
|
211
243
|
.filter((f) => f.type === "Key" || f.type === "File")
|
|
212
244
|
.map((f) => ({ name: f.name, type: f.reftype }));
|
|
213
|
-
const jsfields = fields.map((f) =>
|
|
245
|
+
const jsfields = arrangeIdFirst(fields).map((f) =>
|
|
246
|
+
typeToGridType(f.type, f)
|
|
247
|
+
);
|
|
214
248
|
if (table.versioned) {
|
|
215
|
-
jsfields.push({
|
|
249
|
+
jsfields.push({
|
|
250
|
+
field: "_versions",
|
|
251
|
+
title: "Versions",
|
|
252
|
+
formatter: "__versionsFormatter",
|
|
253
|
+
});
|
|
216
254
|
}
|
|
217
|
-
jsfields.push({
|
|
255
|
+
jsfields.push({
|
|
256
|
+
formatter: "buttonCross",
|
|
257
|
+
title: i({ class: "far fa-trash-alt" }),
|
|
258
|
+
width: 40,
|
|
259
|
+
hozAlign: "center",
|
|
260
|
+
headerSort: false,
|
|
261
|
+
cellClick: "__delete_tabulator_row",
|
|
262
|
+
});
|
|
218
263
|
res.sendWrap(
|
|
219
264
|
{
|
|
220
265
|
title: req.__(`%s data table`, table.name),
|
|
221
266
|
headers: [
|
|
222
267
|
//jsgrid - grid editor external component
|
|
223
268
|
{
|
|
224
|
-
script: `/static_assets/${db.connectObj.version_tag}/
|
|
269
|
+
script: `/static_assets/${db.connectObj.version_tag}/tabulator.min.js`,
|
|
225
270
|
},
|
|
226
271
|
// date flat picker external component
|
|
227
272
|
{
|
|
@@ -233,12 +278,9 @@ router.get(
|
|
|
233
278
|
},
|
|
234
279
|
//css for jsgrid - grid editor external component
|
|
235
280
|
{
|
|
236
|
-
css: `/static_assets/${db.connectObj.version_tag}/
|
|
237
|
-
},
|
|
238
|
-
// css theme for jsgrid - grid editor external component
|
|
239
|
-
{
|
|
240
|
-
css: `/static_assets/${db.connectObj.version_tag}/jsgrid-theme.min.css`,
|
|
281
|
+
css: `/static_assets/${db.connectObj.version_tag}/tabulator_bootstrap4.min.css`,
|
|
241
282
|
},
|
|
283
|
+
|
|
242
284
|
// css for date flat picker external component
|
|
243
285
|
{
|
|
244
286
|
css: `/static_assets/${db.connectObj.version_tag}/flatpickr.min.css`,
|
|
@@ -254,65 +296,103 @@ router.get(
|
|
|
254
296
|
{ href: `/table/${table.id || table.name}`, text: table.name },
|
|
255
297
|
{ text: req.__("Data") },
|
|
256
298
|
],
|
|
257
|
-
right:
|
|
258
|
-
{ class: "dropdown" },
|
|
299
|
+
right:
|
|
259
300
|
button(
|
|
260
301
|
{
|
|
261
|
-
class: "btn btn-sm btn-
|
|
262
|
-
|
|
263
|
-
type: "button",
|
|
264
|
-
id: "btnHideCols",
|
|
265
|
-
"data-toggle": "dropdown",
|
|
266
|
-
"aria-haspopup": "true",
|
|
267
|
-
"aria-expanded": "false",
|
|
302
|
+
class: "btn btn-sm btn-primary mr-2",
|
|
303
|
+
onClick: "add_tabulator_row()",
|
|
268
304
|
},
|
|
269
|
-
"
|
|
270
|
-
|
|
305
|
+
i({ class: "fas fa-plus mr-1" }),
|
|
306
|
+
"Add row"
|
|
307
|
+
) +
|
|
271
308
|
div(
|
|
272
|
-
{
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
309
|
+
{ class: "dropdown d-inline" },
|
|
310
|
+
button(
|
|
311
|
+
{
|
|
312
|
+
class: "btn btn-sm btn-outline-secondary dropdown-toggle",
|
|
313
|
+
"data-boundary": "viewport",
|
|
314
|
+
type: "button",
|
|
315
|
+
id: "btnHideCols",
|
|
316
|
+
"data-toggle": "dropdown",
|
|
317
|
+
"aria-haspopup": "true",
|
|
318
|
+
"aria-expanded": "false",
|
|
319
|
+
},
|
|
320
|
+
"Show/hide fields"
|
|
321
|
+
),
|
|
322
|
+
div(
|
|
323
|
+
{
|
|
324
|
+
class: "dropdown-menu",
|
|
325
|
+
"aria-labelledby": "btnHideCols",
|
|
326
|
+
},
|
|
327
|
+
form(
|
|
328
|
+
{ class: "px-2" },
|
|
329
|
+
fields.map((f) =>
|
|
330
|
+
div(
|
|
331
|
+
{ class: "form-check" },
|
|
332
|
+
input({
|
|
333
|
+
type: "checkbox",
|
|
334
|
+
onChange: `showHideCol('${f.name}', this)`,
|
|
335
|
+
class: "form-check-input",
|
|
336
|
+
checked: true,
|
|
337
|
+
}),
|
|
338
|
+
label(f.name)
|
|
339
|
+
)
|
|
288
340
|
)
|
|
289
341
|
)
|
|
290
342
|
)
|
|
291
|
-
)
|
|
292
|
-
),
|
|
343
|
+
),
|
|
293
344
|
},
|
|
294
345
|
{
|
|
295
346
|
type: "blank",
|
|
296
347
|
contents: div(
|
|
297
|
-
script(`var edit_fields=${JSON.stringify(jsfields)};`),
|
|
298
|
-
script(domReady(versionsField(table.name))),
|
|
348
|
+
//script(`var edit_fields=${JSON.stringify(jsfields)};`),
|
|
349
|
+
//script(domReady(versionsField(table.name))),
|
|
299
350
|
script(
|
|
300
|
-
domReady(
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
table.versioned
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
351
|
+
domReady(`
|
|
352
|
+
const columns=${JSON.stringify(jsfields)};
|
|
353
|
+
columns.forEach(col=>{
|
|
354
|
+
Object.entries(col).forEach(([k,v])=>{
|
|
355
|
+
if(typeof v === "string" && v.startsWith("__"))
|
|
356
|
+
col[k] = window[v.substring(2)];
|
|
357
|
+
})
|
|
358
|
+
})
|
|
359
|
+
window.tabulator_table = new Tabulator("#jsGrid", {
|
|
360
|
+
ajaxURL:"/api/${table.name}${
|
|
361
|
+
table.versioned ? "?versioncount=on" : ""
|
|
362
|
+
}",
|
|
363
|
+
layout:"fitColumns",
|
|
364
|
+
columns,
|
|
365
|
+
height:"100%",
|
|
366
|
+
pagination:true,
|
|
367
|
+
paginationSize:20,
|
|
368
|
+
initialSort:[
|
|
369
|
+
{column:"id", dir:"asc"},
|
|
370
|
+
],
|
|
371
|
+
ajaxResponse:function(url, params, response){
|
|
372
|
+
|
|
373
|
+
return response.success; //return the tableData property of a response json object
|
|
374
|
+
},
|
|
375
|
+
});
|
|
376
|
+
window.tabulator_table.on("cellEdited", function(cell){
|
|
377
|
+
const row = cell.getRow().getData()
|
|
378
|
+
$.ajax({
|
|
379
|
+
type: "POST",
|
|
380
|
+
url: "/api/${table.name}/" + (row.id||""),
|
|
381
|
+
data: row,
|
|
382
|
+
headers: {
|
|
383
|
+
"CSRF-Token": _sc_globalCsrf,
|
|
384
|
+
},
|
|
385
|
+
error: tabulator_error_handler,
|
|
386
|
+
}).done(function (resp) {
|
|
387
|
+
//if (item._versions) item._versions = +item._versions + 1;
|
|
388
|
+
//data.resolve(fixKeys(item));
|
|
389
|
+
if(resp.success &&typeof resp.success ==="number" && !row.id) {
|
|
390
|
+
window.tabulator_table.updateRow(cell.getRow(), {id: resp.success});
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
});
|
|
394
|
+
});
|
|
395
|
+
window.tabulator_table_name="${table.name}";`)
|
|
316
396
|
),
|
|
317
397
|
div({ id: "jsGridNotify" }),
|
|
318
398
|
|
|
@@ -324,3 +404,5 @@ router.get(
|
|
|
324
404
|
);
|
|
325
405
|
})
|
|
326
406
|
);
|
|
407
|
+
|
|
408
|
+
// TODO: increment version count
|
package/routes/packs.js
CHANGED
|
@@ -30,7 +30,7 @@ const {
|
|
|
30
30
|
fetch_pack_by_name,
|
|
31
31
|
can_install_pack,
|
|
32
32
|
uninstall_pack,
|
|
33
|
-
} = require("@saltcorn/
|
|
33
|
+
} = require("@saltcorn/admin-models/models/pack");
|
|
34
34
|
const { h5, pre, code, p, text, text_attr } = require("@saltcorn/markup/tags");
|
|
35
35
|
const Library = require("@saltcorn/data/models/library");
|
|
36
36
|
const Trigger = require("@saltcorn/data/models/trigger");
|
package/routes/pageedit.js
CHANGED
|
@@ -17,7 +17,7 @@ const Form = require("@saltcorn/data/models/form");
|
|
|
17
17
|
const File = require("@saltcorn/data/models/file");
|
|
18
18
|
const Trigger = require("@saltcorn/data/models/trigger");
|
|
19
19
|
const { getViews, traverseSync } = require("@saltcorn/data/models/layout");
|
|
20
|
-
const { add_to_menu } = require("@saltcorn/
|
|
20
|
+
const { add_to_menu } = require("@saltcorn/admin-models/models/pack");
|
|
21
21
|
const db = require("@saltcorn/data/db");
|
|
22
22
|
|
|
23
23
|
const { isAdmin, error_catcher } = require("./utils.js");
|
|
@@ -157,9 +157,12 @@ const pageBuilderData = async (req, context) => {
|
|
|
157
157
|
const images = await File.find({ mime_super: "image" });
|
|
158
158
|
const roles = await User.get_roles();
|
|
159
159
|
const stateActions = getState().actions;
|
|
160
|
-
const actions =
|
|
161
|
-
|
|
162
|
-
.
|
|
160
|
+
const actions = [
|
|
161
|
+
"GoBack",
|
|
162
|
+
...Object.entries(stateActions)
|
|
163
|
+
.filter(([k, v]) => !v.requireRow && !v.disableInBuilder)
|
|
164
|
+
.map(([k, v]) => k),
|
|
165
|
+
];
|
|
163
166
|
const triggers = await Trigger.find({
|
|
164
167
|
when_trigger: { or: ["API call", "Never"] },
|
|
165
168
|
});
|
package/routes/plugins.js
CHANGED
|
@@ -18,7 +18,7 @@ const { getState } = require("@saltcorn/data/db/state");
|
|
|
18
18
|
const Form = require("@saltcorn/data/models/form");
|
|
19
19
|
const Field = require("@saltcorn/data/models/field");
|
|
20
20
|
const Plugin = require("@saltcorn/data/models/plugin");
|
|
21
|
-
const { fetch_available_packs } = require("@saltcorn/
|
|
21
|
+
const { fetch_available_packs } = require("@saltcorn/admin-models/models/pack");
|
|
22
22
|
const { getConfig, setConfig } = require("@saltcorn/data/models/config");
|
|
23
23
|
const db = require("@saltcorn/data/db");
|
|
24
24
|
const {
|
package/routes/scapi.js
CHANGED
|
@@ -16,7 +16,7 @@ const Page = require("@saltcorn/data/models/page");
|
|
|
16
16
|
const File = require("@saltcorn/data/models/file");
|
|
17
17
|
const Trigger = require("@saltcorn/data/models/trigger");
|
|
18
18
|
const Role = require("@saltcorn/data/models/role");
|
|
19
|
-
const Tenant = require("@saltcorn/
|
|
19
|
+
const Tenant = require("@saltcorn/admin-models/models/tenant");
|
|
20
20
|
const Plugin = require("@saltcorn/data/models/plugin");
|
|
21
21
|
const Config = require("@saltcorn/data/models/config");
|
|
22
22
|
const passport = require("passport");
|
package/routes/tables.js
CHANGED
|
@@ -22,7 +22,7 @@ const {
|
|
|
22
22
|
post_dropdown_item,
|
|
23
23
|
} = require("@saltcorn/markup");
|
|
24
24
|
const { recalculate_for_stored } = require("@saltcorn/data/models/expression");
|
|
25
|
-
const { isAdmin, error_catcher } = require("./utils.js");
|
|
25
|
+
const { isAdmin, error_catcher, setTenant } = require("./utils.js");
|
|
26
26
|
const Form = require("@saltcorn/data/models/form");
|
|
27
27
|
const {
|
|
28
28
|
span,
|
|
@@ -352,6 +352,7 @@ router.get(
|
|
|
352
352
|
*/
|
|
353
353
|
router.post(
|
|
354
354
|
"/create-from-csv",
|
|
355
|
+
setTenant, // TODO why is this needed?????
|
|
355
356
|
isAdmin,
|
|
356
357
|
error_catcher(async (req, res) => {
|
|
357
358
|
if (req.body.name && req.files && req.files.file) {
|
|
@@ -1367,6 +1368,7 @@ router.post(
|
|
|
1367
1368
|
*/
|
|
1368
1369
|
router.post(
|
|
1369
1370
|
"/upload_to_table/:name",
|
|
1371
|
+
setTenant, // TODO why is this needed?????
|
|
1370
1372
|
isAdmin,
|
|
1371
1373
|
error_catcher(async (req, res) => {
|
|
1372
1374
|
const { name } = req.params;
|