Exemplo n.º 1
0
        public void Configuration(IAppBuilder app)
        {
            //write defaults and stuff
            Console.WriteLine(ConsoleTime.GetTime(DateTime.Now) + "setting default configuration...");
            SelfConfig.WriteDefaults();
            Console.WriteLine(ConsoleTime.GetTime(DateTime.Now) + "    set configuration for: antd...");
            SystemConfig.WriteDefaults();
            Console.WriteLine(ConsoleTime.GetTime(DateTime.Now) + "    set configuration for: system...");
            Cfg.LaunchDefaults();
            Console.WriteLine(ConsoleTime.GetTime(DateTime.Now) + "    set configuration for: cfg...");
            Network.LaunchDefaults();
            Console.WriteLine(ConsoleTime.GetTime(DateTime.Now) + "    set configuration for: network...");
            SystemDataRepo.LaunchDefaults();
            Console.WriteLine(ConsoleTime.GetTime(DateTime.Now) + "    set configuration for: systemDataRepo...");
            ZfsMount.LaunchDefaults();
            Console.WriteLine(ConsoleTime.GetTime(DateTime.Now) + "    set configuration for: zfsMount...");
            Command.Launch("chmod", "777 *.xml");
            Console.WriteLine(ConsoleTime.GetTime(DateTime.Now) + "    check configuration...");

            Console.WriteLine(ConsoleTime.GetTime(DateTime.Now) + "loading service configuration");
            var hubConfiguration = new HubConfiguration {
                EnableDetailedErrors = false
            };

            app.MapSignalR(hubConfiguration);
            Console.WriteLine(ConsoleTime.GetTime(DateTime.Now) + "    signalR -> loaded");
            bool errorTrace = false;

            StaticConfiguration.DisableErrorTraces = errorTrace;
            Console.WriteLine(ConsoleTime.GetTime(DateTime.Now) + "    disableerrortraces -> {0}", errorTrace);
            Database.Start();
            Console.WriteLine(ConsoleTime.GetTime(DateTime.Now) + "    denso-db -> loaded");
            app.UseNancy();
            Console.WriteLine(ConsoleTime.GetTime(DateTime.Now) + "    nancy-fx -> loaded");
        }
Exemplo n.º 2
0
        public SystemModule()
            : base("/sys")
        {
            this.RequiresAuthentication();

            Get["/"] = x => {
                return(View["page-m-system"]);
            };

            Get["/cfg"] = x => {
                CommandModel[] commands = Cfg.LaunchDefaults();
                return(View["page-m-system", commands]);
            };

            Get["/datarepo"] = x => {
                CommandModel[] commands = SystemDataRepo.LaunchDefaults();
                return(View["page-m-system", commands]);
            };

            Get["/network"] = x => {
                CommandModel[] commands = Network.LaunchDefaults();
                return(View["page-m-system", commands]);
            };

            Get["/anthillasp"] = x => {
                CommandModel[] commands = SetAnthillaSP.LaunchDefaults();
                return(View["page-m-system", commands]);
            };

            Get["/anthillaas"] = x => {
                CommandModel[] commands = SetAnthillaAS.LaunchDefaults();
                return(View["page-m-system", commands]);
            };

            Get["/zfsmount"] = x => {
                CommandModel[] commands = ZfsMount.LaunchDefaults();
                return(View["page-m-system", commands]);
            };
        }