Scott Seago
2009-Jan-13 17:42 UTC
[Ovirt-devel] [PATCH] More UI enhancements for task list:
1) show selected filters more clearly (without having to expand the menu) 2) combined rarely-used 'args' column with 'action' in the display 3) moved 'message' next to the 'action' column Signed-off-by: Scott Seago <sseago at redhat.com> --- src/app/controllers/task_actions.rb | 2 +- src/app/models/host_task.rb | 6 +++++- src/app/models/storage_task.rb | 6 +++++- src/app/models/storage_volume_task.rb | 6 +++++- src/app/models/task.rb | 17 +++++++++++------ src/app/models/vm_task.rb | 6 +++++- src/app/views/task/_grid.rhtml | 7 +++---- src/app/views/task/_show.rhtml | 6 ++++-- src/public/images/view.png | Bin 0 -> 985 bytes 9 files changed, 39 insertions(+), 17 deletions(-) create mode 100644 src/public/images/view.png diff --git a/src/app/controllers/task_actions.rb b/src/app/controllers/task_actions.rb index d71c11e..de43e9b 100644 --- a/src/app/controllers/task_actions.rb +++ b/src/app/controllers/task_actions.rb @@ -42,7 +42,7 @@ module TaskActions find_opts[:conditions] = conditions unless conditions.empty? attr_list = [] attr_list << :id if params[:checkboxes] - attr_list += [:type_label, :task_obj, :action, :state, :user, :created_at, :args, :message] + attr_list += [:type_label, :task_obj, :action_with_args, :message, :state, :user, :created_at] json_hash(tasks_query_obj, attr_list, [:all], find_opts) end diff --git a/src/app/models/host_task.rb b/src/app/models/host_task.rb index 82298db..38305a3 100644 --- a/src/app/models/host_task.rb +++ b/src/app/models/host_task.rb @@ -26,7 +26,11 @@ class HostTask < Task end def task_obj - "Host;;;#{self.host.id};;;#{self.host.hostname}" + if self.host + "Host;;;#{self.host.id};;;#{self.host.hostname}" + else + "" + end end def vm diff --git a/src/app/models/storage_task.rb b/src/app/models/storage_task.rb index 785f0ea..308673d 100644 --- a/src/app/models/storage_task.rb +++ b/src/app/models/storage_task.rb @@ -26,7 +26,11 @@ class StorageTask < Task end def task_obj - "StoragePool;;;#{self.storage_pool.id};;;#{self.storage_pool.display_name}" + if self.storage_pool + "StoragePool;;;#{self.storage_pool.id};;;#{self.storage_pool.display_name}" + else + "" + end end def host nil diff --git a/src/app/models/storage_volume_task.rb b/src/app/models/storage_volume_task.rb index 136f1ba..021ef63 100644 --- a/src/app/models/storage_volume_task.rb +++ b/src/app/models/storage_volume_task.rb @@ -27,7 +27,11 @@ class StorageVolumeTask < Task end def task_obj - "StorageVolume;;;#{self.storage_volume.id};;;#{self.storage_volume.display_name}" + if self.storage_volume + "StorageVolume;;;#{self.storage_volume.id};;;#{self.storage_volume.display_name}" + else + "" + end end def host nil diff --git a/src/app/models/task.rb b/src/app/models/task.rb index 4d16e01..dd24e6a 100644 --- a/src/app/models/task.rb +++ b/src/app/models/task.rb @@ -45,18 +45,18 @@ class Task < ActiveRecord::Base COMPLETED_STATES = [STATE_FINISHED, STATE_FAILED, STATE_CANCELED] WORKING_STATES = [STATE_QUEUED, STATE_RUNNING, STATE_PAUSED] - TASK_TYPES_OPTIONS = [["VM Task", "VmTask"], - ["Host Task", "HostTask"], - ["Storage Task", "StorageTask"], - ["Storage Volume Task", "StorageVolumeTask", "break"], - ["Show All", ""]] + TASK_TYPES_OPTIONS = [["VM Tasks", "VmTask"], + ["Host Tasks", "HostTask"], + ["Storage Tasks", "StorageTask"], + ["Storage Volume Tasks", "StorageVolumeTask", "break"], + ["All Types", ""]] TASK_STATES_OPTIONS = [["Queued", Task::STATE_QUEUED], ["Running", Task::STATE_RUNNING], ["Paused", Task::STATE_PAUSED], ["Finished", Task::STATE_FINISHED], ["Failed", Task::STATE_FAILED], ["Canceled", Task::STATE_CANCELED, "break"], - ["Show All", ""]] + ["All States", ""]] def cancel self[:state] = STATE_CANCELED @@ -84,4 +84,9 @@ class Task < ActiveRecord::Base "" end + def action_with_args + ret_val = action + ret_val += " #{args}" if args + ret_val + end end diff --git a/src/app/models/vm_task.rb b/src/app/models/vm_task.rb index 27e3e65..27513bb 100644 --- a/src/app/models/vm_task.rb +++ b/src/app/models/vm_task.rb @@ -123,7 +123,11 @@ class VmTask < Task end def task_obj - "Vm;;;#{self.vm.id};;;#{self.vm.description}" + if self.vm + "Vm;;;#{self.vm.id};;;#{self.vm.description}" + else + "" + end end def self.valid_actions_for_vm_state(state, vm=nil, user=nil) diff --git a/src/app/views/task/_grid.rhtml b/src/app/views/task/_grid.rhtml index 3c17ac5..5e2a3d5 100644 --- a/src/app/views/task/_grid.rhtml +++ b/src/app/views/task/_grid.rhtml @@ -18,12 +18,11 @@ <%= "{display: '', width : 20, align: 'left', process: #{table_id}checkbox}," if checkboxes %> {display: 'Type', width : 80, align: 'left'}, {display: 'Item', width : 120, align: 'right', process: <%= table_id%>item}, - {display: 'Action', name : 'action', width : 80, align: 'left'}, + {display: 'Action', name : 'action', width : 120, align: 'left'}, + {display: 'Message', name : 'message', width : 180, align: 'left'}, {display: 'State', name : 'state', width : 60, align: 'left'}, {display: 'User', name : 'user', width : 60, align: 'right'}, - {display: 'Created', name : 'tasks.created_at', width : 140, align: 'right'}, - {display: 'Args', name : 'args', width : 180, align: 'left'}, - {display: 'Message', name : 'message', width : 180, align: 'left'} + {display: 'Created', name : 'tasks.created_at', width : 140, align: 'right'} ], sortname: "tasks.created_at", sortorder: "desc", diff --git a/src/app/views/task/_show.rhtml b/src/app/views/task/_show.rhtml index 5d8d180..9421dc9 100644 --- a/src/app/views/task/_show.rhtml +++ b/src/app/views/task/_show.rhtml @@ -2,7 +2,8 @@ <ul> <%if task_types %> <li> - <%= image_tag "icon_move.png", :style => "vertical-align:middle;" %> Type <%= image_tag "icon_toolbar_arrow.gif", :style => "vertical-align:middle;" %> + <%= image_tag "view.png", :style => "vertical-align:middle;" %> <%= task_types.select {|type| type[1]==task_type}[0][0] %> + <%= image_tag "icon_toolbar_arrow.gif", :style => "vertical-align:middle;" %> <ul> <% task_types.each_index { |index| %> <li onclick="apply_task_filter('<%=task_types[index][1]%>','<%=task_state%>');";" @@ -20,7 +21,8 @@ <% end %> <li> - <%= image_tag "icon_move.png", :style => "vertical-align:middle;" %> State <%= image_tag "icon_toolbar_arrow.gif", :style => "vertical-align:middle;" %> + <%= image_tag "view.png", :style => "vertical-align:middle;" %> <%= task_states.select {|state| state[1]==task_state}[0][0] %> + <%= image_tag "icon_toolbar_arrow.gif", :style => "vertical-align:middle;" %> <ul> <% task_states.each_index { |index| %> <li onclick="apply_task_filter('<%=task_type%>','<%=task_states[index][1]%>');";" diff --git a/src/public/images/view.png b/src/public/images/view.png new file mode 100644 index 0000000000000000000000000000000000000000..6e0aef0fde79fe85d47899594dd4f3f2038b398c GIT binary patch literal 985 zcmV;~119{5P)<h;3K|Lk000e1NJLTq000yK000yS1^@s6jfou%0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU#dr3q=RCwB?l*?}$RTRd*xifyn4yl^N zkG6>#5u&OIDnf!*3dE%w*dSK0KnPT}AhAHKSo0T9sTD$k6^npc2|?LJpj23)h_-2+ zHj~Cp+{Ae}6Wj54#*gv!+ at 3qNQ50Dbk1Ks+&-i>lpL@=ktKjgZOifOnWsJSan37B+ z5)+nX3(K~bgzL_7&ad4_rEXH3_}g#@j3r;0{8&}hkKX&>;@DL3JYw+#ITS4D%lLI> z1~Wfj&A6 at Bm$Sd8E>XODSZ0he`{Y70Sy^0K7WJkpTCNaHx=3XUj+k5A65n2(5i&-` zN{=+E-L`q|<(FRd`+Z+r`s(X=Xy7Cw0fq(_upJjg+eOB3kS#R9U526I6aLJ?t<iWa zHlN$rTw`5;norZ-diVW{qv64mDA*i37OBFKD{*9t4n1puD?a3lCVGyIW9ZpaqtYY2 zS{I<7F?DKe{0uftj-u6q-EiSj*=tRg1kkP_=-zQSoIn)Kx&`Tx-flpjs<N@@@ew at S zYk80crvg#?B$T^PRj*Z{XaQ8I3{I0ndZf1-(0eAcl67-PF43sDURIngP7AQiGFUKz zz3nVm&j2~{p0`^K!Fg*X^JoPsfn;`dg4UaYvX!3_Rza;+0}CI8v6_azFYbBJY4t%~ z!)g4LzCGvN(3p7Lt<u)5Y7GTr2c at C`^_dt<V+)0)6j3xtkMwpM8 at 0DLq82x^=c2=7 zeQG2M+qPj<Dpa>RO|J$uJOHzp$Gz`9N9_3vc>Kq;^+Kt1Ww%h!y8+pYBh~T#Uh$!R zXCA_BK?(E`q~9Br^3FQ8(zD3TO(ROMwbXRYG%Mev??3pSyyn4IPkH-%_>D-2T|W^Y zgzv};xTEia2NP)6WoisV&)^V3M~->h+_-%`S2oQb=I^C1lXp}0az9Xc=e5Y|;h^%% z#B(EX5X44q6(yTN&nKosJ)sGo<{S3v%A0Gn{kz4z(r+uP*;#tDO|s<stQ~}%J#!lV zNDQlw7GP7&mLEHx-O}?n+6PIX9p7jJ_DE$?wR1RV2VsN9Pa&I`M{e7|{jBrppL*jb zirH-&Itg%@D9LGm7yE}eupee@=va8T@)Wk%_>q3!YG)wu50;$6P?HP21G{<m!GDHz zj;~;UpDNbZ^wDi&_vrtDbx!OcDN2g9|G;Q>?O(&>dLqC862I3E#!IpG00000NkvXX Hu0mjfwm{v~ literal 0 HcmV?d00001 -- 1.6.0.6
David Lutterkort
2009-Jan-14 00:57 UTC
[Ovirt-devel] [PATCH] More UI enhancements for task list:
On Tue, 2009-01-13 at 17:42 +0000, Scott Seago wrote:> 1) show selected filters more clearly (without having to expand the menu) > 2) combined rarely-used 'args' column with 'action' in the display > 3) moved 'message' next to the 'action' columnACK .. very nice ! David