Exemplo n.º 1
0
        public override void Loaded(IPluginProvider pluginProvider)
        {
            _auth           = pluginProvider.Get <AuthPlugin>();
            _auth.LoggedIn += OnLoggedIn;

            database = pluginProvider.Get <CockroachDbPlugin>();
        }
Exemplo n.º 2
0
        public override void Loaded(IPluginProvider pluginProvider)
        {
            //Setup auth dependencies
            var auth = pluginProvider.Get <AuthPlugin>();

            if (UseAuthModule && auth != null)
            {
                auth.LoggedIn  += OnUserLoggedIn;
                auth.LoggedOut += OnUserLoggedOut;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        ///   Executes the specified data query.
        /// </summary>
        /// <param name="dataQuery">The data query.</param>
        /// <returns>The result of execution.</returns>
        public PluginDto[] Execute([NotNull] GetPluginsByProjectQuery dataQuery)
        {
            if (dataQuery == null)
            {
                throw new ArgumentNullException(nameof(dataQuery));
            }

            return(_pluginsProvider.Get(_ =>
                                        _.Projects.Any(p => p.Id == dataQuery.ProjectId && p.ItPluginId == _.Id) ||
                                        _.Projects1.Any(p => p.Id == dataQuery.ProjectId && p.VcsPluginId == _.Id))
                   .Select(new PluginRenderer().GetSpec())
                   .ToArray());
        }
        /// <summary>
        ///   Executes the specified data query.
        /// </summary>
        /// <param name="dataQuery">The data query.</param>
        /// <returns>The result of execution.</returns>
        public PluginDto Execute([NotNull] GetPluginByIdQuery dataQuery)
        {
            if (dataQuery == null)
            {
                throw new ArgumentNullException(nameof(dataQuery));
            }

            var plugin = _pluginProvider.Get(_ => _.Id == dataQuery.PluginId)
                         .Select(new PluginRenderer().GetSpec())
                         .SingleOrDefault();

            return(plugin);
        }
Exemplo n.º 5
0
        public override void Loaded(IPluginProvider pluginProvider)
        {
            base.Loaded(pluginProvider);

            _roomPlugin = pluginProvider.Get <RoomPlugin>();
        }
 /// <summary>
 ///   Executes the specified data query.
 /// </summary>
 /// <param name="dataQuery">The data query.</param>
 /// <returns>The result of execution.</returns>
 public PluginDto[] Execute(GetPluginsByTypeQuery dataQuery) =>
 _pluginProvider.Get(_ => _.Type == (int)dataQuery.PluginType)
 .Select(new PluginRenderer().GetSpec())
 .ToArray();
Exemplo n.º 7
0
        /// <summary>
        ///   Executes the specified data query.
        /// </summary>
        /// <param name="dataQuery">The data query.</param>
        /// <returns>The result of execution.</returns>
        public SettingsDto Execute(GetSystemSettingsQuery dataQuery)
        {
            if (!_userAuthorityValidator.HasUserAuthorities(
                    _userPrincipal.Info.Id,
                    new[] { Authorities.UI.Administration.View },
                    null))
            {
                throw new UnauthorizedAccessException();
            }

            var mailConnectionParameters = _mailConnectionParametersProvider.TryGet();

            var settings = new SettingsDto
            {
                ActiveDirectorySettings = new ActiveDirectorySettingsDto
                {
                    RootGroupPath =
                        _configurationProvider.GetValue(ConfigurationKeys.AppSettings.ActiveDirectoryRootGroup)
                },
                DatabaseSettings = new DatabaseSettingsDto
                {
                    ConnectionString = _configManager.GetConnectionString()
                },
                FileStorageSettings = new FileStorageSettingsDto
                {
                    TempDirPath = _configurationProvider.GetValue(ConfigurationKeys.AppSettings.TempDirPath)
                },
                ScanAgentSettings = new ScanAgentSettingsDto
                {
                    ScanAgents = new TableRenderer().Render(
                        _scanAgentRepository.Query()
                        .Select(_ => new QueryResultItem
                    {
                        EntityId = _.Id,
                        Value    = new
                        {
                            _.Uid,
                            _.Machine,
                            Version = _.AssemblyVersion
                        }
                    }))
                },
                PluginSettings = new PluginSettingsDto
                {
                    Plugins = new TableRenderer().Render(
                        _pluginProvider.Get(_ => true)
                        .Select(_ => new QueryResultItem
                    {
                        EntityId = _.Id,
                        Value    = new
                        {
                            Name = _.DisplayName,
                            Type = ((PluginType)_.Type).ToString()
                        }
                    }))
                },
                NotificationSettings = new NotificationSettingsDto
                {
                    MailServerHost = mailConnectionParameters.Host,
                    IsSslEnabled   = mailConnectionParameters.IsSslEnabled,
                    MailBox        = mailConnectionParameters.Mailbox,
                    MainServerPort = mailConnectionParameters.Port,
                    Password       = mailConnectionParameters.Password,
                    UserName       = mailConnectionParameters.Username
                }
            };

            return(settings);
        }
Exemplo n.º 8
0
 public override void Loaded(IPluginProvider pluginProvider)
 {
     AddProvider(pluginProvider.Get <RoomsPlugin>());
     AddProvider(pluginProvider.Get <LobbiesPlugin>());
 }
Exemplo n.º 9
0
 public override void Loaded(IPluginProvider pluginProvider)
 {
     _database = pluginProvider.Get <CockroachDbPlugin>();
     _mailer   = pluginProvider.Get <MailPlugin>();
 }
Exemplo n.º 10
0
 public override void Loaded(IPluginProvider pluginProvider)
 {
     // Get dependencies
     SpawnersPlugin = pluginProvider.Get <SpawnersPlugin>();
     RoomsPlugin    = pluginProvider.Get <RoomsPlugin>();
 }