Beispiel #1
0
        className='btn btn-danger reset-environment-btn'
        disabled={this.state.actionInProgress || this.state.confirmation &&
         _.isUndefined(this.state.confirmationError) || this.state.confirmationError}
        onClick={this.state.confirmation ? this.resetEnvironment : this.showConfirmationForm}
      >
        {i18n('common.reset_button')}
      </button>
    ]);
  }
});

export var ShowNodeInfoDialog = React.createClass({
  mixins: [
    dialogMixin,
    backboneMixin('node'),
    renamingMixin('hostname')
  ],
  getDefaultProps() {
    return {modalClass: 'always-show-scrollbar'};
  },
  getInitialState() {
    return {
      title: i18n('dialog.show_node.default_dialog_title'),
      VMsConf: null,
      VMsConfValidationError: null,
      hostnameChangingError: null
    };
  },
  goToConfigurationScreen(url) {
    this.close();
    app.navigate(
Beispiel #2
0
 * License for the specific language governing permissions and limitations
 * under the License.
**/
import _ from 'underscore';
import i18n from 'i18n';
import Backbone from 'backbone';
import React from 'react';
import utils from 'utils';
import models from 'models';
import dispatcher from 'dispatcher';
import {Input, Popover, Tooltip} from 'views/controls';
import {DeleteNodesDialog, RemoveOfflineNodeDialog, ShowNodeInfoDialog} from 'views/dialogs';
import {renamingMixin} from 'component_mixins';

var Node = React.createClass({
  mixins: [renamingMixin('name')],
  getInitialState() {
    return {
      actionInProgress: false,
      extendedView: false,
      labelsPopoverVisible: false
    };
  },
  componentDidUpdate() {
    if (!this.props.node.get('cluster') && !this.props.checked) {
      this.props.node.set({pending_roles: []}, {assign: true});
    }
  },
  getNodeLogsLink() {
    var status = this.props.node.get('status');
    var error = this.props.node.get('error_type');
Beispiel #3
0
  render() {
    var {alerts, severity, blockersDescription} = this.props;
    if (_.isEmpty(alerts)) return null;
    return (
      <div className='warnings-block'>
        {severity === 'blocker' && blockersDescription}
        <ul className={'text-' + (severity === 'warning' ? 'warning' : 'danger')}>
          {_.map(alerts, (alert, index) => <li key={severity + index}>{alert}</li>)}
        </ul>
      </div>
    );
  }
});

var ClusterInfo = React.createClass({
  mixins: [renamingMixin('clustername')],
  getClusterValue(fieldName) {
    var cluster = this.props.cluster;
    var settings = cluster.get('settings');
    switch (fieldName) {
      case 'status':
        return i18n('cluster.status.' + cluster.get('status'));
      case 'openstack_release':
        return cluster.get('release').get('name');
      case 'compute':
        var libvirtSettings = settings.get('common').libvirt_type;
        var computeLabel = _.find(libvirtSettings.values, {data: libvirtSettings.value}).label;
        if (settings.get('common').use_vcenter.value) {
          return computeLabel + ' ' + i18n(ns + 'and_vcenter');
        }
        return computeLabel;