2024-10-14 12:14:01 +03:00
|
|
|
package _VisualDVM.Passes.All;
|
2024-10-11 00:00:30 +03:00
|
|
|
import Common.Utils.Utils_;
|
2024-10-13 22:08:13 +03:00
|
|
|
import _VisualDVM.Global;
|
2024-10-14 15:19:13 +03:00
|
|
|
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
|
2024-10-20 17:27:58 +03:00
|
|
|
import _VisualDVM.Repository.BugReport.UI.BugReportInterface;
|
2024-10-09 22:21:57 +03:00
|
|
|
import _VisualDVM.Repository.BugReport.BugReportState;
|
|
|
|
|
import _VisualDVM.Repository.Server.ServerCode;
|
|
|
|
|
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
|
2023-09-17 22:13:42 +03:00
|
|
|
public class SendBugReport extends ComponentsRepositoryPass {
|
|
|
|
|
@Override
|
|
|
|
|
protected void ServerAction() throws Exception {
|
2024-10-13 22:08:13 +03:00
|
|
|
if (!Global.mainModule.getBugReport().project_version.isEmpty()) {
|
2023-09-17 22:13:42 +03:00
|
|
|
//отправить архив.
|
|
|
|
|
Command(new ServerExchangeUnit_2021(ServerCode.SendBugReport,
|
2024-10-13 22:08:13 +03:00
|
|
|
Global.mainModule.getBugReport().id,
|
|
|
|
|
Utils_.fileToBytes(BugReportInterface.getArchiveFile(Global.mainModule.getBugReport()))
|
2023-09-17 22:13:42 +03:00
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
// синхрон бд
|
2024-10-13 22:08:13 +03:00
|
|
|
Command(new ServerExchangeUnit_2021(ServerCode.PublishObject, "", Global.mainModule.getBugReport()));
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected void performFail() throws Exception {
|
2024-10-13 22:08:13 +03:00
|
|
|
Global.mainModule.getBugReport().state = BugReportState.draft;
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
}
|