public TestRunController(IWebHostEnvironment env, AppsData data, OpenQA.Selenium.Chrome.ChromeDriver driver, AppsContext ctx)
 {
     _env    = env;
     _db     = data.AppsDB;
     _data   = data;
     _driver = driver;
     _ctx    = ctx;
 }
Esempio n. 2
0
 void AppStartup(object sender, StartupEventArgs args)
 {
     Settings = new Settings();
     AppsData = new AppsData(Settings);
     AppInfos = new ObservableCollection <AppInfo>();
     Settings.LoadFilterData();
     Settings.RefreshFilters();
     //MainWindow mainWindow = new MainWindow();
     //mainWindow.Show();
     // AutoFix
     WndPolling    = new WndPolling();
     WndCreateHook = new WndCreateHook();
 }
        public static void RegisterClient(AppsData data, LiteDB.LiteDatabase appsDb, AppsClient.AppsClientConfig config, ref AppsClient.AppsResult result)
        {
            var objs = appsDb.GetCollection <App>("Apps");
            var apps = objs.Query().Where(a => a.MachineName == config.MachineName && a.WorkingFolder == config.WorkingDirectory);
            App app  = null;

            if (apps.Count() == 0)
            {
                app = new App()
                {
                    Created       = DateTime.Now,
                    MachineName   = config.MachineName,
                    WorkingFolder = config.WorkingDirectory,
                    Updated       = DateTime.Now,
                    IsEnabled     = true,
                    LocalHostPort = config.LocalHostPort
                };

                objs.Insert(app);
            }
            else if (apps.Count() == 1)
            {
                app               = apps.Single();
                app.Updated       = DateTime.Now;
                app.LocalHostPort = config.LocalHostPort;
                objs.Upsert(app);
            }
            else
            {
                new AppFlows.Helpers.AppsSystem.Fail("Found more than one matching app for incoming config: " + apps.Count().ToString(), ref result);
            }

            var client = new Client(app, ref result);

            AppsHelper.UpdateAppSoftwareFilesAndCodes(client, config, ref result);
        }
 public AppsController(IWebHostEnvironment env, AppsData data, AppsContext ctx)
 {
     _env = env;
     _db  = data.AppsDB;
     _ctx = ctx;
 }
Esempio n. 5
0
        //static IHubCallerClients Clients;

        public AppsHub(AppsData data)
        {
            //  _context = context;
            AppsDB = data.AppsDB;
            _data  = data;
        }
Esempio n. 6
0
 public PublishController(IWebHostEnvironment env, AppsData data)
 {
     _env  = env;
     _data = data;
     _db   = data.AppsDB;
 }
Esempio n. 7
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AppsData appsdb)
        {
            //app.UseCors(MyAllowSpecificOrigins);

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseDefaultFiles(new DefaultFilesOptions { DefaultFileNames = new List<string> { "index.html" } });

            app.UseStaticFiles();

            //app.UseHangfireDashboard();
            
            app.UseHttpsRedirection();

            app.UseRouting();

            //app.UseAuthentication();

            //app.UseAuthorization();

            //app.addj.AddJsonOptions(options =>
            // {
            //     options.SerializerSettings.Formatting = Newtonsoft.Json.Formatting.Indented;
            //     options.SerializerSettings.ContractResolver = new DefaultContractResolver();
            // });
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
                endpoints.MapHub<AppsHub>("/appsHub");
            });

            //app.UseIdentityServer();
            //app.UseOcelot().Wait(); //Must go after id server

            AppsLog.Load("Apps"); //already done with config registration
            var hub = new AppsHub(appsdb);
            hub.Load();
            FlowsData.Load();

            //AppsHub.TestProgress("hiya");
            //var aTimer = new System.Timers.Timer(5000);
            //// Hook up the Elapsed event for the timer. 
            //aTimer.Elapsed += ATimer_Elapsed; ;
            //aTimer.AutoReset = true;
            //aTimer.Enabled = true;

            //AppsDB = appsdb.AppsDB;
            //FlowsDB = flowsdb.FlowsDB;
            //var solutionDirectory = @"D:\Work\Brooksoft\AppsJS\AppsJSDemo\AppsJSDemo\AppsJSDemo.sln";
            //var projectFilePath = @"D:\Work\Brooksoft\AppsJS\AppsJSDemo\AppsJSDemo\AppsJSDemo.csproj";

            //var globalProperties = new Dictionary<string, string> {
            //    { "DesignTimeBuild", "true" },
            //    { "BuildProjectReferences", "false" },
            //    { "_ResolveReferenceDependencies", "false" },
            //    { "SolutionDir", solutionDirectory + System.IO.Path.DirectorySeparatorChar }
            //};

            //var collection = new Microsoft.Build.Evaluation.ProjectCollection();
            //Microsoft.Build.Evaluation.Project project = collection.LoadProject(projectFilePath);

            //Run();

            //hangfireJobs.Enqueue(() => Console.WriteLine("Hello world from Hangfire!"));
            AppsLog.LogInfo("Finished configure.");
        }
Esempio n. 8
0
 public CreateController(IWebHostEnvironment env, AppsData data)
 {
     _env = env;
     _db  = data.AppsDB;
 }
 public AppComponentController(IWebHostEnvironment env, AppsData data)
 {
     _env = env;
     _db  = data.AppsDB;
 }
Esempio n. 10
0
 public DevelopController(IWebHostEnvironment env, AppsData data)
 {
     _env  = env;
     _db   = data.AppsDB;
     _data = data;
 }