This commit is contained in:
Liyas Thomas
2020-09-14 15:09:44 +05:30
parent 81e638a7e0
commit d9f78b9d5c

View File

@@ -2,13 +2,22 @@
<pw-section class="green" icon="history" :label="$t('history')" ref="history"> <pw-section class="green" icon="history" :label="$t('history')" ref="history">
<div class="show-on-large-screen"> <div class="show-on-large-screen">
<input aria-label="Search" type="search" :placeholder="$t('search')" v-model="filterText" /> <input aria-label="Search" type="search" :placeholder="$t('search')" v-model="filterText" />
<button class="icon"> <!-- <button class="icon">
<i class="material-icons">search</i> <i class="material-icons">search</i>
</button> </button> -->
</div> </div>
<div class="virtual-list" :class="{ filled: filteredHistory.length }"> <div class="virtual-list" :class="{ filled: filteredHistory.length }">
<ul v-for="(entry, index) in filteredHistory" :key="index" class="entry"> <ul v-for="(entry, index) in filteredHistory" :key="index" class="entry">
<div class="show-on-large-screen"> <div class="show-on-large-screen">
<button
class="icon"
:id="'use-button#' + index"
@click="useHistory(entry)"
:aria-label="$t('edit')"
v-tooltip="$t('restore')"
>
<i class="material-icons">restore</i>
</button>
<button <button
class="icon" class="icon"
:class="{ stared: entry.star }" :class="{ stared: entry.star }"
@@ -21,47 +30,28 @@
{{ entry.star ? "star" : "star_border" }} {{ entry.star ? "star" : "star_border" }}
</i> </i>
</button> </button>
<li> <li class="method-list-item">
<input <input
:aria-label="$t('label')" :aria-label="$t('method')"
type="text" type="text"
readonly readonly
:value="entry.label" :value="`${entry.method} ${entry.status}`"
:placeholder="$t('no_label')" :class="findEntryStatus(entry).className"
:style="{ '--status-code': entry.status }"
class="bg-color" class="bg-color"
/> />
<!-- <span
class="entry-status-code"
:class="findEntryStatus(entry).className"
:style="{ '--status-code': entry.status }"
>{{ entry.status }}</span
> -->
</li> </li>
<!-- <li>
<button
class="icon"
v-tooltip="{
content: !entry.usesScripts
? 'No pre-request script'
: 'Used pre-request script'
}"
>
<i class="material-icons">
{{ !entry.usesScripts ? "http" : "code" }}
</i>
</button>
</li> -->
<v-popover> <v-popover>
<button class="tooltip-target icon" v-tooltip="$t('options')"> <button class="tooltip-target icon" v-tooltip="$t('options')">
<i class="material-icons">more_vert</i> <i class="material-icons">more_vert</i>
</button> </button>
<template slot="popover"> <template slot="popover">
<div>
<button
class="icon"
:id="'use-button#' + index"
@click="useHistory(entry)"
:aria-label="$t('edit')"
v-close-popover
>
<i class="material-icons">restore</i>
<span>{{ $t("restore") }}</span>
</button>
</div>
<div> <div>
<button <button
class="icon" class="icon"
@@ -76,36 +66,45 @@
</div> </div>
</template> </template>
</v-popover> </v-popover>
</div> <!-- <li class="method-list-item">
<div class="show-on-large-screen">
<li class="method-list-item">
<input <input
:aria-label="$t('method')" :aria-label="$t('label')"
type="text" type="text"
readonly readonly
:value="entry.method" :value="entry.label"
:class="findEntryStatus(entry).className" :placeholder="$t('no_label')"
:style="{ '--status-code': entry.status }" class="bg-color"
/> />
<span </li> -->
class="entry-status-code" <!-- <li>
:class="findEntryStatus(entry).className" <button
:style="{ '--status-code': entry.status }" class="icon"
>{{ entry.status }}</span v-tooltip="{
content: !entry.usesScripts
? 'No pre-request script'
: 'Used pre-request script'
}"
> >
</li> <i class="material-icons">
{{ !entry.usesScripts ? "http" : "code" }}
</i>
</button>
</li> -->
</div> </div>
<!-- <div class="show-on-large-screen">
</div> -->
<div class="show-on-large-screen"> <div class="show-on-large-screen">
<li> <li>
<input <input
:aria-label="$t('url')" :aria-label="$t('url')"
type="text" type="text"
readonly readonly
:value="entry.url" :value="`${entry.url}${entry.path}`"
:placeholder="$t('no_url')" :placeholder="$t('no_url')"
class="bg-color"
/> />
</li> </li>
<li> <!-- <li>
<input <input
:aria-label="$t('path')" :aria-label="$t('path')"
type="text" type="text"
@@ -113,7 +112,7 @@
:value="entry.path" :value="entry.path"
:placeholder="$t('no_path')" :placeholder="$t('no_path')"
/> />
</li> </li> -->
</div> </div>
<transition name="fade"> <transition name="fade">
<div v-if="showMore" class="show-on-large-screen"> <div v-if="showMore" class="show-on-large-screen">
@@ -349,7 +348,7 @@ export default {
value = typeof value !== "string" ? value.toString() : value value = typeof value !== "string" ? value.toString() : value
return value.toLowerCase().includes(filterText) return value.toLowerCase().includes(filterText)
}) })
}) }).reverse()
}, },
}, },
methods: { methods: {