Exemplo n.º 1
0
        private async Task DeleteLogStreamSettingsAsync(GeneralLogStreamSettingsViewModel generalLogStreamSettings)
        {
            try
            {
                var logStreams = new LogStreams {
                    LogStreamSettings = new List <LogStreamSettings>()
                };
                var logStreamSettingsSavelist = new List <LogStreamSettings>();
                foreach (var ls in logSreamSettingsList)
                {
                    if (ls != generalLogStreamSettings)
                    {
                        logStreams.LogStreamSettings.Add(ls.LogStreamSettings);
                    }
                }
                await TrackService.SaveTrackLogStreamSettingsAsync(logStreams);

                logSreamSettingsList.Remove(generalLogStreamSettings);
            }
            catch (TokenUnavailableException)
            {
                await(OpenidConnectPkce as TenantOpenidConnectPkce).TenantLoginAsync();
            }
            catch (Exception ex)
            {
                generalLogStreamSettings.Form.SetError(ex.Message);
            }
        }
Exemplo n.º 2
0
        private async Task OnEditLogStreamSettingsValidSubmitAsync(GeneralLogStreamSettingsViewModel generalLogStreamSettings, EditContext editContext)
        {
            var logStreams = new LogStreams {
                LogStreamSettings = new List <LogStreamSettings>()
            };
            GeneralLogStreamSettingsViewModel updatedgeneralLogStreamSettings = null;

            foreach (var ls in logSreamSettingsList)
            {
                if (ls == generalLogStreamSettings)
                {
                    logStreams.LogStreamSettings.Add(generalLogStreamSettings.Form.Model);
                    updatedgeneralLogStreamSettings = ls;
                }
                else
                {
                    logStreams.LogStreamSettings.Add(ls.LogStreamSettings);
                }
            }
            await TrackService.SaveTrackLogStreamSettingsAsync(logStreams);

            updatedgeneralLogStreamSettings.LogStreamSettings = generalLogStreamSettings.Form.Model;
            if (generalLogStreamSettings.CreateMode)
            {
                toastService.ShowSuccess("Log stream settings created.", "SUCCESS");
            }
            else
            {
                toastService.ShowSuccess("Log stream settings updated.", "SUCCESS");
            }
            generalLogStreamSettings.Edit = false;
        }
Exemplo n.º 3
0
 public async Task SaveTrackLogStreamSettingsAsync(LogStreams logStreams) => await PostAsync(logStreamsSettingsApiUri, logStreams);