1 |
- import React from'react';import Module from'../Module';import Extendable from'../base/ExtendableContainer';import{FontAwesomeIcon}from'@fortawesome/react-fontawesome';import{Table,TextInput as Input}from'react-materialize';import'./RouterServiceInfo.css';class RouterServiceInfo extends Module{constructor(a){super(a),this.state={modid:'',route:'',routeName:''}}removeRoute(a,b){this.RoutingSystem.removeRoute(a,b),this.CoreSystem.refresh(!0),this.forceUpdate()}render(){let a=this.RoutingSystem.getRoutes();return React.createElement('div',{className:''},React.createElement('div',{className:'row'},this.__renderID()),React.createElement('div',{className:'row'},React.createElement('div',{className:'col s4'},'Current View :'),React.createElement('div',{className:'col s8'},this.RoutingSystem.getCurrentView())),React.createElement('div',{className:'row'},React.createElement(Table,{className:'white',bordered:!0,hoverable:!0,responsive:!0},React.createElement('thead',null,React.createElement('tr',null,React.createElement('th',null),React.createElement('th',null,'ModID'),React.createElement('th',null,'Route'),React.createElement('th',null,'Name'))),React.createElement('tbody',null,a.map(a=>React.createElement('tr',{key:a.route},React.createElement('td',null,React.createElement(FontAwesomeIcon,{icon:'trash',onClick:()=>this.removeRoute(a.id,a.route)})),React.createElement('td',null,a.id),React.createElement('td',null,a.route),React.createElement('td',null,a.routeName))),React.createElement('tr',null,React.createElement('td',null,React.createElement('button',{onClick:()=>{this.RoutingSystem.addRoute(this.state.route,this.state.modid,this.state.routeName),this.setState({route:'',modid:''})}},'Add')),React.createElement('td',null,React.createElement('input',{type:'text',value:this.state.modid,onChange:a=>this.setState({modid:a.target.value})})),React.createElement('td',null,React.createElement('input',{type:'text',value:this.state.route,onChange:a=>this.setState({route:a.target.value})})),React.createElement('td',null,React.createElement('input',{type:'text',value:this.state.routeName,onChange:a=>this.setState({routeName:a.target.value})})))))),super.render())}}RouterServiceInfo.Category='Services';export default RouterServiceInfo;
|