Project

General

Profile

Download (18.1 KB) Statistics
| Branch: | Revision:
1 95b003ff Origo
<!doctype html>
2
<html>
3
  <head>
4
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
5
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
6
    <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui">
7
    <title>Stabile</title>
8
      <link rel="stylesheet" href="/stabile/static/css/style.css" />
9
      <link rel="stylesheet" href="/stabile/static/css/plupload.queue.css" />
10 a91e0e6e hq
      <link rel="stylesheet" href="/stabile/static/css/dark-i.css" />
11 95b003ff Origo
12
      <script type="text/javascript">
13
      var dojoConfig = {
14
          async:1,
15
          packages: [{
16
            name: 'fileTree',
17
            location: '/stabile/static/js/fileTree'
18
          },{
19
            name: 'steam2',
20
            location: '/stabile/static/js/steam2'
21
          },{
22
            name: 'stabile',
23
            location: '/stabile/static/js/stabile'
24
          },{
25
            name: 'evd',
26
            location: '/stabile/static/js/evd'
27
          },{
28
            name: 'java',
29
            location: '/stabile/static/js/java'
30
          },{
31
            name: 'ssh',
32
            location: '/stabile/static/js/ssh'
33
          },{
34
            name: 'vnc',
35
            location: '/stabile/static/js/vnc'
36
          },{
37
            name: 'rdp',
38
            location: '/stabile/static/js/rdp'
39
          },{
40
            name: 'helpers',
41
            location: '/stabile/static/js/helpers'
42
          },
43
          {
44
            name: 'plupload',
45
            location: '/stabile/static/js/plupload'
46
          }
47
      ]};
48
    </script>
49
      <!-- script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script -->
50
      <script type="text/javascript" src="/stabile/static/js/jquery/1.10.2/jquery.min.js"></script>
51
      <script type="text/javascript" src="/stabile/static/js/toastr.js"></script>
52
      <script type="text/javascript" src="/stabile/static/js/js.cookie.min.js"></script>
53 104449f5 Origo
      <script src="/stabile/static/js/apexcharts-3.22.1/apexcharts.min.js"></script>
54
      <!-- script src="https://cdn.jsdelivr.net/npm/apexcharts"></script -->
55 95b003ff Origo
      <!-- script src="//ajax.googleapis.com/ajax/libs/dojo/1.7.5/dojo/dojo.js"></script -->
56
      <script src="/stabile/static/js/dojo/1.7.12/dojo/dojo.js"></script>
57 89cb0977 hq
      <!-- link rel="icon" href="/stabile/static/img/logo-icon.png" sizes="192x192" / -->
58
      <!-- link rel="icon" href="/stabile/static/img/logo-icon-32.png" sizes="32x32" / -->
59 95b003ff Origo
60
  </head>
61
62
<body class="tundra inframe" onresize="home.bodyResize();" onbeforeunload="return home.logout();">
63
<div id="toaster" style="font-size: 14px;"></div>
64
<div class="modal-body">
65
    <ul id="steamtabs" class="nav nav-tabs">
66
              <span class="navbar-brand navbar-right" style="white-space: nowrap; margin-right:-10px; margin-top: -12px;">
67 104449f5 Origo
                  <span class="glyphicon glyphicon-alert" aria-hidden="true" style="font-size:15px; vertical-align:top; margin-top:7px; margin-left:10px; margin-right:10px; color:#3c3c3c; display:none; cursor:pointer;" title="alerts" id="toasthistory" onclick="IRIGO.toasthistory();"></span>
68 95b003ff Origo
                  <span id="engines_span" style="display:none; margin-right:12px">
69
                      <span class="glyphicon glyphicon-cloud" aria-hidden="true" style="font-size:15px; vertical-align:top; margin-top:9px; margin-left:10px; color:#3c3c3c;" title=""></span>
70
                      <span id="engines"></span>
71
                  </span>
72
                  <span class="glyphicon glyphicon-user" aria-hidden="true" style="font-size:15px; vertical-align:top; margin-top:7px; margin-left:10px; color:#3c3c3c;" title=""></span>
73
                  <span id="account" style="display:none;"></span>
74
                  <span style="margin-left:14px;" class="logo"><a href="https://www.origo.io"><img alt="Origo" src="static/img/logo-icon.png" style="height:28px;"></a></span>
75
              </span>
76 d24d9a01 hq
              <li role="presentation" id="hometab" class="active" title="Click to manage your servers and stacks">
77 95b003ff Origo
                  <a data-toggle="tab" href="#homecontent" id="hometab_a" onclick="fixInfoWidth();">
78
                      Dashboard
79
                  </a>
80
              </li>
81
              <li role="presentation" id="serverstab" title="Click to manage the servers that run your apps"><a data-toggle="tab" href="#serverscontent" onclick="">Servers</a></li>
82
              <li role="presentation" id="imagestab" title="Click to manage the images your servers run off"><a data-toggle="tab" href="#imagescontent" onclick="">Images</a></li>
83
              <li role="presentation" id="networkstab" title="Click to manage the connections your servers connect to the network  through"><a data-toggle="tab" href="#networkscontent" onclick="">Network</a></li>
84
              <li role="presentation" id="userstab" title="Click to manage users on this engine" style="display:none"><a data-toggle="tab" href="#userscontent" onclick="">Users</a></li>
85
              <li role="presentation" id="nodestab" title="Click to manage the nodes that your servers run on" style="display:none"><a data-toggle="tab" href="#nodescontent" onclick="">Nodes</a></li>
86
    </ul>
87
88
    <div id="tabs-content" class="tab-content" style="margin:0; background-color:white;">
89 45cc3024 hq
        <div id="homecontent" class="tab-pane in active grid-tab">
90 95b003ff Origo
        </div>
91 45cc3024 hq
        <div id="serverscontent" class="tab-pane grid-tab">
92 95b003ff Origo
        </div>
93 45cc3024 hq
        <div id="imagescontent" class="tab-pane grid-tab">
94 95b003ff Origo
        </div>
95 45cc3024 hq
        <div id="networkscontent" class="tab-pane grid-tab">
96 95b003ff Origo
        </div>
97
        <div id="userscontent" class="tab-pane grid-tab">
98
        </div>
99 45cc3024 hq
        <div id="nodescontent" class="tab-pane grid-tab">
100 95b003ff Origo
        </div>
101
    </div>
102
103
    <div class="panel-group" role="tablist" style="margin-botton: 0;">
104
        <div class="panel panel-default" id="activityPanel" style="border-radius:0;">
105
            <div class="panel-heading" role="tab" id="activityHeading1">
106
                <h4 class="panel-title" id="-collapsible-list-group-">
107
                    <a class="collapsed" data-toggle="collapse" href="#activity-collapse" aria-expanded="false" aria-controls="collapseListGroup1">
108
                        Activity log
109
                    </a>
110
                    <a class="anchorjs-link" href="#-collapsible-list-group-"><span class="anchorjs-icon"></span></a>
111
                </h4>
112
            </div>
113
            <div id="activity-collapse" class="panel-collapse collapse" role="tabpanel" aria-expanded="false" style="height: 0px;">
114
                      <pre style="height:140px; overflow-y:auto; overflow-x:hidden; padding:6px; margin:0; border-radius: 0; background-color: white; border-left:0; border-right:0;" class="small" id="activity-panel">
115
                      </pre>
116
                <div class="panel-footer" style="padding:4px;"><button class="btn btn-success btn-sm" id="refresh_activity_button">Refresh</button> <button class="btn btn-danger btn-sm" id="clear_activity_button" style="display:none">Clear</button></div>
117
            </div>
118
        </div>
119
    </div>
120
</div>
121
122
<script type="text/javascript">
123
    require([
124
              "dojo/domReady!",
125
              'dojo/io/script',
126
              'dojo/ready',
127
              'dojo/parser',
128
              'dojo/cookie',
129
              'dojo/dom',
130
              'dojo/hash',
131
              'dojo/topic',
132
              'dojo/require',
133
              'dijit/form/Select',
134
              'dojox/widget/Toaster',
135
              'java/applet',
136
              'stabile/ui_update',
137
              'steam2/user',
138
              '/stabile/static/docs/embed.js',
139
140
              'dojo/_base/declare',
141
              'dijit/layout/TabContainer',
142
              'dijit/layout/ContentPane',
143
144
              'stabile/home',
145
              'stabile/servers',
146
              'stabile/images',
147
              'stabile/networks',
148
              'stabile/users',
149
              'stabile/nodes',
150
151
              'stabile/ClearTextBox',
152
              'stabile/home',
153
              '/stabile/static/js/plupload/moxie.js',
154
              'steam2/xhrDecorator',
155
156
              'dojo/aspect',
157
              'dojo/on',
158
              'dojo/Evented',
159
              'dojo/_base/connect'
160
161
    ], function(
162
                  domReady,
163
                  ioScript,
164
                  ready,
165
                  parser,
166
                  cookie,
167
                  dom,
168
                  hash,
169
                  topic,
170
                  require,
171
                  Select,
172
                  Toaster,
173
                  applet,
174
                  ui_update,
175
                  user,
176
                  embed,
177
                  declare,
178
                  TabContainer,
179
                  ContentPane
180
            ) {
181
        ready(function(){
182
183
            dojo.connect(window, 'onkeypress', function(evt) {
184
                key = evt.keyCode;
185
                if (key == dojo.keys.ESCAPE) {
186
                    console.debug("Escape trapped !!");
187
                    dojo.stopEvent(evt);
188
                } else if (key == dojo.keys.BACKSPACE) {
189
                    if (evt.target.nodeName != "INPUT" && evt.target.nodeName != "TEXTAREA") {
190
                        dojo.stopEvent(evt);
191
                        console.debug("Backspace trapped !!", evt);
192
                    }
193
                }
194
            });
195 104449f5 Origo
196
                  IRIGO.toasthistory = function() {
197
                      if (IRIGO.alerts.length>0) {
198
                          var messages = IRIGO.alerts.map(function (element) {
199
                              return element.time.toLocaleTimeString() + " : " + element.message
200
                          });
201
                          var message = "<hr>" + messages.join("<hr>\n");
202
                          toastr.options.timeOut = 3000;
203
                          toastr.options.preventDuplicates = true;
204
                          toastr.options.progressBar = false;
205 45cc3024 hq
                          toastr.alert(message, 'Alert history <a onclick="IRIGO.toastclear();" class="pull-right" style="font-weight: 400;">clear</a>');
206 104449f5 Origo
                      }
207
                  }
208 95b003ff Origo
209 45cc3024 hq
                  IRIGO.toastclear = function() {
210
                      IRIGO.alerts = [];
211
                      toastr.remove();
212
                  //    toastr.clear();
213
                      $("#toasthistory").hide();
214
                  }
215
216 95b003ff Origo
              IRIGO.toast = function(message) {
217 48fcda6b Origo
                  IRIGO.toaster([{
218 95b003ff Origo
                      message: message,
219
                      type: "message",
220 104449f5 Origo
                          priority: "success",
221 95b003ff Origo
                      duration: 3000
222
                  }]);
223
              }
224
225 104449f5 Origo
                  IRIGO.toaster = function(toast, nohistory) {
226 95b003ff Origo
                  var priority = toast.priority || 'info'; // success
227
                  toastr.options.timeOut = toast.duration || 3000;
228
                  toastr.options.preventDuplicates = true;
229 104449f5 Origo
                      toastr.options.progressBar = true;
230
                      toastr.options.closeButton = false;
231 95b003ff Origo
                  var message = toast[0].message;
232
                  if (toastr[priority]) {
233
                      toastr[priority](message);
234
                  } else {
235
                      toastr.info(message);
236
                  }
237 104449f5 Origo
                      if (!nohistory) {
238
                          IRIGO.alerts.unshift({"message": message, "time": new Date()});
239 45cc3024 hq
                          if (IRIGO.alerts.length>12) IRIGO.alerts.pop();
240 104449f5 Origo
                          $("#toasthistory").show();
241
                      }
242 95b003ff Origo
              }
243
244
                  dojo.subscribe('message', function(obj){
245 48fcda6b Origo
                     if (obj.message) IRIGO.toaster([{message: obj.message}]);
246 95b003ff Origo
                  });
247
248
                  homepane = new ContentPane({id: 'homepane', title: 'Dashboard', href: "static/html/home.html", style:"min-height: 450px; height:80vh;",
249
                onLoad: function(){home.init();}
250
            });
251
                  serverspane = new ContentPane({id: 'serverspane', title: 'Servers', href: "static/html/servers.html", style:"height:80vh;",
252
                onLoad: function(){servers.init();}
253
            });
254
                  imagespane = new ContentPane({id: 'imagespane', title: 'Images', href: "static/html/images.html", style:"height:80vh;",
255
                onLoad: function(){images.init();}
256
            });
257
                  networkspane = new ContentPane({id: 'networkspane', Networks: 'Servers', href: "static/html/networks.html", style:"height:80vh;",
258
                onLoad: function(){networks.init();}
259
            });
260
261
            $('#homecontent').empty().append(homepane.domNode);
262
            homepane.startup();
263
            $('#serverscontent').empty().append(serverspane.domNode);
264
            serverspane.startup();
265
            $('#imagescontent').empty().append(imagespane.domNode);
266
            imagespane.startup();
267
            $('#networkscontent').empty().append(networkspane.domNode);
268
            networkspane.startup();
269
270
            $('#serverstab').on('shown.bs.tab', function(e){
271
                servers.grid.handleSelectTab();
272
                if (!user.is_readonly) $("#serversNewButton").show();
273
            });
274
            $('#imagestab').on('shown.bs.tab', function(e){
275
                images.grid.handleSelectTab();
276
                if (!user.is_readonly) {
277
                    $("#imagesNewButton").show();
278
                    $("#imagesUploadButton").show();
279
                      };
280
                      images.updateMissingBackups();
281
            });
282
            $('#networkstab').on('shown.bs.tab', function(e){
283
                networks.grid.handleSelectTab();
284
                if (!user.is_readonly) {
285
                    $("#networksNewButton").show();
286
                }
287
            });
288
            $('#hometab').on('shown.bs.tab', function(e){
289
                if (home.grid.updatePending) {
290
                    home.grid.refresh();
291
                    home.grid.updatePending = false;
292
                }
293
            });
294
295
            if(user.is_admin) {
296
                nodespane = new ContentPane({id: 'nodespane', title: 'Nodes', href: "static/html/nodes.html", style:"height:80vh;",
297
                    onLoad: function(){nodes.init();}
298
                });
299
                $('#nodescontent').empty().append(nodespane.domNode);
300
                nodespane.startup();
301
                $('#nodestab').on('shown.bs.tab', function(e){
302
                    nodes.grid.handleSelectTab();
303
                });
304
305
                      userspane = new ContentPane({id: 'userspane', title: 'Users', href: "static/html/users.html", style:"height:80vh;",
306
                          onLoad: function(){users.init();}
307
                      });
308
                      $('#userscontent').empty().append(userspane.domNode);
309
                      userspane.startup();
310
                      $('#userstab').on('shown.bs.tab', function(e){
311
                          users.grid.handleSelectTab();
312
                      });
313
314
            }
315
316
            function getActivity() {
317
                $('#activity-panel').load("/stabile/cgi/nodes.cgi?action=listlog", function(){
318
                        setTimeout(function(){
319
                    $('#activity-panel').scrollTop($('#activity-panel')[0].scrollHeight);
320
                        }, 200);
321
                })
322
            }
323
            function clearActivity() {
324
                $.get("/stabile/cgi/nodes.cgi?action=clearlog", function() {
325
                    $('#activity-panel').text("--");
326
                });
327
            }
328
              $('#activity-collapse').on('show.bs.collapse', function () {
329
                  getActivity();
330
              });
331
              $('#activity-collapse').on('shown.bs.collapse', function () {
332
                      $(".border_container_south").css("bottom","270px");
333
                      window.scrollTo(0,document.body.scrollHeight);
334
              });
335
              $('#activity-collapse').on('hide.bs.collapse', function () {
336
                      $(".border_container_south").css("bottom","90px");
337
              });
338
            $('#refresh_activity_button').on('click', function () {
339
                getActivity();
340
            });
341
            $('#clear_activity_button').on('click', function () {
342
                clearActivity();
343
            });
344 45cc3024 hq
                  $(document).on('click', function(evt) { // Hidi Dojo dialogs when clicking outside
345
                      if (evt.target.className.indexOf("dijitDialogUnderlay")!=-1) {
346
                          $.each($(".dijitDialog"), function( index, value ) {
347
                              dijit.byId(value.id).hide();
348
                          });
349
                      }
350
                  });
351
352
                  $('#hometab').on('shown.bs.tab', function (e) {location="#home";});
353
                  $('#serverstab').on('shown.bs.tab', function (e) {location="#servers";});
354
                  $('#imagestab').on('shown.bs.tab', function (e) {location="#images";});
355
                  $('#networkstab').on('shown.bs.tab', function (e) {location="#networks";});
356
                  if ($('#nodestab')) $('#nodestab').on('shown.bs.tab', function (e) {location="#nodes";});
357
                  if ($('#userstab')) $('#userstab').on('shown.bs.tab', function (e) {location="#users";});
358
359
                  $('a[data-toggle=tab]').on('click', function () {
360
                    console.log($(this)[0].hash.substring(1));
361
                    if ($(this)[0].hash.substring(1) == 'homecontent') {
362
                        console.log("resizing");
363
                        if (typeof homepane !== 'undefined') setTimeout(function() { home.bodyResize(); homepane.resize();}, 100);
364
                    }
365
                  });
366 95b003ff Origo
        });
367
    });
368
369
    // For some reason dijit_layout_BorderContainer_0 get's reset to width 0 sometimes, this ugly hack fixes it
370
    function fixInfoWidth() {
371
        if ($("#dijit_layout_BorderContainer_0").width() == 0)
372
            $("#dijit_layout_BorderContainer_0").css("width","");
373
    }
374 a91e0e6e hq
    console.log("hash", location.hash, document.location.hash);
375
    if (location.hash === "#dark") {
376
        $("body").addClass("dark");
377
    }
378 95b003ff Origo
</script>
379
      <!-- script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>
380
      <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script -->
381
      <script type="text/javascript" src="/stabile/static/js/jqueryui/1.8.23/jquery-ui.min.js"></script>
382
      <script type="text/javascript" src="/stabile/static/js/bootstrap/3.3.4/js/bootstrap.min.js"></script>
383
</body>
384
</html>