1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- "use strict";
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: admin
- * Copyright IBM Corp. 2015, 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['bi/admin/common/slideout/BasePane', 'bi/admin/system/services/ApiSvc', 'bi/commons/ui/properties/PropertyUIControl', 'bi/admin/nls/StringResource'], function (BasePane, ApiSvc, PropertyUIControl, StringResource) {
- var ContentPane = BasePane.extend({
- init: function init(options) {
- ContentPane.inherited('init', this, arguments);
- $.extend(this, options);
- ApiSvc.glassContext = this.glassContext;
- },
- renderBody: function renderBody($body) {
- return Promise.try(function () {
- return ApiSvc.getBackupList().fail(function (dfd, jqXHR) {
- this.logger.error(jqXHR);
- }.bind(this));
- }.bind(this)).catch(function () {
- this.glassContext.appController.showToast(StringResource.get('getBackupListFail'), {
- type: 'error'
- });
- return {
- data: []
- };
- }.bind(this)).then(function (data) {
- var tabControlItems = [{
- name: StringResource.get('backup'),
- module: 'bi/admin/system/BackupTab',
- parentView: this.slideout,
- items: data.data
- }, {
- name: StringResource.get('restore'),
- module: 'bi/admin/system/RestoreTab',
- parentView: this.slideout,
- items: data.data
- }]; // fix the issue that cannot scroll to bottom of the pane
- $body.addClass('bi-admin-noscroll');
- var $content = $('<div>');
- $content.addClass('bi-admin-fullheight');
- $body.append($content);
- this._oPropertyUIControl = this._getNewPropUIControl({
- 'glassContext': this.glassContext,
- 'el': $content,
- 'items': [{
- 'type': 'TabControl',
- 'items': tabControlItems
- }]
- });
- return this._oPropertyUIControl.render();
- }.bind(this));
- },
- _getNewPropUIControl: function _getNewPropUIControl(options) {
- return new PropertyUIControl(options);
- }
- });
- return ContentPane;
- });
|