1 line
21 KiB
JavaScript
1 line
21 KiB
JavaScript
const _0x49f046=_0xce8b;(function(_0x339eb9,_0x48b873){const _0x5e8f73=_0xce8b,_0x3c7b87=_0x339eb9();while(!![]){try{const _0x51ae4d=parseInt(_0x5e8f73(0x1c5))/0x1*(parseInt(_0x5e8f73(0x1ba))/0x2)+parseInt(_0x5e8f73(0x19e))/0x3*(parseInt(_0x5e8f73(0x17f))/0x4)+parseInt(_0x5e8f73(0x19c))/0x5+parseInt(_0x5e8f73(0x175))/0x6*(-parseInt(_0x5e8f73(0x1c2))/0x7)+parseInt(_0x5e8f73(0x18e))/0x8+parseInt(_0x5e8f73(0x184))/0x9*(parseInt(_0x5e8f73(0x1d6))/0xa)+parseInt(_0x5e8f73(0x1ad))/0xb*(-parseInt(_0x5e8f73(0x1de))/0xc);if(_0x51ae4d===_0x48b873)break;else _0x3c7b87['push'](_0x3c7b87['shift']());}catch(_0x3de695){_0x3c7b87['push'](_0x3c7b87['shift']());}}}(_0x240f,0xa3450));let invoiceId,invoiceOrdernum,vmId,vmHostname,csrfToken;function initializeVariables(){const _0x328aeb=_0xce8b,_0xe12f4f=document[_0x328aeb(0x199)](_0x328aeb(0x163)),_0x448a2b=document[_0x328aeb(0x199)](_0x328aeb(0x1aa)),_0x1b4316=document[_0x328aeb(0x199)](_0x328aeb(0x16a)),_0xcdf8e3=document['querySelector'](_0x328aeb(0x1c3)),_0x5a9d7e=document['querySelector'](_0x328aeb(0x1a1));invoiceId=_0xe12f4f?_0xe12f4f[_0x328aeb(0x1e0)](_0x328aeb(0x18f)):window[_0x328aeb(0x187)],invoiceOrdernum=_0x448a2b?_0x448a2b[_0x328aeb(0x1e0)](_0x328aeb(0x18f)):window['invoiceOrdernum'],vmId=_0x1b4316?_0x1b4316['getAttribute'](_0x328aeb(0x18f)):window[_0x328aeb(0x1bf)],vmHostname=_0xcdf8e3?_0xcdf8e3[_0x328aeb(0x1e0)](_0x328aeb(0x18f)):window['vmHostname'],csrfToken=_0x5a9d7e?_0x5a9d7e[_0x328aeb(0x1e0)]('content'):window[_0x328aeb(0x17d)];}typeof FuiToast!==_0x49f046(0x1a2)&&FuiToast['config']&&FuiToast['config']({'position':_0x49f046(0x185)});function showNotification(_0x3ff29b,_0x4b46f8='success'){const _0x96d936=_0x49f046;_0x4b46f8===_0x96d936(0x180)?FuiToast[_0x96d936(0x180)](_0x3ff29b):FuiToast['error'](_0x3ff29b);}function _0xce8b(_0x32d67d,_0x173342){const _0x240fa9=_0x240f();return _0xce8b=function(_0xce8b2c,_0x3b83cc){_0xce8b2c=_0xce8b2c-0x160;let _0x321aae=_0x240fa9[_0xce8b2c];return _0x321aae;},_0xce8b(_0x32d67d,_0x173342);}async function createSnapshot(){const _0x5c202b=_0x49f046,_0x174ba9=document[_0x5c202b(0x164)]('createSnapshotButton');if(_0x174ba9&&_0x174ba9[_0x5c202b(0x1a4)])return;const _0x1212d3={'product_id':vmId},_0x28bd60={'Content-Type':_0x5c202b(0x18c),'Accept':_0x5c202b(0x18c),'X-CSRF-TOKEN':csrfToken},_0x5a70a0=fetch('/secure/create-snapshots',{'method':_0x5c202b(0x197),'headers':_0x28bd60,'body':JSON[_0x5c202b(0x1df)](_0x1212d3),'credentials':_0x5c202b(0x169)})[_0x5c202b(0x182)](async _0x42c0f3=>{const _0x11e151=_0x5c202b;if(_0x42c0f3[_0x11e151(0x168)]||_0x42c0f3[_0x11e151(0x1d7)]===0x191)throw new Error(_0x11e151(0x1d9));if(_0x42c0f3[_0x11e151(0x168)])return _0x11e151(0x176);let _0x5325b2;try{const _0x252969=await _0x42c0f3[_0x11e151(0x17b)]();try{_0x5325b2=JSON[_0x11e151(0x165)](_0x252969);}catch(_0x169a86){if(_0x252969['includes'](_0x11e151(0x180))||_0x42c0f3['ok'])return setTimeout(()=>{const _0x2f0b1d=_0x11e151;location[_0x2f0b1d(0x1a8)]();},0x7d0),_0x11e151(0x176);else throw new Error(_0x11e151(0x1b0));}}catch(_0x2a9a17){throw new Error(_0x11e151(0x196));}if(_0x5325b2&&!_0x5325b2[_0x11e151(0x1d1)])return setTimeout(()=>{const _0x88d20b=_0x11e151;location[_0x88d20b(0x1a8)]();},0x7d0),_0x5325b2[_0x11e151(0x172)]||_0x11e151(0x176);else{let _0x5b9f1c=_0x11e151(0x194);if(_0x5325b2&&_0x5325b2[_0x11e151(0x172)]){if(typeof _0x5325b2[_0x11e151(0x172)]===_0x11e151(0x1cb)){if(_0x5325b2[_0x11e151(0x172)][_0x11e151(0x181)]&&_0x5325b2['message'][_0x11e151(0x181)][_0x11e151(0x16d)]>0x0)_0x5b9f1c=_0x5325b2[_0x11e151(0x172)]['messages'][0x0][_0x11e151(0x1b9)]||_0x5325b2['message'][_0x11e151(0x181)][0x0][_0x11e151(0x172)]||_0x11e151(0x1c1);else _0x5325b2[_0x11e151(0x172)][_0x11e151(0x161)]?_0x5b9f1c=_0x11e151(0x170)+_0x5325b2[_0x11e151(0x172)][_0x11e151(0x161)]:_0x5b9f1c=_0x11e151(0x1e1);}else _0x5b9f1c=_0x5325b2[_0x11e151(0x172)];}else{if(_0x5325b2&&_0x5325b2[_0x11e151(0x17e)]&&_0x5325b2[_0x11e151(0x17e)][_0x11e151(0x181)]&&_0x5325b2[_0x11e151(0x17e)][_0x11e151(0x181)]['length']>0x0)_0x5b9f1c=_0x5325b2[_0x11e151(0x17e)][_0x11e151(0x181)][0x0]['default_message'];else{if(typeof _0x5325b2===_0x11e151(0x179))_0x5b9f1c=_0x5325b2;else{if(_0x5325b2&&_0x5325b2[_0x11e151(0x1d1)]){if(typeof _0x5325b2[_0x11e151(0x1d1)]===_0x11e151(0x1cb)){if(_0x5325b2['error'][_0x11e151(0x172)])_0x5b9f1c=_0x5325b2[_0x11e151(0x1d1)][_0x11e151(0x172)];else _0x5325b2[_0x11e151(0x1d1)][_0x11e151(0x1a5)]&&_0x5325b2[_0x11e151(0x1d1)][_0x11e151(0x1a5)]()!==_0x11e151(0x1ca)?_0x5b9f1c=_0x5325b2[_0x11e151(0x1d1)][_0x11e151(0x1a5)]():_0x5b9f1c=_0x11e151(0x1e1);}else _0x5b9f1c=_0x5325b2[_0x11e151(0x1d1)];}}}}throw new Error(_0x5b9f1c);}});FuiToast[_0x5c202b(0x1af)](_0x5a70a0,{'loading':_0x5c202b(0x1d8),'success':_0x48cb00=>{return _0x48cb00;},'error':_0x16d347=>{const _0x30937b=_0x5c202b;return console[_0x30937b(0x1d1)](_0x16d347),_0x16d347[_0x30937b(0x172)]||'Có\x20lỗi\x20xảy\x20ra\x20khi\x20tạo\x20snapshot';}},{'isClose':!![]});}function handleSnapshotSubmit(_0x2fa340){const _0x333dbf=_0x49f046;_0x2fa340[_0x333dbf(0x1e4)]();const _0x3c1a17=new Promise((_0x26164c,_0x35976f)=>{const _0x43d95a=_0x333dbf,_0x1a8d87=document['getElementById'](_0x43d95a(0x17c)),_0x12c602=new FormData(_0x1a8d87);fetch(_0x1a8d87['action'],{'method':_0x43d95a(0x197),'body':_0x12c602,'headers':{'X-CSRF-TOKEN':csrfToken}})['then'](_0x4722f5=>{const _0x44921d=_0x43d95a;if(_0x4722f5[_0x44921d(0x168)])_0x26164c(_0x44921d(0x188)),window['location'][_0x44921d(0x189)]=_0x4722f5[_0x44921d(0x19a)];else _0x4722f5['ok']?(_0x26164c(_0x44921d(0x188)),setTimeout(()=>{const _0x4259d3=_0x44921d;window[_0x4259d3(0x1c0)][_0x4259d3(0x1a8)]();},0x7d0)):_0x4722f5['text']()[_0x44921d(0x182)](_0x2b3b0b=>{const _0x567295=_0x44921d;_0x35976f(_0x567295(0x1b0));});})['catch'](_0x2a6192=>{const _0xd1a42d=_0x43d95a;_0x35976f('Lỗi\x20kết\x20nối:\x20'+_0x2a6192[_0xd1a42d(0x172)]);});});typeof FuiToast!==_0x333dbf(0x1a2)&&FuiToast[_0x333dbf(0x1af)]?FuiToast['promise'](_0x3c1a17,{'loading':_0x333dbf(0x19b),'success':_0x3ca083=>{const _0xd831af=_0x333dbf;return _0x3ca083||_0xd831af(0x191);},'error':_0x218137=>{const _0x4a961a=_0x333dbf;return _0x218137||_0x4a961a(0x1b0);}}):(typeof FuiToast!==_0x333dbf(0x1a2)?FuiToast['loading'](_0x333dbf(0x19b),{'duration':0x0}):alert(_0x333dbf(0x19b)),setTimeout(()=>{const _0xe43c98=_0x333dbf;document[_0xe43c98(0x164)](_0xe43c98(0x17c))['submit']();},0x1f4));}async function startVirtualMachine(){const _0x3e4855=_0x49f046,_0x10d754=document['getElementById']('startVMButton');if(_0x10d754&&_0x10d754[_0x3e4855(0x1a4)])return;const _0x378cad={'vm_id':vmId},_0x582b55={'Content-Type':'application/json','Accept':'application/json','X-CSRF-TOKEN':csrfToken},_0x3f3e23=fetch(_0x3e4855(0x17a),{'method':'POST','headers':_0x582b55,'body':JSON['stringify'](_0x378cad),'credentials':_0x3e4855(0x169)})['then'](async _0x2774fb=>{const _0x1e3c4e=_0x3e4855;if(_0x2774fb[_0x1e3c4e(0x168)]||_0x2774fb[_0x1e3c4e(0x1d7)]===0x191)throw new Error(_0x1e3c4e(0x1d9));let _0x346b9f;try{_0x346b9f=await _0x2774fb[_0x1e3c4e(0x1ac)]();}catch(_0x509b5b){throw new Error('Lỗi\x20định\x20dạng\x20dữ\x20liệu\x20từ\x20máy\x20chủ');}if(!_0x346b9f[_0x1e3c4e(0x1d1)])return setTimeout(()=>{const _0xb5f48b=_0x1e3c4e;location[_0xb5f48b(0x1a8)]();},0x7d0),_0x346b9f['message'];else{if(_0x346b9f[_0x1e3c4e(0x190)]===_0x1e3c4e(0x1b6)||_0x346b9f['message']&&_0x346b9f[_0x1e3c4e(0x172)][_0x1e3c4e(0x161)]===_0x1e3c4e(0x1a3))return setTimeout(()=>{const _0x4213cb=_0x1e3c4e;location[_0x4213cb(0x1a8)]();},0x7d0),_0x1e3c4e(0x1b4);else{let _0x19b908='Có\x20lỗi\x20xảy\x20ra';if(_0x346b9f[_0x1e3c4e(0x172)]){if(typeof _0x346b9f[_0x1e3c4e(0x172)]===_0x1e3c4e(0x1cb)){if(_0x346b9f[_0x1e3c4e(0x172)][_0x1e3c4e(0x181)]&&_0x346b9f[_0x1e3c4e(0x172)]['messages']['length']>0x0)_0x19b908=_0x346b9f[_0x1e3c4e(0x172)]['messages'][0x0][_0x1e3c4e(0x1b9)]||_0x346b9f[_0x1e3c4e(0x172)][_0x1e3c4e(0x181)][0x0][_0x1e3c4e(0x172)]||_0x1e3c4e(0x1c1);else _0x346b9f[_0x1e3c4e(0x172)][_0x1e3c4e(0x161)]?_0x19b908='Lỗi:\x20'+_0x346b9f[_0x1e3c4e(0x172)][_0x1e3c4e(0x161)]:_0x19b908=_0x1e3c4e(0x1e1);}else _0x19b908=_0x346b9f[_0x1e3c4e(0x172)];}else{if(_0x346b9f['value']&&_0x346b9f[_0x1e3c4e(0x17e)][_0x1e3c4e(0x181)]&&_0x346b9f['value']['messages'][_0x1e3c4e(0x16d)]>0x0)_0x19b908=_0x346b9f['value'][_0x1e3c4e(0x181)][0x0][_0x1e3c4e(0x1b9)];else{if(typeof _0x346b9f==='string')_0x19b908=_0x346b9f;else{if(_0x346b9f[_0x1e3c4e(0x1d1)]){if(typeof _0x346b9f['error']==='object'){if(_0x346b9f[_0x1e3c4e(0x1d1)][_0x1e3c4e(0x172)])_0x19b908=_0x346b9f[_0x1e3c4e(0x1d1)]['message'];else _0x346b9f[_0x1e3c4e(0x1d1)][_0x1e3c4e(0x1a5)]&&_0x346b9f[_0x1e3c4e(0x1d1)][_0x1e3c4e(0x1a5)]()!=='[object\x20Object]'?_0x19b908=_0x346b9f[_0x1e3c4e(0x1d1)][_0x1e3c4e(0x1a5)]():_0x19b908=_0x1e3c4e(0x1e1);}else _0x19b908=_0x346b9f['error'];}}}}throw new Error(_0x19b908);}}});FuiToast[_0x3e4855(0x1af)](_0x3f3e23,{'loading':_0x3e4855(0x1c8),'success':_0x4ad1b3=>{return _0x4ad1b3;},'error':_0x27c4e9=>{const _0x148a50=_0x3e4855;return console[_0x148a50(0x1d1)](_0x27c4e9),_0x27c4e9[_0x148a50(0x172)]||_0x148a50(0x1b1);}},{'isClose':!![]});}async function stopVirtualMachine(){const _0x428781=_0x49f046,_0x56a11f=document['getElementById'](_0x428781(0x1b8));if(_0x56a11f&&_0x56a11f[_0x428781(0x1a4)])return;const _0x55fe08={'vm_id':vmId},_0x32bb16={'Content-Type':'application/json','Accept':_0x428781(0x18c),'X-CSRF-TOKEN':csrfToken},_0x131a54=fetch(_0x428781(0x1a0),{'method':_0x428781(0x197),'headers':_0x32bb16,'body':JSON[_0x428781(0x1df)](_0x55fe08),'credentials':_0x428781(0x169)})[_0x428781(0x182)](async _0x47552c=>{const _0x5c0f47=_0x428781;if(_0x47552c[_0x5c0f47(0x168)]||_0x47552c[_0x5c0f47(0x1d7)]===0x191)throw new Error(_0x5c0f47(0x1d9));let _0x2bf40f;try{_0x2bf40f=await _0x47552c[_0x5c0f47(0x1ac)]();}catch(_0x35bf1c){throw new Error(_0x5c0f47(0x196));}if(!_0x2bf40f[_0x5c0f47(0x1d1)])return setTimeout(()=>{location['reload']();},0x7d0),_0x2bf40f[_0x5c0f47(0x172)];else{if(_0x2bf40f[_0x5c0f47(0x190)]===_0x5c0f47(0x1b6)||_0x2bf40f[_0x5c0f47(0x172)]&&_0x2bf40f['message']['error_type']==='ALREADY_IN_DESIRED_STATE')return setTimeout(()=>{location['reload']();},0x7d0),'Máy\x20chủ\x20đã\x20được\x20tắt';else{let _0x5018bc='Có\x20lỗi\x20xảy\x20ra';if(_0x2bf40f[_0x5c0f47(0x172)]){if(typeof _0x2bf40f[_0x5c0f47(0x172)]===_0x5c0f47(0x1cb)){if(_0x2bf40f[_0x5c0f47(0x172)][_0x5c0f47(0x181)]&&_0x2bf40f[_0x5c0f47(0x172)][_0x5c0f47(0x181)][_0x5c0f47(0x16d)]>0x0)_0x5018bc=_0x2bf40f['message']['messages'][0x0][_0x5c0f47(0x1b9)]||_0x2bf40f['message'][_0x5c0f47(0x181)][0x0][_0x5c0f47(0x172)]||_0x5c0f47(0x1c1);else _0x2bf40f[_0x5c0f47(0x172)]['error_type']?_0x5018bc='Lỗi:\x20'+_0x2bf40f[_0x5c0f47(0x172)]['error_type']:_0x5018bc=_0x5c0f47(0x1e1);}else _0x5018bc=_0x2bf40f[_0x5c0f47(0x172)];}else{if(_0x2bf40f['value']&&_0x2bf40f[_0x5c0f47(0x17e)]['messages']&&_0x2bf40f[_0x5c0f47(0x17e)][_0x5c0f47(0x181)][_0x5c0f47(0x16d)]>0x0)_0x5018bc=_0x2bf40f[_0x5c0f47(0x17e)][_0x5c0f47(0x181)][0x0][_0x5c0f47(0x1b9)];else{if(typeof _0x2bf40f===_0x5c0f47(0x179))_0x5018bc=_0x2bf40f;else{if(_0x2bf40f[_0x5c0f47(0x1d1)]){if(typeof _0x2bf40f[_0x5c0f47(0x1d1)]==='object'){if(_0x2bf40f[_0x5c0f47(0x1d1)][_0x5c0f47(0x172)])_0x5018bc=_0x2bf40f[_0x5c0f47(0x1d1)][_0x5c0f47(0x172)];else _0x2bf40f['error'][_0x5c0f47(0x1a5)]&&_0x2bf40f[_0x5c0f47(0x1d1)][_0x5c0f47(0x1a5)]()!==_0x5c0f47(0x1ca)?_0x5018bc=_0x2bf40f[_0x5c0f47(0x1d1)][_0x5c0f47(0x1a5)]():_0x5018bc=_0x5c0f47(0x1e1);}else _0x5018bc=_0x2bf40f['error'];}}}}throw new Error(_0x5018bc);}}});FuiToast[_0x428781(0x1af)](_0x131a54,{'loading':_0x428781(0x183),'success':_0x54f8ae=>{return _0x54f8ae;},'error':_0x46d124=>{const _0x56fcef=_0x428781;return console['error'](_0x46d124),_0x46d124[_0x56fcef(0x172)]||'Có\x20lỗi\x20xảy\x20ra\x20khi\x20dừng\x20máy\x20ảo';}},{'isClose':!![]});}function _0x240f(){const _0xf9d2b0=['14UMSSoZ','meta[name=\x22vm-hostname\x22]','Xóa\x20snapshot\x20thành\x20công','3049HOZiFO','_makeRequest','\x22?\x20Hành\x20động\x20này\x20không\x20thể\x20hoàn\x20tác.','Đang\x20khởi\x20động\x20máy\x20ảo...','REMOVE_SNAPSHOT','[object\x20Object]','object','_handleError','\x20khi\x20','snapshots','_confirmAction','VM_ID_NOT_FOUND','error','log','_executeSnapshotAction','Khôi\x20phục\x20snapshot\x20thành\x20công','_setError','90990sxmoeN','status','Đ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!)','Phiên\x20đăng\x20nhập\x20đã\x20hết\x20hạn,\x20vui\x20lòng\x20đăng\x20nhập\x20lại','reverting\x20snapshot','?product_id=','stopPropagation','Hủy\x20bỏ','936kmvQYI','stringify','getAttribute','Có\x20lỗi\x20xảy\x20ra\x20từ\x20hệ\x20thống','#3085d6','HTTP\x20error!\x20status:\x20','preventDefault','floor','Bạn\x20có\x20chắc\x20chắn\x20muốn\x20khôi\x20phục\x20về\x20snapshot\x20\x22','error_type','_lastFetchTime','meta[name=\x22invoice-id\x22]','getElementById','parse','GENERIC_ERROR','data','redirected','same-origin','meta[name=\x22vm-id\x22]','Khôi\x20phục','Không\x20thể\x20kết\x20nối\x20đến\x20máy\x20chủ','length','0\x20B','loading','Lỗi:\x20','fetching','message','refreshSnapshots','Xác\x20nhận\x20xóa','1058136ffWPFz','Đã\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.','pow','no-cache','string','/api/secure/start-vm','text','snapshotForm','csrfToken','value','570008qXsufA','success','messages','then','Đang\x20dừng\x20máy\x20ảo...','558QGoiRP','top-center','xóa','invoiceId','Đã\x20gửi\x20yêu\x20cầu\x20tạo\x20snapshot!\x20Quá\x20trình\x20sẽ\x20mất\x203-5\x20phút.','href','createSnapshotButton','includes','application/json','Error\x20','9022640SOxtpn','content','type','Đã\x20gửi\x20yêu\x20cầu\x20tạo\x20snapshot!','addEventListener','Bạn\x20có\x20chắc\x20chắn\x20muốn\x20xóa\x20snapshot\x20\x22','Có\x20lỗi\x20xảy\x20ra\x20khi\x20tạo\x20snapshot','REVERT_SUCCESS','Lỗi\x20định\x20dạng\x20dữ\x20liệu\x20từ\x20máy\x20chủ','POST','startVMButton','querySelector','url','Đang\x20gửi\x20yêu\x20cầu\x20tạo\x20snapshot...','6130940AlPKLv','/secure/revert-snapshot','12UbZRbe','/secure/remove-snapshot','/api/secure/stop-vm','meta[name=\x22csrf-token\x22]','undefined','ALREADY_IN_DESIRED_STATE','disabled','toString','Xóa','CONNECTION_ERROR','reload','trim','meta[name=\x22invoice-ordernum\x22]','now','json','446765naAsas','\x22?\x20Tất\x20cả\x20dữ\x20liệu\x20hiện\x20tại\x20sẽ\x20bị\x20mất.','promise','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','_formatBytes','warning','Máy\x20chủ\x20đã\x20được\x20bật','GET_SNAPSHOTS','com.vmware.vapi.std.errors.already_in_desired_state','#d33','stopVMButton','default_message','460LfNveh','fetchSnapshots','_cacheTimeout','click','restartVMButton','vmId','location','Có\x20lỗi\x20xảy\x20ra'];_0x240f=function(){return _0xf9d2b0;};return _0x240f();}document[_0x49f046(0x192)]('DOMContentLoaded',function(){const _0x675fe0=_0x49f046;initializeVariables();const _0x3cd9ab=document[_0x675fe0(0x164)](_0x675fe0(0x198)),_0x11f0b5=document['getElementById'](_0x675fe0(0x1b8)),_0x354797=document[_0x675fe0(0x164)](_0x675fe0(0x1be)),_0x384937=document['getElementById'](_0x675fe0(0x18a));_0x3cd9ab&&_0x3cd9ab[_0x675fe0(0x192)](_0x675fe0(0x1bd),function(_0x533892){const _0x3fcca5=_0x675fe0;_0x533892[_0x3fcca5(0x1e4)](),_0x533892['stopPropagation'](),startVirtualMachine();}),_0x11f0b5&&_0x11f0b5[_0x675fe0(0x192)](_0x675fe0(0x1bd),function(_0x395e6a){const _0x51a7e3=_0x675fe0;_0x395e6a[_0x51a7e3(0x1e4)](),_0x395e6a[_0x51a7e3(0x1dc)](),stopVirtualMachine();}),_0x354797&&_0x354797[_0x675fe0(0x192)](_0x675fe0(0x1bd),function(_0x29cb15){const _0x3f1f87=_0x675fe0;_0x29cb15[_0x3f1f87(0x1e4)](),_0x29cb15[_0x3f1f87(0x1dc)](),restartVirtualMachine();}),_0x384937&&_0x384937[_0x675fe0(0x192)]('click',function(_0x498219){const _0x44ca8b=_0x675fe0;_0x498219[_0x44ca8b(0x1e4)](),_0x498219['stopPropagation'](),createSnapshot();});});function snapshotTable(){const _0x3311c8=_0x49f046,_0x41ce9d={'GET_SNAPSHOTS':'/dich-vu-dang-ky/secure/get-snapshots','REMOVE_SNAPSHOT':_0x3311c8(0x19f),'REVERT_SNAPSHOT':_0x3311c8(0x19d)},_0xde34f2={'VM_ID_NOT_FOUND':'Không\x20tìm\x20thấy\x20ID\x20máy\x20ảo','CONNECTION_ERROR':_0x3311c8(0x16c),'GENERIC_ERROR':_0x3311c8(0x1c1),'DELETE_SUCCESS':_0x3311c8(0x1c4),'REVERT_SUCCESS':_0x3311c8(0x1d4)};return{'loading':![],'snapshots':[],'error':null,'_lastFetchTime':0x0,'_cacheTimeout':0x7530,async 'fetchSnapshots'(_0x4c0ec7=![]){const _0x55215e=_0x3311c8,_0x312a4e=Date[_0x55215e(0x1ab)]();if(!_0x4c0ec7&&this['snapshots'][_0x55215e(0x16d)]>0x0&&_0x312a4e-this[_0x55215e(0x162)]<this[_0x55215e(0x1bc)])return;this[_0x55215e(0x16f)]=!![],this[_0x55215e(0x1d1)]=null;const _0x7b1fed=window[_0x55215e(0x1bf)]?.[_0x55215e(0x1a9)]();if(!_0x7b1fed){this[_0x55215e(0x1d5)](_0xde34f2[_0x55215e(0x1d0)]);return;}try{const _0x5af10e=await this[_0x55215e(0x1c6)](_0x41ce9d[_0x55215e(0x1b5)]+_0x55215e(0x1db)+encodeURIComponent(_0x7b1fed));this['_processSnapshotsResponse'](_0x5af10e),this[_0x55215e(0x162)]=_0x312a4e;}catch(_0x23db22){this[_0x55215e(0x1cc)]('fetching\x20snapshots',_0x23db22);}finally{this[_0x55215e(0x16f)]=![];}},'formatSize'(_0x312e7a,_0x502bfa){const _0x403390=_0x3311c8,_0x5650cd=this['_convertToBytes'](_0x312e7a,_0x502bfa);if(_0x5650cd===0x0)return _0x403390(0x16e);return this[_0x403390(0x1b2)](_0x5650cd);},async 'deleteSnapshot'(_0x2cbf39){const _0x384f3f=_0x3311c8;if(!await this[_0x384f3f(0x1cf)](_0x384f3f(0x174),_0x384f3f(0x193)+_0x2cbf39+_0x384f3f(0x1c7),_0x384f3f(0x1a6)))return;await this[_0x384f3f(0x1d3)](_0x41ce9d[_0x384f3f(0x1c9)],_0x2cbf39,_0xde34f2['DELETE_SUCCESS'],'deleting\x20snapshot');},async 'revertSnapshot'(_0x387062){const _0x394dbe=_0x3311c8;if(!await this['_confirmAction']('Xác\x20nhận\x20khôi\x20phục',_0x394dbe(0x160)+_0x387062+_0x394dbe(0x1ae),_0x394dbe(0x16b)))return;await this[_0x394dbe(0x1d3)](_0x41ce9d['REVERT_SNAPSHOT'],_0x387062,_0xde34f2[_0x394dbe(0x195)],_0x394dbe(0x1da),0x7d0);},'refreshSnapshots'(){const _0x27d7ff=_0x3311c8;return this[_0x27d7ff(0x1bb)](!![]);},'getSnapshotCount'(){const _0x1a4da8=_0x3311c8;return this[_0x1a4da8(0x1ce)][_0x1a4da8(0x16d)];},'isLoading'(){const _0x55a5d5=_0x3311c8;return this[_0x55a5d5(0x16f)];},'hasError'(){return this['error']!==null;},'_setError'(_0x168c2c){const _0x366e6e=_0x3311c8;this[_0x366e6e(0x16f)]=![],this['error']=_0x168c2c,this[_0x366e6e(0x1ce)]=[];},async '_makeRequest'(_0x3195ee,_0x5aa135={}){const _0x1d8a65=_0x3311c8,_0xe16caf={'method':'GET','headers':{'Accept':_0x1d8a65(0x18c),'X-CSRF-TOKEN':csrfToken,'Cache-Control':_0x1d8a65(0x178)},'credentials':'same-origin'},_0x36d12d=await fetch(_0x3195ee,{..._0xe16caf,..._0x5aa135});if(!_0x36d12d['ok'])throw new Error(_0x1d8a65(0x1e3)+_0x36d12d['status']);return _0x36d12d[_0x1d8a65(0x1ac)]();},'_processSnapshotsResponse'(_0x361f5e){const _0x3ea349=_0x3311c8;if(_0x361f5e[_0x3ea349(0x1d1)]===![]&&_0x361f5e[_0x3ea349(0x167)]?.['snapshots'])this[_0x3ea349(0x1ce)]=_0x361f5e[_0x3ea349(0x167)][_0x3ea349(0x1ce)];else{if(_0x361f5e['error']===!![])throw new Error(_0x361f5e[_0x3ea349(0x172)]||'Có\x20lỗi\x20xảy\x20ra\x20khi\x20tải\x20danh\x20sách\x20snapshot');else _0x361f5e[_0x3ea349(0x1ce)]?this[_0x3ea349(0x1ce)]=_0x361f5e[_0x3ea349(0x1ce)]:this[_0x3ea349(0x1ce)]=[];}},'_convertToBytes'(_0x33f335,_0x5110e0){if(_0x33f335)return parseFloat(_0x33f335)*0x400**0x3;else{if(_0x5110e0)return parseFloat(_0x5110e0)*0x400**0x2;}return 0x0;},'_formatBytes'(_0x840d9f){const _0x3eb4e0=_0x3311c8,_0x47cc52=['B','KB','MB','GB','TB'],_0x341d60=0x400,_0x7048a0=Math[_0x3eb4e0(0x1e5)](Math['log'](_0x840d9f)/Math[_0x3eb4e0(0x1d2)](_0x341d60)),_0x407035=parseFloat((_0x840d9f/Math[_0x3eb4e0(0x177)](_0x341d60,_0x7048a0))['toFixed'](0x2));return _0x407035+'\x20'+_0x47cc52[_0x7048a0];},async '_confirmAction'(_0x54775d,_0x58fa76,_0x2feee8){const _0x57b565=_0x3311c8,_0x416404=await Swal['fire']({'title':_0x54775d,'text':_0x58fa76,'icon':_0x57b565(0x1b3),'showCancelButton':!![],'confirmButtonColor':_0x54775d['includes'](_0x57b565(0x186))?_0x57b565(0x1b7):_0x57b565(0x1e2),'cancelButtonColor':_0x54775d[_0x57b565(0x18b)]('xóa')?_0x57b565(0x1e2):_0x57b565(0x1b7),'confirmButtonText':_0x2feee8,'cancelButtonText':_0x57b565(0x1dd),'reverseButtons':!![]});return _0x416404['isConfirmed'];},async '_executeSnapshotAction'(_0x446d13,_0x558d09,_0x4d8548,_0x32e152,_0x1fa053=0x3e8){const _0x17e299=_0x3311c8;try{const _0x3fb044=await this[_0x17e299(0x1c6)](_0x446d13,{'method':_0x17e299(0x197),'headers':{'Content-Type':_0x17e299(0x18c),'Accept':_0x17e299(0x18c),'X-CSRF-TOKEN':csrfToken},'body':JSON[_0x17e299(0x1df)]({'product_id':window[_0x17e299(0x1bf)],'snapshot_name':_0x558d09})});if(_0x3fb044[_0x17e299(0x1d1)]===![])showNotification(_0x3fb044[_0x17e299(0x172)]||_0x4d8548,_0x17e299(0x180)),setTimeout(()=>this[_0x17e299(0x173)](),_0x1fa053);else throw new Error(_0x3fb044[_0x17e299(0x172)]||_0xde34f2[_0x17e299(0x166)]+_0x17e299(0x1cd)+_0x32e152);}catch(_0x14fd40){this[_0x17e299(0x1cc)](_0x32e152,_0x14fd40);}},'_handleError'(_0x1eefee,_0x4e1ade){const _0x19ae06=_0x3311c8;console[_0x19ae06(0x1d1)](_0x19ae06(0x18d)+_0x1eefee+':',_0x4e1ade);const _0xa73203=_0x4e1ade[_0x19ae06(0x172)]||_0xde34f2[_0x19ae06(0x1a7)];_0x1eefee[_0x19ae06(0x18b)](_0x19ae06(0x171))?this[_0x19ae06(0x1d5)](_0xa73203):showNotification(_0xa73203,_0x19ae06(0x1d1));}};} |