| |
27 |
27 |
array set package [list] |
| |
28 |
28 |
|
| |
29 |
29 |
apm_get_package_repository -repository_url $repository_url -array repository |
| |
30 |
30 |
|
| |
31 |
31 |
foreach package_key [array names repository] { |
| |
32 |
32 |
array unset version |
| |
33 |
33 |
array set version $repository($package_key) |
| |
34 |
34 |
|
| |
35 |
35 |
if { ![exists_and_not_null package_type] || [string equal $version(package.type) $package_type] } { |
| |
36 |
36 |
set package_key $version(package.key) |
| |
37 |
37 |
|
| |
38 |
38 |
# If in upgrade mode, only add to list if it's an upgrade |
| |
39 |
39 |
if { !$upgrade_p || [string equal $version(install_type) upgrade] } { |
| |
40 |
40 |
set package([string toupper $version(package-name)]) \ |
| |
41 |
41 |
[list \ |
| |
42 |
42 |
$version(package.key) \ |
| |
43 |
43 |
$version(package-name) \ |
| |
44 |
44 |
$version(name) \ |
| |
45 |
45 |
$version(package.type) \ |
| |
46 |
46 |
$version(install_type) \ |
| |
47 |
|
$version(summary)] |
| |
|
47 |
$version(summary) \ |
| |
|
48 |
$version(maturity)] |
| |
48 |
49 |
} |
| |
49 |
50 |
} |
| |
50 |
51 |
} |
| |
51 |
52 |
|
| |
52 |
53 |
|
| |
53 |
54 |
##### |
| |
54 |
55 |
# |
| |
55 |
56 |
# Output the list |
| |
56 |
57 |
# |
| |
57 |
58 |
##### |
| |
58 |
59 |
|
| |
59 |
60 |
# Sort the list alphabetically (in case package_name and package_key doesn't sort the same) |
| |
60 |
|
multirow create packages package_key package_name version_name package_type install_type summary |
| |
|
61 |
multirow create packages package_key package_name version_name package_type install_type summary maturity |
| |
61 |
62 |
foreach name [lsort -ascii [array names package]] { |
| |
62 |
63 |
set row $package($name) |
| |
63 |
64 |
multirow append packages \ |
| |
64 |
65 |
[lindex $row 0] \ |
| |
65 |
66 |
[lindex $row 1] \ |
| |
66 |
67 |
[lindex $row 2] \ |
| |
67 |
68 |
[lindex $row 3] \ |
| |
68 |
69 |
[lindex $row 4] \ |
| |
69 |
|
[lindex $row 5] |
| |
|
70 |
[lindex $row 5] \ |
| |
|
71 |
[apm::package_version::attributes::maturity_int_to_text [lindex $row 6]] |
| |
70 |
72 |
} |
| |
71 |
73 |
|
| |
72 |
74 |
multirow extend packages install_url |
| |
73 |
75 |
multirow -unclobber foreach packages { |
| |
74 |
76 |
set install_url [export_vars -base install-2 { package_key repository_url }] |
| |
75 |
77 |
} |
| |
76 |
78 |
|
| |
77 |
79 |
|
| |
78 |
80 |
# Build the list-builder list |
| |
79 |
81 |
template::list::create \ |
| |
80 |
82 |
-name packages \ |
| |
81 |
83 |
-multirow packages \ |
| |
82 |
84 |
-key package_key \ |
| |
83 |
85 |
-bulk_actions { |
| |
84 |
86 |
"Install checked applications" "install-2" "Install checked applications" |
| |
85 |
87 |
} \ |
| |
86 |
88 |
-bulk_action_export_vars { |
| |
87 |
89 |
repository_url |
| |
88 |
90 |
} \ |
| |
89 |
91 |
-elements { |
| |
90 |
92 |
package_name { |
| |
91 |
93 |
label "Package" |
| |
92 |
94 |
link_url_col install_url |
| |
93 |
95 |
link_html { title "Install this package" } |
| |
94 |
96 |
} |
| |
95 |
97 |
summary { |
| |
96 |
98 |
label "Summary" |
| |
97 |
99 |
} |
| |
|
100 |
maturity { |
| |
|
101 |
label {[apm::package_version::attributes::get_pretty_name maturity]} |
| |
|
102 |
} |
| |
98 |
103 |
version_name { |
| |
99 |
104 |
label "Version" |
| |
100 |
105 |
} |
| |
101 |
106 |
package_type { |
| |
102 |
107 |
label "Type" |
| |
103 |
108 |
display_eval {[ad_decode $package_type "apm_application" "Application" "Service"]} |
| |
104 |
109 |
} |
| |
105 |
110 |
upgrade { |
| |
106 |
111 |
label "Upgrade" |
| |
107 |
112 |
hide_p {[ad_decode $upgrades_p 1 0 1]} |
| |
108 |
113 |
display_eval {[ad_decode $install_type "upgrade" "Upgrade" ""]} |
| |
109 |
114 |
} |
| |
110 |
115 |
} -filters { |
| |
111 |
116 |
package_type { |
| |
112 |
117 |
label "Type" |
| |
113 |
118 |
values { |
| |
114 |
119 |
{Application apm_application} |
| |
115 |
120 |
{Service apm_service} |
| |
116 |
121 |
} |
| |
117 |
122 |
} |