Files
DirectAdmin-1.62.4/update/data/skins/evolution/assets/pages/164.js
tuend-work 4478491d73 z
2025-11-13 07:41:56 +07:00

1 line
10 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[164],{1859:function(t,e,n){"use strict";n.r(e);var o=n(3967),r=n(2750);for(var a in r)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(a);var s=n(0),i=n(3738),l=n.n(i),u=Object(s.a)(r.default,o.a,o.b,!1,null,null,null);"function"==typeof l.a&&l()(u),e.default=u.exports},1989:function(t,e,n){"use strict";n.r(e),n.d(e,"getKeys",(function(){return v})),n.d(e,"createKey",(function(){return y})),n.d(e,"authorizeKeys",(function(){return h})),n.d(e,"deleteKeys",(function(){return b})),n.d(e,"deleteAuthorizedKeys",(function(){return _})),n.d(e,"pasteKey",(function(){return g})),n.d(e,"modifyKey",(function(){return O}));var o,r=n(78),a=n.n(r),s=n(9),i=n(97),l=n(47),u=function(){return(u=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};!function(t){t.VALUE="value",t.CHECKBOX="checkbox"}(o||(o={}));var p=s.pipe(s.prop("keysize"),i.toSelectData),c=function(t,e){return u(u({id:t},e),{timestamp:Object(i.toAppDate)(e.timestamp)})},f={getKeys:{users:function(t){return l.Maybe.Some(t).flatMap((function(t){return l.Maybe.fromNull(t.users)})).orSome([])},options:s.prop("key_options"),sizes:p,public:function(t){return s.toPairs(t.public_keys).map(s.apply(c))},authorized:function(t){return s.values(t.authorized_keys).map(function(t){return function(e){var n=l.Maybe.Some(e).flatMap((function(t){return l.Maybe.fromNull(t.options)})).map(s.defaultTo({})).map(s.values).map(s.reduce((function(t,e){var n,o=e.name,r=e.value;return u(u({},t),((n={})[o]=r,n))}),{})).orSome({}),o=l.Maybe.Some(t).flatMap((function(t){return l.Maybe.fromNull(t.global_keys)})).flatMap((function(t){return l.Maybe.fromNull(t[e.fingerprint])})),r=o.map((function(t){return t.who})).orSome("no"),a=o.flatMap((function(t){return l.Maybe.fromNull(t.users)})).map(s.toPairs).map(s.filter(s.pipe(s.nth(1),s.prop("enabled"),s.equals("yes")))).map(s.map(s.head)).orSome([]);return u(u({},e),{options:n,global:r,users:"except"===r?s.without(a,t.users||[]):a})}}(t))}}},d=function(){return(d=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},m="/CMD_SSH_KEYS",v=a.a.get({id:"SSH_KEYS",url:m,mapResponse:f.getKeys,schema:{enabled_users:a.a.OPTIONAL_BOOL,fingerprint:a.a.OPTIONAL_STRING}}),y=a.a.post({url:m,params:{action:"create",type:"rsa"},schema:{id:a.a.REQUIRED_STRING,comment:a.a.REQUIRED_STRING,keysize:a.a.REQUIRED_STRING,passwd:a.a.OPTIONAL_STRING,overwrite:a.a.REQUIRED_BOOL,authorize:a.a.REQUIRED_BOOL},before:function(t){return{passwd2:t.passwd}}}),h=a.a.select({url:m,params:{type:"public",authorize:!0}}),b=a.a.select({url:m,params:{type:"public",delete:!0}}),_=a.a.select({url:m,params:{type:"authorized_keys",delete:!0}}),g=a.a.post({url:m,params:{type:"paste",action:"authorize"},schema:{text:a.a.REQUIRED_STRING}}),O=a.a.post({url:"/CMD_SSH_KEYS",params:{action:"modify"},schema:{fingerprint:a.a.REQUIRED_STRING,comment:a.a.REQUIRED_STRING,options:{type:Object,required:!0,default:function(){return{}}},global:a.a.REQUIRED_BOOL,users:{type:Array,required:!0,default:function(){return[]}},who:a.a.OPTIONAL_STRING},before:function(t){var e=t.options,n=t.users,o=t.global;return d(d({},e),{global_key:o,select:n,options:null,global:null,users:null})}})},2750:function(t,e,n){"use strict";n.r(e);var o=n(2751),r=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e.default=r.a},2751:function(t,e,n){"use strict";n(23),n(25),n(6);var o=n(1),r=n(20);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=o(n(38)),s=o(n(2));n(57),n(16),n(14),n(18),n(26),n(34),n(68),n(5);var i=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=p(e);if(n&&n.has(t))return n.get(t);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var i=a?Object.getOwnPropertyDescriptor(t,s):null;i&&(i.get||i.set)?Object.defineProperty(o,s,i):o[s]=t[s]}o.default=t,n&&n.set(t,o);return o}(n(9)),l=n(1989),u=n(72);function p(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(p=function(t){return t?n:e})(t)}var c={preload:function(t){var e=t.fingerprint;return(0,l.getKeys)({fingerprint:e,enabled_users:!0})},api:[{command:l.getKeys,bind:"keys"}],props:{fingerprint:{type:String,required:!0,default:""}},data:function(){return{comment:"",options:[],global:!1,who:"all",users:[]}},computed:{showGlobal:function(){return"user"!==this.$state.app.user.level},key:function(){var t=this;return this.$api.keys.authorized.find((function(e){return e.fingerprint===t.fingerprint}))},isOptionDefined:function(){var t=this;return function(e){return!!t.options.find((function(t){return t.name===e.value}))}},possibleOptions:function(){return i.pipe(i.toPairs,i.map(i.zipObj(["value","type"])),i.filter(i.complement(this.isOptionDefined)))(this.$api.keys.options)},mergedOptions:function(){return(0,u.mergeTransduce)([(0,u.filterReducer)((function(t){return!1!==t.value})),(0,u.mapReducer)((function(t){return(0,s.default)({},t.name,t.value)}))],this.options)},requestData:function(){return{comment:this.comment,fingerprint:this.fingerprint,options:this.mergedOptions,global:this.global,users:this.users,who:this.who}}},created:function(){var t=this;this.comment=this.key.comment,this.options=Object.entries(this.key.options).map((function(e){var n=(0,a.default)(e,2),o=n[0];return{name:o,value:n[1],type:t.getOptionType(o)}})),this.global="no"!==this.key.global,this.global&&(this.who=this.key.global),this.users=this.key.users},methods:{addOption:function(t){this.options.push({type:t.type,name:t.value,value:"value"===t.type&&""})},getOptionType:function(t){return(this.possibleOptions.find((function(e){return e.value===t}))||{}).type||"value"},modifyKey:function(){(0,l.modifyKey)(this.requestData).then(this.removeEmptyOptions)},removeEmptyOptions:function(){this.options=this.options.filter((function(t){return t.value}))}}};e.default=c},3738:function(t,e){},3967:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return r}));var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("app-page",[n("app-page-section",[n("translate",{attrs:{slot:"section:title"},slot:"section:title"},[t._v("\n Key Data\n ")]),t._v(" "),n("ui-form-element",{attrs:{group:"editKey",validators:{required:!0}}},[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Comment\n ")]),t._v(" "),n("input-text",{attrs:{slot:"content"},slot:"content",model:{value:t.comment,callback:function(e){t.comment=e},expression:"comment"}})],1),t._v(" "),n("ui-form-element",[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Fingerprint\n ")]),t._v(" "),n("input-text",{attrs:{slot:"content",disabled:"",value:t.fingerprint},slot:"content"})],1),t._v(" "),n("ui-form-element",[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Type\n ")]),t._v(" "),n("input-text",{attrs:{slot:"content",disabled:"",value:t.key.type},slot:"content"})],1),t._v(" "),n("ui-form-element",{attrs:{underline:!1}},[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Size\n ")]),t._v(" "),n("input-text",{attrs:{slot:"content",disabled:"",value:t.key.keysize},slot:"content"})],1)],1),t._v(" "),n("app-page-section",[n("translate",{attrs:{slot:"section:title"},slot:"section:title"},[t._v("\n Key Options\n ")]),t._v(" "),t._l(t.options,(function(e){return n("ui-form-element",{key:e.name},[n("span",{attrs:{slot:"title"},slot:"title"},[t._v(t._s(e.name))]),t._v(" "),"value"===e.type?n("input-text",{attrs:{slot:"content"},slot:"content",model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"option.value"}}):"checkbox"===e.type?n("input-checkbox",{attrs:{slot:"content"},slot:"content",model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"option.value"}}):t._e()],1)})),t._v(" "),t.possibleOptions.length?n("ui-form-element",[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Add Option\n ")]),t._v(" "),n("input-select-legacy",{attrs:{slot:"content",options:t.possibleOptions},on:{change:function(e){return t.addOption(e)}},slot:"content"})],1):t._e(),t._v(" "),t.showGlobal?n("ui-form-element",{attrs:{underline:!1}},[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Global Key\n ")]),t._v(" "),n("input-checkbox",{attrs:{slot:"content"},slot:"content",model:{value:t.global,callback:function(e){t.global=e},expression:"global"}})],1):t._e()],2),t._v(" "),t.showGlobal&&t.global?n("app-page-section",[n("translate",{attrs:{slot:"section:title"},slot:"section:title"},[t._v("\n Global Key Options\n ")]),t._v(" "),n("ui-form-element",{attrs:{underline:!1}},[n("translate",{attrs:{slot:"title"},slot:"title"},[t._v("\n Apply To\n ")]),t._v(" "),n("ui-grid",{attrs:{slot:"content"},slot:"content"},[n("input-radio",{attrs:{value:"all"},model:{value:t.who,callback:function(e){t.who=e},expression:"who"}},[n("translate",[t._v("All Users")])],1),t._v(" "),n("input-radio",{attrs:{value:"except"},model:{value:t.who,callback:function(e){t.who=e},expression:"who"}},[n("translate",[t._v("All Users Except Selected Users")])],1),t._v(" "),n("input-radio",{attrs:{value:"selected"},model:{value:t.who,callback:function(e){t.who=e},expression:"who"}},[n("translate",[t._v("Selected Users")])],1)],1)],1),t._v(" "),n("transition",{attrs:{name:"fade"}},["all"!==t.who?n("ui-form-element",{attrs:{underline:!1}},[n("span",{attrs:{slot:"title"},slot:"title"},[t._v("Users")]),t._v(" "),n("input-select-multiple",{attrs:{slot:"content",options:t.$api.keys.users},slot:"content",model:{value:t.users,callback:function(e){t.users=e},expression:"users"}})],1):t._e()],1)],1):t._e(),t._v(" "),n("ui-button",{attrs:{slot:"footer:buttons",theme:"safe",size:"big","validate-group":"editKey"},on:{click:t.modifyKey},slot:"footer:buttons"},[n("translate",[t._v("Save")])],1)],1)},r=[]}}]);