Skip to content
Snippets Groups Projects
Verified Commit 227b7e6b authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Zobrazovani titulku

parent 936de2fe
Branches
No related tags found
No related merge requests found
Pipeline #13238 passed
2.6.6
2.7.0
......@@ -32,9 +32,8 @@
<thead>
<tr>
<th class="text-left">Zkratka</th>
<th class="text-left">Přidano</th>
<th class="text-left">URL</th>
<th class="text-left">Přesměrování</th>
<th class="text-left">Přidáno</th>
<th class="text-left">Stránka</th>
<th class="text-left">Kliky</th>
<th class="text-left"></th>
</tr>
......@@ -43,8 +42,9 @@
<tr v-for="shortcut in shortcuts" >
<td v-bind:title="shortcut.title" class="text-bold w-32" @click="showInfo(shortcut)" >{{shortcut.shortcut}}</td>
<td class="text-bold w-32" @click="showInfo(shortcut)" >{{ formatTimestamp(shortcut.created) }}</td>
<td v-bind:title="shortcut.title" @click="showInfo(shortcut)" >{{ stripURL(shortcut.url) }}</td>
<td class="w-24" @click="showInfo(shortcut)">{{ shortcut.code == 301 ? '301 trvalé' : '302 dočasné'}}</td>
<td v-bind:title="shortcut.title" @click="showInfo(shortcut)" >{{ strip(shortcut.url, 64) }}
<div class="text-xs text-grey-200 pt-1">{{ strip(shortcut.title, 72) }}</div>
</td>
<td class="w-16 text-right" @click="showInfo(shortcut)">{{shortcut.counter}}</td>
<td class="w-40">
<i class="ico--link cursor-pointer mx-1" @click="showInfo(shortcut)" title="Zkopirovat odkaz"></i>
......@@ -152,7 +152,6 @@
</div>
<script type="module">
const MAX_URL_LENGTH = 50;
const BASE_URL = "/api/shortcuts";
const API_HEADERS = {
"Content-Type": "application/json",
......@@ -249,11 +248,11 @@
})
},
stripURL: function(url) {
if ( url.length > MAX_URL_LENGTH ) {
url = url.substring(0, MAX_URL_LENGTH) + '...';
strip: function(text, size) {
if ( typeof text === "string" && text.length > size ) {
text = text.substring(0, size) + '...';
}
return url;
return text;
},
formatTimestamp: function(timestamp) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment