fix: preserve SSO identities and polish sharing interface
This commit is contained in:
1 parent
2e3b56f250
commit
bd9bf33bc9
22 files changed
+430
-106
No files matched your search
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<div :class="{ 'without-sidebar': hideSidebar }">
|
||||
<div v-if="uploadStore.totalBytes" class="progress">
|
||||
<div
|
||||
v-bind:style="{
|
||||
@@ -7,7 +7,7 @@
|
||||
}"
|
||||
></div>
|
||||
</div>
|
||||
<sidebar></sidebar>
|
||||
<sidebar v-if="!hideSidebar"></sidebar>
|
||||
<main>
|
||||
<router-view></router-view>
|
||||
<shell
|
||||
@@ -30,7 +30,7 @@ import Sidebar from "@/components/Sidebar.vue";
|
||||
import Prompts from "@/components/prompts/Prompts.vue";
|
||||
import Shell from "@/components/Shell.vue";
|
||||
import UploadFiles from "@/components/prompts/UploadFiles.vue";
|
||||
import { enableExec } from "@/utils/constants";
|
||||
import { enableExec, hideLoginButton } from "@/utils/constants";
|
||||
import { computed, watch } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
@@ -39,6 +39,7 @@ const authStore = useAuthStore();
|
||||
const fileStore = useFileStore();
|
||||
const uploadStore = useUploadStore();
|
||||
const route = useRoute();
|
||||
const hideSidebar = computed(() => route.name === "Share" && hideLoginButton);
|
||||
|
||||
const sentPercent = computed(() =>
|
||||
((uploadStore.sentBytes / uploadStore.totalBytes) * 100).toFixed(2)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<header-bar showMenu showLogo>
|
||||
<header-bar :showMenu="!hideLoginButton" showLogo>
|
||||
<title />
|
||||
|
||||
<action
|
||||
@@ -301,6 +301,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { hideLoginButton } from "@/utils/constants";
|
||||
import { pub as api } from "@/api";
|
||||
import { filesize } from "@/utils";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
@@ -113,6 +113,9 @@ const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const editor = ref<Ace.Editor | null>(null);
|
||||
const themeObserver = new MutationObserver(() => {
|
||||
editor.value?.setTheme(getEditorTheme());
|
||||
});
|
||||
const fontSize = ref(parseInt(localStorage.getItem("editorFontSize") || "14"));
|
||||
|
||||
const isPreview = ref(false);
|
||||
@@ -191,6 +194,7 @@ onMounted(() => {
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
themeObserver.disconnect();
|
||||
window.removeEventListener("keydown", keyEvent);
|
||||
window.removeEventListener("beforeunload", handlePageChange);
|
||||
editor.value?.destroy();
|
||||
@@ -217,12 +221,16 @@ onBeforeRouteUpdate((to, from, next) => {
|
||||
});
|
||||
|
||||
const initEditor = (fileContent: string) => {
|
||||
themeObserver.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ["class"],
|
||||
});
|
||||
editor.value = ace.edit("editor", {
|
||||
value: fileContent,
|
||||
showPrintMargin: false,
|
||||
useWorker: false,
|
||||
readOnly: fileStore.req?.type === "textImmutable",
|
||||
theme: getEditorTheme(authStore.user?.aceEditorTheme ?? ""),
|
||||
theme: getEditorTheme(),
|
||||
mode: modelist.getModeForPath(fileStore.req!.name).mode,
|
||||
wrap: true,
|
||||
enableBasicAutocompletion: true,
|
||||
|
||||
@@ -7,6 +7,14 @@
|
||||
</div>
|
||||
|
||||
<div class="card-content">
|
||||
<div class="profile-summary">
|
||||
<strong>{{ authStore.user?.username }}</strong
|
||||
><span v-if="authStore.user?.profileName">{{
|
||||
authStore.user.profileName
|
||||
}}</span
|
||||
><span v-if="authStore.user?.email">{{ authStore.user.email }}</span
|
||||
><small>{{ t("sso.managed") }}</small>
|
||||
</div>
|
||||
<p>
|
||||
<input type="checkbox" name="hideDotfiles" v-model="hideDotfiles" />
|
||||
{{ t("settings.hideDotfiles") }}
|
||||
@@ -33,12 +41,7 @@
|
||||
v-model:locale="locale"
|
||||
></languages>
|
||||
|
||||
<h3>{{ t("settings.aceEditorTheme") }}</h3>
|
||||
<AceEditorTheme
|
||||
class="input input--block"
|
||||
v-model:aceEditorTheme="aceEditorTheme"
|
||||
id="aceTheme"
|
||||
></AceEditorTheme>
|
||||
<p class="field-hint">{{ t("sso.editorTheme") }}</p>
|
||||
</div>
|
||||
|
||||
<div class="card-action">
|
||||
@@ -58,7 +61,6 @@
|
||||
import { useAuthStore } from "@/stores/auth";
|
||||
import { useLayoutStore } from "@/stores/layout";
|
||||
import { users as api } from "@/api";
|
||||
import AceEditorTheme from "@/components/settings/AceEditorTheme.vue";
|
||||
import Languages from "@/components/settings/Languages.vue";
|
||||
import { inject, onMounted, ref } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
@@ -17,7 +17,10 @@
|
||||
</tr>
|
||||
|
||||
<tr v-for="user in users" :key="user.id">
|
||||
<td>{{ user.displayName || user.username }}</td>
|
||||
<td>
|
||||
{{ user.displayName || user.username
|
||||
}}<small class="user-record-id">ID {{ user.id }}</small>
|
||||
</td>
|
||||
<td>{{ user.scope }}</td>
|
||||
<td class="small">
|
||||
<router-link :to="'/settings/users/' + user.id"
|
||||
|
||||
Reference in new issue
Block a user