Files
portal-api/public/js/service/service.min.js
T
2025-08-03 23:06:08 +07:00

1 line
21 KiB
JavaScript

function _0x22f5(_0x363a14,_0x44f9aa){const _0x9e522b=_0x9e52();return _0x22f5=function(_0x22f551,_0x1c0df4){_0x22f551=_0x22f551-0x1f3;let _0x319e7c=_0x9e522b[_0x22f551];return _0x319e7c;},_0x22f5(_0x363a14,_0x44f9aa);}const _0x1ab566=_0x22f5;(function(_0x189bbb,_0x3d8def){const _0x542617=_0x22f5,_0x387176=_0x189bbb();while(!![]){try{const _0x3fef99=parseInt(_0x542617(0x276))/0x1+-parseInt(_0x542617(0x246))/0x2+-parseInt(_0x542617(0x23f))/0x3*(parseInt(_0x542617(0x225))/0x4)+parseInt(_0x542617(0x21e))/0x5*(parseInt(_0x542617(0x219))/0x6)+-parseInt(_0x542617(0x259))/0x7*(parseInt(_0x542617(0x268))/0x8)+parseInt(_0x542617(0x21d))/0x9+parseInt(_0x542617(0x224))/0xa;if(_0x3fef99===_0x3d8def)break;else _0x387176['push'](_0x387176['shift']());}catch(_0x2786d1){_0x387176['push'](_0x387176['shift']());}}}(_0x9e52,0x7f70f));let invoiceId,invoiceOrdernum,vmId,vmHostname,csrfToken;function initializeVariables(){const _0x59de46=_0x22f5,_0x5a3809=document[_0x59de46(0x234)](_0x59de46(0x273)),_0x38dcb7=document['querySelector'](_0x59de46(0x21f)),_0x4cada3=document[_0x59de46(0x234)]('meta[name=\x22vm-id\x22]'),_0x3ed6f9=document[_0x59de46(0x234)]('meta[name=\x22vm-hostname\x22]'),_0x5dcf24=document[_0x59de46(0x234)]('meta[name=\x22csrf-token\x22]');invoiceId=_0x5a3809?_0x5a3809[_0x59de46(0x26d)](_0x59de46(0x23c)):window[_0x59de46(0x205)],invoiceOrdernum=_0x38dcb7?_0x38dcb7[_0x59de46(0x26d)]('content'):window['invoiceOrdernum'],vmId=_0x4cada3?_0x4cada3[_0x59de46(0x26d)]('content'):window[_0x59de46(0x227)],vmHostname=_0x3ed6f9?_0x3ed6f9[_0x59de46(0x26d)](_0x59de46(0x23c)):window['vmHostname'],csrfToken=_0x5dcf24?_0x5dcf24[_0x59de46(0x26d)](_0x59de46(0x23c)):window[_0x59de46(0x22c)];}typeof FuiToast!==_0x1ab566(0x1f8)&&FuiToast[_0x1ab566(0x221)]&&FuiToast['config']({'position':'top-center'});function showNotification(_0x3aba8a,_0x303af9=_0x1ab566(0x1fe)){const _0x582f73=_0x1ab566;_0x303af9==='success'?FuiToast['success'](_0x3aba8a):FuiToast[_0x582f73(0x226)](_0x3aba8a);}async function createSnapshot(){const _0xf16c5a=_0x1ab566,_0x5ca8fe=document[_0xf16c5a(0x266)]('createSnapshotButton');if(_0x5ca8fe&&_0x5ca8fe['disabled'])return;const _0x17219e={'product_id':vmId},_0x5933d0={'Content-Type':_0xf16c5a(0x272),'Accept':'application/json','X-CSRF-TOKEN':csrfToken},_0x92c1df=fetch(_0xf16c5a(0x270),{'method':_0xf16c5a(0x254),'headers':_0x5933d0,'body':JSON[_0xf16c5a(0x255)](_0x17219e),'credentials':'same-origin'})[_0xf16c5a(0x220)](async _0x5b6d1c=>{const _0x111569=_0xf16c5a;if(_0x5b6d1c[_0x111569(0x214)]||_0x5b6d1c[_0x111569(0x23d)]===0x191)throw new Error(_0x111569(0x1fd));if(_0x5b6d1c[_0x111569(0x214)])return _0x111569(0x24a);let _0x2fa501;try{const _0x526179=await _0x5b6d1c['text']();try{_0x2fa501=JSON[_0x111569(0x20f)](_0x526179);}catch(_0x5e900b){if(_0x526179[_0x111569(0x1f6)](_0x111569(0x1fe))||_0x5b6d1c['ok'])return setTimeout(()=>{const _0x1cf7aa=_0x111569;location[_0x1cf7aa(0x1fb)]();},0x7d0),_0x111569(0x24a);else throw new Error(_0x111569(0x243));}}catch(_0x274de1){throw new Error('Lỗi\x20định\x20dạng\x20dữ\x20liệu\x20từ\x20máy\x20chủ');}if(_0x2fa501&&!_0x2fa501['error'])return setTimeout(()=>{const _0x218d1f=_0x111569;location[_0x218d1f(0x1fb)]();},0x7d0),_0x2fa501[_0x111569(0x203)]||'Đã\x20gửi\x20yêu\x20cầu\x20tạo\x20snapshot.\x20Quá\x20trình\x20sẽ\x20mất\x203-5\x20phút,\x20vui\x20lòng\x20chờ\x20đợi.';else{let _0x180f99=_0x111569(0x213);if(_0x2fa501&&_0x2fa501[_0x111569(0x203)]){if(typeof _0x2fa501[_0x111569(0x203)]===_0x111569(0x265)){if(_0x2fa501[_0x111569(0x203)]['messages']&&_0x2fa501[_0x111569(0x203)][_0x111569(0x237)]['length']>0x0)_0x180f99=_0x2fa501['message'][_0x111569(0x237)][0x0][_0x111569(0x26e)]||_0x2fa501[_0x111569(0x203)][_0x111569(0x237)][0x0][_0x111569(0x203)]||_0x111569(0x1fa);else _0x2fa501[_0x111569(0x203)][_0x111569(0x248)]?_0x180f99=_0x111569(0x20e)+_0x2fa501[_0x111569(0x203)][_0x111569(0x248)]:_0x180f99='Có\x20lỗi\x20xảy\x20ra\x20từ\x20hệ\x20thống';}else _0x180f99=_0x2fa501[_0x111569(0x203)];}else{if(_0x2fa501&&_0x2fa501[_0x111569(0x22f)]&&_0x2fa501[_0x111569(0x22f)][_0x111569(0x237)]&&_0x2fa501[_0x111569(0x22f)]['messages']['length']>0x0)_0x180f99=_0x2fa501[_0x111569(0x22f)]['messages'][0x0][_0x111569(0x26e)];else{if(typeof _0x2fa501===_0x111569(0x262))_0x180f99=_0x2fa501;else{if(_0x2fa501&&_0x2fa501[_0x111569(0x226)]){if(typeof _0x2fa501[_0x111569(0x226)]===_0x111569(0x265)){if(_0x2fa501[_0x111569(0x226)][_0x111569(0x203)])_0x180f99=_0x2fa501[_0x111569(0x226)][_0x111569(0x203)];else _0x2fa501[_0x111569(0x226)][_0x111569(0x204)]&&_0x2fa501[_0x111569(0x226)][_0x111569(0x204)]()!==_0x111569(0x208)?_0x180f99=_0x2fa501['error'][_0x111569(0x204)]():_0x180f99=_0x111569(0x230);}else _0x180f99=_0x2fa501[_0x111569(0x226)];}}}}throw new Error(_0x180f99);}});FuiToast['promise'](_0x92c1df,{'loading':_0xf16c5a(0x206),'success':_0x32afe6=>{return _0x32afe6;},'error':_0x118b80=>{const _0x2eb50a=_0xf16c5a;return console[_0x2eb50a(0x226)](_0x118b80),_0x118b80[_0x2eb50a(0x203)]||_0x2eb50a(0x213);}},{'isClose':!![]});}function handleSnapshotSubmit(_0x30768b){const _0x47a6db=_0x1ab566;_0x30768b[_0x47a6db(0x1f5)]();const _0x3e8336=new Promise((_0x2dfadd,_0x47fb46)=>{const _0x28f22c=_0x47a6db,_0x2e902b=document['getElementById'](_0x28f22c(0x232)),_0x79a03a=new FormData(_0x2e902b);fetch(_0x2e902b[_0x28f22c(0x23a)],{'method':_0x28f22c(0x254),'body':_0x79a03a,'headers':{'X-CSRF-TOKEN':csrfToken}})[_0x28f22c(0x220)](_0x13dc1d=>{const _0x5aff70=_0x28f22c;if(_0x13dc1d[_0x5aff70(0x214)])_0x2dfadd(_0x5aff70(0x1f7)),window[_0x5aff70(0x26c)][_0x5aff70(0x21c)]=_0x13dc1d[_0x5aff70(0x233)];else _0x13dc1d['ok']?(_0x2dfadd(_0x5aff70(0x1f7)),setTimeout(()=>{window['location']['reload']();},0x7d0)):_0x13dc1d[_0x5aff70(0x258)]()[_0x5aff70(0x220)](_0xe929da=>{const _0x24b353=_0x5aff70;_0x47fb46(_0x24b353(0x243));});})[_0x28f22c(0x24b)](_0x40d13e=>{_0x47fb46('Lỗi\x20kết\x20nối:\x20'+_0x40d13e['message']);});});typeof FuiToast!==_0x47a6db(0x1f8)&&FuiToast[_0x47a6db(0x22a)]?FuiToast[_0x47a6db(0x22a)](_0x3e8336,{'loading':_0x47a6db(0x25e),'success':_0x50e0c4=>{return _0x50e0c4||'Đã\x20gửi\x20yêu\x20cầu\x20tạo\x20snapshot!';},'error':_0x3038b1=>{const _0x4303f4=_0x47a6db;return _0x3038b1||_0x4303f4(0x243);}}):(typeof FuiToast!==_0x47a6db(0x1f8)?FuiToast[_0x47a6db(0x201)]('Đang\x20gửi\x20yêu\x20cầu\x20tạo\x20snapshot...',{'duration':0x0}):alert(_0x47a6db(0x25e)),setTimeout(()=>{const _0x407d59=_0x47a6db;document[_0x407d59(0x266)]('snapshotForm')[_0x407d59(0x24e)]();},0x1f4));}async function startVirtualMachine(){const _0x15a2af=_0x1ab566,_0x26b3e1=document[_0x15a2af(0x266)](_0x15a2af(0x277));if(_0x26b3e1&&_0x26b3e1[_0x15a2af(0x235)])return;const _0x6bf81e={'vm_id':vmId},_0x5c981e={'Content-Type':_0x15a2af(0x272),'Accept':_0x15a2af(0x272),'X-CSRF-TOKEN':csrfToken},_0x24be41=fetch(_0x15a2af(0x202),{'method':'POST','headers':_0x5c981e,'body':JSON[_0x15a2af(0x255)](_0x6bf81e),'credentials':_0x15a2af(0x1ff)})['then'](async _0x508e4d=>{const _0x1b9b81=_0x15a2af;if(_0x508e4d[_0x1b9b81(0x214)]||_0x508e4d['status']===0x191)throw new Error(_0x1b9b81(0x1fd));let _0x2a95f0;try{_0x2a95f0=await _0x508e4d[_0x1b9b81(0x247)]();}catch(_0x54fb1a){throw new Error('Lỗi\x20định\x20dạng\x20dữ\x20liệu\x20từ\x20máy\x20chủ');}if(!_0x2a95f0['error'])return setTimeout(()=>{const _0x2ab38b=_0x1b9b81;location[_0x2ab38b(0x1fb)]();},0x7d0),_0x2a95f0[_0x1b9b81(0x203)];else{if(_0x2a95f0[_0x1b9b81(0x239)]===_0x1b9b81(0x256)||_0x2a95f0[_0x1b9b81(0x203)]&&_0x2a95f0[_0x1b9b81(0x203)][_0x1b9b81(0x248)]===_0x1b9b81(0x241))return setTimeout(()=>{location['reload']();},0x7d0),_0x1b9b81(0x223);else{let _0x11f3eb='Có\x20lỗi\x20xảy\x20ra';if(_0x2a95f0[_0x1b9b81(0x203)]){if(typeof _0x2a95f0[_0x1b9b81(0x203)]===_0x1b9b81(0x265)){if(_0x2a95f0[_0x1b9b81(0x203)][_0x1b9b81(0x237)]&&_0x2a95f0['message']['messages'][_0x1b9b81(0x26b)]>0x0)_0x11f3eb=_0x2a95f0[_0x1b9b81(0x203)][_0x1b9b81(0x237)][0x0][_0x1b9b81(0x26e)]||_0x2a95f0['message'][_0x1b9b81(0x237)][0x0][_0x1b9b81(0x203)]||_0x1b9b81(0x1fa);else _0x2a95f0['message'][_0x1b9b81(0x248)]?_0x11f3eb=_0x1b9b81(0x20e)+_0x2a95f0[_0x1b9b81(0x203)]['error_type']:_0x11f3eb=_0x1b9b81(0x230);}else _0x11f3eb=_0x2a95f0[_0x1b9b81(0x203)];}else{if(_0x2a95f0[_0x1b9b81(0x22f)]&&_0x2a95f0[_0x1b9b81(0x22f)]['messages']&&_0x2a95f0[_0x1b9b81(0x22f)][_0x1b9b81(0x237)]['length']>0x0)_0x11f3eb=_0x2a95f0[_0x1b9b81(0x22f)]['messages'][0x0][_0x1b9b81(0x26e)];else{if(typeof _0x2a95f0===_0x1b9b81(0x262))_0x11f3eb=_0x2a95f0;else{if(_0x2a95f0[_0x1b9b81(0x226)]){if(typeof _0x2a95f0[_0x1b9b81(0x226)]===_0x1b9b81(0x265)){if(_0x2a95f0[_0x1b9b81(0x226)][_0x1b9b81(0x203)])_0x11f3eb=_0x2a95f0['error'][_0x1b9b81(0x203)];else _0x2a95f0['error'][_0x1b9b81(0x204)]&&_0x2a95f0[_0x1b9b81(0x226)][_0x1b9b81(0x204)]()!=='[object\x20Object]'?_0x11f3eb=_0x2a95f0[_0x1b9b81(0x226)][_0x1b9b81(0x204)]():_0x11f3eb=_0x1b9b81(0x230);}else _0x11f3eb=_0x2a95f0[_0x1b9b81(0x226)];}}}}throw new Error(_0x11f3eb);}}});FuiToast[_0x15a2af(0x22a)](_0x24be41,{'loading':_0x15a2af(0x22d),'success':_0x4c71fb=>{return _0x4c71fb;},'error':_0x147ac0=>{const _0x348831=_0x15a2af;return console[_0x348831(0x226)](_0x147ac0),_0x147ac0[_0x348831(0x203)]||_0x348831(0x244);}},{'isClose':!![]});}async function stopVirtualMachine(){const _0xc5eb8=_0x1ab566,_0x175d28=document[_0xc5eb8(0x266)](_0xc5eb8(0x229));if(_0x175d28&&_0x175d28[_0xc5eb8(0x235)])return;const _0x1b9ce9={'vm_id':vmId},_0x32027d={'Content-Type':_0xc5eb8(0x272),'Accept':'application/json','X-CSRF-TOKEN':csrfToken},_0x1d443c=fetch('/api/secure/stop-vm',{'method':'POST','headers':_0x32027d,'body':JSON['stringify'](_0x1b9ce9),'credentials':_0xc5eb8(0x1ff)})['then'](async _0x1a1879=>{const _0x5e990d=_0xc5eb8;if(_0x1a1879['redirected']||_0x1a1879['status']===0x191)throw new Error(_0x5e990d(0x1fd));let _0x8eda20;try{_0x8eda20=await _0x1a1879[_0x5e990d(0x247)]();}catch(_0x5710ab){throw new Error('Lỗi\x20định\x20dạng\x20dữ\x20liệu\x20từ\x20máy\x20chủ');}if(!_0x8eda20['error'])return setTimeout(()=>{const _0x5f4065=_0x5e990d;location[_0x5f4065(0x1fb)]();},0x7d0),_0x8eda20[_0x5e990d(0x203)];else{if(_0x8eda20[_0x5e990d(0x239)]===_0x5e990d(0x256)||_0x8eda20[_0x5e990d(0x203)]&&_0x8eda20[_0x5e990d(0x203)][_0x5e990d(0x248)]===_0x5e990d(0x241))return setTimeout(()=>{const _0x4b3a97=_0x5e990d;location[_0x4b3a97(0x1fb)]();},0x7d0),_0x5e990d(0x200);else{let _0x4feb0b=_0x5e990d(0x1fa);if(_0x8eda20['message']){if(typeof _0x8eda20[_0x5e990d(0x203)]==='object'){if(_0x8eda20['message']['messages']&&_0x8eda20[_0x5e990d(0x203)][_0x5e990d(0x237)][_0x5e990d(0x26b)]>0x0)_0x4feb0b=_0x8eda20[_0x5e990d(0x203)]['messages'][0x0][_0x5e990d(0x26e)]||_0x8eda20['message'][_0x5e990d(0x237)][0x0]['message']||'Có\x20lỗi\x20xảy\x20ra';else _0x8eda20[_0x5e990d(0x203)]['error_type']?_0x4feb0b=_0x5e990d(0x20e)+_0x8eda20['message'][_0x5e990d(0x248)]:_0x4feb0b=_0x5e990d(0x230);}else _0x4feb0b=_0x8eda20[_0x5e990d(0x203)];}else{if(_0x8eda20[_0x5e990d(0x22f)]&&_0x8eda20[_0x5e990d(0x22f)][_0x5e990d(0x237)]&&_0x8eda20[_0x5e990d(0x22f)][_0x5e990d(0x237)][_0x5e990d(0x26b)]>0x0)_0x4feb0b=_0x8eda20['value']['messages'][0x0][_0x5e990d(0x26e)];else{if(typeof _0x8eda20===_0x5e990d(0x262))_0x4feb0b=_0x8eda20;else{if(_0x8eda20['error']){if(typeof _0x8eda20[_0x5e990d(0x226)]===_0x5e990d(0x265)){if(_0x8eda20['error'][_0x5e990d(0x203)])_0x4feb0b=_0x8eda20[_0x5e990d(0x226)]['message'];else _0x8eda20[_0x5e990d(0x226)]['toString']&&_0x8eda20[_0x5e990d(0x226)][_0x5e990d(0x204)]()!==_0x5e990d(0x208)?_0x4feb0b=_0x8eda20[_0x5e990d(0x226)][_0x5e990d(0x204)]():_0x4feb0b='Có\x20lỗi\x20xảy\x20ra\x20từ\x20hệ\x20thống';}else _0x4feb0b=_0x8eda20[_0x5e990d(0x226)];}}}}throw new Error(_0x4feb0b);}}});FuiToast[_0xc5eb8(0x22a)](_0x1d443c,{'loading':_0xc5eb8(0x1f4),'success':_0x571865=>{return _0x571865;},'error':_0x437741=>{const _0x4dbe50=_0xc5eb8;return console['error'](_0x437741),_0x437741[_0x4dbe50(0x203)]||_0x4dbe50(0x1f9);}},{'isClose':!![]});}document['addEventListener'](_0x1ab566(0x22e),function(){const _0x28196a=_0x1ab566;initializeVariables();const _0x320472=document[_0x28196a(0x266)](_0x28196a(0x277)),_0x42e5c6=document[_0x28196a(0x266)](_0x28196a(0x229)),_0x2616e1=document[_0x28196a(0x266)](_0x28196a(0x23e)),_0x43e16c=document['getElementById'](_0x28196a(0x238));_0x320472&&_0x320472[_0x28196a(0x217)](_0x28196a(0x260),function(_0x5a2129){const _0x18ddbf=_0x28196a;_0x5a2129[_0x18ddbf(0x1f5)](),_0x5a2129[_0x18ddbf(0x252)](),startVirtualMachine();}),_0x42e5c6&&_0x42e5c6[_0x28196a(0x217)](_0x28196a(0x260),function(_0xa2afa2){const _0x7fe865=_0x28196a;_0xa2afa2[_0x7fe865(0x1f5)](),_0xa2afa2[_0x7fe865(0x252)](),stopVirtualMachine();}),_0x2616e1&&_0x2616e1[_0x28196a(0x217)](_0x28196a(0x260),function(_0x4817f4){_0x4817f4['preventDefault'](),_0x4817f4['stopPropagation'](),restartVirtualMachine();}),_0x43e16c&&_0x43e16c[_0x28196a(0x217)]('click',function(_0x29a8e1){const _0x5701e7=_0x28196a;_0x29a8e1[_0x5701e7(0x1f5)](),_0x29a8e1[_0x5701e7(0x252)](),createSnapshot();});});function _0x9e52(){const _0x5aeaee=['Bạn\x20có\x20chắc\x20chắn\x20muốn\x20khôi\x20phục\x20về\x20snapshot\x20\x22','stopVMButton','promise','data','csrfToken','Đang\x20khởi\x20động\x20máy\x20ảo...','DOMContentLoaded','value','Có\x20lỗi\x20xảy\x20ra\x20từ\x20hệ\x20thống','Error\x20','snapshotForm','url','querySelector','disabled','CONNECTION_ERROR','messages','createSnapshotButton','type','action','Hủy\x20bỏ','content','status','restartVMButton','268659xDSLwZ','_cacheTimeout','ALREADY_IN_DESIRED_STATE','REMOVE_SNAPSHOT','Có\x20lỗi\x20xảy\x20ra\x20khi\x20gửi\x20yêu\x20cầu\x20tạo\x20snapshot','Có\x20lỗi\x20xảy\x20ra\x20khi\x20khởi\x20động\x20máy\x20ảo','#d33','1929628FwhzqP','json','error_type','DELETE_SUCCESS','Đã\x20gửi\x20yêu\x20cầu\x20tạo\x20snapshot.\x20Quá\x20trình\x20sẽ\x20mất\x203-5\x20phút,\x20vui\x20lòng\x20chờ\x20đợi.','catch','GENERIC_ERROR','Không\x20thể\x20kết\x20nối\x20đến\x20máy\x20chủ','submit','?product_id=','pow','GET_SNAPSHOTS','stopPropagation','HTTP\x20error!\x20status:\x20','POST','stringify','com.vmware.vapi.std.errors.already_in_desired_state','snapshotTable','text','7rBFQad','xóa','/dich-vu-dang-ky/secure/revert-snapshot','_lastFetchTime','deleting\x20snapshot','Đang\x20gửi\x20yêu\x20cầu\x20tạo\x20snapshot...','_processSnapshotsResponse','click','reverting\x20snapshot','string','\x20khi\x20','floor','object','getElementById','VM_ID_NOT_FOUND','5320088dSoOkP','Xác\x20nhận\x20xóa','/dich-vu-dang-ky/secure/remove-snapshot','length','location','getAttribute','default_message','toFixed','/secure/create-snapshots','0\x20B','application/json','meta[name=\x22invoice-id\x22]','Có\x20lỗi\x20xảy\x20ra\x20khi\x20tải\x20danh\x20sách\x20snapshot','now','585887aBMcYL','startVMButton','_setError','/dich-vu-dang-ky/secure/get-snapshots','\x22?\x20Hành\x20động\x20này\x20không\x20thể\x20hoàn\x20tác.','_handleError','Không\x20tìm\x20thấy\x20ID\x20máy\x20ảo','Đang\x20dừng\x20máy\x20ảo...','preventDefault','includes','Đã\x20gửi\x20yêu\x20cầu\x20tạo\x20snapshot!\x20Quá\x20trình\x20sẽ\x20mất\x203-5\x20phút.','undefined','Có\x20lỗi\x20xảy\x20ra\x20khi\x20dừng\x20máy\x20ảo','Có\x20lỗi\x20xảy\x20ra','reload','log','Phiên\x20đăng\x20nhập\x20đã\x20hết\x20hạn,\x20vui\x20lòng\x20đăng\x20nhập\x20lại','success','same-origin','Máy\x20chủ\x20đã\x20được\x20tắt','loading','/api/secure/start-vm','message','toString','invoiceId','Đang\x20gửi\x20yêu\x20cầu\x20tạo\x20snapshot...\x20(Quá\x20trình\x20mất\x203-5\x20phút\x20vui\x20lòng\x20giữ\x20trang\x20không\x20tắt!)','GET','[object\x20Object]','snapshots','_makeRequest','trim','_formatBytes','Bạn\x20có\x20chắc\x20chắn\x20muốn\x20xóa\x20snapshot\x20\x22','Lỗi:\x20','parse','#3085d6','isConfirmed','no-cache','Có\x20lỗi\x20xảy\x20ra\x20khi\x20tạo\x20snapshot','redirected','REVERT_SUCCESS','_executeSnapshotAction','addEventListener','_confirmAction','24EONqqB','fire','Xóa\x20snapshot\x20thành\x20công','href','1830672AuloAA','237485VHuLrq','meta[name=\x22invoice-ordernum\x22]','then','config','fetching','Máy\x20chủ\x20đã\x20được\x20bật','19785180NEAuCA','36gkMAoq','error','vmId'];_0x9e52=function(){return _0x5aeaee;};return _0x9e52();}function snapshotTable(){const _0x2b7a59=_0x1ab566,_0x3561b1={'GET_SNAPSHOTS':_0x2b7a59(0x279),'REMOVE_SNAPSHOT':_0x2b7a59(0x26a),'REVERT_SNAPSHOT':_0x2b7a59(0x25b)},_0x26eec8={'VM_ID_NOT_FOUND':_0x2b7a59(0x1f3),'CONNECTION_ERROR':_0x2b7a59(0x24d),'GENERIC_ERROR':_0x2b7a59(0x1fa),'DELETE_SUCCESS':_0x2b7a59(0x21b),'REVERT_SUCCESS':'Khôi\x20phục\x20snapshot\x20thành\x20công'};return{'loading':![],'snapshots':[],'error':null,'_lastFetchTime':0x0,'_cacheTimeout':0x7530,async 'fetchSnapshots'(_0x2e7cee=![]){const _0x4686ef=_0x2b7a59,_0x320eff=Date[_0x4686ef(0x275)]();if(!_0x2e7cee&&this['snapshots'][_0x4686ef(0x26b)]>0x0&&_0x320eff-this[_0x4686ef(0x25c)]<this[_0x4686ef(0x240)])return;this[_0x4686ef(0x201)]=!![],this[_0x4686ef(0x226)]=null;const _0x8e76c6=window[_0x4686ef(0x227)]?.[_0x4686ef(0x20b)]();if(!_0x8e76c6){this[_0x4686ef(0x278)](_0x26eec8[_0x4686ef(0x267)]);return;}try{const _0x7c8d99=await this[_0x4686ef(0x20a)](_0x3561b1[_0x4686ef(0x251)]+_0x4686ef(0x24f)+encodeURIComponent(_0x8e76c6));this[_0x4686ef(0x25f)](_0x7c8d99),this['_lastFetchTime']=_0x320eff;}catch(_0x4670fd){this[_0x4686ef(0x27b)]('fetching\x20snapshots',_0x4670fd);}finally{this[_0x4686ef(0x201)]=![];}},'formatSize'(_0x5ad0d1,_0x476415){const _0x5ca835=_0x2b7a59,_0x3445c6=this['_convertToBytes'](_0x5ad0d1,_0x476415);if(_0x3445c6===0x0)return _0x5ca835(0x271);return this[_0x5ca835(0x20c)](_0x3445c6);},async 'deleteSnapshot'(_0x3cc47c){const _0x4a9c2f=_0x2b7a59;if(!await this[_0x4a9c2f(0x218)](_0x4a9c2f(0x269),_0x4a9c2f(0x20d)+_0x3cc47c+_0x4a9c2f(0x27a),'Xóa'))return;await this[_0x4a9c2f(0x216)](_0x3561b1[_0x4a9c2f(0x242)],_0x3cc47c,_0x26eec8[_0x4a9c2f(0x249)],_0x4a9c2f(0x25d));},async 'revertSnapshot'(_0x2459c2){const _0x565fa5=_0x2b7a59;if(!await this[_0x565fa5(0x218)]('Xác\x20nhận\x20khôi\x20phục',_0x565fa5(0x228)+_0x2459c2+'\x22?\x20Tất\x20cả\x20dữ\x20liệu\x20hiện\x20tại\x20sẽ\x20bị\x20mất.','Khôi\x20phục'))return;await this['_executeSnapshotAction'](_0x3561b1['REVERT_SNAPSHOT'],_0x2459c2,_0x26eec8[_0x565fa5(0x215)],_0x565fa5(0x261),0x7d0);},'refreshSnapshots'(){return this['fetchSnapshots'](!![]);},'getSnapshotCount'(){const _0x2f81a6=_0x2b7a59;return this[_0x2f81a6(0x209)][_0x2f81a6(0x26b)];},'isLoading'(){const _0x439ab8=_0x2b7a59;return this[_0x439ab8(0x201)];},'hasError'(){const _0x29f4f9=_0x2b7a59;return this[_0x29f4f9(0x226)]!==null;},'_setError'(_0x50fb91){const _0x3a59d5=_0x2b7a59;this['loading']=![],this[_0x3a59d5(0x226)]=_0x50fb91,this[_0x3a59d5(0x209)]=[];},async '_makeRequest'(_0x567e03,_0x13fb7c={}){const _0x7f9828=_0x2b7a59,_0x11b7c6={'method':_0x7f9828(0x207),'headers':{'Accept':_0x7f9828(0x272),'X-CSRF-TOKEN':csrfToken,'Cache-Control':_0x7f9828(0x212)},'credentials':_0x7f9828(0x1ff)},_0x527521=await fetch(_0x567e03,{..._0x11b7c6,..._0x13fb7c});if(!_0x527521['ok'])throw new Error(_0x7f9828(0x253)+_0x527521['status']);return _0x527521['json']();},'_processSnapshotsResponse'(_0x1d006c){const _0x6f5626=_0x2b7a59;if(_0x1d006c[_0x6f5626(0x226)]===![]&&_0x1d006c['data']?.[_0x6f5626(0x209)])this['snapshots']=_0x1d006c[_0x6f5626(0x22b)][_0x6f5626(0x209)];else{if(_0x1d006c[_0x6f5626(0x226)]===!![])throw new Error(_0x1d006c[_0x6f5626(0x203)]||_0x6f5626(0x274));else _0x1d006c[_0x6f5626(0x209)]?this[_0x6f5626(0x209)]=_0x1d006c[_0x6f5626(0x209)]:this[_0x6f5626(0x209)]=[];}},'_convertToBytes'(_0x21b4fd,_0x535ce8){if(_0x21b4fd)return parseFloat(_0x21b4fd)*0x400**0x3;else{if(_0x535ce8)return parseFloat(_0x535ce8)*0x400**0x2;}return 0x0;},'_formatBytes'(_0xc7ec5){const _0x471bbc=_0x2b7a59,_0x46f7cc=['B','KB','MB','GB','TB'],_0x42bd4a=0x400,_0x449949=Math[_0x471bbc(0x264)](Math[_0x471bbc(0x1fc)](_0xc7ec5)/Math[_0x471bbc(0x1fc)](_0x42bd4a)),_0x1b3332=parseFloat((_0xc7ec5/Math[_0x471bbc(0x250)](_0x42bd4a,_0x449949))[_0x471bbc(0x26f)](0x2));return _0x1b3332+'\x20'+_0x46f7cc[_0x449949];},async '_confirmAction'(_0x232e65,_0x238cfd,_0x178236){const _0x11cd24=_0x2b7a59,_0x1ac5f5=await Swal[_0x11cd24(0x21a)]({'title':_0x232e65,'text':_0x238cfd,'icon':'warning','showCancelButton':!![],'confirmButtonColor':_0x232e65['includes'](_0x11cd24(0x25a))?_0x11cd24(0x245):_0x11cd24(0x210),'cancelButtonColor':_0x232e65[_0x11cd24(0x1f6)]('xóa')?_0x11cd24(0x210):_0x11cd24(0x245),'confirmButtonText':_0x178236,'cancelButtonText':_0x11cd24(0x23b),'reverseButtons':!![]});return _0x1ac5f5[_0x11cd24(0x211)];},async '_executeSnapshotAction'(_0x5d6ac0,_0x2c5081,_0x170580,_0x38352a,_0x5911ad=0x3e8){const _0x2280cc=_0x2b7a59;try{const _0x220998=await this[_0x2280cc(0x20a)](_0x5d6ac0,{'method':_0x2280cc(0x254),'headers':{'Content-Type':_0x2280cc(0x272),'Accept':_0x2280cc(0x272),'X-CSRF-TOKEN':csrfToken},'body':JSON['stringify']({'product_id':window[_0x2280cc(0x227)],'snapshot_name':_0x2c5081})});if(_0x220998[_0x2280cc(0x226)]===![])showNotification(_0x220998['message']||_0x170580,_0x2280cc(0x1fe)),setTimeout(()=>this['refreshSnapshots'](),_0x5911ad);else throw new Error(_0x220998[_0x2280cc(0x203)]||_0x26eec8[_0x2280cc(0x24c)]+_0x2280cc(0x263)+_0x38352a);}catch(_0x4403d7){this['_handleError'](_0x38352a,_0x4403d7);}},'_handleError'(_0x375f4e,_0xb91bac){const _0xcbdde8=_0x2b7a59;console[_0xcbdde8(0x226)](_0xcbdde8(0x231)+_0x375f4e+':',_0xb91bac);const _0x1d9bcd=_0xb91bac[_0xcbdde8(0x203)]||_0x26eec8[_0xcbdde8(0x236)];_0x375f4e[_0xcbdde8(0x1f6)](_0xcbdde8(0x222))?this[_0xcbdde8(0x278)](_0x1d9bcd):showNotification(_0x1d9bcd,'error');}};}window[_0x1ab566(0x257)]=snapshotTable;