Commit aaabe195 authored by Leo Iannacone's avatar Leo Iannacone

use config.web properly for web interface

parent 25c5caec
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
socket.on('distributions', function(distributions) { socket.on('distributions', function(distributions) {
$('#distributions ul').html(''); $('#distributions ul').html('');
distributions.forEach(function (name){ distributions.forEach(function (name){
$('#distributions ul').append('<li id="distribution-' + name +'"><a href="'+ PATHS.distribution + '#'+ name + '">' + name + '</li>'); $('#distributions ul').append('<li id="distribution-' + name +'"><a href="'+ config.paths.distribution + '#'+ name + '">' + name + '</li>');
}); });
}); });
...@@ -18,6 +18,6 @@ socket.on('status-update', function(data) { ...@@ -18,6 +18,6 @@ socket.on('status-update', function(data) {
console.log(data) console.log(data)
}) })
if (window.location.pathname == PATHS.distribution) { if (window.location.pathname == config.paths.distribution) {
new Page_Distrubion().init(socket) new Page_Distrubion().init(socket)
} }
...@@ -17,7 +17,7 @@ function Page_Distrubion() ...@@ -17,7 +17,7 @@ function Page_Distrubion()
if (Utils.check_data_file(data)) { if (Utils.check_data_file(data)) {
var complete_name = data.package.orig_name + '.' + data.file.name var complete_name = data.package.orig_name + '.' + data.file.name
if (! data.file.path) if (! data.file.path)
data.file.path = PATHS.debomatic + '/' + data.distribution.name + '/pool/' + data.package.orig_name + '/' + complete_name data.file.path = config.paths.debomatic + '/' + data.distribution.name + '/pool/' + data.package.orig_name + '/' + complete_name
label = complete_name + ' \ label = complete_name + ' \
<a class="btn btn-link btn-lg" title="Download" href="' + data.file.path + '">\ <a class="btn btn-link btn-lg" title="Download" href="' + data.file.path + '">\
<span class="glyphicon glyphicon-download-alt"></span>\ <span class="glyphicon glyphicon-download-alt"></span>\
...@@ -142,7 +142,7 @@ function Page_Distrubion() ...@@ -142,7 +142,7 @@ function Page_Distrubion()
var new_html = $("#file pre").html() + data.file.new_content var new_html = $("#file pre").html() + data.file.new_content
$("#file pre").html(new_html) $("#file pre").html(new_html)
if (AUTOSCROLL) // scroll down if (config.autoscroll) // scroll down
$('body,html').animate({ scrollTop: $('#file pre').height() }, 500); $('body,html').animate({ scrollTop: $('#file pre').height() }, 500);
}, },
get: function() { get: function() {
......
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title><%= title %></title> <title><%= web.title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/libs/bootstrap/3.1.1/css/bootstrap.min.css"> <link rel="stylesheet" href="/libs/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="/libs/bootstrap/3.1.1/css/bootstrap-theme.min.css"> <link rel="stylesheet" href="/libs/bootstrap/3.1.1/css/bootstrap-theme.min.css">
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<div id="wrapper" class="container-fluid"> <div id="wrapper" class="container-fluid">
<header id="header" onclick="window.location.href='/'"> <header id="header" onclick="window.location.href='/'">
<h1><%= title %></h1> <h1><%= web.title %></h1>
<p class="lead"><%= description %></p> <p class="lead"><%= web.description %></p>
</header> </header>
<nav id="distributions" class="navbar navbar-inverse" role="navigation"> <nav id="distributions" class="navbar navbar-inverse" role="navigation">
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<footer class="container-fluid"> <footer class="container-fluid">
<small class="copyright pull-right text-muted"> <small class="copyright pull-right text-muted">
<%= footer %> <%= web.footer %>
</small> </small>
<div id="status" class="clearfix"> <div id="status" class="clearfix">
<span>status:</span> <span class="idle text-muted">Idle</span> <span>status:</span> <span class="idle text-muted">Idle</span>
...@@ -44,10 +44,8 @@ ...@@ -44,10 +44,8 @@
<script src="/libs/bootstrap/3.1.1/js/bootstrap.min.js"></script> <script src="/libs/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script> <script>
var PATHS = <%- JSON.stringify(paths) %> var config = <%- JSON.stringify(web) %>
var AUTOSCROLL = <%= autoscroll %> var socket = io.connect('//' + config.hostname );
var HOSTNAME = '<%= host %><% if (port) { %>:<%= port%><% } %>'
var socket = io.connect('//' + HOSTNAME);
</script> </script>
<script src='/javascripts/utils.js'></script> <script src='/javascripts/utils.js'></script>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment