X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Flogging%2Fsrc%2Flogging.jsx;fp=skyquake%2Fplugins%2Flogging%2Fsrc%2Flogging.jsx;h=70efac3c62accaa99445f384b21e11b9291c0fd8;hb=e29efc315df33d546237e270470916e26df391d6;hp=0000000000000000000000000000000000000000;hpb=9c5e457509ba5a1822c316635c6308874e61b4b9;p=osm%2FUI.git diff --git a/skyquake/plugins/logging/src/logging.jsx b/skyquake/plugins/logging/src/logging.jsx new file mode 100644 index 000000000..70efac3c6 --- /dev/null +++ b/skyquake/plugins/logging/src/logging.jsx @@ -0,0 +1,96 @@ +/* + * + * Copyright 2016 RIFT.IO Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + import React from 'react'; + import './logging.scss'; + import AppHeader from 'widgets/header/header.jsx'; + import LoggingActions from './loggingActions.js'; + import LoggingStore from './loggingStore.js'; + + export default class Logging extends React.Component { + constructor(props) { + super(props); + console.log("Logging.constructor called"); + + + this.state = LoggingStore.getState(); + console.log("Logging.constructor: state=", this.state); + LoggingStore.listen(this.storeListener); + // LoggingStore.get(); + } + + storeListener = (state) => { + console.log("Logging.storeListener called"); + this.setState(state); + } + + //handleUpdate(data) + // Lifecycle methods + // https://facebook.github.io/react/docs/component-specs.html + + componentWillMount() { + console.log("Logging.componentWillMount called"); + } + componentDidMount() { + console.log("Logging.componentDidMount called"); + //LoggingStore.getSysLogViewerURL(); + LoggingStore.getLoggingConfig(); + //LoggingStore.getLoggingOperational(); + } + + // Invoked when a component is receiving new props. This method is not called for the intial render. + // use this as an opportunity to react to a prop transition before render() is called + componentWillReceiveProps(nextProps) { + console.log("Logging.componentWillReceiveProps called"); + // this.setState({ key: nextProps.value}); + } + + // shouldComonentUpdate(nextProps, nextState) {} + // Invoked immediately before rendering when new props or state are being received + // componentWillUpdate(nextProps, nextState) {} + + + // Invoked immediately after the component's updates are flushed to the DOM. + // This method is not called for the initial render. + // Use this as an opportunity to operate on the DOM when the component has been updated. + componentDidUpdate(prevPros, prevState) { + + } + componentWillUnmount() { + console.log("Logging.componentWillUnmount called"); + //LoggingStore.unlisten(this.storeListener); + } + render() { + console.log("Logging.render called"); + console.log("Logging.state=", JSON.stringify(this.state)); + var html=(

Hello Logging page

); + if (this.state != null) { + html = ( +
+

Placeholder for logging page

+

alpha

+
+ ); + } + return ( +
+ {html} +
+ ); + } + + } \ No newline at end of file