summaryrefslogtreecommitdiffstats
path: root/settings/src
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-05-17 09:49:47 +0200
committerJulius Härtl <jus@bitgrid.net>2019-05-22 11:48:06 +0200
commit738ab1a0a0996f0f2757a7b8d7fb7f2ba98ad7c3 (patch)
treee92c55efaa3fd46420e5ca073e76bd69cf74c797 /settings/src
parentc9fbd9212cb2a213f367b4b018b476741629b16a (diff)
downloadnextcloud-server-738ab1a0a0996f0f2757a7b8d7fb7f2ba98ad7c3.tar.gz
nextcloud-server-738ab1a0a0996f0f2757a7b8d7fb7f2ba98ad7c3.zip
Bump settings
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'settings/src')
-rw-r--r--settings/src/components/AuthToken.vue384
-rw-r--r--settings/src/views/Apps.vue37
-rw-r--r--settings/src/views/Users.vue34
3 files changed, 238 insertions, 217 deletions
diff --git a/settings/src/components/AuthToken.vue b/settings/src/components/AuthToken.vue
index 44365b5f4db..ef54b6d2d2f 100644
--- a/settings/src/components/AuthToken.vue
+++ b/settings/src/components/AuthToken.vue
@@ -21,7 +21,7 @@
<template>
<tr :data-id="token.id"
- :class="{wiping}">
+ :class="wiping">
<td class="client">
<div :class="iconName.icon"></div>
</td>
@@ -41,214 +41,216 @@
<span class="last-activity" v-tooltip="lastActivity">{{lastActivityRelative}}</span>
</td>
<td class="more">
- <Action v-if="!token.current"
- :actions="actions"
- v-bind:open.sync="actionOpen"
- v-tooltip="{content: t('settings', 'Device settings'), container: 'body'}"
- tabindex="0"/>
+ <Actions v-if="!token.current"
+ :actions="actions"
+ :open.sync="actionOpen"
+ v-tooltip.auto="{
+ content: t('settings', 'Device settings'),
+ container: 'body'
+ }">
+ <ActionCheckbox v-if="token.type === 1"
+ :checked="token.scope.filesystem"
+ @change.stop.prevent="$emit('toggleScope', token, 'filesystem', !token.scope.filesystem)">
+ <!-- TODO: add text/longtext with some description -->
+ {{ t('settings', 'Allow filesystem access') }}
+ </ActionCheckbox>
+ <ActionButton v-if="token.canRename"
+ icon="icon-rename"
+ @click.stop.prevent="startRename">
+ <!-- TODO: add text/longtext with some description -->
+ {{ t('settings', 'Rename') }}
+ </ActionButton>
+
+ <!-- revoke & wipe -->
+ <template v-if="token.canDelete">
+ <template v-if="token.type !== 2">
+ <ActionButton icon="icon-delete"
+ @click.stop.prevent="revoke">
+ <!-- TODO: add text/longtext with some description -->
+ {{ t('settings', 'Revoke') }}
+ </ActionButton>
+ <ActionButton icon="icon-delete"
+ @click.stop.prevent="wipe">
+ {{ t('settings', 'Wipe device') }}
+ </ActionButton>
+ </template>
+ <ActionButton v-else-if="token.type === 2"
+ icon="icon-delete"
+ :title="t('settings', 'Revoke')"
+ @click.stop.prevent="revoke">
+ {{ t('settings', 'Revoking this token might prevent the wiping of your device if it hasn\'t started the wipe yet.') }}
+ </ActionButton>
+ </template>
+ </Actions>
</td>
</tr>
</template>
<script>
- import {Action} from 'nextcloud-vue';
+import {
+ Actions,
+ ActionButton,
+ ActionCheckbox
+} from 'nextcloud-vue';
- const userAgentMap = {
- ie: /(?:MSIE|Trident|Trident\/7.0; rv)[ :](\d+)/,
- // Microsoft Edge User Agent from https://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx
- edge: /^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Chrome\/[0-9.]+ (?:Mobile Safari|Safari)\/[0-9.]+ Edge\/[0-9.]+$/,
- // Firefox User Agent from https://developer.mozilla.org/en-US/docs/Web/HTTP/Gecko_user_agent_string_reference
- firefox: /^Mozilla\/5\.0 \([^)]*(Windows|OS X|Linux)[^)]+\) Gecko\/[0-9.]+ Firefox\/(\d+)(?:\.\d)?$/,
- // Chrome User Agent from https://developer.chrome.com/multidevice/user-agent
- chrome: /^Mozilla\/5\.0 \([^)]*(Windows|OS X|Linux)[^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Chrome\/(\d+)[0-9.]+ (?:Mobile Safari|Safari)\/[0-9.]+$/,
- // Safari User Agent from http://www.useragentstring.com/pages/Safari/
- safari: /^Mozilla\/5\.0 \([^)]*(Windows|OS X)[^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\)(?: Version\/([0-9]+)[0-9.]+)? Safari\/[0-9.A-Z]+$/,
- // Android Chrome user agent: https://developers.google.com/chrome/mobile/docs/user-agent
- androidChrome: /Android.*(?:; (.*) Build\/).*Chrome\/(\d+)[0-9.]+/,
- iphone: / *CPU +iPhone +OS +([0-9]+)_(?:[0-9_])+ +like +Mac +OS +X */,
- ipad: /\(iPad\; *CPU +OS +([0-9]+)_(?:[0-9_])+ +like +Mac +OS +X */,
- iosClient: /^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/,
- androidClient: /^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/,
- iosTalkClient: /^Mozilla\/5\.0 \(iOS\) Nextcloud\-Talk.*$/,
- androidTalkClient: /^Mozilla\/5\.0 \(Android\) Nextcloud\-Talk.*$/,
- // DAVdroid/1.2 (2016/07/03; dav4android; okhttp3) Android/6.0.1
- davDroid: /DAV(droid|x5)\/([0-9.]+)/,
- // Mozilla/5.0 (U; Linux; Maemo; Jolla; Sailfish; like Android 4.3) AppleWebKit/538.1 (KHTML, like Gecko) WebPirate/2.0 like Mobile Safari/538.1 (compatible)
- webPirate: /(Sailfish).*WebPirate\/(\d+)/,
- // Mozilla/5.0 (Maemo; Linux; U; Jolla; Sailfish; Mobile; rv:31.0) Gecko/31.0 Firefox/31.0 SailfishBrowser/1.0
- sailfishBrowser: /(Sailfish).*SailfishBrowser\/(\d+)/
- };
- const nameMap = {
- ie: t('setting', 'Internet Explorer'),
- edge: t('setting', 'Edge'),
- firefox: t('setting', 'Firefox'),
- chrome: t('setting', 'Google Chrome'),
- safari: t('setting', 'Safari'),
- androidChrome: t('setting', 'Google Chrome for Android'),
- iphone: t('setting', 'iPhone'),
- ipad: t('setting', 'iPad'),
- iosClient: t('setting', 'Nextcloud iOS app'),
- androidClient: t('setting', 'Nextcloud Android app'),
- iosTalkClient: t('setting', 'Nextcloud Talk for iOS'),
- androidTalkClient: t('setting', 'Nextcloud Talk for Android'),
- davDroid: 'DAVdroid',
- webPirate: 'WebPirate',
- sailfishBrowser: 'SailfishBrowser'
- };
- const iconMap = {
- ie: 'icon-desktop',
- edge: 'icon-desktop',
- firefox: 'icon-desktop',
- chrome: 'icon-desktop',
- safari: 'icon-desktop',
- androidChrome: 'icon-phone',
- iphone: 'icon-phone',
- ipad: 'icon-tablet',
- iosClient: 'icon-phone',
- androidClient: 'icon-phone',
- iosTalkClient: 'icon-phone',
- androidTalkClient: 'icon-phone',
- davDroid: 'icon-phone',
- webPirate: 'icon-link',
- sailfishBrowser: 'icon-link'
- };
+const userAgentMap = {
+ ie: /(?:MSIE|Trident|Trident\/7.0; rv)[ :](\d+)/,
+ // Microsoft Edge User Agent from https://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx
+ edge: /^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Chrome\/[0-9.]+ (?:Mobile Safari|Safari)\/[0-9.]+ Edge\/[0-9.]+$/,
+ // Firefox User Agent from https://developer.mozilla.org/en-US/docs/Web/HTTP/Gecko_user_agent_string_reference
+ firefox: /^Mozilla\/5\.0 \([^)]*(Windows|OS X|Linux)[^)]+\) Gecko\/[0-9.]+ Firefox\/(\d+)(?:\.\d)?$/,
+ // Chrome User Agent from https://developer.chrome.com/multidevice/user-agent
+ chrome: /^Mozilla\/5\.0 \([^)]*(Windows|OS X|Linux)[^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Chrome\/(\d+)[0-9.]+ (?:Mobile Safari|Safari)\/[0-9.]+$/,
+ // Safari User Agent from http://www.useragentstring.com/pages/Safari/
+ safari: /^Mozilla\/5\.0 \([^)]*(Windows|OS X)[^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\)(?: Version\/([0-9]+)[0-9.]+)? Safari\/[0-9.A-Z]+$/,
+ // Android Chrome user agent: https://developers.google.com/chrome/mobile/docs/user-agent
+ androidChrome: /Android.*(?:; (.*) Build\/).*Chrome\/(\d+)[0-9.]+/,
+ iphone: / *CPU +iPhone +OS +([0-9]+)_(?:[0-9_])+ +like +Mac +OS +X */,
+ ipad: /\(iPad\; *CPU +OS +([0-9]+)_(?:[0-9_])+ +like +Mac +OS +X */,
+ iosClient: /^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/,
+ androidClient: /^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/,
+ iosTalkClient: /^Mozilla\/5\.0 \(iOS\) Nextcloud\-Talk.*$/,
+ androidTalkClient: /^Mozilla\/5\.0 \(Android\) Nextcloud\-Talk.*$/,
+ // DAVdroid/1.2 (2016/07/03; dav4android; okhttp3) Android/6.0.1
+ davDroid: /DAV(droid|x5)\/([0-9.]+)/,
+ // Mozilla/5.0 (U; Linux; Maemo; Jolla; Sailfish; like Android 4.3) AppleWebKit/538.1 (KHTML, like Gecko) WebPirate/2.0 like Mobile Safari/538.1 (compatible)
+ webPirate: /(Sailfish).*WebPirate\/(\d+)/,
+ // Mozilla/5.0 (Maemo; Linux; U; Jolla; Sailfish; Mobile; rv:31.0) Gecko/31.0 Firefox/31.0 SailfishBrowser/1.0
+ sailfishBrowser: /(Sailfish).*SailfishBrowser\/(\d+)/
+};
+const nameMap = {
+ ie: t('setting', 'Internet Explorer'),
+ edge: t('setting', 'Edge'),
+ firefox: t('setting', 'Firefox'),
+ chrome: t('setting', 'Google Chrome'),
+ safari: t('setting', 'Safari'),
+ androidChrome: t('setting', 'Google Chrome for Android'),
+ iphone: t('setting', 'iPhone'),
+ ipad: t('setting', 'iPad'),
+ iosClient: t('setting', 'Nextcloud iOS app'),
+ androidClient: t('setting', 'Nextcloud Android app'),
+ iosTalkClient: t('setting', 'Nextcloud Talk for iOS'),
+ androidTalkClient: t('setting', 'Nextcloud Talk for Android'),
+ davDroid: 'DAVdroid',
+ webPirate: 'WebPirate',
+ sailfishBrowser: 'SailfishBrowser'
+};
+const iconMap = {
+ ie: 'icon-desktop',
+ edge: 'icon-desktop',
+ firefox: 'icon-desktop',
+ chrome: 'icon-desktop',
+ safari: 'icon-desktop',
+ androidChrome: 'icon-phone',
+ iphone: 'icon-phone',
+ ipad: 'icon-tablet',
+ iosClient: 'icon-phone',
+ androidClient: 'icon-phone',
+ iosTalkClient: 'icon-phone',
+ androidTalkClient: 'icon-phone',
+ davDroid: 'icon-phone',
+ webPirate: 'icon-link',
+ sailfishBrowser: 'icon-link'
+};
- export default {
- name: "AuthToken",
- components: {
- Action,
+export default {
+ name: "AuthToken",
+ components: {
+ Actions,
+ ActionButton,
+ ActionCheckbox
+ },
+ props: {
+ token: {
+ type: Object,
+ required: true,
+ }
+ },
+ computed: {
+ lastActivityRelative () {
+ return OC.Util.relativeModifiedDate(this.token.lastActivity * 1000);
},
- props: {
- token: {
- type: Object,
- required: true,
- }
+ lastActivity () {
+ return OC.Util.formatDate(this.token.lastActivity * 1000, 'LLL');
},
- computed: {
- actions () {
- const actions = [];
-
- if (this.token.type === 1) {
- // TODO: add text/longtext with some description
- actions.push({
- input: 'checkbox',
- action: () => this.$emit('toggleScope', this.token, 'filesystem', !this.token.scope.filesystem),
- model: this.token.scope.filesystem,
- text: t('settings', 'Allow filesystem access'),
- });
- }
- if (this.token.canRename) {
- // TODO: add text/longtext with some description
- actions.push({
- icon: 'icon-rename',
- action: () => this.startRename(),
- text: t('settings', 'Rename'),
- });
- }
- if (this.token.canDelete && this.token.type !== 2) {
- // TODO: add text/longtext with some description
- actions.push({
- icon: 'icon-delete',
- action: () => this.$emit('delete', this.token),
- text: t('settings', 'Revoke'),
- });
- actions.push({
- icon: 'icon-delete',
- action: this.wipe,
- text: t('settings', 'Wipe device'),
- });
- } else if (this.token.canDelete && this.token.type === 2) {
- actions.push({
- icon: 'icon-delete',
- action: () => this.$emit('delete', this.token),
- text: t('settings', 'Revoke'),
- longtext: t('settings', 'Revoking this token might prevent the wiping of your device if it hasn\'t started the wipe yet.'),
- });
- }
-
- return actions;
- },
- lastActivityRelative () {
- return OC.Util.relativeModifiedDate(this.token.lastActivity * 1000);
- },
- lastActivity () {
- return OC.Util.formatDate(this.token.lastActivity * 1000, 'LLL');
- },
- iconName () {
- // pretty format sync client user agent
- let matches = this.token.name.match(/Mozilla\/5\.0 \((\w+)\) (?:mirall|csyncoC)\/(\d+\.\d+\.\d+)/);
+ iconName () {
+ // pretty format sync client user agent
+ let matches = this.token.name.match(/Mozilla\/5\.0 \((\w+)\) (?:mirall|csyncoC)\/(\d+\.\d+\.\d+)/);
- let icon = '';
- if (matches) {
- this.token.name = t('settings', 'Sync client - {os}', {
- os: matches[1],
- version: matches[2]
- });
- icon = 'icon-desktop';
- }
-
- // preserve title for cases where we format it further
- const title = this.token.name;
- let name = this.token.name;
- for (let client in userAgentMap) {
- if (matches = title.match(userAgentMap[client])) {
- if (matches[2] && matches[1]) { // version number and os
- name = nameMap[client] + ' ' + matches[2] + ' - ' + matches[1];
- } else if (matches[1]) { // only version number
- name = nameMap[client] + ' ' + matches[1];
- } else {
- name = nameMap[client];
- }
+ let icon = '';
+ if (matches) {
+ this.token.name = t('settings', 'Sync client - {os}', {
+ os: matches[1],
+ version: matches[2]
+ });
+ icon = 'icon-desktop';
+ }
- icon = iconMap[client];
+ // preserve title for cases where we format it further
+ const title = this.token.name;
+ let name = this.token.name;
+ for (let client in userAgentMap) {
+ if (matches = title.match(userAgentMap[client])) {
+ if (matches[2] && matches[1]) { // version number and os
+ name = nameMap[client] + ' ' + matches[2] + ' - ' + matches[1];
+ } else if (matches[1]) { // only version number
+ name = nameMap[client] + ' ' + matches[1];
+ } else {
+ name = nameMap[client];
}
- }
- if (this.token.current) {
- name = t('settings', 'This session');
- }
- return {
- icon,
- name,
- };
- },
- wiping() {
- return this.token.type === 2;
+ icon = iconMap[client];
+ }
}
- },
- data () {
+ if (this.token.current) {
+ name = t('settings', 'This session');
+ }
+
return {
- showMore: this.token.canScope || this.token.canDelete,
- renaming: false,
- newName: '',
- actionOpen: false,
+ icon,
+ name,
};
},
- methods: {
- startRename () {
- // Close action (popover menu)
- this.actionOpen = false;
-
- this.newName = this.token.name;
- this.renaming = true;
- this.$nextTick(() => {
- this.$refs.input.select();
- });
- },
- cancelRename () {
- this.renaming = false;
- },
- rename () {
- this.renaming = false;
- this.$emit('rename', this.token, this.newName);
- },
- wipe () {
- this.actionOpen = false;
+ wiping() {
+ return this.token.type === 2;
+ }
+ },
+ data () {
+ return {
+ showMore: this.token.canScope || this.token.canDelete,
+ renaming: false,
+ newName: '',
+ actionOpen: false,
+ };
+ },
+ methods: {
+ startRename() {
+ // Close action (popover menu)
+ this.actionOpen = false;
- this.$emit('wipe', this.token);
- }
+ this.newName = this.token.name;
+ this.renaming = true;
+ this.$nextTick(() => {
+ this.$refs.input.select();
+ });
+ },
+ cancelRename() {
+ this.renaming = false;
+ },
+ revoke() {
+ this.actionOpen = false;
+ this.$emit('delete', this.token)
+ },
+ rename() {
+ this.renaming = false;
+ this.$emit('rename', this.token, this.newName);
+ },
+ wipe() {
+ this.actionOpen = false;
+ this.$emit('wipe', this.token);
}
}
+}
</script>
<style lang="scss" scoped>
@@ -266,7 +268,8 @@
&%icon {
overflow: visible;
position: relative;
- width: 16px;
+ width: 44px;
+ height: 44px;
}
&.token-name {
@@ -287,6 +290,7 @@
&.more {
@extend %icon;
+ padding: 0 10px;
}
&.client {
diff --git a/settings/src/views/Apps.vue b/settings/src/views/Apps.vue
index 59fc85b73fa..9119170ef38 100644
--- a/settings/src/views/Apps.vue
+++ b/settings/src/views/Apps.vue
@@ -21,25 +21,31 @@
-->
<template>
- <AppContent app-name="settings" :class="{ 'with-app-sidebar': currentApp}"
+ <Content app-name="settings" :class="{ 'with-app-sidebar': currentApp}"
:content-class="{ 'icon-loading': loadingList }" :navigation-class="{ 'icon-loading': loading }">
- <template #navigation>
+ <AppNavigation>
<ul id="appscategories">
<AppNavigationItem v-for="item in menu" :key="item.key" :item="item" />
</ul>
- </template>
- <template #content class="app-settings-content" :class="{ 'icon-loading': loadingList }">
- <app-list :category="category" :app="currentApp" :search="searchQuery"></app-list>
- </template>
- <template #sidebar v-if="id && currentApp" >
- <app-details :category="category" :app="currentApp"></app-details>
- </template>
- </AppContent>
+ </AppNavigation>
+ <AppContent class="app-settings-content" :class="{ 'icon-loading': loadingList }">
+ <AppList :category="category" :app="currentApp" :search="searchQuery" />
+ </AppContent>
+ <AppSidebar v-if="id && currentApp" >
+ <AppDetails :category="category" :app="currentApp" />
+ </AppSidebar>
+ </Content>
</template>
<script>
-import { AppContent, AppNavigationItem } from 'nextcloud-vue';
-import appList from '../components/appList';
+import {
+ AppContent,
+ AppNavigation,
+ AppNavigationItem,
+ AppSidebar,
+ Content
+} from 'nextcloud-vue';
+import AppList from '../components/appList';
import Vue from 'vue';
import VueLocalStorage from 'vue-localstorage'
import AppDetails from '../components/appDetails';
@@ -60,9 +66,12 @@ export default {
},
components: {
AppContent,
- AppDetails,
- appList,
+ AppNavigation,
AppNavigationItem,
+ AppSidebar,
+ Content,
+ AppDetails,
+ AppList
},
methods: {
setSearch(query) {
diff --git a/settings/src/views/Users.vue b/settings/src/views/Users.vue
index d88c15a5e0d..dcbef1cd799 100644
--- a/settings/src/views/Users.vue
+++ b/settings/src/views/Users.vue
@@ -21,8 +21,8 @@
-->
<template>
- <AppContent app-name="settings" :navigation-class="{ 'icon-loading': loadingAddGroup }">
- <template #navigation>
+ <Content app-name="settings" :navigation-class="{ 'icon-loading': loadingAddGroup }">
+ <AppNavigation>
<AppNavigationNew button-id="new-user-button" :text="t('settings','New user')" button-class="icon-add" @click="toggleNewUserMenu" />
<ul id="usergrouplist">
<AppNavigationItem v-for="item in menu" :key="item.key" :item="item" />
@@ -30,12 +30,12 @@
<AppNavigationSettings>
<div>
<p>{{t('settings', 'Default quota:')}}</p>
- <multiselect :value="defaultQuota" :options="quotaOptions"
+ <Multiselect :value="defaultQuota" :options="quotaOptions"
tag-placeholder="create" :placeholder="t('settings', 'Select default quota')"
- label="label" track-by="id" class="multiselect-vue"
+ label="label" track-by="id"
:allowEmpty="false" :taggable="true"
@tag="validateQuota" @input="setDefaultQuota">
- </multiselect>
+ </Multiselect>
</div>
<div>
@@ -55,22 +55,27 @@
<label for="showStoragePath">{{t('settings', 'Show storage path')}}</label>
</div>
</AppNavigationSettings>
- </template>
- <user-list #content :users="users" :showConfig="showConfig" :selectedGroup="selectedGroup" :externalActions="externalActions" />
- </AppContent>
+ </AppNavigation>
+ <AppContent>
+ <UserList #content :users="users" :showConfig="showConfig" :selectedGroup="selectedGroup" :externalActions="externalActions" />
+ </AppContent>
+ </Content>
</template>
<script>
+import Vue from 'vue';
+import VueLocalStorage from 'vue-localstorage'
import {
AppContent,
+ AppNavigation,
AppNavigationItem,
AppNavigationNew,
AppNavigationSettings,
+ AppSidebar,
+ Content,
+ Multiselect
} from 'nextcloud-vue';
-import userList from '../components/userList';
-import Vue from 'vue';
-import VueLocalStorage from 'vue-localstorage'
-import Multiselect from 'vue-multiselect';
+import UserList from '../components/userList';
import api from '../store/api';
Vue.use(VueLocalStorage)
@@ -80,10 +85,13 @@ export default {
props: ['selectedGroup'],
components: {
AppContent,
+ AppNavigation,
AppNavigationItem,
AppNavigationNew,
AppNavigationSettings,
- userList,
+ AppSidebar,
+ Content,
+ UserList,
Multiselect,
},
beforeMount() {