Любимые страницы
This commit is contained in:
1 parent
1b1220b9e7
commit
e1e41d9256
3 files changed
+42
-13
No files matched your search
@@ -57,11 +57,37 @@
|
||||
<v-row class="flex-grow-0">
|
||||
<v-col class="pa-1">
|
||||
<v-card class="flex-colmn">
|
||||
<v-btn-toggle
|
||||
<v-sheet
|
||||
class="mx-auto "
|
||||
:class="favorit.length>10?'mx-n3':''"
|
||||
max-width="800"
|
||||
>
|
||||
<v-slide-group
|
||||
show-arrows
|
||||
>
|
||||
<v-slide-group-item
|
||||
v-for="x in favorit"
|
||||
:key="x"
|
||||
>
|
||||
<v-btn-toggle
|
||||
v-model="toggle"
|
||||
divided
|
||||
variant="outlined"
|
||||
>
|
||||
<v-btn
|
||||
:icon="x.pages__ico"
|
||||
:to="x.pages__fullPath"
|
||||
/>
|
||||
</v-btn-toggle>
|
||||
</v-slide-group-item>
|
||||
</v-slide-group>
|
||||
</v-sheet>
|
||||
<!-- <v-btn-toggle
|
||||
v-model="toggle"
|
||||
divided
|
||||
variant="outlined"
|
||||
>
|
||||
|
||||
<v-tooltip
|
||||
v-for="x in favorit"
|
||||
:key="x"
|
||||
@@ -76,7 +102,7 @@
|
||||
/>
|
||||
</template>
|
||||
</v-tooltip>
|
||||
</v-btn-toggle>
|
||||
</v-btn-toggle> -->
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -128,15 +154,16 @@
|
||||
|
||||
onMounted(() => {
|
||||
favoritLinks()
|
||||
|
||||
})
|
||||
|
||||
const favoritLinks = () => {
|
||||
|
||||
|
||||
// axiosApiInstance.get(`api/watcher/selectedlinks/`)
|
||||
// .then(data => {
|
||||
// favorit.value = data.data
|
||||
// })
|
||||
axiosApiInstance.get(`api/watcher/selectedlinks/`)
|
||||
.then(data => {
|
||||
favorit.value = data.data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ from .views import *
|
||||
|
||||
urlpatterns = [
|
||||
path('counter/', Counter.as_view(),name="CountVisitors"),
|
||||
# path('selectedlinks/', SelectedLinksAPIView.as_view(),name="SelectedLinks")
|
||||
path('selectedlinks/', SelectedLinksAPIView.as_view(),name="SelectedLinks")
|
||||
# path('', views.Watchuser.as_view()), selectedlinks
|
||||
|
||||
|
||||
|
||||
@@ -63,13 +63,15 @@ class Counter(ListAPIView):
|
||||
|
||||
return Response(res)
|
||||
|
||||
# class SelectedLinksAPIView(ListAPIView):
|
||||
class SelectedLinksAPIView(ListAPIView):
|
||||
|
||||
# def get(self, request):
|
||||
# user = User.objects.get(username=self.request.user)
|
||||
# res = CountVisitor.objects.values('page','fullPath','ico').filter(user_id=user).annotate(Sum('count')).exclude(fullPath='/')
|
||||
# sort = res.order_by('-count__sum')[:20]
|
||||
def get(self, request):
|
||||
user = User.objects.get(username=self.request.user)
|
||||
res = CountVisitor.objects.values('pages__page','pages__fullPath','pages__ico').filter(user_id=user).annotate(Sum('count')).exclude(pages__fullPath='/')
|
||||
# res = CountVisitor.objects.values('pages__page','pages__fullPath','pages__ico').filter(user_id=user).annotate(Sum('count')).exclude(fullPath='/')
|
||||
|
||||
sort = res.order_by('-count__sum')[:20]
|
||||
|
||||
|
||||
# return Response(sort)
|
||||
return Response(sort)
|
||||
|
||||
Reference in new issue
Block a user