Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const monitorData = useState<MonitorInfo[]>('monitorData')
const { locale } = useI18n()

const echartsLocale = computed(() => {
if (locale.value === 'zh-cn') return 'ZH'
if (locale.value.startsWith('zh')) return 'ZH'
return 'EN'
})

Expand Down
7 changes: 3 additions & 4 deletions app/components/AppFooter.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<script lang="ts" setup>
const { t } = useI18n()
const localePath = useLocalePath()

const currentYear = new Date().getFullYear()


</script>

<template>
Expand All @@ -23,7 +20,9 @@ const currentYear = new Date().getFullYear()
</div>
</div>

<div class="mt-6 flex flex-col gap-2 pt-4 text-xs text-[--color-text-3] sm:flex-row sm:items-center sm:justify-between">
<div
class="mt-6 flex flex-col gap-2 pt-4 text-xs text-[--color-text-3] sm:flex-row sm:items-center sm:justify-between"
>
<p>
Copyright &copy; {{ currentYear }}
<ALink target="_blank" href="https://github.com/ikxin/kms-tools">
Expand Down
2 changes: 1 addition & 1 deletion app/components/CommonActivate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ watch(
watch(
() => locale.value,
val => {
if (val === 'zh-cn') {
if (val.startsWith('zh')) {
rankVal.value = 2
} else {
rankVal.value = 1
Expand Down
135 changes: 74 additions & 61 deletions app/pages/activate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,25 @@ const { t } = useI18n()
const path = computed(() => route.path.slice(1).split('/'))

const drawerVisible = ref(false)
const isDesktop = useMediaQuery('(min-width: 768px)')

if (!path.value.at(-1)) {
navigateTo(localePath('/activate/windows'))
}

watch(
isDesktop,
value => {
if (value) {
drawerVisible.value = false
}
},
{
immediate: true,
flush: 'post'
}
)

watch(
() => route.path,
() => {
Expand All @@ -35,68 +49,69 @@ function handleRainyunAdClick() {

<template>
<!-- Mobile: floating left-edge tab -->
<div
v-show="!drawerVisible"
class="fixed left-0 top-1/3 z-[100] -translate-y-1/2 cursor-pointer rounded-r-lg bg-[rgb(var(--primary-6))] px-1 py-4 text-white shadow-lg md:hidden"
@click="drawerVisible = true"
>
<Icon name="material-symbols:chevron-right" class="text-base" />
</div>

<!-- Mobile: left-side drawer -->
<ADrawer
v-model:visible="drawerVisible"
placement="left"
:width="240"
:title="t('label.activate')"
:footer="false"
>
<AMenu
:selected-keys="path"
:default-open-keys="['system', 'software']"
class="select-none !border-none [&_.arco-menu-icon>i]:inline-block"
<template v-if="!isDesktop">
<div
v-show="!drawerVisible"
class="fixed left-0 top-1/3 z-[100] -translate-y-1/2 cursor-pointer rounded-r-lg bg-[rgb(var(--primary-6))] px-1 py-4 text-white shadow-lg md:hidden"
@click="drawerVisible = true"
>
<ASubMenu key="system">
<template #icon><Icon name="icons:system" /></template>
<template #title>{{ t('label.system') }}</template>
<AMenuItem key="windows" @click="handleMenuClick('windows')">
<template #icon><Icon name="icons:windows" /></template>
Windows
</AMenuItem>
<AMenuItem
key="windows-server"
@click="handleMenuClick('windows-server')"
>
<template #icon><Icon name="icons:windows-server" /></template>
Windows Server
</AMenuItem>
</ASubMenu>
<ASubMenu key="software">
<template #icon><Icon name="icons:software" /></template>
<template #title>{{ t('label.software') }}</template>
<AMenuItem key="office" @click="handleMenuClick('office')">
<template #icon><Icon name="icons:office" /></template>
Office
</AMenuItem>
</ASubMenu>
</AMenu>
<Icon name="material-symbols:chevron-right" class="text-base" />
</div>

<div
class="hover:bg-[var(--color-fill-2)]/50 group relative mt-4 flex rounded-lg bg-[var(--color-bg-2)] p-2 ring-1 ring-[var(--color-border)] transition"
<!-- Mobile: left-side drawer -->
<ADrawer
v-model:visible="drawerVisible"
placement="left"
:width="240"
:title="t('label.activate')"
:footer="false"
unmount-on-close
>
<button
type="button"
class="flex w-full flex-col items-start gap-y-2 text-left"
@click="handleRainyunAdClick"
<AMenu
:selected-keys="path"
:default-open-keys="['system', 'software']"
class="select-none !border-none [&_.arco-menu-icon>i]:inline-block"
>
<img
src="/images/rainyun_1.png"
alt="RainYun"
class="h-auto w-full rounded-md object-cover"
/>
</button>
</div>
</ADrawer>
<ASubMenu key="system">
<template #icon><Icon name="icons:system" /></template>
<template #title>{{ t('label.system') }}</template>
<AMenuItem key="windows" @click="handleMenuClick('windows')">
<template #icon><Icon name="icons:windows" /></template>
Windows
</AMenuItem>
<AMenuItem
key="windows-server"
@click="handleMenuClick('windows-server')"
>
<template #icon><Icon name="icons:windows-server" /></template>
Windows Server
</AMenuItem>
</ASubMenu>
<ASubMenu key="software">
<template #icon><Icon name="icons:software" /></template>
<template #title>{{ t('label.software') }}</template>
<AMenuItem key="office" @click="handleMenuClick('office')">
<template #icon><Icon name="icons:office" /></template>
Office
</AMenuItem>
</ASubMenu>
</AMenu>

<div class="group relative flex rounded-md transition">
<button
type="button"
class="flex w-full flex-col items-start gap-y-2 text-left"
@click="handleRainyunAdClick"
>
<img
src="/images/rainyun_1.png"
alt="RainYun"
class="h-auto w-full rounded-md object-cover"
/>
</button>
</div>
</ADrawer>
</template>

<!-- Mobile: page content -->
<div class="flex w-full flex-col gap-4 md:hidden">
Expand Down Expand Up @@ -150,9 +165,7 @@ function handleRainyunAdClick() {
</AMenu>

<div class="p-2 pt-0">
<div
class="hover:bg-[var(--color-fill-2)]/50 group relative flex rounded-lg bg-[var(--color-bg-2)] p-2 ring-1 ring-[var(--color-border)] transition"
>
<div class="group relative flex rounded-md transition">
<button
type="button"
class="flex w-full flex-col items-start gap-y-2 text-left"
Expand Down
48 changes: 34 additions & 14 deletions app/pages/check/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ type ParsedOutput = {

const requestParamLabelMap: Record<string, string> = {
'Protocol version': 'pages.check.result.request-params.protocol-version',
'Client is a virtual machine': 'pages.check.result.request-params.client-is-vm',
'Client is a virtual machine':
'pages.check.result.request-params.client-is-vm',
'Licensing status': 'pages.check.result.request-params.licensing-status',
'Remaining time (0 = forever)': 'pages.check.result.request-params.remaining-time',
'Remaining time (0 = forever)':
'pages.check.result.request-params.remaining-time',
'Application ID': 'pages.check.result.request-params.application-id',
'SKU ID (aka Activation ID)': 'pages.check.result.request-params.sku-id',
'KMS ID (aka KMS counted ID)': 'pages.check.result.request-params.kms-id',
Expand All @@ -58,7 +60,8 @@ const requestParamLabelMap: Record<string, string> = {
}

const responseParamLabelMap: Record<string, string> = {
'Size of KMS Response': 'pages.check.result.response-params.kms-response-size',
'Size of KMS Response':
'pages.check.result.response-params.kms-response-size',
'KMS ePID': 'pages.check.result.response-params.kms-epid',
'KMS HwId': 'pages.check.result.response-params.kms-hwid',
'Client machine ID': 'pages.check.result.response-params.client-machine-id',
Expand Down Expand Up @@ -126,7 +129,10 @@ const parsedOutput = computed<ParsedOutput>(() => {
const rpcLines =
rpcStart >= 0
? lines
.slice(rpcStart, responseStart > rpcStart ? responseStart : lines.length)
.slice(
rpcStart,
responseStart > rpcStart ? responseStart : lines.length
)
.filter(line => line.trim())
: []

Expand Down Expand Up @@ -280,7 +286,9 @@ const handleSubmit = async (data: {
resultInfo.visible = true
resultInfo.loading = false
} catch (err) {
resultInfo.message = String(err || t('pages.check.result.unknown-request-error'))
resultInfo.message = String(
err || t('pages.check.result.unknown-request-error')
)
resultInfo.type = 'error'
resultInfo.visible = true
resultInfo.loading = false
Expand Down Expand Up @@ -341,7 +349,9 @@ const handleSubmit = async (data: {
: 'border-[rgb(var(--primary-6))] bg-[rgb(var(--primary-1))]'
"
>
<div class="flex flex-col gap-3 md:flex-row md:items-center md:justify-between">
<div
class="flex flex-col gap-3 md:flex-row md:items-center md:justify-between"
>
<div class="flex min-w-0 flex-col gap-1">
<div class="flex items-center gap-2">
<Icon
Expand All @@ -354,22 +364,28 @@ const handleSubmit = async (data: {
"
class="text-lg"
/>
<span class="text-base font-semibold text-[var(--color-text-1)]">
<span
class="text-base font-semibold text-[var(--color-text-1)]"
>
{{ statusMeta.title }}
</span>
</div>
<span class="text-sm text-[var(--color-text-2)]">{{ statusMeta.desc }}</span>
<span class="text-sm text-[var(--color-text-2)]">{{
statusMeta.desc
}}</span>
</div>
<ATag bordered :color="statusMeta.color">{{ resultInfo.type.toUpperCase() }}</ATag>
<ATag bordered :color="statusMeta.color">{{
resultInfo.type.toUpperCase()
}}</ATag>
</div>

<div
v-if="parsedOutput.connectionLine"
class="mt-3 rounded bg-[var(--color-fill-2)] px-3 py-2 font-mono text-xs text-[var(--color-text-2)]"
>
<span class="mr-1 text-[var(--color-text-3)]">{{
t('pages.check.result.connection-title')
}}:</span>
<span class="mr-1 text-[var(--color-text-3)]"
>{{ t('pages.check.result.connection-title') }}:</span
>
{{ parsedOutput.connectionLine }}
</div>
</ACard>
Expand Down Expand Up @@ -445,7 +461,8 @@ const handleSubmit = async (data: {
>
<pre
class="max-h-72 overflow-auto whitespace-pre rounded bg-[var(--color-fill-1)] p-3 font-mono text-xs leading-5 text-[var(--color-text-2)]"
>{{ rpcText }}</pre>
>{{ rpcText }}</pre
>
</ACard>

<ACollapse>
Expand All @@ -454,7 +471,10 @@ const handleSubmit = async (data: {
:header="t('pages.check.result.raw-title')"
class="overflow-hidden [&_.arco-collapse-item-content]:bg-[var(--color-bg-2)] [&_.arco-collapse-item-content]:px-4 [&_.arco-collapse-item-content]:py-3"
>
<pre class="max-h-72 overflow-auto whitespace-pre rounded bg-[var(--color-fill-1)] p-3 font-mono text-xs leading-5 text-[var(--color-text-2)]">{{ rawOutputText }}</pre>
<pre
class="max-h-72 overflow-auto whitespace-pre rounded bg-[var(--color-fill-1)] p-3 font-mono text-xs leading-5 text-[var(--color-text-2)]"
>{{ rawOutputText }}</pre
>
</ACollapseItem>
</ACollapse>
</div>
Expand Down
3 changes: 2 additions & 1 deletion app/pages/monitor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const monitorData = useState<MonitorInfo[]>('monitorData')
const { t, locale } = useI18n()

const timeLocale = computed(() => {
if (locale.value === 'zh-cn') return 'zh-CN'
if (locale.value === 'zh-tw') return 'zh-TW'
if (locale.value.startsWith('zh')) return 'zh-CN'
return 'en-US'
})

Expand Down
Loading
Loading