Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
cb336a65
Commit
cb336a65
authored
Apr 29, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(dashboard) further cleanup... the same, but different
parent
4021045e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
186 additions
and
358 deletions
+186
-358
fbegin.inc
src/www/fbegin.inc
+1
-1
foot.inc
src/www/foot.inc
+19
-26
index.php
src/www/index.php
+156
-331
system_information.widget.php
src/www/widgets/widgets/system_information.widget.php
+10
-0
No files found.
src/www/fbegin.inc
View file @
cb336a65
...
@@ -194,7 +194,7 @@ if($need_alert_display == true) {
...
@@ -194,7 +194,7 @@ if($need_alert_display == true) {
<a
href=
"
<?=
$button
[
'href'
];
?>
"
class=
"btn btn-primary"
><span
class=
"glyphicon glyphicon-plus-sign __iconspacer"
></span>
<?=
$button
[
'label'
];
?>
</a>
<a
href=
"
<?=
$button
[
'href'
];
?>
"
class=
"btn btn-primary"
><span
class=
"glyphicon glyphicon-plus-sign __iconspacer"
></span>
<?=
$button
[
'label'
];
?>
</a>
<?php
endforeach
;
endif
;
?>
<?php
endforeach
;
endif
;
?>
<?php
if
(
isset
(
$widget
files
))
:
?>
<?php
if
(
isset
(
$widget
Collection
))
:
?>
<a
href=
"#"
id=
"updatepref"
style=
"display:none"
onclick=
"return updatePref();"
class=
"btn btn-primary"
>
<?=
gettext
(
"Save Settings"
);
?>
</a>
<a
href=
"#"
id=
"updatepref"
style=
"display:none"
onclick=
"return updatePref();"
class=
"btn btn-primary"
>
<?=
gettext
(
"Save Settings"
);
?>
</a>
<button
type=
"button"
class=
"btn btn-default"
data-toggle=
"modal"
data-target=
"#modal_widgets"
><span
class=
"glyphicon glyphicon-plus-sign __iconspacer"
></span>
<?=
gettext
(
'Add widget'
)
?>
</button>
<button
type=
"button"
class=
"btn btn-default"
data-toggle=
"modal"
data-target=
"#modal_widgets"
><span
class=
"glyphicon glyphicon-plus-sign __iconspacer"
></span>
<?=
gettext
(
'Add widget'
)
?>
</button>
<?php
endif
;
?>
<?php
endif
;
?>
...
...
src/www/foot.inc
View file @
cb336a65
...
@@ -11,51 +11,44 @@
...
@@ -11,51 +11,44 @@
</main>
</main>
<?php
<?php
if
(
isset
(
$widgetfiles
))
:
if
(
isset
(
$widgetCollection
))
:
$widgetfiles_add
=
$widgetfiles
;
// sort by name
sort
(
$widgetfiles_add
);
usort
(
$widgetCollection
,
function
(
$item1
,
$item2
)
{
return
strcmp
(
strtolower
(
$item1
[
'name'
]),
strtolower
(
$item2
[
'name'
]));
});
?>
?>
<div
class=
"modal fade"
id=
"modal_widgets"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"modal_widgets_label"
aria-hidden=
"true"
>
<div
class=
"modal fade"
id=
"modal_widgets"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"modal_widgets_label"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
><span
aria-hidden=
"true"
>
×
</span><span
class=
"sr-only"
>
Close
</span></button>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
>
<span
aria-hidden=
"true"
>
×
</span>
<span
class=
"sr-only"
>
<?=
gettext
(
"Close"
);
?>
</span>
</button>
<h4
class=
"modal-title"
id=
"modal_widgets_label"
>
<?=
gettext
(
"Available Widgets"
);
?>
</h4>
<h4
class=
"modal-title"
id=
"modal_widgets_label"
>
<?=
gettext
(
"Available Widgets"
);
?>
</h4>
</div>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
<table
class=
"table table-striped table-hover"
>
<table
class=
"table table-striped table-hover"
>
<?php
<?php
foreach
(
$widgetfiles_add
as
$widget
)
:
foreach
(
$widgetCollection
as
$widgetItem
)
:
if
(
!
stristr
(
$widget
,
"widget.php"
))
$widgettitle
=
$widgetItem
[
'name'
]
.
"_title"
;
continue
;
$widgettitlelink
=
$widgetItem
[
'name'
]
.
"_title_link"
;
if
(
isset
(
$$widgettitle
))
:?>
$periodpos
=
strpos
(
$widget
,
"."
);
$widgetname
=
substr
(
$widget
,
0
,
$periodpos
);
$nicename
=
$widgetname
;
$nicename
=
str_replace
(
"_"
,
" "
,
$nicename
);
//make the title look nice
$nicename
=
ucwords
(
$nicename
);
$widgettitle
=
$widgetname
.
"_title"
;
$widgettitlelink
=
$widgetname
.
"_title_link"
;
if
(
isset
(
$$widgettitle
))
:?>
<
tr
>
<
tr
>
<
td
style
=
"cursor: pointer;"
onclick
=
'return addWidget("<?=$widget
name
; ?>")'
><?=
$$widgettitle
;
?>
</td>
<
td
style
=
"cursor: pointer;"
onclick
=
'return addWidget("<?=$widget
Item['
name
']
; ?>")'
><?=
$$widgettitle
;
?>
</td>
</tr>
</tr>
<?php
<?php
elseif
(
$nicename
!=
""
)
:
?>
elseif
(
!
empty
(
$widgetItem
[
'display_name'
])
)
:
?>
<tr>
<tr>
<td
style=
"cursor: pointer;"
onclick=
'return addWidget("
<?=
$widget
name
;
?>
")'
>
<?=
$nicename
;
?>
</td>
<td
style=
"cursor: pointer;"
onclick=
'return addWidget("
<?=
$widget
Item
[
'name'
];
?>
")'
>
<?=
$widgetItem
[
'display_name'
]
;
?>
</td>
</tr>
</tr>
<?php
<?php
endif
;
endif
;
endforeach
;
?>
endforeach
;
?>
</table>
</table>
</div>
</div>
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
<?=
gettext
(
"Close"
);
?>
</button>
</div>
</div>
</div>
<!-- /modal-content -->
</div>
<!-- /modal-content -->
</div>
<!-- /modal-dialog -->
</div>
<!-- /modal-dialog -->
...
...
src/www/index.php
View file @
cb336a65
This diff is collapsed.
Click to expand it.
src/www/widgets/widgets/system_information.widget.php
View file @
cb336a65
...
@@ -34,6 +34,16 @@ require_once("pfsense-utils.inc");
...
@@ -34,6 +34,16 @@ require_once("pfsense-utils.inc");
require_once
(
"system.inc"
);
require_once
(
"system.inc"
);
require_once
(
"stats.inc"
);
require_once
(
"stats.inc"
);
## Check to see if we have a swap space,
## if true, display, if false, hide it ...
$swapinfo
=
`/usr/sbin/swapinfo`
;
if
(
stristr
(
$swapinfo
,
'%'
))
{
$showswap
=
true
;
}
else
{
$showswap
=
false
;
}
if
(
isset
(
$_REQUEST
[
'getupdatestatus'
]))
{
if
(
isset
(
$_REQUEST
[
'getupdatestatus'
]))
{
$pkg_json
=
trim
(
configd_run
(
'firmware check'
));
$pkg_json
=
trim
(
configd_run
(
'firmware check'
));
if
(
$pkg_json
!=
''
)
{
if
(
$pkg_json
!=
''
)
{
...
...
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