Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tttttangTH committed Oct 2, 2020
1 parent 12d65fd commit dd61aef
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 58 deletions.
50 changes: 50 additions & 0 deletions script/_nginx_server_install
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
#
# Copyright (c) 2020, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#

nginx_configure()
{
if command -v nginx; then

top_dir="$(pwd)"

nginx_conf_file=$(nginx -V 2>&1 | grep -o "\-\-conf-path=\(.*conf\)" | cut -d "=" -f2)

sudo rm "${nginx_conf_file}"

sudo cp "${top_dir}"/etc/rest/nginx.conf "${nginx_conf_file}"

sudo sed -i.bak "s:to be set:${top_dir}/src/rest/frontend:" "${nginx_conf_file}"

else

echo >&2 ' *** WARNING: nginx not found, please install nginx manually and run setup again'

fi

}
2 changes: 1 addition & 1 deletion script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ install_packages_rpm()

install_packages_brew()
{
brew install boost cmake cpputest dbus jsoncpp ninja nginx
brew install cmake cpputest dbus ninja nginx
}

install_packages_source()
Expand Down
2 changes: 1 addition & 1 deletion script/setup
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ main()
dns64_install
network_manager_install
dhcpv6_pd_install
nginx_configure
nginx_server_install
otbr_install
. "$AFTER_HOOK"
}
Expand Down
1 change: 1 addition & 0 deletions src/rest/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ void Connection::ProcessWaitRead(fd_set &aReadFdSet)
// Check second failure situation : received = -1 error(indicates that our system call read raise an error )
// then try to send back a response that there is an internal error.
VerifyOrExit(received > 0 || (received == -1 && (err == EAGAIN || err == EWOULDBLOCK)), error = OTBR_ERROR_REST);

exit:

if (error != OTBR_ERROR_NONE)
Expand Down
8 changes: 4 additions & 4 deletions src/rest/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ <h4>Commission</h4>



<button ng-disabled="graphState == 1" class="mdl-button mdl-js-button mdl-button--raised" ng-click="showTopology()">Reload</button>
<button ng-disabled="topologyIsLoading" class="mdl-button mdl-js-button mdl-button--raised" ng-click="showTopology()">Reload</button>


</div>
Expand All @@ -343,18 +343,18 @@ <h4>Commission</h4>
</div>

<div class="mdl-graphs mdl-shadow--1dp mdl-cell mdl-cell--9-col" ng-show="menu[6].show">
<div ng-show="graphState==2" class="d3graph" id="topograph">
<div ng-show="topologyIsReady" class="d3graph" id="topograph">
</div>


<div ng-show="graphState==1" class="load_content">
<div ng-show="topologyIsLoading" class="load_content">
<div class="mdl-spinner mdl-js-spinner is-active"></div>


</div>

</div>
<div ng-show="graphState==2 && menu[6].show " class="demo-cards mdl-cell mdl-cell--top mdl-cell--3-col mdl-cell--8-col-tablet mdl-grid mdl-grid--no-spacing">
<div ng-show="topologyIsReady && menu[6].show " class="demo-cards mdl-cell mdl-cell--top mdl-cell--3-col mdl-cell--8-col-tablet mdl-grid mdl-grid--no-spacing">
<div class="demo-updates mdl-card mdl-shadow--1dp mdl-cell mdl-cell--3-col mdl-cell--3-col-tablet mdl-cell--12-col-desktop">
<div class="detailContainer">
<div class="detailElement" ng-if="isObject(detailList) && isObject(nodeDetailInfo) "ng-repeat="(key, data) in detailList track by $index">
Expand Down
Loading

0 comments on commit dd61aef

Please sign in to comment.