mirror of
https://github.com/ShaYmez/ezservermonitor-web.git
synced 2025-07-03 01:15:15 -04:00
Compare commits
No commits in common. "master" and "v2.3" have entirely different histories.
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1 @@
|
|||||||
/web/css/.sass-cache
|
/web/css/.sass-cache
|
||||||
.htpasswd
|
|
||||||
.htaccess
|
|
||||||
|
674
LICENSE
674
LICENSE
@ -1,674 +0,0 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
11
README.md
11
README.md
@ -9,7 +9,7 @@ In its [Web](http://www.ezservermonitor.com/esm-web/features) version eSM is a P
|
|||||||
- **System** : hostname, OS, kernel version, uptime, last boot date, number of current user(s), server datetime
|
- **System** : hostname, OS, kernel version, uptime, last boot date, number of current user(s), server datetime
|
||||||
- **Load average** : gauges showing the CPU load with the percentage (1 minute, 5 minutes et 15 minutes)
|
- **Load average** : gauges showing the CPU load with the percentage (1 minute, 5 minutes et 15 minutes)
|
||||||
- **Network usage** : displaying the IP address of each network interface with the data transmitted and received
|
- **Network usage** : displaying the IP address of each network interface with the data transmitted and received
|
||||||
- **CPU** : model, frequency, cores number, cache L2, bogomips, temperature
|
- **CPU** : model, frequency, cores number, cache L2, bogomips
|
||||||
- **Disk usage** : table of each mount point with the space available, used and total
|
- **Disk usage** : table of each mount point with the space available, used and total
|
||||||
- **Memory** : table containing the available used and total of RAM
|
- **Memory** : table containing the available used and total of RAM
|
||||||
- **Swap** : table containing the available used and total of Swap
|
- **Swap** : table containing the available used and total of Swap
|
||||||
@ -17,16 +17,9 @@ In its [Web](http://www.ezservermonitor.com/esm-web/features) version eSM is a P
|
|||||||
- **Ping** : ping the hosts defined in the configuration file
|
- **Ping** : ping the hosts defined in the configuration file
|
||||||
- **Services** : displays the status (up or down) services defined in the configuration file
|
- **Services** : displays the status (up or down) services defined in the configuration file
|
||||||
|
|
||||||
Several themes are available !
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Each block can be reloaded manually.
|
Each block can be reloaded manually.
|
||||||
|
|
||||||
You can download the last version [here](http://www.ezservermonitor.com/esm-web/downloads). The [requirements](http://www.ezservermonitor.com/esm-web/documentation) are simple : a Linux environment, a web server (Apache2, Lighttpd, Nginx, ...) and PHP.
|
You can download the last version [here](http://www.ezservermonitor.com/esm-web/downloads). The [requirements](http://www.ezservermonitor.com/esm-web/documentation) are simple : a Linux environment, a web server (Apache2, Lighttpd, Nginx, ...) and PHP.
|
||||||
|
|
||||||
The [documentation](http://www.ezservermonitor.com/esm-web/documentation) explains all the parameters of *esm.config.json*.
|
|
||||||
|
|
||||||
Changelog is available [here](http://www.ezservermonitor.com/esm-web/changelog).
|
View more information on the [official website](http://www.ezservermonitor.com/esm-web/features).
|
||||||
|
|
||||||
**View more information on the [official website](http://www.ezservermonitor.com/esm-web/features).**
|
|
@ -1,8 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
function eSMAutoload($class)
|
|
||||||
{
|
|
||||||
include __DIR__.'/libs/Utils/'.$class.'.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
spl_autoload_register('eSMAutoload');
|
|
@ -1 +0,0 @@
|
|||||||
deny from all
|
|
@ -1,71 +0,0 @@
|
|||||||
{
|
|
||||||
"esm": {
|
|
||||||
"version": "2.5",
|
|
||||||
"website": "http://www.ezservermonitor.com",
|
|
||||||
"check_updates": true,
|
|
||||||
"auto_refresh": 0,
|
|
||||||
"theme": "blue",
|
|
||||||
"custom_title": ""
|
|
||||||
},
|
|
||||||
"cpu": {
|
|
||||||
"enable_temperature": true
|
|
||||||
},
|
|
||||||
"disk": {
|
|
||||||
"show_tmpfs": false,
|
|
||||||
"show_loop": false,
|
|
||||||
"show_filesystem": true,
|
|
||||||
"ignore_mounts": []
|
|
||||||
},
|
|
||||||
"ping": {
|
|
||||||
"hosts": [
|
|
||||||
"facebook.com",
|
|
||||||
"google.com",
|
|
||||||
"yahoo.com"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"last_login": {
|
|
||||||
"enable": true,
|
|
||||||
"max": 5
|
|
||||||
},
|
|
||||||
"services": {
|
|
||||||
"show_port": true,
|
|
||||||
"list": [
|
|
||||||
{
|
|
||||||
"name": "Web Server",
|
|
||||||
"host": "localhost",
|
|
||||||
"port": 80,
|
|
||||||
"protocol": "tcp"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Email Server (incoming)",
|
|
||||||
"host": "localhost",
|
|
||||||
"port": 993,
|
|
||||||
"protocol": "tcp"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Email Server (outgoing)",
|
|
||||||
"host": "localhost",
|
|
||||||
"port": 587,
|
|
||||||
"protocol": "tcp"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "FTP Server",
|
|
||||||
"host": "localhost",
|
|
||||||
"port": 21,
|
|
||||||
"protocol": "tcp"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Database Server",
|
|
||||||
"host": "localhost",
|
|
||||||
"port": 3306,
|
|
||||||
"protocol": "tcp"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SSH",
|
|
||||||
"host": "localhost",
|
|
||||||
"port": 22,
|
|
||||||
"protocol": "tcp"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
53
esm.config.json
Normal file
53
esm.config.json
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
"esm": {
|
||||||
|
"version": "2.3",
|
||||||
|
"website": "http://www.ezservermonitor.com",
|
||||||
|
"check_updates": true,
|
||||||
|
"auto_refresh": 0
|
||||||
|
},
|
||||||
|
"disk": {
|
||||||
|
"show_tmpfs": false
|
||||||
|
},
|
||||||
|
"ping": {
|
||||||
|
"hosts": [
|
||||||
|
"facebook.com",
|
||||||
|
"google.com",
|
||||||
|
"yahoo.com"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"last_login": {
|
||||||
|
"max": 5
|
||||||
|
},
|
||||||
|
"services": [
|
||||||
|
{
|
||||||
|
"name": "Web Server",
|
||||||
|
"host": "localhost",
|
||||||
|
"port": 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Email Server (incoming)",
|
||||||
|
"host": "localhost",
|
||||||
|
"port": 993
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Email Server (outgoing)",
|
||||||
|
"host": "localhost",
|
||||||
|
"port": 587
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "FTP Server",
|
||||||
|
"host": "localhost",
|
||||||
|
"port": 21
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Database Server",
|
||||||
|
"host": "localhost",
|
||||||
|
"port": 3306
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SSH Service",
|
||||||
|
"host": "localhost",
|
||||||
|
"port": 22
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
50
index.php
50
index.php
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
require 'autoload.php';
|
require 'libs/Utils/Misc.class.php';
|
||||||
|
require 'libs/Utils/Config.class.php';
|
||||||
$Config = new Config();
|
$Config = new Config();
|
||||||
$update = $Config->checkUpdate();
|
$update = $Config->checkUpdate();
|
||||||
?>
|
?>
|
||||||
@ -7,6 +8,9 @@ $update = $Config->checkUpdate();
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
<?php if ($Config->get('esm:auto_refresh') > 0): ?>
|
||||||
|
<meta http-equiv="refresh" content="<?php echo $Config->get('esm:auto_refresh'); ?>">
|
||||||
|
<?php endif; ?>
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
<title>eZ Server Monitor - <?php echo Misc::getHostname(); ?></title>
|
<title>eZ Server Monitor - <?php echo Misc::getHostname(); ?></title>
|
||||||
<link rel="stylesheet" href="web/css/utilities.css" type="text/css">
|
<link rel="stylesheet" href="web/css/utilities.css" type="text/css">
|
||||||
@ -32,15 +36,11 @@ $update = $Config->checkUpdate();
|
|||||||
});
|
});
|
||||||
|
|
||||||
esm.getAll();
|
esm.getAll();
|
||||||
|
|
||||||
<?php if ($Config->get('esm:auto_refresh') > 0): ?>
|
|
||||||
setInterval(function(){ esm.getAll(); }, <?php echo $Config->get('esm:auto_refresh') * 1000; ?>);
|
|
||||||
<?php endif; ?>
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
<body class="theme-<?php echo $Config->get('esm:theme'); ?>">
|
|
||||||
|
|
||||||
<nav role="main">
|
<nav role="main">
|
||||||
<div id="appname">
|
<div id="appname">
|
||||||
@ -49,12 +49,7 @@ $update = $Config->checkUpdate();
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="hostname">
|
<div id="hostname">
|
||||||
<?php
|
<?php echo Misc::getHostname(); ?> - <?php echo Misc::getLanIP(); ?>
|
||||||
if ($Config->get('esm:custom_title') != '')
|
|
||||||
echo $Config->get('esm:custom_title');
|
|
||||||
else
|
|
||||||
echo Misc::getHostname().' - '.Misc::getLanIP();
|
|
||||||
?>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if (!is_null($update)): ?>
|
<?php if (!is_null($update)): ?>
|
||||||
@ -129,17 +124,15 @@ $update = $Config->checkUpdate();
|
|||||||
<input type="text" class="gauge" id="load-average_1" value="0" data-height="100" data-width="150" data-min="0" data-max="100" data-readOnly="true" data-fgColor="#BED7EB" data-angleOffset="-90" data-angleArc="180">
|
<input type="text" class="gauge" id="load-average_1" value="0" data-height="100" data-width="150" data-min="0" data-max="100" data-readOnly="true" data-fgColor="#BED7EB" data-angleOffset="-90" data-angleArc="180">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="f-left w33p">
|
<div class="f-right w33p">
|
||||||
<h3>5 min</h3>
|
|
||||||
<input type="text" class="gauge" id="load-average_5" value="0" data-height="100" data-width="150" data-min="0" data-max="100" data-readOnly="true" data-fgColor="#BED7EB" data-angleOffset="-90" data-angleArc="180">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="f-left w33p">
|
|
||||||
<h3>15 min</h3>
|
<h3>15 min</h3>
|
||||||
<input type="text" class="gauge" id="load-average_15" value="0" data-height="100" data-width="150" data-min="0" data-max="100" data-readOnly="true" data-fgColor="#BED7EB" data-angleOffset="-90" data-angleArc="180">
|
<input type="text" class="gauge" id="load-average_15" value="0" data-height="100" data-width="150" data-min="0" data-max="100" data-readOnly="true" data-fgColor="#BED7EB" data-angleOffset="-90" data-angleArc="180">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="cls"></div>
|
<div class="t-center">
|
||||||
|
<h3>5 min</h3>
|
||||||
|
<input type="text" class="gauge" id="load-average_5" value="0" data-height="100" data-width="150" data-min="0" data-max="100" data-readOnly="true" data-fgColor="#BED7EB" data-angleOffset="-90" data-angleArc="180">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -176,12 +169,6 @@ $update = $Config->checkUpdate();
|
|||||||
<td>Bogomips</td>
|
<td>Bogomips</td>
|
||||||
<td id="cpu-bogomips"></td>
|
<td id="cpu-bogomips"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php if ($Config->get('cpu:enable_temperature')): ?>
|
|
||||||
<tr>
|
|
||||||
<td>Temperature</td>
|
|
||||||
<td id="cpu-temp"></td>
|
|
||||||
</tr>
|
|
||||||
<?php endif; ?>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@ -229,11 +216,8 @@ $update = $Config->checkUpdate();
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<?php if ($Config->get('disk:show_filesystem')): ?>
|
|
||||||
<th class="w10p filesystem">Filesystem</th>
|
|
||||||
<?php endif; ?>
|
|
||||||
<th class="w20p">Mount</th>
|
<th class="w20p">Mount</th>
|
||||||
<th>Use</th>
|
<th class="w35p">Use</th>
|
||||||
<th class="w15p">Free</th>
|
<th class="w15p">Free</th>
|
||||||
<th class="w15p">Used</th>
|
<th class="w15p">Used</th>
|
||||||
<th class="w15p">Total</th>
|
<th class="w15p">Total</th>
|
||||||
@ -261,7 +245,7 @@ $update = $Config->checkUpdate();
|
|||||||
<table class="firstBold">
|
<table class="firstBold">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="w20p">Used %</td>
|
<td class="w20p">Used</td>
|
||||||
<td><div class="progressbar-wrap"><div class="progressbar" style="width: 0%;">0%</div></div></td>
|
<td><div class="progressbar-wrap"><div class="progressbar" style="width: 0%;">0%</div></div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -293,7 +277,7 @@ $update = $Config->checkUpdate();
|
|||||||
<table class="firstBold">
|
<table class="firstBold">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="w20p">Used %</td>
|
<td class="w20p">Used</td>
|
||||||
<td><div class="progressbar-wrap"><div class="progressbar" style="width: 0%;">0%</div></div></td>
|
<td><div class="progressbar-wrap"><div class="progressbar" style="width: 0%;">0%</div></div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -327,13 +311,9 @@ $update = $Config->checkUpdate();
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="box-content">
|
<div class="box-content">
|
||||||
<?php if ($Config->get('last_login:enable') == true): ?>
|
|
||||||
<table>
|
<table>
|
||||||
<tbody></tbody>
|
<tbody></tbody>
|
||||||
</table>
|
</table>
|
||||||
<?php else: ?>
|
|
||||||
<p>Disabled</p>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
136
js/esm.js
136
js/esm.js
@ -3,17 +3,11 @@ var esm = {};
|
|||||||
|
|
||||||
esm.getSystem = function() {
|
esm.getSystem = function() {
|
||||||
|
|
||||||
var module = 'system';
|
$.get('libs/system.php', function(data) {
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
var $box = $('.box#esm-system .box-content tbody');
|
||||||
|
|
||||||
$.get('libs/'+module+'.php', function(data) {
|
esm.insertDatas($box, 'system', data);
|
||||||
|
|
||||||
var $box = $('.box#esm-'+module+' .box-content tbody');
|
|
||||||
|
|
||||||
esm.insertDatas($box, module, data);
|
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
@ -22,20 +16,14 @@ esm.getSystem = function() {
|
|||||||
|
|
||||||
esm.getLoad_average = function() {
|
esm.getLoad_average = function() {
|
||||||
|
|
||||||
var module = 'load_average';
|
$.get('libs/load_average.php', function(data) {
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
var $box = $('.box#esm-load_average .box-content');
|
||||||
|
|
||||||
$.get('libs/'+module+'.php', function(data) {
|
|
||||||
|
|
||||||
var $box = $('.box#esm-'+module+' .box-content');
|
|
||||||
|
|
||||||
esm.reconfigureGauge($('input#load-average_1', $box), data[0]);
|
esm.reconfigureGauge($('input#load-average_1', $box), data[0]);
|
||||||
esm.reconfigureGauge($('input#load-average_5', $box), data[1]);
|
esm.reconfigureGauge($('input#load-average_5', $box), data[1]);
|
||||||
esm.reconfigureGauge($('input#load-average_15', $box), data[2]);
|
esm.reconfigureGauge($('input#load-average_15', $box), data[2]);
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -43,17 +31,11 @@ esm.getLoad_average = function() {
|
|||||||
|
|
||||||
esm.getCpu = function() {
|
esm.getCpu = function() {
|
||||||
|
|
||||||
var module = 'cpu';
|
$.get('libs/cpu.php', function(data) {
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
var $box = $('.box#esm-cpu .box-content tbody');
|
||||||
|
|
||||||
$.get('libs/'+module+'.php', function(data) {
|
esm.insertDatas($box, 'cpu', data);
|
||||||
|
|
||||||
var $box = $('.box#esm-'+module+' .box-content tbody');
|
|
||||||
|
|
||||||
esm.insertDatas($box, module, data);
|
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
@ -62,17 +44,11 @@ esm.getCpu = function() {
|
|||||||
|
|
||||||
esm.getMemory = function() {
|
esm.getMemory = function() {
|
||||||
|
|
||||||
var module = 'memory';
|
$.get('libs/memory.php', function(data) {
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
var $box = $('.box#esm-memory .box-content tbody');
|
||||||
|
|
||||||
$.get('libs/'+module+'.php', function(data) {
|
esm.insertDatas($box, 'memory', data);
|
||||||
|
|
||||||
var $box = $('.box#esm-'+module+' .box-content tbody');
|
|
||||||
|
|
||||||
esm.insertDatas($box, module, data);
|
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
|
||||||
|
|
||||||
// Percent bar
|
// Percent bar
|
||||||
var $progress = $('.progressbar', $box);
|
var $progress = $('.progressbar', $box);
|
||||||
@ -96,15 +72,11 @@ esm.getMemory = function() {
|
|||||||
|
|
||||||
esm.getSwap = function() {
|
esm.getSwap = function() {
|
||||||
|
|
||||||
var module = 'swap';
|
$.get('libs/swap.php', function(data) {
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
var $box = $('.box#esm-swap .box-content tbody');
|
||||||
|
|
||||||
$.get('libs/'+module+'.php', function(data) {
|
esm.insertDatas($box, 'swap', data);
|
||||||
|
|
||||||
var $box = $('.box#esm-'+module+' .box-content tbody');
|
|
||||||
|
|
||||||
esm.insertDatas($box, module, data);
|
|
||||||
|
|
||||||
// Percent bar
|
// Percent bar
|
||||||
var $progress = $('.progressbar', $box);
|
var $progress = $('.progressbar', $box);
|
||||||
@ -121,8 +93,6 @@ esm.getSwap = function() {
|
|||||||
else
|
else
|
||||||
$progress.addClass('red');
|
$progress.addClass('red');
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -130,13 +100,9 @@ esm.getSwap = function() {
|
|||||||
|
|
||||||
esm.getDisk = function() {
|
esm.getDisk = function() {
|
||||||
|
|
||||||
var module = 'disk';
|
$.get('libs/disk.php', function(data) {
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
var $box = $('.box#esm-disk .box-content tbody');
|
||||||
|
|
||||||
$.get('libs/'+module+'.php', function(data) {
|
|
||||||
|
|
||||||
var $box = $('.box#esm-'+module+' .box-content tbody');
|
|
||||||
$box.empty();
|
$box.empty();
|
||||||
|
|
||||||
for (var line in data)
|
for (var line in data)
|
||||||
@ -152,22 +118,16 @@ esm.getDisk = function() {
|
|||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
html += '<tr>';
|
html += '<tr>';
|
||||||
|
|
||||||
if (typeof data[line].filesystem != 'undefined')
|
|
||||||
html += '<td class="filesystem">'+data[line].filesystem+'</td>';
|
|
||||||
|
|
||||||
html += '<td>'+data[line].mount+'</td>';
|
html += '<td>'+data[line].mount+'</td>';
|
||||||
html += '<td><div class="progressbar-wrap"><div class="progressbar '+bar_class+'" style="width: '+data[line].percent_used+'%;">'+data[line].percent_used+'%</div></div></td>';
|
html += '<td><div class="progressbar-wrap"><div class="progressbar '+bar_class+'" style="width: '+data[line].percent_used+'%;">'+data[line].percent_used+'%</div></div></td>';
|
||||||
html += '<td class="t-center">'+data[line].free+'</td>';
|
html += '<td class="t-right">'+data[line].free+'</td>';
|
||||||
html += '<td class="t-center">'+data[line].used+'</td>';
|
html += '<td class="t-right">'+data[line].used+'</td>';
|
||||||
html += '<td class="t-center">'+data[line].total+'</td>';
|
html += '<td class="t-right">'+data[line].total+'</td>';
|
||||||
html += '</tr>';
|
html += '</tr>';
|
||||||
|
|
||||||
$box.append(html);
|
$box.append(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -175,13 +135,9 @@ esm.getDisk = function() {
|
|||||||
|
|
||||||
esm.getLast_login = function() {
|
esm.getLast_login = function() {
|
||||||
|
|
||||||
var module = 'last_login';
|
$.get('libs/last_login.php', function(data) {
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
var $box = $('.box#esm-last_login .box-content tbody');
|
||||||
|
|
||||||
$.get('libs/'+module+'.php', function(data) {
|
|
||||||
|
|
||||||
var $box = $('.box#esm-'+module+' .box-content tbody');
|
|
||||||
$box.empty();
|
$box.empty();
|
||||||
|
|
||||||
for (var line in data)
|
for (var line in data)
|
||||||
@ -189,14 +145,13 @@ esm.getLast_login = function() {
|
|||||||
var html = '';
|
var html = '';
|
||||||
html += '<tr>';
|
html += '<tr>';
|
||||||
html += '<td>'+data[line].user+'</td>';
|
html += '<td>'+data[line].user+'</td>';
|
||||||
|
html += '<td>'+data[line].host+'</td>';
|
||||||
html += '<td class="w50p">'+data[line].date+'</td>';
|
html += '<td class="w50p">'+data[line].date+'</td>';
|
||||||
html += '</tr>';
|
html += '</tr>';
|
||||||
|
|
||||||
$box.append(html);
|
$box.append(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -204,13 +159,9 @@ esm.getLast_login = function() {
|
|||||||
|
|
||||||
esm.getNetwork = function() {
|
esm.getNetwork = function() {
|
||||||
|
|
||||||
var module = 'network';
|
$.get('libs/network.php', function(data) {
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
var $box = $('.box#esm-network .box-content tbody');
|
||||||
|
|
||||||
$.get('libs/'+module+'.php', function(data) {
|
|
||||||
|
|
||||||
var $box = $('.box#esm-'+module+' .box-content tbody');
|
|
||||||
$box.empty();
|
$box.empty();
|
||||||
|
|
||||||
for (var line in data)
|
for (var line in data)
|
||||||
@ -219,15 +170,13 @@ esm.getNetwork = function() {
|
|||||||
html += '<tr>';
|
html += '<tr>';
|
||||||
html += '<td>'+data[line].interface+'</td>';
|
html += '<td>'+data[line].interface+'</td>';
|
||||||
html += '<td>'+data[line].ip+'</td>';
|
html += '<td>'+data[line].ip+'</td>';
|
||||||
html += '<td class="t-center">'+data[line].receive+'</td>';
|
html += '<td class="t-right">'+data[line].receive+'</td>';
|
||||||
html += '<td class="t-center">'+data[line].transmit+'</td>';
|
html += '<td class="t-right">'+data[line].transmit+'</td>';
|
||||||
html += '</tr>';
|
html += '</tr>';
|
||||||
|
|
||||||
$box.append(html);
|
$box.append(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -235,13 +184,9 @@ esm.getNetwork = function() {
|
|||||||
|
|
||||||
esm.getPing = function() {
|
esm.getPing = function() {
|
||||||
|
|
||||||
var module = 'ping';
|
$.get('libs/ping.php', function(data) {
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
var $box = $('.box#esm-ping .box-content tbody');
|
||||||
|
|
||||||
$.get('libs/'+module+'.php', function(data) {
|
|
||||||
|
|
||||||
var $box = $('.box#esm-'+module+' .box-content tbody');
|
|
||||||
$box.empty();
|
$box.empty();
|
||||||
|
|
||||||
for (var line in data)
|
for (var line in data)
|
||||||
@ -255,8 +200,6 @@ esm.getPing = function() {
|
|||||||
$box.append(html);
|
$box.append(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -264,13 +207,9 @@ esm.getPing = function() {
|
|||||||
|
|
||||||
esm.getServices = function() {
|
esm.getServices = function() {
|
||||||
|
|
||||||
var module = 'services';
|
$.get('libs/services.php', function(data) {
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
var $box = $('.box#esm-services .box-content tbody');
|
||||||
|
|
||||||
$.get('libs/'+module+'.php', function(data) {
|
|
||||||
|
|
||||||
var $box = $('.box#esm-'+module+' .box-content tbody');
|
|
||||||
$box.empty();
|
$box.empty();
|
||||||
|
|
||||||
for (var line in data)
|
for (var line in data)
|
||||||
@ -288,13 +227,13 @@ esm.getServices = function() {
|
|||||||
$box.append(html);
|
$box.append(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
esm.reloadBlock_spin(module);
|
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
esm.getAll = function() {
|
esm.getAll = function() {
|
||||||
esm.getSystem();
|
esm.getSystem();
|
||||||
esm.getCpu();
|
esm.getCpu();
|
||||||
@ -309,18 +248,7 @@ esm.getAll = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
esm.reloadBlock = function(block) {
|
esm.reloadBlock = function(block) {
|
||||||
|
|
||||||
esm.mapping[block]();
|
esm.mapping[block]();
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
esm.reloadBlock_spin = function(block) {
|
|
||||||
|
|
||||||
var $module = $('.box#esm-'+block);
|
|
||||||
|
|
||||||
$('.reload', $module).toggleClass('spin disabled');
|
|
||||||
$('.box-content', $module).toggleClass('faded');
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
esm.insertDatas = function($box, block, datas) {
|
esm.insertDatas = function($box, block, datas) {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Downward compatible, touchable dial
|
* Downward compatible, touchable dial
|
||||||
*
|
*
|
||||||
* Version: 1.2.11
|
* Version: 1.2.8
|
||||||
* Requires: jQuery v1.7+
|
* Requires: jQuery v1.7+
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012 Anthony Terrien
|
* Copyright (c) 2012 Anthony Terrien
|
||||||
@ -10,15 +10,7 @@
|
|||||||
*
|
*
|
||||||
* Thanks to vor, eskimoblood, spiffistan, FabrizioC
|
* Thanks to vor, eskimoblood, spiffistan, FabrizioC
|
||||||
*/
|
*/
|
||||||
(function (factory) {
|
(function($) {
|
||||||
if (typeof define === 'function' && define.amd) {
|
|
||||||
// AMD. Register as an anonymous module.
|
|
||||||
define(['jquery'], factory);
|
|
||||||
} else {
|
|
||||||
// Browser globals
|
|
||||||
factory(jQuery);
|
|
||||||
}
|
|
||||||
}(function ($) {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Kontrol library
|
* Kontrol library
|
||||||
@ -88,41 +80,43 @@
|
|||||||
._draw();
|
._draw();
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.$.data('kontroled')) return;
|
if(this.$.data('kontroled')) return;
|
||||||
this.$.data('kontroled', true);
|
this.$.data('kontroled', true);
|
||||||
|
|
||||||
this.extend();
|
this.extend();
|
||||||
this.o = $.extend({
|
this.o = $.extend(
|
||||||
|
{
|
||||||
// Config
|
// Config
|
||||||
min: this.$.data('min') !== undefined ? this.$.data('min') : 0,
|
min : this.$.data('min') !== undefined ? this.$.data('min') : 0,
|
||||||
max: this.$.data('max') !== undefined ? this.$.data('max') : 100,
|
max : this.$.data('max') !== undefined ? this.$.data('max') : 100,
|
||||||
stopper: true,
|
stopper : true,
|
||||||
readOnly: this.$.data('readonly') || (this.$.attr('readonly') === 'readonly'),
|
readOnly : this.$.data('readonly') || (this.$.attr('readonly') === 'readonly'),
|
||||||
|
|
||||||
// UI
|
// UI
|
||||||
cursor: this.$.data('cursor') === true && 30
|
cursor : (this.$.data('cursor') === true && 30) ||
|
||||||
|| this.$.data('cursor') || 0,
|
this.$.data('cursor') || 0,
|
||||||
thickness: this.$.data('thickness')
|
thickness : (
|
||||||
&& Math.max(Math.min(this.$.data('thickness'), 1), 0.01)
|
this.$.data('thickness') &&
|
||||||
|| 0.35,
|
Math.max(Math.min(this.$.data('thickness'), 1), 0.01)
|
||||||
lineCap: this.$.data('linecap') || 'butt',
|
) || 0.35,
|
||||||
width: this.$.data('width') || 200,
|
lineCap : this.$.data('linecap') || 'butt',
|
||||||
height: this.$.data('height') || 200,
|
width : this.$.data('width') || 200,
|
||||||
displayInput: this.$.data('displayinput') == null || this.$.data('displayinput'),
|
height : this.$.data('height') || 200,
|
||||||
displayPrevious: this.$.data('displayprevious'),
|
displayInput : this.$.data('displayinput') == null || this.$.data('displayinput'),
|
||||||
fgColor: this.$.data('fgcolor') || '#87CEEB',
|
displayPrevious : this.$.data('displayprevious'),
|
||||||
|
fgColor : this.$.data('fgcolor') || '#87CEEB',
|
||||||
inputColor: this.$.data('inputcolor'),
|
inputColor: this.$.data('inputcolor'),
|
||||||
font: this.$.data('font') || 'Arial',
|
font: this.$.data('font') || 'Arial',
|
||||||
fontWeight: this.$.data('font-weight') || 'bold',
|
fontWeight: this.$.data('font-weight') || 'bold',
|
||||||
inline: false,
|
inline : false,
|
||||||
step: this.$.data('step') || 1,
|
step : this.$.data('step') || 1,
|
||||||
rotation: this.$.data('rotation'),
|
rotation: this.$.data('rotation'),
|
||||||
|
|
||||||
// Hooks
|
// Hooks
|
||||||
draw: null, // function () {}
|
draw : null, // function () {}
|
||||||
change: null, // function (value) {}
|
change : null, // function (value) {}
|
||||||
cancel: null, // function () {}
|
cancel : null, // function () {}
|
||||||
release: null, // function (value) {}
|
release : null, // function (value) {}
|
||||||
|
|
||||||
// Output formatting, allows to add unit: %, ms ...
|
// Output formatting, allows to add unit: %, ms ...
|
||||||
format: function(v) {
|
format: function(v) {
|
||||||
@ -136,12 +130,12 @@
|
|||||||
|
|
||||||
// finalize options
|
// finalize options
|
||||||
this.o.flip = this.o.rotation === 'anticlockwise' || this.o.rotation === 'acw';
|
this.o.flip = this.o.rotation === 'anticlockwise' || this.o.rotation === 'acw';
|
||||||
if (!this.o.inputColor) {
|
if(!this.o.inputColor) {
|
||||||
this.o.inputColor = this.o.fgColor;
|
this.o.inputColor = this.o.fgColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// routing value
|
// routing value
|
||||||
if (this.$.is('fieldset')) {
|
if(this.$.is('fieldset')) {
|
||||||
|
|
||||||
// fieldset = array of integer
|
// fieldset = array of integer
|
||||||
this.v = {};
|
this.v = {};
|
||||||
@ -152,31 +146,33 @@
|
|||||||
s.v[k] = s.o.parse($this.val());
|
s.v[k] = s.o.parse($this.val());
|
||||||
|
|
||||||
$this.bind(
|
$this.bind(
|
||||||
'change blur',
|
'change blur'
|
||||||
function () {
|
, function () {
|
||||||
var val = {};
|
var val = {};
|
||||||
val[k] = $this.val();
|
val[k] = $this.val();
|
||||||
s.val(s._validate(val));
|
s.val(val);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
this.$.find('legend').remove();
|
this.$.find('legend').remove();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// input = integer
|
// input = integer
|
||||||
this.i = this.$;
|
this.i = this.$;
|
||||||
this.v = this.o.parse(this.$.val());
|
this.v = this.o.parse(this.$.val());
|
||||||
this.v === '' && (this.v = this.o.min);
|
(this.v === '') && (this.v = this.o.min);
|
||||||
|
|
||||||
this.$.bind(
|
this.$.bind(
|
||||||
'change blur',
|
'change blur'
|
||||||
function () {
|
, function () {
|
||||||
s.val(s._validate(s.o.parse(s.$.val())));
|
s.val(s._validate(s.o.parse(s.$.val())));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
!this.o.displayInput && this.$.hide();
|
(!this.o.displayInput) && this.$.hide();
|
||||||
|
|
||||||
// adds needed DOM elements (canvas, div)
|
// adds needed DOM elements (canvas, div)
|
||||||
this.$c = $(document.createElement('canvas')).attr({
|
this.$c = $(document.createElement('canvas')).attr({
|
||||||
@ -209,7 +205,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// hdpi support
|
// hdpi support
|
||||||
this.scale = (window.devicePixelRatio || 1) / (
|
this.scale = (window.devicePixelRatio || 1) /
|
||||||
|
(
|
||||||
this.c.webkitBackingStorePixelRatio ||
|
this.c.webkitBackingStorePixelRatio ||
|
||||||
this.c.mozBackingStorePixelRatio ||
|
this.c.mozBackingStorePixelRatio ||
|
||||||
this.c.msBackingStorePixelRatio ||
|
this.c.msBackingStorePixelRatio ||
|
||||||
@ -218,11 +215,11 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
// detects relative width / height
|
// detects relative width / height
|
||||||
this.relativeWidth = this.o.width % 1 !== 0
|
this.relativeWidth = ((this.o.width % 1 !== 0) &&
|
||||||
&& this.o.width.indexOf('%');
|
this.o.width.indexOf('%'));
|
||||||
this.relativeHeight = this.o.height % 1 !== 0
|
this.relativeHeight = ((this.o.height % 1 !== 0) &&
|
||||||
&& this.o.height.indexOf('%');
|
this.o.height.indexOf('%'));
|
||||||
this.relative = this.relativeWidth || this.relativeHeight;
|
this.relative = (this.relativeWidth || this.relativeHeight);
|
||||||
|
|
||||||
// computes size and carves the component
|
// computes size and carves the component
|
||||||
this._carve();
|
this._carve();
|
||||||
@ -256,15 +253,15 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
this._carve = function() {
|
this._carve = function() {
|
||||||
if (this.relative) {
|
if(this.relative) {
|
||||||
var w = this.relativeWidth ?
|
var w = this.relativeWidth ?
|
||||||
this.$div.parent().width() *
|
this.$div.parent().width() *
|
||||||
parseInt(this.o.width) / 100
|
parseInt(this.o.width) / 100 :
|
||||||
: this.$div.parent().width(),
|
this.$div.parent().width(),
|
||||||
h = this.relativeHeight ?
|
h = this.relativeHeight ?
|
||||||
this.$div.parent().height() *
|
this.$div.parent().height() *
|
||||||
parseInt(this.o.height) / 100
|
parseInt(this.o.height) / 100 :
|
||||||
: this.$div.parent().height();
|
this.$div.parent().height();
|
||||||
|
|
||||||
// apply relative
|
// apply relative
|
||||||
this.w = this.h = Math.min(w, h);
|
this.w = this.h = Math.min(w, h);
|
||||||
@ -305,13 +302,17 @@
|
|||||||
|
|
||||||
s.clear();
|
s.clear();
|
||||||
|
|
||||||
s.dH && (d = s.dH());
|
s.dH
|
||||||
|
&& (d = s.dH());
|
||||||
|
|
||||||
|
(d !== false) && s.draw();
|
||||||
|
|
||||||
d !== false && s.draw();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this._touch = function (e) {
|
this._touch = function (e) {
|
||||||
|
|
||||||
var touchMove = function (e) {
|
var touchMove = function (e) {
|
||||||
|
|
||||||
var v = s.xy2val(
|
var v = s.xy2val(
|
||||||
e.originalEvent.touches[s.t].pageX,
|
e.originalEvent.touches[s.t].pageX,
|
||||||
e.originalEvent.touches[s.t].pageY
|
e.originalEvent.touches[s.t].pageY
|
||||||
@ -319,7 +320,7 @@
|
|||||||
|
|
||||||
if (v == s.cv) return;
|
if (v == s.cv) return;
|
||||||
|
|
||||||
if (s.cH && s.cH(v) === false) return;
|
if (s.cH && (s.cH(v) === false)) return;
|
||||||
|
|
||||||
s.change(s._validate(v));
|
s.change(s._validate(v));
|
||||||
s._draw();
|
s._draw();
|
||||||
@ -335,8 +336,8 @@
|
|||||||
k.c.d
|
k.c.d
|
||||||
.bind("touchmove.k", touchMove)
|
.bind("touchmove.k", touchMove)
|
||||||
.bind(
|
.bind(
|
||||||
"touchend.k",
|
"touchend.k"
|
||||||
function () {
|
, function () {
|
||||||
k.c.d.unbind('touchmove.k touchend.k');
|
k.c.d.unbind('touchmove.k touchend.k');
|
||||||
s.val(s.cv);
|
s.val(s.cv);
|
||||||
}
|
}
|
||||||
@ -346,6 +347,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
this._mouse = function (e) {
|
this._mouse = function (e) {
|
||||||
|
|
||||||
var mouseMove = function (e) {
|
var mouseMove = function (e) {
|
||||||
var v = s.xy2val(e.pageX, e.pageY);
|
var v = s.xy2val(e.pageX, e.pageY);
|
||||||
|
|
||||||
@ -365,21 +367,23 @@
|
|||||||
.bind("mousemove.k", mouseMove)
|
.bind("mousemove.k", mouseMove)
|
||||||
.bind(
|
.bind(
|
||||||
// Escape key cancel current change
|
// Escape key cancel current change
|
||||||
"keyup.k",
|
"keyup.k"
|
||||||
function (e) {
|
, function (e) {
|
||||||
if (e.keyCode === 27) {
|
if (e.keyCode === 27) {
|
||||||
k.c.d.unbind("mouseup.k mousemove.k keyup.k");
|
k.c.d.unbind("mouseup.k mousemove.k keyup.k");
|
||||||
|
|
||||||
if (s.eH && s.eH() === false)
|
if (
|
||||||
return;
|
s.eH
|
||||||
|
&& (s.eH() === false)
|
||||||
|
) return;
|
||||||
|
|
||||||
s.cancel();
|
s.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.bind(
|
.bind(
|
||||||
"mouseup.k",
|
"mouseup.k"
|
||||||
function (e) {
|
, function (e) {
|
||||||
k.c.d.unbind('mousemove.k mouseup.k keyup.k');
|
k.c.d.unbind('mousemove.k mouseup.k keyup.k');
|
||||||
s.val(s.cv);
|
s.val(s.cv);
|
||||||
}
|
}
|
||||||
@ -392,23 +396,23 @@
|
|||||||
var o = this.$c.offset();
|
var o = this.$c.offset();
|
||||||
this.x = o.left;
|
this.x = o.left;
|
||||||
this.y = o.top;
|
this.y = o.top;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
this._listen = function () {
|
this._listen = function () {
|
||||||
|
|
||||||
if (!this.o.readOnly) {
|
if (!this.o.readOnly) {
|
||||||
this.$c
|
this.$c
|
||||||
.bind(
|
.bind(
|
||||||
"mousedown",
|
"mousedown"
|
||||||
function (e) {
|
, function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
s._xy()._mouse(e);
|
s._xy()._mouse(e);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.bind(
|
.bind(
|
||||||
"touchstart",
|
"touchstart"
|
||||||
function (e) {
|
, function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
s._xy()._touch(e);
|
s._xy()._touch(e);
|
||||||
}
|
}
|
||||||
@ -419,9 +423,10 @@
|
|||||||
this.$.attr('readonly', 'readonly');
|
this.$.attr('readonly', 'readonly');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.relative) {
|
if(this.relative) {
|
||||||
$(window).resize(function() {
|
$(window).resize(function() {
|
||||||
s._carve().init();
|
s._carve()
|
||||||
|
.init();
|
||||||
s._draw();
|
s._draw();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -451,9 +456,8 @@
|
|||||||
this.$c[0].width = this.$c[0].width;
|
this.$c[0].width = this.$c[0].width;
|
||||||
};
|
};
|
||||||
|
|
||||||
this._validate = function (v) {
|
this._validate = function(v) {
|
||||||
var val = (~~ (((v < 0) ? -0.5 : 0.5) + (v/this.o.step))) * this.o.step;
|
return (~~ (((v < 0) ? -0.5 : 0.5) + (v/this.o.step))) * this.o.step;
|
||||||
return Math.round(val * 100) / 100;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Abstract methods
|
// Abstract methods
|
||||||
@ -470,19 +474,14 @@
|
|||||||
this.h2rgba = function (h, a) {
|
this.h2rgba = function (h, a) {
|
||||||
var rgb;
|
var rgb;
|
||||||
h = h.substring(1,7)
|
h = h.substring(1,7)
|
||||||
rgb = [
|
rgb = [parseInt(h.substring(0,2),16)
|
||||||
parseInt(h.substring(0,2), 16),
|
,parseInt(h.substring(2,4),16)
|
||||||
parseInt(h.substring(2,4), 16),
|
,parseInt(h.substring(4,6),16)];
|
||||||
parseInt(h.substring(4,6), 16)
|
|
||||||
];
|
|
||||||
|
|
||||||
return "rgba(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "," + a + ")";
|
return "rgba(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "," + a + ")";
|
||||||
};
|
};
|
||||||
|
|
||||||
this.copy = function (f, t) {
|
this.copy = function (f, t) {
|
||||||
for (var i in f) {
|
for (var i in f) { t[i] = f[i]; }
|
||||||
t[i] = f[i];
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -502,12 +501,14 @@
|
|||||||
this.PI2 = 2*Math.PI;
|
this.PI2 = 2*Math.PI;
|
||||||
|
|
||||||
this.extend = function () {
|
this.extend = function () {
|
||||||
this.o = $.extend({
|
this.o = $.extend(
|
||||||
bgColor: this.$.data('bgcolor') || '#EEEEEE',
|
{
|
||||||
angleOffset: this.$.data('angleoffset') || 0,
|
bgColor : this.$.data('bgcolor') || '#EEEEEE',
|
||||||
angleArc: this.$.data('anglearc') || 360,
|
angleOffset : this.$.data('angleoffset') || 0,
|
||||||
inline: true
|
angleArc : this.$.data('anglearc') || 360,
|
||||||
}, this.o);
|
inline : true
|
||||||
|
}, this.o
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.val = function (v, triggerRelease) {
|
this.val = function (v, triggerRelease) {
|
||||||
@ -516,10 +517,10 @@
|
|||||||
// reverse format
|
// reverse format
|
||||||
v = this.o.parse(v);
|
v = this.o.parse(v);
|
||||||
|
|
||||||
if (triggerRelease !== false
|
if (
|
||||||
&& v != this.v
|
triggerRelease !== false && (v != this.v) && this.rH &&
|
||||||
&& this.rH
|
(this.rH(v) === false)
|
||||||
&& this.rH(v) === false) { return; }
|
) return;
|
||||||
|
|
||||||
this.cv = this.o.stopper ? max(min(v, this.o.max), this.o.min) : v;
|
this.cv = this.o.stopper ? max(min(v, this.o.max), this.o.min) : v;
|
||||||
this.v = this.cv;
|
this.v = this.cv;
|
||||||
@ -534,23 +535,23 @@
|
|||||||
var a, ret;
|
var a, ret;
|
||||||
|
|
||||||
a = Math.atan2(
|
a = Math.atan2(
|
||||||
x - (this.x + this.w2),
|
x - (this.x + this.w2)
|
||||||
- (y - this.y - this.w2)
|
, - (y - this.y - this.w2)
|
||||||
) - this.angleOffset;
|
) - this.angleOffset;
|
||||||
|
|
||||||
if (this.o.flip) {
|
if (this.o.flip) {
|
||||||
a = this.angleArc - a - this.PI2;
|
a = this.angleArc - a - this.PI2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.angleArc != this.PI2 && (a < 0) && (a > -0.5)) {
|
if(this.angleArc != this.PI2 && (a < 0) && (a > -0.5)) {
|
||||||
|
|
||||||
// if isset angleArc option, set to min if .5 under min
|
// if isset angleArc option, set to min if .5 under min
|
||||||
a = 0;
|
a = 0;
|
||||||
} else if (a < 0) {
|
} else if (a < 0) {
|
||||||
a += this.PI2;
|
a += this.PI2;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (a * (this.o.max - this.o.min) / this.angleArc) + this.o.min;
|
ret = ~~ (0.5 + (a * (this.o.max - this.o.min) / this.angleArc))
|
||||||
|
+ this.o.min;
|
||||||
|
|
||||||
this.o.stopper && (ret = max(min(ret, this.o.max), this.o.min));
|
this.o.stopper && (ret = max(min(ret, this.o.max), this.o.min));
|
||||||
|
|
||||||
@ -558,75 +559,60 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.listen = function () {
|
this.listen = function () {
|
||||||
|
|
||||||
// bind MouseWheel
|
// bind MouseWheel
|
||||||
var s = this, mwTimerStop,
|
var s = this, mwTimerStop, mwTimerRelease,
|
||||||
mwTimerRelease,
|
|
||||||
mw = function (e) {
|
mw = function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
var ori = e.originalEvent,
|
var ori = e.originalEvent
|
||||||
deltaX = ori.detail || ori.wheelDeltaX,
|
,deltaX = ori.detail || ori.wheelDeltaX
|
||||||
deltaY = ori.detail || ori.wheelDeltaY,
|
,deltaY = ori.detail || ori.wheelDeltaY
|
||||||
v = s._validate(s.o.parse(s.$.val()))
|
,v = s._validate(s.o.parse(s.$.val()))
|
||||||
+ (
|
+ (deltaX>0 || deltaY>0 ? s.o.step : deltaX<0 || deltaY<0 ? -s.o.step : 0);
|
||||||
deltaX > 0 || deltaY > 0
|
|
||||||
? s.o.step
|
|
||||||
: deltaX < 0 || deltaY < 0 ? -s.o.step : 0
|
|
||||||
);
|
|
||||||
|
|
||||||
v = max(min(v, s.o.max), s.o.min);
|
v = max(min(v, s.o.max), s.o.min);
|
||||||
|
|
||||||
s.val(v, false);
|
s.val(v, false);
|
||||||
|
|
||||||
if (s.rH) {
|
if(s.rH) {
|
||||||
// Handle mousewheel stop
|
// Handle mousewheel stop
|
||||||
clearTimeout(mwTimerStop);
|
clearTimeout(mwTimerStop);
|
||||||
mwTimerStop = setTimeout(function () {
|
mwTimerStop = setTimeout(function() {
|
||||||
s.rH(v);
|
s.rH(v);
|
||||||
mwTimerStop = null;
|
mwTimerStop = null;
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
// Handle mousewheel releases
|
// Handle mousewheel releases
|
||||||
if (!mwTimerRelease) {
|
if(!mwTimerRelease) {
|
||||||
mwTimerRelease = setTimeout(function () {
|
mwTimerRelease = setTimeout(function() {
|
||||||
if (mwTimerStop)
|
if(mwTimerStop) s.rH(v);
|
||||||
s.rH(v);
|
|
||||||
mwTimerRelease = null;
|
mwTimerRelease = null;
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
kval,
|
, kval, to, m = 1, kv = {37:-s.o.step, 38:s.o.step, 39:s.o.step, 40:-s.o.step};
|
||||||
to,
|
|
||||||
m = 1,
|
|
||||||
kv = {
|
|
||||||
37: -s.o.step,
|
|
||||||
38: s.o.step,
|
|
||||||
39: s.o.step,
|
|
||||||
40: -s.o.step
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$
|
this.$
|
||||||
.bind(
|
.bind(
|
||||||
"keydown",
|
"keydown"
|
||||||
function (e) {
|
,function (e) {
|
||||||
var kc = e.keyCode;
|
var kc = e.keyCode;
|
||||||
|
|
||||||
// numpad support
|
// numpad support
|
||||||
if (kc >= 96 && kc <= 105) {
|
if(kc >= 96 && kc <= 105) {
|
||||||
kc = e.keyCode = kc - 48;
|
kc = e.keyCode = kc - 48;
|
||||||
}
|
}
|
||||||
|
|
||||||
kval = parseInt(String.fromCharCode(kc));
|
kval = parseInt(String.fromCharCode(kc));
|
||||||
|
|
||||||
if (isNaN(kval)) {
|
if (isNaN(kval)) {
|
||||||
|
|
||||||
(kc !== 13) // enter
|
(kc !== 13) // enter
|
||||||
&& kc !== 8 // bs
|
&& (kc !== 8) // bs
|
||||||
&& kc !== 9 // tab
|
&& (kc !== 9) // tab
|
||||||
&& kc !== 189 // -
|
&& (kc !== 189) // -
|
||||||
&& (kc !== 190
|
&& (kc !== 190 || s.$.val().match(/\./)) // . only allowed once
|
||||||
|| s.$.val().match(/\./)) // . allowed once
|
|
||||||
&& e.preventDefault();
|
&& e.preventDefault();
|
||||||
|
|
||||||
// arrows
|
// arrows
|
||||||
@ -636,20 +622,20 @@
|
|||||||
var v = s.o.parse(s.$.val()) + kv[kc] * m;
|
var v = s.o.parse(s.$.val()) + kv[kc] * m;
|
||||||
s.o.stopper && (v = max(min(v, s.o.max), s.o.min));
|
s.o.stopper && (v = max(min(v, s.o.max), s.o.min));
|
||||||
|
|
||||||
s.change(s._validate(v));
|
s.change(v);
|
||||||
s._draw();
|
s._draw();
|
||||||
|
|
||||||
// long time keydown speed-up
|
// long time keydown speed-up
|
||||||
to = window.setTimeout(function () {
|
to = window.setTimeout(
|
||||||
m *= 2;
|
function () { m *= 2; }, 30
|
||||||
}, 30);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.bind(
|
.bind(
|
||||||
"keyup",
|
"keyup"
|
||||||
function (e) {
|
,function (e) {
|
||||||
if (isNaN(kval)) {
|
if (isNaN(kval)) {
|
||||||
if (to) {
|
if (to) {
|
||||||
window.clearTimeout(to);
|
window.clearTimeout(to);
|
||||||
@ -662,6 +648,7 @@
|
|||||||
(s.$.val() > s.o.max && s.$.val(s.o.max))
|
(s.$.val() > s.o.max && s.$.val(s.o.max))
|
||||||
|| (s.$.val() < s.o.min && s.$.val(s.o.min));
|
|| (s.$.val() < s.o.min && s.$.val(s.o.min));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -670,8 +657,11 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.init = function () {
|
this.init = function () {
|
||||||
if (this.v < this.o.min
|
|
||||||
|| this.v > this.o.max) { this.v = this.o.min; }
|
if (
|
||||||
|
this.v < this.o.min
|
||||||
|
|| this.v > this.o.max
|
||||||
|
) this.v = this.o.min;
|
||||||
|
|
||||||
this.$.val(this.v);
|
this.$.val(this.v);
|
||||||
this.w2 = this.w / 2;
|
this.w2 = this.w / 2;
|
||||||
@ -696,29 +686,30 @@
|
|||||||
this.endAngle = 1.5 * Math.PI + this.angleOffset + this.angleArc;
|
this.endAngle = 1.5 * Math.PI + this.angleOffset + this.angleArc;
|
||||||
|
|
||||||
var s = max(
|
var s = max(
|
||||||
String(Math.abs(this.o.max)).length,
|
String(Math.abs(this.o.max)).length
|
||||||
String(Math.abs(this.o.min)).length,
|
, String(Math.abs(this.o.min)).length
|
||||||
2
|
, 2
|
||||||
) + 2;
|
) + 2;
|
||||||
|
|
||||||
this.o.displayInput
|
this.o.displayInput
|
||||||
&& this.i.css({
|
&& this.i.css({
|
||||||
'width' : ((this.w / 2 + 4) >> 0) + 'px',
|
'width' : ((this.w / 2 + 4) >> 0) + 'px'
|
||||||
'height' : ((this.w / 3) >> 0) + 'px',
|
,'height' : ((this.w / 3) >> 0) + 'px'
|
||||||
'position' : 'absolute',
|
,'position' : 'absolute'
|
||||||
'vertical-align' : 'middle',
|
,'vertical-align' : 'middle'
|
||||||
'margin-top' : ((this.w / 3) >> 0) + 'px',
|
,'margin-top' : ((this.w / 3) >> 0) + 'px'
|
||||||
'margin-left' : '-' + ((this.w * 3 / 4 + 2) >> 0) + 'px',
|
,'margin-left' : '-' + ((this.w * 3 / 4 + 2) >> 0) + 'px'
|
||||||
'border' : 0,
|
,'border' : 0
|
||||||
'background' : 'none',
|
,'background' : 'none'
|
||||||
'font' : this.o.fontWeight + ' ' + ((this.w / s) >> 0) + 'px ' + this.o.font,
|
,'font' : this.o.fontWeight + ' ' + ((this.w / s) >> 0) + 'px ' + this.o.font
|
||||||
'text-align' : 'center',
|
,'text-align' : 'center'
|
||||||
'color' : this.o.inputColor || this.o.fgColor,
|
,'color' : this.o.inputColor || this.o.fgColor
|
||||||
'padding' : '0px',
|
,'padding' : '0px'
|
||||||
'-webkit-appearance': 'none'
|
,'-webkit-appearance': 'none'
|
||||||
}) || this.i.css({
|
})
|
||||||
'width': '0px',
|
|| this.i.css({
|
||||||
'visibility': 'hidden'
|
'width' : '0px'
|
||||||
|
,'visibility' : 'hidden'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -744,7 +735,6 @@
|
|||||||
this.o.cursor
|
this.o.cursor
|
||||||
&& (sa = ea - this.cursorExt)
|
&& (sa = ea - this.cursorExt)
|
||||||
&& (ea = ea + this.cursorExt);
|
&& (ea = ea + this.cursorExt);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
s: sa,
|
s: sa,
|
||||||
e: ea,
|
e: ea,
|
||||||
@ -753,20 +743,17 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.draw = function () {
|
this.draw = function () {
|
||||||
|
|
||||||
var c = this.g, // context
|
var c = this.g, // context
|
||||||
a = this.arc(this.cv), // Arc
|
a = this.arc(this.cv) // Arc
|
||||||
pa, // Previous arc
|
, pa // Previous arc
|
||||||
r = 1;
|
, r = 1;
|
||||||
|
|
||||||
c.lineWidth = this.lineWidth;
|
c.lineWidth = this.lineWidth;
|
||||||
c.lineCap = this.lineCap;
|
c.lineCap = this.lineCap;
|
||||||
|
|
||||||
if (this.o.bgColor !== "none") {
|
|
||||||
c.beginPath();
|
|
||||||
c.strokeStyle = this.o.bgColor;
|
c.strokeStyle = this.o.bgColor;
|
||||||
c.arc(this.xy, this.xy, this.radius, this.endAngle - 0.00001, this.startAngle + 0.00001, true);
|
c.arc(this.xy, this.xy, this.radius, this.endAngle - 0.00001, this.startAngle + 0.00001, true);
|
||||||
c.stroke();
|
c.stroke();
|
||||||
}
|
|
||||||
|
|
||||||
if (this.o.displayPrevious) {
|
if (this.o.displayPrevious) {
|
||||||
pa = this.arc(this.v);
|
pa = this.arc(this.v);
|
||||||
@ -774,7 +761,7 @@
|
|||||||
c.strokeStyle = this.pColor;
|
c.strokeStyle = this.pColor;
|
||||||
c.arc(this.xy, this.xy, this.radius, pa.s, pa.e, pa.d);
|
c.arc(this.xy, this.xy, this.radius, pa.s, pa.e, pa.d);
|
||||||
c.stroke();
|
c.stroke();
|
||||||
r = this.cv == this.v;
|
r = (this.cv == this.v);
|
||||||
}
|
}
|
||||||
|
|
||||||
c.beginPath();
|
c.beginPath();
|
||||||
@ -799,4 +786,4 @@
|
|||||||
).parent();
|
).parent();
|
||||||
};
|
};
|
||||||
|
|
||||||
}));
|
})(jQuery);
|
@ -9,7 +9,7 @@ class Config
|
|||||||
{
|
{
|
||||||
$this->_checkPHPVersion(5.3);
|
$this->_checkPHPVersion(5.3);
|
||||||
|
|
||||||
$this->file = __DIR__.'/../../conf/esm.config.json';
|
$this->file = __DIR__.'/../../esm.config.json';
|
||||||
|
|
||||||
if (!file_exists($this->file))
|
if (!file_exists($this->file))
|
||||||
throw new \Exception('Config file '.basename($this->file).' not found');
|
throw new \Exception('Config file '.basename($this->file).' not found');
|
||||||
@ -47,8 +47,7 @@ class Config
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// return $tab == $this->config ? null : $tab;
|
return $tab == $this->config ? null : $tab;
|
||||||
return $tab;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
57
libs/Utils/Misc.class.php
Normal file
57
libs/Utils/Misc.class.php
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class Misc
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Returns human size
|
||||||
|
*/
|
||||||
|
public static function getSize($filesize, $precision = 2)
|
||||||
|
{
|
||||||
|
$units = array('', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y');
|
||||||
|
|
||||||
|
foreach ($units as $idUnit => $unit)
|
||||||
|
{
|
||||||
|
if ($filesize > 1024)
|
||||||
|
$filesize /= 1024;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return round($filesize, $precision).' '.$units[$idUnit].'B';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns hostname
|
||||||
|
*/
|
||||||
|
public static function getHostname()
|
||||||
|
{
|
||||||
|
return php_uname('n');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns server IP
|
||||||
|
*/
|
||||||
|
public static function getLanIp()
|
||||||
|
{
|
||||||
|
return $_SERVER['SERVER_ADDR'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows to pluralize a word based on a number
|
||||||
|
* Ex : echo 'mot'.Misc::pluralize(5); ==> prints mots
|
||||||
|
* Ex : echo 'cheva'.Misc::pluralize(5, 'ux', 'l'); ==> prints chevaux
|
||||||
|
* Ex : echo 'cheva'.Misc::pluralize(1, 'ux', 'l'); ==> prints cheval
|
||||||
|
*
|
||||||
|
* @param int $nb
|
||||||
|
* @param string $plural
|
||||||
|
* @param string $singular
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function pluralize($nb, $plural = 's', $singular = '')
|
||||||
|
{
|
||||||
|
return $nb > 1 ? $plural : $singular;
|
||||||
|
}
|
||||||
|
}
|
@ -1,217 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Misc
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Returns human size
|
|
||||||
*
|
|
||||||
* @param float $filesize File size
|
|
||||||
* @param int $precision Number of decimals
|
|
||||||
* @return string Human size
|
|
||||||
*/
|
|
||||||
public static function getSize($filesize, $precision = 2)
|
|
||||||
{
|
|
||||||
$units = array('', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y');
|
|
||||||
|
|
||||||
foreach ($units as $idUnit => $unit)
|
|
||||||
{
|
|
||||||
if ($filesize > 1024)
|
|
||||||
$filesize /= 1024;
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return round($filesize, $precision).' '.$units[$idUnit].'B';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns hostname
|
|
||||||
*
|
|
||||||
* @return string Hostname
|
|
||||||
*/
|
|
||||||
public static function getHostname()
|
|
||||||
{
|
|
||||||
return php_uname('n');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns CPU cores number
|
|
||||||
*
|
|
||||||
* @return int Number of cores
|
|
||||||
*/
|
|
||||||
public static function getCpuCoresNumber()
|
|
||||||
{
|
|
||||||
if (!($num_cores = shell_exec('/bin/grep -c ^processor /proc/cpuinfo')))
|
|
||||||
{
|
|
||||||
if (!($num_cores = trim(shell_exec('/usr/bin/nproc'))))
|
|
||||||
{
|
|
||||||
$num_cores = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((int)$num_cores <= 0)
|
|
||||||
$num_cores = 1;
|
|
||||||
|
|
||||||
return (int)$num_cores;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns server IP
|
|
||||||
*
|
|
||||||
* @return string Server local IP
|
|
||||||
*/
|
|
||||||
public static function getLanIp()
|
|
||||||
{
|
|
||||||
return $_SERVER['SERVER_ADDR'];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Seconds to human readable text
|
|
||||||
* Eg: for 36545627 seconds => 1 year, 57 days, 23 hours and 33 minutes
|
|
||||||
*
|
|
||||||
* @return string Text
|
|
||||||
*/
|
|
||||||
public static function getHumanTime($seconds)
|
|
||||||
{
|
|
||||||
$units = array(
|
|
||||||
'year' => 365*86400,
|
|
||||||
'day' => 86400,
|
|
||||||
'hour' => 3600,
|
|
||||||
'minute' => 60,
|
|
||||||
// 'second' => 1,
|
|
||||||
);
|
|
||||||
|
|
||||||
$parts = array();
|
|
||||||
|
|
||||||
foreach ($units as $name => $divisor)
|
|
||||||
{
|
|
||||||
$div = floor($seconds / $divisor);
|
|
||||||
|
|
||||||
if ($div == 0)
|
|
||||||
continue;
|
|
||||||
else
|
|
||||||
if ($div == 1)
|
|
||||||
$parts[] = $div.' '.$name;
|
|
||||||
else
|
|
||||||
$parts[] = $div.' '.$name.'s';
|
|
||||||
$seconds %= $divisor;
|
|
||||||
}
|
|
||||||
|
|
||||||
$last = array_pop($parts);
|
|
||||||
|
|
||||||
if (empty($parts))
|
|
||||||
return $last;
|
|
||||||
else
|
|
||||||
return join(', ', $parts).' and '.$last;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a command that exists in the system among $cmds
|
|
||||||
*
|
|
||||||
* @param array $cmds List of commands
|
|
||||||
* @param string $args List of arguments (optional)
|
|
||||||
* @param bool $returnWithArgs If true, returns command with the arguments
|
|
||||||
* @return string Command
|
|
||||||
*/
|
|
||||||
public static function whichCommand($cmds, $args = '', $returnWithArgs = true)
|
|
||||||
{
|
|
||||||
$return = '';
|
|
||||||
|
|
||||||
foreach ($cmds as $cmd)
|
|
||||||
{
|
|
||||||
if (trim(shell_exec($cmd.' 2>/dev/null '.$args)) != '')
|
|
||||||
{
|
|
||||||
$return = $cmd;
|
|
||||||
|
|
||||||
if ($returnWithArgs)
|
|
||||||
$return .= $args;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allows to pluralize a word based on a number
|
|
||||||
* Ex : echo 'mot'.Misc::pluralize(5); ==> prints mots
|
|
||||||
* Ex : echo 'cheva'.Misc::pluralize(5, 'ux', 'l'); ==> prints chevaux
|
|
||||||
* Ex : echo 'cheva'.Misc::pluralize(1, 'ux', 'l'); ==> prints cheval
|
|
||||||
*
|
|
||||||
* @param int $nb Number
|
|
||||||
* @param string $plural String for plural word
|
|
||||||
* @param string $singular String for singular word
|
|
||||||
* @return string String pluralized
|
|
||||||
*/
|
|
||||||
public static function pluralize($nb, $plural = 's', $singular = '')
|
|
||||||
{
|
|
||||||
return $nb > 1 ? $plural : $singular;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if a port is open (TCP or UPD)
|
|
||||||
*
|
|
||||||
* @param string $host Host to check
|
|
||||||
* @param int $port Port number
|
|
||||||
* @param string $protocol tcp or udp
|
|
||||||
* @param integer $timeout Timeout
|
|
||||||
* @return bool True if the port is open else false
|
|
||||||
*/
|
|
||||||
public static function scanPort($host, $port, $protocol = 'tcp', $timeout = 3)
|
|
||||||
{
|
|
||||||
if ($protocol == 'tcp')
|
|
||||||
{
|
|
||||||
$handle = @fsockopen($host, $port, $errno, $errstr, $timeout);
|
|
||||||
|
|
||||||
if (!$handle)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fclose($handle);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elseif ($protocol == 'udp')
|
|
||||||
{
|
|
||||||
$handle = @fsockopen('udp://'.$host, $port, $errno, $errstr, $timeout);
|
|
||||||
|
|
||||||
socket_set_timeout($handle, $timeout);
|
|
||||||
|
|
||||||
$write = fwrite($handle, 'x00');
|
|
||||||
|
|
||||||
if ($write === false)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$startTime = time();
|
|
||||||
|
|
||||||
$header = fread($handle, 1);
|
|
||||||
|
|
||||||
$endTime = time();
|
|
||||||
|
|
||||||
$timeDiff = $endTime - $startTime;
|
|
||||||
|
|
||||||
fclose($handle);
|
|
||||||
|
|
||||||
if ($timeDiff >= $timeout)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
54
libs/cpu.php
54
libs/cpu.php
@ -1,19 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
require '../autoload.php';
|
|
||||||
$Config = new Config();
|
|
||||||
|
|
||||||
// Number of cores
|
// Number of cores
|
||||||
$num_cores = Misc::getCpuCoresNumber();
|
if (!($num_cores = shell_exec('/bin/grep -c ^processor /proc/cpuinfo')))
|
||||||
|
{
|
||||||
|
$num_cores = 'N.A';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// CPU info
|
// CPU info
|
||||||
$model = 'N.A';
|
if (!($cpuinfo = shell_exec('cat /proc/cpuinfo')))
|
||||||
$frequency = 'N.A';
|
{
|
||||||
$cache = 'N.A';
|
$model = 'N.A';
|
||||||
$bogomips = 'N.A';
|
$frequency = 'N.A';
|
||||||
$temp = 'N.A';
|
$cache = 'N.A';
|
||||||
|
$bogomips = 'N.A';
|
||||||
if ($cpuinfo = shell_exec('cat /proc/cpuinfo'))
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$processors = preg_split('/\s?\n\s?\n/', trim($cpuinfo));
|
$processors = preg_split('/\s?\n\s?\n/', trim($cpuinfo));
|
||||||
|
|
||||||
@ -25,16 +27,15 @@ if ($cpuinfo = shell_exec('cat /proc/cpuinfo'))
|
|||||||
{
|
{
|
||||||
list($key, $value) = preg_split('/\s*:\s*/', trim($detail));
|
list($key, $value) = preg_split('/\s*:\s*/', trim($detail));
|
||||||
|
|
||||||
switch (strtolower($key))
|
switch ($key)
|
||||||
{
|
{
|
||||||
case 'model name':
|
case 'model name':
|
||||||
case 'cpu model':
|
case 'cpu model':
|
||||||
case 'cpu':
|
case 'cpu':
|
||||||
case 'processor':
|
|
||||||
$model = $value;
|
$model = $value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'cpu mhz':
|
case 'cpu MHz':
|
||||||
case 'clock':
|
case 'clock':
|
||||||
$frequency = $value.' MHz';
|
$frequency = $value.' MHz';
|
||||||
break;
|
break;
|
||||||
@ -52,32 +53,6 @@ if ($cpuinfo = shell_exec('cat /proc/cpuinfo'))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($frequency == 'N.A')
|
|
||||||
{
|
|
||||||
if ($f = shell_exec('cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq'))
|
|
||||||
{
|
|
||||||
$f = (int)$f / 1000;
|
|
||||||
$frequency = $f.' MHz';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// CPU Temp
|
|
||||||
if ($Config->get('cpu:enable_temperature'))
|
|
||||||
{
|
|
||||||
if (file_exists('/usr/bin/sensors') && exec('/usr/bin/sensors | grep -E "^(CPU Temp|Core 0)" | cut -d \'+\' -f2 | cut -d \'.\' -f1', $t))
|
|
||||||
{
|
|
||||||
if (isset($t[0]))
|
|
||||||
$temp = $t[0].' °C';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (exec('cat /sys/class/thermal/thermal_zone0/temp', $t))
|
|
||||||
{
|
|
||||||
$temp = round($t[0] / 1000).' °C';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$datas = array(
|
$datas = array(
|
||||||
'model' => $model,
|
'model' => $model,
|
||||||
@ -85,7 +60,6 @@ $datas = array(
|
|||||||
'frequency' => $frequency,
|
'frequency' => $frequency,
|
||||||
'cache' => $cache,
|
'cache' => $cache,
|
||||||
'bogomips' => $bogomips,
|
'bogomips' => $bogomips,
|
||||||
'temp' => $temp,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
echo json_encode($datas);
|
echo json_encode($datas);
|
@ -1,12 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
require '../autoload.php';
|
require 'Utils/Misc.class.php';
|
||||||
|
require 'Utils/Config.class.php';
|
||||||
$Config = new Config();
|
$Config = new Config();
|
||||||
|
|
||||||
$datas = array();
|
$datas = array();
|
||||||
|
|
||||||
# if there are more than 7 awk's colums it means the mount point name contains spaces
|
if (!(exec('/bin/df -T | awk -v c=`/bin/df -T | grep -bo "Type" | awk -F: \'{print $1}\'` \'{print substr($0,c);}\' | tail -n +2 | awk \'{print $1","$2","$3","$4","$5","$6}\'', $df)))
|
||||||
# so consider the first colums as a unique colum and the last 6 as real colums
|
|
||||||
if (!(exec('/bin/df -T -P | tail -n +2 | awk \'{ if (NF > 7) { for (i=1; i<NF-6; i++) { printf("%s ", $i); } for (i=NF-6; i<NF; i++) { printf("%s,", $i); } print $NF; } else { print $1","$2","$3","$4","$5","$6","$7; } }\'', $df)))
|
|
||||||
{
|
{
|
||||||
$datas[] = array(
|
$datas[] = array(
|
||||||
'total' => 'N.A',
|
'total' => 'N.A',
|
||||||
@ -14,50 +13,31 @@ if (!(exec('/bin/df -T -P | tail -n +2 | awk \'{ if (NF > 7) { for (i=1; i<NF-6;
|
|||||||
'free' => 'N.A',
|
'free' => 'N.A',
|
||||||
'percent_used' => 0,
|
'percent_used' => 0,
|
||||||
'mount' => 'N.A',
|
'mount' => 'N.A',
|
||||||
'filesystem' => 'N.A',
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mounted_points = array();
|
$mounted_points = array();
|
||||||
$key = 0;
|
|
||||||
|
|
||||||
foreach ($df as $mounted)
|
foreach ($df as $mounted)
|
||||||
{
|
{
|
||||||
list($filesystem, $type, $total, $used, $free, $percent, $mount) = explode(',', $mounted);
|
list($type, $total, $used, $free, $percent, $mount) = explode(',', $mounted);
|
||||||
|
|
||||||
if ($percent > 100)
|
|
||||||
$percent = 100;
|
|
||||||
|
|
||||||
if (strpos($type, 'tmpfs') !== false && $Config->get('disk:show_tmpfs') === false)
|
if (strpos($type, 'tmpfs') !== false && $Config->get('disk:show_tmpfs') === false)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (strpos($filesystem, '/dev/loop') !== false && $Config->get('disk:show_loop') === false)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
foreach ($Config->get('disk:ignore_mounts') as $to_ignore)
|
|
||||||
{
|
|
||||||
if ($mount === $to_ignore)
|
|
||||||
continue 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!in_array($mount, $mounted_points))
|
if (!in_array($mount, $mounted_points))
|
||||||
{
|
{
|
||||||
$mounted_points[] = trim($mount);
|
$mounted_points[] = trim($mount);
|
||||||
|
|
||||||
$datas[$key] = array(
|
$datas[] = array(
|
||||||
'total' => Misc::getSize($total * 1024),
|
'total' => Misc::getSize($total * 1024),
|
||||||
'used' => Misc::getSize($used * 1024),
|
'used' => Misc::getSize($used * 1024),
|
||||||
'free' => Misc::getSize($free * 1024),
|
'free' => Misc::getSize($free * 1024),
|
||||||
'percent_used' => trim($percent, '%'),
|
'percent_used' => trim($percent, '%'),
|
||||||
'mount' => $mount,
|
'mount' => $mount,
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($Config->get('disk:show_filesystem'))
|
|
||||||
$datas[$key]['filesystem'] = $filesystem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$key++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,33 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
require '../autoload.php';
|
require 'Utils/Config.class.php';
|
||||||
$Config = new Config();
|
$Config = new Config();
|
||||||
|
|
||||||
|
|
||||||
$datas = array();
|
$datas = array();
|
||||||
|
|
||||||
if ($Config->get('last_login:enable'))
|
if (!(exec('/usr/bin/lastlog --time 365 | /usr/bin/awk \'{print $1","$3","$4" "$5" "$6" "$7" "$8}\'', $users)))
|
||||||
{
|
{
|
||||||
if (!(exec('/usr/bin/lastlog --time 365 | awk \'{ printf $1";"; for (i=4; i<NF; i++) printf $i" "; print $NF; }\'', $users)))
|
|
||||||
{
|
|
||||||
$datas[] = array(
|
$datas[] = array(
|
||||||
'user' => 'N.A',
|
'user' => 'N.A',
|
||||||
|
'host' => 'N.A',
|
||||||
'date' => 'N.A',
|
'date' => 'N.A',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$max = $Config->get('last_login:max');
|
$max = $Config->get('last_login:max');
|
||||||
|
|
||||||
for ($i = 1; $i < count($users) && $i <= $max; $i++)
|
for ($i = 1; $i < count($users) && $i <= $max; $i++)
|
||||||
{
|
{
|
||||||
list($user, $date) = explode(';', $users[$i]);
|
list($user, $host, $date) = explode(',', $users[$i]);
|
||||||
|
|
||||||
$datas[] = array(
|
$datas[] = array(
|
||||||
'user' => $user,
|
'user' => $user,
|
||||||
|
'host' => $host,
|
||||||
'date' => $date,
|
'date' => $date,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo json_encode($datas);
|
echo json_encode($datas);
|
@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
require '../autoload.php';
|
|
||||||
|
|
||||||
if (!($load_tmp = shell_exec('cat /proc/loadavg | awk \'{print $1","$2","$3}\'')))
|
if (!($load_tmp = shell_exec('cat /proc/loadavg | awk \'{print $1","$2","$3}\'')))
|
||||||
{
|
{
|
||||||
@ -8,13 +7,13 @@ if (!($load_tmp = shell_exec('cat /proc/loadavg | awk \'{print $1","$2","$3}\'')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Number of cores
|
// Number of cores
|
||||||
$cores = Misc::getCpuCoresNumber();
|
$cores = (int)shell_exec('grep -c ^processor /proc/cpuinfo');
|
||||||
|
|
||||||
$load_exp = explode(',', $load_tmp);
|
$load_exp = explode(',', $load_tmp);
|
||||||
|
|
||||||
$load = array_map(
|
$load = array_map(
|
||||||
function ($value, $cores) {
|
function ($value, $cores) {
|
||||||
$v = (int)((float)$value * 100 / $cores);
|
$v = (int)($value * 100 / $cores);
|
||||||
if ($v > 100)
|
if ($v > 100)
|
||||||
$v = 100;
|
$v = 100;
|
||||||
return $v;
|
return $v;
|
||||||
|
@ -1,31 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
require '../autoload.php';
|
require 'Utils/Misc.class.php';
|
||||||
|
|
||||||
$free = 0;
|
// Free
|
||||||
|
if (!($free = shell_exec('/usr/bin/free -to | grep Mem: | awk \'{print $4+$6+$7}\'')))
|
||||||
if (shell_exec('cat /proc/meminfo'))
|
|
||||||
{
|
{
|
||||||
$free = shell_exec('grep MemFree /proc/meminfo | awk \'{print $2}\'');
|
$free = 0;
|
||||||
$buffers = shell_exec('grep Buffers /proc/meminfo | awk \'{print $2}\'');
|
|
||||||
$cached = shell_exec('grep Cached /proc/meminfo | awk \'{print $2}\'');
|
|
||||||
|
|
||||||
$free = (int)$free + (int)$buffers + (int)$cached;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Total
|
// Total
|
||||||
if (!($total = shell_exec('grep MemTotal /proc/meminfo | awk \'{print $2}\'')))
|
if (!($total = shell_exec('/usr/bin/free -to | grep Mem: | awk \'{print $2}\'')))
|
||||||
{
|
{
|
||||||
$total = 0;
|
$total = 0;
|
||||||
}
|
}
|
||||||
$total = (int)$total;
|
|
||||||
|
|
||||||
// Used
|
// Used
|
||||||
$used = $total - $free;
|
$used = $total - $free;
|
||||||
|
|
||||||
// Percent used
|
// Percent used
|
||||||
$percent_used = 0;
|
$percent_used = 100 - (round($free / $total * 100));
|
||||||
if ($total > 0)
|
|
||||||
$percent_used = 100 - (round($free / $total * 100));
|
|
||||||
|
|
||||||
|
|
||||||
$datas = array(
|
$datas = array(
|
||||||
|
@ -1,69 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
require '../autoload.php';
|
require 'Utils/Misc.class.php';
|
||||||
|
|
||||||
$datas = array();
|
$datas = array();
|
||||||
$network = array();
|
$network = array();
|
||||||
|
|
||||||
// Possible commands for ifconfig and ip
|
$ifconfig = trim(shell_exec('which ifconfig'));
|
||||||
$commands = array(
|
|
||||||
'ifconfig' => array('ifconfig', '/sbin/ifconfig', '/usr/bin/ifconfig', '/usr/sbin/ifconfig'),
|
|
||||||
'ip' => array('ip', '/bin/ip', '/sbin/ip', '/usr/bin/ip', '/usr/sbin/ip'),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Returns command line for retreive interfaces
|
if (!(exec($ifconfig.' |awk -F \'[/ |: ]\' \'{print $1}\' |sed -e \'/^$/d\'', $getInterfaces)))
|
||||||
function getInterfacesCommand($commands)
|
|
||||||
{
|
|
||||||
$ifconfig = Misc::whichCommand($commands['ifconfig'], ' | awk -F \'[/ |: ]\' \'{print $1}\' | sed -e \'/^$/d\'');
|
|
||||||
|
|
||||||
if (!empty($ifconfig))
|
|
||||||
{
|
|
||||||
return $ifconfig;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$ip_cmd = Misc::whichCommand($commands['ip'], ' -V', false);
|
|
||||||
|
|
||||||
if (!empty($ip_cmd))
|
|
||||||
{
|
|
||||||
return $ip_cmd.' -oneline link show | awk \'{print $2}\' | sed "s/://"';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns command line for retreive IP address from interface name
|
|
||||||
function getIpCommand($commands, $interface)
|
|
||||||
{
|
|
||||||
$ifconfig = Misc::whichCommand($commands['ifconfig'], ' '.$interface.' | awk \'/inet / {print $2}\' | cut -d \':\' -f2');
|
|
||||||
|
|
||||||
if (!empty($ifconfig))
|
|
||||||
{
|
|
||||||
return $ifconfig;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$ip_cmd = Misc::whichCommand($commands['ip'], ' -V', false);
|
|
||||||
|
|
||||||
if (!empty($ip_cmd))
|
|
||||||
{
|
|
||||||
return 'for family in inet inet6; do '.
|
|
||||||
$ip_cmd.' -oneline -family $family addr show '.$interface.' | grep -v fe80 | awk \'{print $4}\' | sed "s/\/.*//"; ' .
|
|
||||||
'done';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$getInterfaces_cmd = getInterfacesCommand($commands);
|
|
||||||
|
|
||||||
if (is_null($getInterfaces_cmd) || !(exec($getInterfaces_cmd, $getInterfaces)))
|
|
||||||
{
|
{
|
||||||
$datas[] = array('interface' => 'N.A', 'ip' => 'N.A');
|
$datas[] = array('interface' => 'N.A', 'ip' => 'N.A');
|
||||||
}
|
}
|
||||||
@ -72,18 +15,8 @@ else
|
|||||||
foreach ($getInterfaces as $name)
|
foreach ($getInterfaces as $name)
|
||||||
{
|
{
|
||||||
$ip = null;
|
$ip = null;
|
||||||
|
exec($ifconfig.' '.$name.' | awk \'/inet / {print $2}\' | cut -d \':\' -f2', $ip);
|
||||||
|
|
||||||
$getIp_cmd = getIpCommand($commands, $name);
|
|
||||||
|
|
||||||
if (is_null($getIp_cmd) || !(exec($getIp_cmd, $ip)))
|
|
||||||
{
|
|
||||||
$network[] = array(
|
|
||||||
'name' => $name,
|
|
||||||
'ip' => 'N.A',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!isset($ip[0]))
|
if (!isset($ip[0]))
|
||||||
$ip[0] = '';
|
$ip[0] = '';
|
||||||
|
|
||||||
@ -92,7 +25,6 @@ else
|
|||||||
'ip' => $ip[0],
|
'ip' => $ip[0],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($network as $interface)
|
foreach ($network as $interface)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
require '../autoload.php';
|
require 'Utils/Config.class.php';
|
||||||
$Config = new Config();
|
$Config = new Config();
|
||||||
|
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ else
|
|||||||
|
|
||||||
foreach ($hosts as $host)
|
foreach ($hosts as $host)
|
||||||
{
|
{
|
||||||
exec('/bin/ping -qc 1 '.$host.' | awk -F/ \'/^(rtt|round-trip)/ { print $5 }\'', $result);
|
exec('/bin/ping -qc 1 '.$host.' | awk -F/ \'/^rtt/ { print $5 }\'', $result);
|
||||||
|
|
||||||
if (!isset($result[0]))
|
if (!isset($result[0]))
|
||||||
{
|
{
|
||||||
|
@ -1,33 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
require '../autoload.php';
|
require 'Utils/Config.class.php';
|
||||||
$Config = new Config();
|
$Config = new Config();
|
||||||
|
|
||||||
|
|
||||||
$datas = array();
|
$datas = array();
|
||||||
|
|
||||||
$available_protocols = array('tcp', 'udp');
|
if (count($Config->get('services')) > 0)
|
||||||
|
|
||||||
$show_port = $Config->get('services:show_port');
|
|
||||||
|
|
||||||
if (count($Config->get('services:list')) > 0)
|
|
||||||
{
|
{
|
||||||
foreach ($Config->get('services:list') as $service)
|
foreach ($Config->get('services') as $service)
|
||||||
{
|
{
|
||||||
$host = $service['host'];
|
$host = $service['host'];
|
||||||
$port = $service['port'];
|
$sock = @fsockopen($host, $service['port'], $num, $error, 5);
|
||||||
$name = $service['name'];
|
|
||||||
$protocol = isset($service['protocol']) && in_array($service['protocol'], $available_protocols) ? $service['protocol'] : 'tcp';
|
|
||||||
|
|
||||||
if (Misc::scanPort($host, $port, $protocol))
|
|
||||||
$status = 1;
|
|
||||||
else
|
|
||||||
$status = 0;
|
|
||||||
|
|
||||||
|
if ($sock)
|
||||||
|
{
|
||||||
$datas[] = array(
|
$datas[] = array(
|
||||||
'port' => $show_port === true ? $port : '',
|
'port' => $service['port'],
|
||||||
'name' => $name,
|
'name' => $service['name'],
|
||||||
'status' => $status,
|
'status' => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
fclose($sock);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$datas[] = array(
|
||||||
|
'port' => $service['port'],
|
||||||
|
'name' => $service['name'],
|
||||||
|
'status' => 0,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,27 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
require '../autoload.php';
|
require 'Utils/Misc.class.php';
|
||||||
|
|
||||||
// Free
|
// Free
|
||||||
if (!($free = shell_exec('grep SwapFree /proc/meminfo | awk \'{print $2}\'')))
|
if (!($free = shell_exec('grep SwapFree /proc/meminfo | awk \'{print $2}\'')))
|
||||||
{
|
{
|
||||||
$free = 0;
|
$free = 0;
|
||||||
}
|
}
|
||||||
$free = (int)$free;
|
|
||||||
|
|
||||||
// Total
|
// Total
|
||||||
if (!($total = shell_exec('grep SwapTotal /proc/meminfo | awk \'{print $2}\'')))
|
if (!($total = shell_exec('grep SwapTotal /proc/meminfo | awk \'{print $2}\'')))
|
||||||
{
|
{
|
||||||
$total = 0;
|
$total = 0;
|
||||||
}
|
}
|
||||||
$total = (int)$total;
|
|
||||||
|
|
||||||
// Used
|
// Used
|
||||||
$used = $total - $free;
|
$used = $total - $free;
|
||||||
|
|
||||||
// Percent used
|
// Percent used
|
||||||
$percent_used = 0;
|
$percent_used = 100 - (round($free / $total * 100));
|
||||||
if ($total > 0)
|
|
||||||
$percent_used = 100 - (round($free / $total * 100));
|
|
||||||
|
|
||||||
|
|
||||||
$datas = array(
|
$datas = array(
|
||||||
|
@ -1,26 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
require '../autoload.php';
|
require 'Utils/Misc.class.php';
|
||||||
date_default_timezone_set(@date_default_timezone_get());
|
|
||||||
|
|
||||||
// Hostname
|
// Hostname
|
||||||
$hostname = php_uname('n');
|
$hostname = php_uname('n');
|
||||||
|
|
||||||
// OS
|
// OS
|
||||||
if (!file_exists('/usr/bin/lsb_release') || !($os = shell_exec('/usr/bin/lsb_release -ds | cut -d= -f2 | tr -d \'"\'')))
|
if (!($os = shell_exec('/usr/bin/lsb_release -ds')))
|
||||||
{
|
{
|
||||||
if (!file_exists('/etc/system-release') || !($os = shell_exec('cat /etc/system-release | cut -d= -f2 | tr -d \'"\'')))
|
if(!($os = shell_exec('cat /etc/system-release')))
|
||||||
{
|
{
|
||||||
if (!file_exists('/etc/os-release') || !($os = shell_exec('cat /etc/os-release | grep PRETTY_NAME | tail -n 1 | cut -d= -f2 | tr -d \'"\'')))
|
if (!($os = shell_exec('find /etc/*-release -type f -exec cat {} \; | grep NAME | tail -n 1 | cut -d= -f2 | tr -d \'"\'')))
|
||||||
{
|
|
||||||
if (!($os = shell_exec('find /etc/*-release -type f -exec cat {} \; | grep PRETTY_NAME | tail -n 1 | cut -d= -f2 | tr -d \'"\'')))
|
|
||||||
{
|
{
|
||||||
$os = 'N.A';
|
$os = 'N.A';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$os = trim($os, '"');
|
|
||||||
$os = str_replace("\n", '', $os);
|
|
||||||
|
|
||||||
// Kernel
|
// Kernel
|
||||||
if (!($kernel = shell_exec('/bin/uname -r')))
|
if (!($kernel = shell_exec('/bin/uname -r')))
|
||||||
@ -35,7 +29,22 @@ if (!($totalSeconds = shell_exec('/usr/bin/cut -d. -f1 /proc/uptime')))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$uptime = Misc::getHumanTime((int)$totalSeconds);
|
$totalMin = $totalSeconds / 60;
|
||||||
|
$totalHours = $totalMin / 60;
|
||||||
|
|
||||||
|
$days = floor($totalHours / 24);
|
||||||
|
$hours = floor($totalHours - ($days * 24));
|
||||||
|
$min = floor($totalMin - ($days * 60 * 24) - ($hours * 60));
|
||||||
|
|
||||||
|
$uptime = '';
|
||||||
|
if ($days != 0)
|
||||||
|
$uptime .= $days.' day'.Misc::pluralize($days).' ';
|
||||||
|
|
||||||
|
if ($hours != 0)
|
||||||
|
$uptime .= $hours.' hour'.Misc::pluralize($hours).' ';
|
||||||
|
|
||||||
|
if ($min != 0)
|
||||||
|
$uptime .= $min.' minute'.Misc::pluralize($min);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Last boot
|
// Last boot
|
||||||
|
@ -6,43 +6,6 @@ $navbar-height: 60px;
|
|||||||
/* Layout */
|
/* Layout */
|
||||||
$layout-bg-color: #fff;
|
$layout-bg-color: #fff;
|
||||||
|
|
||||||
/* Default colors */
|
/* Basic colors */
|
||||||
$main-color: #99AEC4;
|
$main-color: #99AEC4;
|
||||||
$text-color: #4D5157;
|
$text-color: #4D5157;
|
||||||
|
|
||||||
/* Themes ! */
|
|
||||||
$themes: (
|
|
||||||
blue: (
|
|
||||||
main-color: #99AEC4
|
|
||||||
),
|
|
||||||
aqua: (
|
|
||||||
main-color: #75C8C7
|
|
||||||
),
|
|
||||||
green: (
|
|
||||||
main-color: #9DC499
|
|
||||||
),
|
|
||||||
light-green: (
|
|
||||||
main-color: #ADD8C7
|
|
||||||
),
|
|
||||||
orange: (
|
|
||||||
main-color: #E8B184
|
|
||||||
),
|
|
||||||
red: (
|
|
||||||
main-color: #B36973
|
|
||||||
),
|
|
||||||
light-red: (
|
|
||||||
main-color: #E89D9D
|
|
||||||
),
|
|
||||||
purple: (
|
|
||||||
main-color: #AA8ECC
|
|
||||||
),
|
|
||||||
slate: (
|
|
||||||
main-color: #7C8998
|
|
||||||
),
|
|
||||||
light: (
|
|
||||||
main-color: #C4C4C4
|
|
||||||
),
|
|
||||||
dark: (
|
|
||||||
main-color: #747474
|
|
||||||
)
|
|
||||||
);
|
|
@ -1,27 +1,26 @@
|
|||||||
@import "_config.frontend";
|
/* Buttons */
|
||||||
|
$button-default-color: #c5c5c5;
|
||||||
|
$button-red: #ff0000;
|
||||||
|
$button-orange: #fe9c43;
|
||||||
|
$button-purple: #9a68c7;
|
||||||
|
$button-blue: #3ba9e4;
|
||||||
|
$button-green: #75b343;
|
||||||
|
$button-black: #4b4b4b;
|
||||||
|
$button-salmon: #F5AD9E;
|
||||||
|
|
||||||
/* Labels */
|
/* Labels */
|
||||||
$label: (
|
$label-default: #bfbfbf;
|
||||||
types: (
|
$label-success: #46a546;
|
||||||
default: #bfbfbf,
|
$label-warning: #f89406;
|
||||||
success: #46a546,
|
$label-important: #c43c35;
|
||||||
warning: #f89406,
|
$label-notice: #62cffc;
|
||||||
important: #c43c35,
|
$label-border-radius: 3px;
|
||||||
error: #c43c35,
|
$label-font-size: 10px;
|
||||||
notice: #62cffc
|
|
||||||
),
|
|
||||||
border-radius: 3px,
|
|
||||||
font-size: 10px
|
|
||||||
);
|
|
||||||
|
|
||||||
/* Classic box */
|
/* Classic box */
|
||||||
$classic-box: (
|
$classic-box-color: darken(#99AEC4, 7%);
|
||||||
color: darken($main-color, 7%),
|
$classic-box-background: #fff;
|
||||||
background: #fff,
|
$classic-box-border: lighten(#99AEC4, 16%);
|
||||||
border-color: lighten($main-color, 16%),
|
$classic-box-header-height: 35px;
|
||||||
header: (
|
$classic-box-title-color: #fff;
|
||||||
height: 35px,
|
$classic-box-title-fontsize: 14px;
|
||||||
color: #fff,
|
|
||||||
font-size: 14px
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
@ -15,29 +15,22 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@function map-get-deep($map, $keys...) {
|
@mixin letterpress($opacity) {
|
||||||
@if length($keys) == 1 {
|
text-shadow: rgba(255, 255, 255, $opacity) 0 1px 0;
|
||||||
$keys: nth($keys, 1);
|
}
|
||||||
}
|
|
||||||
$warn: "#{nth($keys, 1)}";
|
@mixin hide-text {
|
||||||
$length: length($keys);
|
font: 0/0 a;
|
||||||
$get: map-get($map, nth($keys, 1));
|
text-shadow: none;
|
||||||
|
color: transparent;
|
||||||
@if $length > 1 {
|
}
|
||||||
@for $i from 2 through $length {
|
|
||||||
@if $get != null and type-of($get) == 'map' {
|
@mixin link-colors($normal, $hover: $normal, $visited: $normal) {
|
||||||
$warn: $warn + "->#{nth($keys, $i)}";
|
color: $normal;
|
||||||
$get: map-get($get, nth($keys, $i));
|
&:hover, &:focus {
|
||||||
|
color: $hover;
|
||||||
@if $get == null {
|
}
|
||||||
@return map-get-deep-warning($warn, $get);
|
&:visited {
|
||||||
}
|
color: $visited;
|
||||||
}
|
}
|
||||||
@else {
|
|
||||||
@return map-get-deep-warning($warn, $get);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@return $get;
|
|
||||||
}
|
}
|
@ -35,6 +35,7 @@ a {
|
|||||||
/* --------------------- */
|
/* --------------------- */
|
||||||
/* == NAVBAR */
|
/* == NAVBAR */
|
||||||
/* --------------------- */
|
/* --------------------- */
|
||||||
|
|
||||||
nav[role="main"] {
|
nav[role="main"] {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
@ -51,7 +52,7 @@ nav[role="main"] {
|
|||||||
|
|
||||||
#appname {
|
#appname {
|
||||||
float: left;
|
float: left;
|
||||||
width: 150px;
|
width: 120px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
@ -79,11 +80,6 @@ nav[role="main"] {
|
|||||||
float: left;
|
float: left;
|
||||||
margin-left: 110px;
|
margin-left: 110px;
|
||||||
line-height: $navbar-height;
|
line-height: $navbar-height;
|
||||||
|
|
||||||
a {
|
|
||||||
color: #fff;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#update {
|
#update {
|
||||||
@ -109,9 +105,11 @@ nav[role="main"] {
|
|||||||
padding: (($navbar-height / 2) - 17px) 15px;
|
padding: (($navbar-height / 2) - 17px) 15px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
@include transition(background 300ms ease-in-out);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: lighten($main-color, 20%);
|
background: lighten($main-color, 6%);
|
||||||
|
@include transition(background 300ms ease-in-out);
|
||||||
}
|
}
|
||||||
|
|
||||||
> span[class^="icon-"] {
|
> span[class^="icon-"] {
|
||||||
@ -127,6 +125,7 @@ nav[role="main"] {
|
|||||||
/* ------------------- */
|
/* ------------------- */
|
||||||
/* == MAIN */
|
/* == MAIN */
|
||||||
/* ------------------- */
|
/* ------------------- */
|
||||||
|
|
||||||
#main-container {
|
#main-container {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
margin-top: $navbar-height;
|
margin-top: $navbar-height;
|
||||||
@ -136,6 +135,31 @@ nav[role="main"] {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------------------- */
|
||||||
|
/* == Listing */
|
||||||
|
/* ---------------------- */
|
||||||
|
ul.list {
|
||||||
|
margin-left: 20px;
|
||||||
|
list-style-type: none;
|
||||||
|
|
||||||
|
li {
|
||||||
|
position: relative;
|
||||||
|
padding-left: 12px;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: '';
|
||||||
|
width: 5px;
|
||||||
|
height: 5px;
|
||||||
|
background-color: $main-color;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 9px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* --------------------- */
|
/* --------------------- */
|
||||||
/* == Tables */
|
/* == Tables */
|
||||||
/* --------------------- */
|
/* --------------------- */
|
||||||
@ -185,13 +209,14 @@ table:not(.no-style) {
|
|||||||
|
|
||||||
table.firstBold tbody tr td:first-child {
|
table.firstBold tbody tr td:first-child {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #7e848c;
|
color: lighten($text-color, 20%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* --------------------------- */
|
/* --------------------------- */
|
||||||
/* == Progress bar */
|
/* == Progress bar */
|
||||||
/* --------------------------- */
|
/* --------------------------- */
|
||||||
|
|
||||||
.progressbar-wrap {
|
.progressbar-wrap {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: rgba($main-color, 0.2);
|
background-color: rgba($main-color, 0.2);
|
||||||
@ -206,35 +231,6 @@ table.firstBold tbody tr td:first-child {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* --------------------------- */
|
|
||||||
/* == Reload style */
|
|
||||||
/* --------------------------- */
|
|
||||||
.reload.spin {
|
|
||||||
@include animation(spin 2000ms infinite linear);
|
|
||||||
}
|
|
||||||
|
|
||||||
@-ms-keyframes spin {
|
|
||||||
from { -ms-transform: rotate(0deg); }
|
|
||||||
to { -ms-transform: rotate(360deg); }
|
|
||||||
}
|
|
||||||
@-moz-keyframes spin {
|
|
||||||
from { -moz-transform: rotate(0deg); }
|
|
||||||
to { -moz-transform: rotate(360deg); }
|
|
||||||
}
|
|
||||||
@-webkit-keyframes spin {
|
|
||||||
from { -webkit-transform: rotate(0deg); }
|
|
||||||
to { -webkit-transform: rotate(360deg); }
|
|
||||||
}
|
|
||||||
@keyframes spin {
|
|
||||||
from {
|
|
||||||
transform:rotate(0deg);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
transform:rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* --------------------------- */
|
/* --------------------------- */
|
||||||
/* == Load Average */
|
/* == Load Average */
|
||||||
/* --------------------------- */
|
/* --------------------------- */
|
||||||
@ -243,109 +239,3 @@ table.firstBold tbody tr td:first-child {
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------- */
|
|
||||||
/* == ! THEMES ! */
|
|
||||||
/* ------------------------- */
|
|
||||||
@each $name, $datas in $themes {
|
|
||||||
body.theme-#{""+$name+""} {
|
|
||||||
a {
|
|
||||||
color: map-get($datas, main-color);
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: lighten(map-get($datas, main-color), 5%);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
::-moz-selection {
|
|
||||||
background-color: darken(map-get($datas, main-color), 10%);
|
|
||||||
color: lighten(map-get($datas, main-color), 30%);
|
|
||||||
}
|
|
||||||
::selection {
|
|
||||||
background-color: darken(map-get($datas, main-color), 10%);
|
|
||||||
color: lighten(map-get($datas, main-color), 30%);
|
|
||||||
}
|
|
||||||
|
|
||||||
nav[role="main"] {
|
|
||||||
background-color: map-get($datas, main-color);
|
|
||||||
|
|
||||||
> ul > li > a {
|
|
||||||
&:hover {
|
|
||||||
background: lighten(map-get($datas, main-color), 15%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
table:not(.no-style) {
|
|
||||||
tbody tr:hover {
|
|
||||||
background: lighten(map-get($datas, main-color), 25%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.progressbar-wrap {
|
|
||||||
background-color: rgba(map-get($datas, main-color), 0.2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------- */
|
|
||||||
/* == Responsive */
|
|
||||||
/* ------------------------- */
|
|
||||||
@media only screen and (max-width: 1024px) {
|
|
||||||
.column-left, .column-right {
|
|
||||||
float: none;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.box {
|
|
||||||
width: 100%;
|
|
||||||
margin-right: 0 !important;
|
|
||||||
margin-left: 0 !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 550px) {
|
|
||||||
nav[role="main"] {
|
|
||||||
#appname {
|
|
||||||
width: 135px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hostname {
|
|
||||||
margin-left: 0;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#update {
|
|
||||||
margin-left: 0;
|
|
||||||
font-size: 9px;
|
|
||||||
position: absolute;
|
|
||||||
top: 47px;
|
|
||||||
line-height: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul > li {
|
|
||||||
> a {
|
|
||||||
padding: 12px 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.box#esm-load_average {
|
|
||||||
div {
|
|
||||||
width: 100%;
|
|
||||||
float: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.box#esm-disk {
|
|
||||||
.filesystem {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
/* -------------------- */
|
/* -------------------- */
|
||||||
/* == Fonts */
|
/* == Fonts */
|
||||||
/* -------------------- */
|
/* -------------------- */
|
||||||
@include font-face('OpenSans-Light', font-files('OpenSans-Light.ttf', 'OpenSans-Light.svg', 'OpenSans-Light.woff'), 'OpenSans-Light.eot');
|
|
||||||
|
@include font-face('OpenSans-Light', font-files('OpenSans-Light.ttf'));
|
||||||
@include font-face('Entypo', font-files('entypo.ttf', 'entypo.eot', 'entypo.svg', 'entypo.woff'));
|
@include font-face('Entypo', font-files('entypo.ttf', 'entypo.eot', 'entypo.svg', 'entypo.woff'));
|
||||||
|
|
||||||
@import "../libs/_icons.entypo";
|
@import "../libs/_icons.entypo";
|
||||||
@ -14,6 +15,7 @@
|
|||||||
/* ------------------- */
|
/* ------------------- */
|
||||||
/* == Misc */
|
/* == Misc */
|
||||||
/* ------------------- */
|
/* ------------------- */
|
||||||
|
|
||||||
* { padding: 0; margin: 0; }
|
* { padding: 0; margin: 0; }
|
||||||
*:focus { outline: none; }
|
*:focus { outline: none; }
|
||||||
|
|
||||||
@ -35,9 +37,14 @@ img { border: 0; }
|
|||||||
|
|
||||||
.debug { border: 1px solid red; }
|
.debug { border: 1px solid red; }
|
||||||
|
|
||||||
.text_left, .t-left { text-align: left !important; }
|
.u { text-decoration: underline; }
|
||||||
|
.b { font-weight: bold; }
|
||||||
|
.i { font-style: italic; }
|
||||||
|
.r { text-decoration: line-through; }
|
||||||
|
|
||||||
|
.text_left, .t-left { text-align: left; }
|
||||||
.text_right, .t-right { text-align: right !important; }
|
.text_right, .t-right { text-align: right !important; }
|
||||||
.text_center, .t-center { text-align: center !important; }
|
.text_center, .t-center { text-align: center; }
|
||||||
|
|
||||||
.pfixed { position: fixed !important; }
|
.pfixed { position: fixed !important; }
|
||||||
.f-left { float: left; }
|
.f-left { float: left; }
|
||||||
@ -58,6 +65,9 @@ img { border: 0; }
|
|||||||
width: 66%;
|
width: 66%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.m-l-10 { margin-left: 10px; }
|
||||||
|
.m-r-10 { margin-right: 10px; }
|
||||||
|
|
||||||
|
|
||||||
/*pre {
|
/*pre {
|
||||||
background-color: #fafafa;
|
background-color: #fafafa;
|
||||||
@ -66,7 +76,6 @@ img { border: 0; }
|
|||||||
color: #666;
|
color: #666;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
.w10p { width: 10%; }
|
|
||||||
.w15p { width: 15%; }
|
.w15p { width: 15%; }
|
||||||
.w20p { width: 20%; }
|
.w20p { width: 20%; }
|
||||||
.w33p { width: 33%; }
|
.w33p { width: 33%; }
|
||||||
@ -74,6 +83,32 @@ img { border: 0; }
|
|||||||
.w50p { width: 50%; }
|
.w50p { width: 50%; }
|
||||||
.w100p { width: 100%; }
|
.w100p { width: 100%; }
|
||||||
|
|
||||||
|
.w30 { width: 30px; }
|
||||||
|
.w50 { width: 50px; }
|
||||||
|
.w60 { width: 60px; }
|
||||||
|
.w70 { width: 70px; }
|
||||||
|
.w75 { width: 75px; }
|
||||||
|
.w90 { width: 90px; }
|
||||||
|
.w100 { width: 100px; }
|
||||||
|
.w110 { width: 110px; }
|
||||||
|
.w120 { width: 120px; }
|
||||||
|
.w130 { width: 130px; }
|
||||||
|
.w150 { width: 150px; }
|
||||||
|
.w180 { width: 180px; }
|
||||||
|
.w200 { width: 200px; }
|
||||||
|
.w220 { width: 220px; }
|
||||||
|
.w250 { width: 250px; }
|
||||||
|
.w300 { width: 300px; }
|
||||||
|
.w350 { width: 350px; }
|
||||||
|
.w400 { width: 400px; }
|
||||||
|
.w450 { width: 450px; }
|
||||||
|
.w500 { width: 500px; }
|
||||||
|
.w600 { width: 600px; }
|
||||||
|
.w700 { width: 700px; }
|
||||||
|
.w800 { width: 800px; }
|
||||||
|
.w900 { width: 900px; }
|
||||||
|
.w1000 { width: 1000px; }
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------ */
|
/* ------------------------ */
|
||||||
/* == Scrollbar */
|
/* == Scrollbar */
|
||||||
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 113 KiB |
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -1,28 +1,28 @@
|
|||||||
@import "compass";
|
@import "compass";
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
background: map-get($classic-box, background);
|
background: $classic-box-background;
|
||||||
box-shadow: 3px 3px 0 rgba(map-get($classic-box, border-color), .6);
|
box-shadow: 3px 3px 0 rgba($classic-box-border, .6);
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
border: 1px solid map-get($classic-box, border-color);
|
border: 1px solid $classic-box-border;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
|
|
||||||
.box-header {
|
.box-header {
|
||||||
background-color: map-get($classic-box, color);
|
background-color: $classic-box-color;
|
||||||
height: map-get-deep($classic-box, header, height);
|
height: $classic-box-header-height;
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
color: map-get-deep($classic-box, header, color);
|
color: $classic-box-title-color;
|
||||||
float: left;
|
float: left;
|
||||||
font-size: map-get-deep($classic-box, header, font-size);
|
font-size: $classic-box-title-fontsize;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
line-height: map-get-deep($classic-box, header, height) - 2px;
|
line-height: $classic-box-header-height - 2px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
/*text-shadow: rgba(0, 0, 0, 1) 0 1px 0;*/
|
/*text-shadow: rgba(0, 0, 0, 1) 0 1px 0;*/
|
||||||
|
|
||||||
&:first-letter {
|
&:first-letter {
|
||||||
font-size: map-get-deep($classic-box, header, font-size) + 6px;
|
font-size: $classic-box-title-fontsize + 6px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ul {
|
ul {
|
||||||
@ -34,20 +34,20 @@
|
|||||||
margin-left: -3px;
|
margin-left: -3px;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: lighten(map-get-deep($classic-box, header, color), 10%);
|
color: lighten($classic-box-title-color, 10%);
|
||||||
font-size: map-get-deep($classic-box, header, font-size) + 6px;
|
font-size: $classic-box-title-fontsize + 6px;
|
||||||
line-height: map-get-deep($classic-box, header, height);
|
line-height: $classic-box-header-height;
|
||||||
padding: 4px 10px;
|
padding: 4px 10px;
|
||||||
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
||||||
&:hover:not(.disabled) {
|
&:hover:not(.disabled) {
|
||||||
background: lighten(map-get($classic-box, color), 20%);
|
background: lighten($classic-box-color, 20%);
|
||||||
color: map-get($classic-box, color) !important;
|
color: $classic-box-color !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.disabled {
|
&.disabled {
|
||||||
/*opacity: .4;*/
|
opacity: .4;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
@ -74,16 +74,12 @@
|
|||||||
|
|
||||||
table a {
|
table a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: map-get($classic-box, color);
|
color: $classic-box-color;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: lighten(map-get($classic-box, color), 20%);
|
color: lighten($classic-box-color, 20%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.faded {
|
|
||||||
opacity: .4;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.box-footer {
|
.box-footer {
|
||||||
@ -96,38 +92,3 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* --------------------- */
|
|
||||||
/* == THEMES */
|
|
||||||
/* --------------------- */
|
|
||||||
@each $name, $datas in $themes {
|
|
||||||
body.theme-#{""+$name+""} {
|
|
||||||
|
|
||||||
.box {
|
|
||||||
box-shadow: 3px 3px 0 rgba(lighten(map-get($datas, main-color), 16%), .6);
|
|
||||||
border-color: lighten(map-get($datas, main-color), 16%);
|
|
||||||
|
|
||||||
.box-header {
|
|
||||||
background-color: darken(map-get($datas, main-color), 7%);
|
|
||||||
|
|
||||||
ul li a {
|
|
||||||
&:hover:not(.disabled) {
|
|
||||||
background: lighten(darken(map-get($datas, main-color), 7%), 20%);
|
|
||||||
color: darken(map-get($datas, main-color), 7%) !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.box-content {
|
|
||||||
table a {
|
|
||||||
color: darken(map-get($datas, main-color), 7%);
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: lighten(darken(map-get($datas, main-color), 7%), 20%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,17 +2,24 @@
|
|||||||
|
|
||||||
span.label {
|
span.label {
|
||||||
padding: 1px 3px 2px;
|
padding: 1px 3px 2px;
|
||||||
font-size: map-get($label, font-size);
|
font-size: $label-font-size;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
background-color: map-get-deep($label, types, default);
|
background-color: $label-default;
|
||||||
@include border-radius(map-get($label, border-radius));
|
@include border-radius($label-border-radius);
|
||||||
|
|
||||||
@each $name, $color in map-get($label, types) {
|
&.success {
|
||||||
&.#{""+$name+""} {
|
background-color: $label-success;
|
||||||
background-color: $color;
|
|
||||||
}
|
}
|
||||||
|
&.warning {
|
||||||
|
background-color: $label-warning;
|
||||||
|
}
|
||||||
|
&.important, &.error {
|
||||||
|
background-color: $label-important;
|
||||||
|
}
|
||||||
|
&.notice {
|
||||||
|
background-color: $label-notice;
|
||||||
}
|
}
|
||||||
}
|
}
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user