Merge remote-tracking branch 'origin/feature/RefactoringGestioneColli' into feature/RefactoringGestioneColli
# Conflicts: # build/Jenkinsfile.groovy
This commit is contained in:
@@ -128,7 +128,8 @@ sleep 10''', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaul
|
||||
}
|
||||
|
||||
// bat "docker buildx build --platform linux/amd64,linux/arm64 --push -t \"git.studioml.it/integry/ems-api${branchVersion}:latest\" ."
|
||||
bat "podman build --platform linux/amd64,linux/arm64 ."
|
||||
bat "podman build -f .\\Containerfile -t \"git.studioml.it/integry/ems-api${branchVersion}:latest\" ."
|
||||
bat "podman push \"git.studioml.it/integry/ems-api${branchVersion}:latest\""
|
||||
|
||||
//containerImageLink "git.studioml.it/integry/ems-api-${env.GIT_BRANCH.toLowerCase().replace('/', '-')}:latest}"
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@ public class ImportDirectoryOperationDTO extends BaseDirectoryOperationDTO {
|
||||
@OperationField(required = true, password = true)
|
||||
private String password;
|
||||
|
||||
@OperationField()
|
||||
private boolean backupAfterImport;
|
||||
|
||||
@OperationField()
|
||||
private boolean deleteAfterImport;
|
||||
|
||||
@@ -75,6 +78,15 @@ public class ImportDirectoryOperationDTO extends BaseDirectoryOperationDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isBackupAfterImport() {
|
||||
return backupAfterImport;
|
||||
}
|
||||
|
||||
public ImportDirectoryOperationDTO setBackupAfterImport(boolean backupAfterImport) {
|
||||
this.backupAfterImport = backupAfterImport;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isDeleteAfterImport() {
|
||||
return deleteAfterImport;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,6 @@ public class SftpFolderDirectoryWatcher extends DirectoryWatcher {
|
||||
|
||||
@Override
|
||||
protected void start() throws Exception {
|
||||
|
||||
connect();
|
||||
|
||||
String baseDirectory = UtilityString.isNull(operationData.getDirectory(), "");
|
||||
@@ -117,7 +116,11 @@ public class SftpFolderDirectoryWatcher extends DirectoryWatcher {
|
||||
|
||||
HashMap<File, Boolean> results = directoryWatcherEvents.onStart(tempFiles);
|
||||
|
||||
if (operationData.isDeleteAfterImport() && !tempFiles.isEmpty()) {
|
||||
if (operationData.isBackupAfterImport() && !tempFiles.isEmpty()) {
|
||||
backupImportedFiles(results);
|
||||
}
|
||||
|
||||
if (!operationData.isBackupAfterImport() && operationData.isDeleteAfterImport() && !tempFiles.isEmpty()) {
|
||||
deleteImportedFiles(results);
|
||||
}
|
||||
|
||||
@@ -155,7 +158,11 @@ public class SftpFolderDirectoryWatcher extends DirectoryWatcher {
|
||||
prevImportedFiles.addAll(ls.stream().map(RemoteResourceInfo::getPath).collect(Collectors.toList()));
|
||||
|
||||
|
||||
if (operationData.isDeleteAfterImport()) {
|
||||
if (operationData.isBackupAfterImport()) {
|
||||
backupImportedFiles(importResult);
|
||||
}
|
||||
|
||||
if (operationData.isDeleteAfterImport() && !operationData.isBackupAfterImport()) {
|
||||
deleteImportedFiles(importResult);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -187,6 +194,30 @@ public class SftpFolderDirectoryWatcher extends DirectoryWatcher {
|
||||
return new File(tempFilePath);
|
||||
}
|
||||
|
||||
private void backupImportedFiles(HashMap<File, Boolean> results) throws Exception {
|
||||
final @NotNull List<String> toBeBackupped = results.entrySet().stream()
|
||||
.filter(Map.Entry::getValue)
|
||||
.map(Map.Entry::getKey)
|
||||
.map(File::getName)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
String baseDirectory = UtilityString.isNull(operationData.getDirectory(), "");
|
||||
String backupDirectory = Paths.get(UtilityString.isNull(operationData.getDirectory(), ""), "imported").toString();
|
||||
|
||||
connect();
|
||||
|
||||
for (String fileToBackup : toBeBackupped) {
|
||||
String oldPath = Paths.get(baseDirectory, fileToBackup).toString();
|
||||
String newPath = Paths.get(backupDirectory, fileToBackup).toString();
|
||||
|
||||
logger.debug(String.format("Sposto file importato da %s a %s", oldPath, newPath));
|
||||
sftpClient.rename(oldPath, newPath);
|
||||
}
|
||||
|
||||
disconnect();
|
||||
}
|
||||
|
||||
private void deleteImportedFiles(HashMap<File, Boolean> results) throws Exception {
|
||||
final @NotNull List<String> toBeDeleted = results.entrySet().stream()
|
||||
.filter(Map.Entry::getValue)
|
||||
@@ -200,7 +231,10 @@ public class SftpFolderDirectoryWatcher extends DirectoryWatcher {
|
||||
connect();
|
||||
|
||||
for (String fileToDelete : toBeDeleted) {
|
||||
sftpClient.rm(Paths.get(baseDirectory, fileToDelete).toString());
|
||||
|
||||
String oldPath = Paths.get(baseDirectory, fileToDelete).toString();
|
||||
logger.debug(String.format("Cancello file importato da %s", oldPath));
|
||||
sftpClient.rm(oldPath);
|
||||
}
|
||||
|
||||
disconnect();
|
||||
|
||||
@@ -1 +1 @@
|
||||
import{_ as R}from"./DynamicForm-CXexLuSl.js";import{_ as A,d as S,r as i,f as x,o as v,l as e,i as n,m as b,h as w,k as L,L as C,c as k,M as N,N as E,z as B,X as P,O as V,Q as D,R as F,S as $,J as j,T as z,u as I,a as d,b as T,w as W}from"./index-BNu-F4v_.js";const O=S({name:"SchedulerCreate",components:{DynamicForm:R,RiAddBoxLine:$,RiArrowRightSLine:F,RiErrorWarningLine:D,RiInformationLine:V,RiArrowLeftLine:P,RiAddLine:B,RiCheckLine:E},setup(){const t=j(),s=z(),o=I(),a=d(()=>t.params.type),l=T(!1);W(a,()=>m()),m();function m(){o.dispatch("scheduler/setCurrentCategory",a.value)}const p=d(()=>o.getters["scheduler/getCurrentCategory"]),u=d(()=>o.getters["main/isLoading"]),c=d(()=>o.getters["scheduler/getError"]),g=d(()=>({cronTrigger:"* * * * * *",active:!1,name:"",description:""}));async function f(r){await o.dispatch("scheduler/saveAutomation",{category:a.value,...r}),c.value||(o.dispatch("main/showNotification",{type:"success",message:"Pianificata creata con successo"}),await s.push({name:"scheduler.show",params:{type:a.value}}))}async function h(){l.value=!0;try{const r=document.querySelector("form");if(r){const y=new FormData(r),_=Object.fromEntries(y);await o.dispatch("scheduler/saveAutomation",{category:a.value,..._}),c.value||(o.dispatch("main/showNotification",{type:"success",message:"Pianificata creata con successo. Puoi crearne un'altra."}),window.location.reload())}}finally{l.value=!1}}return{type:a,currentCategory:p,defaultValues:g,onSubmit:f,onSaveAndCreateAnother:h,isLoading:u,isSavingAndCreating:l,error:c}}}),X={class:"view-container"},q={class:"view-card"},J={class:"card-header p-4 border-b border-gray-200"},M={class:"flex items-center justify-between"},Q={class:"flex items-center gap-3"},G={class:"text-sm text-gray-500 mt-1"},H={class:"flex items-center space-x-2 text-sm text-gray-500"},K={class:"card-body p-4 !overflow-auto"},U={key:0,class:"mb-6 p-4 bg-red-50 border border-red-200 rounded-lg flex items-start gap-3"},Y={class:"text-sm text-red-700 mt-1"},Z={class:"p-8"},ee={class:"flex items-center justify-between pt-6 border-t border-gray-200"},te=["disabled","onClick"],se={class:"flex items-center gap-3"},oe=["disabled"];function ne(t,s,o,a,l,m){const p=i("RiAddBoxLine"),u=i("RouterLink"),c=i("RiArrowRightSLine"),g=i("RiErrorWarningLine"),f=i("RiArrowLeftLine"),h=i("RiAddLine"),r=N,y=R;return v(),x("div",X,[e("div",q,[e("div",J,[e("div",M,[e("div",Q,[n(p,{class:"w-6 h-6 text-green-600"}),e("div",null,[s[0]||(s[0]=e("h1",{class:"text-xl font-semibold text-gray-900"}," Crea Nuova Pianificata ",-1)),e("p",G," Configura una nuova azione pianificata per "+b(t.type),1)])]),e("nav",H,[n(u,{to:{name:"scheduler.show",params:{type:t.type}},class:"hover:text-blue-600 transition-colors"},{default:w(()=>[L(" Pianificate "+b(t.type),1)]),_:1},8,["to"]),n(c,{class:"w-4 h-4"}),s[1]||(s[1]=e("span",{class:"text-gray-900"},"Crea Nuova",-1))])])]),e("div",K,[t.error?(v(),x("div",U,[n(g,{class:"w-5 h-5 text-red-600 mt-0.5 flex-shrink-0"}),e("div",null,[s[2]||(s[2]=e("h3",{class:"text-sm font-medium text-red-800"},"Errore durante la creazione",-1)),e("p",Y,b(t.error.message),1)])])):C("",!0),e("div",Z,[n(y,{fields:t.currentCategory,"initial-values":t.defaultValues,onSubmit:t.onSubmit,class:"space-y-6"},{default:w(()=>[e("div",ee,[n(u,{to:{name:"scheduler.show",params:{type:t.type}},custom:""},{default:w(({navigate:_})=>[e("button",{type:"button",class:"inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors",disabled:t.isLoading,onClick:_},[n(f,{class:"w-4 h-4 mr-2"}),s[3]||(s[3]=L(" Annulla ",-1))],8,te)]),_:1},8,["to"]),e("div",se,[e("button",{type:"submit",class:"inline-flex items-center px-4 py-2 text-sm font-medium text-green-700 bg-green-50 border border-green-200 rounded-lg hover:bg-green-100 focus:ring-2 focus:ring-green-500 transition-colors",disabled:t.isLoading},[n(h,{class:"w-4 h-4 mr-2"}),s[4]||(s[4]=L(" Crea Pianificata ",-1)),t.isLoading&&!t.isSavingAndCreating?(v(),k(r,{key:0,icon:"oval",color:"white",class:"w-4 h-4 ml-2"})):C("",!0)],8,oe)])])]),_:1},8,["fields","initial-values","onSubmit"])])])])])}const ie=A(O,[["render",ne]]);export{ie as default};
|
||||
import{_ as R}from"./DynamicForm-DWX-KwGX.js";import{_ as A,d as S,r as i,f as x,o as v,l as e,i as n,m as b,h as w,k as L,L as C,c as k,M as N,N as E,z as B,X as P,O as V,Q as D,R as F,S as $,J as j,T as z,u as I,a as d,b as T,w as W}from"./index-CjLz75tu.js";const O=S({name:"SchedulerCreate",components:{DynamicForm:R,RiAddBoxLine:$,RiArrowRightSLine:F,RiErrorWarningLine:D,RiInformationLine:V,RiArrowLeftLine:P,RiAddLine:B,RiCheckLine:E},setup(){const t=j(),s=z(),o=I(),a=d(()=>t.params.type),l=T(!1);W(a,()=>m()),m();function m(){o.dispatch("scheduler/setCurrentCategory",a.value)}const p=d(()=>o.getters["scheduler/getCurrentCategory"]),u=d(()=>o.getters["main/isLoading"]),c=d(()=>o.getters["scheduler/getError"]),g=d(()=>({cronTrigger:"* * * * * *",active:!1,name:"",description:""}));async function f(r){await o.dispatch("scheduler/saveAutomation",{category:a.value,...r}),c.value||(o.dispatch("main/showNotification",{type:"success",message:"Pianificata creata con successo"}),await s.push({name:"scheduler.show",params:{type:a.value}}))}async function h(){l.value=!0;try{const r=document.querySelector("form");if(r){const y=new FormData(r),_=Object.fromEntries(y);await o.dispatch("scheduler/saveAutomation",{category:a.value,..._}),c.value||(o.dispatch("main/showNotification",{type:"success",message:"Pianificata creata con successo. Puoi crearne un'altra."}),window.location.reload())}}finally{l.value=!1}}return{type:a,currentCategory:p,defaultValues:g,onSubmit:f,onSaveAndCreateAnother:h,isLoading:u,isSavingAndCreating:l,error:c}}}),X={class:"view-container"},q={class:"view-card"},J={class:"card-header p-4 border-b border-gray-200"},M={class:"flex items-center justify-between"},Q={class:"flex items-center gap-3"},G={class:"text-sm text-gray-500 mt-1"},H={class:"flex items-center space-x-2 text-sm text-gray-500"},K={class:"card-body p-4 !overflow-auto"},U={key:0,class:"mb-6 p-4 bg-red-50 border border-red-200 rounded-lg flex items-start gap-3"},Y={class:"text-sm text-red-700 mt-1"},Z={class:"p-8"},ee={class:"flex items-center justify-between pt-6 border-t border-gray-200"},te=["disabled","onClick"],se={class:"flex items-center gap-3"},oe=["disabled"];function ne(t,s,o,a,l,m){const p=i("RiAddBoxLine"),u=i("RouterLink"),c=i("RiArrowRightSLine"),g=i("RiErrorWarningLine"),f=i("RiArrowLeftLine"),h=i("RiAddLine"),r=N,y=R;return v(),x("div",X,[e("div",q,[e("div",J,[e("div",M,[e("div",Q,[n(p,{class:"w-6 h-6 text-green-600"}),e("div",null,[s[0]||(s[0]=e("h1",{class:"text-xl font-semibold text-gray-900"}," Crea Nuova Pianificata ",-1)),e("p",G," Configura una nuova azione pianificata per "+b(t.type),1)])]),e("nav",H,[n(u,{to:{name:"scheduler.show",params:{type:t.type}},class:"hover:text-blue-600 transition-colors"},{default:w(()=>[L(" Pianificate "+b(t.type),1)]),_:1},8,["to"]),n(c,{class:"w-4 h-4"}),s[1]||(s[1]=e("span",{class:"text-gray-900"},"Crea Nuova",-1))])])]),e("div",K,[t.error?(v(),x("div",U,[n(g,{class:"w-5 h-5 text-red-600 mt-0.5 flex-shrink-0"}),e("div",null,[s[2]||(s[2]=e("h3",{class:"text-sm font-medium text-red-800"},"Errore durante la creazione",-1)),e("p",Y,b(t.error.message),1)])])):C("",!0),e("div",Z,[n(y,{fields:t.currentCategory,"initial-values":t.defaultValues,onSubmit:t.onSubmit,class:"space-y-6"},{default:w(()=>[e("div",ee,[n(u,{to:{name:"scheduler.show",params:{type:t.type}},custom:""},{default:w(({navigate:_})=>[e("button",{type:"button",class:"inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors",disabled:t.isLoading,onClick:_},[n(f,{class:"w-4 h-4 mr-2"}),s[3]||(s[3]=L(" Annulla ",-1))],8,te)]),_:1},8,["to"]),e("div",se,[e("button",{type:"submit",class:"inline-flex items-center px-4 py-2 text-sm font-medium text-green-700 bg-green-50 border border-green-200 rounded-lg hover:bg-green-100 focus:ring-2 focus:ring-green-500 transition-colors",disabled:t.isLoading},[n(h,{class:"w-4 h-4 mr-2"}),s[4]||(s[4]=L(" Crea Pianificata ",-1)),t.isLoading&&!t.isSavingAndCreating?(v(),k(r,{key:0,icon:"oval",color:"white",class:"w-4 h-4 ml-2"})):C("",!0)],8,oe)])])]),_:1},8,["fields","initial-values","onSubmit"])])])])])}const ie=A(O,[["render",ne]]);export{ie as default};
|
||||
@@ -0,0 +1 @@
|
||||
.space-y-6[data-v-379ea0b4]>*+*{margin-top:1.5rem}.space-y-2[data-v-379ea0b4]>*+*{margin-top:.5rem}input[data-v-379ea0b4]:focus,textarea[data-v-379ea0b4]:focus,select[data-v-379ea0b4]:focus{outline:none;box-shadow:0 0 0 3px #3b82f61a}input[type=number][data-v-379ea0b4]{-webkit-appearance:textfield;appearance:textfield;-moz-appearance:textfield}input[type=number][data-v-379ea0b4]::-webkit-outer-spin-button,input[type=number][data-v-379ea0b4]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}textarea[data-v-379ea0b4]{min-height:2.5rem;max-height:12rem}
|
||||
@@ -1 +0,0 @@
|
||||
.space-y-6[data-v-4fa0371f]>*+*{margin-top:1.5rem}.space-y-2[data-v-4fa0371f]>*+*{margin-top:.5rem}input[data-v-4fa0371f]:focus,textarea[data-v-4fa0371f]:focus,select[data-v-4fa0371f]:focus{outline:none;box-shadow:0 0 0 3px #3b82f61a}input[type=number][data-v-4fa0371f]{-webkit-appearance:textfield;appearance:textfield;-moz-appearance:textfield}input[type=number][data-v-4fa0371f]::-webkit-outer-spin-button,input[type=number][data-v-4fa0371f]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}textarea[data-v-4fa0371f]{min-height:2.5rem;max-height:12rem}
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{_ as B}from"./DynamicForm-CXexLuSl.js";import{_ as V,d as P,r as d,f as A,o as w,l as t,i as o,L as S,m as l,h as f,k as E,E as F,c as $,M as j,N as W,U as J,X as T,Q as X,R as q,V as I,J as O,T as Q,u as U,a as n,b as x,w as k}from"./index-BNu-F4v_.js";const z=P({name:"SchedulerEdit",components:{DynamicForm:B,RiEditBoxLine:I,RiArrowRightSLine:q,RiErrorWarningLine:X,RiArrowLeftLine:T,RiSaveLine:J,RiCheckLine:W},setup(){const e=O(),i=Q(),s=U(),a=n(()=>e.params.type),h=n(()=>e.params.id),L=n(()=>e.name),g=n(()=>L.value==="scheduler.edit"),r=x(!1);k(a,()=>_()),k(h,()=>m()),_(),v(),m();async function v(){await s.dispatch("scheduler/fetchAutomations",a.value)}function _(){s.dispatch("scheduler/setCurrentCategory",a.value)}function m(){s.dispatch("scheduler/setCurrentAutomation",h.value)}const y=n(()=>s.getters["scheduler/getCurrentCategory"]),R=n(()=>s.getters["scheduler/getCurrentAutomation"]),c=x(R.value);c.value&&L.value==="scheduler.duplicate"&&(c.value.id=void 0);const b=n(()=>s.getters["main/isLoading"]),u=n(()=>s.getters["scheduler/getError"]);async function C(p){console.log("Submitting values:",p),await s.dispatch("scheduler/saveAutomation",{category:a.value,...p}),u.value||await i.push({name:"scheduler.show",params:{type:a.value}})}async function M(){if(g.value){r.value=!0;try{const p=document.querySelector("form");if(p){const D=new FormData(p),N=Object.fromEntries(D);await s.dispatch("scheduler/saveAutomation",{category:a.value,...c.value,...N}),u.value||(s.dispatch("main/showNotification",{type:"success",message:"Pianificata salvata con successo"}),await v(),m())}}finally{r.value=!1}}}return{type:a,id:h,isEditMode:g,currentCategory:y,currentAutomation:c,onSubmit:C,onSaveAndContinue:M,isLoading:b,isSavingAndContinuing:r,error:u}}}),G={class:"view-container"},H={class:"view-card"},K={class:"card-header p-4 border-b border-gray-200"},Y={class:"flex items-center justify-between"},Z={class:"flex items-center gap-3"},ee={class:"text-xl font-semibold text-gray-900"},te={key:0,class:"text-sm text-gray-500 mt-1"},se={class:"flex items-center space-x-2 text-sm text-gray-500"},oe={class:"text-gray-900"},ae={class:"card-body p-4 !overflow-auto"},ne={key:0,class:"mb-6 p-4 bg-red-50 border border-red-200 rounded-lg flex items-start gap-3"},ie={class:"text-sm text-red-700 mt-1"},re={class:"p-8"},ce={class:"flex items-center justify-between pt-6 border-t border-gray-200"},ue={class:"flex items-center gap-3"};function de(e,i,s,a,h,L){var u;const g=d("RiEditBoxLine"),r=d("RouterLink"),v=d("RiArrowRightSLine"),_=d("RiErrorWarningLine"),m=d("RiArrowLeftLine"),y=F,R=d("RiSaveLine"),c=j,b=B;return w(),A("div",G,[t("div",H,[t("div",K,[t("div",Y,[t("div",Z,[o(g,{class:"w-6 h-6 text-blue-600"}),t("div",null,[t("h1",ee,l(e.isEditMode?"Modifica Pianificata":"Duplica Pianificata"),1),(u=e.currentAutomation)!=null&&u.name?(w(),A("p",te,l(e.currentAutomation.name),1)):S("",!0)])]),t("nav",se,[o(r,{to:{name:"scheduler.show",params:{type:e.type}},class:"hover:text-blue-600 transition-colors"},{default:f(()=>[E(" Pianificate "+l(e.type),1)]),_:1},8,["to"]),o(v,{class:"w-4 h-4"}),t("span",oe,l(e.isEditMode?"Modifica":"Duplica"),1)])])]),t("div",ae,[e.error?(w(),A("div",ne,[o(_,{class:"w-5 h-5 text-red-600 mt-0.5 flex-shrink-0"}),t("div",null,[i[0]||(i[0]=t("h3",{class:"text-sm font-medium text-red-800"},"Errore durante il salvataggio",-1)),t("p",ie,l(e.error.message),1)])])):S("",!0),t("div",re,[o(b,{fields:e.currentCategory,"initial-values":e.currentAutomation,onSubmit:e.onSubmit,class:"space-y-6"},{default:f(()=>[t("div",ce,[o(r,{to:{name:"scheduler.show",params:{type:e.type}},custom:""},{default:f(({navigate:C})=>[o(y,{severity:"secondary",loading:e.isLoading,outlined:"",onClick:C},{default:f(()=>[o(m,{class:"w-4 h-4 mr-2"}),i[1]||(i[1]=E(" Annulla ",-1))]),_:2,__:[1]},1032,["loading","onClick"])]),_:1},8,["to"]),t("div",ue,[o(y,{type:"submit",severity:"primary",outlined:"",loading:e.isLoading},{default:f(()=>[o(R,{class:"w-4 h-4 mr-2"}),E(" "+l(e.isEditMode?"Salva Modifiche":"Crea Pianificata")+" ",1),e.isLoading&&!e.isSavingAndContinuing?(w(),$(c,{key:0,icon:"oval",color:"white",class:"w-4 h-4 ml-2"})):S("",!0)]),_:1},8,["loading"])])])]),_:1},8,["fields","initial-values","onSubmit"])])])])])}const pe=V(z,[["render",de]]);export{pe as default};
|
||||
import{_ as B}from"./DynamicForm-DWX-KwGX.js";import{_ as V,d as P,r as d,f as A,o as w,l as t,i as o,L as S,m as l,h as f,k as E,E as F,c as $,M as j,N as W,U as J,X as T,Q as X,R as q,V as I,J as O,T as Q,u as U,a as n,b as x,w as k}from"./index-CjLz75tu.js";const z=P({name:"SchedulerEdit",components:{DynamicForm:B,RiEditBoxLine:I,RiArrowRightSLine:q,RiErrorWarningLine:X,RiArrowLeftLine:T,RiSaveLine:J,RiCheckLine:W},setup(){const e=O(),i=Q(),s=U(),a=n(()=>e.params.type),h=n(()=>e.params.id),L=n(()=>e.name),g=n(()=>L.value==="scheduler.edit"),r=x(!1);k(a,()=>_()),k(h,()=>m()),_(),v(),m();async function v(){await s.dispatch("scheduler/fetchAutomations",a.value)}function _(){s.dispatch("scheduler/setCurrentCategory",a.value)}function m(){s.dispatch("scheduler/setCurrentAutomation",h.value)}const y=n(()=>s.getters["scheduler/getCurrentCategory"]),R=n(()=>s.getters["scheduler/getCurrentAutomation"]),c=x(R.value);c.value&&L.value==="scheduler.duplicate"&&(c.value.id=void 0);const b=n(()=>s.getters["main/isLoading"]),u=n(()=>s.getters["scheduler/getError"]);async function C(p){console.log("Submitting values:",p),await s.dispatch("scheduler/saveAutomation",{category:a.value,...p}),u.value||await i.push({name:"scheduler.show",params:{type:a.value}})}async function M(){if(g.value){r.value=!0;try{const p=document.querySelector("form");if(p){const D=new FormData(p),N=Object.fromEntries(D);await s.dispatch("scheduler/saveAutomation",{category:a.value,...c.value,...N}),u.value||(s.dispatch("main/showNotification",{type:"success",message:"Pianificata salvata con successo"}),await v(),m())}}finally{r.value=!1}}}return{type:a,id:h,isEditMode:g,currentCategory:y,currentAutomation:c,onSubmit:C,onSaveAndContinue:M,isLoading:b,isSavingAndContinuing:r,error:u}}}),G={class:"view-container"},H={class:"view-card"},K={class:"card-header p-4 border-b border-gray-200"},Y={class:"flex items-center justify-between"},Z={class:"flex items-center gap-3"},ee={class:"text-xl font-semibold text-gray-900"},te={key:0,class:"text-sm text-gray-500 mt-1"},se={class:"flex items-center space-x-2 text-sm text-gray-500"},oe={class:"text-gray-900"},ae={class:"card-body p-4 !overflow-auto"},ne={key:0,class:"mb-6 p-4 bg-red-50 border border-red-200 rounded-lg flex items-start gap-3"},ie={class:"text-sm text-red-700 mt-1"},re={class:"p-8"},ce={class:"flex items-center justify-between pt-6 border-t border-gray-200"},ue={class:"flex items-center gap-3"};function de(e,i,s,a,h,L){var u;const g=d("RiEditBoxLine"),r=d("RouterLink"),v=d("RiArrowRightSLine"),_=d("RiErrorWarningLine"),m=d("RiArrowLeftLine"),y=F,R=d("RiSaveLine"),c=j,b=B;return w(),A("div",G,[t("div",H,[t("div",K,[t("div",Y,[t("div",Z,[o(g,{class:"w-6 h-6 text-blue-600"}),t("div",null,[t("h1",ee,l(e.isEditMode?"Modifica Pianificata":"Duplica Pianificata"),1),(u=e.currentAutomation)!=null&&u.name?(w(),A("p",te,l(e.currentAutomation.name),1)):S("",!0)])]),t("nav",se,[o(r,{to:{name:"scheduler.show",params:{type:e.type}},class:"hover:text-blue-600 transition-colors"},{default:f(()=>[E(" Pianificate "+l(e.type),1)]),_:1},8,["to"]),o(v,{class:"w-4 h-4"}),t("span",oe,l(e.isEditMode?"Modifica":"Duplica"),1)])])]),t("div",ae,[e.error?(w(),A("div",ne,[o(_,{class:"w-5 h-5 text-red-600 mt-0.5 flex-shrink-0"}),t("div",null,[i[0]||(i[0]=t("h3",{class:"text-sm font-medium text-red-800"},"Errore durante il salvataggio",-1)),t("p",ie,l(e.error.message),1)])])):S("",!0),t("div",re,[o(b,{fields:e.currentCategory,"initial-values":e.currentAutomation,onSubmit:e.onSubmit,class:"space-y-6"},{default:f(()=>[t("div",ce,[o(r,{to:{name:"scheduler.show",params:{type:e.type}},custom:""},{default:f(({navigate:C})=>[o(y,{severity:"secondary",loading:e.isLoading,outlined:"",onClick:C},{default:f(()=>[o(m,{class:"w-4 h-4 mr-2"}),i[1]||(i[1]=E(" Annulla ",-1))]),_:2,__:[1]},1032,["loading","onClick"])]),_:1},8,["to"]),t("div",ue,[o(y,{type:"submit",severity:"primary",outlined:"",loading:e.isLoading},{default:f(()=>[o(R,{class:"w-4 h-4 mr-2"}),E(" "+l(e.isEditMode?"Salva Modifiche":"Crea Pianificata")+" ",1),e.isLoading&&!e.isSavingAndContinuing?(w(),$(c,{key:0,icon:"oval",color:"white",class:"w-4 h-4 ml-2"})):S("",!0)]),_:1},8,["loading"])])])]),_:1},8,["fields","initial-values","onSubmit"])])])])])}const pe=V(z,[["render",de]]);export{pe as default};
|
||||
@@ -1 +1 @@
|
||||
import{_ as s,d as n,r,c as i,o as u,u as d,a as p,w as l}from"./index-BNu-F4v_.js";const h=n({name:"SchedulerIndex",setup(){const e=d(),o=p(()=>e.getters["scheduler/getAutomationCategories"]);e.dispatch("scheduler/initStore"),l(()=>o.value,()=>{e.dispatch("main/clearMenuButton",{button:"Pianificate",child:!0}),Object.keys(o.value).forEach(t=>{e.dispatch("main/addMenuButton",{child:"Pianificate",button:{title:t,icon:"ActivityIcon",routeName:"scheduler.show",params:{type:t},child:[{routeName:"scheduler.create",params:{type:t}}]}})})})}});function m(e,o,a,t,_,f){const c=r("router-view");return u(),i(c)}const w=s(h,[["render",m]]);export{w as default};
|
||||
import{_ as s,d as n,r,c as i,o as u,u as d,a as p,w as l}from"./index-CjLz75tu.js";const h=n({name:"SchedulerIndex",setup(){const e=d(),o=p(()=>e.getters["scheduler/getAutomationCategories"]);e.dispatch("scheduler/initStore"),l(()=>o.value,()=>{e.dispatch("main/clearMenuButton",{button:"Pianificate",child:!0}),Object.keys(o.value).forEach(t=>{e.dispatch("main/addMenuButton",{child:"Pianificate",button:{title:t,icon:"ActivityIcon",routeName:"scheduler.show",params:{type:t},child:[{routeName:"scheduler.create",params:{type:t}}]}})})})}});function m(e,o,a,t,_,f){const c=r("router-view");return u(),i(c)}const w=s(h,[["render",m]]);export{w as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
ems-engine/src/main/webapp/assets/Show-fp2Rf64Q.js
Normal file
1
ems-engine/src/main/webapp/assets/Show-fp2Rf64Q.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
import{aI as a,aJ as r}from"./index-BNu-F4v_.js";a.register(...r);export{a as default};
|
||||
1
ems-engine/src/main/webapp/assets/auto-IuxBkHCG.js
Normal file
1
ems-engine/src/main/webapp/assets/auto-IuxBkHCG.js
Normal file
@@ -0,0 +1 @@
|
||||
import{aI as a,aJ as r}from"./index-CjLz75tu.js";a.register(...r);export{a as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,27 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>Servizi Integry</title>
|
||||
<link rel="icon"
|
||||
type="image/ico"
|
||||
href="./favicon.ico"
|
||||
/>
|
||||
<link
|
||||
rel="preload"
|
||||
href="./font/Inter-roman.var.woff2"
|
||||
as="font"
|
||||
type="font/woff2"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
<!-- <link rel="preload" href="/font/Inter-italic.var.woff2" as="font" type="font/woff2" crossorigin="anonymous"> -->
|
||||
<link rel="stylesheet" href="./font/inter.css"/>
|
||||
<script type="module" crossorigin src="./assets/index-BNu-F4v_.js"></script>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>Servizi Integry</title>
|
||||
<link rel="icon"
|
||||
type="image/ico"
|
||||
href="./favicon.ico"
|
||||
/>
|
||||
<link
|
||||
rel="preload"
|
||||
href="./font/Inter-roman.var.woff2"
|
||||
as="font"
|
||||
type="font/woff2"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
<!-- <link rel="preload" href="/font/Inter-italic.var.woff2" as="font" type="font/woff2" crossorigin="anonymous"> -->
|
||||
<link rel="stylesheet" href="./font/inter.css"/>
|
||||
<script type="module" crossorigin src="./assets/index-CjLz75tu.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-BLtKgaLe.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
</body>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user