コード例 #1
0
ファイル: ServicesNew.js プロジェクト: devopsclub/cabin
 selectDeployment() {
   const deployments = alt.stores.DeploymentsStore.getAll(this.props.cluster);
   const options = [
     {title: intl('cancel')},
     ...deployments.map(deployment => {
       const name = deployment.getIn(['metadata', 'name']);
       return {
         title: name,
         onPress: () => {
           this.setState({deployment, name});
           this.refs.nameInput.setText(name);
         },
       };
     }).toJS(),
   ];
   const title = deployments.size > 0 ? intl('service_new_choose_deployment_alert') : intl('service_new_no_deployments_alert');
   ActionSheetUtils.showActionSheetWithOptions({options, title});
 }
コード例 #2
0
ファイル: NodesShow.js プロジェクト: devopsclub/cabin
 onNavigatorEvent(event) {
   const { cluster, node } = this.props;
   switch (event.id) {
     case 'yaml':
       this.props.navigator.push({
         screen: 'cabin.EntitiesYaml',
         passProps: { cluster, entity: node },
       });
       break;
     case 'more':
       const options = [
         { title: intl('cancel') },
         {
           title: 'Put in maintenance',
           onPress: () => NodesActions.putInMaintenance({ cluster, node }),
         },
       ];
       ActionSheetUtils.showActionSheetWithOptions({options});
       break;
   }
 }