diff --git a/src/Aiplugs.PoshApp/Services/Git/GitWorker.cs b/src/Aiplugs.PoshApp/Services/Git/GitWorker.cs index a944f64..0e4c9ba 100644 --- a/src/Aiplugs.PoshApp/Services/Git/GitWorker.cs +++ b/src/Aiplugs.PoshApp/Services/Git/GitWorker.cs @@ -90,13 +90,14 @@ public void Clone(CloneCommand cmd) CredentialsProvider = new LibGit2Sharp.Handlers.CredentialsHandler(GetCredential) }); } - catch(Exception) + catch (Exception ex) { - if (_credentials.ContainsKey(cmd.Origin)) { + if (_credentials.ContainsKey(cmd.Origin)) + { _credentials.Remove(cmd.Origin); } Client.SendAsync("GitCloneFaild", cmd.Name).Wait(); - throw; + throw ex; } Client.SendAsync("GitClone", cmd.Name).Wait(); diff --git a/src/Aiplugs.PoshApp/Services/ScriptsService.cs b/src/Aiplugs.PoshApp/Services/ScriptsService.cs index 504f81c..d36a941 100644 --- a/src/Aiplugs.PoshApp/Services/ScriptsService.cs +++ b/src/Aiplugs.PoshApp/Services/ScriptsService.cs @@ -16,7 +16,7 @@ public class ScriptsService [ScriptType.List] = "param(\n\t[int]\n\t$Page,\n\n\t[int]\n\t$PageSize\n)\n", [ScriptType.Detail] = "param(\n\t[Parameter(ValueFromPipeline=$true,Mandatory=$true)]\n\t[PSObject]\n\t$InputObject\n)\n", [ScriptType.Singleton] = "", - [ScriptType.Action] = "param(\n\t[Parameter(ValueFromPipeline=$true)]\n\t[PSObject[]]\n\t$InputObject\n)\nprocess {\n\n}" + [ScriptType.Action] = "param(\n\t[Parameter(ValueFromPipeline=$true)]\n\t[PSObject[]]\n\t$InputObject\n)\n" }; private readonly ConfigAccessor _configAccessor; private readonly LicenseService _license; diff --git a/src/Aiplugs.PoshApp/Views/Shared/App.cshtml b/src/Aiplugs.PoshApp/Views/Shared/App.cshtml index 60bd985..6e66509 100644 --- a/src/Aiplugs.PoshApp/Views/Shared/App.cshtml +++ b/src/Aiplugs.PoshApp/Views/Shared/App.cshtml @@ -51,14 +51,17 @@ \ No newline at end of file diff --git a/src/Aiplugs.PoshApp/Views/Shared/Components/UpdateNotice.cshtml b/src/Aiplugs.PoshApp/Views/Shared/Components/UpdateNotice.cshtml index e1f3aeb..19601a4 100644 --- a/src/Aiplugs.PoshApp/Views/Shared/Components/UpdateNotice.cshtml +++ b/src/Aiplugs.PoshApp/Views/Shared/Components/UpdateNotice.cshtml @@ -1,12 +1,12 @@  - \ No newline at end of file diff --git a/src/Aiplugs.PoshApp/Views/Shared/Pages/Parts/ParametersForm.cshtml b/src/Aiplugs.PoshApp/Views/Shared/Pages/Parts/ParametersForm.cshtml index e89dffd..bd1fb6a 100644 --- a/src/Aiplugs.PoshApp/Views/Shared/Pages/Parts/ParametersForm.cshtml +++ b/src/Aiplugs.PoshApp/Views/Shared/Pages/Parts/ParametersForm.cshtml @@ -3,7 +3,7 @@ p.name == 'Page'); - if (p) { - this.$set(p, 'value', value - 1); - } - }, - setPageSize(value) { - const p = this.parameters.find(p => p.name == 'PageSize'); - if (p) { - this.$set(p, 'value', value); - } - }, + ...Vuex.mapActions('signalr', ['invokeGetParameters']), isNumberType(type) { const numberTypes = ['System.Int32','System.Int64','System.Single','System.Double','System.Decimal']; return numberTypes.includes(type); @@ -145,37 +140,22 @@ }, getClixmls() { return this.parameters.reduce((o, p) => { - if (p.value !== undefined) { - o[p.name] = createCliXml(p.type, p.value); + if (this.value[p.name] !== undefined) { + o[p.name] = createCliXml(p.type, this.value[p.name]); } return o; }, {}); }, - getPageSize() { - const p = this.parameters.find(p => p.name == 'PageSize'); - return p ? parseInt(p.value) : null; - }, emitRun() { - this.$emit('run', this.getClixmls()); + this.$emit('run', { + value: this.getClixmls(), + page: this.value.Page - 0 + 1, + pageSize: this.value.PageSize - 0 + }); }, - getParameters() { - this.loadingParams = true; - this.$signalr.invoke('GetParameters', this.script); - } }, mounted() { - this.$signalr.on("GetParameters", parameters => { - this.parameters.splice(0, this.parameters.length, ...parameters); - this.setPage(this.page); - this.setPageSize(this.pageSize); - this.loadingParams = false; - }) - this.$signalr.onconnected(() => { - this.getParameters(); - }) - }, - beforeDestroy() { - this.$signalr.off('DetailResult') + this.invokeGetParameters({ scriptId: this.script }); } }) \ No newline at end of file diff --git a/src/Aiplugs.PoshApp/Views/Shared/Pages/Singleton.cshtml b/src/Aiplugs.PoshApp/Views/Shared/Pages/Singleton.cshtml index 324c6c3..454dce0 100644 --- a/src/Aiplugs.PoshApp/Views/Shared/Pages/Singleton.cshtml +++ b/src/Aiplugs.PoshApp/Views/Shared/Pages/Singleton.cshtml @@ -3,33 +3,37 @@
- + + - {{action.displayName || action.id}} + {{action.displayName || action.id}}
- +
mdi-xml - \ No newline at end of file diff --git a/src/Aiplugs.PoshApp/Views/Shared/PowershellUI/Log.cshtml b/src/Aiplugs.PoshApp/Views/Shared/PowershellUI/Log.cshtml index fe5ebe8..a834e24 100644 --- a/src/Aiplugs.PoshApp/Views/Shared/PowershellUI/Log.cshtml +++ b/src/Aiplugs.PoshApp/Views/Shared/PowershellUI/Log.cshtml @@ -11,7 +11,7 @@
-

             
@@ -25,16 +25,21 @@ \ No newline at end of file diff --git a/src/Aiplugs.PoshApp/Views/Shared/PowershellUI/LogForError.cshtml b/src/Aiplugs.PoshApp/Views/Shared/PowershellUI/LogForError.cshtml index 1b70bbd..d074fd3 100644 --- a/src/Aiplugs.PoshApp/Views/Shared/PowershellUI/LogForError.cshtml +++ b/src/Aiplugs.PoshApp/Views/Shared/PowershellUI/LogForError.cshtml @@ -1,14 +1,15 @@