~camicrisystems/cube-server/v4

« back to all changes in this revision

Viewing changes to data/cube-system/data/server/html/startup.html

  • Committer: Jake R. Capangpangan
  • Date: 2015-04-12 03:13:33 UTC
  • Revision ID: camicrisystems@gmail.com-20150412031333-h3vhvnt0g28gk3u2
Added cube-server essential data files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html>
 
2
<html lang="en">
 
3
  <head>
 
4
    <meta charset="utf-8">
 
5
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
 
6
    <meta name="viewport" content="width=device-width, initial-scale=1">
 
7
    <title>Startup</title>
 
8
    <link href="/assets/css/bootstrap.min.css" rel="stylesheet">    
 
9
  </head>
 
10
  <body>        
 
11
        <div class="well"><img src="images/cubelogo.png" height="48" width="48"/>Camicri Cube 2.0</div>
 
12
        
 
13
        <div class="container">
 
14
                <div class="row" id="notify-pnl">
 
15
                </div>                  
 
16
                        <div class="col-md-8 col-md-offset-2">                          
 
17
                                <div class="panel panel-default">
 
18
                                        <div class="panel-heading text-center"></div>
 
19
                                                <div class="panel-body">
 
20
                                                        <p></p>                                 
 
21
                                                        <div class="row">
 
22
                                                                <div class="col-md-3">                                          
 
23
                                                                        <h5>Select a project</h5>
 
24
                                                                </div>
 
25
                                                                <div class="col-md-5">
 
26
                                                                        <select id="project-cbo" class="form-control col-md-12">
 
27
                                                                        </select>
 
28
                                                                </div>
 
29
                                                                <button id="open-project-btn" class="col-md-3 btn btn-default">Open Project</button>            
 
30
                                                        </div>
 
31
                                                        <p></p>
 
32
                                                        <p class="text-center">or</p>
 
33
                                                        <div class="row">
 
34
                                                                <div class="col-md-3">
 
35
                                                                        <h5>Create a project</h5>
 
36
                                                                </div>
 
37
                                                        <div class="col-md-5">
 
38
                                                                <input id="create-project-in" type="text" class="col-md-12 form-control"/>
 
39
                                                        </div>          
 
40
                                                        <button id="create-project-btn" class="col-md-3 btn btn-default">Create Project</button>
 
41
                                                </div>                                          
 
42
                                        </div>                                  
 
43
                                <p></p>
 
44
                                <div class="panel-footer"><i>Copyright (c) Camicri Systems</i></div>
 
45
                                </div>                                          
 
46
                        </div>
 
47
                </div>
 
48
        
 
49
        </div>
 
50
 
 
51
    <script src="/assets/js/jquery.min.js"></script>
 
52
    <script src="/assets/js/bootstrap.min.js"></script>
 
53
    
 
54
    <script>
 
55
    
 
56
    $(document).ready(function(){    
 
57
        
 
58
        function get_projects ()
 
59
        {       
 
60
                        //Get Projects
 
61
                        $.getJSON("http://localhost:8080/cmd/project/get-projects")
 
62
                        .done(function(result){
 
63
                                for ( var i = 0; i < result.length ; i++ )
 
64
                                        $("#project-cbo").append("<option value=" + result[i].name + ">" + result[i].name + "</option>");
 
65
                        })
 
66
                        .fail(function(){
 
67
                                $("#notify-pnl").html("<div class=\"col-md-8 col-md-offset-2 alert alert-danger text-center\"><strong>Cube not running!</strong> Please run the cube server first and refresh this page</div>");
 
68
                                $("button").attrib("disabled");
 
69
                        });
 
70
                }
 
71
                
 
72
                function open_project( name )
 
73
                {
 
74
                        $.getJSON("http://localhost:8080/cmd/project/open-project?project="+name)
 
75
                        .done(function(result){
 
76
                                if ( result.success == "true" )
 
77
                                        $("#notify-pnl").html("<div class=\"col-md-8 col-md-offset-2 alert alert-success text-center\"><strong>Project Opened!</strong>"+result.message+"</div>");
 
78
                        })
 
79
                        .fail(function(){
 
80
                                $("#notify-pnl").html("<div class=\"col-md-8 col-md-offset-2 alert alert-danger text-center\"><strong>Failed to open project!</strong>"+result.message+"</div>");
 
81
                                $("button").attrib("disabled");
 
82
                        });
 
83
                }
 
84
                
 
85
                function create_project ( name )
 
86
                {
 
87
                        $.getJSON("http://localhost:8080/cmd/project/create-project?project="+name)
 
88
                        .done(function(result){
 
89
                                if ( result.success == "true" )
 
90
                                        $("#notify-pnl").html("<div class=\"col-md-8 col-md-offset-2 alert alert-success text-center\"><strong>Project Created!</strong>"+result.message+"</div>");
 
91
                        })
 
92
                        .fail(function(){
 
93
                                $("#notify-pnl").html("<div class=\"col-md-8 col-md-offset-2 alert alert-danger text-center\"><strong>Failed to create project!</strong>"+result.message+"</div>");
 
94
                                $("button").attrib("disabled");
 
95
                        });
 
96
                }
 
97
                
 
98
                function initialize()
 
99
                {
 
100
                        get_projects ();
 
101
                        
 
102
                        $(document).on("click","#open-project-btn", function(){ 
 
103
                                open_project ( $("#project-cbo option:selected").text() );
 
104
                        });
 
105
                        
 
106
                        $(document).on("click","#create-project-btn", function(){ 
 
107
                                create_project ( $("#create-project-in").val() );
 
108
                        });
 
109
                }               
 
110
                
 
111
                initialize();
 
112
        
 
113
    });
 
114
    
 
115
    </script>
 
116
    
 
117
  </body>
 
118
</html>