Skip to content

Commit 07e91d2

Browse files
authored
Merge pull request nextcloud#7754 from pierlon/master
Add icons to devices/sessions
2 parents cd2e5b5 + 05d8537 commit 07e91d2

File tree

7 files changed

+56
-2
lines changed

7 files changed

+56
-2
lines changed

core/css/icons.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,20 @@ img, object, video, button, textarea, input, select, div[contenteditable=true] {
516516
background-image: url('../img/places/picture.svg?v=1');
517517
}
518518

519+
/* CLIENTS ------------------------------------------------------------------- */
520+
521+
.icon-desktop {
522+
background-image: url('../img/clients/desktop.svg?v=1');
523+
}
524+
525+
.icon-phone {
526+
background-image: url('../img/clients/phone.svg?v=1');
527+
}
528+
529+
.icon-tablet {
530+
background-image: url('../img/clients/tablet.svg?v=1');
531+
}
532+
519533
/* APP CATEGORIES ------------------------------------------------------------------- */
520534
.icon-category-installed {
521535
background-image: url('../img/actions/user.svg?v=1');

core/img/clients/desktop.svg

Lines changed: 1 addition & 0 deletions
Loading

core/img/clients/phone.svg

Lines changed: 1 addition & 0 deletions
Loading

core/img/clients/tablet.svg

Lines changed: 1 addition & 0 deletions
Loading

settings/css/settings.scss

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,23 @@ table.nostyle {
329329
}
330330
}
331331
.token-list td {
332-
&.more {
332+
&%icon {
333333
overflow: visible;
334334
position: relative;
335335
width: 16px;
336336
}
337+
&.more {
338+
@extend %icon;
339+
}
340+
&.client {
341+
@extend %icon;
342+
343+
div {
344+
opacity: 0.57;
345+
width: inherit;
346+
padding-top: 5px;
347+
}
348+
}
337349
border-top: 1px solid #DDD;
338350
text-overflow: ellipsis;
339351
max-width: 200px;
@@ -342,7 +354,7 @@ table.nostyle {
342354
vertical-align: top;
343355
position: relative;
344356
}
345-
tr > *:nth-child(2) {
357+
tr > *:nth-child(3) {
346358
text-align: right;
347359
}
348360
.token-list {

settings/js/authtoken_view.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727

2828
var TEMPLATE_TOKEN =
2929
'<tr data-id="{{id}}">'
30+
+ '<td class="client">'
31+
+ '<div class="{{icon}}" />'
32+
+ '</td>'
3033
+ '<td class="has-tooltip" title="{{title}}">'
3134
+ '<span class="token-name">{{name}}</span>'
3235
+ '</td>'
@@ -146,6 +149,22 @@
146149
sailfishBrowser: 'SailfishBrowser'
147150
};
148151

152+
var iconMap = {
153+
ie: 'icon-desktop',
154+
edge: 'icon-desktop',
155+
firefox: 'icon-desktop',
156+
chrome: 'icon-desktop',
157+
safari: 'icon-desktop',
158+
androidChrome: 'icon-phone',
159+
iphone: 'icon-phone',
160+
ipad: 'icon-tablet',
161+
iosClient: 'icon-phone',
162+
androidClient: 'icon-phone',
163+
davDroid: 'icon-phone',
164+
webPirate: 'icon-link',
165+
sailfishBrowser: 'icon-link'
166+
};
167+
149168
if (matches) {
150169
viewData.name = t('settings', 'Sync client - {os}', {
151170
os: matches[1],
@@ -161,6 +180,11 @@
161180
} else {
162181
viewData.name = nameMap[client];
163182
}
183+
184+
// update title - for easier view
185+
viewData.title = viewData.name;
186+
187+
viewData.icon = iconMap[client];
164188
}
165189
}
166190
if (viewData.current) {

settings/templates/settings/personal/security.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<table class="icon-loading">
3838
<thead class="token-list-header">
3939
<tr>
40+
<th></th>
4041
<th><?php p($l->t('Device'));?></th>
4142
<th><?php p($l->t('Last activity'));?></th>
4243
<th></th>

0 commit comments

Comments
 (0)