mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-16 10:33:52 +02:00
add a settings page to DS that uses handlebars template library
This commit is contained in:
parent
bb0d0d067e
commit
afe2e57701
8 changed files with 96 additions and 4 deletions
|
@ -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)
|
||||
|
|
28
domain-server/resources/web/js/handlebars-v1.3.0.min.js
vendored
Normal file
28
domain-server/resources/web/js/handlebars-v1.3.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8
domain-server/resources/web/js/settings.js
Normal file
8
domain-server/resources/web/js/settings.js
Normal 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));
|
||||
});
|
||||
});
|
10
domain-server/resources/web/settings/describe.json
Normal file
10
domain-server/resources/web/settings/describe.json
Normal 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)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
13
domain-server/resources/web/settings/index.shtml
Normal file
13
domain-server/resources/web/settings/index.shtml
Normal 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"-->
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
12
domain-server/src/DomainServerSettingsManager.cpp
Normal file
12
domain-server/src/DomainServerSettingsManager.cpp
Normal 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"
|
21
domain-server/src/DomainServerSettingsManager.h
Normal file
21
domain-server/src/DomainServerSettingsManager.h
Normal 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
|
Loading…
Reference in a new issue