예제 #1
0
        public AnthillaASModule()
            : base("/anthillaas")
        {
            this.RequiresAuthentication();

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

            Get["/unit/set/anthillaas"] = x => {
                CreateUnit.ForAnthillaAS();
                AnthillaAS.EnableAnthillaAS();
                return(Response.AsJson(true));
            };

            Get["/unit/set/anthillafirewall"] = x => {
                CreateUnit.ForAnthillaFirewall();
                AnthillaAS.EnableAnthillaFirewall();
                return(Response.AsJson(true));
            };

            Get["/unit/set/anthillastorage"] = x => {
                CreateUnit.ForAnthillaStorage();
                AnthillaAS.EnableAnthillaStorage();
                return(Response.AsJson(true));
            };

            Get["/unit/start/anthillaas"] = x => {
                CommandModel start = AnthillaAS.StartAnthillaAS();
                return(View["page-m-service-as", start]);
                //return Response.AsJson(start);
            };

            Get["/unit/start/anthillafirewall"] = x => {
                CommandModel start = AnthillaAS.StartAnthillaFirewall();
                return(View["page-m-service-as", start]);
                //return Response.AsJson(start);
            };

            Get["/unit/start/anthillastorage"] = x => {
                CommandModel start = AnthillaAS.StartAnthillaStorage();
                return(View["page-m-service-as", start]);
                //return Response.AsJson(start);
            };

            Get["/unit/stop/anthillaas"] = x => {
                CommandModel stop = AnthillaAS.StopAnthillaAS();
                return(View["page-m-service-as", stop]);
                //return Response.AsJson(stop);
            };

            Get["/unit/stop/anthillafirewall"] = x => {
                CommandModel stop = AnthillaAS.StopAnthillaFirewall();
                return(View["page-m-service-as", stop]);
                //return Response.AsJson(stop);
            };

            Get["/unit/stop/anthillastorage"] = x => {
                CommandModel stop = AnthillaAS.StopAnthillaStorage();
                return(View["page-m-service-as", stop]);
                //return Response.AsJson(stop);
            };

            Get["/unit/status/anthillaas"] = x => {
                CommandModel status = AnthillaAS.StatusAnthillaAS();
                return(View["page-m-service-as", status]);
                //return Response.AsJson(status);
            };

            Get["/unit/status/anthillafirewall"] = x => {
                CommandModel status = AnthillaAS.StatusAnthillaFirewall();
                return(View["page-m-service-as", status]);
                //return Response.AsJson(status);
            };

            Get["/unit/status/anthillastorage"] = x => {
                CommandModel status = AnthillaAS.StatusAnthillaStorage();
                return(View["page-m-service-as", status]);
                //return Response.AsJson(status);
            };
        }