1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[99],{1349:function(n,t,e){"use strict";e.r(t);var o=e(3043),a=e(1894);for(var r in a)"default"!==r&&function(n){e.d(t,n,(function(){return a[n]}))}(r);e(2691);var i=e(0),s=e(2693),l=e.n(s),u=Object(i.a)(a.default,o.a,o.b,!1,null,null,null);"function"==typeof l.a&&l()(u),t.default=u.exports},1894:function(n,t,e){"use strict";e.r(t);var o=e(1895),a=e.n(o);for(var r in o)"default"!==r&&function(n){e.d(t,n,(function(){return o[n]}))}(r);t.default=a.a},1895:function(n,t,e){"use strict";var o=e(10),a=e(1);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(e(2)),i=a(e(15)),s=a(e(16)),l=o(e(1896));function u(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,o)}return e}function c(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?u(Object(e),!0).forEach((function(t){(0,r.default)(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):u(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}var d,m,p,b={preload:function(){return l.getCronjobs()},api:[{command:l.getCronjobs,bind:"cronjobs"}],data:function(){return{checkedRows:[],editableRow:{},email:""}},computed:{checkedJobs:function(){return this.checkedRows.map((function(n){return n.id}))}},created:function(){this.email=this.$api.cronjobs.email},methods:{loadData:function(){l.getCronjobs()},deleteJobs:(p=(0,s.default)(i.default.mark((function n(){return i.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,l.deleteCronjobs({select:this.checkedJobs});case 2:n.sent&&(this.checkedRows=[],this.clearEditable(),this.loadData());case 4:case"end":return n.stop()}}),n,this)}))),function(){return p.apply(this,arguments)}),saveEmail:(m=(0,s.default)(i.default.mark((function n(){return i.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:l.saveEmail({email:this.email}),this.$dialog("SEND_TO_EMAIL").close();case 2:case"end":return n.stop()}}),n,this)}))),function(){return m.apply(this,arguments)}),setEditable:function(n){this.editableRow=c({},n),this.$dialog("EDIT_CRON_JOB").open()},clearEditable:function(){this.editableRow={},this.$dialog("EDIT_CRON_JOB").close()},updateJob:(d=(0,s.default)(i.default.mark((function n(){return i.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("@reboot"!==this.editableRow.minute){n.next=5;break}return n.next=3,l.updateCronjobReboot(this.editableRow);case 3:n.next=7;break;case 5:return n.next=7,l.updateCronjob(c({},this.editableRow,{dayofmonth:this.editableRow.day_of_month,dayofweek:this.editableRow.day_of_week}));case 7:this.clearEditable(),this.loadData();case 9:case"end":return n.stop()}}),n,this)}))),function(){return d.apply(this,arguments)})}};t.default=b},1896:function(n,t,e){"use strict";e.r(t),e.d(t,"getCronjobs",(function(){return s})),e.d(t,"deleteCronjobs",(function(){return l})),e.d(t,"createCronjob",(function(){return u})),e.d(t,"updateCronjobReboot",(function(){return d})),e.d(t,"updateCronjob",(function(){return m})),e.d(t,"saveEmail",(function(){return p})),e.d(t,"getPhpBinPath",(function(){return b}));var o=e(30),a=e.n(o),r=e(6),i="/CMD_CRON_JOBS",s=a.a.get({url:i,id:"CRON_JOBS",params:{ipp:"99999",page:"1"},mapResponse:{email:r.prop("MAILTO"),rows:r.pipe(r.prop("crons"),r.omit(["info"]),r.values)}}),l=a.a.select({url:i,params:{action:"delete",delete:!0}}),u=a.a.post({url:i,params:{action:"create"},schema:{reboot:a.a.REQUIRED_BOOL,minute:a.a.REQUIRED_STRING,hour:a.a.REQUIRED_STRING,dayofmonth:a.a.REQUIRED_STRING,month:a.a.REQUIRED_STRING,dayofweek:a.a.REQUIRED_STRING}}),c=a.a.post({url:i,params:{save:!0},schema:{id:a.a.REQUIRED_STRING,command:a.a.REQUIRED_STRING}}),d=c.extend({url:i,params:{reboot:!0}}),m=c.extend({url:i,schema:{minute:a.a.REQUIRED_STRING,hour:a.a.REQUIRED_STRING,dayofmonth:a.a.REQUIRED_STRING,month:a.a.REQUIRED_STRING,dayofweek:a.a.REQUIRED_STRING}}),p=a.a.post({url:i,params:{action:"saveemail"},schema:{email:a.a.REQUIRED_STRING}}),b=a.a.get({url:i,id:"CRON_PHP_BIN_PATH",response:!1,mapResponse:function(n){return"1"===n.set_php_bin_path_in_crons}})},1897:function(n,t,e){var o=e(2692);"string"==typeof o&&(o=[[n.i,o,""]]),o.locals&&(n.exports=o.locals);(0,e(5).default)("c73dd910",o,!0,{})},2691:function(n,t,e){"use strict";var o=e(1897);e.n(o).a},2692:function(n,t,e){(n.exports=e(4)(!0)).push([n.i,"html.vue-app .cronjobs .wrap{word-break:break-all}","",{version:3,sources:["/home/evo/evolution/src/js/pages/user/cronjobs/index.vue"],names:[],mappings:"AA8RA,6BACI,oBAAqB,CAAA",file:"index.vue?vue&type=style&index=0&lang=scss&",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nhtml.vue-app .cronjobs .wrap {\n word-break: break-all;\n}\n"],sourceRoot:""}])},2693:function(n,t){},3043:function(n,t,e){"use strict";var o=function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("app-page",[e("template",{slot:"header:buttons"},[e("ui-button-link",{attrs:{theme:"primary",name:"user/cronjobs/create"}},[e("translate",[n._v("Create Cron job")])],1)],1),n._v(" "),e("app-page-section",[e("ui-r-table",n._b({staticClass:"cronjobs",attrs:{rowsCount:n.$api.cronjobs.rows.length,checkedRows:n.checkedRows,columns:[{id:"minute",label:n.$gettext("Minute")},{id:"hour",label:n.$gettext("Hour")},{id:"day_of_month",label:n.$gettext("Day of Month")},{id:"month",label:n.$gettext("Month")},{id:"day_of_week",label:n.$gettext("Day of Week")},{id:"command",label:n.$gettext("Command"),grow:!0}],editable:!1,verticalLayout:n.$_Client.isPhone,disablePagination:""},on:{"update:checkedRows":function(t){n.checkedRows=t},"update:checked-rows":function(t){n.checkedRows=t}},scopedSlots:n._u([{key:"row:actions",fn:function(t){var o=t.item;return[e("ui-button-icon",{attrs:{icon:"pencil",title:n.$gettext("Edit")},on:{click:function(t){return n.setEditable(o)}}})]}},{key:"col:command",fn:function(t){var o=t.command;return[e("span",{staticClass:"wrap",domProps:{textContent:n._s(o)}})]}}])},"ui-r-table",n.$api.cronjobs,!1),[e("template",{slot:"table:actions"},[e("ui-table-action",{on:{click:function(t){n.$dialog("DELETE_ITEMS_DIALOG").open()}}},[e("translate",[n._v("Delete")])],1)],1)],2)],1),n._v(" "),e("template",{slot:"bottom:links"},[e("ui-link",{attrs:{bullet:""},on:{click:function(t){n.$dialog("SEND_TO_EMAIL").open()}}},[e("translate",[n._v("Send all Cron output to e-mail")])],1)],1),n._v(" "),e("ui-dialog-delete-items",{attrs:{subject:n.$ngettext("Cron job","Cron jobs",n.checkedJobs.length)},on:{"click:confirm":n.deleteJobs}}),n._v(" "),e("ui-dialog",{attrs:{id:"SEND_TO_EMAIL"}},[e("translate",{attrs:{slot:"title"},slot:"title"},[n._v("Set E-mail")]),n._v(" "),e("ui-form-element",{attrs:{slot:"content",vertical:""},slot:"content"},[e("translate",{attrs:{slot:"title"},slot:"title"},[n._v("E-mail")]),n._v(" "),e("translate",{attrs:{slot:"tooltip"},slot:"tooltip"},[n._v("\n Valid values are an E-mail address, your DA username: admin, or a blank field to prevent any e-mail.\n ")]),n._v(" "),e("input-text",{attrs:{slot:"content"},on:{keyup:function(t){return!t.type.indexOf("key")&&n._k(t.keyCode,"enter",13,t.key,"Enter")?null:n.saveEmail(t)}},slot:"content",model:{value:n.email,callback:function(t){n.email=t},expression:"email"}})],1),n._v(" "),e("ui-button",{attrs:{slot:"buttons",theme:"safe"},on:{click:n.saveEmail},slot:"buttons"},[e("translate",[n._v("Save")])],1)],1),n._v(" "),e("ui-dialog",{attrs:{id:"EDIT_CRON_JOB",theme:"safe",size:"normal"}},[e("translate",{attrs:{slot:"title"},slot:"title"},[n._v("Edit Cron Job")]),n._v(" "),e("template",{slot:"content"},["@reboot"!==n.editableRow.minute?[e("ui-form-element",{attrs:{vertical:"",group:"modifyCronJob",validators:{required:!0}}},[e("template",{slot:"title"},[e("translate",[n._v("\n Minute\n ")]),n._v(" "),e("ui-tooltip",[e("div",{directives:[{name:"flex",rawName:"v-flex",value:{dir:"column"},expression:"{ dir: 'column'}"}]},[e("translate",[n._v("Valid Cron time values are the numbers indicated and *.")]),n._v(" "),e("translate",[n._v("You can specify exact times using commas to separate them. e.g. 1,2,3 (minutes 1,2 and 3) ")]),n._v(" "),e("translate",[n._v("You can specify spans using a dash. e.g. 5-7 (minutes 5 to 7) ")]),n._v(" "),e("translate",[n._v("You can specify intervals using a star and a forward slash. e.g. */2 (every 2nd minute) ")]),n._v(" "),e("translate",[n._v("You can combine them to create a more precise schedule. e.g. 1,5,11-15,30-59/2 (minutes 1, 5, 11 to 15 and every 2nd minute between 30 and 59) ")]),n._v(" "),e("translate",[n._v("Note that there are no spaces ")])],1)])],1),n._v(" "),e("input-text",{attrs:{slot:"content"},slot:"content",model:{value:n.editableRow.minute,callback:function(t){n.$set(n.editableRow,"minute",t)},expression:"editableRow.minute"}}),n._v(" "),e("translate",{attrs:{slot:"error:between"},slot:"error:between"},[n._v("\n Minute should be a number between 0 and 59 or *\n ")])],2),n._v(" "),e("ui-form-element",{attrs:{vertical:"",group:"modifyCronJob",validators:{required:!0}}},[e("translate",{attrs:{slot:"title"},slot:"title"},[n._v("\n Hour\n ")]),n._v(" "),e("input-text",{attrs:{slot:"content"},slot:"content",model:{value:n.editableRow.hour,callback:function(t){n.$set(n.editableRow,"hour",t)},expression:"editableRow.hour"}}),n._v(" "),e("translate",{attrs:{slot:"error:between"},slot:"error:between"},[n._v("\n Hour should be a number between 0 and 23 or *\n ")])],1),n._v(" "),e("ui-form-element",{attrs:{vertical:"",group:"modifyCronJob",validators:{required:!0}}},[e("translate",{attrs:{slot:"title"},slot:"title"},[n._v("\n Day of Month\n ")]),n._v(" "),e("input-text",{attrs:{slot:"content"},slot:"content",model:{value:n.editableRow.day_of_month,callback:function(t){n.$set(n.editableRow,"day_of_month",t)},expression:"editableRow.day_of_month"}})],1),n._v(" "),e("ui-form-element",{attrs:{vertical:"",group:"modifyCronJob",validators:{required:!0}}},[e("translate",{attrs:{slot:"title"},slot:"title"},[n._v("\n Month\n ")]),n._v(" "),e("input-text",{attrs:{slot:"content"},slot:"content",model:{value:n.editableRow.month,callback:function(t){n.$set(n.editableRow,"month",t)},expression:"editableRow.month"}})],1),n._v(" "),e("ui-form-element",{attrs:{vertical:""}},[e("translate",{attrs:{slot:"title"},slot:"title"},[n._v("\n Day of Week\n ")]),n._v(" "),e("input-text",{attrs:{slot:"content"},slot:"content",model:{value:n.editableRow.day_of_week,callback:function(t){n.$set(n.editableRow,"day_of_week",t)},expression:"editableRow.day_of_week"}})],1)]:n._e(),n._v(" "),e("ui-form-element",{attrs:{vertical:""}},[e("translate",{attrs:{slot:"title"},slot:"title"},[n._v("\n Command\n ")]),n._v(" "),e("input-textarea",{attrs:{slot:"content",type:"text"},slot:"content",model:{value:n.editableRow.command,callback:function(t){n.$set(n.editableRow,"command",t)},expression:"editableRow.command"}})],1)],2),n._v(" "),e("ui-button",{attrs:{slot:"buttons",theme:"primary",validateGroup:"modifyCronJob"},on:{click:n.updateJob},slot:"buttons"},[e("translate",[n._v("Save")])],1)],2)],2)},a=[];e.d(t,"a",(function(){return o})),e.d(t,"b",(function(){return a}))}}]); |