Skip to content

Commit

Permalink
mv css and js in template dir
Browse files Browse the repository at this point in the history
  • Loading branch information
nniclausse committed Apr 29, 2014
1 parent 6b83a37 commit 165b58e
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 137 deletions.
11 changes: 5 additions & 6 deletions Makefile.in
Expand Up @@ -97,9 +97,9 @@ RECORDER_TARGETDIR = $(ERLANG_LIB_DIR)/$(RECORDER_APPLICATION)-$(VERSION)
CONTROLLER_TARGETDIR = $(ERLANG_LIB_DIR)/$(CONTROLLER_APPLICATION)-$(VERSION)
TARGETDIR = $(ERLANG_LIB_DIR)/$(APPLICATION)-$(VERSION)

STYLES = $(wildcard style/*.css style/*.js)
TEMPLATES = $(wildcard $(ESRC)/templates/*.thtml)
TEMPLATES += $(wildcard $(ESRC)/templates/*.js)
TEMPLATES_STYLE = $(wildcard $(ESRC)/templates/style/*.js)
TEMPLATES_STYLE += $(wildcard $(ESRC)/templates/style/*.css)
TMP = $(wildcard *~) $(wildcard src/*~) $(wildcard inc/*~)
INC_FILES = $(wildcard $(INC)/*.hrl)
MOCHI = $(wildcard $(ESRC)/lib/mochi*.erl)
Expand Down Expand Up @@ -249,7 +249,9 @@ install: tsung doc install_recorder install_controller $(CONFFILE)
install -m 0644 $(CONFFILE) $(DESTDIR)$(CONFDIR)/

install -d $(DESTDIR)$(TEMPLATES_DIR)
install -d $(DESTDIR)$(TEMPLATES_DIR)/style
install -m 0644 $(TEMPLATES) $(DESTDIR)$(TEMPLATES_DIR)/
install -m 0644 $(TEMPLATES_STYLE) $(DESTDIR)$(TEMPLATES_DIR)/style
install -m 0644 $(DTD) $(DESTDIR)$(SHARE_DIR)/

install_recorder:
Expand All @@ -270,16 +272,13 @@ install_controller:
install -d $(DESTDIR)$(CONTROLLER_TARGETDIR)/ebin
install -d $(DESTDIR)$(CONTROLLER_TARGETDIR)/src
install -d $(DESTDIR)$(CONTROLLER_TARGETDIR)/include
install -d $(DESTDIR)$(CONTROLLER_TARGETDIR)/priv/style
install -m 0644 $(INC_FILES) $(DESTDIR)$(CONTROLLER_TARGETDIR)/include
install -m 0644 $(CONTROLLER_TARGET) $(DESTDIR)$(CONTROLLER_TARGETDIR)/ebin

install -m 0644 $(CONTROLLER_APPFILES) $(DESTDIR)$(CONTROLLER_TARGETDIR)/ebin

install -m 0644 $(CONTROLLER_SRC) $(DESTDIR)$(CONTROLLER_TARGETDIR)/src

install -m 0644 $(STYLES) $(DESTDIR)$(CONTROLLER_TARGETDIR)/priv/style

uninstall:
rm -rf $(TARGETDIR) $(SCRIPT)

Expand Down Expand Up @@ -330,7 +329,7 @@ release: Makefile tsung.spec doc user_guide
tar zcf tmp.tgz $(SRC) $(APPFILES_IN) $(INC_FILES) $(LIBSRC) \
$(CONTROLLER_SRC) $(CONTROLLER_APPFILES_IN) $(TESTSRC) \
$(RECORDER_APPFILES_IN) \
$(RECORDER_SRC) $(TEMPLATES) $(STYLES)\
$(RECORDER_SRC) $(TEMPLATES) $(TEMPLATES_STYLE)\
man/*.erl man/*.txt man/*.dia man/*.png man/Makefile man/*.sgml man/*.1 \
docs/*.rst docs/Makefile docs/*.txt docs/README docs/*.py docs/_static docs/_templates \
$(USERMANUAL) $(USERMANUAL_SRC) $(USERMANUAL_IMG) $(DTD) \
Expand Down
37 changes: 23 additions & 14 deletions src/templates/graph.thtml
@@ -1,23 +1,30 @@
[% INCLUDE header.thtml %]

<div id="response_time">
<h3>Response Time</h3>
<h3>Response Time</h3>
<table>
<tr><th>Transactions and Pages</th><th>Requests and connection establishment</th></tr>
<tr>
<td>
<a class="ts_tooltip" href="images/graphes-Transactions-mean.[% ext %]">
<a href="images/graphes-Transactions-mean.[% ext %]">
<img class="graph" src="images/graphes-Transactions-mean_tn.png" alt="transaction response time"/>
<span class="classic"> Response time for pages and transactions (a page
is a group of requests not separated by a thinktime).</span>
</a>
<br/>
<p class="collapse alert-info" id="detailrequest"> Response time in
msec for pages and transactions (a page
is a group of requests not separated by a thinktime).</p>
<a class="btn btn-info" data-toggle="collapse" data-target="#detailrequest"> <i class="icon-ok icon-white"></i>Info &raquo;</a>
</td>
<td>
<a class="ts_tooltip" href="images/graphes-Perfs-mean.[% ext %]">
<img class="graph" src="images/graphes-Perfs-mean_tn.png" alt="mean request response time"/>
<span class="classic"> <em>connect</em> Mean duration of the connection
establishment only.<em>request</em> Mean duration of requests.</span>
<a href="images/graphes-Perfs-mean.[% ext %]">
<img class="graph" src="images/graphes-Perfs-mean_tn.png" alt="mean request response time"/>
</a>
<br/>
<dl class="collapse alert-info" id="detailconnection">
<dt>connect</dt> <dd>Mean duration (in msec) of the connection
establishment only.</dd><dt>request</dt> <dd>Mean duration of
requests (in msec).</dd></dl>
<a class="btn btn-info" data-toggle="collapse" data-target="#detailconnection"> <i class="icon-ok icon-white"></i>Info &raquo;</a>
</td>
</tr>
</table>
Expand Down Expand Up @@ -78,24 +85,26 @@ establishment only.<em>request</em> Mean duration of requests.</span>
</div>

<div id="users">
<h3>Simultaneous Users</h3>
<h3>Simultaneous Users</h3>
<table>
<tr><th>Simultaneous Users</th>
[% IF match %]
<th>Matching responses</th>
[% END %]
</tr>
<tr>
<td> <a class="ts_tooltip" href="images/graphes-Users-simultaneous.[% ext %]">
<td> <a href="images/graphes-Users-simultaneous.[% ext %]">
<img class="graph" src="images/graphes-Users-simultaneous_tn.png"
alt="Users"/>
<span class="classic"><em>users</em> Number of simultaneous users (it's session has started, but not yet finished).
<em>connected</em> number of users with an opened TCP/UDP connection (example: for HTTP, during a think time, the TCP connection can be closed by the server, and it won't be reopened until the thinktime has expired)</span>
alt="Users"/>
</a>
<br/>
<dl class="collapse alert-info" id="detailsimul"><dt>users</dt><dd> Number of simultaneous users (it's session has started, but not yet finished).</dd>
<dt>connected</dt> <dd>number of users with an opened TCP/UDP connection (example: for HTTP, during a think time, the TCP connection can be closed by the server, and it won't be reopened until the thinktime has expired)</dd></dl>
<a class="btn btn-info" data-toggle="collapse" data-target="#detailsimul"> <i class="icon-ok icon-white"></i>Info &raquo;</a>
</td>
[% IF match %]
<td> <a href="images/graphes-Match-rate.[% ext %]">
<img class="graph" src="images/graphes-Match-rate_tn.png" alt="Match"/>
<img class="graph" src="images/graphes-Match-rate_tn.png" alt="Match"/>
</a>
</td>
[% END %]
Expand Down
2 changes: 2 additions & 0 deletions src/templates/header.thtml
Expand Up @@ -13,6 +13,8 @@

</head>
<body>
<script src="style/jquery.min.js"></script>
<script src="style/bootstrap.min.js"></script>

<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
Expand Down
4 changes: 1 addition & 3 deletions src/tsung_controller/ts_controller_sup.erl
Expand Up @@ -101,7 +101,7 @@ start_inets(LogDir) ->
case application:get_env(tsung_controller,web_gui) of
{ok, true} ->
inets:start(),
Path = filename:absname(filename:dirname(code:which(tsung_controller))++"/../priv/style"),
Path = filename:join(filename:dirname(code:which(tsung_controller)),"../../../../../share/tsung/templates/style"),
{ok,Styles} = file:list_dir(Path),
DestDir = filename:join(LogDir,"style"),
file:make_dir(DestDir),
Expand All @@ -119,8 +119,6 @@ start_inets(LogDir) ->
mod_disk_log]},
{erl_script_alias, {"/tsung", [tsung_web]}},
{error_log, "inets_error.log"},
{security_log, "inets_security.log"},
{transfer_log, "inets_transfer.log"},
{mime_types,[ {"html","text/html"},
{"css","text/css"},
{"png","image/png"},
Expand Down
9 changes: 8 additions & 1 deletion src/tsung_stats.pl.in
Expand Up @@ -643,11 +643,18 @@ sub html_report {
conf => $xml_conf,
ext => $imgfmt
};

mkdir "style" unless -d "./style";
copy (($template_dir . "/style/bootstrap.min.js"), "./style/") or die "copy failed : $!";
copy (($template_dir . "/style/bootstrap.min.css"), "./style/") or die "copy failed : $!";
copy (($template_dir . "/style/dashboard.css"), "./style/") or die "copy failed : $!";
copy (($template_dir . "/style/docs.min.css"), "./style/") or die "copy failed : $!";
copy (($template_dir . "/style/jquery.min.js"), "./style/") or die "copy failed : $!";
if (not $dygraph) {
$tt->process("graph.thtml", $vars, "graph.html") or die $tt->error(), "\n";
} else {
$tt->process("graph_dy.thtml", $vars, "graph.html") or die $tt->error(), "\n";
copy (($template_dir . "/dygraph-combined.js"), ".") or die "copy failed : $!";
copy (($template_dir . "/style/dygraph-combined.js"), "./style/") or die "copy failed : $!";
}
}

Expand Down
7 changes: 0 additions & 7 deletions style/bootstrap.min.css

This file was deleted.

98 changes: 0 additions & 98 deletions style/dashboard.css

This file was deleted.

6 changes: 0 additions & 6 deletions style/docs.min.css

This file was deleted.

2 changes: 0 additions & 2 deletions style/dygraph-combined.js

This file was deleted.

2 comments on commit 165b58e

@gonenradai
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this commit seem to have broken installation on ubuntu 12.04.

I successfully installed 2 days ago from a clone of the repository.
I cloned the repo today on another server and 'make install' failed with:

install -m 0644   /usr/share/tsung/templates/style
install: missing destination file operand after `/usr/share/tsung/templates/style'

@nniclausse
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks for reporting the pb.

Please sign in to comment.