123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- "use strict";
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: admin
- * Copyright IBM Corp. 2015, 2018
- * US Government Users Restricted Rights -
- * Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['bi/admin/common/slideout/BasePane', 'doT', 'bi/admin/nls/StringResource', 'bi/admin/common/utils/CapabilityHelper', 'text!bi/admin/common/templates/ManagePaneTemplate.html', '../../ba-graphics/dist/icons-js/child-relationship_32'], function (BasePane, dot, StringResource, CapabilityHelper, template, childRel32) {
- /**
- * Sample content view that extends the glass AdminPane class
- *
- */
- var ConfigPane = BasePane.extend({
- init: function init(options) {
- ConfigPane.inherited('init', this, arguments);
- $.extend(this, options);
- CapabilityHelper.glassContext = this.glassContext;
- },
- _getMenuItems: function _getMenuItems(isSysAdmin) {
- var items = [{
- 'id': 'system_settings',
- 'title': StringResource.get('systemTitle'),
- 'description': StringResource.get('configurationDetail'),
- 'icon': 'common-configure-manage'
- }, {
- 'id': 'system_diagnostic_logging',
- 'title': StringResource.get('systemLoggingTitle'),
- 'description': StringResource.get('loggingDetail'),
- 'icon': 'common-log'
- }];
- if (isSysAdmin) {
- items.push({
- 'id': 'system_routingrules',
- 'title': StringResource.get('routingRulesTitle'),
- 'description': StringResource.get('routingRulesDetail'),
- 'icon': childRel32.default.id
- });
- }
- return items;
- },
- renderBody: function renderBody($body) {
- return this.isSysAdmin().then(function (isSysAdmin) {
- var $html = $(dot.template(template)({
- 'items': this._getMenuItems(isSysAdmin)
- }));
- if (!CapabilityHelper.checkCapabilities('canUseServerAdministrationTool')) {
- $html.find('#system_settings').hide();
- }
- $body.html($html);
- $body.addClass('bi-admin-entrance-pane');
- $body.find('.manage-sub-menu .adminentry').on('primaryaction', function (e) {
- if (this.slideout.child) {
- this.slideout.child.hide();
- }
- var childTitle = $(e.currentTarget).attr('title');
- switch (e.currentTarget.id) {
- case 'system_settings':
- this.glassContext.appController.showSlideOut({
- parent: this.slideout,
- overlay: true,
- width: '450px',
- label: childTitle,
- content: {
- module: 'bi/admin/system/slideout/SystemPane',
- title: childTitle,
- showGobackButton: true
- }
- });
- break;
- case 'system_mail':
- this.glassContext.appController.showSlideOut({
- parent: this.slideout,
- overlay: true,
- width: '450px',
- label: childTitle,
- content: {
- module: 'bi/admin/system/slideout/MailSettingsPane',
- title: childTitle,
- showGobackButton: true
- }
- });
- break;
- case 'system_diagnostic_logging':
- this.glassContext.appController.showSlideOut({
- parent: this.slideout,
- overlay: true,
- width: '450px',
- label: childTitle,
- content: {
- module: 'bi/admin/system/slideout/LoggingConfigurationPane',
- title: childTitle,
- showGobackButton: true
- }
- });
- break;
- case 'system_routingrules':
- var context = {
- id: 'routingrules',
- content: {}
- };
- this.glassContext.appController.openAppView('routingrules', context);
- break;
- default:
- }
- }.bind(this));
- }.bind(this));
- }
- });
- return ConfigPane;
- });
|