github.com/benoitkugler/goacve@v0.0.0-20201217100549-151ce6e55dc8/server/static/bv/js/passwords.008e7c0e.js (about)

     1  (function(e){function t(t){for(var n,o,i=t[0],c=t[1],u=t[2],d=0,p=[];d<i.length;d++)o=i[d],Object.prototype.hasOwnProperty.call(s,o)&&s[o]&&p.push(s[o][0]),s[o]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);l&&l(t);while(p.length)p.shift()();return a.push.apply(a,u||[]),r()}function r(){for(var e,t=0;t<a.length;t++){for(var r=a[t],n=!0,i=1;i<r.length;i++){var c=r[i];0!==s[c]&&(n=!1)}n&&(a.splice(t--,1),e=o(o.s=r[0]))}return e}var n={},s={passwords:0},a=[];function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=e,o.c=n,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/static/bv/";var i=window["webpackJsonp"]=window["webpackJsonp"]||[],c=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=c;a.push([10,"chunk-vendors","chunk-common"]),r()})({10:function(e,t,r){e.exports=r("55c0")},"55c0":function(e,t,r){"use strict";r.r(t);r("e260"),r("e6cf"),r("cca6"),r("a79d"),r("0cdd");var n=r("2b0e"),s=(r("135e"),function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("base-app",{attrs:{title:"Coffre-fort des mots de passe ACVE"}},[e.output?r("success",{attrs:{output:e.output}}):e._e(),e.output?r("error",{attrs:{output:e.output}}):e._e(),r("b-modal",{attrs:{"hide-header":"","hide-footer":""},model:{value:e.showEditPassword,callback:function(t){e.showEditPassword=t},expression:"showEditPassword"}},[r("form-password",{attrs:{password:e.currentPassword},on:{done:e.onDoneEdit}})],1),r("b-container",{staticClass:"my-2 mb-3 mx-auto"},[r("b-card",[r("b-card-title",[r("b-row",{staticClass:"w-100",attrs:{"no-gutters":""}},[r("b-col",[e._v(" Mots de passe ")]),r("b-col",{staticClass:"text-right"},[r("b-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.top",modifiers:{top:!0}}],attrs:{variant:"success",title:"Ajouter un mot de passe..."},on:{click:e.startCreatePassword}},[r("b-icon-plus"),e._v(" Ajouter ")],1)],1)],1)],1),r("b-overlay",{staticClass:"overflow-auto",staticStyle:{height:"60vh"},attrs:{show:e.loading}},[r("b-table-lite",{attrs:{items:e.passwords,fields:e.fields,small:"",striped:""},scopedSlots:e._u([{key:"cell(provenance)",fn:function(t){var n=t.item;return[r("a",{attrs:{href:e.asP(n).provenance,target:"_blank"}},[e._v(e._s(e.asP(n).provenance))])]}},{key:"cell(buttons)",fn:function(t){var n=t.item;return[r("b-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.top",value:"Modifier...",expression:"'Modifier...'",modifiers:{hover:!0,top:!0}}],attrs:{size:"sm",variant:"secondary"},on:{click:function(t){return e.startUpdatePassword(n)}}},[r("b-icon-pencil")],1),r("b-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.right",value:"Supprimer...",expression:"'Supprimer...'",modifiers:{right:!0}}],staticClass:"ml-1",attrs:{size:"sm",variant:"danger"},on:{click:function(t){return e.startDeletePassword(n)}}},[r("b-icon-trash")],1)]}}])})],1)],1)],1)],1)}),a=[],o=(r("07ac"),r("96cf"),r("1da1")),i=r("d4ec"),c=r("bee2"),u=r("262e"),l=r("2caf"),d=r("9ab4"),p=r("2fe1"),f=r("3b54"),b=r("c658"),h=r("9dc9"),w=r("fc87"),v=r("bc3a"),m=r.n(v),g=Object(w["c"])(),y=g+"/api",P=function(e){Object(u["a"])(r,e);var t=Object(l["a"])(r);function r(){var e;return Object(i["a"])(this,r),e=t.apply(this,arguments),e.passwords={},e}return Object(c["a"])(r,[{key:"getPasswords",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m.a.get(y);case 3:t=e.sent,this.passwords=t.data||{},e.next=10;break;case 7:e.prev=7,e.t0=e["catch"](0),this.notifications.onAxiosError(e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"createPassword",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m.a.put(y,t);case 3:r=e.sent,n["default"].set(this.passwords,r.data.id,r.data),this.notifications.success={message:"Mot de passe ajouté avec succès.",title:"Création"},e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),this.notifications.onAxiosError(e.t0);case 11:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"updatePassword",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m.a.post(y,t);case 3:r=e.sent,n["default"].set(this.passwords,r.data.id,r.data),this.notifications.success={message:"Mot de passe modifié avec succès.",title:"Modification"},e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),this.notifications.onAxiosError(e.t0);case 11:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"deletePassword",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m.a.delete(y,{params:{id:t}});case 3:n["default"].delete(this.passwords,t),this.notifications.success={message:"Mot de passe supprimé avec succès.",title:"Suppression"},e.next=10;break;case 7:e.prev=7,e.t0=e["catch"](0),this.notifications.onAxiosError(e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])})));function t(t){return e.apply(this,arguments)}return t}()}]),r}(w["a"]),k=new P,x=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("b-card",{attrs:{title:e.title}},[r("b-row",[r("b-col",[r("b-form-group",{attrs:{label:"Site ou service"}},[r("b-form-input",{model:{value:e.innerPassword.provenance,callback:function(t){e.$set(e.innerPassword,"provenance",t)},expression:"innerPassword.provenance"}})],1)],1)],1),r("b-row",[r("b-col",[r("b-form-group",{attrs:{label:"Identifiant"}},[r("b-form-input",{model:{value:e.innerPassword.loggin,callback:function(t){e.$set(e.innerPassword,"loggin",t)},expression:"innerPassword.loggin"}})],1)],1),r("b-col",[r("b-form-group",{attrs:{label:"Mot de passe"}},[r("b-form-input",{model:{value:e.innerPassword.password,callback:function(t){e.$set(e.innerPassword,"password",t)},expression:"innerPassword.password"}})],1)],1)],1),r("b-row",[r("b-col",[r("b-form-group",{attrs:{label:"Description"}},[r("b-form-textarea",{model:{value:e.innerPassword.description,callback:function(t){e.$set(e.innerPassword,"description",t)},expression:"innerPassword.description"}})],1)],1)],1),r("b-row",[r("b-col",{staticClass:"text-right"},[r("b-button",{attrs:{variant:e.isCreateMode?"success":"secondary"},on:{click:function(t){return e.$emit("done",e.isCreateMode,e.innerPassword)}}},[e._v(" "+e._s(e.btnLabel)+" ")])],1)],1)],1)},j=[],O=r("60a3"),C=n["default"].extend({props:{password:Object}});function M(){return{password:"",id:-1,provenance:"",description:"",loggin:""}}var _=function(e){Object(u["a"])(r,e);var t=Object(l["a"])(r);function r(){var e;return Object(i["a"])(this,r),e=t.apply(this,arguments),e.innerPassword=e.duplique(),e}return Object(c["a"])(r,[{key:"p",value:function(){this.innerPassword=this.duplique()}},{key:"duplique",value:function(){var e=null==this.password?M():this.password;return JSON.parse(JSON.stringify(e))}},{key:"isCreateMode",get:function(){return null==this.password}},{key:"title",get:function(){return this.isCreateMode?"Ajouter un mot de passe":"Modifier le mot de passe"}},{key:"btnLabel",get:function(){return this.isCreateMode?"Créer":"Modifier"}}]),r}(C);d["a"]([Object(O["a"])("password",{deep:!0})],_.prototype,"p",null),_=d["a"]([Object(p["b"])({})],_);var E=_,R=E,S=r("2877"),A=Object(S["a"])(R,x,j,!1,null,"4d13fdf7",null),$=A.exports,D={style:"vertical-align:middle;"},N=function(e){Object(u["a"])(r,e);var t=Object(l["a"])(r);function r(){var e;return Object(i["a"])(this,r),e=t.apply(this,arguments),e.output=k.notifications,e.loading=!1,e.fields=[{key:"buttons",label:"",thStyle:{width:"100px"}},{key:"provenance",label:"Site",class:"text-center",tdAttr:D},{key:"loggin",label:"Identifiant",class:"text-center",tdAttr:D},{key:"password",label:"Mot de passe",class:"text-center",tdAttr:D},{key:"description",label:"Description",tdAttr:D}],e.showEditPassword=!1,e.currentPassword=null,e.asP=function(e){return e},e.C=k,e}return Object(c["a"])(r,[{key:"created",value:function(){this.refresh()}},{key:"refresh",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.loading=!0,e.next=3,k.getPasswords();case 3:this.loading=!1;case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"startCreatePassword",value:function(){this.currentPassword=null,this.showEditPassword=!0}},{key:"startUpdatePassword",value:function(e){this.currentPassword=e,this.showEditPassword=!0}},{key:"startDeletePassword",value:function(e){var t=this;this.$bvModal.msgBoxConfirm("Confirmer la suppression du mot de passe pour ".concat(e.provenance),{title:"Suppression",okVariant:"danger",cancelTitle:"Retour"}).then((function(r){r&&t.deletePassword(e)}))}},{key:"onDoneEdit",value:function(e,t){this.showEditPassword=!1,e?this.createPassword(t):this.updatePassword(t)}},{key:"createPassword",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.loading=!0,e.next=3,k.createPassword(t);case 3:this.loading=!1;case 4:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"updatePassword",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.loading=!0,e.next=3,k.updatePassword(t);case 3:this.loading=!1;case 4:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"deletePassword",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.loading=!0,e.next=3,k.deletePassword(t.id);case 3:this.loading=!1;case 4:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"passwords",get:function(){return Object.values(k.passwords).sort((function(e,t){return e.provenance.localeCompare(t.provenance)}))}}]),r}(n["default"]);N=d["a"]([Object(p["b"])({components:{BaseApp:f["a"],Success:b["a"],Error:h["a"],FormPassword:$}})],N);var J=N,T=J,q=(r("c1bd"),Object(S["a"])(T,s,a,!1,null,null,null)),z=q.exports;n["default"].config.productionTip=!1,new n["default"]({render:function(e){return e(z)}}).$mount("#app")},"6d70":function(e,t,r){},c1bd:function(e,t,r){"use strict";r("6d70")}});
     2  //# sourceMappingURL=passwords.008e7c0e.js.map