Page MenuHomeSoftware Heritage

vault.5e9ca396f730a410304f.js
No OneTemporary

vault.5e9ca396f730a410304f.js

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.vault=e():(t.swh=t.swh||{},t.swh.vault=e())}(window,(function(){return function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/static/",o(o.s=261)}({166:function(t,e,o){"use strict";o.d(e,"a",(function(){return c})),o.d(e,"c",(function(){return s})),o.d(e,"d",(function(){return l})),o.d(e,"b",(function(){return d}));var n,r,i=o(2);function a(t,e){"new"===e.status?t.css("background-color","rgba(128, 128, 128, 0.5)"):"pending"===e.status?t.css("background-color","rgba(0, 0, 255, 0.5)"):"done"===e.status?t.css("background-color","#5cb85c"):"failed"===e.status&&(t.css("background-color","rgba(255, 0, 0, 0.5)"),t.css("background-image","none")),t.text(e.progress_message||e.status),"new"===e.status||"pending"===e.status?t.addClass("progress-bar-animated"):t.removeClass("progress-bar-striped")}function c(t){r=null,fetch(t).then((function(e){if(e.ok)$("#vault-fetch-iframe").attr("src",t);else{for(var o=JSON.parse(localStorage.getItem("swh-vault-cooking-tasks")),n=0;n<o.length;++n)if(o[n].fetch_url===t){r=o[n];break}$("#vault-recook-object-modal").modal("show")}}))}function s(){var t;r&&(clearTimeout(n),t="directory"===r.object_type?Urls.api_1_vault_cook_directory(r.object_id):Urls.api_1_vault_cook_revision_gitfast(r.object_id),r.email&&(t+="?email="+r.email),Object(i.a)(t).then(i.b).then((function(){r.status="new";for(var t=JSON.parse(localStorage.getItem("swh-vault-cooking-tasks")),e=0;e<t.length;++e)if(t[e].object_id===r.object_id){t[e]=r;break}localStorage.setItem("swh-vault-cooking-tasks",JSON.stringify(t)),u(),$("#vault-recook-object-modal").modal("hide")})).catch((function(){u(),$("#vault-recook-object-modal").modal("hide")})))}function u(){var t=JSON.parse(localStorage.getItem("swh-vault-cooking-tasks"));if(!t||0===t.length)return $(".swh-vault-table tbody tr").remove(),void(n=setTimeout(u,5e3));for(var e=[],o={},r=[],c=0;c<t.length;++c){var s=t[c];r.push(s.object_id),o[s.object_id]=s;var l=void 0;l="directory"===s.object_type?Urls.api_1_vault_cook_directory(s.object_id):Urls.api_1_vault_cook_revision_gitfast(s.object_id),"done"!==s.status&&"failed"!==s.status&&e.push(fetch(l))}$(".swh-vault-table tbody tr").each((function(t,e){var o=$(e).find(".vault-object-info").data("object-id");-1===$.inArray(o,r)&&$(e).remove()})),Promise.all(e).then(i.c).then((function(t){return Promise.all(t.map((function(t){return t.json()})))})).then((function(e){for(var r=$("#vault-cooking-tasks tbody"),i=0;i<e.length;++i){var c=o[e[i].obj_id];c.status=e[i].status,c.fetch_url=e[i].fetch_url,c.progress_message=e[i].progress_message}for(var s=0;s<t.length;++s){var l=t[s],d=$("#vault-task-"+l.object_id);if(d.length){a(d.find(".progress-bar"),l);var f=d.find(".vault-dl-link");"done"===l.status?f[0].innerHTML='<button class="btn btn-default btn-sm" onclick="swh.vault.fetchCookedObject(\''+l.fetch_url+'\')"><i class="mdi mdi-download mdi-fw" aria-hidden="true"></i>Download</button>':f[0].innerHTML=""}else{var b=l.browse_url;b||(b="directory"===l.object_type?Urls.browse_directory(l.object_id):Urls.browse_revision(l.object_id));var v=$.parseHTML('<div class="progress">\n <div class="progress-bar progress-bar-success progress-bar-striped"\n role="progressbar" aria-valuenow="100" aria-valuemin="0"\n aria-valuemax="100" style="width: 100%;height: 100%;">\n </div>\n </div>;')[0];a($(v).find(".progress-bar"),l);var h=void 0;h="directory"===l.object_type?'<tr id="vault-task-'+l.object_id+'" title="Once downloaded, the directory can be extracted with the following command:\n\n$ tar xvzf '+l.object_id+'.tar.gz">':'<tr id="vault-task-'+l.object_id+'" title="Once downloaded, the git repository can be imported with the following commands:\n\n$ git init\n$ zcat '+l.object_id+'.gitfast.gz | git fast-import">',h+='<td><div class="custom-control custom-checkbox">',h+='<input type="checkbox" class="custom-control-input vault-task-toggle-selection" id="vault-task-toggle-selection-'+l.object_id+'"/>',h+='<label class="custom-control-label" for="vault-task-toggle-selection-'+l.object_id+'"></label></td>',l.origin?h+='<td class="vault-origin"><a href="'+Urls.browse_origin()+"?origin_url="+l.origin+'">'+l.origin+"</a></td>":h+='<td class="vault-origin">unknown</td>',h+='<td><i class="'+swh.webapp.getSwhObjectIcon(l.object_type)+' mdi-fw"></i>'+l.object_type+"</td>",h+='<td class="vault-object-info" data-object-id="'+l.object_id+'"><b>id:</b>&nbsp;<a href="'+b+'">'+l.object_id+"</a>",l.path&&(h+="<br/><b>path:</b>&nbsp;"+l.path),h+="</td>",h+="<td>"+v.outerHTML+"</td>";var g="";"done"===l.status&&(g='<button class="btn btn-default btn-sm" onclick="swh.vault.fetchCookedObject(\''+l.fetch_url+'\')"><i class="mdi mdi-download mdi-fw" aria-hidden="true"></i>Download</button>'),h+='<td class="vault-dl-link">'+g+"</td>",h+="</tr>",r.prepend(h)}}localStorage.setItem("swh-vault-cooking-tasks",JSON.stringify(t)),n=setTimeout(u,5e3)})).catch((function(){}))}function l(t){var e=JSON.parse(localStorage.getItem("swh-vault-cooking-tasks"));e&&(e=$.grep(e,(function(e){return-1===$.inArray(e.object_id,t)})),localStorage.setItem("swh-vault-cooking-tasks",JSON.stringify(e)))}function d(){$("#vault-tasks-toggle-selection").change((function(t){$(".vault-task-toggle-selection").prop("checked",t.currentTarget.checked)})),$("#vault-remove-tasks").click((function(){clearTimeout(n);var t=[];$(".swh-vault-table tbody tr").each((function(e,o){if($(o).find(".vault-task-toggle-selection").prop("checked")){var n=$(o).find(".vault-object-info").data("object-id");t.push(n),$(o).remove()}})),l(t),$("#vault-tasks-toggle-selection").prop("checked",!1),n=setTimeout(u,5e3)})),u(),window.onfocus=function(){clearTimeout(n),u()}}},167:function(t,e,o){"use strict";o.d(e,"e",(function(){return i})),o.d(e,"a",(function(){return s})),o.d(e,"c",(function(){return u})),o.d(e,"b",(function(){return l})),o.d(e,"d",(function(){return d}));var n=o(2),r={position:"fixed",left:"1rem",bottom:"1rem","z-index":"100000"};function i(t,e){var o;o="directory"===t?Urls.api_1_vault_cook_directory(e):Urls.api_1_vault_cook_revision_gitfast(e),fetch(o).then((function(t){return t.json()})).then((function(o){if("NotFoundExc"===o.exception||"failed"===o.status)swh.vault.removeCookingTaskInfo([e]),$("#vault-cook-"+t+"-modal").modal("show");else if("done"===o.status)$("#vault-fetch-"+t+"-modal").modal("show");else{var i=$(Object(n.d)("danger","Archive cooking service is currently experiencing issues.<br/>Please try again later.",!0));i.css(r),$("body").append(i)}}))}function a(t){var e=swh.webapp.getSwhIdsContext();t.origin=e[t.object_type].context.origin,t.path=e[t.object_type].context.path,t.browse_url=e[t.object_type].swhid_with_context_url,t.browse_url||(t.browse_url=e[t.object_type].swhid_url);var o,i=JSON.parse(localStorage.getItem("swh-vault-cooking-tasks"));(i||(i=[]),void 0===i.find((function(e){return e.object_type===t.object_type&&e.object_id===t.object_id})))&&(o="directory"===t.object_type?Urls.api_1_vault_cook_directory(t.object_id):Urls.api_1_vault_cook_revision_gitfast(t.object_id),t.email&&(o+="?email="+t.email),Object(n.a)(o).then(n.b).then((function(){i.push(t),localStorage.setItem("swh-vault-cooking-tasks",JSON.stringify(i)),$("#vault-cook-directory-modal").modal("hide"),$("#vault-cook-revision-modal").modal("hide");var e=$(Object(n.d)("success",'Archive cooking request successfully submitted.<br/>Go to the <a href="'+Urls.browse_vault()+'">Downloads</a> page to get the download link once it is ready.',!0));e.css(r),$("body").append(e)})).catch((function(){$("#vault-cook-directory-modal").modal("hide"),$("#vault-cook-revision-modal").modal("hide");var t=$(Object(n.d)("danger","Archive cooking request submission failed.",!0));t.css(r),$("body").append(t)})))}function c(t){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(t).toLowerCase())}function s(t){var e=$("#swh-vault-directory-email").val().trim();!e||c(e)?a({object_type:"directory",object_id:t,email:e,status:"new"}):$("#invalid-email-modal").modal("show")}function u(t){$("#vault-fetch-directory-modal").modal("hide");var e=Urls.api_1_vault_cook_directory(t);fetch(e).then((function(t){return t.json()})).then((function(t){swh.vault.fetchCookedObject(t.fetch_url)}))}function l(t){var e=$("#swh-vault-revision-email").val().trim();!e||c(e)?a({object_type:"revision",object_id:t,email:e,status:"new"}):$("#invalid-email-modal").modal("show")}function d(t){$("#vault-fetch-directory-modal").modal("hide");var e=Urls.api_1_vault_cook_revision_gitfast(t);fetch(e).then((function(t){return t.json()})).then((function(t){swh.vault.fetchCookedObject(t.fetch_url)}))}},2:function(t,e,o){"use strict";function n(t){if(!t.ok)throw t;return t}function r(t){for(var e=0;e<t.length;++e)if(!t[e].ok)throw t[e];return t}function i(t){return"/static/"+t}function a(t,e,o){return void 0===e&&(e={}),void 0===o&&(o=null),e["X-CSRFToken"]=Cookies.get("csrftoken"),fetch(t,{credentials:"include",headers:e,method:"POST",body:o})}function c(t,e){return new RegExp("(?:git|https?|git@)(?:\\:\\/\\/)?"+e+"[/|:][A-Za-z0-9-/]+?\\/[\\w\\.-]+\\/?(?!=.git)(?:\\.git(?:\\/?|\\#[\\w\\.\\-_]+)?)?$").test(t)}function s(){history.replaceState("",document.title,window.location.pathname+window.location.search)}function u(t,e){var o=window.getSelection();o.removeAllRanges();var n=document.createRange();n.setStart(t,0),"#text"!==e.nodeName?n.setEnd(e,e.childNodes.length):n.setEnd(e,e.textContent.length),o.addRange(n)}function l(t,e,o){void 0===o&&(o=!1);var n="",r="";return o&&(n='<button type="button" class="close" data-dismiss="alert" aria-label="Close">\n <span aria-hidden="true">&times;</span>\n </button>',r="alert-dismissible"),'<div class="alert alert-'+t+" "+r+'" role="alert">'+e+n+"</div>"}o.d(e,"b",(function(){return n})),o.d(e,"c",(function(){return r})),o.d(e,"h",(function(){return i})),o.d(e,"a",(function(){return a})),o.d(e,"e",(function(){return c})),o.d(e,"f",(function(){return s})),o.d(e,"g",(function(){return u})),o.d(e,"d",(function(){return l}))},261:function(t,e,o){t.exports=o(262)},262:function(t,e,o){"use strict";o.r(e);o(263);var n=o(166);o.d(e,"fetchCookedObject",(function(){return n.a})),o.d(e,"recookObject",(function(){return n.c})),o.d(e,"removeCookingTaskInfo",(function(){return n.d})),o.d(e,"initUi",(function(){return n.b}));var r=o(167);o.d(e,"vaultRequest",(function(){return r.e})),o.d(e,"cookDirectoryArchive",(function(){return r.a})),o.d(e,"fetchDirectoryArchive",(function(){return r.c})),o.d(e,"cookRevisionArchive",(function(){return r.b})),o.d(e,"fetchRevisionArchive",(function(){return r.d}))},263:function(t,e,o){}})}));
//# sourceMappingURL=vault.5e9ca396f730a410304f.js.map

File Metadata

Mime Type
text/plain
Expires
Jun 4 2025, 7:41 PM (10 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3368312

Event Timeline