moved artifact deployment to the platform configuration

revert-dabc3590
ayyoob 8 years ago
parent cfab3b1b81
commit 06d646c87a

@ -27,22 +27,32 @@
class="alert alert-danger hidden" role="alert"> class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span> <i class="icon fw fw-error"></i><span></span>
</div> </div>
<div class="wr-input-control"> <div class="wr-input-control wr-btn-grp">
<label class="wr-input-label" for="email-config-host"> <button id="save-general-btn" class="wr-btn" onclick="artifactUpload();">
Mqtt Endpoint Deploy Analytics Artifacts
<span class="helper" title="SMTP Server Host"> </button>
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</div>
</div>
</div>
<div id="androidsense-statistic-response-template" style="display: none">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i id="status-icon" class="fw fw-error fw-stack-1x"></i>
</span> </span>
<br> <br>
</label> </h3>
<input id="mqtt-endpoint" type="text" class="form-control" <h4>
placeholder="[ Required Field ]"> <span id="title"></span>
<br> <br>
</h4>
<span id="description"></span>
</div> </div>
<div class="wr-input-control wr-btn-grp">
<button id="save-general-btn" class="wr-btn" onclick="addConfiguration();">
Save
</button>
</div> </div>
</div> </div>
</div> </div>

@ -95,3 +95,30 @@ var addConfiguration = function () {
} }
); );
}; };
function artifactUpload() {
var contentType = "application/json";
var backendEndBasePath = "/api/device-mgt/v1.0";
var urix = backendEndBasePath + "/admin/devicetype/deploy/android_sense";
var defaultStatusClasses = "fw fw-stack-1x";
var content = $("#androidsense-statistic-response-template").find(".content");
var title = content.find("#title");
var statusIcon = content.find("#status-icon");
var data = {}
invokerUtil.post(urix, data, function (data) {
title.html("Deploying statistic artifacts. Please wait...");
statusIcon.attr("class", defaultStatusClasses + " fw-check");
$(modalPopupContent).html(content.html());
showPopup();
setTimeout(function () {
hidePopup();
location.reload(true);
}, 5000);
}, function (jqXHR) {
title.html("Failed to deploy artifacts, Please contact administrator.");
statusIcon.attr("class", defaultStatusClasses + " fw-error");
$(modalPopupContent).html(content.html());
showPopup();
}, contentType);
}

@ -73,30 +73,3 @@ function attachEvents() {
} }
} }
function artifactUpload() {
var contentType = "application/json";
var urix = backendEndBasePath + "/admin/devicetype/deploy/android_sense";
var defaultStatusClasses = "fw fw-stack-1x";
var content = $("#androidsense-statistic-response-template").find(".content");
var title = content.find("#title");
var statusIcon = content.find("#status-icon");
var data = {}
invokerUtil.post(urix, data, function (data) {
title.html("Deploying statistic artifacts. Please wait...");
statusIcon.attr("class", defaultStatusClasses + " fw-check");
$(modalPopupContent).html(content.html());
showPopup();
setTimeout(function () {
hidePopup();
location.reload(true);
}, 5000);
}, function (jqXHR) {
title.html("Failed to deploy artifacts, Please contact administrator.");
statusIcon.attr("class", defaultStatusClasses + " fw-error");
$(modalPopupContent).html(content.html());
showPopup();
}, contentType);
}

@ -41,9 +41,6 @@
<a href="#" class="download-link btn-operations"><i class="fw fw-mobile fw-inverse fw-lg add-margin-1x"></i> Enroll Device</a> <a href="#" class="download-link btn-operations"><i class="fw fw-mobile fw-inverse fw-lg add-margin-1x"></i> Enroll Device</a>
<a href="{{hostName}}{{@unit.publicUri}}/asset/androidsense.apk" class="btn-operations"><i class="fw fw-download fw-inverse fw-lg add-margin-1x"></i> Download APK</a> <a href="{{hostName}}{{@unit.publicUri}}/asset/androidsense.apk" class="btn-operations"><i class="fw fw-download fw-inverse fw-lg add-margin-1x"></i> Download APK</a>
<a href="javascript:toggleEmailInvite()" class="btn-operations"><i class="fw fw-mail fw-inverse fw-lg add-margin-1x"></i> Invite by Email</a> <a href="javascript:toggleEmailInvite()" class="btn-operations"><i class="fw fw-mail fw-inverse fw-lg add-margin-1x"></i> Invite by Email</a>
{{#if permissions.IS_ADMIN}}
<a href="javascript:artifactUpload()" class="btn-operations"><i class="fw fw-upload fw-inverse fw-lg add-margin-1x"></i> Deploy Analytics Artifacts</a>
{{/if}}
<p class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS300/Android+Sense" <p class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS300/Android+Sense"
target="_blank">[ here ]</a> for latest instructions and target="_blank">[ here ]</a> for latest instructions and
troubleshooting.</p> troubleshooting.</p>

@ -27,33 +27,32 @@
class="alert alert-danger hidden" role="alert"> class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span> <i class="icon fw fw-error"></i><span></span>
</div> </div>
<div class="wr-input-control">
<label class="wr-input-label" for="email-config-host">
Http Server IP
<span class="helper" title="SMTP Server Host">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<br>
</label>
<input id="http-endpoint" type="text" class="form-control"
placeholder="[ Required Field ]">
<br>
<label class="wr-input-label" for="email-config-host"> <div class="wr-input-control wr-btn-grp">
Http Server Port <button id="save-general-btn" class="wr-btn" onclick="artifactUpload();">
<span class="helper" title="SMTP Server Host"> Deploy Analytics Artifacts
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span> </button>
</div>
</div>
</div>
<div id="arduino-statistic-response-template" style="display: none">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i id="status-icon" class="fw fw-error fw-stack-1x"></i>
</span> </span>
<br> <br>
</label> </h3>
<input id="https-endpoint" type="text" class="form-control" <h4>
placeholder="[ Required Field ]"> <span id="title"></span>
<br> <br>
</h4>
<span id="description"></span>
</div> </div>
<div class="wr-input-control wr-btn-grp">
<button id="save-general-btn" class="wr-btn" onclick="addConfiguration();">
Save
</button>
</div> </div>
</div> </div>
</div> </div>

@ -103,3 +103,30 @@ var addConfiguration = function () {
} }
); );
}; };
function artifactUpload() {
var contentType = "application/json";
var backendEndBasePath = "/api/device-mgt/v1.0";
var urix = backendEndBasePath + "/admin/devicetype/deploy/arduino";
var defaultStatusClasses = "fw fw-stack-1x";
var content = $("#arduino-statistic-response-template").find(".content");
var title = content.find("#title");
var statusIcon = content.find("#status-icon");
var data = {}
invokerUtil.post(urix, data, function (data) {
title.html("Deploying statistic artifacts. Please wait...");
statusIcon.attr("class", defaultStatusClasses + " fw-check");
$(modalPopupContent).html(content.html());
showPopup();
setTimeout(function () {
hidePopup();
location.reload(true);
}, 5000);
}, function (jqXHR) {
title.html("Failed to deploy artifacts, Please contact administrator.");
statusIcon.attr("class", defaultStatusClasses + " fw-error");
$(modalPopupContent).html(content.html());
showPopup();
}, contentType);
}

@ -184,30 +184,3 @@ function doAction(data) {
}); });
} }
} }
function artifactUpload() {
var contentType = "application/json";
var urix = backendEndBasePath + "/admin/devicetype/deploy/arduino";
var defaultStatusClasses = "fw fw-stack-1x";
var content = $("#arduino-statistic-response-template").find(".content");
var title = content.find("#title");
var statusIcon = content.find("#status-icon");
var data = {}
invokerUtil.post(urix, data, function (data) {
title.html("Deploying statistic artifacts. Please wait...");
statusIcon.attr("class", defaultStatusClasses + " fw-check");
$(modalPopupContent).html(content.html());
showPopup();
setTimeout(function () {
hidePopup();
location.reload(true);
}, 5000);
}, function (jqXHR) {
title.html("Failed to deploy artifacts, Please contact administrator.");
statusIcon.attr("class", defaultStatusClasses + " fw-error");
$(modalPopupContent).html(content.html());
showPopup();
}, contentType);
}

@ -66,11 +66,6 @@
<a href="#" class="download-link btn-operations"> <a href="#" class="download-link btn-operations">
<i class="fw fw-download add-margin-1x"></i>Download Sketch <i class="fw fw-download add-margin-1x"></i>Download Sketch
</a> </a>
{{#if permissions.IS_ADMIN}}
<a href="javascript:artifactUpload()" class="btn-operations"><i
class="fw fw-upload fw-inverse fw-lg add-margin-1x"></i> Deploy Analytics Artifacts</a>
{{/if}}
<p class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS300/Arduino" <p class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS300/Arduino"
target="_blank">here</a> for latest instructions and target="_blank">here</a> for latest instructions and
troubleshooting.</p> troubleshooting.</p>

@ -27,43 +27,32 @@
class="alert alert-danger hidden" role="alert"> class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span> <i class="icon fw fw-error"></i><span></span>
</div> </div>
<div class="wr-input-control"> <div class="wr-input-control wr-btn-grp">
<label class="wr-input-label" for="email-config-host"> <button id="save-general-btn" class="wr-btn" onclick="artifactUpload();">
Http Endpoint Deploy Analytics Artifacts
<span class="helper" title="SMTP Server Host"> </button>
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<br>
</label>
<input id="http-endpoint" type="text" class="form-control"
placeholder="[ Required Field ]">
<br>
<label class="wr-input-label" for="email-config-host"> </div>
Https Endpoint </div>
<span class="helper" title="SMTP Server Host"> </div>
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span> <div id="raspberrypi-statistic-response-template" style="display: none">
<br> <div class="content">
</label> <div class="row">
<input id="https-endpoint" type="text" class="form-control" <div class="col-lg-5 col-md-6 col-centered">
placeholder="[ Required Field ]"> <h3>
<br> <span class="fw-stack">
<label class="wr-input-label" for="email-config-host"> <i class="fw fw-circle-outline fw-stack-2x"></i>
Mqtt Endpoint <i id="status-icon" class="fw fw-error fw-stack-1x"></i>
<span class="helper" title="SMTP Server Host">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span> </span>
<br> <br>
</label> </h3>
<input id="mqtt-endpoint" type="text" class="form-control" <h4>
placeholder="[ Required Field ]"> <span id="title"></span>
<br> <br>
</h4>
<span id="description"></span>
</div> </div>
<div class="wr-input-control wr-btn-grp">
<button id="save-general-btn" class="wr-btn" onclick="addConfiguration();">
Save
</button>
</div> </div>
</div> </div>
</div> </div>

@ -113,3 +113,30 @@ var addConfiguration = function () {
} }
); );
}; };
function artifactUpload() {
var contentType = "application/json";
var backendEndBasePath = "/api/device-mgt/v1.0";
var urix = backendEndBasePath + "/admin/devicetype/deploy/raspberrypi";
var defaultStatusClasses = "fw fw-stack-1x";
var content = $("#raspberrypi-statistic-response-template").find(".content");
var title = content.find("#title");
var statusIcon = content.find("#status-icon");
var data = {}
invokerUtil.post(urix, data, function (data) {
title.html("Deploying statistic artifacts. Please wait...");
statusIcon.attr("class", defaultStatusClasses + " fw-check");
$(modalPopupContent).html(content.html());
showPopup();
setTimeout(function () {
hidePopup();
location.reload(true);
}, 5000);
}, function (jqXHR) {
title.html("Failed to deploy artifacts, Please contact administrator.");
statusIcon.attr("class", defaultStatusClasses + " fw-error");
$(modalPopupContent).html(content.html());
showPopup();
}, contentType);
}

@ -183,30 +183,3 @@ function doAction(data) {
}); });
} }
} }
function artifactUpload() {
var contentType = "application/json";
var urix = backendEndBasePath + "/admin/devicetype/deploy/raspberrypi";
var defaultStatusClasses = "fw fw-stack-1x";
var content = $("#raspberrypi-statistic-response-template").find(".content");
var title = content.find("#title");
var statusIcon = content.find("#status-icon");
var data = {}
invokerUtil.post(urix, data, function (data) {
title.html("Deploying statistic artifacts. Please wait...");
statusIcon.attr("class", defaultStatusClasses + " fw-check");
$(modalPopupContent).html(content.html());
showPopup();
setTimeout(function () {
hidePopup();
location.reload(true);
}, 5000);
}, function (jqXHR) {
title.html("Failed to deploy artifacts, Please contact administrator.");
statusIcon.attr("class", defaultStatusClasses + " fw-error");
$(modalPopupContent).html(content.html());
showPopup();
}, contentType);
}

@ -61,9 +61,6 @@
<a href="#" class="download-link btn-operations"> <a href="#" class="download-link btn-operations">
<i class="fw fw-download add-margin-1x"></i>Download Agent <i class="fw fw-download add-margin-1x"></i>Download Agent
</a> </a>
{{#if permissions.IS_ADMIN}}
<a href="javascript:artifactUpload()" class="btn-operations"><i class="fw fw-upload fw-inverse fw-lg add-margin-1x"></i> Deploy Analytics Artifacts</a>
{{/if}}
<p class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS300/Raspberry+Pi" <p class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS300/Raspberry+Pi"
target="_blank">here</a> for latest instructions and target="_blank">here</a> for latest instructions and

@ -28,43 +28,32 @@
class="alert alert-danger hidden" role="alert"> class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span> <i class="icon fw fw-error"></i><span></span>
</div> </div>
<div class="wr-input-control"> <div class="wr-input-control wr-btn-grp">
<label class="wr-input-label" for="email-config-host"> <button id="save-general-btn" class="wr-btn" onclick="artifactUpload();">
Http Endpoint Deploy Analytics Artifacts
<span class="helper" title="SMTP Server Host"> </button>
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span>
<br>
</label>
<input id="http-endpoint" type="text" class="form-control"
placeholder="[ Required Field ]">
<br>
<label class="wr-input-label" for="email-config-host"> </div>
Https Endpoint </div>
<span class="helper" title="SMTP Server Host"> </div>
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span> <div id="virtual-firealarm-statistic-response-template" style="display: none">
<br> <div class="content">
</label> <div class="row">
<input id="https-endpoint" type="text" class="form-control" <div class="col-lg-5 col-md-6 col-centered">
placeholder="[ Required Field ]"> <h3>
<br> <span class="fw-stack">
<label class="wr-input-label" for="email-config-host"> <i class="fw fw-circle-outline fw-stack-2x"></i>
Mqtt Endpoint <i id="status-icon" class="fw fw-error fw-stack-1x"></i>
<span class="helper" title="SMTP Server Host">
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
</span> </span>
<br> <br>
</label> </h3>
<input id="mqtt-endpoint" type="text" class="form-control" <h4>
placeholder="[ Required Field ]"> <span id="title"></span>
<br> <br>
</h4>
<span id="description"></span>
</div> </div>
<div class="wr-input-control wr-btn-grp">
<button id="save-general-btn-virtualfirealarm" class="wr-btn" onclick="addConfiguration();">
Save
</button>
</div> </div>
</div> </div>
</div> </div>

@ -0,0 +1,24 @@
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
function onRequest(context){
var viewModel = {};
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
viewModel["permissions"] = userModule.getUIPermissions();
return viewModel;
}

@ -103,3 +103,30 @@ var addConfiguration = function () {
} }
); );
}; };
function artifactUpload() {
var contentType = "application/json";
var backendEndBasePath = "/api/device-mgt/v1.0";
var urix = backendEndBasePath + "/admin/devicetype/deploy/virtual_firealarm";
var defaultStatusClasses = "fw fw-stack-1x";
var content = $("#virtual-firealarm-statistic-response-template").find(".content");
var title = content.find("#title");
var statusIcon = content.find("#status-icon");
var data = {}
invokerUtil.post(urix, data, function (data) {
title.html("Deploying statistic artifacts. Please wait...");
statusIcon.attr("class", defaultStatusClasses + " fw-check");
$(modalPopupContent).html(content.html());
showPopup();
setTimeout(function () {
hidePopup();
location.reload(true);
}, 5000);
}, function (jqXHR) {
title.html("Failed to deploy artifacts, Please contact administrator.");
statusIcon.attr("class", defaultStatusClasses + " fw-error");
$(modalPopupContent).html(content.html());
showPopup();
}, contentType);
}

@ -135,30 +135,3 @@ function doAction(data) {
}); });
} }
} }
function artifactUpload() {
var contentType = "application/json";
var urix = backendEndBasePath + "/admin/devicetype/deploy/virtual_firealarm";
var defaultStatusClasses = "fw fw-stack-1x";
var content = $("#virtualfirealarm-statistic-response-template").find(".content");
var title = content.find("#title");
var statusIcon = content.find("#status-icon");
var data = {}
invokerUtil.post(urix, data, function (data) {
title.html("Deploying statistic artifacts. Please wait...");
statusIcon.attr("class", defaultStatusClasses + " fw-check");
$(modalPopupContent).html(content.html());
showPopup();
setTimeout(function () {
hidePopup();
location.reload(true);
}, 5000);
}, function (jqXHR) {
title.html("Failed to deploy artifacts, Please contact administrator.");
statusIcon.attr("class", defaultStatusClasses + " fw-error");
$(modalPopupContent).html(content.html());
showPopup();
}, contentType);
}

@ -54,9 +54,6 @@
</a> </a>
<a href="#" class="download-link btn-operations"> <a href="#" class="download-link btn-operations">
<i class="fw fw-download"></i>Download Agent</a> <i class="fw fw-download"></i>Download Agent</a>
{{#if permissions.IS_ADMIN}}
<a href="javascript:artifactUpload()" class="btn-operations"><i class="fw fw-upload fw-inverse fw-lg add-margin-1x"></i> Deploy Analytics Artifacts</a>
{{/if}}
<p class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS300/Virtual+Firealarm" <p class="doc-link">Click <a href="https://docs.wso2.com/display/IoTS300/Virtual+Firealarm"
target="_blank">[ here ]</a> for latest instructions and target="_blank">[ here ]</a> for latest instructions and

@ -385,30 +385,3 @@ $(document).ready(function () {
); );
}); });
}); });
function artifactUpload() {
var contentType = "application/json";
var urix = backendEndBasePath + "/admin/devicetype/deploy/android";
var defaultStatusClasses = "fw fw-stack-1x";
var content = $("#android-statistic-response-template").find(".content");
var title = content.find("#title");
var statusIcon = content.find("#status-icon");
var data = {}
invokerUtil.post(urix, data, function (data) {
title.html("Deploying statistic artifacts. Please wait...");
statusIcon.attr("class", defaultStatusClasses + " fw-check");
$(modalPopupContent).html(content.html());
showPopup();
setTimeout(function () {
hidePopup();
location.reload(true);
}, 5000);
}, function (jqXHR) {
title.html("Failed to deploy artifacts, Please contact administrator.");
statusIcon.attr("class", defaultStatusClasses + " fw-error");
$(modalPopupContent).html(content.html());
showPopup();
}, contentType);
}

@ -43,10 +43,6 @@
<a href="{{host}}/android-web-agent/public/mdm.page.enrollments.android.download-agent/asset/android-agent.apk" <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> <i class="fw fw-download fw-inverse fw-lg add-margin-1x"></i> Download APK</a>
{{#if permissions.IS_ADMIN}}
<a href="javascript:artifactUpload()" class="btn-operations">
<i class="fw fw-upload fw-inverse fw-lg add-margin-1x"></i> Deploy Geo Dashboard</a>
{{/if}}
</div> </div>
{{/if}} {{/if}}
{{/if}} {{/if}}

@ -19,8 +19,6 @@
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"];
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
viewModel["permissions"] = userModule.getUIPermissions();
var isCloud = devicemgtProps["isCloud"]; var isCloud = devicemgtProps["isCloud"];
viewModel["isVirtual"] = request.getParameter("type") == 'virtual'; viewModel["isVirtual"] = request.getParameter("type") == 'virtual';
viewModel["isCloud"] = isCloud; viewModel["isCloud"] = isCloud;

Loading…
Cancel
Save