isite 2022.9.23 → 2022.9.25
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/apps/client-side/app.js +3 -22
- package/apps/client-side/site_files/css/bootstrap5-addon.css +2 -0
- package/apps/client-side/site_files/css/effect.css +19 -12
- package/apps/client-side/site_files/css/images.css +16 -12
- package/apps/client-side/site_files/css/layout.css +16 -9
- package/apps/client-side/site_files/css/table.css +1 -1
- package/apps/client-side/site_files/js/angular.js +23512 -22334
- package/apps/client-side/site_files/js/angular.min.js +352 -6
- package/apps/client-side/site_files/js/angular.min.js.map +8 -0
- package/apps/client-side/site_files/js/directive.js +2 -2
- package/apps/client-side/site_files/js/jquery.js +2 -4
- package/apps/client-side/site_files/js/site.js +1 -1
- package/apps/client-side/site_files/js/site.min.js +1 -1
- package/apps/security/site_files/html/add_modal.html +28 -37
- package/apps/security/site_files/html/delete_modal.html +25 -36
- package/apps/security/site_files/html/login_modal.html +2 -2
- package/apps/security/site_files/html/logout_modal.html +14 -14
- package/apps/security/site_files/html/register_modal.html +23 -23
- package/apps/security/site_files/html/update_modal.html +22 -36
- package/apps/security/site_files/html/view_modal.html +26 -37
- package/index.js +1 -2
- package/lib/collection.js +4 -4
- package/lib/collectionFile.js +5 -2
- package/lib/mongodb.js +5 -49
- package/lib/parser.js +100 -2
- package/lib/routing.js +34 -3
- package/lib/sessions.js +1 -1
- package/object-options/index.js +2 -0
- package/object-options/lib/fn.js +44 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(t,e,n,r){function o(t){return t?("string"!=typeof t&&(t=t.toString()),t.replace(/[\/\\^$*+?.()\[\]{}]/g,"\\$&")):""}function a(t,e){let n="";return h.forEach(r=>{r.n==t&&(n=r.i0[e])}),n}function s(t,e){let n="";return 11==t?h.forEach(r=>{r.n==t&&(n=r.i0[e])}):12==t?h.forEach(r=>{r.n==t&&(n=r.i0[e])}):(h.forEach(r=>{r.n==t[1]&&(n=r.i0[e])}),h.forEach(r=>{r.n==t[0]&&(t[1]>0&&t[0]>1?n+=p.strings.space[e]+p.strings.and[e]:n+="",n+=r.i1[e])})),n}function l(t,e){let n="";h.forEach(r=>{r.n==t[0]&&(n=r.i2[e]+p.strings.space[e])});let r=s(t.substring(1),e);return r&&(n&&(n+=p.strings.and[e]),n+=r),n}function c(t,e){let n="";h.forEach(r=>{r.n==t[0]&&(n=r.i3[e]+p.strings.space[e])});let r=l(t.substring(1),e);return r&&(n&&(n+=p.strings.and[e]),n+=r),n}function u(t,e){let n=s(t.substring(0,2),e)+p.strings.space[e];1==t[0]?n+=p.strings[10][e]+p.strings.space[e]:n+=p.strings[20][e]+p.strings.space[e];let r=l(t.substring(2),e);return r&&(n+=p.strings.and[e]+r),n}function d(t,e){let n=l(t.substring(0,3),e)+p.strings.space[e];n+=p.strings[100][e]+p.strings.space[e];let r=l(t.substring(3),e);return r&&(n+=p.strings.and[e]+r),n}if(String.prototype.test||(String.prototype.test=function(t,e="gium"){try{return new RegExp(t,e).test(this)}catch(t){return!1}}),String.prototype.like||(String.prototype.like=function(t){if(!t)return!1;let e=!1;return t.split("|").forEach(t=>{t=t.split("*"),t.forEach((e,n)=>{t[n]=o(e)}),t=t.join(".*"),this.test("^"+t+"$","gium")&&(e=!0)}),e}),String.prototype.contains||(String.prototype.contains=function(t){let e=!1;return t?(t.split("|").forEach(t=>{t&&this.test("^.*"+o(t)+".*$","gium")&&(e=!0)}),e):e}),t.SOCIALBROWSER){if(SOCIALBROWSER.var=SOCIALBROWSER.var||{},SOCIALBROWSER.var.white_list=SOCIALBROWSER.var.white_list||[],e.location.hostname){let t=`*${e.location.hostname}*`,n=!1;SOCIALBROWSER.var.white_list.forEach(e=>{e.url==t&&(n=!0)}),n||(SOCIALBROWSER.var.white_list.push({url:t}),SOCIALBROWSER.call("set_var",{name:"white_list",data:SOCIALBROWSER.var.white_list}))}SOCIALBROWSER.var.blocking=SOCIALBROWSER.var.blocking||{},SOCIALBROWSER.var.blocking.block_ads=!1,SOCIALBROWSER.var.blocking.block_empty_iframe=!1,SOCIALBROWSER.var.blocking.remove_external_iframe=!1,SOCIALBROWSER.var.blocking.skip_video_ads=!1,SOCIALBROWSER.var.blocking.popup=SOCIALBROWSER.var.blocking.popup||{},SOCIALBROWSER.var.blocking.popup.allow_external=!0,SOCIALBROWSER.var.blocking.popup.allow_internal=!0,SOCIALBROWSER.var.blocking.javascript=SOCIALBROWSER.var.blocking.javascript||{},SOCIALBROWSER.var.blocking.javascript.block_window_open=!1,SOCIALBROWSER.var.blocking.javascript.block_eval=!1,SOCIALBROWSER.var.blocking.javascript.block_console_output=!1}let p={printerList:[],getPrinters:function(){return t.SOCIALBROWSER&&SOCIALBROWSER.currentWindow.webContents.getPrintersAsync?SOCIALBROWSER.currentWindow.webContents.getPrintersAsync().then(t=>{p.printerList=t}):t.SOCIALBROWSER&&SOCIALBROWSER.currentWindow.webContents.getPrinters?p.printerList=SOCIALBROWSER.currentWindow.webContents.getPrinters():fetch("http://127.0.0.1:60080/printers/all").then(t=>t.json()).then(t=>{p.printerList=t.list}),p.printerList},render:function(t,n){let r=e.querySelector(t);return r?Mustache.render(r.innerHTML,n):""},html:function(t,e){return Mustache.render(t,e)},getUniqueObjects:function(t,e){const n=t.map(t=>t[e]).map((t,e,n)=>n.indexOf(t)===e&&e).filter(e=>t[e]).map(e=>t[e]);return n},$:function(t){let n=e.querySelectorAll(t);return n}},g=999999;p.showModal=function(e){r(e).click(()=>{r("popup").hide()}),g++;let n=p.$(e);if(0===n.length)return;n[0].style.zIndex=g,n[0].style.display="block";let o=n[0].getAttribute("fixed");""!==o&&n[0].addEventListener("click",function(){p.hideModal(e)});let i=p.$(e+" i-control input");i.length>0&&i[0].focus(),p.$(e+" .close").forEach(t=>{t.addEventListener("click",function(){p.hideModal(e)})}),p.$(e+" .modal-header").forEach(e=>{e.addEventListener("click",function(e){e=e||t.event,e.stopPropagation()})}),p.$(e+" .modal-body").forEach(e=>{e.addEventListener("click",function(e){e=e||t.event,e.stopPropagation()})}),p.$(e+" .modal-footer").forEach(e=>{e.addEventListener("click",function(e){e=e||t.event,e.stopPropagation()})})},p.hideModal=function(t){r("popup").hide();let e=p.$(t);e.length>0&&(e[0].style.display="none")},p.eventList=[],p.on=function(t,e){e=e||function(){},p.eventList.push({name:t,callback:e})},p.call=function(t,e){for(var n=0;n<p.eventList.length;n++){var r=p.eventList[n];r.name==t&&r.callback(e)}},p.translate=function(t,e){"string"==typeof t&&(t={text:t,lang:"ar"}),t.url=`https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=${t.lang}&dt=t&dt=bd&dj=1&q=${t.text}`,p.getData(t,e)},p.getData=function(t,e,n){e=e||function(){},n=n||function(){},"string"==typeof t&&(t={url:t}),t.headers=t.headers||{Accept:"application/json","Content-Type":"application/json"},t.url=p.handle_url(t.url),fetch(t.url,{mode:"cors",method:"get",headers:t.headers}).then(t=>t.json()).then(t=>{e(t)}).catch(t=>{n(t)})},p.getContent=function(t,e,n){e=e||function(){},n=n||function(){},"string"==typeof t&&(t={url:t}),t.url=p.handle_url(t.url),fetch(t.url,{mode:"cors",method:"get"}).then(function(t){return t.text()}).then(function(t){e(t)})},p.handle_url=function(e){if("string"!=typeof e)return e;if(e=e.trim(),e.like("http*")||0===e.indexOf("//")||0===e.indexOf("data:"))e=e;else if(0===e.indexOf("/"))e=t.location.origin+e;else if(e.split("?")[0].split(".").length<3){let n=t.location.pathname.split("/").pop();e=t.location.origin+t.location.pathname.replace(n,"")+e}return e},p.postData=function(n,r,o){r=r||function(){},o=o||function(){},"string"==typeof n&&(n={url:n}),n.data=n.data||n.body,delete n.body,n.data&&"object"==typeof n.data&&(n.data=JSON.stringify(n.data)),n.headers=n.headers||{Accept:"application/json","Content-Type":"application/json"},n.data&&"string"==typeof n.data&&(n.headers["Content-Length"]=n.data.length.toString());try{n.headers.Cookie=e.cookie}catch(o){console.log(o)}n.method="post",n.redirect="follow",n.mode="cors",n.url=p.handle_url(n.url),t.SOCIALBROWSER&&t.SOCIALBROWSER.fetchJson?SOCIALBROWSER.fetchJson(n,t=>{r(t)}):fetch(n.url,{mode:n.mode,method:n.method,headers:n.headers,body:n.data,redirect:n.redirect}).then(t=>t.json()).then(t=>{r(t)}).catch(t=>{o(t)})},p.typeOf=function(t){return Object.prototype.toString.call(t).slice(8,-1)},p.toDateTime=function(t){return t?new Date(t):new Date},p.toDateX=function(t){let e=p.toDateTime(t);return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()},p.toDateXT=function(t){let e=p.toDateTime(t);return e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()},p.toDateXF=function(t){let e=p.toDateTime(t);return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()+" "+e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()},p.toDateOnly=function(t){let e=p.toDateTime(t);return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0)},p.toDateT=function(t){return p.toDateOnly(t).getTime()},p.toDateF=function(t){return p.toDateTime(t).getTime()},p.addZero=function(t,e){let n=e-t.toString().length;for(let e=0;e<n;e++)t="0"+t.toString();return t},p.addSubZero=function(t,e){let n=e;if(2==t.toString().split(".").length){t.toString().split(".")[1].length;t=t.toString()}else t=t.toString()+".";for(let e=0;e<n;e++)t=t.toString()+0;return t},p.fixed=3,p.to_number=p.toNumber=function(t,e){let n=e||p.fixed,r=0;return t&&(r=parseFloat(t).toFixed(n)),parseFloat(r)},p.to_money=p.toMoney=function(t,e=!0){let n=0;if(t){t=t.toFixed(2).split(".");t[0];let e=t[1]||"00";if(e){let n=e[0]||"0",r=e[1]||"0";r&&parseInt(r)>5?(n=parseInt(n)+1,n*=10,100==n?(n=0,t[0]=parseInt(t[0])+1,t[1]=""):t[1]=n):r&&5==parseInt(r)?t[1]=e:r&&parseInt(r)>2?(r=5,t[1]=n+r):t[1]=n+"0"}n=t.join(".")}return e?p.to_float(n):(n&&n.endsWith(".")&&(n+="00"),n)},p.to_float=p.toFloat=function(t){return t?parseFloat(t):0},p.to_int=p.toInt=function(t){return t?parseInt(t):0},p.$base64Letter="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",p.$base64Numbers=[];for(let t=11;t<99;t++)t%10!=0&&t%11!=0&&p.$base64Numbers.push(t);p.toJson=(t=>typeof t===n||null===t?"":JSON.stringify(t)),p.fromJson=(t=>"string"!=typeof t?t:JSON.parse(t)),p.toBase64=(t=>typeof t===n||null===t||""===t?"":("string"!=typeof t&&(t=p.toJson(t)),Base64.encode(t))),p.fromBase64=(t=>typeof t===n||null===t||""===t?"":Base64.decode(t)),p.to123=(t=>{t=p.toBase64(t);let e="";for(let n=0;n<t.length;n++){let r=t[n];e+=p.$base64Numbers[p.$base64Letter.indexOf(r)]}return e}),p.from123=(t=>{let e="";for(let n=0;n<t.length;n++){let r=t[n]+t[n+1],o=p.$base64Numbers.indexOf(parseInt(r));e+=p.$base64Letter[o],n++}return e=p.fromBase64(e),e}),p.hide=function(t){return p.to123(t)},p.show=function(t){return JSON.parse(p.from123(t))},p.typeOf=p.typeof=function(t){return Object.prototype.toString.call(t).slice(8,-1)},p.showTabContent=function(t,n){let r=e.querySelectorAll(".tab-content");for(i=0;i<r.length;i++)r[i].style.display="none";let o=e.querySelectorAll(".tab-link");for(i=0;i<o.length;i++)o[i].className=o[i].className.replace(" active","");e.querySelectorAll(n+".tab-content").forEach(t=>{t.style.display="inline-block"}),t&&(t.currentTarget.className+=" active")},p.showTabs=function(t,e){t&&t.stopPropagation(),r(".main-menu .tabs").hide(),r(e).show(100)},p.toHtmlTable=function(t){if(t===n||null===t)return"";if("Object"==p.typeOf(t)){let e='<table class="table">';for(let n=0;n<Object.getOwnPropertyNames(t).length;n++){let r=Object.getOwnPropertyNames(t)[n];e+="<tr>",e+=`<td><p> ${r} </p></td>`,"Object"==p.typeOf(t[r])||"Array"==p.typeOf(t[r])?e+=`<td><p> ${p.toHtmlTable(t[r])} </p></td>`:e+=`<td><p> ${t[r]} </p></td>`,e+="</tr>"}return e+="</table>",e}if("Array"==p.typeOf(t)){let e='<table class="table">';for(let n=0;n<t.length;n++)"Object"==p.typeOf(t[n])||"Array"==p.typeOf(t[n])?e+=`<tr><td><p>${p.toHtmlTable(t[n])}</p></td></tr>`:e+=`<tr><td><p>${t[n]}</p></td></tr>`;return e+="</table>",e}return""},p.resetValidated=function(t){t=t||"body";const n=e.querySelectorAll(t+" [v]");n.forEach(t=>{t.classList.remove("is-invalid"),t.classList.remove("is-valid")})},p.validated=function(t){const n={ok:!0,messages:[]};t=t||"body";const r=e.querySelectorAll(t+" [v]");return r.forEach(t=>{t.classList.remove("is-invalid"),t.classList.remove("is-valid");const e=t.getAttribute("v"),r=e.split(" ");r.forEach(e=>{if(e=e.toLowerCase().trim(),"r"===e)"INPUT"!==t.nodeName&&"SELECT"!==t.nodeName&&"TEXTAREA"!==t.nodeName||t.value&&!t.value.like("*undefined*")||(t.classList.add("is-invalid"),(f=t.parentNode.querySelector(".invalid-feedback"))&&(p.session&&"en"==p.session.lang?f.innerHTML="Data Is Required":p.session&&"ar"==p.session.lang&&(f.innerHTML="هذا البيان مطلوب")),n.ok=!1,n.messages.push({en:"Data Is Required",ar:"هذا البيان مطلوب"})),"I-DATETIME"!==t.nodeName||t.getAttribute("value")?t.classList.add("is-valid"):(t.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Data Is Required",ar:"هذا البيان مطلوب"}));else if(e.like("ml*")){const r=parseInt(e.replace("ml",""));"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName||t.value&&!(t.value.length>r)||(t.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Letter Count Must be <= "+r,ar:"عدد الاحرف يجب ان يكون أقل من أو يساوى "+r}))}else if(e.like("ll*")){const r=parseInt(e.replace("ll",""));"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName||t.value&&!(t.value.length<r)||(t.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Letter Count Must be >= "+r,ar:"عدد الاحرف يجب ان يكون اكبر من أو يساوى "+r}))}else if(e.like("l*")){const r=parseInt(e.replace("l",""));"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName||t.value&&t.value.length===r||(t.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Letter Count Must be = "+r,ar:"عدد الاحرف يجب ان يساوى "+r}))}})}),n};let h=[{n:1,i0:{ar:"واحد"},i1:{ar:"عشرة"},i2:{ar:"مائة"},i3:{ar:"الف"},i4:{ar:"عشرة الاف"}},{n:2,i0:{ar:"اثنان "},i1:{ar:"عشرون"},i2:{ar:"مائتان"},i3:{ar:"الفان"},i4:{ar:"عشرون الف"}},{n:3,i0:{ar:"ثلاثة"},i1:{ar:"ثلاثون"},i2:{ar:"ثلاثمائة"},i3:{ar:"ثلاث الاف"},i4:{ar:"ثلاثون الف"}},{n:4,i0:{ar:"اربعة"},i1:{ar:"اربعون"},i2:{ar:"اربعة مائة"},i3:{ar:"اربعة الاف"},i4:{ar:"اربعون الف"}},{n:5,i0:{ar:"خمسة"},i1:{ar:"خمسون"},i2:{ar:"خمسمائة"},i3:{ar:"خمسة الاف"},i4:{ar:"خمسون الف"}},{n:6,i0:{ar:"ستة"},i1:{ar:"ستون"},i2:{ar:"ستة مائة"},i3:{ar:"ستة الااف"},i4:{ar:"ستون الف"}},{n:7,i0:{ar:"سبعة"},i1:{ar:"سبعون"},i2:{ar:"سبعمائة"},i3:{ar:"سبعة الااف"},i4:{ar:"سبعون الف"}},{n:8,i0:{ar:"ثمانية"},i1:{ar:"ثمانون"},i2:{ar:"ثمانمائة"},i3:{ar:"ثمان الااف"},i4:{ar:"ثمانون الف"}},{n:9,i0:{ar:"تسعة"},i1:{ar:"تسعون"},i2:{ar:"تسعمائة"},i3:{ar:"تسعة الااف"},i4:{ar:"تسعون الف"}},{n:11,i0:{ar:"احدى عشر"}},{n:12,i0:{ar:"اثنى عشر"}}];p.strings={and:{ar:"و"},space:{ar:" "},10:{ar:"آلاف"},20:{ar:"ألفاً"},100:{ar:"ألف"},currency:{ar:" جنيها مصريا فقط لاغير "},from10:{ar:" قروش "},from100:{ar:" قرش "},from1000:{ar:" من الف "}},p.stringfiy=function(t,e){t=t||"",e=e||"ar",t=t.toString().split(".");let n=t[0],r=t[1],o="";1==n.length?o=a(n,e):2==n.length?o=s(n,e):3==n.length?o=l(n,e):4==n.length?o=c(n,e):5==n.length?o=u(n,e):6==n.length&&(o=d(n,e));let i="";return r&&(1==r.length&&(r+="0"),1==r.length?i=a(r,e)+p.strings.from10[e]:2==r.length?i=s(r,e)+p.strings.from100[e]:3==r.length&&(i=l(r,e)+p.strings.from1000[e])),o+=p.strings.currency[e],i&&(o+=p.strings.space[e]+p.strings.and[e]+p.strings.space[e]+i),o},p.ws=function(e,n){if("WebSocket"in t){"string"==typeof e&&(e={url:e});var r=new WebSocket(e.url);let t={ws:r,options:e,closed:!0,onError:t=>{console.log("server.onError Not Implement ... ")},onClose:function(t){t.wasClean?console.log(`[ws closed] Connection closed cleanly, code=${t.code} reason=${t.reason}`):(console.warn("[ws closed] Connection died"),setTimeout(()=>{p.ws(e,n)},5e3))},onOpen:()=>{console.log("server.onOpen Not Implement ... ")},onMessage:()=>{console.log("server.onMessage Not Implement ... ")},onData:()=>{console.log("server.onData Not Implement ... ")},send:function(t){if(this.closed)return!1;"object"!=typeof t&&(t={type:"text",content:t}),this.ws.send(JSON.stringify(t))}};r.onerror=function(e){t.onError(e)},r.onclose=function(e){t.closed=!0,t.onClose(e)},r.onopen=function(){t.closed=!1,t.onOpen()},r.onmessage=function(e){e instanceof Blob?t.onData(e):t.onMessage(JSON.parse(e.data))},n(t)}else console.error("WebSocket Not Supported")},p.hex=function(t){if("string"==typeof t){const e=new TextEncoder;return Array.from(e.encode(t)).map(t=>t.toString(16).padStart(2,"0")).join("")}if("number"==typeof t){let e=t.toString(16);return 1==e.length&&(e="0"+e),e}},p.zakat=function(t){let e="";return t.name&&(e+="01"+p.hex(t.name.length)+p.hex(t.name)),t.vat_number&&(e+="02"+p.hex(t.vat_number.length)+p.hex(t.vat_number)),t.time&&(e+="03"+p.hex(t.time.length)+p.hex(t.time)),t.total&&(e+="04"+p.hex(t.total.length)+p.hex(t.total)),t.vat_total&&(e+="05"+p.hex(t.vat_total.length)+p.hex(t.vat_total)),p.toBase64(e)},p.zakat2=function(t,e){fetch("/x-api/zakat",{method:"POST",body:JSON.stringify(t)}).then(t=>t.json()).then(t=>{e(t)})},p.barcode=function(t){if(t&&t.selector&&t.text)return JsBarcode(t.selector,t.selector,t.options);console.error("qrcode need {selector , text}")},p.qrcode=function(t){if(!t||!t.selector||!t.text)return void console.error("qrcode need {selector , text}");let n="string"==typeof t.selector?e.querySelector(t.selector):t.selector;return n?(n.innerHTML="",new QRCode(n,{text:t.text,width:t.width||256,height:t.height||256,colorDark:t.colorDark||"#000000",colorLight:t.colorLight||"#ffffff",correctLevel:t.correctLevel||QRCode.CorrectLevel.H})):void 0},t.site=p})(window,document,"undefined",jQuery);
|
|
1
|
+
(function(e,t,n,r){function o(e){return e?("string"!=typeof e&&(e=e.toString()),e.replace(/[\/\\^$*+?.()\[\]{}]/g,"\\$&")):""}function a(e,t){let n="";return g.forEach(r=>{r.n==e&&(n=r.i0[t])}),n}function s(e,t){let n="";return 11==e?g.forEach(r=>{r.n==e&&(n=r.i0[t])}):12==e?g.forEach(r=>{r.n==e&&(n=r.i0[t])}):(g.forEach(r=>{r.n==e[1]&&(n=r.i0[t])}),g.forEach(r=>{r.n==e[0]&&(e[1]>0&&e[0]>1?n+=p.strings.space[t]+p.strings.and[t]:n+="",n+=r.i1[t])})),n}function l(e,t){let n="";g.forEach(r=>{r.n==e[0]&&(n=r.i2[t]+p.strings.space[t])});let r=s(e.substring(1),t);return r&&(n&&(n+=p.strings.and[t]),n+=r),n}function c(e,t){let n="";g.forEach(r=>{r.n==e[0]&&(n=r.i3[t]+p.strings.space[t])});let r=l(e.substring(1),t);return r&&(n&&(n+=p.strings.and[t]),n+=r),n}function u(e,t){let n=s(e.substring(0,2),t)+p.strings.space[t];1==e[0]?n+=p.strings[10][t]+p.strings.space[t]:n+=p.strings[20][t]+p.strings.space[t];let r=l(e.substring(2),t);return r&&(n+=p.strings.and[t]+r),n}function d(e,t){let n=l(e.substring(0,3),t)+p.strings.space[t];n+=p.strings[100][t]+p.strings.space[t];let r=l(e.substring(3),t);return r&&(n+=p.strings.and[t]+r),n}if(String.prototype.test||(String.prototype.test=function(e,t="gium"){try{return new RegExp(e,t).test(this)}catch(e){return!1}}),String.prototype.like||(String.prototype.like=function(e){if(!e)return!1;let t=!1;return e.split("|").forEach(e=>{e=e.split("*"),e.forEach((t,n)=>{e[n]=o(t)}),e=e.join(".*"),this.test("^"+e+"$","gium")&&(t=!0)}),t}),String.prototype.contains||(String.prototype.contains=function(e){let t=!1;return e?(e.split("|").forEach(e=>{e&&this.test("^.*"+o(e)+".*$","gium")&&(t=!0)}),t):t}),e.SOCIALBROWSER){if(SOCIALBROWSER.var=SOCIALBROWSER.var||{},SOCIALBROWSER.var.white_list=SOCIALBROWSER.var.white_list||[],t.location.hostname){let e=`*${t.location.hostname}*`,n=!1;SOCIALBROWSER.var.white_list.forEach(t=>{t.url==e&&(n=!0)}),n||(SOCIALBROWSER.var.white_list.push({url:e}),SOCIALBROWSER.call("set_var",{name:"white_list",data:SOCIALBROWSER.var.white_list}))}SOCIALBROWSER.var.blocking=SOCIALBROWSER.var.blocking||{},SOCIALBROWSER.var.blocking.block_ads=!1,SOCIALBROWSER.var.blocking.block_empty_iframe=!1,SOCIALBROWSER.var.blocking.remove_external_iframe=!1,SOCIALBROWSER.var.blocking.skip_video_ads=!1,SOCIALBROWSER.var.blocking.popup=SOCIALBROWSER.var.blocking.popup||{},SOCIALBROWSER.var.blocking.popup.allow_external=!0,SOCIALBROWSER.var.blocking.popup.allow_internal=!0,SOCIALBROWSER.var.blocking.javascript=SOCIALBROWSER.var.blocking.javascript||{},SOCIALBROWSER.var.blocking.javascript.block_window_open=!1,SOCIALBROWSER.var.blocking.javascript.block_eval=!1,SOCIALBROWSER.var.blocking.javascript.block_console_output=!1}let p={onLoad:function(e){"loading"!==t.readyState?e():t.addEventListener("DOMContentLoaded",()=>{e()})}};p.zoomNumber=parseInt(localStorage.getItem("zoomNumber")||100),p.zoom=function(e){"+"==e?p.zoomNumber+=25:"-"==e?p.zoomNumber-=25:"0"==e||(p.zoomNumber=100),localStorage.setItem("zoomNumber",p.zoomNumber.toString()),t.body.style.zoom=p.zoomNumber+"%"},p.onLoad(()=>{p.zoom("0")}),p.printerList=[],p.getPrinters=function(){return e.SOCIALBROWSER&&SOCIALBROWSER.currentWindow.webContents.getPrintersAsync?SOCIALBROWSER.currentWindow.webContents.getPrintersAsync().then(e=>{p.printerList=e}):e.SOCIALBROWSER&&SOCIALBROWSER.currentWindow.webContents.getPrinters?p.printerList=SOCIALBROWSER.currentWindow.webContents.getPrinters():fetch("http://127.0.0.1:60080/printers/all").then(e=>e.json()).then(e=>{p.printerList=e.list}).catch(e=>{p.printerList=[]}),p.printerList},p.render=function(e,n){let r=t.querySelector(e);return r?Mustache.render(r.innerHTML,n):""},p.html=function(e,t){return Mustache.render(e,t)},p.getUniqueObjects=function(e,t){const n=e.map(e=>e[t]).map((e,t,n)=>n.indexOf(e)===t&&t).filter(t=>e[t]).map(t=>e[t]);return n},p.$=function(e){let n=t.querySelectorAll(e);return n},p.modal_z_index=999999,p.showModal=function(t){r(t).click(()=>{r("popup").hide()}),p.modal_z_index++;let n=p.$(t);if(0===n.length)return;n[0].style.zIndex=p.modal_z_index,n[0].style.display="block";let o=n[0].getAttribute("fixed");""!==o&&n[0].addEventListener("click",function(){p.hideModal(t)});let a=p.$(t+" i-control input");a.length>0&&a[0].focus(),p.$(t+" .close").forEach(e=>{e.addEventListener("click",function(){p.hideModal(t)})}),p.$(t+" .modal-header").forEach(t=>{t.addEventListener("click",function(t){t=t||e.event,t.stopPropagation()})}),p.$(t+" .modal-body").forEach(t=>{t.addEventListener("click",function(t){t=t||e.event,t.stopPropagation()})}),p.$(t+" .modal-footer").forEach(t=>{t.addEventListener("click",function(t){t=t||e.event,t.stopPropagation()})})},p.hideModal=function(e){r("popup").hide();let t=p.$(e);t.length>0&&(t[0].style.display="none")},p.eventList=[],p.on=function(e,t){t=t||function(){},p.eventList.push({name:e,callback:t})},p.call=function(e,t){for(var n=0;n<p.eventList.length;n++){var r=p.eventList[n];r.name==e&&r.callback(t)}},p.translate=function(e,t){"string"==typeof e&&(e={text:e,lang:"ar"}),e.url=`https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=${e.lang}&dt=t&dt=bd&dj=1&q=${e.text}`,p.getData(e,t)},p.getData=function(e,t,n){t=t||function(){},n=n||function(){},"string"==typeof e&&(e={url:e}),e.headers=e.headers||{Accept:"application/json","Content-Type":"application/json"},e.url=p.handle_url(e.url),fetch(e.url,{mode:"cors",method:"get",headers:e.headers}).then(e=>e.json()).then(e=>{t(e)}).catch(e=>{n(e)})},p.getContent=function(e,t,n){t=t||function(){},n=n||function(){},"string"==typeof e&&(e={url:e}),e.url=p.handle_url(e.url),fetch(e.url,{mode:"cors",method:"get"}).then(function(e){return e.text()}).then(function(e){t(e)})},p.handle_url=function(t){if("string"!=typeof t)return t;if(t=t.trim(),t.like("http*")||0===t.indexOf("//")||0===t.indexOf("data:"))t=t;else if(0===t.indexOf("/"))t=e.location.origin+t;else if(t.split("?")[0].split(".").length<3){let n=e.location.pathname.split("/").pop();t=e.location.origin+e.location.pathname.replace(n,"")+t}return t},p.postData=function(e,n,r){n=n||function(){},r=r||function(){},"string"==typeof e&&(e={url:e}),e.data=e.data||e.body,delete e.body,e.data&&"object"==typeof e.data&&(e.data=JSON.stringify(e.data)),e.headers=e.headers||{Accept:"application/json","Content-Type":"application/json"},e.data&&"string"==typeof e.data&&(e.headers["Content-Length"]=e.data.length.toString());try{e.headers.Cookie=t.cookie}catch(r){console.log(r)}e.method="post",e.redirect="follow",e.mode="cors",e.url=p.handle_url(e.url),fetch(e.url,{mode:e.mode,method:e.method,headers:e.headers,body:e.data,redirect:e.redirect}).then(e=>e.json()).then(e=>{n(e)}).catch(e=>{r(e)})},p.typeOf=function(e){return Object.prototype.toString.call(e).slice(8,-1)},p.toDateTime=function(e){return e?new Date(e):new Date},p.toDateX=function(e){let t=p.toDateTime(e);return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()},p.toDateXT=function(e){let t=p.toDateTime(e);return t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()},p.toDateXF=function(e){let t=p.toDateTime(e);return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()+" "+t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()},p.toDateOnly=function(e){let t=p.toDateTime(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)},p.toDateT=function(e){return p.toDateOnly(e).getTime()},p.toDateF=function(e){return p.toDateTime(e).getTime()},p.addZero=function(e,t){let n=t-e.toString().length;for(let t=0;t<n;t++)e="0"+e.toString();return e},p.addSubZero=function(e,t){let n=t;if(2==e.toString().split(".").length){e.toString().split(".")[1].length;e=e.toString()}else e=e.toString()+".";for(let t=0;t<n;t++)e=e.toString()+0;return e},p.fixed=3,p.to_number=p.toNumber=function(e,t){let n=t||p.fixed,r=0;return e&&(r=parseFloat(e).toFixed(n)),parseFloat(r)},p.to_money=p.toMoney=function(e,t=!0){let n=0;if(e){e=e.toFixed(2).split(".");e[0];let t=e[1]||"00";if(t){let n=t[0]||"0",r=t[1]||"0";r&&parseInt(r)>5?(n=parseInt(n)+1,n*=10,100==n?(n=0,e[0]=parseInt(e[0])+1,e[1]=""):e[1]=n):r&&5==parseInt(r)?e[1]=t:r&&parseInt(r)>2?(r=5,e[1]=n+r):e[1]=n+"0"}n=e.join(".")}return t?p.to_float(n):(n&&n.endsWith(".")&&(n+="00"),n)},p.to_float=p.toFloat=function(e){return e?parseFloat(e):0},p.to_int=p.toInt=function(e){return e?parseInt(e):0},p.$base64Letter="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",p.$base64Numbers=[];for(let e=11;e<99;e++)e%10!=0&&e%11!=0&&p.$base64Numbers.push(e);p.toJson=(e=>typeof e===n||null===e?"":JSON.stringify(e)),p.fromJson=(e=>"string"!=typeof e?e:JSON.parse(e)),p.toBase64=(e=>typeof e===n||null===e||""===e?"":("string"!=typeof e&&(e=p.toJson(e)),Base64.encode(e))),p.fromBase64=(e=>typeof e===n||null===e||""===e?"":Base64.decode(e)),p.to123=(e=>{e=p.toBase64(e);let t="";for(let n=0;n<e.length;n++){let r=e[n];t+=p.$base64Numbers[p.$base64Letter.indexOf(r)]}return t}),p.from123=(e=>{let t="";for(let n=0;n<e.length;n++){let r=e[n]+e[n+1],o=p.$base64Numbers.indexOf(parseInt(r));t+=p.$base64Letter[o],n++}return t=p.fromBase64(t),t}),p.hide=p.hideObject=function(e){return p.to123(JSON.parse(e))},p.show=p.showObject=function(e){return JSON.parse(p.from123(e))},p.typeOf=p.typeof=function(e){return Object.prototype.toString.call(e).slice(8,-1)},p.showTabContent=function(e,n){let r=t.querySelectorAll(".tab-content");for(i=0;i<r.length;i++)r[i].style.display="none";let o=t.querySelectorAll(".tab-link");for(i=0;i<o.length;i++)o[i].className=o[i].className.replace(" active","");t.querySelectorAll(n+".tab-content").forEach(e=>{e.style.display="block"}),e&&(e.currentTarget.className+=" active")},p.showTabs=function(e,t){e&&e.stopPropagation(),r(".main-menu .tabs").hide(),r(t).show(100)},p.toHtmlTable=function(e){if(e===n||null===e)return"";if("Object"==p.typeOf(e)){let t='<table class="table">';for(let n=0;n<Object.getOwnPropertyNames(e).length;n++){let r=Object.getOwnPropertyNames(e)[n];t+="<tr>",t+=`<td><p> ${r} </p></td>`,"Object"==p.typeOf(e[r])||"Array"==p.typeOf(e[r])?t+=`<td><p> ${p.toHtmlTable(e[r])} </p></td>`:t+=`<td><p> ${e[r]} </p></td>`,t+="</tr>"}return t+="</table>",t}if("Array"==p.typeOf(e)){let t='<table class="table">';for(let n=0;n<e.length;n++)"Object"==p.typeOf(e[n])||"Array"==p.typeOf(e[n])?t+=`<tr><td><p>${p.toHtmlTable(e[n])}</p></td></tr>`:t+=`<tr><td><p>${e[n]}</p></td></tr>`;return t+="</table>",t}return""},p.resetValidated=function(e){e=e||"body";const n=t.querySelectorAll(e+" [v]");n.forEach(e=>{e.classList.remove("is-invalid"),e.classList.remove("is-valid")})},p.validated=function(e){const n={ok:!0,messages:[]};e=e||"body";const r=t.querySelectorAll(e+" [v]");return r.forEach(e=>{e.classList.remove("is-invalid"),e.classList.remove("is-valid");const t=e.getAttribute("v"),r=t.split(" ");r.forEach(t=>{if(t=t.toLowerCase().trim(),"r"===t)"INPUT"!==e.nodeName&&"SELECT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&!e.value.like("*undefined*")?"I-DATETIME"!==e.nodeName||e.getAttribute("value")?"INPUT"!==e.nodeName&&"SELECT"!==e.nodeName&&"TEXTAREA"!==e.nodeName&&"I-DATETIME"!==e.nodeName||e.classList.add("is-valid"):(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Data Is Required",ar:"هذا البيان مطلوب"})):(e.classList.add("is-invalid"),(f=e.parentNode.querySelector(".invalid-feedback"))&&(p.session&&"en"==p.session.lang?f.innerHTML="Data Is Required":p.session&&"ar"==p.session.lang&&(f.innerHTML="هذا البيان مطلوب")),n.ok=!1,n.messages.push({en:"Data Is Required",ar:"هذا البيان مطلوب"}));else if(t.like("ml*")){const r=parseInt(t.replace("ml",""));"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&!(e.value.length>r)||(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Letter Count Must be <= "+r,ar:"عدد الاحرف يجب ان يكون أقل من أو يساوى "+r}))}else if(t.like("ll*")){const r=parseInt(t.replace("ll",""));"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&!(e.value.length<r)||(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Letter Count Must be >= "+r,ar:"عدد الاحرف يجب ان يكون اكبر من أو يساوى "+r}))}else if(t.like("l*")){const r=parseInt(t.replace("l",""));"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.value&&e.value.length===r||(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Letter Count Must be = "+r,ar:"عدد الاحرف يجب ان يساوى "+r}))}else t.like("e")?"INPUT"!==e.nodeName||e.value&&p.isEmail(e.value)||(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Write Valid Email address",ar:"اكتب البريد الالكترونى بطريقة صحيحة"})):(t.like("web")||t.like("url"))&&("INPUT"!==e.nodeName||e.value&&p.isURL(e.value)||(e.classList.add("is-invalid"),n.ok=!1,n.messages.push({en:"Write Valid Web address",ar:"اكتب رابط الموقع بطريقة صحيحة"})))})}),n},p.isEmail=function(e){return!!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(e)},p.isURL=function(e){var t=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");return!!t.test(encodeURI(e))};let g=[{n:1,i0:{ar:"واحد"},i1:{ar:"عشرة"},i2:{ar:"مائة"},i3:{ar:"الف"},i4:{ar:"عشرة الاف"}},{n:2,i0:{ar:"اثنان "},i1:{ar:"عشرون"},i2:{ar:"مائتان"},i3:{ar:"الفان"},i4:{ar:"عشرون الف"}},{n:3,i0:{ar:"ثلاثة"},i1:{ar:"ثلاثون"},i2:{ar:"ثلاثمائة"},i3:{ar:"ثلاث الاف"},i4:{ar:"ثلاثون الف"}},{n:4,i0:{ar:"اربعة"},i1:{ar:"اربعون"},i2:{ar:"اربعة مائة"},i3:{ar:"اربعة الاف"},i4:{ar:"اربعون الف"}},{n:5,i0:{ar:"خمسة"},i1:{ar:"خمسون"},i2:{ar:"خمسمائة"},i3:{ar:"خمسة الاف"},i4:{ar:"خمسون الف"}},{n:6,i0:{ar:"ستة"},i1:{ar:"ستون"},i2:{ar:"ستة مائة"},i3:{ar:"ستة الااف"},i4:{ar:"ستون الف"}},{n:7,i0:{ar:"سبعة"},i1:{ar:"سبعون"},i2:{ar:"سبعمائة"},i3:{ar:"سبعة الااف"},i4:{ar:"سبعون الف"}},{n:8,i0:{ar:"ثمانية"},i1:{ar:"ثمانون"},i2:{ar:"ثمانمائة"},i3:{ar:"ثمان الااف"},i4:{ar:"ثمانون الف"}},{n:9,i0:{ar:"تسعة"},i1:{ar:"تسعون"},i2:{ar:"تسعمائة"},i3:{ar:"تسعة الااف"},i4:{ar:"تسعون الف"}},{n:11,i0:{ar:"احدى عشر"}},{n:12,i0:{ar:"اثنى عشر"}}];p.strings={and:{ar:"و"},space:{ar:" "},10:{ar:"آلاف"},20:{ar:"ألفاً"},100:{ar:"ألف"},currency:{ar:" جنيها مصريا فقط لاغير "},from10:{ar:" قروش "},from100:{ar:" قرش "},from1000:{ar:" من الف "}},p.stringfiy=function(e,t){e=e||"",t=t||"ar",e=e.toString().split(".");let n=e[0],r=e[1],o="";1==n.length?o=a(n,t):2==n.length?o=s(n,t):3==n.length?o=l(n,t):4==n.length?o=c(n,t):5==n.length?o=u(n,t):6==n.length&&(o=d(n,t));let i="";return r&&(1==r.length&&(r+="0"),1==r.length?i=a(r,t)+p.strings.from10[t]:2==r.length?i=s(r,t)+p.strings.from100[t]:3==r.length&&(i=l(r,t)+p.strings.from1000[t])),o+=p.strings.currency[t],i&&(o+=p.strings.space[t]+p.strings.and[t]+p.strings.space[t]+i),o},p.ws=function(t,n){if("WebSocket"in e){"string"==typeof t&&(t={url:t});var r=new WebSocket(t.url);let e={ws:r,options:t,closed:!0,onError:e=>{console.log("server.onError Not Implement ... ")},onClose:function(e){e.wasClean?console.log(`[ws closed] Connection closed cleanly, code=${e.code} reason=${e.reason}`):(console.warn("[ws closed] Connection died"),setTimeout(()=>{p.ws(t,n)},5e3))},onOpen:()=>{console.log("server.onOpen Not Implement ... ")},onMessage:()=>{console.log("server.onMessage Not Implement ... ")},onData:()=>{console.log("server.onData Not Implement ... ")},send:function(e){if(this.closed)return!1;"object"!=typeof e&&(e={type:"text",content:e}),this.ws.send(JSON.stringify(e))}};r.onerror=function(t){e.onError(t)},r.onclose=function(t){e.closed=!0,e.onClose(t)},r.onopen=function(){e.closed=!1,e.onOpen()},r.onmessage=function(t){t instanceof Blob?e.onData(t):e.onMessage(JSON.parse(t.data))},n(e)}else console.error("WebSocket Not Supported")},p.hex=function(e){if("string"==typeof e){const t=new TextEncoder;return Array.from(t.encode(e)).map(e=>e.toString(16).padStart(2,"0")).join("")}if("number"==typeof e){let t=e.toString(16);return 1==t.length&&(t="0"+t),t}},p.zakat=function(e){let t="";return e.name&&(t+="01"+p.hex(e.name.length)+p.hex(e.name)),e.vat_number&&(t+="02"+p.hex(e.vat_number.length)+p.hex(e.vat_number)),e.time&&(t+="03"+p.hex(e.time.length)+p.hex(e.time)),e.total&&(t+="04"+p.hex(e.total.length)+p.hex(e.total)),e.vat_total&&(t+="05"+p.hex(e.vat_total.length)+p.hex(e.vat_total)),p.toBase64(t)},p.zakat2=function(e,t){fetch("/x-api/zakat",{method:"POST",body:JSON.stringify(e)}).then(e=>e.json()).then(e=>{t(e)})},p.barcode=function(e){if(e&&e.selector&&e.text)return JsBarcode(e.selector,e.selector,e.options);console.error("qrcode need {selector , text}")},p.qrcode=function(e){if(!e||!e.selector||!e.text)return void console.error("qrcode need {selector , text}");let n="string"==typeof e.selector?t.querySelector(e.selector):e.selector;return n?(n.innerHTML="",new QRCode(n,{text:e.text,width:e.width||256,height:e.height||256,colorDark:e.colorDark||"#000000",colorLight:e.colorLight||"#ffffff",correctLevel:e.correctLevel||QRCode.CorrectLevel.H})):void 0},e.site=p})(window,document,"undefined",jQuery);
|
|
@@ -1,45 +1,36 @@
|
|
|
1
1
|
<style>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
#addUserModal .img {
|
|
3
|
+
width: 200px;
|
|
4
|
+
height: 200px;
|
|
5
|
+
margin: 5px;
|
|
6
|
+
padding: 5px;
|
|
7
|
+
border: 1px solid var(--background-color);
|
|
8
|
+
}
|
|
10
9
|
</style>
|
|
11
10
|
<style x-lang="ar">
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
label {
|
|
12
|
+
text-align: right;
|
|
13
|
+
}
|
|
15
14
|
</style>
|
|
16
15
|
|
|
17
|
-
|
|
18
16
|
<div id="addUserModal" class="modal">
|
|
19
|
-
|
|
20
|
-
<div class="modal-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<h2>
|
|
24
|
-
<i class="fa fa-plus"></i> ##word.security_new_user## </h2>
|
|
25
|
-
</div>
|
|
26
|
-
<div class="modal-body">
|
|
27
|
-
<span ng-show="busy">
|
|
28
|
-
<i class="fa fa-spinner white fa-pulse fa-3x fa-fw"></i>
|
|
29
|
-
<span class="sr-only">Loading...</span>
|
|
30
|
-
</span>
|
|
31
|
-
|
|
32
|
-
<div x-import="security/content.html"></div>
|
|
33
|
-
|
|
34
|
-
</div>
|
|
35
|
-
<h2>{{error}}</h2>
|
|
36
|
-
<div class="modal-footer center">
|
|
37
|
-
|
|
38
|
-
<i-button type="add" label="##word.security_add_user##" ng-click="add()"></i-button>
|
|
39
|
-
<i-button type="exit" label="##word.close##" onclick="site.hideModal('#addUserModal')"></i-button>
|
|
40
|
-
|
|
41
|
-
</div>
|
|
17
|
+
<div class="modal-content">
|
|
18
|
+
<div class="modal-header">
|
|
19
|
+
<span class="close">×</span>
|
|
20
|
+
<p><i class="fa fa-plus"></i> ##word.security_new_user##</p>
|
|
42
21
|
</div>
|
|
22
|
+
<div class="modal-body">
|
|
23
|
+
<span ng-show="busy">
|
|
24
|
+
<i class="fa fa-spinner white fa-pulse fa-3x fa-fw"></i>
|
|
25
|
+
<span class="sr-only">Loading...</span>
|
|
26
|
+
</span>
|
|
43
27
|
|
|
44
|
-
|
|
45
|
-
</div>
|
|
28
|
+
<div x-import="security/content.html"></div>
|
|
29
|
+
</div>
|
|
30
|
+
<p>{{error}}</p>
|
|
31
|
+
<div class="modal-footer center">
|
|
32
|
+
<i-button type="add" label="##word.security_add_user##" ng-click="add()"></i-button>
|
|
33
|
+
<i-button type="exit" label="##word.close##" onclick="site.hideModal('#addUserModal')"></i-button>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
@@ -1,42 +1,31 @@
|
|
|
1
1
|
<style>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
.img {
|
|
3
|
+
width: 200px;
|
|
4
|
+
height: 200px;
|
|
5
|
+
margin: 5px;
|
|
6
|
+
padding: 5px;
|
|
7
|
+
border: 1px solid var(--background-color);
|
|
8
|
+
}
|
|
9
9
|
</style>
|
|
10
10
|
|
|
11
|
-
|
|
12
11
|
<div id="deleteUserModal" class="modal">
|
|
13
|
-
|
|
14
|
-
<div class="modal-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<h2>
|
|
18
|
-
<i class="fa fa-plus"></i> ##word.user_details## </h2>
|
|
19
|
-
</div>
|
|
20
|
-
<div class="modal-body">
|
|
21
|
-
<span ng-show="busy">
|
|
22
|
-
<i class="fa fa-spinner white fa-pulse fa-3x fa-fw"></i>
|
|
23
|
-
<span class="sr-only">Loading...</span>
|
|
24
|
-
</span>
|
|
25
|
-
|
|
26
|
-
<div x-import="security/view.html"></div>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</div>
|
|
30
|
-
<h2>{{error}}</h2>
|
|
31
|
-
<div class="modal-footer center">
|
|
32
|
-
|
|
33
|
-
<i-button type="delete" label="##word.delete##" ng-click="delete(user)"></i-button>
|
|
34
|
-
<i-button type="close" label="##word.close##" onclick="site.hideModal('#deleteUserModal')"></i-button>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</div>
|
|
12
|
+
<div class="modal-content">
|
|
13
|
+
<div class="modal-header">
|
|
14
|
+
<span class="close">×</span>
|
|
15
|
+
<p><i class="fa fa-plus"></i> ##word.user_details##</p>
|
|
39
16
|
</div>
|
|
17
|
+
<div class="modal-body">
|
|
18
|
+
<span ng-show="busy">
|
|
19
|
+
<i class="fa fa-spinner white fa-pulse fa-3x fa-fw"></i>
|
|
20
|
+
<span class="sr-only">Loading...</span>
|
|
21
|
+
</span>
|
|
40
22
|
|
|
41
|
-
|
|
42
|
-
</div>
|
|
23
|
+
<div x-import="security/view.html"></div>
|
|
24
|
+
</div>
|
|
25
|
+
<p>{{error}}</p>
|
|
26
|
+
<div class="modal-footer center">
|
|
27
|
+
<i-button type="delete" label="##word.delete##" ng-click="delete(user)"></i-button>
|
|
28
|
+
<i-button type="close" label="##word.close##" onclick="site.hideModal('#deleteUserModal')"></i-button>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
<div class="modal-content">
|
|
3
3
|
<div class="modal-header">
|
|
4
4
|
<span class="close">×</span>
|
|
5
|
-
<
|
|
5
|
+
<p class="text-center"><i class="fas fa-sign-in-alt"></i> ##word.security_login##</p>
|
|
6
6
|
</div>
|
|
7
7
|
|
|
8
8
|
<div class="modal-body">
|
|
9
|
-
<
|
|
9
|
+
<p ng-show="busy" class="center"><i class="fas fa-spinner fa-pulse fa-3x fa-fw"></i></p>
|
|
10
10
|
|
|
11
11
|
<form ng-hide="busy">
|
|
12
12
|
<i-control label="##word.security_user_email##" ng-model="userEmail" ng-keydown="tryLogin($event)"></i-control>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<div data-ng-controller="logout" id="logoutModal" class="modal small" tabindex="-1">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
<div class="modal-content">
|
|
3
|
+
<div class="modal-header">
|
|
4
|
+
<span class="close">×</span>
|
|
5
|
+
<p class="text-center"><i class="fa fa-sign-out"></i> ##word.security_logout##</p>
|
|
6
|
+
</div>
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
<div class="modal-body">
|
|
9
|
+
<p class="center" ng-show="busy"><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i><span class="sr-only">Loading...</span></p>
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</div>
|
|
11
|
+
<p class="red">{{error}}</p>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="modal-footer center">
|
|
14
|
+
<button class="btn bg-blue white" onclick="site.hideModal('#logoutModal')"> <i class="fa fa-times" aria-hidden="true"></i> Close</button>
|
|
15
|
+
<button ng-hide="busy" id="loginBtn" ng-click="logout()" class="btn bg-red white"> <i class="fa fa-sign-out" aria-hidden="true"></i> ##word.security_logout## </button>
|
|
17
16
|
</div>
|
|
18
|
-
|
|
17
|
+
</div>
|
|
18
|
+
<!-- /.modal-content -->
|
|
19
19
|
</div>
|
|
20
20
|
<!-- /.modal -->
|
|
21
21
|
<script x-import="security/logout.js"></script>
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
<div data-ng-controller="register" id="registerModal" class="modal fade small" tabindex="-1" role="dialog" fixed>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<div class="modal-body">
|
|
9
|
-
<h1 ng-show="busy" class="center"><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i><span class="sr-only">Loading...</span></h1>
|
|
2
|
+
<div class="modal-content">
|
|
3
|
+
<div class="modal-header">
|
|
4
|
+
<span class="close">×</span>
|
|
5
|
+
<p class="text-center"><i class="fa fa-sign-in"></i> ##word.security_register##</p>
|
|
6
|
+
</div>
|
|
10
7
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<label>##word.security_user_email##</label>
|
|
14
|
-
<input ng-model="userEmail" type="text" />
|
|
15
|
-
</div>
|
|
16
|
-
<div class="control">
|
|
17
|
-
<label>##word.security_user_password##</label>
|
|
18
|
-
<input ng-model="userPassword" type="password" />
|
|
19
|
-
</div>
|
|
20
|
-
</form>
|
|
8
|
+
<div class="modal-body">
|
|
9
|
+
<p ng-show="busy" class="center"><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i><span class="sr-only">Loading...</span></p>
|
|
21
10
|
|
|
22
|
-
|
|
11
|
+
<form ng-hide="busy">
|
|
12
|
+
<div class="control">
|
|
13
|
+
<label>##word.security_user_email##</label>
|
|
14
|
+
<input ng-model="userEmail" type="text" />
|
|
23
15
|
</div>
|
|
24
|
-
<div class="
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
<div class="control">
|
|
17
|
+
<label>##word.security_user_password##</label>
|
|
18
|
+
<input ng-model="userPassword" type="password" />
|
|
27
19
|
</div>
|
|
20
|
+
</form>
|
|
21
|
+
|
|
22
|
+
<p class="yellow">{{error}}</p>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="modal-footer center">
|
|
25
|
+
<button class="btn" onclick="site.hideModal('#registerModal')"> <i class="fa fa-times" aria-hidden="true"></i> ##word.close## </button>
|
|
26
|
+
<button ng-hide="busy" id="registerBtn" ng-click="register()" class="btn"> <i class="fa fa-sign-in" aria-hidden="true"></i> ##word.security_register## </button>
|
|
28
27
|
</div>
|
|
29
|
-
|
|
28
|
+
</div>
|
|
29
|
+
<!-- /.modal-content -->
|
|
30
30
|
</div>
|
|
31
31
|
<!-- /.modal -->
|
|
32
32
|
<script x-import="security/register.js"></script>
|
|
@@ -1,42 +1,28 @@
|
|
|
1
1
|
<style>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
#updateUserModal .img {
|
|
3
|
+
width: 200px;
|
|
4
|
+
height: 200px;
|
|
5
|
+
margin: 5px;
|
|
6
|
+
padding: 5px;
|
|
7
|
+
border: 1px solid var(--background-color);
|
|
8
|
+
}
|
|
9
9
|
</style>
|
|
10
10
|
|
|
11
|
-
|
|
12
11
|
<div id="updateUserModal" class="modal">
|
|
13
|
-
|
|
14
|
-
<div class="modal-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<h2>
|
|
18
|
-
<i class="fa fa-plus"></i> ##word.security_user_details## </h2>
|
|
19
|
-
</div>
|
|
20
|
-
<div class="modal-body">
|
|
21
|
-
<span ng-show="busy">
|
|
22
|
-
<i class="fa fa-spinner white fa-pulse fa-3x fa-fw"></i><span class="sr-only">Loading...</span>
|
|
23
|
-
</span>
|
|
24
|
-
|
|
25
|
-
<div x-import="security/content.html"></div>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</div>
|
|
29
|
-
<h2>{{error}}</h2>
|
|
30
|
-
<div class="modal-footer center">
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<i-button type="save" label="##word.save##" ng-click="update(user)"></i-button>
|
|
34
|
-
<i-button type="close" label="##word.close##" onclick="site.hideModal('#updateUserModal')"></i-button>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</div>
|
|
12
|
+
<div class="modal-content">
|
|
13
|
+
<div class="modal-header">
|
|
14
|
+
<span class="close">×</span>
|
|
15
|
+
<p><i class="fa fa-plus"></i> ##word.security_user_details##</p>
|
|
39
16
|
</div>
|
|
17
|
+
<div class="modal-body">
|
|
18
|
+
<span ng-show="busy"> <i class="fa fa-spinner white fa-pulse fa-3x fa-fw"></i><span class="sr-only">Loading...</span> </span>
|
|
40
19
|
|
|
41
|
-
|
|
42
|
-
</div>
|
|
20
|
+
<div x-import="security/content.html"></div>
|
|
21
|
+
</div>
|
|
22
|
+
<p>{{error}}</p>
|
|
23
|
+
<div class="modal-footer center">
|
|
24
|
+
<i-button type="save" label="##word.save##" ng-click="update(user)"></i-button>
|
|
25
|
+
<i-button type="close" label="##word.close##" onclick="site.hideModal('#updateUserModal')"></i-button>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
@@ -1,43 +1,32 @@
|
|
|
1
1
|
<style>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
.img {
|
|
3
|
+
width: 200px;
|
|
4
|
+
height: 200px;
|
|
5
|
+
margin: 5px;
|
|
6
|
+
padding: 5px;
|
|
7
|
+
border: 1px solid var(--background-color);
|
|
8
|
+
}
|
|
11
9
|
</style>
|
|
12
10
|
|
|
13
|
-
|
|
14
11
|
<div id="viewUserModal" class="modal">
|
|
15
|
-
|
|
16
|
-
<div class="modal-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<h2>
|
|
20
|
-
<i class="fa fa-file"></i> ##word.security_user_details## </h2>
|
|
21
|
-
</div>
|
|
22
|
-
<div class="modal-body">
|
|
23
|
-
<span ng-show="busy">
|
|
24
|
-
<i class="fa fa-spinner white fa-pulse fa-3x fa-fw"></i>
|
|
25
|
-
<span class="sr-only">Loading...</span>
|
|
26
|
-
</span>
|
|
27
|
-
|
|
28
|
-
<div x-import="security/view.html"></div>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</div>
|
|
32
|
-
<h2>{{error}}</h2>
|
|
33
|
-
<div class="modal-footer center">
|
|
34
|
-
|
|
35
|
-
<i-button type="edit" ng-click="edit(user)" label="##word.edit##"></i-button>
|
|
36
|
-
<i-button type="remove" ng-click="remove(user)" label="##word.delete##"></i-button>
|
|
37
|
-
<i-button type="exit" onclick="site.hideModal('#viewUserModal')" label="##word.close##"></i-button>
|
|
38
|
-
|
|
39
|
-
</div>
|
|
12
|
+
<div class="modal-content">
|
|
13
|
+
<div class="modal-header">
|
|
14
|
+
<span class="close">×</span>
|
|
15
|
+
<p><i class="fa fa-file"></i> ##word.security_user_details##</p>
|
|
40
16
|
</div>
|
|
17
|
+
<div class="modal-body">
|
|
18
|
+
<span ng-show="busy">
|
|
19
|
+
<i class="fa fa-spinner white fa-pulse fa-3x fa-fw"></i>
|
|
20
|
+
<span class="sr-only">Loading...</span>
|
|
21
|
+
</span>
|
|
41
22
|
|
|
42
|
-
|
|
43
|
-
</div>
|
|
23
|
+
<div x-import="security/view.html"></div>
|
|
24
|
+
</div>
|
|
25
|
+
<p>{{error}}</p>
|
|
26
|
+
<div class="modal-footer center">
|
|
27
|
+
<i-button type="edit" ng-click="edit(user)" label="##word.edit##"></i-button>
|
|
28
|
+
<i-button type="remove" ng-click="remove(user)" label="##word.delete##"></i-button>
|
|
29
|
+
<i-button type="exit" onclick="site.hideModal('#viewUserModal')" label="##word.close##"></i-button>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
package/index.js
CHANGED
|
@@ -27,7 +27,6 @@ module.exports = function init(options) {
|
|
|
27
27
|
____0.cwd = process.cwd();
|
|
28
28
|
____0.setting = {};
|
|
29
29
|
|
|
30
|
-
|
|
31
30
|
____0.require = function (file_path) {
|
|
32
31
|
return require(file_path)(____0);
|
|
33
32
|
};
|
|
@@ -172,7 +171,7 @@ module.exports = function init(options) {
|
|
|
172
171
|
};
|
|
173
172
|
} else {
|
|
174
173
|
____0.connectCollection = function (option, db) {
|
|
175
|
-
return
|
|
174
|
+
return require('./lib/collectionFile')(____0, option, db);
|
|
176
175
|
};
|
|
177
176
|
}
|
|
178
177
|
|
package/lib/collection.js
CHANGED
|
@@ -124,8 +124,6 @@ module.exports = function init(____0, option, db) {
|
|
|
124
124
|
});
|
|
125
125
|
$collection.run();
|
|
126
126
|
} else {
|
|
127
|
-
let $req = options.$req;
|
|
128
|
-
let $res = options.$res;
|
|
129
127
|
let option = {};
|
|
130
128
|
if (options._id) {
|
|
131
129
|
option.set = { ...options };
|
|
@@ -179,8 +177,6 @@ module.exports = function init(____0, option, db) {
|
|
|
179
177
|
dbName: $collection.db,
|
|
180
178
|
where: option.where,
|
|
181
179
|
set: option.set || {},
|
|
182
|
-
$req: $req,
|
|
183
|
-
$res: $res,
|
|
184
180
|
},
|
|
185
181
|
function (err, result, result2) {
|
|
186
182
|
callback(err, result, result2);
|
|
@@ -233,6 +229,10 @@ module.exports = function init(____0, option, db) {
|
|
|
233
229
|
if (options.where && options.where.id) {
|
|
234
230
|
options.where.id = ____0.toInt(options.where.id);
|
|
235
231
|
}
|
|
232
|
+
|
|
233
|
+
delete options.where.$req;
|
|
234
|
+
delete options.where.$res;
|
|
235
|
+
|
|
236
236
|
____0.mongodb.deleteOne(
|
|
237
237
|
{
|
|
238
238
|
collectionName: $collection.collection,
|
package/lib/collectionFile.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
module.exports = function init(____0,
|
|
2
|
-
|
|
1
|
+
module.exports = function init(____0, options, db) {
|
|
2
|
+
return {
|
|
3
|
+
options : options,
|
|
4
|
+
db : db,
|
|
3
5
|
busy: !0,
|
|
4
6
|
deleteDuplicate: function () {},
|
|
5
7
|
createUnique: function () {},
|
|
6
8
|
findOne: function () {},
|
|
7
9
|
findAll: function () {},
|
|
10
|
+
findMany: function () {},
|
|
8
11
|
get: function () {},
|
|
9
12
|
getAll: function () {},
|
|
10
13
|
find: function () {},
|