Example #1
0
        private async Task RemoveDashboardAsync(V1NeonDashboard dashboard)
        {
            await SyncContext.Clear;

            Dashboards.Remove(
                Dashboards.Where(
                    d => d.Id == dashboard.Name())?.First());
        }
Example #2
0
        private async Task AddDashboardAsync(V1NeonDashboard dashboard)
        {
            await SyncContext.Clear;

            if (string.IsNullOrEmpty(dashboard.Spec.DisplayName))
            {
                dashboard.Spec.DisplayName = dashboard.Name();
            }

            Dashboards.Add(
                new Dashboard(
                    id:           dashboard.Name(),
                    name:         dashboard.Spec.DisplayName,
                    url:          dashboard.Spec.Url,
                    displayOrder: dashboard.Spec.DisplayOrder));
        }