Config page refactoring
This commit is contained in:
parent
460b044720
commit
f69b9c1887
4 changed files with 458 additions and 443 deletions
|
|
@ -30,33 +30,7 @@ along with Cockpit; If not, see <http://www.gnu.org/licenses/>.
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/cockpit/@localhost/session-recording/index.html">Session Recording</a></li>
|
||||
<li class="active">Configuration</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><span>General Configuration</span></div>
|
||||
<div class="panel-body" id="sr_config"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><span>SSSD Configuration</span></div>
|
||||
<div class="panel-body" id="sssd_config"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="view"></div>
|
||||
<script type="text/javascript" src="config.js"></script>
|
||||
</body>
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@
|
|||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Cockpit; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
let cockpit = require("cockpit");
|
||||
|
|
@ -370,7 +368,6 @@
|
|||
}
|
||||
|
||||
setConfig(data) {
|
||||
console.log(data);
|
||||
const config = {...data['session_recording']};
|
||||
this.setState(config);
|
||||
}
|
||||
|
|
@ -463,6 +460,46 @@
|
|||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(<Config />, document.getElementById('sr_config'));
|
||||
ReactDOM.render(<SssdConfig />, document.getElementById('sssd_config'));
|
||||
}());
|
||||
class ConfigView extends React.Component {
|
||||
render() {
|
||||
const goBack = () => {
|
||||
cockpit.jump(['session-recording']);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="container-fluid">
|
||||
<div className="row">
|
||||
<div className="col-md-12">
|
||||
<ol className="breadcrumb">
|
||||
<li><a onClick={goBack}>Session
|
||||
Recording</a></li>
|
||||
<li className="active">Configuration</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div className="row">
|
||||
<div className="col-md-3">
|
||||
<div className="panel panel-default">
|
||||
<div className="panel-heading"><span>General Configuration</span></div>
|
||||
<div className="panel-body" id="sr_config">
|
||||
<Config />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="row">
|
||||
<div className="col-md-3">
|
||||
<div className="panel panel-default">
|
||||
<div className="panel-heading"><span>SSSD Configuration</span></div>
|
||||
<div className="panel-body" id="sssd_config">
|
||||
<SssdConfig />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(<ConfigView />, document.getElementById('view'));
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ along with Cockpit; If not, see <http://www.gnu.org/licenses/>.
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<div id="view"/>
|
||||
<div id="view"></div>
|
||||
<script type="text/javascript" src="recordings.js"></script>
|
||||
</body>
|
||||
|
||||
|
|
|
|||
|
|
@ -605,6 +605,7 @@ class View extends React.Component {
|
|||
this.handleTsChange = this.handleTsChange.bind(this);
|
||||
this.handleLogTsChange = this.handleLogTsChange.bind(this);
|
||||
this.handleDateSinceChange = this.handleDateSinceChange.bind(this);
|
||||
this.openConfig = this.openConfig.bind(this);
|
||||
/* Journalctl instance */
|
||||
this.journalctl = null;
|
||||
/* Recording ID journalctl instance is invoked with */
|
||||
|
|
@ -831,6 +832,10 @@ class View extends React.Component {
|
|||
this.setState({logsTs: ts});
|
||||
}
|
||||
|
||||
openConfig() {
|
||||
cockpit.jump(['session-recording/config']);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
let proc = cockpit.spawn(["getent", "passwd", "tlog"]);
|
||||
|
||||
|
|
@ -929,8 +934,7 @@ class View extends React.Component {
|
|||
<label className="control-label" htmlFor="config">Configuration</label>
|
||||
</td>
|
||||
<td className="top">
|
||||
<a href="/cockpit/@localhost/session-recording/config.html" className="btn btn-default" data-toggle="modal">
|
||||
<i className="fa fa-cog" aria-hidden="true" /></a>
|
||||
<button className="btn btn-default" onClick={this.openConfig}><i className="fa fa-cog" aria-hidden="true" /></button>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue