parent
891480366c
commit
2a2f99b6f0
2 changed files with 8 additions and 4 deletions
|
|
@ -28,10 +28,9 @@ export class Application extends React.Component {
|
|||
super();
|
||||
this.state = { 'hostname': _("Unknown") };
|
||||
|
||||
cockpit.file('/etc/hostname').read()
|
||||
.done((content) => {
|
||||
this.setState({ 'hostname': content.trim() });
|
||||
});
|
||||
cockpit.file('/etc/hostname').watch(content => {
|
||||
this.setState({ 'hostname': content.trim() });
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue