]> source.dussan.org Git - nextcloud-server.git/commitdiff
enable deleting/configuring new tokens
authorRobin Appelman <icewind@owncloud.com>
Wed, 3 Aug 2016 14:24:12 +0000 (16:24 +0200)
committerRobin Appelman <robin@icewind.nl>
Wed, 16 Nov 2016 14:24:28 +0000 (15:24 +0100)
Signed-off-by: Robin Appelman <icewind@owncloud.com>
settings/Controller/AuthSettingsController.php
settings/css/settings.css
settings/js/authtoken_view.js

index f097abf910b35061e1f1d2b6414bacd75ebd941b..4e3d05a14e84666ed7edf9bc33c550d0c31096c9 100644 (file)
@@ -135,11 +135,13 @@ class AuthSettingsController extends Controller {
 
                $token = $this->generateRandomDeviceToken();
                $deviceToken = $this->tokenProvider->generateToken($token, $this->uid, $loginName, $password, $name, IToken::PERMANENT_TOKEN);
+               $tokenData = $deviceToken->jsonSerialize();
+               $tokenData['canDelete'] = true;
 
                return [
                        'token' => $token,
                        'loginName' => $loginName,
-                       'deviceToken' => $deviceToken
+                       'deviceToken' => $tokenData
                ];
        }
 
index 7eff9df1d975f2a5f26759657d2f979ae1bc4d83..4ef1f876a631c70defac40c3cc10c191836ddbf1 100644 (file)
@@ -172,14 +172,20 @@ table.nostyle td { padding: 0.2em 0; }
 }
 #sessions .token-list a.icon,
 #apppasswords .token-list a.icon {
-       display: block;
        opacity: 0.6;
        margin-top: 4px;
+       display: none;
+}
+
+#sessions .token-list tr:hover a.icon,
+#apppasswords .token-list tr:hover a.icon {
+       display: block;
 }
 
 #sessions .token-list td div.configure,
 #apppasswords .token-list td div.configure {
        display: none;
+       height: 18px;
 }
 
 #sessions .token-list tr.active div.configure,
index 54561ffd1e34b83648787fd9c6deb3cb04c9e3bb..7ba3ce0b924b4a1f274c66ae4678d378bbd53e43 100644 (file)
@@ -81,7 +81,7 @@
 
                        var list = this.$('.token-list');
                        var tokens = this.collection.filter(function (token) {
-                               return parseInt(token.get('type'), 10) === _this.type;
+                               return token.get('type') === _this.type;
                        });
                        list.html('');
 
                        var ts = viewData.lastActivity * 1000;
                        viewData.lastActivity = OC.Util.relativeModifiedDate(ts);
                        viewData.lastActivityTime = OC.Util.formatDate(ts, 'LLL');
-                       viewData.canScope = token.get('type') === '1';
+                       viewData.canScope = token.get('type') === 1;
 
                        // preserve title for cases where we format it further
                        viewData.title = viewData.name;