Merge pull request #628 from charithag/master

UI/UX Improvements
revert-dabc3590
Amal Gunatilake 8 years ago committed by GitHub
commit 4fec9a2db6

@ -20,7 +20,7 @@ hw.sdCard=no
hw.sensors.orientation=yes hw.sensors.orientation=yes
hw.sensors.proximity=yes hw.sensors.proximity=yes
hw.trackBall=no hw.trackBall=no
image.sysdir.1=system-images/android-24/default/x86/ image.sysdir.1=system-images/android-23/default/x86/
skin.dynamic=no skin.dynamic=no
skin.name=720x1280 skin.name=720x1280
skin.path=720x1280 skin.path=720x1280

@ -56,48 +56,48 @@ getAndroidSDK() {
} }
createAVD() { createAVD() {
if [ ! -d "$ANDROID_TRYIT_SDK_HOME/platforms/android-24" ]; then if [ ! -d "$ANDROID_TRYIT_SDK_HOME/platforms/android-23" ]; then
echo echo
echo "Downloading Android platform..." echo "Downloading Android platform..."
cd $ANDROID_TRYIT_SDK_HOME cd $ANDROID_TRYIT_SDK_HOME
downloadArtifacts "https://dl.google.com/android/repository/platform-24_r02.zip" downloadArtifacts "https://dl.google.com/android/repository/platform-23_r03.zip"
echo -n "Configuring Android platform..." echo -n "Configuring Android platform..."
unzip -q platform-24_r02.zip unzip -q platform-23_r03.zip
mkdir -p platforms/android-24 mkdir -p platforms/android-23
mv android-7.0/* platforms/android-24/ mv android-6.0/* platforms/android-23/
rm -r android-7.0 rm -r android-6.0
rm platform-24_r02.zip rm platform-23_r03.zip
cd .. cd ..
echo " Done!" echo " Done!"
fi fi
if [ ! -d "$ANDROID_TRYIT_SDK_HOME/system-images/android-24/default" ]; then if [ ! -d "$ANDROID_TRYIT_SDK_HOME/system-images/android-23/default" ]; then
echo "Downloading Android system image..." echo "Downloading Android system image..."
cd $ANDROID_TRYIT_SDK_HOME cd $ANDROID_TRYIT_SDK_HOME
downloadArtifacts "https://dl.google.com/android/repository/sys-img/android/x86-24_r07.zip" downloadArtifacts "https://dl.google.com/android/repository/sys-img/android/x86-23_r09.zip"
echo -n "Configuring Android system image..." echo -n "Configuring Android system image..."
unzip -q x86-24_r07.zip unzip -q x86-23_r09.zip
mkdir -p system-images/android-24/default mkdir -p system-images/android-23/default
mv x86 system-images/android-24/default mv x86 system-images/android-23/default
rm x86-24_r07.zip rm x86-23_r09.zip
cd .. cd ..
echo " Done!" echo " Done!"
fi fi
echo "Creating a new AVD device" echo "Creating a new AVD device"
if [ -f "$ANDROID_TRYIT_SDK_HOME/tools/bin/avdmanager" ]; then if [ -f "$ANDROID_TRYIT_SDK_HOME/tools/bin/avdmanager" ]; then
$ANDROID_TRYIT_SDK_HOME/tools/bin/avdmanager create avd -k 'system-images;android-24;default;x86' -n WSO2_AVD $ANDROID_TRYIT_SDK_HOME/tools/bin/avdmanager create avd -k 'system-images;android-23;default;x86' -n WSO2_AVD
else else
$ANDROID_TRYIT_SDK_HOME/tools/android create avd -n WSO2_AVD -t android-24 $ANDROID_TRYIT_SDK_HOME/tools/android create avd -n WSO2_AVD -t android-23
fi fi
rm $HOME/.android/avd/WSO2_AVD.avd/resources/config.ini rm $HOME/.android/avd/WSO2_AVD.avd/config.ini
cp $SCRIPT_HOME/resources/config.ini $HOME/.android/avd/WSO2_AVD.avd/ cp $SCRIPT_HOME/resources/config.ini $HOME/.android/avd/WSO2_AVD.avd/
startAVD startAVD
} }
startAVD() { startAVD() {
if [ ! -d "$HOME/.android/avd/WSO2_AVD.avd" ]; then if [ ! -d "$HOME/.android/avd/WSO2_AVD.avd" ]; then
echo -n "Seems you don't have WSO2_AVD. Do you want to create WSO2_AVD with default configs (y/N)?: " echo -n "Looks you don't have the WSO2_AVD. Do you want to create WSO2_AVD with default configs (Y/n)?: "
read answer read answer
if echo "$answer" | grep -iq "^y" ;then if ! echo "$answer" | grep -iq "^n" ;then
createAVD createAVD
return return
fi fi
@ -178,12 +178,12 @@ echo "| WSO2 Android Tryit |"
echo "+----------------------------------------------------------------+" echo "+----------------------------------------------------------------+"
echo "Detected OS: " $OSTYPE echo "Detected OS: " $OSTYPE
if [ ! -f "sdklocation" ]; then if [ ! -f "sdklocation" ]; then
echo -n "Do you have Android SDK installed in your computer (Y/n)?: " echo -n "Do you have an Android SDK installed on your computer (y/N)?: "
read answer read answer
if echo "$answer" | grep -iq "^n" ;then if echo "$answer" | grep -iq "^y" ;then
getAndroidSDK
else
setSDKPath setSDKPath
else
getAndroidSDK
fi fi
fi fi
export ANDROID_TRYIT_SDK_HOME=$(<sdklocation) export ANDROID_TRYIT_SDK_HOME=$(<sdklocation)

@ -60,4 +60,11 @@ hr {
} }
.enrollment-qr-container canvas { .enrollment-qr-container canvas {
width: 14%; width: 14%;
}
@media (min-width:992px){
.add-min-height {
min-height: 115px;
}
} }

@ -378,7 +378,7 @@ $(document).ready(function () {
// on error // on error
function () { function () {
var content = "<li class='message message-danger'><h4><i class='icon fw fw-error'></i>Warning</h4>" + var content = "<li class='message message-danger'><h4><i class='icon fw fw-error'></i>Warning</h4>" +
"<p>Unexpected error occurred while loading notification. Please refresh the page and" + "<p>Unexpected error occurred while loading notification. Please refresh the pa{{#if isCloud}}ge and" +
" try again</p></li>"; " try again</p></li>";
$(messageSideBar).html(content); $(messageSideBar).html(content);
} }

@ -25,13 +25,24 @@
class="btn-operations remove-margin download_agent"> class="btn-operations remove-margin download_agent">
<i class="fw fw-download fw-inverse fw-lg add-margin-1x"></i> Download Try-it Emulator</a></div> <i class="fw fw-download fw-inverse fw-lg add-margin-1x"></i> Download Try-it Emulator</a></div>
{{else}} {{else}}
<h3 class="text-center">Scan to download the Android Agent.</h3> <h3 class="text-center">Scan to get the Android Agent.</h3>
<div class="enrollment-qr-container text-center"></div> <div class="enrollment-qr-container text-center"></div>
<h3 class="text-center add-margin-bottom-2x add-margin-top-2x">or</h3> <h3 class="text-center add-margin-bottom-2x add-margin-top-2x">or</h3>
<div class="text-center"><a {{#if isCloud}}
href="{{host}}/android-web-agent/public/mdm.page.enrollments.android.download-agent/asset/android-agent.apk" <div class="text-center">
<a href='https://play.google.com/store/apps/details?id=org.wso2.iot.agent&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'
target="_blank">
<img alt='Get it on Google Play'
src='{{@unit.publicUri}}/images/en_badge_web_generic_export.png'/>
</a>
</div>
{{else}}
<div class="text-center">
<a href="{{host}}/android-web-agent/public/mdm.page.enrollments.android.download-agent/asset/android-agent.apk"
class="btn-operations remove-margin download_agent"> class="btn-operations remove-margin download_agent">
<i class="fw fw-download fw-inverse fw-lg add-margin-1x"></i> Download APK</a></div> <i class="fw fw-download fw-inverse fw-lg add-margin-1x"></i> Download APK</a>
</div>
{{/if}}
{{/if}} {{/if}}
</div> </div>
<!--<p class="doc-link">Please scan the QR code to download the APK on to your android device or click <!--<p class="doc-link">Please scan the QR code to download the APK on to your android device or click
@ -63,41 +74,84 @@
{{#if isCloud}} {{#if isCloud}}
<div class="row grey-bg"> <div class="row grey-bg">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 col-md-offset-1 col-lg-offset-1 add-padding-top-2x add-padding-bottom-2x"> <div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 col-md-offset-1 col-lg-offset-1 add-padding-top-2x add-padding-bottom-2x">
<h5><strong>Step 1</strong></h5> <h5><strong>Step 1</strong></h5>
{{#if isVirtual}} {{#if isVirtual}}
<ol> <div class="add-min-height">
<li>Unzip the 'android-tryit.zip and run 'start' script in your terminal.</li> <ol>
<li>If you already have android sdk in your computer, please provide location of the sdk. <li>Unzip the 'android-tryit.zip file and run the 'start' script on your terminal.</li>
Otherwise this tool will download and install minimum SDK components which needs to run the emulator. <li>Download and install the Android SDK.
This is a one time process.</li> <ul>
<li>This tool will ask to create AVD if you don't have any in your computer. <li>If you already have an Android SDK on your computer, please provide the location of the SDK.</li>
Otherwise you can select existing AVD to try out IoT Agent.</li> <li>Else, this tool will download and install the minimum SDK components required to run the emulator.
</ol> This is a one-time process.</li>
<img src="{{@unit.publicUri}}/images/android-tryit.png" class="img-responsive"> </ul>
{{else}} </li>
<p>Let's start by installing the Android agent on your device. Open the downloaded file, and tap <li>Next, you will be asked to create an AVD:
<b>INSTALL</b>.</p> <ul>
<img src="{{@unit.publicUri}}/images/install_agent.png" class="img-responsive"> <li>If you don't have one, the WSO2_AVD will be created for you.</li>
{{/if}} <li>Else, you can use an existing AVD to try out IoT Android agent.</li>
</ul>
</li>
</ol>
</div>
<img src="{{@unit.publicUri}}/images/android-tryit.png" class="img-responsive">
{{else}}
<div class="add-min-height">
<p>Let's start by opening the Android agent on your device.
<br/>Tap on <b>WSO2 Device Management Agent</b>.
</p>
</div>
<img src="{{@unit.publicUri}}/images/launch_agent.png" class="img-responsive">
{{/if}}
</div> </div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 col-md-offset-2 col-lg-offset-2 add-padding-top-2x add-padding-bottom-2x"> <div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 col-md-offset-1 col-lg-offset-1 add-padding-top-2x add-padding-bottom-2x">
<h5><strong>Step 2</strong></h5> <h5><strong>Step 2</strong></h5>
<p>Enter your:<p> <div class="add-min-height">
<ul> <p>Enter your:
<li>Organization: <b>{{@user.domain}}</b></li> <p>
<li>Username: <b>{{@user.username}}</b></li> <ul>
<li>Password: <i>The WSO2 Cloud password.</i></li> <li>Organization: <b>{{@user.domain}}</b></li>
</ul> <li>Username: <b>{{@user.username}}</b></li>
<img src="{{@unit.publicUri}}/images/login.png" class="img-responsive"> <li>Password: <i>The WSO2 Cloud password.</i></li>
</ul>
</div>
<img src="{{@unit.publicUri}}/images/register.png" class="img-responsive">
</div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 col-md-offset-1 col-lg-offset-1 add-padding-top-2x add-padding-bottom-2x">
<h5><strong>Step 3</strong></h5>
<div class="add-min-height">
<p>When prompt, allow necessary permissions and activate device admin.</p>
</div>
<img src="{{@unit.publicUri}}/images/activate_deviceadmin.png" class="img-responsive">
</div> </div>
{{else}} {{else}}
<div class="row grey-bg"> <div class="row grey-bg">
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 add-padding-top-2x add-padding-bottom-2x"> <div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 add-padding-top-2x add-padding-bottom-2x">
<h5><strong>Step 1</strong></h5> <h5><strong>Step 1</strong></h5>
<p>Let's start by installing the Android agent on your device. Open the downloaded file, and tap {{#if isVirtual}}
<b>INSTALL</b>.</p> <ol>
<img src="{{@unit.publicUri}}/images/install_agent.png" class="img-responsive"> <li>Unzip the 'android-tryit.zip file and run the 'start' script on your terminal.</li>
<li>Download and install the Android SDK.
<ul>
<li>If you already have an Android SDK on your computer, please provide the location of the SDK.</li>
<li>Else, this tool will download and install the minimum SDK components required to run the emulator.
This is a one-time process.</li>
</ul>
</li>
<li>Next, you will be asked to create an AVD:
<ul>
<li>If you don't have one, the WSO2_AVD will be created for you.</li>
<li>Else, you can use an existing AVD to try out IoT Android agent.</li>
</ul>
</li>
</ol>
<img src="{{@unit.publicUri}}/images/android-tryit.png" class="img-responsive">
{{else}}
<p>Let's start by installing the Android agent on your device. Open the downloaded file, and tap
<b>INSTALL</b>.</p>
<img src="{{@unit.publicUri}}/images/install_agent.png" class="img-responsive">
{{/if}}
</div> </div>
<div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 add-padding-top-2x add-padding-bottom-2x"> <div class="col-xs-12 col-sm-6 col-md-3 col-lg-3 add-padding-top-2x add-padding-bottom-2x">
@ -115,11 +169,11 @@
<p>Enter your: <p>Enter your:
<p> <p>
<ul> <ul>
<li>Username: username/email that you used to sign in to IoT server.</li> <li>Organization: <b>{{@user.domain}}</b></li>
<li>Password: the WSO2 Iot server password.</li> <li>Username: <b>{{@user.username}}</b></li>
<li>Domain: the name of the domain.</li> <li>Password: <i>The WSO2 Cloud password.</i></li>
</ul> </ul>
<img src="{{@unit.publicUri}}/images/install_agent.png" class="img-responsive"> <img src="{{@unit.publicUri}}/images/register.png" class="img-responsive">
</div> </div>
{{/if}} {{/if}}

@ -16,27 +16,32 @@
* under the License. * under the License.
*/ */
function onRequest(context){ function onRequest(context) {
var viewModel = {}; var viewModel = {};
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
//uncomment this to enable analytics artifact deployment //uncomment this to enable analytics artifact deployment
//var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"]; //var serviceInvokers = require("/app/modules/oauth/token-protected-service-invokers.js")["invokers"];
//var url = devicemgtProps["httpsURL"] + "/api/device-mgt/v1.0/admin/devicetype/deploy/android/status"; //var url = devicemgtProps["httpsURL"] + "/api/device-mgt/v1.0/admin/devicetype/deploy/android/status";
//serviceInvokers.XMLHttp.get( //serviceInvokers.XMLHttp.get(
// url, function (responsePayload) { // url, function (responsePayload) {
// var responseContent = responsePayload.status; // var responseContent = responsePayload.status;
// new Log().error(responseContent); // new Log().error(responseContent);
// if ("204" == responsePayload.status) { // if ("204" == responsePayload.status) {
// viewModel["displayStatus"] = "Display"; // viewModel["displayStatus"] = "Display";
// } // }
// }, // },
// function (responsePayload) { // function (responsePayload) {
// //do nothing. // //do nothing.
// } // }
//); //);
var isCloud = devicemgtProps["isCloud"];
viewModel["isVirtual"] = request.getParameter("type") == 'virtual'; viewModel["isVirtual"] = request.getParameter("type") == 'virtual';
viewModel["isCloud"] = devicemgtProps["isCloud"]; viewModel["isCloud"] = isCloud;
viewModel["hostName"] = devicemgtProps["httpsURL"]; viewModel["hostName"] = devicemgtProps["httpsURL"];
viewModel["enrollmentURL"] = devicemgtProps["generalConfig"]["host"] + devicemgtProps["androidEnrollmentDir"]; if (isCloud) {
viewModel["enrollmentURL"] = "https://play.google.com/store/apps/details?id=org.wso2.iot.agent";
} else {
viewModel["enrollmentURL"] = devicemgtProps["generalConfig"]["host"] + devicemgtProps["androidEnrollmentDir"];
}
return viewModel; return viewModel;
} }
Loading…
Cancel
Save