var_createClass=function(){functiondefineProperties(target,props){for(vari=0;i<props.length;i++){vardescriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"indescriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}returnfunction(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);returnConstructor;};}();function_classCallCheck(instance,Constructor){if(!(instanceinstanceofConstructor)){thrownewTypeError("Cannot call a class as a function");}}function_possibleConstructorReturn(self,call){if(!self){thrownewReferenceError("this hasn't been initialised - super() hasn't been called");}returncall&&(typeofcall==="object"||typeofcall==="function")?call:self;}function_inherits(subClass,superClass){if(typeofsuperClass!=="function"&&superClass!==null){thrownewTypeError("Super expression must either be null or a function, not "+typeofsuperClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}functionbytesToSize(bytes){if(bytes===0)return'0 B';vark=1024,sizes=['B','KB','MB','GB','TB','PB','EB','ZB','YB'],i=Math.floor(Math.log(bytes)/Math.log(k));return(bytes/Math.pow(k,i)).toFixed(2)+' '+sizes[i];}varCoderRootFileDetail=function(_Component){_inherits(CoderRootFileDetail,_Component);functionCoderRootFileDetail(props){_classCallCheck(this,CoderRootFileDetail);var_this=_possibleConstructorReturn(this,(CoderRootFileDetail.__proto__||Object.getPrototypeOf(CoderRootFileDetail)).call(this,props));_this.componentDidMount=function(){vardetail=_this.props.detail;_this.setState({value:detail.content});};_this.EditFile=function(){_this.setState({readOnly:false});};_this.CancelEdit=function(){_this.setState({readOnly:true});};_this.changeContent=function(e){_this.setState({value:e});};_this.deleteFile=function(){var_this$props=_this.props,current_user=_this$props.current_user,branch=_this$props.branch,detail=_this$props.detail;varprojectsId=_this.props.match.params.projectsId;varurl="/"+current_user.login+"/"+projectsId+"/contents/files/delete.json";__WEBPACK_IMPORTED_MODULE_5_axios___default.a.delete(url,{params:{filepath:detail.path,branch:branch}}).then(function(result){if(result){_this.props.showNotification("删除成功!");_this.props.history.push("/projects/"+projectsId);}}).catch(function(error){console.log(error);});};_this.UpdateFile=function(){var_this$props2=_this.props,current_user=_this$props2.current_user,branch=_this$props2.branch,detail=_this$props2.detail;varprojectsId=_this.props.match.params.projectsId;varvalue=_this.state.value;varurl="/"+current_user.login+"/"+projectsId+"/contents/files/update.json";__WEBPACK_IMPORTED_MODULE_5_axios___default.a.put(url,{filepath:detail.path,branch:branch,content:value,sha:detail.sha}).then(function(result){if(result){_this.props.showNotification("修改成功!");_this.setState({readOnly:true});}}).catch(function(error){console.log(error);});};_this.state={readOnly:true,value:undefined};return_this;}// 编辑文件
var_createClass=function(){functiondefineProperties(target,props){for(vari=0;i<props.length;i++){vardescriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"indescriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}returnfunction(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);returnConstructor;};}();function_classCallCheck(instance,Constructor){if(!(instanceinstanceofConstructor)){thrownewTypeError("Cannot call a class as a function");}}function_possibleConstructorReturn(self,call){if(!self){thrownewReferenceError("this hasn't been initialised - super() hasn't been called");}returncall&&(typeofcall==="object"||typeofcall==="function")?call:self;}function_inherits(subClass,superClass){if(typeofsuperClass!=="function"&&superClass!==null){thrownewTypeError("Super expression must either be null or a function, not "+typeofsuperClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}functionbytesToSize(bytes){if(bytes===0)return'0 B';vark=1024,sizes=['B','KB','MB','GB','TB','PB','EB','ZB','YB'],i=Math.floor(Math.log(bytes)/Math.log(k));return(bytes/Math.pow(k,i)).toFixed(2)+' '+sizes[i];}varCoderRootFileDetail=function(_Component){_inherits(CoderRootFileDetail,_Component);functionCoderRootFileDetail(props){_classCallCheck(this,CoderRootFileDetail);var_this=_possibleConstructorReturn(this,(CoderRootFileDetail.__proto__||Object.getPrototypeOf(CoderRootFileDetail)).call(this,props));_this.componentDidMount=function(){vardetail=_this.props.detail;_this.setState({value:detail.content});};_this.EditFile=function(){_this.setState({readOnly:false});};_this.CancelEdit=function(){_this.setState({readOnly:true});};_this.changeContent=function(e){_this.setState({value:e});};_this.deleteFile=function(){var_this$props=_this.props,author=_this$props.author,branch=_this$props.branch,detail=_this$props.detail;varprojectsId=_this.props.match.params.projectsId;varurl="/"+author.login+"/"+projectsId+"/contents/files/delete.json";__WEBPACK_IMPORTED_MODULE_5_axios___default.a.delete(url,{params:{filepath:detail.path,branch:branch}}).then(function(result){if(result){_this.props.showNotification("删除成功!");_this.props.history.push("/projects/"+projectsId);}}).catch(function(error){console.log(error);});};_this.UpdateFile=function(){console.log("user",_this.props);var_this$props2=_this.props,author=_this$props2.author,branch=_this$props2.branch,detail=_this$props2.detail;varprojectsId=_this.props.match.params.projectsId;varvalue=_this.state.value;varurl="/"+author.login+"/"+projectsId+"/contents/files/update.json";__WEBPACK_IMPORTED_MODULE_5_axios___default.a.put(url,{filepath:detail.path,branch:branch,content:value,sha:detail.sha}).then(function(result){if(result){_this.props.showNotification("修改成功!");_this.setState({readOnly:true});}}).catch(function(error){console.log(error);});};_this.state={readOnly:true,value:undefined};return_this;}// 编辑文件
var_createClass=function(){functiondefineProperties(target,props){for(vari=0;i<props.length;i++){vardescriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"indescriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}returnfunction(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);returnConstructor;};}();function_classCallCheck(instance,Constructor){if(!(instanceinstanceofConstructor)){thrownewTypeError("Cannot call a class as a function");}}function_possibleConstructorReturn(self,call){if(!self){thrownewReferenceError("this hasn't been initialised - super() hasn't been called");}returncall&&(typeofcall==="object"||typeofcall==="function")?call:self;}function_inherits(subClass,superClass){if(typeofsuperClass!=="function"&&superClass!==null){thrownewTypeError("Super expression must either be null or a function, not "+typeofsuperClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}functionbytesToSize(bytes){if(bytes===0)return'0 B';vark=1024,sizes=['B','KB','MB','GB','TB','PB','EB','ZB','YB'],i=Math.floor(Math.log(bytes)/Math.log(k));return(bytes/Math.pow(k,i)).toFixed(2)+' '+sizes[i];}varCoderRootFileDetail=function(_Component){_inherits(CoderRootFileDetail,_Component);functionCoderRootFileDetail(props){_classCallCheck(this,CoderRootFileDetail);var_this=_possibleConstructorReturn(this,(CoderRootFileDetail.__proto__||Object.getPrototypeOf(CoderRootFileDetail)).call(this,props));_this.componentDidMount=function(){vardetail=_this.props.detail;_this.setState({value:detail.content});};_this.EditFile=function(){_this.setState({readOnly:false});};_this.CancelEdit=function(){_this.setState({readOnly:true});};_this.changeContent=function(e){_this.setState({value:e});};_this.deleteFile=function(){var_this$props=_this.props,current_user=_this$props.current_user,branch=_this$props.branch,detail=_this$props.detail;varprojectsId=_this.props.match.params.projectsId;varurl="/"+current_user.login+"/"+projectsId+"/contents/files/delete.json";__WEBPACK_IMPORTED_MODULE_5_axios___default.a.delete(url,{params:{filepath:detail.path,branch:branch}}).then(function(result){if(result){_this.props.showNotification("删除成功!");_this.props.history.push("/projects/"+projectsId);}}).catch(function(error){console.log(error);});};_this.UpdateFile=function(){var_this$props2=_this.props,current_user=_this$props2.current_user,branch=_this$props2.branch,detail=_this$props2.detail;varprojectsId=_this.props.match.params.projectsId;varvalue=_this.state.value;varurl="/"+current_user.login+"/"+projectsId+"/contents/files/update.json";__WEBPACK_IMPORTED_MODULE_5_axios___default.a.put(url,{filepath:detail.path,branch:branch,content:value,sha:detail.sha}).then(function(result){if(result){_this.props.showNotification("修改成功!");_this.setState({readOnly:true});}}).catch(function(error){console.log(error);});};_this.state={readOnly:true,value:undefined};return_this;}// 编辑文件
var_createClass=function(){functiondefineProperties(target,props){for(vari=0;i<props.length;i++){vardescriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"indescriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}returnfunction(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);returnConstructor;};}();function_classCallCheck(instance,Constructor){if(!(instanceinstanceofConstructor)){thrownewTypeError("Cannot call a class as a function");}}function_possibleConstructorReturn(self,call){if(!self){thrownewReferenceError("this hasn't been initialised - super() hasn't been called");}returncall&&(typeofcall==="object"||typeofcall==="function")?call:self;}function_inherits(subClass,superClass){if(typeofsuperClass!=="function"&&superClass!==null){thrownewTypeError("Super expression must either be null or a function, not "+typeofsuperClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}functionbytesToSize(bytes){if(bytes===0)return'0 B';vark=1024,sizes=['B','KB','MB','GB','TB','PB','EB','ZB','YB'],i=Math.floor(Math.log(bytes)/Math.log(k));return(bytes/Math.pow(k,i)).toFixed(2)+' '+sizes[i];}varCoderRootFileDetail=function(_Component){_inherits(CoderRootFileDetail,_Component);functionCoderRootFileDetail(props){_classCallCheck(this,CoderRootFileDetail);var_this=_possibleConstructorReturn(this,(CoderRootFileDetail.__proto__||Object.getPrototypeOf(CoderRootFileDetail)).call(this,props));_this.componentDidMount=function(){vardetail=_this.props.detail;_this.setState({value:detail.content});};_this.EditFile=function(){_this.setState({readOnly:false});};_this.CancelEdit=function(){_this.setState({readOnly:true});};_this.changeContent=function(e){_this.setState({value:e});};_this.deleteFile=function(){var_this$props=_this.props,author=_this$props.author,branch=_this$props.branch,detail=_this$props.detail;varprojectsId=_this.props.match.params.projectsId;varurl="/"+author.login+"/"+projectsId+"/contents/files/delete.json";__WEBPACK_IMPORTED_MODULE_5_axios___default.a.delete(url,{params:{filepath:detail.path,branch:branch}}).then(function(result){if(result){_this.props.showNotification("删除成功!");_this.props.history.push("/projects/"+projectsId);}}).catch(function(error){console.log(error);});};_this.UpdateFile=function(){console.log("user",_this.props);var_this$props2=_this.props,author=_this$props2.author,branch=_this$props2.branch,detail=_this$props2.detail;varprojectsId=_this.props.match.params.projectsId;varvalue=_this.state.value;varurl="/"+author.login+"/"+projectsId+"/contents/files/update.json";__WEBPACK_IMPORTED_MODULE_5_axios___default.a.put(url,{filepath:detail.path,branch:branch,content:value,sha:detail.sha}).then(function(result){if(result){_this.props.showNotification("修改成功!");_this.setState({readOnly:true});}}).catch(function(error){console.log(error);});};_this.state={readOnly:true,value:undefined};return_this;}// 编辑文件