mirror of
https://github.com/ShaYmez/ezservermonitor-web.git
synced 2024-09-27 15:36:34 -04:00
Compare commits
67 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ccc28acea7 | ||
|
a6a3107f88 | ||
|
a66bd8f49d | ||
|
4aca35d78e | ||
|
16410f396a | ||
|
4e8eb68ed7 | ||
|
050b1b615b | ||
|
1d3a790919 | ||
|
725787bcf7 | ||
|
f6dc271839 | ||
|
80b48185d3 | ||
|
4142d5f199 | ||
|
5ebb86e446 | ||
|
4ce411b34e | ||
|
52a34fd25b | ||
|
132067b7bf | ||
|
3aa15d98a9 | ||
|
980b9f75b6 | ||
|
f82dab4944 | ||
|
a879c6d95f | ||
|
fffe83f2c7 | ||
|
d5b01fd63d | ||
|
3b04b43e17 | ||
|
5390cbdfe9 | ||
|
1fc75db4b5 | ||
|
7ed8e89bfb | ||
|
999a28b9df | ||
|
859f243fa2 | ||
|
2ba594ae76 | ||
|
42ada75475 | ||
|
b6d98b7f12 | ||
|
4952f02a7a | ||
|
f50db37e12 | ||
|
3f2f0db10c | ||
|
30db221713 | ||
|
1977a21093 | ||
|
ff936fc670 | ||
|
54461c2df9 | ||
|
8e4aaf99de | ||
|
c384224e0a | ||
|
a935f5ece1 | ||
|
118bb1862c | ||
|
b330d193bb | ||
|
9970343fe5 | ||
|
dd982cee07 | ||
|
80439c0318 | ||
|
efbbfedeab | ||
|
086a1829e6 | ||
|
3ed4c1d633 | ||
|
c3ec82dd6f | ||
|
258e0edbaa | ||
|
f71fb5bfc1 | ||
|
f6a714596e | ||
|
6e4e1f3d0b | ||
|
e78dc167c2 | ||
|
7e44ecbd47 | ||
|
b28e0b0275 | ||
|
d868a423ed | ||
|
c963916274 | ||
|
8bc4826552 | ||
|
0f97e83459 | ||
|
d329cc43a9 | ||
|
2c0c68fdc3 | ||
|
58025a2451 | ||
|
ba7510e77e | ||
|
ed0bb1fea9 | ||
|
3f6a49bae3 |
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/web/css/.sass-cache
|
||||||
|
.htpasswd
|
||||||
|
.htaccess
|
674
LICENSE
Normal file
674
LICENSE
Normal file
@ -0,0 +1,674 @@
|
|||||||
|
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>.
|
32
README.md
Normal file
32
README.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
[eZ Server Monitor](http://www.ezservermonitor.com) (eSM) is a script for monitoring Linux servers. It is available in [Bash](http://www.ezservermonitor.com/esm-sh/features) version and [Web](http://www.ezservermonitor.com/esm-web/features) application.
|
||||||
|
|
||||||
|
# eZ Server Monitor `Web
|
||||||
|
|
||||||
|
In its [Web](http://www.ezservermonitor.com/esm-web/features) version eSM is a PHP script that displays on a Web page information such as:
|
||||||
|
|
||||||
|
![](http://www.ezservermonitor.com/uploads/esm_web/esm-web_dashboard-complete.png)
|
||||||
|
|
||||||
|
- **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)
|
||||||
|
- **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
|
||||||
|
- **Disk usage** : table of each mount point with the space available, used and total
|
||||||
|
- **Memory** : table containing the available used and total of RAM
|
||||||
|
- **Swap** : table containing the available used and total of Swap
|
||||||
|
- **Last login** : display last 5 user connections
|
||||||
|
- **Ping** : ping the hosts defined in the configuration file
|
||||||
|
- **Services** : displays the status (up or down) services defined in the configuration file
|
||||||
|
|
||||||
|
Several themes are available !
|
||||||
|
|
||||||
|
![](http://www.ezservermonitor.com/uploads/esm_web/esm-web_themes.png)
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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).**
|
8
autoload.php
Normal file
8
autoload.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
function eSMAutoload($class)
|
||||||
|
{
|
||||||
|
include __DIR__.'/libs/Utils/'.$class.'.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
spl_autoload_register('eSMAutoload');
|
1
conf/.htaccess
Normal file
1
conf/.htaccess
Normal file
@ -0,0 +1 @@
|
|||||||
|
deny from all
|
71
conf/esm.config.json
Normal file
71
conf/esm.config.json
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
{
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
"esm": {
|
|
||||||
"version": "2.0",
|
|
||||||
"website": "http://www.ezservermonitor.com"
|
|
||||||
},
|
|
||||||
"ping": {
|
|
||||||
"hosts": [
|
|
||||||
"free.fr",
|
|
||||||
"orange.fr",
|
|
||||||
"google.com"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"last_login": {
|
|
||||||
"max": 5
|
|
||||||
},
|
|
||||||
"services": [
|
|
||||||
{
|
|
||||||
"name": "Web Server (Apache)",
|
|
||||||
"port": 80
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "FTP Server (ProFTPd)",
|
|
||||||
"port": 21
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Databases (MySQL)",
|
|
||||||
"port": 3306
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SSH",
|
|
||||||
"port": 22
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
BIN
favicon.ico
Normal file
BIN
favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
77
index.php
77
index.php
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
require 'libs/Utils/Misc.class.php';
|
require 'autoload.php';
|
||||||
require 'libs/Utils/Config.class.php';
|
|
||||||
$Config = new Config();
|
$Config = new Config();
|
||||||
$update = $Config->checkUpdate();
|
$update = $Config->checkUpdate();
|
||||||
?>
|
?>
|
||||||
@ -8,9 +7,11 @@ $update = $Config->checkUpdate();
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>eZ Server Monitor - <?= Misc::getHostname(); ?></title>
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
|
<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">
|
||||||
<link rel="stylesheet" href="web/css/frontend.css" type="text/css">
|
<link rel="stylesheet" href="web/css/frontend.css" type="text/css">
|
||||||
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
<!--[if IE]>
|
<!--[if IE]>
|
||||||
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
@ -31,25 +32,34 @@ $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">
|
||||||
<a href="index.php"><span class="icon-gauge"></span>eSM</a>
|
<a href="index.php"><span class="icon-gauge"></span>eSM</a>
|
||||||
<a href="<?= $Config->get('esm:website'); ?>"><span class="subtitle">eZ Server Monitor - v<?= $Config->get('esm:version'); ?></span></a>
|
<a href="<?php echo $Config->get('esm:website'); ?>"><span class="subtitle">eZ Server Monitor - v<?php echo $Config->get('esm:version'); ?></span></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="hostname">
|
<div id="hostname">
|
||||||
<?= Misc::getHostname(); ?> - <?= Misc::getLanIP(); ?>
|
<?php
|
||||||
|
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)): ?>
|
||||||
<div id="update">
|
<div id="update">
|
||||||
<a href="<?= $update['fullpath']; ?>">New version available (<?= $update['availableVersion']; ?>) ! Click here to download</a>
|
<a href="<?php echo $update['fullpath']; ?>">New version available (<?php echo $update['availableVersion']; ?>) ! Click here to download</a>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
@ -97,7 +107,7 @@ $update = $Config->checkUpdate();
|
|||||||
<td id="system-current_users"></td>
|
<td id="system-current_users"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Server datetime</td>
|
<td>Server date & time</td>
|
||||||
<td id="system-server_date"></td>
|
<td id="system-server_date"></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -114,20 +124,22 @@ $update = $Config->checkUpdate();
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="box-content t-center">
|
<div class="box-content t-center">
|
||||||
<div class="f-left w180">
|
<div class="f-left w33p">
|
||||||
<h3>1 min</h3>
|
<h3>1 min</h3>
|
||||||
<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-right w180">
|
<div class="f-left 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="t-center" style="margin: 0 180px;">
|
<div class="cls"></div>
|
||||||
<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>
|
||||||
|
|
||||||
@ -149,21 +161,27 @@ $update = $Config->checkUpdate();
|
|||||||
<td id="cpu-model"></td>
|
<td id="cpu-model"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Cores #</td>
|
<td>Cores</td>
|
||||||
<td id="cpu-num_cores"></td>
|
<td id="cpu-num_cores"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>CPU Speed</td>
|
<td>Speed</td>
|
||||||
<td id="cpu-frequency"></td>
|
<td id="cpu-frequency"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Cache L2</td>
|
<td>Cache</td>
|
||||||
<td id="cpu-cache"></td>
|
<td id="cpu-cache"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<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>
|
||||||
@ -211,8 +229,11 @@ $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 class="w35p">Use</th>
|
<th>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>
|
||||||
@ -240,19 +261,19 @@ $update = $Config->checkUpdate();
|
|||||||
<table class="firstBold">
|
<table class="firstBold">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="w20p">Used RAM</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>
|
||||||
<td class="w20p">Used RAM</td>
|
<td class="w20p">Used</td>
|
||||||
<td id="memory-used"></td>
|
<td id="memory-used"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="w20p">Free RAM</td>
|
<td class="w20p">Free</td>
|
||||||
<td id="memory-free"></td>
|
<td id="memory-free"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="w20p">Total RAM</td>
|
<td class="w20p">Total</td>
|
||||||
<td id="memory-total"></td>
|
<td id="memory-total"></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -272,19 +293,19 @@ $update = $Config->checkUpdate();
|
|||||||
<table class="firstBold">
|
<table class="firstBold">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="w20p">Used Swap</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>
|
||||||
<td class="w20p">Used Swap</td>
|
<td class="w20p">Used</td>
|
||||||
<td id="swap-used"></td>
|
<td id="swap-used"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="w20p">Free Swap</td>
|
<td class="w20p">Free</td>
|
||||||
<td id="swap-free"></td>
|
<td id="swap-free"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="w20p">Total Swap</td>
|
<td class="w20p">Total</td>
|
||||||
<td id="swap-total"></td>
|
<td id="swap-total"></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -306,9 +327,13 @@ $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,11 +3,17 @@ var esm = {};
|
|||||||
|
|
||||||
esm.getSystem = function() {
|
esm.getSystem = function() {
|
||||||
|
|
||||||
$.get('libs/system.php', function(data) {
|
var module = 'system';
|
||||||
|
|
||||||
var $box = $('.box#esm-system .box-content tbody');
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
esm.insertDatas($box, 'system', data);
|
$.get('libs/'+module+'.php', function(data) {
|
||||||
|
|
||||||
|
var $box = $('.box#esm-'+module+' .box-content tbody');
|
||||||
|
|
||||||
|
esm.insertDatas($box, module, data);
|
||||||
|
|
||||||
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
@ -16,14 +22,20 @@ esm.getSystem = function() {
|
|||||||
|
|
||||||
esm.getLoad_average = function() {
|
esm.getLoad_average = function() {
|
||||||
|
|
||||||
$.get('libs/load_average.php', function(data) {
|
var module = 'load_average';
|
||||||
|
|
||||||
var $box = $('.box#esm-load_average .box-content');
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
|
$.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');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -31,11 +43,17 @@ esm.getLoad_average = function() {
|
|||||||
|
|
||||||
esm.getCpu = function() {
|
esm.getCpu = function() {
|
||||||
|
|
||||||
$.get('libs/cpu.php', function(data) {
|
var module = 'cpu';
|
||||||
|
|
||||||
var $box = $('.box#esm-cpu .box-content tbody');
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
esm.insertDatas($box, 'cpu', data);
|
$.get('libs/'+module+'.php', function(data) {
|
||||||
|
|
||||||
|
var $box = $('.box#esm-'+module+' .box-content tbody');
|
||||||
|
|
||||||
|
esm.insertDatas($box, module, data);
|
||||||
|
|
||||||
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
@ -44,11 +62,17 @@ esm.getCpu = function() {
|
|||||||
|
|
||||||
esm.getMemory = function() {
|
esm.getMemory = function() {
|
||||||
|
|
||||||
$.get('libs/memory.php', function(data) {
|
var module = 'memory';
|
||||||
|
|
||||||
var $box = $('.box#esm-memory .box-content tbody');
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
esm.insertDatas($box, 'memory', data);
|
$.get('libs/'+module+'.php', function(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);
|
||||||
@ -72,11 +96,15 @@ esm.getMemory = function() {
|
|||||||
|
|
||||||
esm.getSwap = function() {
|
esm.getSwap = function() {
|
||||||
|
|
||||||
$.get('libs/swap.php', function(data) {
|
var module = 'swap';
|
||||||
|
|
||||||
var $box = $('.box#esm-swap .box-content tbody');
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
esm.insertDatas($box, 'swap', data);
|
$.get('libs/'+module+'.php', function(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);
|
||||||
@ -93,6 +121,8 @@ esm.getSwap = function() {
|
|||||||
else
|
else
|
||||||
$progress.addClass('red');
|
$progress.addClass('red');
|
||||||
|
|
||||||
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -100,9 +130,13 @@ esm.getSwap = function() {
|
|||||||
|
|
||||||
esm.getDisk = function() {
|
esm.getDisk = function() {
|
||||||
|
|
||||||
$.get('libs/disk.php', function(data) {
|
var module = 'disk';
|
||||||
|
|
||||||
var $box = $('.box#esm-disk .box-content tbody');
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
|
$.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)
|
||||||
@ -118,16 +152,22 @@ 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-right">'+data[line].free+'</td>';
|
html += '<td class="t-center">'+data[line].free+'</td>';
|
||||||
html += '<td class="t-right">'+data[line].used+'</td>';
|
html += '<td class="t-center">'+data[line].used+'</td>';
|
||||||
html += '<td class="t-right">'+data[line].total+'</td>';
|
html += '<td class="t-center">'+data[line].total+'</td>';
|
||||||
html += '</tr>';
|
html += '</tr>';
|
||||||
|
|
||||||
$box.append(html);
|
$box.append(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -135,9 +175,13 @@ esm.getDisk = function() {
|
|||||||
|
|
||||||
esm.getLast_login = function() {
|
esm.getLast_login = function() {
|
||||||
|
|
||||||
$.get('libs/last_login.php', function(data) {
|
var module = 'last_login';
|
||||||
|
|
||||||
var $box = $('.box#esm-last_login .box-content tbody');
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
|
$.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)
|
||||||
@ -145,13 +189,14 @@ 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');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -159,9 +204,13 @@ esm.getLast_login = function() {
|
|||||||
|
|
||||||
esm.getNetwork = function() {
|
esm.getNetwork = function() {
|
||||||
|
|
||||||
$.get('libs/network.php', function(data) {
|
var module = 'network';
|
||||||
|
|
||||||
var $box = $('.box#esm-network .box-content tbody');
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
|
$.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)
|
||||||
@ -170,13 +219,15 @@ 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-right">'+data[line].receive+'</td>';
|
html += '<td class="t-center">'+data[line].receive+'</td>';
|
||||||
html += '<td class="t-right">'+data[line].transmit+'</td>';
|
html += '<td class="t-center">'+data[line].transmit+'</td>';
|
||||||
html += '</tr>';
|
html += '</tr>';
|
||||||
|
|
||||||
$box.append(html);
|
$box.append(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -184,9 +235,13 @@ esm.getNetwork = function() {
|
|||||||
|
|
||||||
esm.getPing = function() {
|
esm.getPing = function() {
|
||||||
|
|
||||||
$.get('libs/ping.php', function(data) {
|
var module = 'ping';
|
||||||
|
|
||||||
var $box = $('.box#esm-ping .box-content tbody');
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
|
$.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)
|
||||||
@ -200,6 +255,8 @@ esm.getPing = function() {
|
|||||||
$box.append(html);
|
$box.append(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -207,9 +264,13 @@ esm.getPing = function() {
|
|||||||
|
|
||||||
esm.getServices = function() {
|
esm.getServices = function() {
|
||||||
|
|
||||||
$.get('libs/services.php', function(data) {
|
var module = 'services';
|
||||||
|
|
||||||
var $box = $('.box#esm-services .box-content tbody');
|
esm.reloadBlock_spin(module);
|
||||||
|
|
||||||
|
$.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)
|
||||||
@ -227,13 +288,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();
|
||||||
@ -248,7 +309,18 @@ 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.8
|
* Version: 1.2.11
|
||||||
* Requires: jQuery v1.7+
|
* Requires: jQuery v1.7+
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012 Anthony Terrien
|
* Copyright (c) 2012 Anthony Terrien
|
||||||
@ -10,7 +10,15 @@
|
|||||||
*
|
*
|
||||||
* Thanks to vor, eskimoblood, spiffistan, FabrizioC
|
* Thanks to vor, eskimoblood, spiffistan, FabrizioC
|
||||||
*/
|
*/
|
||||||
(function($) {
|
(function (factory) {
|
||||||
|
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
|
||||||
@ -84,8 +92,7 @@
|
|||||||
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,
|
||||||
@ -93,12 +100,11 @@
|
|||||||
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 : (
|
thickness: this.$.data('thickness')
|
||||||
this.$.data('thickness') &&
|
&& Math.max(Math.min(this.$.data('thickness'), 1), 0.01)
|
||||||
Math.max(Math.min(this.$.data('thickness'), 1), 0.01)
|
|| 0.35,
|
||||||
) || 0.35,
|
|
||||||
lineCap: this.$.data('linecap') || 'butt',
|
lineCap: this.$.data('linecap') || 'butt',
|
||||||
width: this.$.data('width') || 200,
|
width: this.$.data('width') || 200,
|
||||||
height: this.$.data('height') || 200,
|
height: this.$.data('height') || 200,
|
||||||
@ -146,33 +152,31 @@
|
|||||||
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(val);
|
s.val(s._validate(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({
|
||||||
@ -205,8 +209,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 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 ||
|
||||||
@ -215,11 +218,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,12 +259,12 @@
|
|||||||
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);
|
||||||
@ -302,17 +305,13 @@
|
|||||||
|
|
||||||
s.clear();
|
s.clear();
|
||||||
|
|
||||||
s.dH
|
s.dH && (d = 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
|
||||||
@ -320,7 +319,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();
|
||||||
@ -336,8 +335,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);
|
||||||
}
|
}
|
||||||
@ -347,7 +346,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
@ -367,23 +365,21 @@
|
|||||||
.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 (
|
if (s.eH && s.eH() === false)
|
||||||
s.eH
|
return;
|
||||||
&& (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);
|
||||||
}
|
}
|
||||||
@ -396,23 +392,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);
|
||||||
}
|
}
|
||||||
@ -425,8 +421,7 @@
|
|||||||
|
|
||||||
if (this.relative) {
|
if (this.relative) {
|
||||||
$(window).resize(function() {
|
$(window).resize(function() {
|
||||||
s._carve()
|
s._carve().init();
|
||||||
.init();
|
|
||||||
s._draw();
|
s._draw();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -457,7 +452,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
this._validate = function (v) {
|
this._validate = function (v) {
|
||||||
return (~~ (((v < 0) ? -0.5 : 0.5) + (v/this.o.step))) * this.o.step;
|
var val = (~~ (((v < 0) ? -0.5 : 0.5) + (v/this.o.step))) * this.o.step;
|
||||||
|
return Math.round(val * 100) / 100;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Abstract methods
|
// Abstract methods
|
||||||
@ -474,14 +470,19 @@
|
|||||||
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 = [parseInt(h.substring(0,2),16)
|
rgb = [
|
||||||
,parseInt(h.substring(2,4),16)
|
parseInt(h.substring(0,2), 16),
|
||||||
,parseInt(h.substring(4,6),16)];
|
parseInt(h.substring(2,4), 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) { t[i] = f[i]; }
|
for (var i in f) {
|
||||||
|
t[i] = f[i];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -501,14 +502,12 @@
|
|||||||
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',
|
bgColor: this.$.data('bgcolor') || '#EEEEEE',
|
||||||
angleOffset: this.$.data('angleoffset') || 0,
|
angleOffset: this.$.data('angleoffset') || 0,
|
||||||
angleArc: this.$.data('anglearc') || 360,
|
angleArc: this.$.data('anglearc') || 360,
|
||||||
inline: true
|
inline: true
|
||||||
}, this.o
|
}, this.o);
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.val = function (v, triggerRelease) {
|
this.val = function (v, triggerRelease) {
|
||||||
@ -517,10 +516,10 @@
|
|||||||
// reverse format
|
// reverse format
|
||||||
v = this.o.parse(v);
|
v = this.o.parse(v);
|
||||||
|
|
||||||
if (
|
if (triggerRelease !== false
|
||||||
triggerRelease !== false && (v != this.v) && this.rH &&
|
&& v != this.v
|
||||||
(this.rH(v) === false)
|
&& this.rH
|
||||||
) return;
|
&& this.rH(v) === false) { 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;
|
||||||
@ -535,8 +534,8 @@
|
|||||||
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) {
|
||||||
@ -544,14 +543,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 = ~~ (0.5 + (a * (this.o.max - this.o.min) / this.angleArc))
|
ret = (a * (this.o.max - this.o.min) / this.angleArc) + this.o.min;
|
||||||
+ 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));
|
||||||
|
|
||||||
@ -559,16 +558,22 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.listen = function () {
|
this.listen = function () {
|
||||||
|
|
||||||
// bind MouseWheel
|
// bind MouseWheel
|
||||||
var s = this, mwTimerStop, mwTimerRelease,
|
var s = this, mwTimerStop,
|
||||||
|
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);
|
||||||
|
|
||||||
@ -585,18 +590,27 @@
|
|||||||
// Handle mousewheel releases
|
// Handle mousewheel releases
|
||||||
if (!mwTimerRelease) {
|
if (!mwTimerRelease) {
|
||||||
mwTimerRelease = setTimeout(function () {
|
mwTimerRelease = setTimeout(function () {
|
||||||
if(mwTimerStop) s.rH(v);
|
if (mwTimerStop)
|
||||||
|
s.rH(v);
|
||||||
mwTimerRelease = null;
|
mwTimerRelease = null;
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
, kval, to, m = 1, kv = {37:-s.o.step, 38:s.o.step, 39:s.o.step, 40:-s.o.step};
|
kval,
|
||||||
|
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
|
||||||
@ -607,12 +621,12 @@
|
|||||||
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 || s.$.val().match(/\./)) // . only allowed once
|
&& (kc !== 190
|
||||||
|
|| s.$.val().match(/\./)) // . allowed once
|
||||||
&& e.preventDefault();
|
&& e.preventDefault();
|
||||||
|
|
||||||
// arrows
|
// arrows
|
||||||
@ -622,20 +636,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(v);
|
s.change(s._validate(v));
|
||||||
s._draw();
|
s._draw();
|
||||||
|
|
||||||
// long time keydown speed-up
|
// long time keydown speed-up
|
||||||
to = window.setTimeout(
|
to = window.setTimeout(function () {
|
||||||
function () { m *= 2; }, 30
|
m *= 2;
|
||||||
);
|
}, 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);
|
||||||
@ -648,7 +662,6 @@
|
|||||||
(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));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -657,11 +670,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.init = function () {
|
this.init = function () {
|
||||||
|
if (this.v < this.o.min
|
||||||
if (
|
|| this.v > this.o.max) { this.v = this.o.min; }
|
||||||
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;
|
||||||
@ -686,30 +696,29 @@
|
|||||||
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({
|
||||||
|| this.i.css({
|
'width': '0px',
|
||||||
'width' : '0px'
|
'visibility': 'hidden'
|
||||||
,'visibility' : 'hidden'
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -735,6 +744,7 @@
|
|||||||
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,
|
||||||
@ -743,17 +753,20 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
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);
|
||||||
@ -761,7 +774,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();
|
||||||
@ -786,4 +799,4 @@
|
|||||||
).parent();
|
).parent();
|
||||||
};
|
};
|
||||||
|
|
||||||
})(jQuery);
|
}));
|
||||||
|
@ -7,16 +7,25 @@ class Config
|
|||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->file = $_SERVER['DOCUMENT_ROOT'].'/esm.config.json';
|
$this->_checkPHPVersion(5.3);
|
||||||
|
|
||||||
|
$this->file = __DIR__.'/../../conf/esm.config.json';
|
||||||
|
|
||||||
|
if (!file_exists($this->file))
|
||||||
|
throw new \Exception('Config file '.basename($this->file).' not found');
|
||||||
|
|
||||||
if (file_exists($this->file))
|
|
||||||
$this->_readFile();
|
$this->_readFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function _readFile()
|
private function _readFile()
|
||||||
{
|
{
|
||||||
$content = file_get_contents($this->file);
|
$content = file_get_contents($this->file);
|
||||||
$this->config = json_decode($content, true);
|
$this->config = json_decode(utf8_encode($content), true);
|
||||||
|
|
||||||
|
if ($this->config == null && json_last_error() != JSON_ERROR_NONE)
|
||||||
|
{
|
||||||
|
throw new \LogicException(sprintf("Failed to parse config file '%s'. Error: '%s'", basename($this->file) , json_last_error_msg()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -38,7 +47,8 @@ class Config
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $tab == $this->config ? null : $tab;
|
// return $tab == $this->config ? null : $tab;
|
||||||
|
return $tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -51,11 +61,26 @@ class Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks the PHP version compared to the required version
|
||||||
|
*/
|
||||||
|
private function _checkPHPVersion($min)
|
||||||
|
{
|
||||||
|
if (!version_compare(phpversion(), $min, '>='))
|
||||||
|
throw new \Exception('Your PHP version is too old ! PHP '.$min.' is required.');
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if there is an eSM`Web update available
|
* Checks if there is an eSM`Web update available
|
||||||
*/
|
*/
|
||||||
public function checkUpdate()
|
public function checkUpdate()
|
||||||
{
|
{
|
||||||
|
if ($this->get('esm:check_updates') === false)
|
||||||
|
return null;
|
||||||
|
|
||||||
$response = null;
|
$response = null;
|
||||||
$this_version = $this->get('esm:version');
|
$this_version = $this->get('esm:version');
|
||||||
$update_url = $this->get('esm:website').'/esm-web/update/'.$this_version;
|
$update_url = $this->get('esm:website').'/esm-web/update/'.$this_version;
|
||||||
@ -92,3 +117,22 @@ class Config
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// PHP 5.5.0
|
||||||
|
if (!function_exists('json_last_error_msg'))
|
||||||
|
{
|
||||||
|
function json_last_error_msg()
|
||||||
|
{
|
||||||
|
static $errors = array(
|
||||||
|
JSON_ERROR_NONE => null,
|
||||||
|
JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
|
||||||
|
JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch',
|
||||||
|
JSON_ERROR_CTRL_CHAR => 'Unexpected control character found',
|
||||||
|
JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON',
|
||||||
|
JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded'
|
||||||
|
);
|
||||||
|
$error = json_last_error();
|
||||||
|
return array_key_exists($error, $errors) ? $errors[$error] : "Unknown error ({$error})";
|
||||||
|
}
|
||||||
|
}
|
@ -1,57 +0,0 @@
|
|||||||
<?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].'o';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
}
|
|
217
libs/Utils/Misc.php
Normal file
217
libs/Utils/Misc.php
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
<?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;
|
||||||
|
}
|
||||||
|
}
|
46
libs/cpu.php
46
libs/cpu.php
@ -1,21 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
|
require '../autoload.php';
|
||||||
|
$Config = new Config();
|
||||||
|
|
||||||
// Number of cores
|
// Number of cores
|
||||||
if (!($num_cores = shell_exec('/bin/grep -c ^processor /proc/cpuinfo')))
|
$num_cores = Misc::getCpuCoresNumber();
|
||||||
{
|
|
||||||
$num_cores = 'N.A';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// CPU info
|
// CPU info
|
||||||
if (!($cpuinfo = shell_exec('cat /proc/cpuinfo')))
|
|
||||||
{
|
|
||||||
$model = 'N.A';
|
$model = 'N.A';
|
||||||
$frequency = 'N.A';
|
$frequency = 'N.A';
|
||||||
$cache = 'N.A';
|
$cache = 'N.A';
|
||||||
$bogomips = 'N.A';
|
$bogomips = 'N.A';
|
||||||
}
|
$temp = 'N.A';
|
||||||
else
|
|
||||||
|
if ($cpuinfo = shell_exec('cat /proc/cpuinfo'))
|
||||||
{
|
{
|
||||||
$processors = preg_split('/\s?\n\s?\n/', trim($cpuinfo));
|
$processors = preg_split('/\s?\n\s?\n/', trim($cpuinfo));
|
||||||
|
|
||||||
@ -27,15 +25,16 @@ else
|
|||||||
{
|
{
|
||||||
list($key, $value) = preg_split('/\s*:\s*/', trim($detail));
|
list($key, $value) = preg_split('/\s*:\s*/', trim($detail));
|
||||||
|
|
||||||
switch ($key)
|
switch (strtolower($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;
|
||||||
@ -53,6 +52,32 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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,
|
||||||
@ -60,6 +85,7 @@ $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,9 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
require 'Utils/Misc.class.php';
|
require '../autoload.php';
|
||||||
|
$Config = new Config();
|
||||||
|
|
||||||
$datas = array();
|
$datas = array();
|
||||||
|
|
||||||
if (!(exec('/bin/df | awk \'{print $2","$3","$4","$5","$6}\'', $df)))
|
# if there are more than 7 awk's colums it means the mount point name contains spaces
|
||||||
|
# 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',
|
||||||
@ -11,36 +14,50 @@ if (!(exec('/bin/df | awk \'{print $2","$3","$4","$5","$6}\'', $df)))
|
|||||||
'free' => 'N.A',
|
'free' => 'N.A',
|
||||||
'percent_used' => 0,
|
'percent_used' => 0,
|
||||||
'mount' => 'N.A',
|
'mount' => 'N.A',
|
||||||
|
'filesystem' => 'N.A',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$first_line = false;
|
|
||||||
|
|
||||||
$mounted_points = array();
|
$mounted_points = array();
|
||||||
|
$key = 0;
|
||||||
|
|
||||||
foreach ($df as $mounted)
|
foreach ($df as $mounted)
|
||||||
{
|
{
|
||||||
if ($first_line === false)
|
list($filesystem, $type, $total, $used, $free, $percent, $mount) = explode(',', $mounted);
|
||||||
{
|
|
||||||
$first_line = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
list($total, $used, $free, $percent, $mount) = explode(',', $mounted);
|
if ($percent > 100)
|
||||||
|
$percent = 100;
|
||||||
|
|
||||||
|
if (strpos($type, 'tmpfs') !== false && $Config->get('disk:show_tmpfs') === false)
|
||||||
|
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[] = array(
|
$datas[$key] = 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,15 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
require 'Utils/Config.class.php';
|
require '../autoload.php';
|
||||||
$Config = new Config();
|
$Config = new Config();
|
||||||
|
|
||||||
|
|
||||||
$datas = array();
|
$datas = array();
|
||||||
|
|
||||||
if (!(exec('/usr/bin/lastlog --time 365 | /usr/bin/awk \'{print $1","$3","$4" "$5" "$6" "$7" "$8}\'', $users)))
|
if ($Config->get('last_login:enable'))
|
||||||
|
{
|
||||||
|
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',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -19,14 +20,14 @@ else
|
|||||||
|
|
||||||
for ($i = 1; $i < count($users) && $i <= $max; $i++)
|
for ($i = 1; $i < count($users) && $i <= $max; $i++)
|
||||||
{
|
{
|
||||||
list($user, $host, $date) = explode(',', $users[$i]);
|
list($user, $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,21 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
|
require '../autoload.php';
|
||||||
|
|
||||||
if (!($load_tmp = shell_exec('/bin/cat /proc/loadavg | /usr/bin/awk \'{print $1","$2","$3}\'')))
|
if (!($load_tmp = shell_exec('cat /proc/loadavg | awk \'{print $1","$2","$3}\'')))
|
||||||
{
|
{
|
||||||
$load = array(0, 0, 0);
|
$load = array(0, 0, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Number of cores
|
||||||
|
$cores = Misc::getCpuCoresNumber();
|
||||||
|
|
||||||
$load_exp = explode(',', $load_tmp);
|
$load_exp = explode(',', $load_tmp);
|
||||||
|
|
||||||
$load = array_map(
|
$load = array_map(
|
||||||
function ($value) {
|
function ($value, $cores) {
|
||||||
$v = (int)($value * 100);
|
$v = (int)((float)$value * 100 / $cores);
|
||||||
if ($v > 100)
|
if ($v > 100)
|
||||||
$v = 100;
|
$v = 100;
|
||||||
return $v;
|
return $v;
|
||||||
},
|
},
|
||||||
$load_exp
|
$load_exp,
|
||||||
|
array_fill(0, 3, $cores)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
require 'Utils/Misc.class.php';
|
require '../autoload.php';
|
||||||
|
|
||||||
// Free
|
|
||||||
if (!($free = shell_exec('grep MemFree /proc/meminfo | awk \'{print $2}\'')))
|
|
||||||
{
|
|
||||||
$free = 0;
|
$free = 0;
|
||||||
|
|
||||||
|
if (shell_exec('cat /proc/meminfo'))
|
||||||
|
{
|
||||||
|
$free = shell_exec('grep MemFree /proc/meminfo | awk \'{print $2}\'');
|
||||||
|
$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
|
||||||
@ -12,11 +17,14 @@ if (!($total = shell_exec('grep MemTotal /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;
|
||||||
|
if ($total > 0)
|
||||||
$percent_used = 100 - (round($free / $total * 100));
|
$percent_used = 100 - (round($free / $total * 100));
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,25 +1,108 @@
|
|||||||
<?php
|
<?php
|
||||||
require 'Utils/Misc.class.php';
|
require '../autoload.php';
|
||||||
|
|
||||||
$datas = array();
|
$datas = array();
|
||||||
|
$network = array();
|
||||||
|
|
||||||
if (!(exec('/sbin/ifconfig | awk -F " " \'{print $1}\' | sed -e \'/^$/d\'', $getInterfaces)))
|
// Possible commands for ifconfig and ip
|
||||||
|
$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
|
||||||
|
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');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
exec('/sbin/ifconfig | awk \'/inet / {print $2}\' | cut -d \':\' -f2', $getIps);
|
foreach ($getInterfaces as $name)
|
||||||
|
{
|
||||||
|
$ip = null;
|
||||||
|
|
||||||
foreach ($getInterfaces as $key => $interface)
|
$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]))
|
||||||
|
$ip[0] = '';
|
||||||
|
|
||||||
|
$network[] = array(
|
||||||
|
'name' => $name,
|
||||||
|
'ip' => $ip[0],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($network as $interface)
|
||||||
{
|
{
|
||||||
// Get transmit and receive datas by interface
|
// Get transmit and receive datas by interface
|
||||||
exec('cat /sys/class/net/'.$interface.'/statistics/tx_bytes', $getBandwidth_tx);
|
exec('cat /sys/class/net/'.$interface['name'].'/statistics/tx_bytes', $getBandwidth_tx);
|
||||||
exec('cat /sys/class/net/'.$interface.'/statistics/rx_bytes', $getBandwidth_rx);
|
exec('cat /sys/class/net/'.$interface['name'].'/statistics/rx_bytes', $getBandwidth_rx);
|
||||||
|
|
||||||
$datas[] = array(
|
$datas[] = array(
|
||||||
'interface' => $interface,
|
'interface' => $interface['name'],
|
||||||
'ip' => $getIps[$key],
|
'ip' => $interface['ip'],
|
||||||
'transmit' => Misc::getSize($getBandwidth_tx[0]),
|
'transmit' => Misc::getSize($getBandwidth_tx[0]),
|
||||||
'receive' => Misc::getSize($getBandwidth_rx[0]),
|
'receive' => Misc::getSize($getBandwidth_rx[0]),
|
||||||
);
|
);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
require 'Utils/Config.class.php';
|
require '../autoload.php';
|
||||||
$Config = new Config();
|
$Config = new Config();
|
||||||
|
|
||||||
|
|
||||||
@ -12,7 +12,12 @@ else
|
|||||||
|
|
||||||
foreach ($hosts as $host)
|
foreach ($hosts as $host)
|
||||||
{
|
{
|
||||||
exec('/bin/ping -qc 1 '.$host.' | awk -F/ \'/^rtt/ { print $5 }\'', $result);
|
exec('/bin/ping -qc 1 '.$host.' | awk -F/ \'/^(rtt|round-trip)/ { print $5 }\'', $result);
|
||||||
|
|
||||||
|
if (!isset($result[0]))
|
||||||
|
{
|
||||||
|
$result[0] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$datas[] = array(
|
$datas[] = array(
|
||||||
'host' => $host,
|
'host' => $host,
|
||||||
|
@ -1,37 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
require 'Utils/Config.class.php';
|
require '../autoload.php';
|
||||||
$Config = new Config();
|
$Config = new Config();
|
||||||
|
|
||||||
|
|
||||||
$datas = array();
|
$datas = array();
|
||||||
|
|
||||||
if (count($Config->get('services')) > 0)
|
$available_protocols = array('tcp', 'udp');
|
||||||
{
|
|
||||||
foreach ($Config->get('services') as $service)
|
|
||||||
{
|
|
||||||
$ip = 'localhost';
|
|
||||||
$sock = @fsockopen($ip, $service['port'], $num, $error, 5);
|
|
||||||
|
|
||||||
if ($sock)
|
$show_port = $Config->get('services:show_port');
|
||||||
{
|
|
||||||
$datas[] = array(
|
|
||||||
'port' => $service['port'],
|
|
||||||
'name' => $service['name'],
|
|
||||||
'status' => 1,
|
|
||||||
);
|
|
||||||
|
|
||||||
fclose($sock);
|
if (count($Config->get('services:list')) > 0)
|
||||||
}
|
{
|
||||||
|
foreach ($Config->get('services:list') as $service)
|
||||||
|
{
|
||||||
|
$host = $service['host'];
|
||||||
|
$port = $service['port'];
|
||||||
|
$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
|
else
|
||||||
{
|
$status = 0;
|
||||||
|
|
||||||
$datas[] = array(
|
$datas[] = array(
|
||||||
'port' => $service['port'],
|
'port' => $show_port === true ? $port : '',
|
||||||
'name' => $service['name'],
|
'name' => $name,
|
||||||
'status' => 0,
|
'status' => $status,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
echo json_encode($datas);
|
echo json_encode($datas);
|
@ -1,23 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
require 'Utils/Misc.class.php';
|
require '../autoload.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;
|
||||||
|
if ($total > 0)
|
||||||
$percent_used = 100 - (round($free / $total * 100));
|
$percent_used = 100 - (round($free / $total * 100));
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,14 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
require 'Utils/Misc.class.php';
|
require '../autoload.php';
|
||||||
|
date_default_timezone_set(@date_default_timezone_get());
|
||||||
|
|
||||||
// Hostname
|
// Hostname
|
||||||
$hostname = php_uname('n');
|
$hostname = php_uname('n');
|
||||||
|
|
||||||
// OS
|
// OS
|
||||||
if (!($os = shell_exec('/usr/bin/lsb_release -ds')))
|
if (!file_exists('/usr/bin/lsb_release') || !($os = shell_exec('/usr/bin/lsb_release -ds | cut -d= -f2 | tr -d \'"\'')))
|
||||||
|
{
|
||||||
|
if (!file_exists('/etc/system-release') || !($os = shell_exec('cat /etc/system-release | cut -d= -f2 | tr -d \'"\'')))
|
||||||
|
{
|
||||||
|
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 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')))
|
||||||
@ -23,22 +35,7 @@ if (!($totalSeconds = shell_exec('/usr/bin/cut -d. -f1 /proc/uptime')))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$totalMin = $totalSeconds / 60;
|
$uptime = Misc::getHumanTime((int)$totalSeconds);
|
||||||
$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
|
||||||
@ -53,15 +50,10 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Current users
|
// Current users
|
||||||
if (!($current_users_cmd = shell_exec('who -q')))
|
if (!($current_users = shell_exec('who -u | awk \'{ print $1 }\' | wc -l')))
|
||||||
{
|
{
|
||||||
$current_users = 'N.A';
|
$current_users = 'N.A';
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$arr_user = explode('=', $current_users_cmd);
|
|
||||||
$current_users = $arr_user[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Server datetime
|
// Server datetime
|
||||||
if (!($server_date = shell_exec('/bin/date')))
|
if (!($server_date = shell_exec('/bin/date')))
|
||||||
|
@ -6,6 +6,43 @@ $navbar-height: 60px;
|
|||||||
/* Layout */
|
/* Layout */
|
||||||
$layout-bg-color: #fff;
|
$layout-bg-color: #fff;
|
||||||
|
|
||||||
/* Basic colors */
|
/* Default 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,26 +1,27 @@
|
|||||||
/* Buttons */
|
@import "_config.frontend";
|
||||||
$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-default: #bfbfbf;
|
$label: (
|
||||||
$label-success: #46a546;
|
types: (
|
||||||
$label-warning: #f89406;
|
default: #bfbfbf,
|
||||||
$label-important: #c43c35;
|
success: #46a546,
|
||||||
$label-notice: #62cffc;
|
warning: #f89406,
|
||||||
$label-border-radius: 3px;
|
important: #c43c35,
|
||||||
$label-font-size: 10px;
|
error: #c43c35,
|
||||||
|
notice: #62cffc
|
||||||
|
),
|
||||||
|
border-radius: 3px,
|
||||||
|
font-size: 10px
|
||||||
|
);
|
||||||
|
|
||||||
/* Classic box */
|
/* Classic box */
|
||||||
$classic-box-color: darken(#99AEC4, 7%);
|
$classic-box: (
|
||||||
$classic-box-background: #fff;
|
color: darken($main-color, 7%),
|
||||||
$classic-box-border: lighten(#99AEC4, 16%);
|
background: #fff,
|
||||||
$classic-box-header-height: 35px;
|
border-color: lighten($main-color, 16%),
|
||||||
$classic-box-title-color: #fff;
|
header: (
|
||||||
$classic-box-title-fontsize: 14px;
|
height: 35px,
|
||||||
|
color: #fff,
|
||||||
|
font-size: 14px
|
||||||
|
)
|
||||||
|
);
|
@ -15,22 +15,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin letterpress($opacity) {
|
@function map-get-deep($map, $keys...) {
|
||||||
text-shadow: rgba(255, 255, 255, $opacity) 0 1px 0;
|
@if length($keys) == 1 {
|
||||||
|
$keys: nth($keys, 1);
|
||||||
|
}
|
||||||
|
$warn: "#{nth($keys, 1)}";
|
||||||
|
$length: length($keys);
|
||||||
|
$get: map-get($map, nth($keys, 1));
|
||||||
|
|
||||||
|
@if $length > 1 {
|
||||||
|
@for $i from 2 through $length {
|
||||||
|
@if $get != null and type-of($get) == 'map' {
|
||||||
|
$warn: $warn + "->#{nth($keys, $i)}";
|
||||||
|
$get: map-get($get, nth($keys, $i));
|
||||||
|
|
||||||
|
@if $get == null {
|
||||||
|
@return map-get-deep-warning($warn, $get);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@else {
|
||||||
|
@return map-get-deep-warning($warn, $get);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin hide-text {
|
@return $get;
|
||||||
font: 0/0 a;
|
|
||||||
text-shadow: none;
|
|
||||||
color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
@mixin link-colors($normal, $hover: $normal, $visited: $normal) {
|
|
||||||
color: $normal;
|
|
||||||
&:hover, &:focus {
|
|
||||||
color: $hover;
|
|
||||||
}
|
|
||||||
&:visited {
|
|
||||||
color: $visited;
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -35,7 +35,6 @@ a {
|
|||||||
/* --------------------- */
|
/* --------------------- */
|
||||||
/* == NAVBAR */
|
/* == NAVBAR */
|
||||||
/* --------------------- */
|
/* --------------------- */
|
||||||
|
|
||||||
nav[role="main"] {
|
nav[role="main"] {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
@ -52,7 +51,7 @@ nav[role="main"] {
|
|||||||
|
|
||||||
#appname {
|
#appname {
|
||||||
float: left;
|
float: left;
|
||||||
width: 120px;
|
width: 150px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
@ -80,6 +79,11 @@ 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 {
|
||||||
@ -105,11 +109,9 @@ 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, 6%);
|
background: lighten($main-color, 20%);
|
||||||
@include transition(background 300ms ease-in-out);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
> span[class^="icon-"] {
|
> span[class^="icon-"] {
|
||||||
@ -125,7 +127,6 @@ nav[role="main"] {
|
|||||||
/* ------------------- */
|
/* ------------------- */
|
||||||
/* == MAIN */
|
/* == MAIN */
|
||||||
/* ------------------- */
|
/* ------------------- */
|
||||||
|
|
||||||
#main-container {
|
#main-container {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
margin-top: $navbar-height;
|
margin-top: $navbar-height;
|
||||||
@ -135,31 +136,6 @@ 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 */
|
||||||
/* --------------------- */
|
/* --------------------- */
|
||||||
@ -209,14 +185,13 @@ 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: lighten($text-color, 20%);
|
color: #7e848c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* --------------------------- */
|
/* --------------------------- */
|
||||||
/* == 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);
|
||||||
@ -231,6 +206,35 @@ 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 */
|
||||||
/* --------------------------- */
|
/* --------------------------- */
|
||||||
@ -239,3 +243,109 @@ 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,8 +6,7 @@
|
|||||||
/* -------------------- */
|
/* -------------------- */
|
||||||
/* == 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";
|
||||||
@ -15,7 +14,6 @@
|
|||||||
/* ------------------- */
|
/* ------------------- */
|
||||||
/* == Misc */
|
/* == Misc */
|
||||||
/* ------------------- */
|
/* ------------------- */
|
||||||
|
|
||||||
* { padding: 0; margin: 0; }
|
* { padding: 0; margin: 0; }
|
||||||
*:focus { outline: none; }
|
*:focus { outline: none; }
|
||||||
|
|
||||||
@ -37,14 +35,9 @@ img { border: 0; }
|
|||||||
|
|
||||||
.debug { border: 1px solid red; }
|
.debug { border: 1px solid red; }
|
||||||
|
|
||||||
.u { text-decoration: underline; }
|
.text_left, .t-left { text-align: left !important; }
|
||||||
.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; }
|
.text_center, .t-center { text-align: center !important; }
|
||||||
|
|
||||||
.pfixed { position: fixed !important; }
|
.pfixed { position: fixed !important; }
|
||||||
.f-left { float: left; }
|
.f-left { float: left; }
|
||||||
@ -65,9 +58,6 @@ 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;
|
||||||
@ -76,38 +66,14 @@ 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%; }
|
||||||
.w35p { width: 35%; }
|
.w35p { width: 35%; }
|
||||||
.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.
BIN
web/css/fonts/OpenSans-light.eot
Normal file
BIN
web/css/fonts/OpenSans-light.eot
Normal file
Binary file not shown.
1824
web/css/fonts/OpenSans-light.svg
Normal file
1824
web/css/fonts/OpenSans-light.svg
Normal file
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 113 KiB |
BIN
web/css/fonts/OpenSans-light.woff
Normal file
BIN
web/css/fonts/OpenSans-light.woff
Normal file
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: $classic-box-background;
|
background: map-get($classic-box, background);
|
||||||
box-shadow: 3px 3px 0 rgba($classic-box-border, .6);
|
box-shadow: 3px 3px 0 rgba(map-get($classic-box, border-color), .6);
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
border: 1px solid $classic-box-border;
|
border: 1px solid map-get($classic-box, border-color);
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
|
|
||||||
.box-header {
|
.box-header {
|
||||||
background-color: $classic-box-color;
|
background-color: map-get($classic-box, color);
|
||||||
height: $classic-box-header-height;
|
height: map-get-deep($classic-box, header, height);
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
color: $classic-box-title-color;
|
color: map-get-deep($classic-box, header, color);
|
||||||
float: left;
|
float: left;
|
||||||
font-size: $classic-box-title-fontsize;
|
font-size: map-get-deep($classic-box, header, font-size);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
line-height: $classic-box-header-height - 2px;
|
line-height: map-get-deep($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: $classic-box-title-fontsize + 6px;
|
font-size: map-get-deep($classic-box, header, font-size) + 6px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ul {
|
ul {
|
||||||
@ -34,20 +34,20 @@
|
|||||||
margin-left: -3px;
|
margin-left: -3px;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: lighten($classic-box-title-color, 10%);
|
color: lighten(map-get-deep($classic-box, header, color), 10%);
|
||||||
font-size: $classic-box-title-fontsize + 6px;
|
font-size: map-get-deep($classic-box, header, font-size) + 6px;
|
||||||
line-height: $classic-box-header-height;
|
line-height: map-get-deep($classic-box, header, height);
|
||||||
padding: 4px 10px;
|
padding: 4px 10px;
|
||||||
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
||||||
&:hover:not(.disabled) {
|
&:hover:not(.disabled) {
|
||||||
background: lighten($classic-box-color, 20%);
|
background: lighten(map-get($classic-box, color), 20%);
|
||||||
color: $classic-box-color !important;
|
color: map-get($classic-box, color) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.disabled {
|
&.disabled {
|
||||||
opacity: .4;
|
/*opacity: .4;*/
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
@ -74,12 +74,16 @@
|
|||||||
|
|
||||||
table a {
|
table a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: $classic-box-color;
|
color: map-get($classic-box, color);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: lighten($classic-box-color, 20%);
|
color: lighten(map-get($classic-box, color), 20%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.faded {
|
||||||
|
opacity: .4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.box-footer {
|
.box-footer {
|
||||||
@ -92,3 +96,38 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* --------------------- */
|
||||||
|
/* == 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,24 +2,17 @@
|
|||||||
|
|
||||||
span.label {
|
span.label {
|
||||||
padding: 1px 3px 2px;
|
padding: 1px 3px 2px;
|
||||||
font-size: $label-font-size;
|
font-size: map-get($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: $label-default;
|
background-color: map-get-deep($label, types, default);
|
||||||
@include border-radius($label-border-radius);
|
@include border-radius(map-get($label, border-radius));
|
||||||
|
|
||||||
&.success {
|
@each $name, $color in map-get($label, types) {
|
||||||
background-color: $label-success;
|
&.#{""+$name+""} {
|
||||||
}
|
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…
Reference in New Issue
Block a user