f96825bffb
Signed-off-by: 潇洒 <14147370+PizazzXS@user.noreply.gitee.com>
1 line
7.6 KiB
JavaScript
1 line
7.6 KiB
JavaScript
Z2xvYmFsVGhpcy5oX29zdCA9ICdodHRwOi8vdi5sa3V5cy5jbi8nOwoKZ2xvYmFsVGhpcy52b2RsaXN0ID0gZnVuY3Rpb24oJHQsICRwZykgewogICAgY29uc3QgY3VycmVudFRpbWVzdGFtcCA9IHBhcnNlSW50KERhdGUubm93KCkgLyAxMDAwLCAxMCk7CiAgICBjb25zdCB1cmwgPSBoX29zdCArICcvdjIvaG9tZS90eXBlX3NlYXJjaCc7CiAgICBjb25zdCBoeCA9IENyeXB0b0pTLk1ENSgna2o1NjQ5ZXJ0ajg0a3M4OXI0amg4czQ1aGY4NGhqZmRzMDRrJyArIGN1cnJlbnRUaW1lc3RhbXApLnRvU3RyaW5nKCk7CiAgICBsZXQgaHRtbCA9IHJlcXVlc3QodXJsLCB7CiAgICAgICAgYm9keTogewogICAgICAgICAgICBzaWduOiBoeCwKICAgICAgICAgICAgdHlwZV9pZDogJHQsCiAgICAgICAgICAgIHBhZ2U6ICRwZywKICAgICAgICB9LAogICAgICAgIGhlYWRlcnM6IHsKICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiAnb2todHRwLW9rZ28vamVhc29ubHp5JywKICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnCiAgICAgICAgfSwKICAgICAgICAnbWV0aG9kJzogJ1BPU1QnCiAgICB9LCB0cnVlKTsKICAgIHJldHVybiBKU09OLnBhcnNlKGh0bWwpLmRhdGEubGlzdDsKfQoKZ2xvYmFsVGhpcy5zZWFjaCA9IGZ1bmN0aW9uKHdkKSB7CiAgICBjb25zdCBjdXJyZW50VGltZXN0YW1wID0gcGFyc2VJbnQoRGF0ZS5ub3coKSAvIDEwMDAsIDEwKTsKICAgIGNvbnN0IHVybCA9IGhfb3N0ICsgJy92Mi9ob21lL3NlYXJjaCc7CiAgICBjb25zdCBoeCA9IENyeXB0b0pTLk1ENSgna2o1NjQ5ZXJ0ajg0a3M4OXI0amg4czQ1aGY4NGhqZmRzMDRrJyArIGN1cnJlbnRUaW1lc3RhbXApLnRvU3RyaW5nKCk7CiAgICBsZXQgaHRtbCA9IHJlcXVlc3QodXJsLCB7CiAgICAgICAgYm9keTogewogICAgICAgICAgICBzaWduOiBoeCwKICAgICAgICAgICAga2V5d29yZDogd2QsCiAgICAgICAgICAgIHRpbWVzdGFtcDogY3VycmVudFRpbWVzdGFtcCwKICAgICAgICB9LAogICAgICAgIGhlYWRlcnM6IHsKICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiAnb2todHRwLW9rZ28vamVhc29ubHp5JywKICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnCiAgICAgICAgfSwKICAgICAgICAnbWV0aG9kJzogJ1BPU1QnCiAgICB9LCB0cnVlKTsKICAgIHJldHVybiBKU09OLnBhcnNlKGh0bWwpLmRhdGEubGlzdDsKfQpnbG9iYWxUaGlzLnZvZGlkcyA9IGZ1bmN0aW9uKGlkcykgewogICAgY29uc3QgY3VycmVudFRpbWVzdGFtcCA9IHBhcnNlSW50KERhdGUubm93KCkgLyAxMDAwLCAxMCk7CiAgICBjb25zdCB1cmwgPSBoX29zdCArICcvdjIvaG9tZS92b2RfZGV0YWlscyc7CiAgICBjb25zdCBoeCA9IENyeXB0b0pTLk1ENSgna2o1NjQ5ZXJ0ajg0a3M4OXI0amg4czQ1aGY4NGhqZmRzMDRrJyArIGN1cnJlbnRUaW1lc3RhbXApLnRvU3RyaW5nKCk7CiAgICBsZXQgaHRtbCA9IHJlcXVlc3QodXJsLCB7CiAgICAgICAgYm9keTogewogICAgICAgICAgICBzaWduOiBoeCwKICAgICAgICAgICAgdm9kX2lkOiBpZHMsCiAgICAgICAgICAgIHRpbWVzdGFtcDogY3VycmVudFRpbWVzdGFtcCwKICAgICAgICB9LAogICAgICAgIGhlYWRlcnM6IHsKICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiAnb2todHRwLW9rZ28vamVhc29ubHp5JywKICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnCiAgICAgICAgfSwKICAgICAgICAnbWV0aG9kJzogJ1BPU1QnCiAgICB9LCB0cnVlKTsKICAgIGNvbnN0IHJlZGF0YSA9IEpTT04ucGFyc2UoaHRtbCk7CiAgICBsZXQgdm9kUGxheUZyb20gPSAnJzsKICAgIGxldCB2b2RQbGF5VXJsID0gJyc7CiAgICByZWRhdGEuZGF0YS52b2RfcGxheV9saXN0LmZvckVhY2goKHZhbHVlLCBrZXkpID0+IHsKICAgICAgICBpZiAodmFsdWUuZmxhZy5pbmNsdWRlcygibmJ5IikgfHwgdmFsdWUuZmxhZy5pbmNsdWRlcygibWd0diIpIHx8IHZhbHVlLmZsYWcuaW5jbHVkZXMoInFxIikgfHwgdmFsdWUuZmxhZy5pbmNsdWRlcygicWl5aSIpIHx8IHZhbHVlLmZsYWcuaW5jbHVkZXMoIm1ndHYiKSkgewogICAgICAgICAgICB2b2RQbGF5RnJvbSArPSBgJHt2YWx1ZS5mbGFnfSQkJGA7CiAgICAgICAgICAgIHZhbHVlLnVybHMuZm9yRWFjaCh1cmwgPT4gewogICAgICAgICAgICAgICAgdm9kUGxheVVybCArPSBgJHt1cmwubmFtZX0kJHt2YWx1ZS5wYXJzZV91cmxzWzBdfSR7dXJsLnVybH1+JHt1cmwubmFtZX0jYDsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIHZvZFBsYXlVcmwgKz0gJyQkJCc7CiAgICAgICAgfQogICAgfSk7CiAgICBjb25zdCByZWdlc2hpID0gewogICAgICAgIHZvZF9pZDogcmVkYXRhLmRhdGEudm9kX2lkLAogICAgICAgIHZvZF9uYW1lOiByZWRhdGEuZGF0YS52b2RfbmFtZSwKICAgICAgICB2b2RfcmVtYXJrczogYCR7cmVkYXRhLmRhdGEudm9kX3JlbWFya3N9YCwKICAgICAgICB0eXBlX25hbWU6IHJlZGF0YS5kYXRhLnZvZF9jbGFzcywKICAgICAgICB2b2RfcGljOiByZWRhdGEuZGF0YS52b2RfcGljLAogICAgICAgIHZvZF95ZWFyOiByZWRhdGEuZGF0YS52b2RfeWVhciwKICAgICAgICB2b2RfYXJlYTogcmVkYXRhLmRhdGEudm9kX2FyZWEsCiAgICAgICAgdm9kX2FjdG9yOiBgJHtyZWRhdGEuZGF0YS52b2RfYWN0b3J9YCwKICAgICAgICB2b2RfZGlyZWN0b3I6IHJlZGF0YS5kYXRhLnZvZF9kaXJlY3RvciwKICAgICAgICB2b2RfY29udGVudDogYCR7cmVkYXRhLmRhdGEudm9kX2NvbnRlbnR9YCwKICAgICAgICB2b2RfcGxheV9mcm9tOiB2b2RQbGF5RnJvbSwKICAgICAgICB2b2RfcGxheV91cmw6IHZvZFBsYXlVcmwKICAgIH07CiAgICByZXR1cm4gcmVnZXNoaTsKfQpnbG9iYWxUaGlzLmp4eCA9IGZ1bmN0aW9uKGlucHV0KSB7CiAgICBpZiAoIjc0MTg1Mjk2MyIgIT09ICc3NDE4NTI5NjMnKSB7CiAgICAgICAgcmV0dXJuICdodHRwczovL3MwLm1hbGwudGNsLmNvbS9ncm91cDEvTTAwLzAwLzg5L0N2b0dCR2RjT1BhQUFVeHZBRHdabmlWVjJiYzQ3Ni5tcDQnOwogICAgfQogICAgY29uc3QgcGFydHMgPSBpbnB1dC5zcGxpdCgnficpOwogICAgdHJ5IHsKICAgICAgICBsZXQgcmVzcG9uc2UgPSBmZXRjaChwYXJ0c1swXSwgewogICAgICAgICAgICBtZXRob2Q6ICdnZXQnLAogICAgICAgICAgICBoZWFkZXJzOiB7CiAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6ICdva2h0dHAvMy4xNC45JywKICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJwogICAgICAgICAgICB9CiAgICAgICAgfSk7CgogICAgICAgIGlmIChyZXNwb25zZS5pbmNsdWRlcygi5oiQ5YqfIikgfHwgcmVzcG9uc2UuaW5jbHVkZXMoInN1Y2Nlc3MiKSB8fCByZXNwb25zZS5pbmNsdWRlcygibmJ5IikpIHsKICAgICAgICAgICAgbGV0IGJhdGEgPSBKU09OLnBhcnNlKHJlc3BvbnNlKTsKICAgICAgICAgICAgaW5wdXQgPSB7CiAgICAgICAgICAgICAgICBwYXJzZTogMCwKICAgICAgICAgICAgICAgIHVybDogYmF0YS51cmwsCiAgICAgICAgICAgICAgICBqeDogMCwKICAgICAgICAgICAgICAgIGRhbm1ha3U6ICdodHRwOi8vMTAzLjM2LjIyMC4xNjY6OTEvZG1rdTEvdHZib3gvemgucGhwP3VybD0nICsgJyZqbT0nICsgVk9ELnZvZF9uYW1lICsgJyZqcz0nICsgcGFydHNbMV0gKyAnJmtleT03NDE4NTI5NjMnCiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBpbnB1dCA9IHsKICAgICAgICAgICAgICAgIHBhcnNlOiAwLAogICAgICAgICAgICAgICAgdXJsOiBwYXJ0c1swXS5pbmNsdWRlcygndXJsPScpID8gcGFydHNbMF0uc2xpY2UocGFydHNbMF0uaW5kZXhPZigndXJsPScpICsgNCkgOiBudWxsLAogICAgICAgICAgICAgICAgang6IDEsCiAgICAgICAgICAgICAgICBkYW5tYWt1OiAnaHR0cDovLzEwMy4zNi4yMjAuMTY2OjkxL2Rta3UxL3R2Ym94L3poLnBocD91cmw9JyArICcmam09JyArIFZPRC52b2RfbmFtZSArICcmanM9JyArIHBhcnRzWzFdICsgJyZrZXk9NzQxODUyOTYzJwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfSBjYXRjaCB7CiAgICAgICAgaW5wdXQgPSB7CiAgICAgICAgICAgIHBhcnNlOiAwLAogICAgICAgICAgICB1cmw6ICfop6PmnpDlpLHotKUnLAogICAgICAgICAgICBqeDogMCwKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gaW5wdXQ7Cn0KCnZhciBydWxlID0gewogICAgdGl0bGU6ICfov73liacnLAogICAgaG9zdDogJycsCiAgICBkZXRhaWxVcmw6ICdmeWlkJywKICAgIHNlYXJjaFVybDogJyoqJywKICAgIHVybDogJ2Z5Y2xhc3MnLAogICAgc2VhcmNoYWJsZTogMiwKICAgIHF1aWNrU2VhcmNoOiAxLAogICAgZmlsdGVyYWJsZTogMCwKICAgIGNsYXNzX25hbWU6ICfnlLXlvbEm55S16KeG5YmnJue7vOiJuibliqjmvKsnLAogICAgY2xhc3NfdXJsOiAnMSYyJjQmMycsCiAgICBwbGF5X3BhcnNlOiB0cnVlLAogICAgbGF6eTogJGpzLnRvU3RyaW5nKCgpID0+IHsKICAgICAgICBpbnB1dCA9IGp4eChpbnB1dCk7CiAgICB9KSwKICAgIOaOqOiNkDogJGpzLnRvU3RyaW5nKCgpID0+IHsKICAgICAgICBsZXQgYmRhdGEgPSB2b2RsaXN0KDAsIDEpOwogICAgICAgIGNvbnNvbGUubG9nKGJkYXRhKTsKICAgICAgICBiZGF0YS5mb3JFYWNoKGl0ID0+IHsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHVybDogaXQudm9kX2lkLAogICAgICAgICAgICAgICAgdGl0bGU6IGl0LnZvZF9uYW1lLAogICAgICAgICAgICAgICAgaW1nOiBpdC52b2RfcGljLAogICAgICAgICAgICAgICAgZGVzYzogaXQudm9kX3JlbWFya3MKICAgICAgICAgICAgfSk7CiAgICAgICAgfSk7CiAgICAgICAgc2V0UmVzdWx0KGQpOwogICAgfSksCiAgICDkuIDnuqc6ICRqcy50b1N0cmluZygoKSA9PiB7CiAgICAgICAgbGV0IGJkYXRhID0gdm9kbGlzdChpbnB1dCwgTVlfUEFHRSk7CiAgICAgICAgY29uc29sZS5sb2coYmRhdGEpOwogICAgICAgIGJkYXRhLmZvckVhY2goaXQgPT4gewogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdXJsOiBpdC52b2RfaWQsCiAgICAgICAgICAgICAgICB0aXRsZTogaXQudm9kX25hbWUsCiAgICAgICAgICAgICAgICBpbWc6IGl0LnZvZF9waWMsCiAgICAgICAgICAgICAgICBkZXNjOiBpdC52b2RfcmVtYXJrcwogICAgICAgICAgICB9KTsKICAgICAgICB9KTsKICAgICAgICBzZXRSZXN1bHQoZCk7CiAgICB9KSwKICAgIOS6jOe6pzogJGpzLnRvU3RyaW5nKCgpID0+IHsKICAgICAgICBjb25zb2xlLmxvZygi6LCD6K+V5L+h5oGvMiIgKyBpbnB1dCk7CiAgICAgICAgbGV0IGRhdGEgPSB2b2RpZHMoaW5wdXQpOwogICAgICAgIC8vY29uc29sZS5sb2coZGF0YSk7CiAgICAgICAgVk9EID0gKGRhdGEpOwogICAgfSksCiAgICDmkJzntKI6ICRqcy50b1N0cmluZygoKSA9PiB7CiAgICAgICAgbGV0IGRkYXRhID0gc2VhY2goaW5wdXQpOwogICAgICAgIGRkYXRhLmZvckVhY2goaXQgPT4gewogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdXJsOiBpdC52b2RfaWQsCiAgICAgICAgICAgICAgICB0aXRsZTogaXQudm9kX25hbWUsCiAgICAgICAgICAgICAgICBpbWc6IGl0LnZvZF9waWMsCiAgICAgICAgICAgICAgICBkZXNjOiBpdC52b2RfcmVtYXJrcwogICAgICAgICAgICB9KTsKICAgICAgICB9KTsKICAgICAgICBzZXRSZXN1bHQoZCk7CiAgICB9KSwKfQ== |