|
87 | 87 | <div class="column is-12"> |
88 | 88 | <h1 class="title is-4">Recent History</h1> |
89 | 89 | </div> |
90 | | - <div class="column is-6-tablet" v-for="history in bHistory" :key="history.id"> |
91 | | - <div class="card" :class="{ 'is-success': history.watched }"> |
| 90 | + <div class="column is-6-tablet" v-for="item in bHistory" :key="item.id"> |
| 91 | + <div class="card" :class="{ 'is-success': item.watched }"> |
92 | 92 | <header class="card-header"> |
93 | 93 | <p class="card-header-title is-text-overflow pr-1"> |
94 | | - <NuxtLink :to="`/history/${history.id}`" v-text="makeName(history)"/> |
| 94 | + <NuxtLink :to="`/history/${item.id}`" v-text="makeName(item)"/> |
95 | 95 | </p> |
96 | | - <span class="card-header-icon"> |
97 | | - <span class="icon" v-if="'episode' === history.type"><i class="fas fa-tv"></i></span> |
| 96 | + <span class="card-header-icon" @click="item.showItem = !item.showItem"> |
| 97 | + <span class="icon" v-if="'episode' === item.type"><i class="fas fa-tv"></i></span> |
98 | 98 | <span class="icon" v-else><i class="fas fa-film"></i></span> |
99 | 99 | </span> |
100 | 100 | </header> |
|
104 | 104 | <span class="icon-text"> |
105 | 105 | <span class="icon"><i class="fas fa-calendar"></i> </span> |
106 | 106 | <span class="has-tooltip" |
107 | | - v-tooltip="`Updated at: ${moment.unix(history.updated_at ?? history.updated).format(TOOLTIP_DATE_FORMAT)}`"> |
108 | | - {{ moment.unix(history.updated_at ?? history.updated).fromNow() }} |
| 107 | + v-tooltip="`Updated at: ${moment.unix(item.updated_at ?? item.updated).format(TOOLTIP_DATE_FORMAT)}`"> |
| 108 | + {{ moment.unix(item.updated_at ?? item.updated).fromNow() }} |
109 | 109 | </span> |
110 | 110 | </span> |
111 | 111 | </div> |
112 | 112 | <div class="column is-4-tablet is-6-mobile has-text-right-mobile"> |
113 | 113 | <span class="icon-text"> |
114 | 114 | <span class="icon"><i class="fas fa-server"></i></span> |
115 | 115 | <span> |
116 | | - <NuxtLink :to="'/backend/'+history.via" v-text="history.via"/> |
| 116 | + <NuxtLink :to="'/backend/'+item.via" v-text="item.via"/> |
117 | 117 | </span> |
118 | 118 | </span> |
119 | 119 | </div> |
120 | 120 | <div class="column is-4-tablet is-12-mobile has-text-left-mobile"> |
121 | 121 | <span class="icon-text"> |
122 | 122 | <span class="icon"><i class="fas fa-envelope"></i></span> |
123 | | - <span>{{ history.event }}</span> |
| 123 | + <span>{{ item.event }}</span> |
124 | 124 | </span> |
125 | 125 | </div> |
126 | 126 | </div> |
127 | 127 | </div> |
128 | | - <div class="card-footer" v-if="history.progress"> |
| 128 | + <div class="card-content p-0 m-0" v-if="item?.showItem"> |
| 129 | + <div class="mt-2" style="position: relative; max-height: 343px; overflow-y: auto;"> |
| 130 | + <code class="is-terminal is-block is-pre-wrap" v-text="JSON.stringify(item, null, 2)"/> |
| 131 | + <button class="button m-4" v-tooltip="'Copy text'" style="position: absolute; top:0; right:0;" |
| 132 | + @click="() => copyText(JSON.stringify(item, null, 2))"> |
| 133 | + <span class="icon"><i class="fas fa-copy"/></span> |
| 134 | + </button> |
| 135 | + </div> |
| 136 | + </div> |
| 137 | + <div class="card-footer" v-if="item.progress"> |
129 | 138 | <div class="card-footer-item"> |
130 | | - <span class="has-text-success" v-if="history.watched">Played</span> |
| 139 | + <span class="has-text-success" v-if="item.watched">Played</span> |
131 | 140 | <span class="has-text-danger" v-else>Unplayed</span> |
132 | 141 | </div> |
133 | | - <div class="card-footer-item">{{ formatDuration(history.progress) }}</div> |
| 142 | + <div class="card-footer-item">{{ formatDuration(item.progress) }}</div> |
134 | 143 | </div> |
135 | 144 | </div> |
136 | 145 | </div> |
|
149 | 158 | <h1 class="title is-4">Basic info</h1> |
150 | 159 | </div> |
151 | 160 | <div class="column is-12"> |
152 | | - <div class="content"> |
153 | | - <code class="is-block is-pre-wrap" v-text="info"></code> |
| 161 | + <div class="mt-2" style="position: relative;"> |
| 162 | + <code class="is-terminal is-block is-pre-wrap" v-text="info"/> |
| 163 | + <button class="button m-4" v-tooltip="'Copy text'" style="position: absolute; top:0; right:0;" |
| 164 | + @click="() => copyText(JSON.stringify(info, null, 2))"> |
| 165 | + <span class="icon"><i class="fas fa-copy"/></span> |
| 166 | + </button> |
154 | 167 | </div> |
155 | 168 | </div> |
156 | 169 | </div> |
|
0 commit comments