Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
opentrafficshaper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yuriy
opentrafficshaper
Commits
4305c489
Commit
4305c489
authored
11 years ago
by
Nigel Kukard
Browse files
Options
Downloads
Patches
Plain Diff
Added stylesheet support to webserver
parent
5fcea7e3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
opentrafficshaper/plugins/webserver/webserver.pm
+22
-10
22 additions, 10 deletions
opentrafficshaper/plugins/webserver/webserver.pm
with
22 additions
and
10 deletions
opentrafficshaper/plugins/webserver/webserver.pm
+
22
−
10
View file @
4305c489
...
...
@@ -360,15 +360,11 @@ sub httpCreateResponse
my
$mainCols
=
12
;
# Check if we have a menu structure, if we do, display the sidebar
my
$styleStr
=
"";
my
$menuStr
=
"";
my
$stylesheetsStr
=
"";
my
$stylesheetStr
=
"";
my
$javascriptStr
=
"";
if
(
defined
(
$options
))
{
# Check if style snippet exists
if
(
defined
(
my
$style
=
$options
->
{'
style
'}))
{
$styleStr
.=
$style
;
}
# Check if menu exists
if
(
my
$menu
=
$options
->
{'
menu
'})
{
$menuStr
=
<<EOF;
...
...
@@ -415,6 +411,20 @@ EOF
$mainCols
=
10
;
}
# Check if we have a list of style assets
if
(
defined
(
my
$stylesheets
=
$options
->
{'
stylesheets
'}))
{
foreach
my
$script
(
@
{
$stylesheets
})
{
$stylesheetsStr
.=
<<EOF;
<link href="$script" rel="stylesheet"></script>
EOF
}
}
# Check if stylesheet snippet exists
if
(
defined
(
my
$stylesheet
=
$options
->
{'
stylesheet
'}))
{
$stylesheetStr
.=
<<EOF;
$stylesheet
EOF
}
# Check if we have a list of javascript assets
if
(
defined
(
my
$javascripts
=
$options
->
{'
javascripts
'}))
{
foreach
my
$script
(
@
{
$javascripts
})
{
...
...
@@ -444,15 +454,17 @@ EOF
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Assets -->
<link href="/static/favicon.ico" rel="icon" />
<link href="/static/jquery-ui/css/ui-lightness/jquery-ui.min.css" rel="stylesheet">
<link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/jquery-ui/css/ui-lightness/jquery-ui.min.css" rel="stylesheet" />
<link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
$stylesheetsStr
<style type="text/css">
body {
padding-top: 50px;
}
$styleStr
$style
sheet
Str
</style>
<!-- End Assets -->
</head>
...
...
@@ -498,7 +510,7 @@ $content
</body>
<script type="text/javascript" src="/static/jquery/js/jquery
.min
.js"></script>
<script type="text/javascript" src="/static/jquery/js/jquery
-1.10.2
.js"></script>
<script type="text/javascript" src="/static/jquery-ui/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="/static/bootstrap/js/bootstrap.min.js"></script>
$javascriptStr
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment