forked from community/device-mgt-core
parent
b7e3b28722
commit
f9a03133fa
@ -0,0 +1,185 @@
|
|||||||
|
{
|
||||||
|
"Logo": {
|
||||||
|
"name": "Cloud",
|
||||||
|
"url": "https://cloudmgt.cloudlocal.wso2.com:9444/cloudmgt",
|
||||||
|
"target": "_parent"
|
||||||
|
},
|
||||||
|
"Main": {
|
||||||
|
"Domain": {
|
||||||
|
"url": "#",
|
||||||
|
"icon": "fw fw-organization",
|
||||||
|
"isAdminOnly": false,
|
||||||
|
"target": "_parent",
|
||||||
|
"dropDown": {
|
||||||
|
"Organization": {
|
||||||
|
"url": "https://cloudmgt.cloudlocal.wso2.com:9444/cloudmgt/site/pages/organization.jag",
|
||||||
|
"icon": "fw fw-organization",
|
||||||
|
"dropDown": "false",
|
||||||
|
"target": "_self"
|
||||||
|
},
|
||||||
|
"Members": {
|
||||||
|
"url": "https://cloudmgt.cloudlocal.wso2.com:9444/cloudmgt/site/pages/user.jag",
|
||||||
|
"icon": "fa fa-users",
|
||||||
|
"dropDown": "false",
|
||||||
|
"target": "_self"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Account": {
|
||||||
|
"url": "https://cloudmgt.cloudlocal.wso2.com:9444/cloudmgt/site/pages/account-summary.jag",
|
||||||
|
"icon": "fw fw-resource",
|
||||||
|
"isAdminOnly": true,
|
||||||
|
"target": "_blank",
|
||||||
|
"dropDown": {
|
||||||
|
"Upgrade Now": {
|
||||||
|
"url": "https://cloudmgt.cloudlocal.wso2.com:9444/cloudmgt/site/pages/payment-plans.jag?cloud-type=api_cloud",
|
||||||
|
"icon": "fw fw-export",
|
||||||
|
"target": "_self"
|
||||||
|
},
|
||||||
|
"Monetization": {
|
||||||
|
"url": "https://cloudmgt.cloudlocal.wso2.com:9444/cloudmgt/site/pages/monetization-dashboard.jag",
|
||||||
|
"icon": "fa fa-money fa-lg",
|
||||||
|
"dropDown": "false",
|
||||||
|
"target": "_self"
|
||||||
|
},
|
||||||
|
"Request Extension": {
|
||||||
|
"url": "https://cloudmgt.cloudlocal.wso2.com:9444/cloudmgt/site/pages/contact-us.jag?cloud-type=api_cloud&request-extension=true",
|
||||||
|
"icon": "fw fw-mail",
|
||||||
|
"target": "_blank"
|
||||||
|
},
|
||||||
|
"Usage data": {
|
||||||
|
"url": "https://cloudmgt.cloudlocal.wso2.com:9444/cloudmgt/site/pages/tenant-usage.jag?cloud-type=api_cloud",
|
||||||
|
"icon": "fw fw-bar-chart",
|
||||||
|
"target": "_self"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Configure": {
|
||||||
|
"url": "none",
|
||||||
|
"icon": "fw fw-settings",
|
||||||
|
"isAdminOnly": true,
|
||||||
|
"dropDown": {
|
||||||
|
"Admin Dashboard": {
|
||||||
|
"id": "admin-dashboard",
|
||||||
|
"url": "https://api.cloudlocal.wso2.com:9445/admin-dashboard/",
|
||||||
|
"icon": "fw fw-user",
|
||||||
|
"target": "_self"
|
||||||
|
},
|
||||||
|
"Custom URL": {
|
||||||
|
"id": "custom-url",
|
||||||
|
"url": "https://cloudmgt.cloudlocal.wso2.com:9444/cloudmgt/site/pages/custom_url.jag",
|
||||||
|
"icon": "fw fw-uri",
|
||||||
|
"target": "_self"
|
||||||
|
},
|
||||||
|
"API Store Access": {
|
||||||
|
"id": "custom-url",
|
||||||
|
"url": "https://cloudmgt.cloudlocal.wso2.com:9444/cloudmgt/site/pages/selfSignup.jag",
|
||||||
|
"icon": "fw fw-store",
|
||||||
|
"target": "_self"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Support": {
|
||||||
|
"url": "https://cloudmgt.cloudlocal.wso2.com:9444/cloudmgt/site/pages/contact-us.jag",
|
||||||
|
"icon": "fw fw-mail",
|
||||||
|
"isAdminOnly": false,
|
||||||
|
"target": "_self",
|
||||||
|
"dropDown": "false"
|
||||||
|
},
|
||||||
|
"Documentation": {
|
||||||
|
"url": "#",
|
||||||
|
"icon": "fw fw-document",
|
||||||
|
"isAdminOnly": false,
|
||||||
|
"dropDown": {
|
||||||
|
"API Cloud": {
|
||||||
|
"id": "api_cloud",
|
||||||
|
"url": "https://docs.wso2.com/display/APICloud/WSO2+API+Cloud+Documentation",
|
||||||
|
"icon": "fw fw-api",
|
||||||
|
"target": "_blank"
|
||||||
|
},
|
||||||
|
"Integration Cloud": {
|
||||||
|
"id": "integration_cloud",
|
||||||
|
"url": "https://docs.wso2.com/display/IntegrationCloud/WSO2+Integration+Cloud+Documentation",
|
||||||
|
"icon": "fw fw-application",
|
||||||
|
"target": "_blank"
|
||||||
|
},
|
||||||
|
"API Cloud Walkthrough": {
|
||||||
|
"id": "api_cloud_walkthrough",
|
||||||
|
"url": "https://api.cloudlocal.wso2.com:9445/publisher?interactiveTutorial=true",
|
||||||
|
"icon": "fw fw-document",
|
||||||
|
"target": "_self"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"User": {
|
||||||
|
"url": "#",
|
||||||
|
"icon": "fw fw-user",
|
||||||
|
"dropDown": {
|
||||||
|
"Profile": {
|
||||||
|
"url": "https://cloudmgt.cloudlocal.wso2.com:9444/cloudmgt/site/pages/user-profile.jag",
|
||||||
|
"icon": "fw fw-user",
|
||||||
|
"dropDown": "true",
|
||||||
|
"target": "_self"
|
||||||
|
},
|
||||||
|
"Change Password": {
|
||||||
|
"url": "https://cloudmgt.cloudlocal.wso2.com:9444/cloudmgt/site/pages/change-password.jag",
|
||||||
|
"icon": "fw fw-lock",
|
||||||
|
"dropDown": "true",
|
||||||
|
"target": "_self"
|
||||||
|
},
|
||||||
|
"Logout": {
|
||||||
|
"url": "https://api.cloudlocal.wso2.com:9445/publisher/site/pages/logout.jag",
|
||||||
|
"icon": "fw fw-sign-out",
|
||||||
|
"dropDown": "true",
|
||||||
|
"target": "_self"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Expand": {
|
||||||
|
"Clouds": {
|
||||||
|
"API Cloud": {
|
||||||
|
"id": "api_cloud",
|
||||||
|
"url": "https://api.cloudlocal.wso2.com:9445/publisher",
|
||||||
|
"icon": "fw fw-api fw-3x",
|
||||||
|
"dropDown": "true",
|
||||||
|
"target": "_self"
|
||||||
|
},
|
||||||
|
"Integration Cloud": {
|
||||||
|
"id": "integration_cloud",
|
||||||
|
"url": "https://milestones.appfactory.wso2.com:9443/appmgt",
|
||||||
|
"icon": "fa fa-cubes fa-3x",
|
||||||
|
"dropDown": "true",
|
||||||
|
"target": "_self"
|
||||||
|
},
|
||||||
|
"Identity Cloud": {
|
||||||
|
"id": "integration_cloud",
|
||||||
|
"url": "https://identity.cloudlocal.wso2.com:9443/admin",
|
||||||
|
"icon": "fw fw-security fa-3x",
|
||||||
|
"dropDown": "true",
|
||||||
|
"target": "_self"
|
||||||
|
},
|
||||||
|
"Device Cloud": {
|
||||||
|
"id": "device_cloud",
|
||||||
|
"url": "https://device.cloudlocal.wso2.com:9443/devicemgt",
|
||||||
|
"icon": "fw fw-security fa-3x",
|
||||||
|
"dropDown": "true",
|
||||||
|
"target": "_self"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Actions": {
|
||||||
|
"Organization": {
|
||||||
|
"url": "https://cloudmgt.cloudlocal.wso2.com:9444/cloudmgt/site/pages/organization.jag",
|
||||||
|
"icon": "fw fw-organization fw-3x",
|
||||||
|
"dropDown": "true",
|
||||||
|
"target": "_self"
|
||||||
|
},
|
||||||
|
"Members": {
|
||||||
|
"url": "https://cloudmgt.cloudlocal.wso2.com:9444/cloudmgt/site/pages/user.jag",
|
||||||
|
"icon": "fa fa-users fa-3x",
|
||||||
|
"dropDown": "true",
|
||||||
|
"target": "_self"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017, 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var conf = function () {
|
||||||
|
var cloudConf = application.get("CLOUD_CONF");
|
||||||
|
if (!conf) {
|
||||||
|
cloudConf = require("/app/conf/toplink-menu.json");
|
||||||
|
var pinch = require("/app/modules/conf-reader/pinch.min.js")["pinch"];
|
||||||
|
var server = require("carbon")["server"];
|
||||||
|
var process = require("process");
|
||||||
|
pinch(conf, /^/,
|
||||||
|
function (path, key, value) {
|
||||||
|
if ((typeof value === "string") && value.indexOf("%https.ip%") > -1) {
|
||||||
|
//noinspection JSUnresolvedFunction
|
||||||
|
return value.replace("%https.ip%", server.address("https"));
|
||||||
|
} else if ((typeof value === "string") && value.indexOf("%http.ip%") > -1) {
|
||||||
|
//noinspection JSUnresolvedFunction
|
||||||
|
return value.replace("%http.ip%", server.address("http"));
|
||||||
|
} else if ((typeof value === "string") && value.indexOf("%date-year%") > -1) {
|
||||||
|
var year = new Date().getFullYear();
|
||||||
|
return value.replace("%date-year%", year);
|
||||||
|
} else if ((typeof value === "string") && value.indexOf("%server.ip%") > -1) {
|
||||||
|
var getProperty = require("process").getProperty;
|
||||||
|
return value.replace("%server.ip%", getProperty("carbon.local.ip"));
|
||||||
|
} else {
|
||||||
|
var paramPattern = new RegExp("%(.*?)%", "g");
|
||||||
|
var out = value;
|
||||||
|
while ((matches = paramPattern.exec(value)) !== null) {
|
||||||
|
// This is necessary to avoid infinite loops with zero-width matches
|
||||||
|
if (matches.index === paramPattern.lastIndex) {
|
||||||
|
paramPattern.lastIndex++;
|
||||||
|
}
|
||||||
|
if (matches.length == 2) {
|
||||||
|
var property = process.getProperty(matches[1]);
|
||||||
|
if (property) {
|
||||||
|
out = out.replace(new RegExp("%" + matches[1] + "%", "g"), property);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
application.put("CLOUD_CONF", cloudConf);
|
||||||
|
}
|
||||||
|
return cloudConf;
|
||||||
|
}();
|
Loading…
Reference in new issue