From f8417e52cf4076cdea68cdb97d44d47fb729ed39 Mon Sep 17 00:00:00 2001 From: Jhonatan David Date: Mon, 8 May 2023 01:26:40 -0500 Subject: [PATCH] feat: pause watcher execution --- .github/workflows/ci.yaml | 2 - ConnectionInterface/ConnectionInterface.cs | 16 +-- ConnectionInterface/Watcher.cs | 8 ++ fsBuddyClient/Assets/Icons/power.png | Bin 0 -> 5800 bytes fsBuddyClient/Client.csproj | 2 + fsBuddyClient/View/Components/Navbar.xaml | 4 +- .../View/Components/WatcherList.xaml | 4 +- fsBuddyClient/ViewModel/Presenter.cs | 5 + fsBuddyConfiguration/ManagerConfiguration.cs | 15 +++ ...508053722_exec-modified-fields.Designer.cs | 102 ++++++++++++++++++ .../20230508053722_exec-modified-fields.cs | 41 +++++++ .../ConfigurationContextModelSnapshot.cs | 8 ++ fsBuddyService/FileSystemWatcher.cs | 8 +- fsBuddyService/PipeManager.cs | 43 ++++++++ fsBuddyService/WatcherManager.cs | 74 ++++++++----- 15 files changed, 294 insertions(+), 38 deletions(-) create mode 100644 fsBuddyClient/Assets/Icons/power.png create mode 100644 fsBuddyConfiguration/Migrations/20230508053722_exec-modified-fields.Designer.cs create mode 100644 fsBuddyConfiguration/Migrations/20230508053722_exec-modified-fields.cs diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5ebd75d..b7f8f3a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,8 +23,6 @@ jobs: dotnet-version: ${{ matrix.dotnet-version }} - name: Install dependencies run: dotnet restore - - name: Install tool dependencies - run: dotnet tool restore - name: Build run: dotnet build --configuration Release --no-restore - name: Test diff --git a/ConnectionInterface/ConnectionInterface.cs b/ConnectionInterface/ConnectionInterface.cs index 336c696..3bfa4e8 100644 --- a/ConnectionInterface/ConnectionInterface.cs +++ b/ConnectionInterface/ConnectionInterface.cs @@ -3,18 +3,21 @@ namespace ConnectionInterface { - public enum t_PipeCommand + public enum t_PipeCommand : int { GET_WATCHER = 0, GET_ALL_WATCHER = 1, CREATE_WATCHER = 2, UPDATE_WATCHER = 3, DELETE_WATCHER = 4, - GET_SERVICESETTING = 5, - GET_ALL_SERVICESETTING = 6, - CREATE_SERVICESETTING = 7, - UPDATE_SERVICESETTING = 8, - DELETE_SERVICESETTING = 9, + PAUSE_WATCHER = 5, + START_WATCHER = 6, + GET_SERVICESETTING = 7, + GET_ALL_SERVICESETTING = 8, + CREATE_SERVICESETTING = 9, + UPDATE_SERVICESETTING = 10, + DELETE_SERVICESETTING = 11, + GET_WATCHER_STATUS = 12, } public enum t_ResponseStatus { @@ -39,6 +42,7 @@ public class PipeResponsePayload { public string? ErrorMessage { get; set; } public List? Watchers { get; set; } + public bool? WatcherStatus { get; set; } } public class PipeResponse diff --git a/ConnectionInterface/Watcher.cs b/ConnectionInterface/Watcher.cs index 1ab9cf6..7418ab6 100644 --- a/ConnectionInterface/Watcher.cs +++ b/ConnectionInterface/Watcher.cs @@ -37,6 +37,14 @@ public class Watcher [Column(name: "created_at")] public DateTime CreatedAt { get; set; } + [Required] + [Column(name: "executed_at")] + public DateTime ExecutedAt { get; set; } + + [Required] + [Column(name: "modified_files")] + public int ModifiedFiles { get; set; } + [Required] [StringLength(256)] diff --git a/fsBuddyClient/Assets/Icons/power.png b/fsBuddyClient/Assets/Icons/power.png new file mode 100644 index 0000000000000000000000000000000000000000..346293436bc94d359ae898636486e6d9f60f8952 GIT binary patch literal 5800 zcmeHLX;@QPn*MGG1OyBLmmo_J7fKsh+<;ObIw&eGsMQ6yC6)z9fds_{gi3O0r?D&} zP}+b3ik4-tIt*e_%5H9zWl(_uL=npx^*r74%)jpG`jO|p=gW8A zZ#(Cn@1FC4yZz1QESduV=G(XV?E|18XaL4W=&_Hf+>IV4G22370ZgrCei&ruvXKyr z-RHj<3jfo#4-M$yn|5sixR++CJ8B59zCwCS_pEm&B%h|$nz%W+d8AibCofrU;e^}VuxTicd2;+%oixYoPR)4SjvJZN zw|rL1R*z2U7nCmhF1q#T_~>1a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3kjnq5`%k|DVHtx|YTCG;hz+h(I>A&Jzo+z9yJ_ zHr~%$FT9&Eg%dsLC78FG)#0E6J6*3+qp;G9C6d8YDP0cmNU6An;?xYq49H&xh)bZ(*!?(6kS)78yp}GDQ-Nbi}!;8w9wti4ND;o zZHY1om1=?`yIgyfFVOhLevtl1!~Az(f1Sjf3}|{`+~NvNpX(TYV0PXZq%|6*1lWsM zurp1~alqXC9O24bm2V)8kBZ|aQiusUk$xU^f)a`_!Eah&goaJAEZ~>}4OhF7OBRCy zCHPUe&fgCth%lu_lZFUwSYU<-7h`T)9f6Gq_tE$Teo&O85dT6at{}pA3H8JTzlR7X ztSJ)<*pCPY-ASv(AVq}wH6+Tm6zxSlk}U!0RyuSb*;0^hLkP*1ffOyc93)!~(w%hZ zN5~1JyXhcXLt=C;jRns2nsXMg!VhBBsW^VHl!XzGC1N&~j>ufskjZqeBMWr3nsb)$ zy&v#(w@mQQ9pRES6+?5lW{mqOI2f0Or9alh?tlhMES=DdB6sWkW)|pMGmHp99zM~G zT4F>ElATw-Jw(Gt&%+hG_vF>Q$`d-T`U2w2dk@LqgqYzB8>O~6)RmG{s$V~d~GW+ zkh8Bh$*{#;RiC)gJiWO&e}1#TbKHhm^lys1aW9N76epd&m0K%6WeF90U8@B6Xm`aC znqn`E==FoBZ`AoVG(7q%XrZb0#G`Dou!be7JtYWPqH7w}o=HR--7E+kz3gh*a9gX$ rEBsq`a=$e+|8flt?XSOGD5H_`A%|y+mA2?&8MbfP?N_*&|HuCVCc+Ra literal 0 HcmV?d00001 diff --git a/fsBuddyClient/Client.csproj b/fsBuddyClient/Client.csproj index a40be3f..b77b541 100644 --- a/fsBuddyClient/Client.csproj +++ b/fsBuddyClient/Client.csproj @@ -13,6 +13,7 @@ + @@ -37,6 +38,7 @@ + diff --git a/fsBuddyClient/View/Components/Navbar.xaml b/fsBuddyClient/View/Components/Navbar.xaml index b367c14..12af9c1 100644 --- a/fsBuddyClient/View/Components/Navbar.xaml +++ b/fsBuddyClient/View/Components/Navbar.xaml @@ -187,7 +187,7 @@ -