Feat expiration date (#1296)
Closes #1287 Co-authored-by: Vadim Babadzhanyan <vadim.babadzhanyan@my.games>
This commit is contained in:
committed by
GitHub
parent
40af030266
commit
8145809e22
@@ -127,7 +127,7 @@
|
||||
</button>
|
||||
|
||||
<!-- New client -->
|
||||
<button @click="clientCreate = true; clientCreateName = '';"
|
||||
<button @click="clientCreate = true; clientCreateName = ''; clientExpiredDate = '';"
|
||||
class="hover:bg-red-800 hover:border-red-800 hover:text-white text-gray-700 dark:text-neutral-200 max-md:border-l-0 border-2 border-gray-100 dark:border-neutral-600 py-2 px-4 rounded-r-full md:rounded inline-flex items-center transition">
|
||||
<svg class="w-4 md:mr-2" inline xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor">
|
||||
@@ -259,6 +259,32 @@
|
||||
<div v-if="uiShowLinks" :ref="'client-' + client.id + '-hash'" class="text-gray-400 text-xs">
|
||||
<a :href="'./' + client.hash + ''">{{document.location.protocol}}//{{document.location.host}}/{{client.hash}}</a>
|
||||
</div>
|
||||
<!-- Expire Date -->
|
||||
<div v-show="enableExpireTime" class=" block md:inline-block pb-1 md:pb-0 text-gray-500 dark:text-neutral-400 text-xs">
|
||||
<span class="group">
|
||||
<!-- Show -->
|
||||
<input v-show="clientEditExpireDateId === client.id" v-model="clientEditExpireDate"
|
||||
v-on:keyup.enter="updateClientExpireDate(client, clientEditExpireDate); clientEditExpireDate = null; clientEditExpireDateId = null;"
|
||||
v-on:keyup.escape="clientEditExpireDate = null; clientEditExpireDateId = null;"
|
||||
:ref="'client-' + client.id + '-expire'"
|
||||
type="text"
|
||||
class="rounded border-2 dark:bg-neutral-700 border-gray-100 dark:border-neutral-600 focus:border-gray-200 dark:focus:border-neutral-500 outline-none w-70 text-black dark:text-neutral-300 dark:placeholder:text-neutral-500 text-xs p-0" />
|
||||
<span v-show="clientEditExpireDateId !== client.id"
|
||||
class="inline-block ">{{client.expiredAt | expiredDateFormat}}</span>
|
||||
|
||||
<!-- Edit -->
|
||||
<span v-show="clientEditExpireDateId !== client.id"
|
||||
@click="clientEditExpireDate = client.expiredAt ? client.expiredAt.toISOString().slice(0, 10) : 'yyyy-mm-dd'; clientEditExpireDateId = client.id; setTimeout(() => $refs['client-' + client.id + '-expire'][0].select(), 1);"
|
||||
class="cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity">
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-4 w-4 inline align-middle opacity-25 hover:opacity-100" fill="none"
|
||||
viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Info -->
|
||||
@@ -378,7 +404,7 @@
|
||||
<div v-if="clients && clients.length === 0">
|
||||
<p class="text-center m-10 text-gray-400 dark:text-neutral-400 text-sm">
|
||||
{{$t("noClients")}}<br /><br />
|
||||
<button @click="clientCreate = true; clientCreateName = '';"
|
||||
<button @click="clientCreate = true; clientCreateName = ''; clientExpiredDate = '';"
|
||||
class="bg-red-800 hover:bg-red-700 text-white border-2 border-none py-2 px-4 rounded inline-flex items-center transition">
|
||||
<svg class="w-4 mr-2" inline xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor">
|
||||
@@ -470,6 +496,16 @@
|
||||
type="text" v-model.trim="clientCreateName" :placeholder="$t('name')" />
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-2" v-show="enableExpireTime">
|
||||
<p class="text-sm text-gray-500">
|
||||
<label class="block text-gray-900 dark:text-neutral-200 text-sm font-bold mb-2" for="expireDate">
|
||||
{{$t("ExpireDate")}}
|
||||
</label>
|
||||
<input
|
||||
class="rounded p-2 border-2 dark:bg-neutral-700 dark:text-neutral-200 border-gray-100 dark:border-neutral-600 focus:border-gray-200 focus:dark:border-neutral-500 dark:placeholder:text-neutral-400 outline-none w-full"
|
||||
type="date" v-model.trim="clientExpiredDate" :placeholder="$t('expireDate')" name="expireDate"/>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user