add a settings page to DS that uses handlebars template library

This commit is contained in:
Stephen Birarda 2014-06-24 12:33:40 -07:00
parent bb0d0d067e
commit afe2e57701
8 changed files with 96 additions and 4 deletions

View file

@ -25,11 +25,11 @@ setup_hifi_project(${TARGET_NAME} TRUE)
# remove and then copy the files for the webserver
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E remove_directory
$<TARGET_FILE_DIR:${TARGET_NAME}>/resources/web)
$<TARGET_FILE_DIR:${TARGET_NAME}>/resources)
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${PROJECT_SOURCE_DIR}/resources/web"
$<TARGET_FILE_DIR:${TARGET_NAME}>/resources/web)
"${PROJECT_SOURCE_DIR}/resources"
$<TARGET_FILE_DIR:${TARGET_NAME}>/resources)
# link the shared hifi library
include(${MACRO_DIR}/LinkHifiLibrary.cmake)

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,8 @@
$(document).ready(function(){
$.getJSON('describe.json', function(data){
var source = $('#template').html();
var template = Handlebars.compile(source);
$('#settings').html(template(data));
});
});

View file

@ -0,0 +1,10 @@
{
"groups": {
"Audio": {
"unattenuated-zone": {
"label": "Unattenuated Zone",
"desc": "Define two axis-aligned boxes for an unattenuated zone of audio (source x, source y, source z, size x, size y, size z, listener x, listener y, listener z)"
}
}
}
}

View file

@ -0,0 +1,13 @@
<!--#include virtual="header.html"-->
<script id="template" type="text/x-handlebars-template">
{{#each groups}}
<h1>{{@key}}</h1>
{{/each}}
</script>
<div id="settings">
</div>
<!--#include virtual="footer.html"-->
<script src='/js/settings.js'></script>
<script src='/js/handlebars-v1.3.0.min.js'></script>
<!--#include virtual="page-end.html"-->

View file

@ -1162,7 +1162,7 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
}
}
// didn't process the request, let the HTTPManager try and handle
// didn't process the request, let our HTTPManager handle
return false;
}

View file

@ -0,0 +1,12 @@
//
// DomainServerSettingsManager.cpp
// domain-server/src
//
// Created by Stephen Birarda on 2014-06-24.
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "DomainServerSettingsManager.h"

View file

@ -0,0 +1,21 @@
//
// DomainServerSettingsManager.h
// domain-server/src
//
// Created by Stephen Birarda on 2014-06-24.
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_DomainServerSettingsManager_h
#define hifi_DomainServerSettingsManager_h
#include <QtCore/QJsonDocument>
class DomainServerSettingsManager {
};
#endif // hifi_DomainServerSettingsManager_h