use the table's filtered data when saving to file (#400)
parent
8f64ee3b41
commit
fb55fc5013
|
|
@ -195,6 +195,11 @@ func (v *Table) GetData() resource.TableData {
|
||||||
return v.data
|
return v.data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetFilteredData fetch filtered tabular data.
|
||||||
|
func (v *Table) GetFilteredData() resource.TableData {
|
||||||
|
return v.filtered()
|
||||||
|
}
|
||||||
|
|
||||||
// SetBaseTitle set the table title.
|
// SetBaseTitle set the table title.
|
||||||
func (v *Table) SetBaseTitle(s string) {
|
func (v *Table) SetBaseTitle(s string) {
|
||||||
v.baseTitle = s
|
v.baseTitle = s
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ func (v *tableView) BufferActive(state bool, k ui.BufferKind) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *tableView) saveCmd(evt *tcell.EventKey) *tcell.EventKey {
|
func (v *tableView) saveCmd(evt *tcell.EventKey) *tcell.EventKey {
|
||||||
if path, err := saveTable(v.app.Config.K9s.CurrentCluster, v.GetBaseTitle(), v.GetData()); err != nil {
|
if path, err := saveTable(v.app.Config.K9s.CurrentCluster, v.GetBaseTitle(), v.GetFilteredData()); err != nil {
|
||||||
v.app.Flash().Err(err)
|
v.app.Flash().Err(err)
|
||||||
} else {
|
} else {
|
||||||
v.app.Flash().Infof("File %s saved successfully!", path)
|
v.app.Flash().Infof("File %s saved successfully!", path)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue