@@ -23,6 +23,7 @@ func GetShortcuts() []string {
2323 return []string {
2424 common .FormatSCHeader ("s" , "Services" ),
2525 common .FormatSCHeader ("d" , "Describe" ),
26+ common .FormatSCHeader ("x" , "Decode" ),
2627 common .FormatSCHeader ("a" , "Add" ),
2728 common .FormatSCHeader ("ctrl-d" , "Delete" ),
2829 }
@@ -43,6 +44,9 @@ func InputHandler(v *view.ResourceView, event *tcell.EventKey) *tcell.EventKey {
4344 case 'd' :
4445 app .InspectCurrentSelection ()
4546 return nil
47+ case 'x' :
48+ Decode (app , v )
49+ return nil
4650 case 'a' :
4751 Create (app )
4852 return nil
@@ -143,6 +147,31 @@ func Create(app common.AppController) {
143147 })
144148}
145149
150+ func Decode (app common.AppController , v * view.ResourceView ) {
151+ id , err := v .GetSelectedID ()
152+ if err != nil {
153+ return
154+ }
155+
156+ subject := resolveConfigSubject (v , id )
157+ inspector := inspect .NewTextInspector ("Decode config" , subject , fmt .Sprintf (" [%s]Decoding config...\n " , styles .TagAccent ), "data" )
158+ app .OpenInspector (inspector )
159+
160+ app .RunInBackground (func () {
161+ data , err := app .GetDocker ().GetConfigData (id )
162+ if err != nil {
163+ app .GetTviewApp ().QueueUpdateDraw (func () {
164+ inspector .Viewer .Update (fmt .Sprintf ("Error: %v" , err ), "text" )
165+ })
166+ return
167+ }
168+
169+ app .GetTviewApp ().QueueUpdateDraw (func () {
170+ inspector .Viewer .Update (string (data ), "env" )
171+ })
172+ })
173+ }
174+
146175func Inspect (app common.AppController , id string ) {
147176 subject := id
148177 if len (id ) > 12 {
0 commit comments