Любимые страницы
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-row class="flex-grow-0">
|
||||||
<v-col class="pa-1">
|
<v-col class="pa-1">
|
||||||
<v-card class="flex-colmn">
|
<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"
|
v-model="toggle"
|
||||||
divided
|
divided
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
>
|
>
|
||||||
|
|
||||||
<v-tooltip
|
<v-tooltip
|
||||||
v-for="x in favorit"
|
v-for="x in favorit"
|
||||||
:key="x"
|
:key="x"
|
||||||
@@ -76,7 +102,7 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</v-tooltip>
|
</v-tooltip>
|
||||||
</v-btn-toggle>
|
</v-btn-toggle> -->
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -128,15 +154,16 @@
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
favoritLinks()
|
favoritLinks()
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const favoritLinks = () => {
|
const favoritLinks = () => {
|
||||||
|
|
||||||
|
|
||||||
// axiosApiInstance.get(`api/watcher/selectedlinks/`)
|
axiosApiInstance.get(`api/watcher/selectedlinks/`)
|
||||||
// .then(data => {
|
.then(data => {
|
||||||
// favorit.value = data.data
|
favorit.value = data.data
|
||||||
// })
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ from .views import *
|
|||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('counter/', Counter.as_view(),name="CountVisitors"),
|
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
|
# path('', views.Watchuser.as_view()), selectedlinks
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -63,13 +63,15 @@ class Counter(ListAPIView):
|
|||||||
|
|
||||||
return Response(res)
|
return Response(res)
|
||||||
|
|
||||||
# class SelectedLinksAPIView(ListAPIView):
|
class SelectedLinksAPIView(ListAPIView):
|
||||||
|
|
||||||
# def get(self, request):
|
def get(self, request):
|
||||||
# user = User.objects.get(username=self.request.user)
|
user = User.objects.get(username=self.request.user)
|
||||||
# res = CountVisitor.objects.values('page','fullPath','ico').filter(user_id=user).annotate(Sum('count')).exclude(fullPath='/')
|
res = CountVisitor.objects.values('pages__page','pages__fullPath','pages__ico').filter(user_id=user).annotate(Sum('count')).exclude(pages__fullPath='/')
|
||||||
# sort = res.order_by('-count__sum')[:20]
|
# 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