Skip to content

Commit 6fa2778

Browse files
authored
Merge pull request #6231 from BOINC/dpa_buda12
Web: improve appearance of BUDA interface. No changes in functionality.
2 parents 080859a + 4c4ac78 commit 6fa2778

File tree

3 files changed

+36
-18
lines changed

3 files changed

+36
-18
lines changed

html/user/buda.php

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,29 +70,28 @@ function app_list($notice=null) {
7070
text_start();
7171
echo "
7272
<p>BUDA (BOINC Universal Docker App)
73-
lets you submit Docker jobs using a web interface;
74-
you don't need to log into the BOINC server.
75-
<p>
73+
lets you submit Docker jobs using a web interface.
7674
<a href=https://github.com/BOINC/boinc/wiki/BUDA-overview>BUDA overview</a>.
7775
";
7876

79-
echo "<h2>Science apps</h2>";
8077
$dirs = scandir($buda_root);
8178
foreach ($dirs as $dir) {
8279
if ($dir[0] == '.') continue;
83-
show_app($dir);
80+
panel("Science app: <b>$dir</b>",
81+
function() use ($dir) {
82+
show_app($dir);
83+
}
84+
);
8485
}
85-
echo '<hr>';
8686
show_button_small('buda.php?action=app_form', 'Add science app');
8787
text_end();
8888
page_tail();
8989
}
9090

9191
function show_app($dir) {
9292
global $buda_root;
93-
echo "<hr><font size=+3>$dir</font>\n";
9493
start_table('table-striped');
95-
table_header('Variant name<br><small>click for details</small>', 'Submit jobs');
94+
table_header('Variant<br><small>click for details</small>', 'Submit jobs');
9695
$pcs = scandir("$buda_root/$dir");
9796
foreach ($pcs as $pc) {
9897
if ($pc[0] == '.') continue;
@@ -107,8 +106,11 @@ function show_app($dir) {
107106
echo "<p>";
108107
show_button_small("buda.php?action=variant_form&app=$dir", 'Add variant');
109108
echo "<p>";
110-
show_button_small(
111-
"buda.php?action=app_delete&app=$dir", "Delete science app '$dir'"
109+
show_button(
110+
"buda.php?action=app_delete&app=$dir",
111+
"Delete science app '$dir'",
112+
null,
113+
'btn btn-xs btn-warning'
112114
);
113115
}
114116

@@ -118,10 +120,16 @@ function variant_view() {
118120
if (!is_valid_filename($app)) die('bad arg');
119121
$variant = get_str('variant');
120122
if (!is_valid_filename($variant)) die('bad arg');
121-
page_head("App $app variant $variant");
123+
page_head("BUDA: variant '$variant' of science app '$app'");
122124
$dir = "$buda_root/$app/$variant";
123-
start_table();
124-
table_header('name', 'size', 'md5');
125+
echo "
126+
This variant includes the following files.
127+
The template files and variant.json
128+
were generated when you created the variant.
129+
<p>
130+
";
131+
start_table('table-striped');
132+
table_header('File name', 'size', 'md5');
125133
foreach(scandir($dir) as $f) {
126134
if ($f[0] == '.') continue;
127135
[$md5, $size] = parse_info_file("$dir/.md5/$f");
@@ -132,9 +140,11 @@ function variant_view() {
132140
);
133141
}
134142
end_table();
135-
show_button_small(
143+
show_button(
136144
"buda.php?action=variant_delete&app=$app&variant=$variant",
137-
'Delete variant'
145+
'Delete variant',
146+
null,
147+
'btn btn-xs btn-warning'
138148
);
139149
page_tail();
140150
}
@@ -339,7 +349,7 @@ function variant_delete() {
339349
app_list($notice);
340350
} else {
341351
page_head("Confirm");
342-
echo "Are you sure you want to delete variant $variant of app $app? <p>";
352+
echo "<p>Are you sure you want to delete variant $variant of BUDA app $app? <p>";
343353
show_button(
344354
"buda.php?action=variant_delete&app=$app&variant=$variant&confirmed=yes",
345355
"Yes"
@@ -368,7 +378,7 @@ function app_delete() {
368378
app_list($notice);
369379
} else {
370380
page_head('Confirm');
371-
echo "Are you sure you want to delete app $app? <p>";
381+
echo "<p>Are you sure you want to delete BUDA science app $app? <p>";
372382
show_button(
373383
"buda.php?action=app_delete&app=$app&confirmed=yes",
374384
"Yes"

html/user/buda_submit.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ function submit_form($user) {
4747
form_input_hidden('app', $app);
4848
form_input_hidden('variant', $variant);
4949
form_select("Batch zip file $desc", 'batch_file', $sbitems_zip);
50-
form_input_text('Command-line arguments', 'cmdline');
50+
form_input_text(
51+
'Command-line arguments<br><small>Passed to all jobs in the batch</small>',
52+
'cmdline'
53+
);
5154
form_checkbox(
5255
"Enabled debugging output <br><small>Write Docker commands and output to stderr</small>.",
5356
'wrapper_verbose'

html/user/submit.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,17 @@ function show_aborted($batches, $limit, $user, $app) {
189189
}
190190

191191
// fill in the app and user names in list of batches
192+
// TODO: speed this up by making list of app and user IDs
193+
// and doing lookup just once.
192194
//
193195
function fill_in_app_and_user_names(&$batches) {
194196
foreach ($batches as $batch) {
195197
$app = BoincApp::lookup_id($batch->app_id);
196198
if ($app) {
197199
$batch->app_name = $app->name;
200+
if ($batch->description) {
201+
$batch->app_name .= ": $batch->description";
202+
}
198203
} else {
199204
$batch->app_name = "unknown";
200205
}

0 commit comments

Comments
 (0)