diff --git a/pkg/shell/active-pages-modal.jsx b/pkg/shell/active-pages-modal.jsx index ffbc21d3a3f..6ebbe4eba64 100644 --- a/pkg/shell/active-pages-modal.jsx +++ b/pkg/shell/active-pages-modal.jsx @@ -32,17 +32,16 @@ const _ = cockpit.gettext; export const ActivePagesDialog = ({ dialogResult, frames }) => { function get_pages() { const result = []; - for (const address in frames.iframes) { - for (const component in frames.iframes[address]) { - const iframe = frames.iframes[address][component]; + for (const f of frames) { + if (f) { result.push({ - frame: iframe, - component, - address, - name: iframe.getAttribute("name"), - active: iframe.getAttribute("data-active") === 'true', - selected: iframe.getAttribute("data-active") === 'true', - displayName: address === "localhost" ? "/" + component : address + ":/" + component + frame: f, + component: f.fullpath, + address: f.host, + name: f.name, + active: f.active, + selected: f.active, + displayName: f.host === "localhost" ? "/" + f.fullpath : f.host + ":/" + f.fullpath, }); } } @@ -61,8 +60,10 @@ export const ActivePagesDialog = ({ dialogResult, frames }) => { function onRemove() { pages.forEach(element => { - if (element.selected) + if (element.selected) { + // XXX frames.remove(element.host, element.component); + } }); dialogResult.resolve(); } diff --git a/pkg/shell/shell.jsx b/pkg/shell/shell.jsx index fbe30b05226..56a3b6a1fe4 100644 --- a/pkg/shell/shell.jsx +++ b/pkg/shell/shell.jsx @@ -138,6 +138,7 @@ function ShellState(machines, loader) { function update() { self.frames = index.frames.frame_array; + self.has_oops = index.has_oops; self.dispatchEvent("update"); } @@ -610,7 +611,7 @@ const Shell = ({ state, machines, loader }) => {
- Dialogs.run(ActivePagesDialog, { frames: this.props.index.frames })}> + onClick={() => Dialogs.run(ActivePagesDialog, { frames: this.props.state.frames })}> {_("Active pages")} ); @@ -217,7 +217,7 @@ export class TopNav extends React.Component { } - { this.props.index.has_oops && + { this.props.state.has_oops &&