🎨 增加 Go 后端

This commit is contained in:
江西小徐
2024-04-07 11:08:05 +08:00
parent 04c82ab25d
commit 61275be2bf
165 changed files with 7043 additions and 3599 deletions
+1
View File
@@ -0,0 +1 @@
node_modules
+6
View File
@@ -0,0 +1,6 @@
# 网站Logo部分
WebSiteDomain="Nuxt Whois"
WebSiteDomainSuffix="Dns"
# 网站标题
WebSiteTitle="Nuxt Whois"
+24
View File
@@ -0,0 +1,24 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist
# Node dependencies
node_modules
# Logs
logs
*.log
# Misc
.DS_Store
.fleet
.idea
# Local env files
.env
.env.*
!.env.example
+4
View File
@@ -0,0 +1,4 @@
public-hoist-pattern[]=@css-render/vue3-ssr
public-hoist-pattern[]=vueuc
public-hoist-pattern[]=naive-ui
shamefully-hoist=true
+128
View File
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
+43
View File
@@ -0,0 +1,43 @@
FROM node:lts-alpine AS base
# Set the working directory
WORKDIR /usr/src/app
# Install pnpm
RUN apk add --no-cache curl && \
curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
################################################################################
# Create a stage for installing dependencies
FROM base as dependencies
# Copy the package.json and package-lock.json (or pnpm-lock.yaml if available)
COPY package*.json pnpm-lock.yaml* ./
# Install dependencies
RUN pnpm install --frozen-lockfile
################################################################################
# Create a stage for running the application in development mode
FROM dependencies as development
# Copy the source code
COPY . .
# Expose the port
EXPOSE 3000
# Run the application
CMD ["pnpm", "run", "dev"]
################################################################################
# Create a stage for building the application
FROM dependencies as build
# Copy the source code
COPY . .
# Build the application
RUN pnpm run build
# Remove extraneous packages
RUN pnpm prune --prod
################################################################################
# Create a stage for running the application in production mode
FROM base AS production
# Copy the built application
COPY --from=build /usr/src/app/.output /usr/src/app/.output
# Run the application
CMD ["node", ".output/server/index.mjs"]
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://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 <https://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
<https://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
<https://www.gnu.org/licenses/why-not-lgpl.html>.
+69
View File
@@ -0,0 +1,69 @@
# Nuxt-Whois
Nuxt-Whois 是一个基于 Nuxt3、Tailwind CSS 和 Xep-Whois 构建的Whois查询工具。它提供了一个简洁、响应式的界面,用于查询域名的Whois信息,包括域名所有者、注册状态、到期时间等信息。
## 特性
- **主题切换**:支持深色和浅色模式,可根据用户偏好或系统设置自动切换。
- **语言切换**:提供多语言支持,方便不同语言用户使用。
- **时区切换**:支持时区设置,确保时间信息的准确性。
- **Dns查询**:支持Dns查询,方便用户查看域名的Dns信息。
- **自定义后缀**:支持自定义Whois服务器后缀,方便用户查询不同后缀的域名。
## 更新说明
- 2024.3.25 抛弃原来 NuxtUi 改用 NaiveUi 重构中 后台增加中 当前版本无法上线使用
- 2024.3.18 重构V2版本 预计三天内完成。
### 内容修改
大部分多语言文字都在lang文件夹下或者.env文件,可以自行修改。
### 环境要求
- Node.js 18.x 或更高版本
- NPM 或 Yarn
### 交流群组
![QQ群图片](./img/qrcode.jpg)
## 图片预览
![首页图片](./img/home.png)
### 安装
克隆项目到本地:
```bash
git clone https://github.com/7836246/Nuxt-Whois.git
cd Nuxt-Whois
# 使用 PNPM
pnpm install
# 或使用 NPM
npm install
# 或使用 Yarn
yarn
```
### 运行
```bash
# 使用 PNPM
pnpm dev
```
# 免责声明
本项目开源仅供学习使用,不得用于任何违法用途,否则后果自负,与本人无关。使用请保留项目地址谢谢。
+21
View File
@@ -0,0 +1,21 @@
# Security Policy
## Supported Versions
Use this section to tell people about which versions of your project are
currently being supported with security updates.
| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |
## Reporting a Vulnerability
Use this section to tell people how to report a vulnerability.
Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.
+12
View File
@@ -0,0 +1,12 @@
enum Api {
blogInfo = '/',
report = '/report'
}
/**
* 获取博客信息
* @returns 博客信息
*/
export function getBlogInfo(option: any) {
return ""
}
+23
View File
@@ -0,0 +1,23 @@
enum Api {
webSiteConfig = '/getWebSiteConfig',
whoisServer = "/getWhoisServer"
}
// 获取网站配置
export function GetWebSiteConfig() {
return useHttp.post<WebSiteConfig>("/getWebSiteConfig")
}
//获取whois服务器
export function GetWhoisServer(config: string) {
return useHttp.post<any>("/getWhoisServer", {
config: config,
})
}
export function GetWhois(domain: string, name: string) {
return useHttp.post<any>("/getWhois", {
domain: domain,
name: name,
})
}
+5
View File
@@ -0,0 +1,5 @@
// api/front/index.ts
import * as home from './home';
// Re-export home
export {home};
+2
View File
@@ -0,0 +1,2 @@
export * as admin from './admin/index';
export * as front from './front/index';
+44
View File
@@ -0,0 +1,44 @@
<template>
<n-config-provider
:theme="theme"
:theme-overrides="themeOverrides"
inline-theme-disabled
preflight-style-disabled
>
<n-global-style/>
<n-modal-provider>
<n-message-provider>
<NuxtLayout>
<NuxtLoadingIndicator/>
<NuxtPage/>
</NuxtLayout>
</n-message-provider>
</n-modal-provider>
</n-config-provider>
</template>
<script setup lang="ts">
import {darkTheme, lightTheme} from 'naive-ui'
const colorMode = useColorMode()
const theme = computed(() => {
return colorMode.value === 'system' ? (colorMode.value ? lightTheme : darkTheme) : colorMode.value === 'light' ? lightTheme : darkTheme
})
const styleStore = useStyleStore()
const {common} = storeToRefs(styleStore)
const themeOverrides = computed(() => {
return {
common: common.value, // 注意这里要使用 common.value
}
})
await callOnce(async () => {
await useSettingsStore().webSiteConfigInit()
await useConfigStore().configServerInit()
})
</script>
<style>
</style>
+3
View File
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

+82
View File
@@ -0,0 +1,82 @@
/**********************************
* @Author: Ronnie Zhang
* @LastEditor: Ronnie Zhang
* @LastEditTime: 2023/12/05 21:26:28
* @Email: [email protected]
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/
html,
body {
width: 100%;
height: 100%;
overflow: hidden;
}
#app {
width: 100%;
height: 100%;
}
/* transition fade-slide */
.fade-slide-leave-active,
.fade-slide-enter-active {
transition: all 0.3s;
}
.fade-slide-enter-from {
opacity: 0;
transform: translateX(-30px);
}
.fade-slide-leave-to {
opacity: 0;
transform: translateX(30px);
}
/* 自定义滚动条样式 */
.cus-scroll {
overflow: auto;
&::-webkit-scrollbar {
width: 8px;
height: 8px;
}
}
.cus-scroll-x {
overflow-x: auto;
&::-webkit-scrollbar {
width: 0;
height: 8px;
}
}
.cus-scroll-y {
overflow-y: auto;
&::-webkit-scrollbar {
width: 8px;
height: 0;
}
}
.cus-scroll,
.cus-scroll-x,
.cus-scroll-y {
&::-webkit-scrollbar-thumb {
background-color: transparent;
border-radius: 4px;
}
&:hover {
&::-webkit-scrollbar-thumb {
background: #bfbfbf;
}
&::-webkit-scrollbar-thumb:hover {
background: var(--primary-color);
}
}
}
+49
View File
@@ -0,0 +1,49 @@
/**********************************
* @Author: Ronnie Zhang
* @LastEditor: Ronnie Zhang
* @LastEditTime: 2023/12/05 21:26:38
* @Email: [email protected]
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/
html {
box-sizing: border-box;
}
*,
::before,
::after {
margin: 0;
padding: 0;
box-sizing: inherit;
}
a {
text-decoration: none;
color: inherit;
}
a:hover,
a:link,
a:visited,
a:active {
text-decoration: none;
}
ol,
ul {
list-style: none;
}
input,
textarea {
outline: none;
border: none;
resize: none;
}
img,
video {
max-width: 100%;
height: auto;
}
+13
View File
@@ -0,0 +1,13 @@
<script lang="ts" setup>
const localePath = useLocalePath()
const router = useRouter();
</script>
<template>
<div
class="cursor-pointer flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100 dark:bg-gray-700"
@click="router.push(localePath('/settings/api'))"
>
<Icon name="i-eos-icons:api-outlined" class=" text-lg dark:text-white" />
</div>
</template>
+27
View File
@@ -0,0 +1,27 @@
<script setup lang="ts">
defineProps({
full: {
type: Boolean,
default: false,
},
showFooter: {
type: Boolean,
default: false,
},
})
</script>
<template>
<main class="cus-scroll h-full flex-col flex-1 bg-#f5f6fb dark:bg-#121212">
<transition name="fade-slide" mode="out-in" appear>
<main :class="{ 'flex-1': full }" class="m-12"><slot /></main>
</transition>
<slot v-if="$slots.footer" name="footer" />
<CommonTheFooter v-else-if="showFooter" class="mb-12 mt-auto" />
<n-back-top :bottom="20" />
</main>
</template>
<style scoped>
</style>
+24
View File
@@ -0,0 +1,24 @@
<script setup lang="ts">
defineProps({
text: String
})
</script>
<template>
<!-- 公告部分 -->
<div class="bg-gray-200 p-3 rounded-md mb-5 dark:bg-[#000000FF]">
<div class="flex items-center">
<i aria-hidden="true" class="icon fas fa-bullhorn mr-3"></i>
</div>
<div class="flex-grow">
<div class="text-sm text-gray-800 dark:text-white">
{{ text }}
<slot name="text"/>
</div>
</div>
</div>
</template>
<style scoped>
</style>
@@ -0,0 +1,64 @@
<script lang="ts" setup>
const colorMode = useColorMode()
const availableColor = ref([
{
id: 1,
name: 'system',
icon: 'ph:laptop-duotone',
},
{
id: 2,
name: 'dark',
icon: 'ph:moon-stars-duotone',
},
{
id: 3,
name: 'light',
icon: 'ph:sun-dim-duotone',
},
])
</script>
<template>
<div>
<HeadlessListbox
v-model="$colorMode.preference"
as="div"
class="relative flex items-center"
>
<HeadlessListboxLabel class="sr-only">
Theme
</HeadlessListboxLabel>
<HeadlessListboxButton type="button" title="Change Color">
<div
class="flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100 dark:bg-gray-700"
>
<Icon name="ph:palette-duotone" class=" text-lg dark:text-white"/>
</div>
</HeadlessListboxButton>
<HeadlessListboxOptions
class="absolute top-full right-0 z-[999] mt-2 w-40 overflow-hidden rounded-lg bg-white text-sm font-semibold text-gray-700 shadow-lg shadow-gray-300 outline-none dark:bg-gray-800 dark:text-white dark:shadow-gray-500 dark:ring-0"
>
<HeadlessListboxOption
v-for="color in availableColor"
:key="color.id"
:value="color.name"
class="flex w-full cursor-pointer items-center justify-between py-2 px-3"
:class="{
'text-white-500 bg-gray-200 dark:bg-gray-500/50':
colorMode.preference === color.name,
'hover:bg-gray-200 dark:hover:bg-gray-700/30':
colorMode.preference !== color.name,
}"
>
<span class="truncate">
{{ color.name }}
</span>
<span class="flex items-center justify-center text-sm">
<Icon :name="color.icon" class="text-base"/>
</span>
</HeadlessListboxOption>
</HeadlessListboxOptions>
</HeadlessListbox>
</div>
</template>
+26
View File
@@ -0,0 +1,26 @@
<script setup lang="ts">
const emit = defineEmits(['action'])
const handleClick = () => {
const urlParam = 'dns' // handleAction
emit('action', urlParam)
}
</script>
<template>
<div>
<div title="Change Color">
<div
class="cursor-pointer flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100 dark:bg-gray-700"
@click="handleClick"
>
<Icon name="eos-icons:dns" class=" text-lg dark:text-white" />
</div>
</div>
</div>
</template>
<style scoped>
</style>
+44
View File
@@ -0,0 +1,44 @@
<script setup lang="ts">
const isOpen = ref(false)
const {t} = useI18n()
</script>
<template>
<div>
<div title="Change Color">
<div
class="cursor-pointer flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100 dark:bg-gray-700"
@click="isOpen = true"
>
<Icon name="mdi:about-circle-outline" class=" text-lg dark:text-white"/>
</div>
</div>
<NDrawer
v-model:show="isOpen"
placement="left"
:default-width="502"
resizable
>
<NDrawerContent
:title="t('index.support')"
closable
>
<div class="flex flex-wrap mt-2 ">
<!-- <span-->
<!-- v-for="item in SupportedTLDs"-->
<!-- :key="item"-->
<!-- class="m-1 px-2 py-1 text-sm font-semibold text-gray-800 bg-gray-200 rounded hover:bg-gray-300"-->
<!-- >-->
<!-- {{ item }}-->
<!-- </span>-->
</div>
</NDrawerContent>
</NDrawer>
</div>
</template>
<style scoped>
</style>
+22
View File
@@ -0,0 +1,22 @@
<script setup lang="ts">
const localePath = useLocalePath()
const {t} = useI18n()
</script>
<template>
<footer class="text-gray-800 h-[10vh] bg-[#F1F3F4] dark:text-white dark:bg-[#000000FF]">
<div class="max-w-5xl mx-auto py-4 px-4 flex justify-between items-center">
<div class="text-sm">
{{ t('footer.text') }}
</div>
<div class="flex items-center space-x-4">
<NuxtLink :to="localePath('/api.html')" class="hover:underline">{{ t('footer.api') }}</NuxtLink>
<NuxtLink to="https://github.com/7836246/Nuxt-Whois" class="hover:underline">
<Icon name="ant-design:github-outlined" class="h-6 w-6"/>
</NuxtLink>
</div>
</div>
</footer>
</template>
<style scoped>
</style>
+96
View File
@@ -0,0 +1,96 @@
<script setup lang="ts">
const isOpen = ref(false)
const settingsStore = useSettingsStore()
const {t} = useI18n()
</script>
<template>
<div>
<div title="Change Color">
<div
class="cursor-pointer flex h-10 w-10 items-center justify-center rounded-lg dark:bg-gray-700"
@click="isOpen = true"
>
<Icon name="ic:baseline-history" class=" text-lg dark:text-white"/>
</div>
</div>
<NDrawer
v-model:show="isOpen"
placement="right"
:default-width="602"
resizable
>
<NDrawerContent
:title="t('history.title')"
class="w-full min-h-screen overflow-y-auto dark:text-white dark:bg-[#000000FF]"
closable
>
<div class="max-w-6xl mx-auto">
<h1 class="text-2xl font-bold text-gray-800 mb-5 flex items-center justify-between">
<span
class="text-sm text-gray-500 py-1 px-3 rounded-full dark:text-white dark:bg-[#000000FF]">
{{ t('history.tips', {length: settingsStore.getHistory.length}) }}
</span>
</h1>
<div class=" shadow-md rounded-lg ">
<!-- 条件渲染如果有历史记录则显示表格否则显示提示 -->
<div v-if="settingsStore.getHistory.length">
<!-- 表格头部和内容 -->
<table class="min-w-full leading-normal ">
<thead>
<tr>
<th class="px-5 py-3 border-b-2 border-gray-200 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
{{ t('history.domain') }}
</th>
<th class="px-5 py-3 border-b-2 border-gray-200 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
{{ t('history.type') }}
</th>
<th class="px-5 py-3 border-b-2 border-gray-200 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
{{ t('history.time') }}
</th>
<th class="px-5 py-3 border-b-2 border-gray-200 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
{{ t('history.actions') }}
</th>
</tr>
</thead>
<tbody>
<!-- 这里将使用循环来动态展示查询历史 -->
<tr v-for="item in settingsStore.getHistory" :key="item.id"
class="border-b border-gray-200 dark:text-white dark:bg-[#000000FF]">
<td class="px-5 py-5 text-sm ">
<NuxtLink :to="item.path">{{ item.domain }}</NuxtLink>
</td>
<td class="px-5 py-5 text-sm ">
{{ item.type }}
</td>
<td class="px-5 py-5 text-sm ">
{{ item.date }}
</td>
<td class="px-5 py-5 text-sm ">
<NButton
@click="settingsStore.deleteHistory(item.id)"
>{{ t('common.actions.delete') }}
</NButton>
</td>
</tr>
</tbody>
</table>
</div>
<div v-else class="text-center py-5">
<p class="text-gray-500">{{ t('history.empty') }}</p>
</div>
</div>
</div>
</NDrawerContent>
</NDrawer>
</div>
</template>
<style scoped>
</style>
@@ -0,0 +1,61 @@
<script lang="ts" setup>
const switchLocalePath = useSwitchLocalePath()
const { locale } = useI18n()
const local = computed(() => {
return locale.value
})
const availableLocales = [
{ iso: 'en', name: 'English', flag: 'twemoji:flag-us-outlying-islands' },
{ iso: 'zh', name: '中文简体', flag: 'emojione-v1:flag-for-china' },
{ iso: 'tw', name: '中文繁体', flag: 'flag:tw-4x3' },
// ...
]
</script>
<template>
<div>
<HeadlessListbox
v-model="local"
as="div"
class="relative flex items-center"
>
<HeadlessListboxLabel class="sr-only">
Change Language
</HeadlessListboxLabel>
<HeadlessListboxButton type="button" title="Change Language">
<div
class="flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100 dark:bg-gray-700"
>
<Icon name="i-ph:translate-bold" class=" text-lg dark:text-white" size="20" />
</div>
</HeadlessListboxButton>
<HeadlessListboxOptions
class="absolute top-full right-0 z-[999] mt-2 w-40 overflow-hidden rounded-lg bg-white text-sm font-semibold text-gray-700 shadow-lg shadow-gray-300 outline-none dark:bg-gray-800 dark:text-white dark:shadow-gray-500 dark:ring-0"
>
<NuxtLink
v-for="lang in availableLocales"
:key="lang.iso"
:to="switchLocalePath(lang.iso)"
class="flex w-full cursor-pointer items-center justify-between py-2 px-3"
:class="{
'text-white-500 bg-gray-200 dark:bg-gray-500/50':
local === lang.iso,
'hover:bg-gray-200 dark:hover:bg-gray-700/30':
local !== lang.iso,
}"
>
<span class="truncate">
{{ lang.name }}
</span>
<span class="flex items-center justify-center text-sm">
<Icon :name="lang.flag" class="text-base" size="20" />
</span>
</NuxtLink>
</HeadlessListboxOptions>
</HeadlessListbox>
</div>
</template>
@@ -0,0 +1,98 @@
<script setup lang="ts">
// import { MeModal } from '@/components'
const [modalRef] = useModal()
</script>
<template>
123
<div>
<n-tooltip trigger="hover" placement="left">
<template #trigger>
<IconSettings size="32" @click="modalRef.open()" filled class="cursor-pointer text-32 color-primary" />
</template>
布局设置
</n-tooltip>
<MeModal
ref="modalRef"
title="布局设置"
:show-footer="false"
width="600px"
:modal-style="{ opacity: 0.85 }"
>
<n-space justify="space-between">
<div class="flex-col cursor-pointer justify-center" @click="appStore.setLayout('simple')">
<div class="flex">
<n-skeleton :width="20" :height="60" />
<div class="ml-4">
<n-skeleton :width="80" :height="60" />
</div>
</div>
<n-button
class="mt-12"
size="small"
:type="appStore.layout === 'simple' ? 'primary' : ''"
ghost
>
简约
</n-button>
</div>
<div class="flex-col cursor-pointer justify-center" @click="appStore.setLayout('normal')">
<div class="flex">
<n-skeleton :width="20" :height="60" />
<div class="ml-4">
<n-skeleton :width="80" :height="10" />
<n-skeleton class="mt-4" :width="80" :height="46" />
</div>
</div>
<n-button
class="mt-12"
size="small"
:type="appStore.layout === 'normal' ? 'primary' : ''"
ghost
>
通用
</n-button>
</div>
<div class="flex-col cursor-pointer justify-center" @click="appStore.setLayout('full')">
<div class="flex">
<n-skeleton :width="20" :height="60" />
<div class="ml-4">
<n-skeleton :width="80" :height="6" />
<n-skeleton class="mt-4" :width="80" :height="4" />
<n-skeleton class="mt-4" :width="80" :height="42" />
</div>
</div>
<n-button
class="mt-12"
size="small"
:type="appStore.layout === 'full' ? 'primary' : ''"
ghost
>
全面
</n-button>
</div>
<div class="flex-col cursor-pointer justify-center" @click="appStore.setLayout('empty')">
<div class="flex">
<n-skeleton :width="104" :height="60" />
</div>
<n-button
class="mt-12"
size="small"
:type="appStore.layout === 'empty' ? 'primary' : ''"
ghost
>
空白
</n-button>
</div>
</n-space>
<p class="mt-16 opacity-50">
: 此设置仅对未设置layout或者设置成跟随系统的页面有效菜单设置的layout优先级最高
</p>
</MeModal>
</div>
</template>
<style scoped>
</style>
+53
View File
@@ -0,0 +1,53 @@
<script lang="ts" setup>
import {useSettingsStore} from "~/stores/settings";
const availableTimeZones = ref([
{ id: 1, name: 'currentWindow' },
{ id: 2, name: 'newWindow' },
]);
const {t} = useI18n()
const settingsStore = useSettingsStore()
</script>
<template>
<div>
<HeadlessListbox
v-model="settingsStore.linkOpenType"
as="div"
class="relative flex items-center"
>
<HeadlessListboxLabel class="sr-only">
Theme
</HeadlessListboxLabel>
<HeadlessListboxButton type="button" title="Change Color">
<div
class="flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100 dark:bg-gray-700"
>
<Icon name="material-symbols:link" class=" text-lg dark:text-white" />
</div>
</HeadlessListboxButton>
<HeadlessListboxOptions
class="absolute top-full right-0 z-[999] mt-2 w-40 max-h-60 overflow-y-auto rounded-lg bg-white text-sm font-semibold text-gray-700 shadow-lg shadow-gray-300 outline-none dark:bg-gray-800 dark:text-white dark:shadow-gray-500 dark:ring-0"
>
<HeadlessListboxOption
v-for="item in availableTimeZones"
:key="item.id"
:value="item.name"
class="flex w-full cursor-pointer items-center justify-between py-2 px-3 hover:bg-gray-100 dark:hover:bg-gray-600"
:class="{
'text-white-500 bg-gray-200 dark:bg-gray-500/50':
settingsStore.linkOpenType === item.name,
'hover:bg-gray-200 dark:hover:bg-gray-700/30':
settingsStore.linkOpenType !== item.name,
}"
>
<span class="truncate">
{{ t(`settings.${item.name}`) }}
</span>
<span class="flex items-center justify-center text-sm">
</span>
</HeadlessListboxOption>
</HeadlessListboxOptions>
</HeadlessListbox>
</div>
</template>
@@ -0,0 +1,21 @@
<script setup lang="ts">
const localePath = useLocalePath()
const router = useRouter();
</script>
<template>
<div>
<div title="Change Color">
<div
class="cursor-pointer flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100 dark:bg-gray-700"
@click="router.push(localePath('/settings'))"
>
<Icon name="uil:setting" class=" text-lg dark:text-white" />
</div>
</div>
</div>
</template>
<style scoped>
</style>
+23
View File
@@ -0,0 +1,23 @@
<script setup lang="ts">
</script>
<template>
<footer class="f-c-c text-14 text-gray-500">
<p>
Copyright © 2023
<a
href="https://github.com/zclzone"
target="__blank"
class="transition"
hover="decoration-underline color-primary"
>
Ronnie Zhang(大脸怪)
</a>
</p>
</footer>
</template>
<style scoped>
</style>
@@ -0,0 +1,82 @@
<script lang="ts" setup>
const availableTimeZones = ref([
{id: 1, name: 'UTC-12', displayName: 'International Date Line West'},
{id: 2, name: 'UTC-11', displayName: 'Coordinated Universal Time-11'},
{id: 3, name: 'UTC-10', displayName: 'Hawaii'},
{id: 4, name: 'UTC-9', displayName: 'Alaska'},
{id: 5, name: 'UTC-8', displayName: 'Pacific Time (US & Canada)'},
{id: 6, name: 'UTC-7', displayName: 'Mountain Time (US & Canada)'},
{id: 7, name: 'UTC-6', displayName: 'Central Time (US & Canada), Mexico City'},
{id: 8, name: 'UTC-5', displayName: 'Eastern Time (US & Canada), Bogota, Lima'},
{id: 9, name: 'UTC-4', displayName: 'Atlantic Time (Canada), Caracas, La Paz'},
{id: 10, name: 'UTC-3', displayName: 'Buenos Aires, Georgetown'},
{id: 11, name: 'UTC-2', displayName: 'Coordinated Universal Time-02'},
{id: 12, name: 'UTC-1', displayName: 'Azores'},
{id: 13, name: 'UTC', displayName: 'Coordinated Universal Time'},
{id: 14, name: 'UTC+1', displayName: 'Brussels, Copenhagen, Madrid, Paris'},
{id: 15, name: 'UTC+2', displayName: 'Athens, Bucharest, Istanbul'},
{id: 16, name: 'UTC+3', displayName: 'Moscow, St. Petersburg, Nairobi'},
{id: 17, name: 'UTC+3:30', displayName: 'Tehran'},
{id: 18, name: 'UTC+4', displayName: 'Abu Dhabi, Muscat'},
{id: 19, name: 'UTC+4:30', displayName: 'Kabul'},
{id: 20, name: 'UTC+5', displayName: 'Islamabad, Karachi, Tashkent'},
{id: 21, name: 'UTC+5:30', displayName: 'Chennai, Kolkata, Mumbai, New Delhi'},
{id: 22, name: 'UTC+5:45', displayName: 'Kathmandu'},
{id: 23, name: 'UTC+6', displayName: 'Astana, Dhaka'},
{id: 24, name: 'UTC+6:30', displayName: 'Yangon (Rangoon)'},
{id: 25, name: 'UTC+7', displayName: 'Bangkok, Hanoi, Jakarta'},
{id: 26, name: 'UTC+8', displayName: 'Beijing, Hong Kong, Singapore, Taipei'},
{id: 27, name: 'UTC+9', displayName: 'Osaka, Sapporo, Tokyo'},
{id: 28, name: 'UTC+9:30', displayName: 'Adelaide, Darwin'},
{id: 29, name: 'UTC+10', displayName: 'Brisbane, Canberra, Melbourne, Sydney'},
{id: 30, name: 'UTC+11', displayName: 'Solomon Is., New Caledonia'},
{id: 31, name: 'UTC+12', displayName: 'Auckland, Wellington'},
{id: 32, name: 'UTC+13', displayName: 'Nuku alofa'}
]);
const settingsStore = useSettingsStore()
</script>
<template>
<div>
<HeadlessListbox
v-model="settingsStore.timeZones"
as="div"
class="relative flex items-center"
>
<HeadlessListboxLabel class="sr-only">
Theme
</HeadlessListboxLabel>
<HeadlessListboxButton type="button" title="Change Color">
<div
class="flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100 dark:bg-gray-700"
>
<Icon name="ri:time-zone-line" class=" text-lg dark:text-white"/>
</div>
</HeadlessListboxButton>
<HeadlessListboxOptions
class="absolute top-full right-0 z-[999] mt-2 w-40 max-h-60 overflow-y-auto rounded-lg bg-white text-sm font-semibold text-gray-700 shadow-lg shadow-gray-300 outline-none dark:bg-gray-800 dark:text-white dark:shadow-gray-500 dark:ring-0"
>
<HeadlessListboxOption
v-for="item in availableTimeZones"
:key="item.id"
:value="item.name"
class="flex w-full cursor-pointer items-center justify-between py-2 px-3 hover:bg-gray-100 dark:hover:bg-gray-600"
:class="{
'text-white-500 bg-gray-200 dark:bg-gray-500/50':
settingsStore.timeZones === item.name,
'hover:bg-gray-200 dark:hover:bg-gray-700/30':
settingsStore.timeZones !== item.name,
}"
>
<span class="truncate">
{{ item.name }}
</span>
<span class="flex items-center justify-center text-sm">
</span>
</HeadlessListboxOption>
</HeadlessListboxOptions>
</HeadlessListbox>
</div>
</template>
+62
View File
@@ -0,0 +1,62 @@
<script lang="ts" setup>
const switchLocalePath = useSwitchLocalePath()
const settingsStore = useSettingsStore()
const configStore = useConfigStore()
const {configServer} = storeToRefs(configStore)
const handlePost = async (name: string) => {
//
await refreshNuxtData('dns')
}
</script>
<template>
<div>
<HeadlessListbox
v-model="configServer.dnsArr"
as="div"
class="relative flex items-center"
>
<HeadlessListboxLabel class="sr-only">
Change Language
</HeadlessListboxLabel>
<HeadlessListboxButton type="button" title="Change Language">
<div
class="flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100 dark:bg-gray-700"
>
<Icon name="gg:select-o" class=" text-lg dark:text-white" size="20"/>
</div>
</HeadlessListboxButton>
<HeadlessListboxOptions
class="absolute top-full right-0 z-[999] mt-2 w-40 overflow-hidden rounded-lg bg-white text-sm font-semibold text-gray-700 shadow-lg shadow-gray-300 outline-none dark:bg-gray-800 dark:text-white dark:shadow-gray-500 dark:ring-0"
>
<div
v-for="lang in configServer.dnsArr"
:key="lang.name"
@click="handlePost(lang.name)"
:class="{
'flex w-full cursor-pointer items-center justify-between py-2 px-3 text-white-500 bg-gray-200 dark:bg-gray-500/50':
dnsStore.getFirstNewDnsShown.name === lang.name && lang.show,
'flex w-full cursor-pointer items-center justify-between py-2 px-3 hover:bg-gray-200 dark:hover:bg-gray-700/30':
dnsStore.getFirstNewDnsShown.name !== lang.name && lang.show,
}"
>
<span
v-if="lang.show"
class="truncate">
{{ lang.iName }}
</span>
<span
v-if="lang.show"
class="flex items-center justify-center text-sm">
<Icon :name="lang.flag" class="text-base" size="20"/>
</span>
</div>
</HeadlessListboxOptions>
</HeadlessListbox>
</div>
</template>
@@ -0,0 +1,45 @@
<script setup lang="ts">
const props = defineProps({
data:{
type: Object,
required: true
}
});
const {t} = useI18n()
</script>
<template>
<div class="flex bg-gray-100 p-8">
<div class="w-full mx-auto">
<div class="bg-white shadow-lg rounded-lg p-6 mb-4" v-for="item in data.Answer">
<h2 class="text-xl font-bold">{{ item.name }}</h2>
<div class="grid grid-cols-2 gap-4">
<div>
<p class="font-semibold">Type</p>
<p>{{ item.type }}</p>
</div>
<div>
<p class="font-semibold">TTL</p>
<p>{{ item.TTL }}</p>
</div>
<div class="col-span-2">
<p class="font-semibold">Data</p>
<p>{{ item.data }}</p>
</div>
</div>
<div class="flex space-x-2 mt-4">
<span class="bg-green-200 text-green-800 px-2 py-1 rounded">RD: {{ data.RD }}</span>
<span class="bg-green-200 text-green-800 px-2 py-1 rounded">RA: {{ data.RA }}</span>
<span class="bg-red-200 text-red-800 px-2 py-1 rounded">TC: {{ data.TC }}</span>
<span class="bg-red-200 text-red-800 px-2 py-1 rounded">AD: {{ data.AD }}</span>
<span class="bg-red-200 text-red-800 px-2 py-1 rounded">CD: {{ data.CD }}</span>
</div>
</div>
</div>
</div>
</template>
<style scoped>
</style>
+61
View File
@@ -0,0 +1,61 @@
<script setup lang="ts">
defineProps({
data: {
type: Object,
required: true
}
})
const {t} = useI18n()
</script>
<template>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div v-if="data.aRecords">
<h3 class="font-semibold text-lg text-blue-600 mb-2">{{ t('dns.aRecord') }}</h3>
<div class="border rounded-lg p-4 bg-blue-50">
<ul
class="list-none space-y-2">
<li v-for="(record, index) in data.aRecords" :key="'a-record-' + index" class="flex justify-between items-center">
<span class="font-medium text-gray-700">IP:</span>
<span class="font-normal text-gray-600">{{ record }}</span>
</li>
</ul>
</div>
</div>
<div v-if="data.nsRecords">
<h3 class="font-semibold text-lg text-green-600 mb-2">{{ t('dns.nsRecord') }}</h3>
<div class="border rounded-lg p-4 bg-green-50">
<ul
class="list-none space-y-2">
<li v-for="(record, index) in data.nsRecords" :key="'ns-record-' + index" class="flex justify-between items-center">
<span class="font-normal text-gray-600">{{ record }}</span>
</li>
</ul>
</div>
</div>
<div
v-if="data.soaRecord"
class="md:col-span-2">
<h3 class="font-semibold text-lg text-purple-600 mb-2">{{ t('dns.soaRecord') }}</h3>
<div class="border rounded-lg p-4 bg-purple-50">
<ul class="list-none space-y-2">
<li
><span class="font-medium text-gray-700">nsname:</span> <span class="font-normal text-gray-600">{{ data.soaRecord.nsname }}</span></li>
<li><span class="font-medium text-gray-700">hostmaster:</span> <span class="font-normal text-gray-600">{{ data.soaRecord.hostmaster }}</span></li>
<li><span class="font-medium text-gray-700">serial:</span> <span class="font-normal text-gray-600">{{ data.soaRecord.serial }}</span></li>
<li><span class="font-medium text-gray-700">refresh:</span> <span class="font-normal text-gray-600">{{ data.soaRecord.refresh }}</span></li>
<li><span class="font-medium text-gray-700">retry:</span> <span class="font-normal text-gray-600">{{ data.soaRecord.retry }}</span></li>
<li><span class="font-medium text-gray-700">expire TTL:</span> <span class="font-normal text-gray-600">{{ data.soaRecord.expire }}</span></li>
<li><span class="font-medium text-gray-700">minttl TTL:</span> <span class="font-normal text-gray-600">{{ data.soaRecord.minttl }}</span></li>
</ul>
</div>
</div>
</div>
</template>
<style scoped>
</style>
+43
View File
@@ -0,0 +1,43 @@
<script setup lang="ts">
defineProps({
data: {
type: Object,
required: true
}
})
</script>
<template>
<div class="flex p-8">
<div class="w-full mx-auto">
<div class=" shadow-lg rounded-lg p-6 mb-4" v-for="item in data.Answer">
<h2 class="text-xl font-bold">{{ item.name }}</h2>
<div class="grid grid-cols-2 gap-4">
<div>
<p class="font-semibold">Type</p>
<p>{{ item.type }}</p>
</div>
<div>
<p class="font-semibold">TTL</p>
<p>{{ item.TTL }}</p>
</div>
<div class="col-span-2">
<p class="font-semibold">Data</p>
<p>{{ item.data }}</p>
</div>
</div>
<div class="flex space-x-2 mt-4">
<span class="bg-green-200 text-green-800 px-2 py-1 rounded">RD: {{ data.RD }}</span>
<span class="bg-green-200 text-green-800 px-2 py-1 rounded">RA: {{ data.RA }}</span>
<span class="bg-red-200 text-red-800 px-2 py-1 rounded">TC: {{ data.TC }}</span>
<span class="bg-red-200 text-red-800 px-2 py-1 rounded">AD: {{ data.AD }}</span>
<span class="bg-red-200 text-red-800 px-2 py-1 rounded">CD: {{ data.CD }}</span>
</div>
</div>
</div>
</div>
</template>
<style scoped>
</style>
+57
View File
@@ -0,0 +1,57 @@
<template>
<div class="px-4 space-y-4">
<div class="flex gap-2 items-center">
<UInput v-model="newDomainSuffix" @input="searchSuffix" :placeholder="t('settings.suffixPlaceholder')" class="flex-grow rounded shadow transition duration-200 ease-in-out" />
<UInput v-model="newWhoisServer" :placeholder="t('settings.whoisPlaceholder')" class="flex-grow border-gray-300 rounded shadow transition duration-200 ease-in-out" />
<UButton @click="addSuffix" type="button" :disabled="suffixExists" class="p-2 bg-blue-500 text-white rounded hover:bg-blue-700 shadow disabled:bg-gray-400 disabled:cursor-not-allowed transition duration-200 ease-in-out">
{{ t('common.actions.add') }}</UButton>
</div>
<div class="text-sm" v-if="suffixExists">
<span class="text-red-500">{{ t('common.actions.suffixExist') }}</span>
</div>
<div class="overflow-auto h-64 mt-4 bg-gray-50 rounded shadow">
<div v-for="(server, suffix) in domainStore.SupportedTLDs" :key="suffix" class="flex items-center justify-between p-2 border-b border-gray-200 last:border-b-0">
<div>{{ suffix }}: {{ server }}</div>
<UButton @click="removeSuffix(suffix)" type="button" class="bg-red-500 hover:bg-red-700 text-white p-1 rounded shadow transition duration-200 ease-in-out">
{{ t('common.actions.delete') }}
</UButton>
</div>
</div>
</div>
</template>
<script setup lang="ts">
const domainStore = useDomainStore();
const newDomainSuffix = ref('');
const newWhoisServer = ref('');
const suffixExists = computed(() => newDomainSuffix.value in domainStore.SupportedTLDs);
const toast = useToast()
const {t} = useI18n();
const addSuffix = async () => {
if (newDomainSuffix.value && newWhoisServer.value && !suffixExists.value) {
await domainStore.addSuffix(newDomainSuffix.value, newWhoisServer.value);
newDomainSuffix.value = '';
newWhoisServer.value = '';
toast.add(
{ title: '`添加成功`' }
);
}
};
const removeSuffix = async (suffix: string) => {
await domainStore.removeSuffix(suffix);
toast.add(
{ title: '删除成功',
}
);
};
const searchSuffix = () => {
// @inputsuffixExists
};
</script>
<style scoped>
</style>
+85
View File
@@ -0,0 +1,85 @@
<script setup lang="ts">
const settingsStore = useSettingsStore()
const {getIsDomainList, getIsHistory,} = storeToRefs(settingsStore)
const {t} = useI18n()
</script>
<template>
<ClientOnly>
<div class="flex justify-between w-full">
<div class="flex space-x-2">
<!-- 左边的新元素 -->
<n-tooltip
v-if="getIsDomainList"
trigger="hover" placement="top">
<template #trigger>
<CommonDomainList/>
</template>
<span>{{ t('popper.support') }}</span>
</n-tooltip>
<n-tooltip
v-if="getIsHistory"
trigger="hover" placement="top">
<template #trigger>
<CommonHistory/>
</template>
<span>{{ t('popper.history') }}</span>
</n-tooltip>
</div>
<div class="flex space-x-2">
<!-- 右边的现有元素 -->
<n-tooltip
trigger="hover"
placement="top">
<template #trigger>
<CommonSettingsChange/>
</template>
<span>{{ t('popper.setting') }}</span>
</n-tooltip>
<n-tooltip
trigger="hover"
placement="top">
<template #trigger>
<CommonApiChange/>
</template>
<span>第三方APi</span>
</n-tooltip>
<n-tooltip
trigger="hover"
placement="top">
<template #trigger>
<CommonTimeZonesChange/>
</template>
<span>{{ settingsStore.timeZones }}</span>
</n-tooltip>
<n-tooltip
trigger="hover"
placement="top">
<template #trigger>
<CommonColorChange/>
</template>
<span>{{ t('popper.theme') }}</span>
</n-tooltip>
<n-tooltip
trigger="hover"
placement="top">
<template #trigger>
<CommonLanguageChange/>
</template>
<span>{{ t('popper.language') }}</span>
</n-tooltip>
</div>
</div>
</ClientOnly>
</template>
<style scoped>
</style>
+13
View File
@@ -0,0 +1,13 @@
<script setup lang="ts">
const props = defineProps({
data: Object,
})
</script>
<template>
{{ data }}
</template>
<style scoped>
</style>
+13
View File
@@ -0,0 +1,13 @@
<script setup lang="ts">
const props = defineProps({
data: Object,
})
</script>
<template>
{{ data }}
</template>
<style scoped>
</style>
+28
View File
@@ -0,0 +1,28 @@
export const formatTimeAgo = (dateString: string) => {
const now = new Date();
const date = new Date(dateString);
const seconds = Math.floor((now.getTime() - date.getTime()) / 1000);
let interval = seconds / 31536000;
if (interval > 1) {
return Math.floor(interval) + " 年前";
}
interval = seconds / 2592000;
if (interval > 1) {
return Math.floor(interval) + " 月前";
}
interval = seconds / 86400;
if (interval > 1) {
return Math.floor(interval) + " 天前";
}
interval = seconds / 3600;
if (interval > 1) {
return Math.floor(interval) + " 小时前";
}
interval = seconds / 60;
if (interval > 1) {
return Math.floor(interval) + " 分钟前";
}
return Math.floor(seconds) + " 秒前";
};
+12
View File
@@ -0,0 +1,12 @@
// 自动导出
export const useHttp = {
post<T = any>(url: string, config?: any): Promise<T> {
const runtimeConfig = useRuntimeConfig()
const baseUrl = runtimeConfig.public.baseUrl
return $fetch(url, {
baseURL: baseUrl,
method: 'POST',
body: config,
})
},
}
+11
View File
@@ -0,0 +1,11 @@
module.exports = {
apps: [
{
name: 'NuxtWhois',
port: '3001',
exec_mode: 'cluster',
instances: 'max',
script: './.output/server/index.mjs'
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 KiB

+167
View File
@@ -0,0 +1,167 @@
export default defineI18nLocale(async locale => {
return {
app: {
title: 'Nuxt Whois',
},
common: {
actions: {
delete: 'Delete',
reset: 'Reset',
confirm: 'Confirm',
add: 'Add',
cancel: 'Cancel',
}
},
whois: {
title: 'Whois Query',
description: 'Query the Whois information of {domain}, including registrant contact information, domain status, DNS records and other detailed information. Quickly and accurately obtain domain ownership and registration information.',
keywords: 'Whois query, {domain}, domain information, domain owner, domain registration information'
},
dns: {
title: 'DNS Query',
description: 'Query the DNS records of {domain}, including A records, AAAA records, CNAME records, MX records, NS records, TXT records, etc.',
keywords: 'DNS query, {domain}, domain resolution, domain resolution record',
//DNS query result
dnsResult: 'DNS query result',
//A record
aRecord: 'A record',
//NS record
nsRecord: 'NS record',
//SOA record
soaRecord: 'SOA record',
},
history: {
//Query history
title: 'Query History',
//Only keep the last 30/{{ styleStore.getHistory.length }} records
tips: 'Only keep the last 30/{length} records',
//Domain
domain: 'Domain',
//Query type
type: 'Query Type',
//Query time
time: 'Query Time',
//Operation
actions: 'Actions',
//There is currently no query history.
empty: 'There is currently no query history.',
},
index: {
tips: 'The information you submit for your query will not be recorded!',
placeholder: 'Please enter a domain name',
onSubmit: 'Submit',
title: 'WHOIS and Dns Query Tool Website',
description: 'Provide domain WHOIS query, domain DNS query, domain registrar query, domain registration information query and other services',
keywords: 'Domain whois query, whois query, whois information query, whois query tool, whois query website, whois query api, whois query interface',
support: 'Currently only the following suffixes are supported',
},
error: {
formatDomain: 'Error formatting domain name',
validDomain: 'Domain must contain a valid top-level domain',
notFound: 'Domain not found',
},
result: {
result: 'Query Result',
title: 'WHOIS Query Result',
description: 'Here is the WHOIS information for the domain you queried',
domain: 'Domain Name',
//数据源
source: 'Source',
//注册商
registrar: 'Registrar',
//更新日
updateDate: 'Updated Date',
//注册日
createDate: 'Creation Date',
//到期日
expirationDate: 'Registry Expiry Date',
//IANAID
ianaId: 'IANAID',
//状态
status: 'Domain Status',
//DNS
dns: 'DNS',
//DNSSEC
dnssec: 'DNSSEC',
//原始数据
rawData: 'Raw Data',
},
footer: {
text: '© 2024 Whois Query. All rights reserved.',
api: 'API Documentation'
},
api: {
h1: 'Whois Key Information Extraction API',
//接口地址
url: 'API URL',
//请求方式
method: 'Request Method',
//请求参数
params: 'Request Parameters',
//输入参数
input: 'Input Parameters',
//输出参数
output: 'Output Parameters',
//返回处理后的whois字符串
whois: 'Returns the processed whois string',
//名称
name: 'Name',
//类型
type: 'Type',
//描述
desc: 'Description',
required: 'Required',
domain: 'Domain',
title: 'Whois Key Information Extraction API',
description: 'Extract key information from domain WHOIS information, including registrar, creation date, expiration date, DNS, status, etc.',
keywords: 'Domain whois query, whois query, whois information query, whois query tool, whois query website, whois query api, whois query interface',
},
popper: {
//支持列表
support: 'Support List',
//history
history: 'Query History',
//支持的DNS服务器列表
dns: 'Supported DNS Server List',
setting: 'Website Settings',
theme: 'Theme',
language: 'Language',
dnsChange: 'DNS Change',
},
settings: {
//全局设置
title: 'Global Settings',
//历史记录保留
history: 'History Retention',
//链接跳转方式
linkOpenType: 'Link Open Type',
//选择榜单列表内容的跳转方式
linkOpenTypeDesc: 'Select the jump method for the list content',
//杂项设置
miscellaneous: 'Miscellaneous Settings',
//重置所有数据
reset: 'Reset All Data',
//重置所有数据,你的自定义设置都将会丢失
resetDesc: 'Reset all data, your custom settings will be lost',
//确认重置所有数据?你的自定义设置都将会丢失!
resetConfirm: 'Confirm reset all data? Your custom settings will be lost!',
// 当前窗口
currentWindow: 'Current Window',
//新窗口
newWindow: 'New Window',
// 后缀设置
suffixSetting: 'Suffix Settings',
// 后缀管理
suffixManage: 'Suffix Management',
// 自定义后缀
customSuffix: 'Custom Suffix',
// 自定义编辑管理添加后缀
suffixDesc: 'Customize the suffix to be added',
// 管理
manage: 'Manage',
suffixPlaceholder: 'Please enter the suffix',
whoisPlaceholder: 'Please enter the whois server',
suffixExist: 'The suffix already exists',
},
}
})
+175
View File
@@ -0,0 +1,175 @@
export default defineI18nLocale(async locale => {
return {
app: {
title: 'Nuxt Whois',
},
common: {
actions: {
delete: '刪除',
//重置
reset: '重置',
//確定
confirm: '確定',
//新增
add: '新增',
cancel: '取消',
}
},
whois: {
title: 'Whois查詢',
description: '查詢{domain}的Whois信息,包括註冊者聯繫方式、域名狀態、DNS記錄等詳細信息。快速、準確地獲取域名所有權和註冊信息。',
keywords: 'Whois查詢, {domain}, 域名信息, 域名所有者, 域名註冊信息'
},
dns: {
title: 'DNS查詢',
description: '查詢{domain}的DNS記錄,包括A記錄、AAAA記錄、CNAME記錄、MX記錄、NS記錄、TXT記錄等。',
keywords: 'DNS查詢, {domain}, 域名解析, 域名解析記錄',
//DNS查詢結果
dnsResult: 'DNS查詢結果',
//A記錄
aRecord: 'A記錄',
//NS記錄
nsRecord: 'NS記錄',
//SOA記錄
soaRecord: 'SOA記錄',
},
history: {
//查詢歷史
title: '查詢歷史',
//只保留最近 30/{{ styleStore.getHistory.length }} 條記錄
tips: '只保留最近 30/{length} 條記錄',
//域名
domain: '域名',
//查詢型別
type: '查詢型別',
//查詢時間
time: '查詢時間',
//操作
actions: '操作',
//當前沒有查詢歷史記錄。
empty: '當前沒有查詢歷史記錄。',
},
index: {
tips: '您提交的查詢信息不會被記錄!',
placeholder: '請輸入域名',
onSubmit: '提交',
title: 'WHOIS與Dns查詢工具網站',
description: '提供域名WHOIS查詢、域名DNS查詢、域名註冊商查詢、域名註冊信息查詢等服務',
keywords: '域名whois查詢,whois查詢,whois信息查詢,whois查詢工具,whois查詢網站,whois查詢api,whois查詢接口',
support: '目前僅支持以下後綴',
},
error: {
formatDomain: '域名格式錯誤',
validDomain: '域名必須包含有效的頂級域',
notFound: '未找到域名資料',
},
result: {
result: '查詢結果',
title: 'WHOIS查詢結果',
description: '以下是您查詢的域名的WHOIS資訊',
domain: '域名',
//数据源
source: '資料來源',
//注册商
registrar: '註冊商',
//更新日
updateDate: '更新日',
//注册日
createDate: '註冊日',
//到期日
expirationDate: '到期日',
//IANAID
ianaId: 'IANAID',
//状态
status: '狀態',
//DNS
dns: 'DNS',
//DNSSEC
dnssec: 'DNSSEC',
//原始数据
rawData: '原始資料',
},
footer: {
text: '© 2024 Whois查詢. All rights reserved.',
api: 'API文檔'
},
api: {
h1: 'Whois關鍵信息提取API',
//接口地址
url: '接口地址',
//请求方式
method: '請求方式',
//请求参数
params: '請求參數',
//输入参数
input: '輸入參數',
//输出参数
output: '輸出參數',
//返回处理后的whois字符串
whois: '返回處理後的whois字符串',
//名称
name: '名稱',
//类型
type: '類型',
//描述
desc: '描述',
required: '必填',
domain: '域名',
title: 'Whois關鍵信息提取API',
description: '提取域名WHOIS信息中的關鍵信息,包括註冊商、註冊日期、到期日期、DNS、狀態等。',
keywords: '域名whois查詢,whois查詢,whois信息查詢,whois查詢工具,whois查詢網站,whois查詢api,whois查詢接口',
},
popper: {
//支援列表
support: '支援列表',
//查詢歷史
history: '查詢歷史',
//Dns查詢
dns: 'DNS查詢',
//網站設定
setting: '網站設定',
//主題模式
theme: '主題模式',
//語言設定
language: '語言設定',
//切換DNS伺服器
dnsChange: '切換DNS伺服器',
},
settings: {
//全域性設定
title: '全域性設定',
//歷史記錄保留
history: '歷史記錄保留',
//連結跳轉方式
linkOpenType: '連結跳轉方式',
//選擇榜單列表內容的跳轉方式
linkOpenTypeDesc: '選擇网页內容的跳轉方式',
//雜項設定
miscellaneous: '雜項設定',
//重置所有資料
reset: '重置所有資料',
//重置所有資料,你的自定義設定都將會丟失
resetDesc: '重置所有資料,你的自定義設定都將會丟失',
//確認重置所有資料?你的自定義設定都將會丟失!
resetConfirm: '確認重置所有資料?你的自定義設定都將會丟失!',
// 當前視窗
currentWindow: '當前視窗',
// 新視窗
newWindow: '新視窗',
// 字尾設定
suffixSetting: '字尾設定',
// 字尾管理
suffixManage: '字尾管理',
// 自定義字尾
customSuffix: '自定義字尾',
// 自定義編輯管理新增字尾
suffixDesc: '自定義編輯管理新增字尾',
// 管理
manage: '管理',
suffixPlaceholder: '域名字尾,如 .cn',
whoisPlaceholder: 'Whois伺服器,如 whois.cnnic.net.cn',
// 字尾已存在
suffixExist: '字尾已存在',
}
}
})
+182
View File
@@ -0,0 +1,182 @@
export default defineI18nLocale(async locale => {
return {
app: {
title: 'Nuxt Whois',
},
common: {
actions: {
//删除
delete: '删除',
//重置
reset: '重置',
//确定
confirm: '确定',
//添加
add: '添加',
cancel: '取消',
}
},
whois: {
title: "Whois查询",
description: "查询{domain}的Whois信息,包括注册者联系方式、域名状态、DNS记录等详细信息。快速、准确地获取域名所有权和注册信息。",
keywords: "Whois查询, {domain}, 域名信息, 域名所有者, 域名注册信息"
},
dns: {
title: 'DNS查询',
description: '查询{domain}的DNS记录,包括A记录、AAAA记录、CNAME记录、MX记录、NS记录、TXT记录等。',
keywords: 'DNS查询, {domain}, 域名解析, 域名解析记录',
//DNS查询结果
dnsResult: 'DNS查询结果',
//A记录
aRecord: 'A记录',
//NS记录
nsRecord: 'NS记录',
//SOA记录
soaRecord: 'SOA记录',
},
history: {
//查询历史
title: '查询历史',
//只保留最近 30/{{ styleStore.getHistory.length }} 条记录
tips: '只保留最近 30/{length} 条记录',
//域名
domain: '域名',
//查询类型
type: '查询类型',
//查询时间
time: '查询时间',
//操作
actions: '操作',
//当前没有查询历史记录。
empty: '当前没有查询历史记录。',
},
index: {
tips: '您提交的查询信息不会被记录!',
placeholder: '请输入域名',
onSubmit: '提交',
title: 'Whois与Dns查询工具网站',
description: '提供域名WHOIS查询、域名DNS查询、域名注册商查询、域名注册信息查询等服务',
keywords: '域名whois查询,whois查询,whois信息查询,whois查询工具,whois查询网站,whois查询api,whois查询接口',
//目前仅支持以下后缀
support: '目前仅支持以下后缀',
},
error: {
formatDomain: '域名格式错误',
//域名必须包含有效的顶级域
validDomain: '域名必须包含有效的顶级域',
notFound: '未找到域名信息,可能是后缀不支持,也可能是当前 Api 不支持,请更换尝试!',
},
result: {
result: '查询结果',
title: 'WHOIS查询结果',
description: '以下是您查询的域名的WHOIS信息',
domain: '域名',
//数据源
source: '数据源',
//注册商
registrar: '注册商',
//更新日
updateDate: '更新日',
//注册日
createDate: '注册日',
//到期日
expirationDate: '到期日',
//IANAID
ianaId: 'IANAID',
//状态
status: '状态',
//DNS
dns: 'DNS',
//DNSSEC
dnssec: 'DNSSEC',
//原始数据
rawData: '原始数据',
},
footer: {
text: '© 2024 Whois查询. All rights reserved.',
//API文档
api: 'API文档'
},
api: {
h1: 'Whois关键信息提取API',
//接口地址
url: '接口地址',
//请求方式
method: '请求方式',
//请求参数
params: '请求参数',
//输入参数
input: '输入参数',
//输出参数
output: '输出参数',
//返回处理后的whois字符串
whois: '返回处理后的whois字符串',
//名称
name: '名称',
//类型
type: '类型',
//描述
desc: '描述',
//必选
required: '必选',
//域名
domain: '域名',
title: 'Whois关键信息提取API',
description: '提取域名WHOIS信息中的关键信息,包括注册商、注册日期、到期日期、DNS、状态等。',
keywords: '域名whois查询,whois查询,whois信息查询,whois查询工具,whois查询网站,whois查询api,whois查询接口',
},
popper: {
//支持列表
support: '支持列表',
//查询历史
history: '查询历史',
//Dns查询
dns: 'Dns查询',
//网站设置
setting: '网站设置',
//主题模式
theme: '主题模式',
//语言设置
language: '切换语言',
//dnsChange
dnsChange: '切换DNS服务器',
},
settings: {
//全局设置
title: '全局设置',
//历史记录保留
history: '历史记录保留',
//链接跳转方式
linkOpenType: '链接跳转方式',
//选择榜单列表内容的跳转方式
linkOpenTypeDesc: '选择网页的跳转方式',
//杂项设置
miscellaneous: '杂项设置',
//重置所有数据
reset: '重置所有数据',
//重置所有数据,你的自定义设置都将会丢失
resetDesc: '重置所有数据,你的自定义设置都将会丢失',
//确认重置所有数据?你的自定义设置都将会丢失!
resetConfirm: '确认重置所有数据?你的自定义设置都将会丢失!',
// 当前窗口
currentWindow: '当前窗口',
// 新窗口
newWindow: '新窗口',
// 后缀设置
suffixSetting: '后缀设置',
// 后缀管理
suffixManage: '后缀管理',
// 自定义后缀
customSuffix: '自定义后缀',
// 自定义编辑管理添加后缀
suffixDesc: '自定义编辑管理添加后缀',
// 管理
manage: '管理',
suffixPlaceholder: '域名后缀,如 .cn',
whoisPlaceholder: 'Whois服务器,如 whois.cnnic.net.cn',
// 后缀已存在
suffixExist: '后缀已存在',
}
}
})
+112
View File
@@ -0,0 +1,112 @@
<script setup lang="ts">
import {type MenuOption, NIcon} from "naive-ui";
import type {Component} from "vue";
import {Settings, Wrench, Pentagon, MessageCircleMore} from 'lucide-vue-next';
function renderIcon(icon: Component) {
return () => h(NIcon, null, {default: () => h(icon)})
}
const route = useRoute()
const router = useRouter()
const menusOptions: MenuOption[] = [
{
label: '控制台',
key: '/admin/dashboard',
icon: renderIcon(Pentagon)
},
{
label: 'Whois管理',
key: 'whois',
icon: renderIcon(Settings),
children: [
{
label: '后缀管理',
key: '/admin/whois/website',
icon: renderIcon(Wrench),
}
]
},
{
label: 'Dns管理',
key: 'dns',
icon: renderIcon(Settings),
children: [
{
label: '后缀管理',
key: '/admin/whois/website',
icon: renderIcon(Wrench),
}
]
},
{
label: 'Domain管理',
key: 'domain',
icon: renderIcon(Settings),
children: [
{
label: '后缀管理',
key: '/admin/whois/website',
icon: renderIcon(Wrench),
}
]
},
{
label: '系统管理',
key: 'settings',
icon: renderIcon(Settings),
children: [
{
label: '网站设置',
key: '/admin/settings/website',
icon: renderIcon(Wrench),
},
{
label: '公告管理',
key: '/admin/settings/bulletin',
icon: renderIcon(MessageCircleMore),
}
]
}
]
const activeKey = computed(() => route.path)
console.log(route.path)
function handleMenuSelect(key: any, item: any) {
if (isExternal(item.key)) {
router.push(item.key)
} else {
router.push(item.key)
}
}
</script>
<template>
<div class="flex h-screen bg-gray-100">
<!-- Left Sidebar -->
<div class="w-64 text-black">
<n-menu
ref="menu"
class="side-menu"
accordion
:indent="18"
:collapsed-icon-size="22"
:collapsed-width="64"
:options="menusOptions"
:value="activeKey"
@update:value="handleMenuSelect"
/>
</div>
<!-- Right Content -->
<div class="flex-1 p-10">
<slot/>
</div>
</div>
</template>
<style scoped>
</style>
+132
View File
@@ -0,0 +1,132 @@
<script setup lang="ts">
const route = useRoute()
const router = useRouter();
const {t} = useI18n()
const localePath = useLocalePath()
const message = useMessage()
const settingsStore = useSettingsStore()
const {isObj, domainSearch, selectedOption, webSiteConfig} = storeToRefs(settingsStore)
//
const stylePage = computed(() => {
return route.meta?.stylePage
})
//
const handleAction = async (url) => {
const etDomainSearch = ExtractDomain(domainSearch.value);
switch (url) {
case 'whois':
// 使
if (DomainRegex.test(etDomainSearch)) {
//
domainSearch.value = etDomainSearch;
//
const urlType = etDomainSearch.replace(/\./g, '_');
await router.push(localePath(`/whois/${urlType}.html`));
} else if (Ipv4Regex.test(domainSearch.value)) {
//
const urlType = domainSearch.value.replace(/\./g, '_');
await router.push(localePath(`/whois/${urlType}.html`));
} else {
message.error('请输入有效的域名或IP地址')
return;
}
break;
case 'dns':
// 使
if (DomainRegex.test(etDomainSearch)) {
//
domainSearch.value = etDomainSearch;
//
const urlType = etDomainSearch.replace(/\./g, '_');
await router.push(localePath(`/dns/${urlType}.html`));
} else if (Ipv4Regex.test(domainSearch.value)) {
//
const urlType = domainSearch.value.replace(/\./g, '_');
await router.push(localePath(`/dns/${urlType}.html`));
} else {
message.error('请输入有效的域名或IP地址')
return;
}
return
}
}
const handleSelectOptions = (value: any) => {
settingsStore.setSelectedOption(value);
}
</script>
<template>
<div
class="w-full text-xs bg-[#F1F3F4] dark:bg-transparent"
:class="{ 'h-[90vh]': !stylePage }"
>
<div
class=" max-w-screen-lg mx-auto px-[1em] pb-[10vh] "
:class="{ 'pt-[25vh]': !stylePage, 'pt-[5vh]': stylePage }"
>
<nav
v-if="isObj.isLogo"
class=" w-full text-[#464747] h-5 ">
<NuxtLink class="mb-3 font-bold text-2xl inline-block text-current no-underline dark:text-white"
:to="localePath('/')"
>
<h1 class="inline-block text-current no-underline dark:text-white">{{ webSiteConfig.logoLeftText }}</h1>
<sup class="text-[#59a8d7] dark:text-[#ace4f8]">{{ webSiteConfig.logoRightText }}</sup>
</NuxtLink>
</nav>
<div class="mt-6">
<ClientOnly>
<div class="flex items-center space-x-2 mb-3 dark:text-white"
>
<!-- 容器div用于水平布局 -->
<div class="flex-grow">
<NInputGroup>
<n-select
class="w-1/4"
size="large"
v-model:value="selectedOption"
:options="webSiteConfig.defaultSelectOptions"
@update:value="handleSelectOptions"
/>
<NAutoComplete
v-model:value="domainSearch"
@keyup.enter="handleAction(settingsStore.selectedOption)"
:input-props="{ autocomplete: 'off' }"
type="text"
:placeholder="t('index.placeholder')"
size="large"
clearable
autofocus
class="w-full ">
</NAutoComplete>
</NInputGroup>
</div>
<!-- 使用v-if基于state.domain的值来控制按钮的显示 -->
<NButton type="primary"
size="large"
@click="handleAction(settingsStore.selectedOption)"
v-if="settingsStore.domainSearch">
{{ t('index.onSubmit') }}
</NButton>
</div>
</ClientOnly>
</div>
<CommonBulletin
v-if="!stylePage && isObj.isBulletin"
:text="`➡️ ${t('index.tips') }`"
/>
<TabList @action="handleAction"/>
<slot/>
</div>
</div>
<CommonFooter/>
</template>
<style scoped>
</style>
+14
View File
@@ -0,0 +1,14 @@
<script setup lang="ts">
</script>
<template>
<div class="w-full text-xs bg-[#F1F3F4] dark:bg-transparent">
<div class="max-w-screen-lg mx-auto pt-[5vh] px-[1em] pb-[10vh] ">
<slot />
</div>
</div>
</template>
<style scoped>
</style>
+70
View File
@@ -0,0 +1,70 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: {enabled: true},
routeRules: {
'/admin/**': {ssr: false}
},
modules: [
'@nuxt/devtools', // Devtools开发工具
'@nuxtjs/i18n', // 多语言
'@pinia/nuxt', // Pinia 持久化状态管理
'@pinia-plugin-persistedstate/nuxt', // Pinia 持久化状态管理插件
'nuxt-simple-robots',
'nuxt-headlessui', // 组件库
'@bg-dev/nuxt-naiveui', // 组件库
'nuxt-icon',
'@nuxtjs/color-mode',
'@nuxtjs/tailwindcss',
],
css: ['~/assets/css/main.css'],
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
experimental: {
appManifest: false,
},
features: {
inlineStyles: true,
},
runtimeConfig: {
public: {
baseUrl: process.env.BASE_URL
}
},
app: {
head: {
title: 'Nuxt Whois',
meta: [
{charset: 'utf-8'},
{name: 'viewport', content: 'width=device-width, initial-scale=1'},
],
link: [
{rel: 'icon', type: 'image/x-icon', href: '/favicon.ico'}
],
// script: [{src: "/darkModelVerify.js"}],
}
},
i18n: {
strategy: 'prefix_except_default',
defaultLocale: 'zh',
detectBrowserLanguage: {
useCookie: true,
},
locales: [
{code: 'zh', iso: 'zh-Hans', file: 'zh.ts'},
{code: 'en', iso: 'en-US', file: 'en.ts'},
{code: 'tw', iso: 'zh-Hant', file: 'tw.ts'},
],
langDir: 'lang/',
},
headlessui: {
prefix: 'Headless'
},
naiveui: {},
colorMode: {
classSuffix: '',
},
})
+37
View File
@@ -0,0 +1,37 @@
{
"name": "nuxt-app",
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"@pinia/nuxt": "^0.5.1",
"lucide-vue-next": "^0.365.0",
"nuxt": "^3.11.2",
"socks": "^2.8.1",
"vue": "^3.4.21",
"vue-router": "^4.3.0",
"vuedraggable": "^4.1.0"
},
"devDependencies": {
"@bg-dev/nuxt-naiveui": "^1.12.2",
"@nuxtjs/color-mode": "^3.3.3",
"@nuxtjs/i18n": "^8.3.0",
"@nuxtjs/tailwindcss": "^6.11.4",
"@pinia-plugin-persistedstate/nuxt": "^1.2.0",
"autoprefixer": "^10.4.19",
"less": "^4.2.0",
"nuxt-headlessui": "^1.2.0",
"nuxt-icon": "^0.6.10",
"nuxt-simple-robots": "4.0.0-rc.16",
"postcss": "^8.4.38",
"sass": "^1.74.1",
"tailwindcss": "^3.4.3",
"typescript": "5.4.4"
}
}
+15
View File
@@ -0,0 +1,15 @@
<script setup lang="ts">
definePageMeta({
layout: "admin",
})
</script>
<template>
123
</template>
<style scoped>
</style>
+99
View File
@@ -0,0 +1,99 @@
<template>
<div class="login-container flex items-center justify-center p-[20px]">
<div class="login-box w-[960px] h-[560px] md:w-[100%] md:px-[50px] px-[80px] py-[30px]">
<div class="flex items-center justify-center md:hidden">
<img :src="LoginPic" alt="login-pic"/>
</div>
<div class="flex justify-center w-[360px] md:w-[100%] flex-col items-center space-y-8">
<div class="space-y-2">
<div class="flex justify-center items-center space-x-[10px]">
<n-gradient-text :gradient="gradient" class="text-[24px] p-5">Nuxt Whois 后台管理</n-gradient-text>
</div>
</div>
<n-form
ref="formRef"
:model="formModel"
:rules="formRules"
label-placement="left"
size="large"
class="w-[100%]"
:show-require-mark="false"
:show-label="false"
>
<n-form-item path="username">
<n-input v-model:value="formModel.username" round placeholder="请输入用户名">
<template #prefix>
<Icon name="mdi:user-outline"/>
</template>
</n-input>
</n-form-item>
<n-form-item path="password">
<n-input v-model:value="formModel.password" round placeholder="请输入密码">
<template #prefix>
<Icon name="material-symbols:lock-outline"/>
</template>
</n-input>
</n-form-item>
<n-form-item>
<div class="flex justify-between w-[100%] px-[2px]">
<div class="flex-initial">
<n-checkbox v-model:checked="autoLogin">自动登录</n-checkbox>
</div>
<div class="flex-initial order-last">
<n-button text type="primary">忘记密码</n-button>
</div>
</div>
</n-form-item>
<n-form-item>
<n-button type="primary" size="large" round @click="handleSubmitForm" :loading="submitLoading" block>登录
</n-button>
</n-form-item>
</n-form>
</div>
</div>
</div>
</template>
<script setup>
definePageMeta({
layout: "empty",
})
import LoginPic from "assets/images/login-pic.png";
const router = useRouter();
const message = useMessage();
const autoLogin = ref(false);
const submitLoading = ref(false);
const formRef = ref(null);
const formModel = reactive({
username: "",
password: "",
});
const formRules = {
username: {required: true, message: "请输入用户名", trigger: "blur"},
password: {required: true, message: "请输入密码", trigger: "blur"},
};
const gradient = {
deg: 92.06,
from: "#33c2ff 0%",
// to: `${appStore.appTheme} 100%`,
};
const handleSubmitForm = (e) => {
};
</script>
<style lang="less" scoped>
.login-container {
background: linear-gradient(-135deg, #d765cf, #495fd1);
min-height: 100%;
.login-box {
@apply shadow-md rounded-xl bg-white flex justify-between;
}
}
</style>
@@ -0,0 +1,13 @@
<script setup lang="ts">
definePageMeta({
layout: "full",
})
</script>
<template>
</template>
<style scoped>
</style>
+62
View File
@@ -0,0 +1,62 @@
<script setup lang="ts">
definePageMeta({
layout: "full",
})
const siteName = ref('');
const siteNameAlt = ref('');
function saveSettings() {
// API
console.log('保存的网站名称:', siteName.value);
}
const active = ref(false);
const GnOptions = ref([
{
label: 'Whois',
value: 'whois'
}, {
label: 'Dns',
value: 'dns'
}, {
label: 'Domain',
value: 'domain'
}
])
const GnValue = ref('whois')
</script>
<template>
<div class="bg-gray-100 p-10">
<div class=" bg-white rounded-lg shadow-md p-5">
<h2 class="text-xl font-semibold mb-5">网站设置</h2>
<div class="flex mb-6 -mx-2">
<div class="flex-1 px-2">
<label for="site-name" class="block mb-2 text-sm font-medium text-gray-900">网站Logo名称</label>
<n-input id="site-name" v-model:value="siteName" placeholder="请输入网站名称"/>
</div>
<div class="flex-1 px-2">
<label for="site-name-alt" class="block mb-2 text-sm font-medium text-gray-900">Logo右上角名称</label>
<n-input id="site-name-alt" v-model:value="siteNameAlt" placeholder="请输入备用网站名称"/>
</div>
</div>
<div class="flex mb-6 -mx-2">
<div class="flex-1 px-2">
<label for="site-name" class="block mb-2 text-sm font-medium text-gray-900">开启极简模式</label>
<n-switch v-model:value="active"/>
</div>
<div class="flex-1 px-2">
<label for="site-name-alt" class="block mb-2 text-sm font-medium text-gray-900">功能开启选择</label>
<n-select v-model:value="GnValue" multiple :options="GnOptions"/>
</div>
</div>
<div class="flex justify-end">
<n-button type="primary" @click="saveSettings">保存设置</n-button>
</div>
</div>
</div>
</template>
<style scoped>
</style>
+90
View File
@@ -0,0 +1,90 @@
<script setup lang="ts">
definePageMeta({
layout: 'empty',
})
const localePath = useLocalePath()
const {t} = useI18n()
useHead({
title: t('api.title'),
meta: [
{
name: 'description',
content: t('api.description')
},{
name: 'keywords',
content: t('api.keywords')
}
]
})
</script>
<template>
<div class="max-w-4xl mx-auto py-8 px-4">
<div class="overflow-hidden shadow-md rounded-lg">
<div class="px-6 py-4 bg-red-500 text-white font-bold uppercase">
<div class="flex items-center justify-between">
<NuxtLink :to="localePath('/')" class="hover:text-white">
<Icon name="ic:outline-home" class="h-6 w-6" /> <!-- 调整图标大小 -->
</NuxtLink>
<span>{{ t('api.h1') }}</span>
<span></span> <!-- 占位符以保持标题居中 -->
</div>
</div>
<div class="p-6">
<div class="grid grid-cols-3 gap-4 mb-4">
<div class="font-semibold">{{ t('api.url') }}</div>
<div class="col-span-2">/api/whois</div>
</div>
<!-- <div class="grid grid-cols-3 gap-4 mb-4">-->
<!-- <div class="font-semibold">累计调用</div>-->
<!-- <div class="col-span-2"><span class="count">156</span> </div>-->
<!-- </div>-->
<div class="grid grid-cols-3 gap-4 mb-4">
<div class="font-semibold">{{ t('api.method') }}</div>
<div class="col-span-2">POST</div>
</div>
<div class="grid grid-cols-3 gap-4 mb-4">
<div class="font-semibold">{{ t('api.params') }}</div>
<div class="col-span-2">String</div>
</div>
</div>
<div class="px-6 py-4 border-t border-gray-200">
<div class="font-bold mb-2">{{ t('api.input') }}</div>
<div class="grid grid-cols-3 gap-4 mb-4">
<div class="font-semibold">{{ t('api.name') }}</div>
<div class="font-semibold">{{ t('api.type') }}</div>
<div class="font-semibold">{{ t('api.desc') }}</div>
</div>
<!-- 参数列表 -->
<div class="grid grid-cols-3 gap-4 mb-4">
<div>domain</div>
<div>string</div>
<div>({{ t('api.required') }}) {{ t('api.domain') }}</div>
</div>
<!-- <div class="grid grid-cols-3 gap-4 mb-4">-->
<!-- <div>whois</div>-->
<!-- <div>string</div>-->
<!-- <div>(必选) 域名的whois信息</div>-->
<!-- </div>-->
<!-- <div class="grid grid-cols-3 gap-4">-->
<!-- <div>lang</div>-->
<!-- <div>string</div>-->
<!-- <div>(可选) 语言代码 ISO 639-1: "zh""en"</div>-->
<!-- </div>-->
<!-- <div class="grid grid-cols-3 gap-4 mb-4">-->
<!-- <div>time_zone</div>-->
<!-- <div>string</div>-->
<!-- <div>(可选) 时区: "8""-3"</div>-->
<!-- </div>-->
</div>
<div class="px-6 py-4 border-t border-gray-200">
<div class="font-bold">{{ t('api.output') }}</div>
<div class="mt-2">{{ t('api.whois') }}</div>
</div>
</div>
</div>
</template>
<style scoped>
</style>
+109
View File
@@ -0,0 +1,109 @@
<script setup lang="ts">
import {AdjustTimeToUTCOffset} from "~/utils/utc";
definePageMeta({
stylePage: true,
})
const {t} = useI18n()
const localePath = useLocalePath()
const route = useRoute();
const {domain}: any = route.params;
const domainData = typeof domain === "string" ? domain?.replace(/_/g, '.') : "";
const styleStore = useStyleStore()
const settingsStore = useSettingsStore()
const configStore = useConfigStore()
const {currentServer} = storeToRefs(configStore)
const {data, pending, error, refresh} = await useAsyncData(
'dns',
() => $fetch('/api/dns', {
method: 'POST',
body: {
domain: domainData,
serverName: currentServer.value.dns,
}
})
)
if (!error.value && settingsStore.getIsHistory) {
styleStore.addOrUpdateHistory(
{
id: domainData,
type: 'dns',
domain: domainData,
path: localePath(`/dns/${domain}.html`),
date: AdjustTimeToUTCOffset(new Date().toString(), settingsStore.timeZones)
}
)
}
useHead({
title: `${domainData} - ${t('dns.title')}`,
meta: [
{
name: 'description',
content: t('dns.description', {domain: domainData})
}, {
name: 'keywords',
content: t('dns.keywords', {domain: domainData})
}
]
})
</script>
<template>
<div class="mt-5">
<div class=" shadow-lg rounded-lg overflow-hidden">
<div class="p-6">
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-bold text-gray-800"> {{ t('dns.dnsResult') }}
<span
class="text-gray-300 text-sm font-normal ml-2">
</span>
</h2>
<NTooltip
placement="top">
<template #trigger>
<DnsApiChanges/>
</template>
{{ t('popper.dnsChange') }}
</NTooltip>
</div>
<div
class=" "> <!-- 使用 min-h-screen 确保占满至少一个屏幕高度 -->
<div
class="p-8 ">
<!-- 增加内边距使用更大的最大宽度更大的圆角和阴影 -->
<h2 class="mb-6 text-xl font-bold text-gray-900 dark:text-white w-full">提示</h2> <!-- 增大标题文字和下边距 -->
<p class="text-center my-2 text-lg text-gray-700 dark:text-gray-400 w-full">当前没有可用的 DNS 服务器</p>
<!-- 增大正文文字尺寸并添加更多说明 -->
<p class="text-center my-2 text-lg text-gray-700 dark:text-gray-400 w-full">请检查您的Dns设置或稍后再试</p>
<!-- 增大正文文字尺寸并添加更多说明 -->
</div>
</div>
<DnsInfoList
:data="data"
/>
<!-- <DnsCloudflareList-->
<!-- v-if="timeStore.getDnsServer == 'cloudflare'"-->
<!-- :data="data"-->
<!-- />-->
</div>
</div>
</div>
</template>
<style scoped>
</style>
+86
View File
@@ -0,0 +1,86 @@
<script setup lang="ts">
import {AdjustTimeToUTCOffset} from "~/utils/utc";
const {t} = useI18n()
const localePath = useLocalePath()
const settingsStore = useSettingsStore()
const route = useRoute();
const {domain} = route.params;
const domainData = typeof domain === "string" ? domain?.replace(/_/g, '.') : "";
const {data: domainInfo, pending, error, refresh} = await useAsyncData(
'domain',
() => $fetch('/api/domain', {
method: 'POST',
body: {
domain: domainData,
}
})
)
if (!error.value && settingsStore.getIsHistory) {
settingsStore.addOrUpdateHistory(
{
id: domainData,
type: 'domain',
domain: domainData,
path: localePath(`/domain/${domain}.html`),
date: AdjustTimeToUTCOffset(new Date().toString(), settingsStore.timeZones)
}
)
}
</script>
<template>
<div class="mt-5 mx-auto mb-5">
<div
v-if="domainStore.getHasDomainShown"
class="bg-white dark:bg-gray-900 shadow rounded-lg overflow-hidden">
<div class="p-6 space-y-4">
<div
class="flex justify-between items-center">
<n-tag type="info" size="medium">域名信息</n-tag>
<n-tag v-if="domainStore.getHasDomainShown" type="success" size="medium">
Api来源{{ domainStore.getFirstNewDomainShown?.name }}
</n-tag>
</div>
<div class="grid grid-cols-2 gap-4 text-sm">
<p class="text-gray-800 dark:text-gray-200">域名: <span class="font-medium">{{ domainInfo.domain }}</span></p>
<p class="text-gray-800 dark:text-gray-200">货币: <span class="font-medium">{{
domainInfo.currency
}} ({{ domainInfo.currency_symbol }})</span></p>
<p class="text-gray-800 dark:text-gray-200">新注册价格: <span
class="font-medium">{{ domainInfo.currency_symbol }}{{ domainInfo.new }}</span>
</p>
<p class="text-gray-800 dark:text-gray-200">续费价格: <span class="font-medium">{{
domainInfo.currency_symbol
}}{{ domainInfo.renew }}</span></p>
<p v-if="domainInfo.premium" class="text-gray-800 dark:text-gray-200">溢价<span
class="font-medium">{{ domainInfo.premium ? '支持' : '不支持' }}</span></p>
<p v-else class="text-gray-800 dark:text-gray-200">溢价功能<span
class="font-medium">{{ domainInfo.premium ? '支持' : '不支持' }}</span></p>
</div>
</div>
</div>
<div
v-else
class="bg-white shadow-lg rounded-lg overflow-hidden"> <!-- 使用 min-h-screen 确保占满至少一个屏幕高度 -->
<div
class="p-8 ">
<!-- 增加内边距使用更大的最大宽度更大的圆角和阴影 -->
<h2 class="mb-6 text-xl font-bold text-gray-900 dark:text-white w-full">提示</h2> <!-- 增大标题文字和下边距 -->
<p class="text-center my-2 text-lg text-gray-700 dark:text-gray-400 w-full">当前没有可用的 Domain 服务器</p>
<!-- 增大正文文字尺寸并添加更多说明 -->
<p class="text-center my-2 text-lg text-gray-700 dark:text-gray-400 w-full">请检查您的Domain设置或稍后再试</p>
<!-- 增大正文文字尺寸并添加更多说明 -->
</div>
</div>
</div>
</template>
<style scoped>
</style>
+26
View File
@@ -0,0 +1,26 @@
<script setup lang="ts">
const settingsStore = useSettingsStore()
const {t} = useI18n()
useHead({
title: `${t('index.title')} - ${t('app.title')}`,
meta: [
{
name: 'description',
content: t('index.description')
}, {
name: 'keywords',
content: t('index.keywords')
}
]
})
</script>
<template>
</template>
<style scoped>
</style>
+278
View File
@@ -0,0 +1,278 @@
<script setup lang="ts">
import draggable from "vuedraggable";
definePageMeta({
stylePage: true,
})
const message = useMessage();
const configStore = useConfigStore()
const {configServer} = storeToRefs(configStore)
//
const restoreDefault = (arr: any, name: string) => {
arr.sort((a, b) => a.order - b.order);
message.success(`恢复默认${name}榜单排序成功`);
if (name === 'whois') {
updateConfigWithFirstVisibleItem(arr, 'Whois');
} else if (name === 'dns') {
updateConfigWithFirstVisibleItem(arr, 'Dns');
} else if (name === 'domain') {
updateConfigWithFirstVisibleItem(arr, 'Domain');
}
};
const updateConfigWithFirstVisibleItem = (arr, configKey) => {
const visibleItems = arr.filter(item => item.show);
const firstItemName = visibleItems.length > 0 ? visibleItems[0].name : '';
configStore[`setCurrentServer${configKey}`](firstItemName);
};
//
const saveSoreData = (name = null, open = false, rank = "whois") => {
message.success(
name ? `${name}${rank}榜单已${open ? "开启" : "关闭"}` : `${rank}榜单排序成功`
);
switch (rank) {
case 'whois':
updateConfigWithFirstVisibleItem(configServer.value.whoisArr, 'Whois');
break;
case 'dns':
updateConfigWithFirstVisibleItem(configServer.value.dnsArr, 'Dns');
break;
}
};
</script>
<template>
<ClientOnly>
<div class="setting mt-5">
<n-card class="set-item">
<div class="top">
<div class="name">
<n-text class="text">Whois第三方API</n-text>
<n-text class="tip" depth="3">
拖拽以排序开关用以控制在页面中的显示状态
</n-text>
</div>
<n-popconfirm @positive-click="restoreDefault(configServer.whoisArr,'whois')">
<template #trigger>
<n-button class="control" size="small"> 恢复默认</n-button>
</template>
确认将排序恢复到默认状态
</n-popconfirm>
</div>
<draggable
:list="configServer.whoisArr"
:animation="200"
class="mews-group"
item-key="order"
@end="saveSoreData(null,false,'whois')"
>
<template #item="{ element }">
<n-card
class="item"
embedded
:content-style="{ display: 'flex', alignItems: 'center' }"
>
<div class="desc" :style="{ opacity: element.show ? null : 0.6 }">
<img class="logo" :src="`/logo/${element.name}.png`" alt="logo"/>
<n-text class="news-name" v-html="element.label"/>
</div>
<n-switch
class="switch"
:round="false"
:disabled="element.disabled"
v-model:value="element.show"
@update:value="saveSoreData(element.label, element.show,'whois')"
/>
</n-card>
</template>
</draggable>
</n-card>
<n-card class="set-item">
<div class="top">
<div class="name">
<n-text class="text">Dns第三方API</n-text>
</div>
<n-popconfirm
@positive-click="restoreDefault(configServer.dnsArr,'dns')"
negative-text="取消"
positive-text="确认"
>
<template #trigger>
<n-button class="control" size="small"> 恢复默认</n-button>
</template>
确认将Dns排序恢复到默认状态
</n-popconfirm>
</div>
<draggable
:list="configServer.dnsArr"
:animation="200"
class="mews-group"
item-key="order"
@end="saveSoreData(null,false,'dns')"
>
<template #item="{ element }">
<n-card
class="item"
embedded
:content-style="{ display: 'flex', alignItems: 'center' }"
>
<div class="desc" :style="{ opacity: element.show ? null : 0.6 }">
<img class="logo" :src="`/logo/${element.name}.png`" alt="logo"/>
<n-text class="news-name" v-html="element.label"/>
</div>
<n-switch
class="switch"
:disabled="element.disabled"
:round="false"
v-model:value="element.show"
@update:value="saveSoreData(element.label, element.show,'dns')"
/>
</n-card>
</template>
</draggable>
</n-card>
<n-card class="set-item">
<div class="top">
<div class="name">
<n-text class="text">Domain第三方API</n-text>
</div>
<n-popconfirm
@positive-click="restoreDefault(configServer.domainArr,'domain')"
negative-text="取消"
positive-text="确认"
>
<template #trigger>
<n-button class="control" size="small"> 恢复默认</n-button>
</template>
确认将Domain排序恢复到默认状态
</n-popconfirm>
</div>
<draggable
:list="configServer.domainArr"
:animation="200"
class="mews-group"
item-key="order"
@end="saveSoreData(null,false,'domain')"
>
<template #item="{ element }">
<n-card
class="item"
embedded
:content-style="{ display: 'flex', alignItems: 'center' }"
>
<div class="desc" :style="{ opacity: element.show ? null : 0.6 }">
<img class="logo" :src="`/logo/${element.name}.png`" alt="logo"/>
<n-text class="news-name" v-html="element.label"/>
</div>
<n-switch
class="switch"
:disabled="element.disabled"
:round="false"
v-model:value="element.show"
@update:value="saveSoreData(element.label, element.show,'domain')"
/>
</n-card>
</template>
</draggable>
</n-card>
</div>
</ClientOnly>
</template>
<style lang="scss" scoped>
.setting {
.title {
margin-top: 30px;
margin-bottom: 20px;
font-size: 40px;
font-weight: bold;
}
.n-h {
padding-left: 16px;
font-size: 20px;
margin-left: 4px;
}
.set-item {
width: 100%;
border-radius: 8px;
margin-bottom: 12px;
.top {
display: flex;
align-items: center;
justify-content: space-between;
.name {
font-size: 18px;
display: flex;
flex-direction: column;
.tip {
font-size: 12px;
border-radius: 8px;
}
}
.set {
max-width: 200px;
}
}
.mews-group {
margin-top: 16px;
display: grid;
grid-template-columns: repeat(5, minmax(0px, 1fr));
gap: 24px;
@media (max-width: 1666px) {
grid-template-columns: repeat(4, minmax(0px, 1fr));
}
@media (max-width: 1200px) {
grid-template-columns: repeat(3, minmax(0px, 1fr));
}
@media (max-width: 890px) {
grid-template-columns: repeat(2, minmax(0px, 1fr));
}
@media (max-width: 620px) {
grid-template-columns: repeat(1, minmax(0px, 1fr));
}
.item {
cursor: pointer;
.desc {
display: flex;
align-items: center;
width: 100%;
transition: all 0.3s;
.logo {
width: 40px;
height: 40px;
margin-right: 12px;
}
.news-name {
font-size: 16px;
}
}
.switch {
margin-left: auto;
}
}
}
}
}
</style>
+218
View File
@@ -0,0 +1,218 @@
<script setup lang="ts">
definePageMeta({
stylePage: true,
})
const settingsStore = useSettingsStore()
const {t} = useI18n()
const {isObj} = storeToRefs(settingsStore)
const handleReset = async () => {
}
const styleStore = useStyleStore();
const localCommon = ref({...styleStore.common});
const modalVisible = ref(false)
const swatches = ['#FFFFFF', '#18A058', '#2080F0', '#F0A020', 'rgba(208, 48, 80, 1)'];
const updateColors = () => {
styleStore.updatePrimaryColor(localCommon.value);
};
</script>
<template>
<ClientOnly>
<div class="setting mt-8 settings-grid">
<n-h6 prefix="bar"> 基础设置</n-h6>
<n-card class="set-item">
<div class="top grid grid-cols-2 gap-4">
<div class="name">
<n-text class="text">{{ t('settings.title') }}</n-text>
<n-text class="tip" depth="3">{{ t('settings.history') }}</n-text>
</div>
<n-switch v-model:value="isObj.isHistory" :round="false"/>
<div class="name">
<n-text class="text">公告设置</n-text>
<n-text class="tip" depth="3">是否开启首页公告功能</n-text>
</div>
<n-switch v-model:value="isObj.isBulletin" :round="false"/>
<div class="name">
<n-text class="text">支持列表</n-text>
<n-text class="tip" depth="3">是否开启支持列表功能</n-text>
</div>
<n-switch v-model:value="isObj.isDomainList" :round="false"/>
<div class="name">
<n-text class="text">支持列表</n-text>
<n-text class="tip" depth="3">是否显示 Logo</n-text>
</div>
<n-switch v-model:value="isObj.isLogo" :round="false"/>
</div>
</n-card>
<n-modal v-model:show="modalVisible" title="颜色设置" :style="{ width: '480px' }">
<div class="p-8">
<div class="max-w-4xl mx-auto">
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<div>
<div class="text-sm font-semibold mb-2">Primary Color</div>
<n-color-picker v-model:value="localCommon.primaryColor" :swatches="swatches"/>
</div>
<div>
<div class="text-sm font-semibold mb-2">Info Color</div>
<n-color-picker v-model:value="localCommon.infoColor" :swatches="swatches"/>
</div>
<!-- 重复上述结构以添加更多颜色选择器 -->
<div>
<div class="text-sm font-semibold mb-2">Success Color</div>
<n-color-picker v-model:value="localCommon.successColor" :swatches="swatches"/>
</div>
<div>
<div class="text-sm font-semibold mb-2">Warning Color</div>
<n-color-picker v-model:value="localCommon.warningColor" :swatches="swatches"/>
</div>
<div>
<div class="text-sm font-semibold mb-2">Error Color</div>
<n-color-picker v-model:value="localCommon.errorColor" :swatches="swatches"/>
</div>
</div>
<n-button @click="updateColors" class="mt-6">Update Colors</n-button>
</div>
</div>
</n-modal>
<div class="mx-auto mt-10">
<n-h6 class="mb-4 text-lg font-bold text-gray-800" prefix="bar">颜色设置</n-h6>
<n-card class="set-item p-4 shadow-lg">
<div class="top flex justify-between items-center">
<div class="name">
<n-text class="text text-gray-600">自定义所有颜色</n-text>
</div>
<n-button type="warning" @click="modalVisible = true" class="bg-orange-500 hover:bg-orange-600">确认
</n-button>
</div>
</n-card>
</div>
<n-h6 prefix="bar"> 杂项设置</n-h6>
<n-card class="set-item">
<div class="top">
<div class="name">
<n-text class="text">重置所有数据</n-text>
<n-text class="tip" depth="3">
重置所有数据你的自定义设置都将会丢失
</n-text>
</div>
<n-popconfirm
@positive-click="handleReset"
:negative-text="t('common.actions.cancel')"
:positive-text="t('common.actions.confirm')"
>
<template #trigger>
<n-button type="warning"> {{ t('common.actions.reset') }}</n-button>
</template>
确认重置所有数据你的自定义设置都将会丢失
</n-popconfirm>
</div>
</n-card>
</div>
</ClientOnly>
</template>
<style scoped>
.setting {
.title {
margin-top: 30px;
margin-bottom: 20px;
font-size: 40px;
font-weight: bold;
}
.n-h {
padding-left: 16px;
font-size: 20px;
margin-left: 4px;
}
.set-item {
width: 100%;
border-radius: 8px;
margin-bottom: 12px;
.top {
display: flex;
align-items: center;
justify-content: space-between;
.name {
font-size: 18px;
display: flex;
flex-direction: column;
.tip {
font-size: 12px;
border-radius: 8px;
}
}
.set {
max-width: 200px;
}
}
.mews-group {
margin-top: 16px;
display: grid;
grid-template-columns: repeat(5, minmax(0px, 1fr));
gap: 24px;
@media (max-width: 1666px) {
grid-template-columns: repeat(4, minmax(0px, 1fr));
}
@media (max-width: 1200px) {
grid-template-columns: repeat(3, minmax(0px, 1fr));
}
@media (max-width: 890px) {
grid-template-columns: repeat(2, minmax(0px, 1fr));
}
@media (max-width: 620px) {
grid-template-columns: repeat(1, minmax(0px, 1fr));
}
.item {
cursor: pointer;
.desc {
display: flex;
align-items: center;
width: 100%;
transition: all 0.3s;
.logo {
width: 40px;
height: 40px;
margin-right: 12px;
}
.news-name {
font-size: 16px;
}
}
.switch {
margin-left: auto;
}
}
}
}
}
</style>
+69
View File
@@ -0,0 +1,69 @@
<script setup lang="ts">
definePageMeta({
stylePage: true,
})
const {t} = useI18n()
const route = useRoute();
const {domain}: any = route.params;
const domainData = typeof domain === "string" ? domain?.replace(/_/g, '.') : "";
const settingsStore = useSettingsStore()
const localePath = useLocalePath()
const configStore = useConfigStore()
const {currentServer} = storeToRefs(configStore)
const {data, pending, error, refresh} = await useAsyncData(
'whois',
() => $fetch('/api/server/whois', {
method: 'POST',
body: {
domain: domainData,
serverName: currentServer.value.whois,
},
})
)
if (!error.value && settingsStore.getIsHistory) {
settingsStore.addOrUpdateHistory(
{
id: domainData,
type: 'whois',
domain: domainData,
path: localePath(`/whois/${domain}.html`),
date: AdjustTimeToUTCOffset(new Date().toString(), settingsStore.timeZones)
}
)
}
useHead({
title: `${domainData} - ${t('whois.title')}`,
meta: [
{
name: 'description',
content: t('whois.description', {domain: domainData})
}, {
name: 'keywords',
content: t('whois.keywords', {domain: domainData})
}
]
})
</script>
<template>
<div
class="w-full bg-[#fffffe] mt-5 p-4 shadow-lg rounded-lg whitespace-pre-wrap dark:text-gray-200 dark:bg-gray-800"
>
<WhoisNuxt
v-if="currentServer.whois == 'nuxt'"
:data="data"
/>
<WhoisTianHu
v-if="currentServer.whois == 'tianhu'"
:data="data"
/>
</div>
</template>
<style scoped>
</style>
+8223
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -0,0 +1,2 @@
User-agent: *
Disallow:
+15
View File
@@ -0,0 +1,15 @@
let theme = localStorage.getItem("nuxt-color-mode");
function setTheme(theme) {
if (theme === "system" || !theme) {
theme =
window.matchMedia &&
window.matchMedia("(prefers-color-scheme: dark)").matches
? "dark"
: "light";
}
document.querySelector("html").classList.add(theme);
document.documentElement.setAttribute("class", theme);
}
setTheme(theme);
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

@@ -0,0 +1,24 @@
import { defineEventHandler } from 'h3';
import fs from 'fs';
import path from 'path';
interface AddSuffixBody {
suffix: string;
server: string;
}
export default defineEventHandler(async (event) => {
const body: AddSuffixBody = await readBody(event);
const filePath = path.join('server/whois/json', 'whois-servers.json');
const fileContent = fs.readFileSync(filePath, { encoding: 'utf8' });
const data: Record<string, string> = JSON.parse(fileContent);
// 添加或更新域名后缀
data[body.suffix] = body.server;
// 写入更新
fs.writeFileSync(filePath, JSON.stringify(data, null, 2), { encoding: 'utf8' });
return { message: 'ok' };
});
@@ -0,0 +1,23 @@
import { defineEventHandler } from 'h3';
import fs from 'fs';
import path from 'path';
interface RemoveSuffixBody {
suffix: string;
}
export default defineEventHandler(async (event) => {
const body: RemoveSuffixBody = await readBody(event);
const filePath = path.join('server/whois/json', 'whois-servers.json');
const fileContent = fs.readFileSync(filePath, { encoding: 'utf8' });
const data: Record<string, string> = JSON.parse(fileContent);
// 删除域名后缀
delete data[body.suffix];
// 写入更新
fs.writeFileSync(filePath, JSON.stringify(data, null, 2), { encoding: 'utf8' });
return { message: 'ok' };
});
+24
View File
@@ -0,0 +1,24 @@
export default defineEventHandler(async (event) => {
const body = await readBody(event);
const domain = body.domain;
const serverName = body.serverName;
if (serverName == '') {
return ""
}
const runtimeConfig = useRuntimeConfig()
const baseUrl = runtimeConfig.public.baseUrl
switch (serverName) {
case "nuxt": {
return ""
}
default:
return await $fetch(`${baseUrl}/server/getDns`, {
method: 'POST',
body: {
name: serverName,
domain: domain,
}
})
}
});
+55
View File
@@ -0,0 +1,55 @@
// 定义 DNS 服务器配置
const doMainServers: any = {
whocx: 'https://who.cx/api/price',
};
interface DomainInfoResponse {
code: number;
currency: string;
currency_symbol: string;
domain: string;
new: string;
renew: string;
premium: boolean;
}
export default defineEventHandler(async (event) => {
const body = await readBody(event);
const domain = body.domain;
const flag = body.flag;
const domainServerKey = body.domainServer;
//判断是否开启DNS
console.log(flag)
if (!flag) {
return {
status: 200,
data: {
status: 'success',
}
}
}
switch (domainServerKey) {
case 'whocx':
const res: any = await $fetch(doMainServers.whocx, {
method: "GET",
params: {
domain: domain,
}
});
return {
code: 200,
currency: res.currency,
currency_symbol: res.currency_symbol,
domain: res.domain,
new: res.new,
renew: res.renew,
premium: false,
} as DomainInfoResponse
default:
return null
}
});
+25
View File
@@ -0,0 +1,25 @@
import {whois} from "~/server/whois/whois";
export default defineEventHandler(async (event) => {
const body = await readBody(event)
const serverName = body.serverName;
const domain = body.domain
if (serverName == '') {
return ""
}
const runtimeConfig = useRuntimeConfig()
const baseUrl = runtimeConfig.public.baseUrl
switch (serverName) {
case "nuxt": {
return await whois(domain)
}
default:
return await $fetch(`${baseUrl}/server/getWhois`, {
method: 'POST',
body: {
name: serverName,
domain: domain,
}
})
}
})
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "../.nuxt/tsconfig.server.json"
}
@@ -0,0 +1,4 @@
{
"whois.denic.de" : "-T dn,ace",
"whois.nic.fr": "-V Md5.2"
}
File diff suppressed because it is too large Load Diff
+495
View File
@@ -0,0 +1,495 @@
import { SocksClient,SocksClientOptions } from 'socks';
import Net from 'net';
import serversData from '~/server/whois/json/whois-servers.json';
import parametersData from '~/server/whois/json/parameters.json';
const IANA_CHK_URL = 'https://www.iana.org/whois?q=';
interface IServers {
[key: string]: string;
}
const SERVERS: IServers = serversData as IServers;
const PARAMETERS: IServers = parametersData as IServers;
/**
* Find the WhoIs server for the TLD from IANA WhoIs service. The TLD is be searched and the HTML response is parsed to extract the WhoIs server
*
* @param tld TLD of the domain
* @returns WhoIs server which hosts the information for the domains of the TLD
*/
async function findWhoIsServer(tld: string): Promise<string> {
const chkURL = IANA_CHK_URL + tld
try{
const res = await fetch(chkURL);
if (res.ok) {
const body = await res.text();
const server = body.match(/whois:\s+(.*)\s+/);
if (server) {
return server[1];
}
}
} catch (err) {
console.error('Error in getting WhoIs server data from IANA', err);
}
return '';
}
/**
* Copy an Object with its values
*
* @param obj Object which needs to be copied
* @returns A copy of the object
*/
function shallowCopy<T extends any>(obj: T): T {
if (Array.isArray(obj)) {
return obj.slice() as T; // Clone the array
} else if (typeof obj === 'object' && obj !== null) {
const copy: any = {};
for (const key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
copy[key] = shallowCopy(obj[key]);
}
}
return copy as T;
} else {
return obj; // For primitive values, return as is
}
}
/**
* Get whois server of the tld from servers list
*
* @param tld TLD of the domain
* @returns WhoIs server which hosts the information for the domains of the TLD
*/
function getWhoIsServer(tld: string): string|undefined {
return SERVERS[tld];
}
/**
* Extract TLD from domain name.
* If the TLD is in whois-servers.json file, then the TLD is returned.
* If TLD is not found within the file, then determined by taking the last element after splitting the domain name from '.'
*
* @param domain Domain name
* @returns TLD
*/
function getTLD(domain: string): string {
let tld = '';
let domainStr = domain;
while (true) {
const domainData = domainStr.split('.');
if (domainData.length < 2) {
break;
}
const tldCheck = domainData.slice(1).join('.')
const server = SERVERS[tldCheck];
if (server) {
tld = tldCheck;
break;
}
domainStr = tldCheck;
}
if (tld != '') {
return tld;
}
console.debug('TLD is not found in server list. Returning last element after split as TLD!');
const domainData = domain.split('.');
return domainData[domainData.length-1];
}
// get whois query parameters if exist on parameters.json for whois server
function getParameters(server: string): string|undefined {
return PARAMETERS[server];
}
/**
* Type of the proxy. Either SOCKS4 or SOCKS5
* @enum
*/
export enum ProxyType {
/**
* SOCKS4 type of proxy
*/
SOCKS4 = 0,
/**
* SOCKS5 type of proxy
*/
SOCKS5 = 1
}
/**
* Proxy related data
* @interface
*
*/
export interface ProxyData {
/**
* Proxy IP
*/
ip: string,
/**
* Proxy port
*/
port: number,
/**
* Username to connect to the proxy
*/
username?: string | null,
/**
* Password to connect to the proxy
*/
password?: string | null,
/**
* {@link ProxyType}
*/
type: ProxyType
}
/**
* WhoIs options
* @interface
*/
export interface WhoIsOptions {
/**
* TLD of the domain. If the {@link tld} is not provided (or null), then it will be automatically determined as to the given domain name
*/
tld?: string | null,
/**
* The encoding type used for WhoIs server and response. By default UTF-8 is used.
*/
encoding?: string | null,
/**{@link ProxyData} */
proxy?: ProxyData | null,
/**
* The WhoIs server to collect data from. If not provided, the server will automatically determined using the {@link tld}
*/
server?: string | null,
/**
* The port of the WhoIs server. By default, port 43 is used.
*/
serverPort?: number | null,
/**
* Which data needs to be extracted/parsed from the WhoIs response.
* An object can be passed which contains keys of the fields of the WhoIs response.
* A copy of the provided object will be returned with the values filled for the provided keys.
*
* The keys can have default value of empty string. However, if the WhoIs response has multiple values for the same field (eg: 'Domain Status'),
* then all the values can be collected by providing a default value of an Array([]).
*
* Following example shows an object used to collect 'Domain Name', 'Domain Status' (multiple values) and 'Registrar' from WhoIs response
*
* @example {'Domain Name': '', 'Domain Status': [], 'Registrar': ''}
*/
parseData?: Object | null
}
/**
* Response returned from whois function. Contains the raw text from WhoIs server and parsed/fornatted WhoIs data (if parsed is true)
*
* @interface
*/
export interface WhoIsResponse {
/**
* Raw text response from WhoIs server
*/
_raw: string,
/**
* Parsed/Formatted key-value pairs of the response (if parsed is true)
*/
parsedData: any | null
}
/**
* Parse collected raw WhoIs data
*
* @class
*/
export class WhoIsParser {
/**
* Iterated through the complete text and returns extracted values
*
* @param rawData raw text from WhoIs server
* @param outputData Data which needs to be extracted from the raw text (key/value pairs). Keys are used to extract from raw text and values are filled.
* @returns Filled {@link outputData}
*/
private static iterParse(rawData: string, outputData: any) {
let lastStr = '';
let lastField: string | null = null;
let lastLetter = '';
for (let i = 0; i < rawData.length; i++) {
let letter = rawData[i];
if (letter == '\n' || (lastLetter == ':' && letter == ' ')) {
if (lastStr.trim() in outputData) {
lastField = lastStr.trim();
} else if (lastField !== null) {
let x = lastStr.trim();
if (x != '') {
let obj = outputData[lastField];
if (Array.isArray(obj)) {
obj.push(x);
} else {
outputData[lastField] = x;
}
lastField = null;
}
}
lastStr = '';
} else if (letter != ':') {
lastStr = lastStr + letter;
}
lastLetter = letter;
if (lastStr == 'Record maintained by' || lastStr == '>>>') {
break;
}
}
return outputData;
}
/**
* Parse the raw WhoIs text and returns extracted values
*
* @param rawData raw text from WhoIs server
* @param outputData Data which needs to be extracted from the raw text (key/value pairs). Keys are used to extract from raw text and values are filled.
* @returns Filled {@link outputData}
*/
public static parseData(rawData: string, outputData: any | null): any {
if (!outputData) {
outputData = {
'Domain Name': '',
'Creation Date': '',
'Updated Date': '',
'Registry Expiry Date': '',
'Domain Status': [],
"Registrar": '',
}
}
outputData = WhoIsParser.iterParse(rawData, outputData);
return outputData;
}
}
/**
* Connects to the provided {@link server}:{@link port} through TCP (through a proxy if a proxy is given), run the WhoIs query and returns the response
*
* @param domain Domain name
* @param queryOptions Query options which can be used with the specific WhoIs server to get the complete response
* @param server WhoIs server
* @param port WhoIs server port
* @param encoding Encoding used by the WhoIs server
* @param proxy {@link ProxyData}
* @returns The {string} WhoIs response for the query. Empty string is returned for errors
*/
export async function tcpWhois(domain: string, queryOptions: string, server: string, port: number, encoding: string, proxy: ProxyData | null): Promise<string> {
const decoder = new TextDecoder(encoding);
const encoder = new TextEncoder();
if (!proxy) {
const socket = new Net.Socket();
return new Promise((resolve, reject) => {
try {
socket.connect({port: port, host: server}, function() {
if (queryOptions != '') {
socket.write(encoder.encode(`${queryOptions} ${domain}\r\n`));
} else {
socket.write(encoder.encode(`${domain}\r\n`));
}
});
socket.on('data', (data) => {
resolve(decoder.decode(data));
});
socket.on('error', (error) => {
reject(error);
});
} catch (e){
reject(e);
}
});
} else {
const options: SocksClientOptions = {
proxy: {
host: proxy.ip,
port: proxy.port,
type: proxy.type == ProxyType.SOCKS5 ? 5 : 4
},
command: 'connect',
destination: {
host: server,
port: port
}
}
if (proxy.username && proxy.password) {
options.proxy.userId = proxy.username;
options.proxy.password = proxy.password;
}
return new Promise((resolve:any, reject:any) => {
SocksClient.createConnection(options, function(err:any, info:any) {
if (err) {
reject(err);
} else {
if (!info) {
reject(new Error('No socket info received!'));
}
if (queryOptions != '') {
info?.socket.write(
encoder.encode(`${queryOptions} ${domain}\r\n`)
);
} else {
info?.socket.write(
encoder.encode(`${domain}\r\n`)
);
}
info?.socket.on('data', (data:any) => {
resolve(decoder.decode(data));
});
info?.socket.resume();
}
});
});
}
}
/**
* Collect WhoIs data for the mentioned {@link domain}. Parse the reveived response if {@link parse} is true, accordingly.
*
* @param domain Domain name
* @param parse Whether the raw text needs to be parsed/formatted or not
* @param options {@link WhoIsOptions}
* @returns {@link WhoIsResponse}
*/
export async function whois(domain: string, parse: boolean = false, options: WhoIsOptions | null = null): Promise<WhoIsResponse> {
let tld: string;
let port = 43;
let server = '';
let queryOptions: string;
let proxy: ProxyData | null;
let encoding = 'utf-8';
if (!options) {
tld = getTLD(domain);
proxy = null;
} else {
tld = options.tld ? options.tld : getTLD(domain);
encoding = options.encoding ? options.encoding : 'utf-8';
proxy = options.proxy ? options.proxy : null;
server = options.server ? options.server : '';
port = options.serverPort ? options.serverPort : 43;
}
if (server == '') {
let serverData = getWhoIsServer(tld);
if (!serverData) {
console.debug(`No WhoIs server found for TLD: ${tld}! Attempting IANA WhoIs database for server!`);
serverData = await findWhoIsServer(tld);
if (!serverData) {
console.debug('WhoIs server could not be found!');
return {
_raw: '',
parsedData: null
};
}
console.debug(`WhoIs sever found for ${tld}: ${server}`);
}
server = serverData;
}
const qOptions = getParameters(server);
queryOptions = qOptions ? qOptions : '';
try {
let rawData = await tcpWhois(domain, queryOptions, server, port, encoding, proxy);
if (!parse) {
return {
_raw: rawData,
parsedData: null
}
} else {
let outputData: any | null = null;
if (options && options.parseData) {
outputData = shallowCopy(options.parseData);
}
try {
const parsedData = WhoIsParser.parseData(rawData, outputData);
return {
_raw: rawData,
parsedData: parsedData
};
} catch (err) {
return {
_raw: rawData,
parsedData: null
};
}
}
} catch (err) {
return {
_raw: '',
parsedData: null
};
}
}
/**
* Collects (and parse/format if set to be true) for the provided {@link domains}. If {@link parallel} is set to be true, multiple threads will be used to batch process the domains according to {@link threads} mentioned.
* If <i>options.parsedData</i> is mentioned, then it will be used to parse <b>all</b> the responses.
* If a proxy is mentioned in {@link options}, then the proxy will be used to collect <b>all</b> the WhoIs data.
*
* @param domains Domains Names
* @param parallel Whether data should be collected parallally or not
* @param threads Batch size (for parallel processing)
* @param parse Whether the raw text needs to be parsed/formatted or not
* @param options {@link WhoIsOptions}
* @returns Array of {@link WhoIsResponse} for all the domains. Order is not guaranteed
*/
export async function batchWhois(domains: string[], parallel: boolean = false, threads: number = 1, parse: boolean = false, options: WhoIsOptions | null = null): Promise<WhoIsResponse[]> {
let response: WhoIsResponse[] = [];
if (parallel) {
if (threads > domains.length) {
threads = domains.length;
}
for (let i = 0; i < domains.length; i+= threads) {
const batch = domains.slice(i, i+threads);
let resp = await Promise.all(batch.map(async domain => {
return await whois(domain, parse, options);
}));
response = response.concat(resp);
}
} else {
for (let i = 0; i < domains.length; i++) {
const res = await whois(domains[i], parse, options);
response.push(res);
}
}
return response;
}
+63
View File
@@ -0,0 +1,63 @@
import {defineStore} from 'pinia'
import {front} from "~/apis/index";
export const useConfigStore = defineStore('useConfig', {
state: () => {
return {
configServer: {
whoisArr: [] as any,
dnsArr: [] as any,
domainArr: [] as any,
},
currentServer: {
whois: 'nuxt',
dns: 'nuxt',
domain: 'nuxt',
}
}
},
actions: {
async configServerInit() {
// 获取网站whois设置
try {
const {data: whoisArray} = await front.home.GetWhoisServer('whois')
this.configServer.whoisArr = whoisArray
} catch (e) {
this.configServer.whoisArr = []
}
// 获取网站dns设置
try {
const {data: dnsArray} = await front.home.GetWhoisServer('dns')
this.configServer.dnsArr = dnsArray
} catch (e) {
this.configServer.dnsArr = []
}
// 获取网站域名设置
try {
const {data: domainArray} = await front.home.GetWhoisServer('domain')
this.configServer.domainArr = domainArray
} catch (e) {
this.configServer.domainArr = []
}
},
setCurrentServerWhois(whois: any) {
this.currentServer.whois = whois
},
setCurrentServerDns(dns: any) {
this.currentServer.dns = dns
},
setCurrenServerDomain(domain: any) {
this.currentServer.domain = domain
}
},
getters: {
// 获取所有的 Whois 服务器
getConfigServer: (state: any) => {
return state.configServer
},
},
persist: {
storage: persistedState.localStorage,
},
})
+119
View File
@@ -0,0 +1,119 @@
import {defineStore} from 'pinia'
import {front} from "~/apis/index";
interface HistoryRecord {
id: number;
type: string;
domain: string;
path: string;
date: string;
}
export const useSettingsStore = defineStore('settings', {
state: () => {
return {
webSiteConfig: {} as WebSiteConfig,
isObj: {
isHistory: false, // 是否显示历史记录
isBulletin: false, // 是否显示公告
isDomainList: false, // 是否显示域名列表
isLogo: true, // 是否显示logo
},
histories: [] as HistoryRecord[], //页面模式下的历史记录
selectedOption: 'whois', // 默认查询类型
domainSearch: '', // 域名搜索
timeZones: 'UTC+8', // 时区
}
},
actions: {
async webSiteConfigInit() {
try {
// @ts-ignore
const {data: webData} = await front.home.GetWebSiteConfig()
this.webSiteConfig = webData;
} catch (e) {
this.webSiteConfig = {} as WebSiteConfig;
}
},
// 设置历史记录
setHistories(histories: any) {
this.histories = histories
},
// 添加或更新历史记录
addOrUpdateHistory(newHistory: {
date: string;
path: any;
domain: any;
id: any;
type: string
}) {
const existingIndex = this.histories.findIndex(
history =>
history.domain === newHistory.domain
&& history.type === newHistory.type);
if (existingIndex !== -1) {
// 更新存在的记录的时间戳
this.histories[existingIndex].date = new Date().toISOString();
} else {
// 添加新记录之前,检查是否已达到保存记录的最大数量
if (this.histories.length >= 30) {
// 确保历史记录按时间降序排列
this.histories.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
// 移除最旧的记录
this.histories.pop();
}
// 添加新的记录
const record: HistoryRecord = {
...newHistory,
id: Date.now(),
date: new Date().toISOString(),
};
this.histories.unshift(record); // 添加到数组的开头
}
// 再次确保历史记录按时间降序排列
this.histories.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
},
deleteHistory(id: number) {
const index = this.histories.findIndex(history => history.id === id);
if (index !== -1) {
this.histories.splice(index, 1);
}
},
setSelectedOption(name: string) {
this.selectedOption = name;
},
setTimeZones(timeZones: string) {
this.timeZones = timeZones
},
},
getters: {
//是否显示历史记录
getIsDomainList: (state: any) => state.isObj.isDomainList,
//是否显示公告
getIsBulletin: (state: any) => state.isObj.isBulletin,
// 是否显示历史记录
getIsHistory: (state: any) => state.isObj.isHistory,
// 是否显示logo
getIsLogo: (state: any) => state.isObj.isLogo,
// 获取历史记录
getHistories(state) {
return state.histories
},
// 获取上次搜索的记录
getDomain(state: any) {
return state.domainSearch;
},
// 获取时区
getTimeZones(state) {
return state.timeZones
},
},
persist: {
// 持久化存储到 Cookie 中
storage: persistedState.cookiesWithOptions({
sameSite: 'strict',
}),
},
})
+64
View File
@@ -0,0 +1,64 @@
import {defineStore} from 'pinia'
import {front} from "~/apis/index";
export const useStyleStore = defineStore('useStyleStore', {
state: () => {
return {
common: {
primaryColor: '#316C72FF',
primaryColorHover: '#316C72E3',
primaryColorPressed: '#2B4C59FF',
primaryColorSuppl: '#316C72E3',
infoColor: '#2080F0FF',
infoColorHover: '#4098FCFF',
infoColorPressed: '#1060C9FF',
infoColorSuppl: '#4098FCFF',
successColor: '#18A058FF',
successColorHover: '#36AD6AFF',
successColorPressed: '#0C7A43FF',
successColorSuppl: '#36AD6AFF',
warningColor: '#F0A020FF',
warningColorHover: '#FCB040FF',
warningColorPressed: '#C97C10FF',
warningColorSuppl: '#FCB040FF',
errorColor: '#D03050FF',
errorColorHover: '#DE576DFF',
errorColorPressed: '#AB1F3FFF',
errorColorSuppl: '#DE576DFF',
},
}
},
actions: {
updatePrimaryColor(common: any) {
this.common.primaryColor = common.primaryColor;
this.common.primaryColorHover = common.primaryColorHover;
this.common.primaryColorPressed = common.primaryColorPressed;
this.common.primaryColorSuppl = common.primaryColorSuppl;
this.common.infoColor = common.infoColor;
this.common.infoColorHover = common.infoColorHover;
this.common.infoColorPressed = common.infoColorPressed;
this.common.infoColorSuppl = common.infoColorSuppl;
this.common.successColor = common.successColor;
this.common.successColorHover = common.successColorHover;
this.common.successColorPressed = common.successColorPressed;
this.common.successColorSuppl = common.successColorSuppl;
this.common.warningColor = common.warningColor;
this.common.warningColorHover = common.warningColorHover;
this.common.warningColorPressed = common.warningColorPressed;
this.common.warningColorSuppl = common.warningColorSuppl;
},
},
getters: {},
persist: {
storage: persistedState.cookiesWithOptions({
sameSite: 'strict',
}),
},
})
+31
View File
@@ -0,0 +1,31 @@
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{vue,js,ts,jsx,tsx}",
],
theme: {
screens: {
'sm': '640px',
// => @media (min-width: 640px) { ... }
'md': '768px',
// => @media (min-width: 768px) { ... }
'lg': '1024px',
// => @media (min-width: 1024px) { ... }
'xl': '1280px',
// => @media (min-width: 1280px) { ... }
'2xl': '1536px',
// => @media (min-width: 1536px) { ... }
},
extend: {},
},
plugins: [],
corePlugins: {
preflight: true,
},
darkMode: "class"
}
+4
View File
@@ -0,0 +1,4 @@
{
// https://nuxt.com/docs/guide/concepts/typescript
"extends": "./.nuxt/tsconfig.json"
}
+12
View File
@@ -0,0 +1,12 @@
// 定义表示单个选项的接口
interface SelectOption {
label: string;
value: string;
}
// 定义表示整个 JSON 对象的接口
interface WebSiteConfig {
logoLeftText: string;
logoRightText: string;
defaultSelectOptions: SelectOption[];
}
+36
View File
@@ -0,0 +1,36 @@
// 正则表达式用于匹配域名或IPv4地址
export const DomainRegex = /^(?!:\/\/)([a-zA-Z0-9]+\.)?[a-zA-Z0-9][a-zA-Z0-9-]+\.[a-zA-Z]{2,11}?$/;
export const Ipv4Regex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
export const ExtractDomain = (url: string) => {
try {
let hostname;
// 如果 URL 是一个有效的 URL,我们尝试从中获取主机名
if (url.startsWith('http://') || url.startsWith('https://')) {
const urlObj = new URL(url);
hostname = urlObj.hostname;
} else {
// 如果不是一个标准的 URL,我们假设它可能是一个域名
hostname = url;
}
// 移除 "www." 如果存在
hostname = hostname.replace(/^www\./, '');
// 处理子域的情况,只保留最后两部分,这对大多数通用顶级域名有效
const parts = hostname.split('.').reverse();
if (parts.length > 2) {
// 检查是否为已知的较长的TLD
if (parts[1].length < 3 || ['com', 'net', 'org'].includes(parts[1])) {
hostname = `${parts[2]}.${parts[1]}.${parts[0]}`;
} else {
hostname = `${parts[1]}.${parts[0]}`;
}
}
return hostname;
} catch (error) {
console.error('Invalid URL:', error);
return ''; // 返回一个空字符串表示 URL 或域名无效
}
};
+118
View File
@@ -0,0 +1,118 @@
/**********************************
* @FilePath: is.ts
* @Author: Ronnie Zhang
* @LastEditor: Ronnie Zhang
* @LastEditTime: 2023/12/04 22:45:32
* @Email: zclzone@outlook.com
* Copyright © 2023 Ronnie Zhang() | https://isme.top
**********************************/
const toString = Object.prototype.toString;
export function is(val: unknown, type: string): boolean {
return toString.call(val) === `[object ${type}]`;
}
export function isDef<T>(val: T): boolean {
return typeof val !== 'undefined';
}
export function isUndef<T>(val: T): boolean {
return typeof val === 'undefined';
}
export function isNull(val: unknown): val is null {
return val === null;
}
export function isWhitespace(val: unknown): val is '' {
return val === '';
}
export function isObject(val: unknown): boolean {
return !isNull(val) && is(val, 'Object');
}
export function isArray(val: unknown): val is Array<unknown> {
return Array.isArray(val);
}
export function isString(val: unknown): val is string {
return is(val, 'String');
}
export function isNumber(val: unknown): val is number {
return is(val, 'Number');
}
export function isBoolean(val: unknown): val is boolean {
return is(val, 'Boolean');
}
export function isDate(val: unknown): val is Date {
return is(val, 'Date');
}
export function isRegExp(val: unknown): val is RegExp {
return is(val, 'RegExp');
}
export function isFunction(val: unknown): val is Function {
return typeof val === 'function';
}
export function isPromise(val: unknown): val is Promise<unknown> {
return is(val, 'Promise') && isObject(val) && isFunction((val as Promise<unknown>).then) && isFunction((val as Promise<unknown>).catch);
}
export function isElement(val: unknown): val is Element {
return isObject(val) && !!((val as Element).tagName);
}
export function isWindow(val: unknown): boolean {
return typeof window !== 'undefined' && isDef(window) && is(val, 'Window');
}
export function isNullOrUndef(val: unknown): boolean {
return isNull(val) || isUndef(val);
}
export function isNullOrWhitespace(val: unknown): boolean {
return isNullOrUndef(val) || isWhitespace(val);
}
/** 空数组 | 空字符串 | 空对象 | 空Map | 空Set */
export function isEmpty(val: unknown): boolean {
if (isArray(val) || isString(val)) {
return val.length === 0;
}
if (val instanceof Map || val instanceof Set) {
return val.size === 0;
}
if (isObject(val)) {
// 使用类型断言确保val是一个对象
return Object.keys(val as Record<string, unknown>).length === 0;
}
return false;
}
export function ifNull<T>(val: T, def: T = '' as T): T {
return isNullOrWhitespace(val) ? def : val;
}
export function isUrl(path: string): boolean {
const reg =
/(((^https?:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
return reg.test(path);
}
export function isExternal(path: string): boolean {
return /^(https?:|mailto:|tel:)/.test(path);
}
export const isServer: boolean = typeof window === 'undefined';
export const isClient: boolean = !isServer;
+28
View File
@@ -0,0 +1,28 @@
// 定义一个函数来将单个UTC+8时间字符串转换为指定UTC偏移量的时间
export function AdjustTimeToUTCOffset(timestamp: string, utcOffset: string): string {
// 将时间字符串转换为Date对象
const date = new Date(timestamp);
let offsetInMillis = 0; // 默认偏移量为0毫秒
if (utcOffset !== "UTC") {
// 解析UTC偏移量(例如:"UTC+8"
const offsetPattern = /UTC([+-])(\d+):?(\d+)?/;
const match = offsetPattern.exec(utcOffset);
if (!match) {
throw new Error('Invalid UTC offset format');
}
const sign = match[1] === '+' ? 1 : -1; // 确定是加时区还是减时区
const hours = parseInt(match[2], 10); // 小时
const minutes = match[3] ? parseInt(match[3], 10) : 0; // 分钟,如果没有定义,则为0
offsetInMillis = sign * ((hours * 60 + minutes) * 60000); // 将偏移量转换为毫秒
}
// 计算并返回调整后的时间
const targetTime = new Date(date.getTime() + offsetInMillis);
// 返回调整后的时间的ISO字符串
return targetTime.toISOString();
}
+65
View File
@@ -0,0 +1,65 @@
interface WhoisInformation {
domainName?: string;
registryDomainID?: string;
registrarWHOISServer?: string;
registrarURL?: string;
updatedDate?: string;
creationDate?: string;
registryExpiryDate?: string;
registrar?: string;
registrarIANAID?: string;
domainStatus?: string[];
nameServers?: string[];
dnssec?: string;
icannWhoisInaccuracyComplaintFormURL?: string;
}
export function ParseWhois(whoisText: string): WhoisInformation {
const lines = whoisText.split('\n'); // 将文本分割成行
const info: WhoisInformation = {}; // 创建一个空对象来存储提取的信息
lines.forEach(line => {
const [key, value] = line.split(': ').map(part => part.trim());
switch (key) {
case 'Domain Name':
info.domainName = value;
break;
case 'Registry Domain ID':
info.registryDomainID = value;
break;
case 'Registrar WHOIS Server':
info.registrarWHOISServer = value;
break;
case 'Registrar URL':
info.registrarURL = value;
break;
case 'Updated Date':
info.updatedDate = value;
break;
case 'Creation Date':
info.creationDate = value;
break;
case 'Registry Expiry Date':
info.registryExpiryDate = value;
break;
case 'Registrar':
info.registrar = value;
break;
case 'Registrar IANA ID':
info.registrarIANAID = value;
break;
case 'Domain Status':
info.domainStatus = info.domainStatus ? [...info.domainStatus, value] : [value];
break;
case 'Name Server':
info.nameServers = info.nameServers ? [...info.nameServers, value] : [value];
break;
case 'DNSSEC':
info.dnssec = value;
break;
}
});
info.icannWhoisInaccuracyComplaintFormURL = "https://www.icann.org/wicf/";
return info;
}