mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
added "cute" 3d buttons :-)
This commit is contained in:
parent
96937a397c
commit
67a691768e
@ -65,7 +65,8 @@ def tmpl(request, template):
|
|||||||
t = loader.get_template('uds/admin/tmpl/' + template + ".html")
|
t = loader.get_template('uds/admin/tmpl/' + template + ".html")
|
||||||
c = RequestContext(request)
|
c = RequestContext(request)
|
||||||
resp = t.render(c)
|
resp = t.render(c)
|
||||||
except:
|
except Exception as e:
|
||||||
|
logger.debug('Exception getting template: {0}'.format(e))
|
||||||
resp = _('requested a template that do not exists')
|
resp = _('requested a template that do not exists')
|
||||||
return HttpResponse(resp, content_type="text/plain");
|
return HttpResponse(resp, content_type="text/plain");
|
||||||
|
|
||||||
|
40
server/src/uds/static/adm/css/buttons.css
Normal file
40
server/src/uds/static/adm/css/buttons.css
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
.btn3d {
|
||||||
|
transition:all .08s linear;
|
||||||
|
position:relative;
|
||||||
|
outline:medium none;
|
||||||
|
-moz-outline-style:none;
|
||||||
|
border:0px;
|
||||||
|
margin-right:10px;
|
||||||
|
margin-top:15px;
|
||||||
|
}
|
||||||
|
.btn3d:focus {
|
||||||
|
outline:medium none;
|
||||||
|
-moz-outline-style:none;
|
||||||
|
}
|
||||||
|
.btn3d:active {
|
||||||
|
top:9px;
|
||||||
|
}
|
||||||
|
.btn-default {
|
||||||
|
box-shadow:0 0 0 1px #ebebeb inset, 0 0 0 2px rgba(255,255,255,0.15) inset, 0 8px 0 0 #adadad, 0 8px 0 1px rgba(0,0,0,0.4), 0 8px 8px 1px rgba(0,0,0,0.5);
|
||||||
|
background-color:#fff;
|
||||||
|
}
|
||||||
|
.btn-primary {
|
||||||
|
box-shadow:0 0 0 1px #428bca inset, 0 0 0 2px rgba(255,255,255,0.15) inset, 0 8px 0 0 #357ebd, 0 8px 0 1px rgba(0,0,0,0.4), 0 8px 8px 1px rgba(0,0,0,0.5);
|
||||||
|
background-color:#428bca;
|
||||||
|
}
|
||||||
|
.btn-success {
|
||||||
|
box-shadow:0 0 0 1px #5cb85c inset, 0 0 0 2px rgba(255,255,255,0.15) inset, 0 8px 0 0 #4cae4c, 0 8px 0 1px rgba(0,0,0,0.4), 0 8px 8px 1px rgba(0,0,0,0.5);
|
||||||
|
background-color:#5cb85c;
|
||||||
|
}
|
||||||
|
.btn-info {
|
||||||
|
box-shadow:0 0 0 1px #5bc0de inset, 0 0 0 2px rgba(255,255,255,0.15) inset, 0 8px 0 0 #46b8da, 0 8px 0 1px rgba(0,0,0,0.4), 0 8px 8px 1px rgba(0,0,0,0.5);
|
||||||
|
background-color:#5bc0de;
|
||||||
|
}
|
||||||
|
.btn-warning {
|
||||||
|
box-shadow:0 0 0 1px #f0ad4e inset, 0 0 0 2px rgba(255,255,255,0.15) inset, 0 8px 0 0 #eea236, 0 8px 0 1px rgba(0,0,0,0.4), 0 8px 8px 1px rgba(0,0,0,0.5);
|
||||||
|
background-color:#f0ad4e;
|
||||||
|
}
|
||||||
|
.btn-danger {
|
||||||
|
box-shadow:0 0 0 1px #c63702 inset, 0 0 0 2px rgba(255,255,255,0.15) inset, 0 8px 0 0 #C24032, 0 8px 0 1px rgba(0,0,0,0.4), 0 8px 8px 1px rgba(0,0,0,0.5);
|
||||||
|
background-color:#c63702;
|
||||||
|
}
|
@ -82,10 +82,11 @@ table.tablesorter thead tr th:hover {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tbl-button-active {
|
.btn3d-tables {
|
||||||
font-weight: bolder;
|
margin-top:0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Edit Below to Customize Widths > 768px */
|
/* Edit Below to Customize Widths > 768px */
|
||||||
@media (min-width:768px) {
|
@media (min-width:768px) {
|
||||||
|
|
||||||
|
@ -142,67 +142,4 @@ api.networks = new BasicModelRest('networks');
|
|||||||
|
|
||||||
// Locale related
|
// Locale related
|
||||||
api.locale = new BasicModelRest('locale');
|
api.locale = new BasicModelRest('locale');
|
||||||
api.locale.tableInfo = api.locale.types = undefined;
|
api.locale.tableInfo = api.locale.types = undefined;
|
||||||
|
|
||||||
// -------------------------------
|
|
||||||
// Templates related
|
|
||||||
// This is not part of REST api provided by UDS, but it's part of the api needed
|
|
||||||
// for the admin app
|
|
||||||
// -------------------------------
|
|
||||||
(function(templates, $) {
|
|
||||||
templates.cache = {}; // Will cache templates locally. If name contains
|
|
||||||
// '?', data will not be cached and always
|
|
||||||
// re-requested
|
|
||||||
templates.get = function(name, success_fnc) {
|
|
||||||
api.doLog('Getting tempkate ' + name);
|
|
||||||
if (name.indexOf('?') != -1) {
|
|
||||||
if (templates.cache[name] !== undefined) {
|
|
||||||
if (success_fnc !== undefined) {
|
|
||||||
success_fnc(templates.cache[name]);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$.ajax({
|
|
||||||
url : '/adm/tmpl/' + name,
|
|
||||||
type : "GET",
|
|
||||||
dataType : "text",
|
|
||||||
success : function(data) {
|
|
||||||
templates.cache[name] = data;
|
|
||||||
api.doLog('Success getting template "' + name + '".');
|
|
||||||
api.doLog('Received: ' + data);
|
|
||||||
if (success_fnc !== undefined) {
|
|
||||||
api.doLog('Executing success method');
|
|
||||||
success_fnc(data);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: function( jqXHR, textStatus, errorThrown ) {
|
|
||||||
api.doLog(jqXHR);
|
|
||||||
api.doLog(textStatus);
|
|
||||||
apid.doLog(errorThrown);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// Simple JavaScript Templating
|
|
||||||
// Based on John Resig - http://ejohn.org/ - MIT Licensed
|
|
||||||
templates.evaluate = function tmpl(str, data) {
|
|
||||||
// Figure out if we're getting a template, or if we need to
|
|
||||||
// load the template - and be sure to cache the result.
|
|
||||||
var fn =
|
|
||||||
// Generate a reusable function that will serve as a template
|
|
||||||
// generator (and which will be cached).
|
|
||||||
new Function("obj", "var p=[],print=function(){p.push.apply(p,arguments);};" +
|
|
||||||
|
|
||||||
// Introduce the data as local variables using with(){}
|
|
||||||
"with(obj){p.push('" +
|
|
||||||
|
|
||||||
// Convert the template into pure JavaScript
|
|
||||||
str.replace(/[\r\t\n]/g, " ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g, "$1\r").replace(
|
|
||||||
/\t=(.*?)%>/g, "',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join(
|
|
||||||
"\\'") + "');}return p.join('');");
|
|
||||||
|
|
||||||
// Provide some basic currying to the user
|
|
||||||
return data ? fn(data) : fn;
|
|
||||||
};
|
|
||||||
}(api.templates = api.templates || {}, jQuery));
|
|
@ -116,7 +116,7 @@ $.extend( $.fn.dataTableExt.oPagination, {
|
|||||||
if ( $.fn.DataTable.TableTools ) {
|
if ( $.fn.DataTable.TableTools ) {
|
||||||
// Set the classes that TableTools uses to something suitable for Bootstrap
|
// Set the classes that TableTools uses to something suitable for Bootstrap
|
||||||
$.extend( true, $.fn.DataTable.TableTools.classes, {
|
$.extend( true, $.fn.DataTable.TableTools.classes, {
|
||||||
"container": "DTTT btn-group",
|
"container": "DTTT btn-group-3d",
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"normal": "btn btn-default",
|
"normal": "btn btn-default",
|
||||||
"disabled": "disabled"
|
"disabled": "disabled"
|
||||||
|
@ -13,7 +13,7 @@ gui.providers.link = function(event) {
|
|||||||
gui.doLog(this);
|
gui.doLog(this);
|
||||||
gui.doLog(this.fnGetSelectedData());
|
gui.doLog(this.fnGetSelectedData());
|
||||||
},
|
},
|
||||||
buttons : [ 'edit', 'refresh', 'delete' ],
|
buttons : [ 'edit', 'refresh', 'delete', 'xls' ],
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -37,14 +37,14 @@ gui.authenticators.link = function(event) {
|
|||||||
gui.authenticators.table({
|
gui.authenticators.table({
|
||||||
container : 'auths-placeholder',
|
container : 'auths-placeholder',
|
||||||
rowSelect : 'single',
|
rowSelect : 'single',
|
||||||
buttons : [ 'edit', 'refresh', 'delete' ],
|
buttons : [ 'edit', 'refresh', 'delete', 'xls' ],
|
||||||
onRowSelect : function(nodes) {
|
onRowSelect : function(nodes) {
|
||||||
var id = this.fnGetSelectedData()[0].id;
|
var id = this.fnGetSelectedData()[0].id;
|
||||||
var user = new GuiElement(api.authenticators.users.detail(id), 'users');
|
var user = new GuiElement(api.authenticators.users.detail(id), 'users');
|
||||||
user.table({
|
user.table({
|
||||||
container : 'users-placeholder',
|
container : 'users-placeholder',
|
||||||
rowSelect : 'multi',
|
rowSelect : 'multi',
|
||||||
buttons : [ 'edit', 'refresh', 'delete' ],
|
buttons : [ 'edit', 'refresh', 'delete', 'xls' ],
|
||||||
scroll : true,
|
scroll : true,
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
@ -65,7 +65,7 @@ gui.osmanagers.link = function(event) {
|
|||||||
|
|
||||||
gui.osmanagers.table({
|
gui.osmanagers.table({
|
||||||
rowSelect : 'single',
|
rowSelect : 'single',
|
||||||
buttons : [ 'edit', 'refresh', 'delete' ],
|
buttons : [ 'edit', 'refresh', 'delete', 'xls' ],
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -77,19 +77,23 @@ gui.connectivity = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
gui.connectivity.link = function(event) {
|
gui.connectivity.link = function(event) {
|
||||||
gui.clearWorkspace();
|
api.templates.get('connectivity', function(tmpl) {
|
||||||
gui.appendToWorkspace(gui.breadcrumbs(gettext('Connectivity')));
|
gui.clearWorkspace();
|
||||||
gui
|
gui.appendToWorkspace(api.templates.evaluate(tmpl, {
|
||||||
.appendToWorkspace('<div class="row"><div class="col-lg-6" id="ttbl"></div><div class="col-lg-6" id="ntbl"></div></div>');
|
transports : 'transports-placeholder',
|
||||||
|
networks : 'networks-placeholder'
|
||||||
|
}));
|
||||||
|
|
||||||
gui.connectivity.transports.table({
|
gui.connectivity.transports.table({
|
||||||
rowSelect : 'multi',
|
rowSelect : 'multi',
|
||||||
container : 'ttbl',
|
container : 'transports-placeholder',
|
||||||
buttons : [ 'edit', 'refresh', 'delete', 'pdf' ],
|
buttons : [ 'edit', 'refresh', 'delete', 'xls' ],
|
||||||
});
|
});
|
||||||
gui.connectivity.networks.table({
|
gui.connectivity.networks.table({
|
||||||
rowSelect : 'multi',
|
rowSelect : 'multi',
|
||||||
container : 'ntbl',
|
container : 'networks-placeholder',
|
||||||
buttons : [ 'edit', 'refresh', 'delete' ],
|
buttons : [ 'edit', 'refresh', 'delete', 'xls' ],
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -185,8 +185,6 @@ GuiElement.prototype = {
|
|||||||
|
|
||||||
// Icon renderer, based on type (created on init methods in styles)
|
// Icon renderer, based on type (created on init methods in styles)
|
||||||
var renderTypeIcon = function(data, type, value){
|
var renderTypeIcon = function(data, type, value){
|
||||||
gui.doLog(type);
|
|
||||||
gui.doLog(data);
|
|
||||||
if( type == 'display' ) {
|
if( type == 'display' ) {
|
||||||
var css = $this.types[value.type].css;
|
var css = $this.types[value.type].css;
|
||||||
return '<span class="' + css + '"></span> ' + renderEmptyCell(data);
|
return '<span class="' + css + '"></span> ' + renderEmptyCell(data);
|
||||||
@ -351,7 +349,7 @@ GuiElement.prototype = {
|
|||||||
"sButtonText" : gettext('Edit'),
|
"sButtonText" : gettext('Edit'),
|
||||||
"fnSelect" : editSelected,
|
"fnSelect" : editSelected,
|
||||||
"fnClick" : editFnc,
|
"fnClick" : editFnc,
|
||||||
"sButtonClass" : "disabled"
|
"sButtonClass" : "disabled btn3d btn3d-tables"
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 'delete':
|
case 'delete':
|
||||||
@ -360,7 +358,7 @@ GuiElement.prototype = {
|
|||||||
"sButtonText" : gettext('Delete'),
|
"sButtonText" : gettext('Delete'),
|
||||||
"fnSelect" : deleteSelected,
|
"fnSelect" : deleteSelected,
|
||||||
"fnClick" : deleteFnc,
|
"fnClick" : deleteFnc,
|
||||||
"sButtonClass" : "disabled"
|
"sButtonClass" : "disabled btn3d btn3d-tables"
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 'refresh':
|
case 'refresh':
|
||||||
@ -368,7 +366,7 @@ GuiElement.prototype = {
|
|||||||
"sExtends" : "text",
|
"sExtends" : "text",
|
||||||
"sButtonText" : gettext('Refresh'),
|
"sButtonText" : gettext('Refresh'),
|
||||||
"fnClick" : refreshFnc,
|
"fnClick" : refreshFnc,
|
||||||
"sButtonClass" : "btn-info"
|
"sButtonClass" : "btn-info btn3d btn3d-tables"
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 'xls':
|
case 'xls':
|
||||||
@ -376,34 +374,42 @@ GuiElement.prototype = {
|
|||||||
"sExtends" : "text",
|
"sExtends" : "text",
|
||||||
"sButtonText" : 'xls',
|
"sButtonText" : 'xls',
|
||||||
"fnClick" : function(){
|
"fnClick" : function(){
|
||||||
// Simple export, based on http://jsfiddle.net/lesson8/wVejP/
|
api.templates.get('spreadsheet', function(tmpl) {
|
||||||
var uri = 'data:application/vnd.ms-excel;base64,',
|
var styles = { 'bold': 's21', };
|
||||||
template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name><%= worksheet %></x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table border="1"><%= table %></table></body></html>',
|
var uri = 'data:application/vnd.ms-excel;base64,',
|
||||||
base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))); };
|
base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))); };
|
||||||
|
|
||||||
table = '<thead>';
|
var headings = [], rows = [];
|
||||||
$.each(columns, function(index, heading){
|
$.each(columns, function(index, heading){
|
||||||
if( heading.bVisible === false ) {
|
if( heading.bVisible === false ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
table += '<th><b>' + heading.sTitle + '</b></th>';
|
headings.push(api.spreadsheet.cell(heading.sTitle, 'String', styles.bold));
|
||||||
});
|
});
|
||||||
table += '</thead><tbody>';
|
rows.push(api.spreadsheet.row(headings));
|
||||||
$.each(data, function(index, row) {
|
$.each(data, function(index, row) {
|
||||||
var tr = '';
|
var cells = [];
|
||||||
$.each(columns, function(index, col){
|
$.each(columns, function(index, col){
|
||||||
if( col.bVisible === false ) {
|
if( col.bVisible === false ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tr += '<td>' + row[col.mData] + '</td>';
|
var type = col.sType == 'numeric' ? 'Number':'String';
|
||||||
|
cells.push(api.spreadsheet.cell(row[col.mData], type));
|
||||||
});
|
});
|
||||||
table += '<tr>' + tr + '</tr>';
|
rows.push(api.spreadsheet.row(cells));
|
||||||
});
|
});
|
||||||
table += '</tbody>';
|
|
||||||
var ctx = {worksheet: title, table: table};
|
var ctx = {
|
||||||
window.location.href = uri + base64(api.templates.evaluate(template, ctx));
|
creation_date: (new Date()).toISOString(),
|
||||||
|
worksheet: title,
|
||||||
|
columns_count: headings.length,
|
||||||
|
rows_count: rows.length,
|
||||||
|
rows: rows.join('\n')
|
||||||
|
};
|
||||||
|
window.location.href = uri + base64(api.templates.evaluate(tmpl, ctx));
|
||||||
|
});
|
||||||
},
|
},
|
||||||
"sButtonClass" : "btn-info"
|
"sButtonClass" : "btn-info btn3d btn3d-tables"
|
||||||
};
|
};
|
||||||
/*case 'csv':
|
/*case 'csv':
|
||||||
btn = {
|
btn = {
|
||||||
@ -457,7 +463,7 @@ GuiElement.prototype = {
|
|||||||
// First is upper row,
|
// First is upper row,
|
||||||
// second row is lower
|
// second row is lower
|
||||||
// (pagination) row
|
// (pagination) row
|
||||||
"sDom" : "<'row'<'col-xs-6'T><'col-xs-6'f>r>t<'row'<'col-xs-5'i><'col-xs-7'p>>",
|
"sDom" : "<'row'<'col-xs-8'T><'col-xs-4'f>r>t<'row'<'col-xs-5'i><'col-xs-7'p>>",
|
||||||
|
|
||||||
});
|
});
|
||||||
$('#' + tableId + '_filter input').addClass('form-control');
|
$('#' + tableId + '_filter input').addClass('form-control');
|
||||||
|
15
server/src/uds/static/adm/js/spreadsheet.js
Normal file
15
server/src/uds/static/adm/js/spreadsheet.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
(function(spreadsheet, $, undefined) {
|
||||||
|
spreadsheet.cell = function(data, type, style) {
|
||||||
|
type = type || 'String';
|
||||||
|
if( style !== undefined ) {
|
||||||
|
style = ' ss:StyleID="' + style + '"';
|
||||||
|
} else {
|
||||||
|
style = '';
|
||||||
|
}
|
||||||
|
return '<Cell' + style + '><Data ss:Type="' + type + '">' + data + '</Data></Cell>';
|
||||||
|
};
|
||||||
|
|
||||||
|
spreadsheet.row = function(cell) {
|
||||||
|
return '<Row>' + cell + '</Row>';
|
||||||
|
};
|
||||||
|
}(api.spreadsheet = api.spreadsheet || {}, jQuery));
|
62
server/src/uds/static/adm/js/templates.js
Normal file
62
server/src/uds/static/adm/js/templates.js
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
// -------------------------------
|
||||||
|
// Templates related
|
||||||
|
// Inserted into api
|
||||||
|
// for the admin app
|
||||||
|
// -------------------------------
|
||||||
|
(function(templates, $) {
|
||||||
|
templates.cache = {}; // Will cache templates locally. If name contains
|
||||||
|
// '?', data will not be cached and always
|
||||||
|
// re-requested. We do not care about lang, because page will reload on language change
|
||||||
|
templates.get = function(name, success_fnc) {
|
||||||
|
api.doLog('Getting tempkate ' + name);
|
||||||
|
if (name.indexOf('?') != -1) {
|
||||||
|
if (templates.cache[name] !== undefined) {
|
||||||
|
if (success_fnc !== undefined) {
|
||||||
|
success_fnc(templates.cache[name]);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$.ajax({
|
||||||
|
url : '/adm/tmpl/' + name,
|
||||||
|
type : "GET",
|
||||||
|
dataType : "text",
|
||||||
|
success : function(data) {
|
||||||
|
templates.cache[name] = data;
|
||||||
|
api.doLog('Success getting template "' + name + '".');
|
||||||
|
api.doLog('Received: ' + data);
|
||||||
|
if (success_fnc !== undefined) {
|
||||||
|
api.doLog('Executing success method');
|
||||||
|
success_fnc(data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function( jqXHR, textStatus, errorThrown ) {
|
||||||
|
api.doLog(jqXHR);
|
||||||
|
api.doLog(textStatus);
|
||||||
|
apid.doLog(errorThrown);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// Simple JavaScript Templating
|
||||||
|
// Based on John Resig - http://ejohn.org/ - MIT Licensed
|
||||||
|
templates.evaluate = function tmpl(str, data) {
|
||||||
|
// Figure out if we're getting a template, or if we need to
|
||||||
|
// load the template - and be sure to cache the result.
|
||||||
|
var fn =
|
||||||
|
// Generate a reusable function that will serve as a template
|
||||||
|
// generator (and which will be cached).
|
||||||
|
new Function("obj", "var p=[],print=function(){p.push.apply(p,arguments);};" +
|
||||||
|
|
||||||
|
// Introduce the data as local variables using with(){}
|
||||||
|
"with(obj){p.push('" +
|
||||||
|
|
||||||
|
// Convert the template into pure JavaScript
|
||||||
|
str.replace(/[\r\t\n]/g, " ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g, "$1\r").replace(
|
||||||
|
/\t=(.*?)%>/g, "',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join(
|
||||||
|
"\\'") + "');}return p.join('');");
|
||||||
|
|
||||||
|
// Provide some basic currying to the user
|
||||||
|
return data ? fn(data) : fn;
|
||||||
|
};
|
||||||
|
}(api.templates = api.templates || {}, jQuery));
|
5
server/src/uds/static/adm/js/tools.js
Normal file
5
server/src/uds/static/adm/js/tools.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
(function(tools, $, undefined) {
|
||||||
|
tools.base64 = function(s) {
|
||||||
|
return window.btoa(unescape(encodeURIComponent(s)));
|
||||||
|
};
|
||||||
|
}(api.tools = api.tools || {}, jQuery));
|
@ -23,6 +23,7 @@
|
|||||||
<link href="{% get_static_prefix %}adm/css/dataTables.bootstrap.css" rel="stylesheet" media="screen">
|
<link href="{% get_static_prefix %}adm/css/dataTables.bootstrap.css" rel="stylesheet" media="screen">
|
||||||
|
|
||||||
<link href="{% get_static_prefix %}css/tables.css" rel="stylesheet" media="screen">
|
<link href="{% get_static_prefix %}css/tables.css" rel="stylesheet" media="screen">
|
||||||
|
<link href="{% get_static_prefix %}adm/css/buttons.css" rel="stylesheet" media="screen">
|
||||||
<link href="{% get_static_prefix %}adm/css/uds-admin.css" rel="stylesheet" media="screen">
|
<link href="{% get_static_prefix %}adm/css/uds-admin.css" rel="stylesheet" media="screen">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@ -70,6 +71,17 @@
|
|||||||
}(window.api = window.api || {}, jQuery));
|
}(window.api = window.api || {}, jQuery));
|
||||||
</script>
|
</script>
|
||||||
<script src="{% get_static_prefix %}adm/js/api.js"></script>
|
<script src="{% get_static_prefix %}adm/js/api.js"></script>
|
||||||
|
|
||||||
|
<!-- templates related, inserts itself into api -->
|
||||||
|
<script src="{% get_static_prefix %}adm/js/templates.js"></script>
|
||||||
|
|
||||||
|
<!-- export to xls, inserts itself into api -->
|
||||||
|
<script src="{% get_static_prefix %}adm/js/spreadsheet.js"></script>
|
||||||
|
|
||||||
|
<!-- utilities attached to api -->
|
||||||
|
<script src="{% get_static_prefix %}adm/js/tools.js"></script>
|
||||||
|
|
||||||
|
|
||||||
<script src="{% get_static_prefix %}adm/js/gui.js"></script>
|
<script src="{% get_static_prefix %}adm/js/gui.js"></script>
|
||||||
<script src="{% get_static_prefix %}adm/js/gui-elements.js"></script>
|
<script src="{% get_static_prefix %}adm/js/gui-elements.js"></script>
|
||||||
|
|
||||||
|
16
server/src/uds/templates/uds/admin/tmpl/connectivity.html
Normal file
16
server/src/uds/templates/uds/admin/tmpl/connectivity.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{% load i18n html5 static %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<h1>{% trans 'Connectivity' %} <small>{% trans 'overview' %}</small></h1>
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li><a id="lnk-dashboard" href=""><i class="fa fa-dashboard"></i> Dashboard</a></li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div><!-- /.row -->
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-6" id="<%= transports %>">
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6" id="<%= networks %>">
|
||||||
|
</div>
|
||||||
|
</div>
|
60
server/src/uds/templates/uds/admin/tmpl/spreadsheet.html
Normal file
60
server/src/uds/templates/uds/admin/tmpl/spreadsheet.html
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<?mso-application progid="Excel.Sheet"?>
|
||||||
|
<Workbook
|
||||||
|
xmlns="urn:schemas-microsoft-com:office:spreadsheet"
|
||||||
|
xmlns:o="urn:schemas-microsoft-com:office:office"
|
||||||
|
xmlns:x="urn:schemas-microsoft-com:office:excel"
|
||||||
|
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
|
||||||
|
xmlns:html="http://www.w3.org/TR/REC-html40">
|
||||||
|
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
|
||||||
|
<Author>UDS Administration</Author>
|
||||||
|
<LastAuthor>UDS Administration Interface</LastAuthor>
|
||||||
|
<Created><%= creation_date %></Created>
|
||||||
|
<Company>UDS</Company>
|
||||||
|
<Version>1.0</Version>
|
||||||
|
</DocumentProperties>
|
||||||
|
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
|
||||||
|
<WindowHeight>6795</WindowHeight>
|
||||||
|
<WindowWidth>8460</WindowWidth>
|
||||||
|
<WindowTopX>120</WindowTopX>
|
||||||
|
<WindowTopY>15</WindowTopY>
|
||||||
|
<ProtectStructure>False</ProtectStructure>
|
||||||
|
<ProtectWindows>False</ProtectWindows>
|
||||||
|
</ExcelWorkbook>
|
||||||
|
<Styles>
|
||||||
|
<Style ss:ID="Default" ss:Name="Normal">
|
||||||
|
<Alignment ss:Vertical="Bottom" />
|
||||||
|
<Borders />
|
||||||
|
<Font />
|
||||||
|
<Interior />
|
||||||
|
<NumberFormat />
|
||||||
|
<Protection />
|
||||||
|
</Style>
|
||||||
|
<Style ss:ID="s21">
|
||||||
|
<Font x:Family="Verdana" ss:Bold="1" />
|
||||||
|
</Style>
|
||||||
|
</Styles>
|
||||||
|
<Worksheet ss:Name="<%= worksheet %>">
|
||||||
|
<Table ss:ExpandedColumnCount="<%= columns_count %>" ss:ExpandedRowCount="<%= rows_count %>"
|
||||||
|
x:FullColumns="1" x:FullRows="1">
|
||||||
|
<%= rows %>
|
||||||
|
</Table>
|
||||||
|
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
|
||||||
|
<Print>
|
||||||
|
<ValidPrinterInfo />
|
||||||
|
<HorizontalResolution>600</HorizontalResolution>
|
||||||
|
<VerticalResolution>600</VerticalResolution>
|
||||||
|
</Print>
|
||||||
|
<Selected />
|
||||||
|
<Panes>
|
||||||
|
<Pane>
|
||||||
|
<Number>3</Number>
|
||||||
|
<ActiveRow>5</ActiveRow>
|
||||||
|
<ActiveCol>1</ActiveCol>
|
||||||
|
</Pane>
|
||||||
|
</Panes>
|
||||||
|
<ProtectObjects>False</ProtectObjects>
|
||||||
|
<ProtectScenarios>False</ProtectScenarios>
|
||||||
|
</WorksheetOptions>
|
||||||
|
</Worksheet>
|
||||||
|
</Workbook>
|
79
server/src/uds/templates/uds/admin/tmpl/test.html
Normal file
79
server/src/uds/templates/uds/admin/tmpl/test.html
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<?mso-application progid="Excel.Sheet"?>
|
||||||
|
<Workbook
|
||||||
|
xmlns="urn:schemas-microsoft-com:office:spreadsheet"
|
||||||
|
xmlns:o="urn:schemas-microsoft-com:office:office"
|
||||||
|
xmlns:x="urn:schemas-microsoft-com:office:excel"
|
||||||
|
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
|
||||||
|
xmlns:html="http://www.w3.org/TR/REC-html40">
|
||||||
|
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
|
||||||
|
<Author>Darl McBride</Author>
|
||||||
|
<LastAuthor>Bill Gates</LastAuthor>
|
||||||
|
<Created>2007-03-15T23:04:04Z</Created>
|
||||||
|
<Company>SCO Group, Inc.</Company>
|
||||||
|
<Version>11.8036</Version>
|
||||||
|
</DocumentProperties>
|
||||||
|
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
|
||||||
|
<WindowHeight>6795</WindowHeight>
|
||||||
|
<WindowWidth>8460</WindowWidth>
|
||||||
|
<WindowTopX>120</WindowTopX>
|
||||||
|
<WindowTopY>15</WindowTopY>
|
||||||
|
<ProtectStructure>False</ProtectStructure>
|
||||||
|
<ProtectWindows>False</ProtectWindows>
|
||||||
|
</ExcelWorkbook>
|
||||||
|
<Styles>
|
||||||
|
<Style ss:ID="Default" ss:Name="Normal">
|
||||||
|
<Alignment ss:Vertical="Bottom" />
|
||||||
|
<Borders />
|
||||||
|
<Font />
|
||||||
|
<Interior />
|
||||||
|
<NumberFormat />
|
||||||
|
<Protection />
|
||||||
|
</Style>
|
||||||
|
<Style ss:ID="s21">
|
||||||
|
<Font x:Family="Swiss" ss:Bold="1" />
|
||||||
|
</Style>
|
||||||
|
</Styles>
|
||||||
|
<Worksheet ss:Name="Sheet1">
|
||||||
|
<Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="5"
|
||||||
|
x:FullColumns="1" x:FullRows="1">
|
||||||
|
<Row>
|
||||||
|
<Cell>
|
||||||
|
<Data ss:Type="String">Texto en celda A1</Data>
|
||||||
|
</Cell>
|
||||||
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<Cell ss:StyleID="s21">
|
||||||
|
<Data ss:Type="String">Texto en negrita en celda A2</Data>
|
||||||
|
</Cell>
|
||||||
|
</Row>
|
||||||
|
<Row ss:Index="4">
|
||||||
|
<Cell ss:Index="2">
|
||||||
|
<Data ss:Type="Number">43</Data>
|
||||||
|
</Cell>
|
||||||
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<Cell ss:Index="2" ss:Formula="=R[-1]C/2">
|
||||||
|
<Data ss:Type="Number">21.5</Data>
|
||||||
|
</Cell>
|
||||||
|
</Row>
|
||||||
|
</Table>
|
||||||
|
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
|
||||||
|
<Print>
|
||||||
|
<ValidPrinterInfo />
|
||||||
|
<HorizontalResolution>600</HorizontalResolution>
|
||||||
|
<VerticalResolution>600</VerticalResolution>
|
||||||
|
</Print>
|
||||||
|
<Selected />
|
||||||
|
<Panes>
|
||||||
|
<Pane>
|
||||||
|
<Number>3</Number>
|
||||||
|
<ActiveRow>5</ActiveRow>
|
||||||
|
<ActiveCol>1</ActiveCol>
|
||||||
|
</Pane>
|
||||||
|
</Panes>
|
||||||
|
<ProtectObjects>False</ProtectObjects>
|
||||||
|
<ProtectScenarios>False</ProtectScenarios>
|
||||||
|
</WorksheetOptions>
|
||||||
|
</Worksheet>
|
||||||
|
</Workbook>
|
Loading…
Reference in New Issue
Block a user