Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Elijah Grubb
emulab-devel
Commits
f8d3f970
Commit
f8d3f970
authored
Feb 16, 2007
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a tab on the showexp page (when showing an instance) to edit the
annotation.
parent
9a903e38
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
27 deletions
+52
-27
www/showexp.php3
www/showexp.php3
+39
-17
www/template_defs.php
www/template_defs.php
+13
-10
No files found.
www/showexp.php3
View file @
f8d3f970
...
...
@@ -9,7 +9,7 @@ require("Sajax.php");
include
(
"showstuff.php3"
);
include
(
"template_defs.php"
);
sajax_init
();
sajax_export
(
"GetExpState"
,
"Show"
);
sajax_export
(
"GetExpState"
,
"Show"
,
"ModifyAnno"
);
#
# Only known and logged in users can look at experiments.
...
...
@@ -46,6 +46,18 @@ if (!$experiment->AccessCheck($this_user, $TB_EXPT_READINFO)) {
USERERROR
(
"You do not have permission to view experiment
$exp_eid
!"
,
1
);
}
# Template Instance Experiments get special treatment in this page.
$instance
=
NULL
;
if
(
$EXPOSETEMPLATES
)
{
$instance
=
TemplateInstance
::
LookupByExptidx
(
$experiment
->
idx
());
if
(
!
is_null
(
$instance
))
{
$tag
=
"Instance"
;
$guid
=
$instance
->
guid
();
$vers
=
$instance
->
vers
();
}
}
#
# For the Sajax Interface
#
...
...
@@ -56,9 +68,17 @@ function GetExpState($a, $b)
return
$experiment
->
state
();
}
function
ModifyAnno
(
$newtext
)
{
global
$this_user
,
$instance
;
$instance
->
SetAnnotation
(
$this_user
,
$newtext
);
return
0
;
}
function
Show
(
$which
,
$arg1
,
$arg2
)
{
global
$experiment
,
$uid
,
$TBSUEXEC_PATH
,
$TBADMINGROUP
;
global
$experiment
,
$
instance
,
$
uid
,
$TBSUEXEC_PATH
,
$TBADMINGROUP
;
$pid
=
$experiment
->
pid
();
$eid
=
$experiment
->
eid
();
$html
=
""
;
...
...
@@ -69,6 +89,14 @@ function Show($which, $arg1, $arg2)
$html
=
ob_get_contents
();
ob_end_clean
();
}
if
(
$which
==
"anno"
)
{
if
(
isset
(
$instance
))
{
ob_start
();
$instance
->
ShowAnnotation
(
1
);
$html
=
ob_get_contents
();
ob_end_clean
();
}
}
elseif
(
$which
==
"details"
)
{
$showevents
=
$arg1
;
$output
=
array
();
...
...
@@ -250,18 +278,6 @@ $paniced = $row["paniced"];
$panic_date
=
$row
[
"panic_date"
];
$lockdown
=
$row
[
"lockdown"
];
# Template Instance Experiments get special treatment in this page.
$instance
=
NULL
;
if
(
$EXPOSETEMPLATES
)
{
$instance
=
TemplateInstance
::
LookupByExptidx
(
$expindex
);
if
(
!
is_null
(
$instance
))
{
$tag
=
"Instance"
;
$guid
=
$instance
->
guid
();
$vers
=
$instance
->
vers
();
}
}
#
# Standard Testbed Header.
#
...
...
@@ -613,6 +629,12 @@ echo "<script type='text/javascript' language='javascript'>
function FullScreenVis() {
window.location.replace('shownsfile.php3?pid=
$pid
&eid=
$eid
');
}
function ModifyAnno() {
textarea = getObjbyName('annotation');
x_ModifyAnno(textarea.value, ModifyAnno_cb);
}
function ModifyAnno_cb(val) {
}
</script>
\n
"
;
#
...
...
@@ -634,10 +656,10 @@ echo "<li>
<a href=
\"
#D
\"
id=
\"
li_details
\"
onclick=
\"
Show('details');
\"
>"
.
"Details</a></li>
\n
"
;
if
(
$instance
&&
$expstate
==
$TB_EXPTSTATE_ACTIVE
)
{
if
(
$instance
)
{
echo
"<li>
<a href=
\"
#E
\"
id=
\"
li_
graphs
\"
onclick=
\"
Show('graphs
');
\"
>"
.
"
Graphs
</a></li>
\n
"
;
<a href=
\"
#E
\"
id=
\"
li_
anno
\"
onclick=
\"
Show('anno
');
\"
>"
.
"
Annotation
</a></li>
\n
"
;
}
echo
"</ul>
\n
"
;
...
...
www/template_defs.php
View file @
f8d3f970
...
...
@@ -1506,8 +1506,9 @@ class TemplateInstance
#
# Display annotation in text box with button to change.
#
function
ShowAnnotation
()
{
function
ShowAnnotation
(
$longform
=
0
)
{
$annotation
=
$this
->
GetAnnotation
();
$cols
=
(
$longform
?
25
:
5
);
if
(
!
$annotation
)
{
$annotation
=
""
;
}
...
...
@@ -1515,11 +1516,12 @@ class TemplateInstance
echo
"<center>"
;
echo
"<b>Annotation</b><br>
\n
"
;
echo
"<form action='fee' method=post>
\n
"
;
echo
"<textarea id='annotation' rows=
5
cols=80>
$annotation
"
.
echo
"<textarea id='annotation' rows=
$cols
cols=80>
$annotation
"
.
"</textarea></form>"
;
echo
"<button name=submit type=button value=submit "
.
"onclick=
\"
ModifyAnno();
\"
>Submit Changes</button>
\n
"
;
echo
"<center>"
;
if
(
!
$longform
)
{
echo
"<script type='text/javascript' language='javascript'>
function ModifyAnno() {
textarea = getObjbyName('annotation');
...
...
@@ -1529,6 +1531,7 @@ class TemplateInstance
}
</script>
\n
"
;
}
}
function
ShowRunAnnotation
(
$runidx
)
{
$annotation
=
$this
->
GetRunAnnotation
(
$runidx
);
if
(
!
$annotation
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment