Merge branch 'chore/remove-unused-02' into 'develop'

chore, refactor: remove unused, fix some type errors (client/src/pages)

See merge request firefish/firefish!10579
This commit is contained in:
Kainoa Kanter 2023-09-01 23:16:23 +00:00
commit 5ad42e73c9
165 changed files with 582 additions and 1139 deletions

View File

@ -7,7 +7,7 @@ export default (v, digits = 0) => {
const i = Math.floor(Math.log(v) / Math.log(1024));
return (
(isMinus ? "-" : "") +
(v / Math.pow(1024, i)).toFixed(digits).replace(/\.0+$/, "") +
(v / 1024 ** i).toFixed(digits).replace(/\.0+$/, "") +
sizes[i]
);
};

View File

@ -2,6 +2,4 @@
<div></div>
</template>
<script lang="ts" setup>
import {} from "vue";
</script>
<script lang="ts" setup></script>

View File

@ -35,9 +35,8 @@
</template>
<script lang="ts" setup>
import { ref, computed } from "vue";
import { ref } from "vue";
import {} from "vue";
import * as misskey from "firefish-js";
import MkButton from "@/components/MkButton.vue";
import { version } from "@/config";
@ -53,9 +52,9 @@ const props = withDefaults(
{},
);
let loaded = ref(false);
let serverIsDead = ref(false);
let meta = ref<misskey.entities.LiteInstanceMetadata | null>(null);
const loaded = ref(false);
const serverIsDead = ref(false);
const meta = ref<misskey.entities.LiteInstanceMetadata | null>(null);
os.api("meta", {
detail: false,
@ -76,10 +75,6 @@ function reload() {
unisonReload();
}
const headerActions = computed(() => []);
const headerTabs = computed(() => []);
definePageMetadata({
title: i18n.ts.error,
icon: "ph-warning ph-bold ph-lg",

View File

@ -225,8 +225,8 @@ sponsors = patronsResp.sponsors;
patrons = patrons.filter((patron) => !sponsors.includes(patron));
let easterEggReady = false;
let easterEggEmojis = ref([]);
let easterEggEngine = ref(null);
const easterEggEmojis = ref([]);
const easterEggEngine = ref(null);
const containerEl = ref<HTMLElement>();
function iconLoaded() {

View File

@ -47,14 +47,13 @@
</template>
<script lang="ts">
import { defineComponent, computed } from "vue";
import { defineComponent } from "vue";
import XEmoji from "./emojis.emoji.vue";
import MkButton from "@/components/MkButton.vue";
import MkInput from "@/components/form/input.vue";
import MkSelect from "@/components/form/select.vue";
import MkFolder from "@/components/MkFolder.vue";
import MkTab from "@/components/MkTab.vue";
import * as os from "@/os";
import { emojiCategories, emojiTags } from "@/instance";
import { i18n } from "@/i18n";

View File

@ -113,9 +113,9 @@ import MkInstanceCardMini from "@/components/MkInstanceCardMini.vue";
import FormSplit from "@/components/form/split.vue";
import { i18n } from "@/i18n";
let host = ref("");
let state = ref("federating");
let sort = ref("+pubSub");
const host = ref("");
const state = ref("federating");
const sort = ref("+pubSub");
const pagination = {
endpoint: "federation/instances" as const,
limit: 10,

View File

@ -178,7 +178,7 @@ import { Virtual } from "swiper/modules";
import { Swiper, SwiperSlide } from "swiper/vue";
import XEmojis from "./about.emojis.vue";
import XFederation from "./about.federation.vue";
import { version, instanceName, host } from "@/config";
import { version, host } from "@/config";
import FormLink from "@/components/form/link.vue";
import FormSection from "@/components/form/section.vue";
import FormSuspense from "@/components/form/suspense.vue";
@ -205,13 +205,13 @@ withDefaults(
},
);
let stats = ref(null);
let instanceIcon = ref<HTMLImageElement>();
const stats = ref(null);
const instanceIcon = ref<HTMLImageElement>();
let iconClicks = 0;
let iconSrc = ref(instance.iconUrl || instance.faviconUrl || "/favicon.ico");
let instanceIconAnimation = ref("");
const iconSrc = ref(instance.iconUrl || instance.faviconUrl || "/favicon.ico");
const instanceIconAnimation = ref("");
let tabs = ["overview", "emojis", "charts"];
let tab = ref(tabs[0]);
const tab = ref(tabs[0]);
watch(tab, () => syncSlide(tabs.indexOf(tab.value)));
if (iAmModerator) tabs.push("federation");
@ -249,7 +249,7 @@ if (iAmModerator) {
});
}
let headerTabs = computed(() => theTabs);
const headerTabs = computed(() => theTabs);
definePageMetadata(
computed(() => ({

View File

@ -172,7 +172,6 @@ import * as os from "@/os";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
import { deviceKind } from "@/scripts/device-kind";
import { acct } from "@/filters/user";
import { iAmAdmin, iAmModerator } from "@/account";
import { defaultStore } from "@/store";
import "swiper/scss";
@ -181,12 +180,12 @@ import "swiper/scss/virtual";
let tabs = ["overview"];
if (iAmModerator) tabs.push("ip");
tabs.push("raw");
let tab = ref(tabs[0]);
const tab = ref(tabs[0]);
watch(tab, () => syncSlide(tabs.indexOf(tab.value)));
let file: any = ref(null);
let info: any = ref(null);
let isSensitive: boolean = ref(false);
const file = ref(null);
const info = ref(null);
const isSensitive = ref(false);
const props = defineProps<{
fileId: string;

View File

@ -56,21 +56,11 @@
</template>
<script lang="ts" setup>
import {
computed,
onMounted,
onUnmounted,
ref,
inject,
watch,
nextTick,
} from "vue";
import { computed, onMounted, onUnmounted, ref, watch, nextTick } from "vue";
import tinycolor from "tinycolor2";
import { popupMenu } from "@/os";
import { url } from "@/config";
import { scrollToTop } from "@/scripts/scroll";
import MkButton from "@/components/MkButton.vue";
import { i18n } from "@/i18n";
import { globalEvents } from "@/events";
import { injectPageMetadata } from "@/scripts/page-metadata";
@ -100,11 +90,10 @@ const emit = defineEmits<{
const metadata = injectPageMetadata();
const el = ref<HTMLElement>(null);
const el = ref<HTMLElement>();
const tabRefs = {};
const tabHighlightEl = ref<HTMLElement | null>(null);
const bg = ref(null);
const height = ref(0);
const bg = ref<string>();
const hasTabs = computed(() => {
return props.tabs && props.tabs.length > 0;
});

View File

@ -93,21 +93,19 @@
<script lang="ts" setup>
import { computed, ref } from "vue";
import MkInput from "@/components/form/input.vue";
import MkSelect from "@/components/form/select.vue";
import MkPagination from "@/components/MkPagination.vue";
import XAbuseReport from "@/components/MkAbuseReport.vue";
import * as os from "@/os";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
let reports = ref<InstanceType<typeof MkPagination>>();
const reports = ref<InstanceType<typeof MkPagination>>();
let state = ref("unresolved");
let reporterOrigin = ref("combined");
let targetUserOrigin = ref("combined");
let searchUsername = ref("");
let searchHost = ref("");
const state = ref("unresolved");
const reporterOrigin = ref("combined");
const targetUserOrigin = ref("combined");
// const searchUsername = ref("");
// const searchHost = ref("");
const pagination = {
endpoint: "admin/abuse-user-reports" as const,
@ -120,7 +118,7 @@ const pagination = {
};
function resolved(reportId) {
reports.value.removeItem((item) => item.id === reportId);
reports.value?.removeItem((item) => item.id === reportId);
}
const headerActions = computed(() => []);

View File

@ -76,7 +76,7 @@ import * as os from "@/os";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
let announcements: any[] = ref([]);
const announcements = ref<any[]>([]);
os.api("admin/announcements/list").then((announcementResponse) => {
announcements.value = announcementResponse;

View File

@ -88,11 +88,11 @@ const MkCaptcha = defineAsyncComponent(
() => import("@/components/MkCaptcha.vue"),
);
let provider = ref(null);
let hcaptchaSiteKey: string | null = ref(null);
let hcaptchaSecretKey: string | null = ref(null);
let recaptchaSiteKey: string | null = ref(null);
let recaptchaSecretKey: string | null = ref(null);
const provider = ref<any>(null);
const hcaptchaSiteKey = ref<string | null>(null);
const hcaptchaSecretKey = ref<string | null>(null);
const recaptchaSiteKey = ref<string | null>(null);
const recaptchaSecretKey = ref<string | null>(null);
async function init() {
const meta = await os.api("admin/meta");

View File

@ -17,15 +17,13 @@
</template>
<script lang="ts" setup>
import { ref, watch, computed } from "vue";
// import { ref, watch } from "vue";
import FormTextarea from "@/components/form/textarea.vue";
import FormInfo from "@/components/MkInfo.vue";
import * as os from "@/os";
import { unisonReload } from "@/scripts/unison-reload";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
const localCustomCss = ref(localStorage.getItem("customCss") ?? "");
// const localCustomCss = ref(localStorage.getItem("customCss") ?? "");
/*
async function apply() {
@ -45,10 +43,6 @@ watch(globalCustomCss, async () => {
});
*/
const headerActions = computed(() => []);
const headerTabs = computed(() => []);
definePageMetadata({
title: i18n.ts.customCss,
icon: "ph-code ph-bold ph-lg",

View File

@ -36,7 +36,6 @@
<script lang="ts" setup>
import { computed } from "vue";
import {} from "vue";
import FormSuspense from "@/components/form/suspense.vue";
import FormButton from "@/components/MkButton.vue";
import MkKeyValue from "@/components/MkKeyValue.vue";

View File

@ -93,7 +93,6 @@
<script lang="ts" setup>
import { ref, computed } from "vue";
import {} from "vue";
import FormSwitch from "@/components/form/switch.vue";
import FormInput from "@/components/form/input.vue";
import FormInfo from "@/components/MkInfo.vue";
@ -105,13 +104,13 @@ import { fetchInstance, instance } from "@/instance";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
let enableEmail: boolean = ref(false);
let email: any = ref(null);
let smtpSecure: boolean = ref(false);
let smtpHost: string = ref("");
let smtpPort: number = ref(0);
let smtpUser: string = ref("");
let smtpPass: string = ref("");
const enableEmail = ref(false);
const email: any = ref(null);
const smtpSecure = ref(false);
const smtpHost = ref("");
const smtpPort = ref(0);
const smtpUser = ref("");
const smtpPass = ref("");
async function init() {
const meta = await os.api("admin/meta");

View File

@ -43,13 +43,11 @@
<script lang="ts" setup>
import { ref } from "vue";
import {} from "vue";
import XModalWindow from "@/components/MkModalWindow.vue";
import MkButton from "@/components/MkButton.vue";
import MkInput from "@/components/form/input.vue";
import MkTextarea from "@/components/form/textarea.vue";
import * as os from "@/os";
import { unique } from "@/scripts/array";
import { i18n } from "@/i18n";
import { emojiCategories } from "@/instance";
@ -57,12 +55,12 @@ const props = defineProps<{
emoji: any;
}>();
let dialog = ref(null);
let name: string = ref(props.emoji.name);
let category: string = ref(props.emoji.category);
let aliases: string = ref(props.emoji.aliases.join(" "));
let categories: string[] = ref(emojiCategories);
let license: string = ref(props.emoji.license ?? "");
const dialog = ref<any>(null);
const name = ref<string>(props.emoji.name);
const category = ref<string>(props.emoji.category);
const aliases = ref<string>(props.emoji.aliases.join(" "));
const categories = ref(emojiCategories);
const license = ref<string>(props.emoji.license ?? "");
const emit = defineEmits<{
(ev: "done", v: { deleted?: boolean; updated?: any }): void;

View File

@ -154,17 +154,10 @@
</template>
<script lang="ts" setup>
import {
computed,
defineAsyncComponent,
defineComponent,
ref,
toRef,
} from "vue";
import { computed, defineAsyncComponent, ref } from "vue";
import MkButton from "@/components/MkButton.vue";
import MkInput from "@/components/form/input.vue";
import MkPagination from "@/components/MkPagination.vue";
import MkTab from "@/components/MkTab.vue";
import MkSwitch from "@/components/form/switch.vue";
import FormSplit from "@/components/form/split.vue";
import { selectFile, selectFiles } from "@/scripts/select-file";

View File

@ -29,7 +29,6 @@
<script lang="ts" setup>
import { ref, computed } from "vue";
import {} from "vue";
import MkStickyContainer from "@/components/global/MkStickyContainer.vue";
import FormSuspense from "@/components/form/suspense.vue";
import FormSwitch from "@/components/form/switch.vue";
@ -38,8 +37,8 @@ import { fetchInstance } from "@/instance";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
let enablePostImports = ref(false);
let meta = ref<MetaExperiments | null>(null);
const enablePostImports = ref(false);
const meta = ref<MetaExperiments | null>(null);
type MetaExperiments = {
experimentalFeatures?: {

View File

@ -80,9 +80,7 @@
</template>
<script lang="ts" setup>
import { computed, defineAsyncComponent, ref } from "vue";
import * as Acct from "firefish-js/built/acct";
import MkButton from "@/components/MkButton.vue";
import { computed, ref } from "vue";
import MkInput from "@/components/form/input.vue";
import MkSelect from "@/components/form/select.vue";
import MkFileListForAdmin from "@/components/MkFileListForAdmin.vue";
@ -91,11 +89,11 @@ import * as os from "@/os";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
let origin = ref("local");
let type = ref(null);
let searchHost = ref("");
let userId = ref("");
let viewMode = ref("grid");
const origin = ref("local");
const type = ref(null);
const searchHost = ref("");
const userId = ref("");
const viewMode = ref("grid");
const pagination = {
endpoint: "admin/drive/files" as const,
limit: 10,
@ -134,8 +132,6 @@ const headerActions = computed(() => [
},
]);
const headerTabs = computed(() => []);
definePageMetadata(
computed(() => ({
title: i18n.ts.files,

View File

@ -28,7 +28,6 @@
<script lang="ts" setup>
import { ref, computed } from "vue";
import {} from "vue";
import FormButton from "@/components/MkButton.vue";
import FormTextarea from "@/components/form/textarea.vue";
import FormSuspense from "@/components/form/suspense.vue";
@ -37,7 +36,7 @@ import { fetchInstance } from "@/instance";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
let hiddenTags: string = ref("");
const hiddenTags = ref("");
async function init() {
const meta = await os.api("admin/meta");

View File

@ -60,9 +60,6 @@
<script lang="ts" setup>
import {
defineAsyncComponent,
inject,
nextTick,
onMounted,
onUnmounted,
onActivated,
@ -74,7 +71,6 @@ import {
import { i18n } from "@/i18n";
import MkSuperMenu from "@/components/MkSuperMenu.vue";
import MkInfo from "@/components/MkInfo.vue";
import { scroll } from "@/scripts/scroll";
import { instance } from "@/instance";
import { version } from "@/config";
import { $i } from "@/account";
@ -88,7 +84,6 @@ import { useRouter } from "@/router";
import {
definePageMetadata,
provideMetadataReceiver,
setPageMetadata,
} from "@/scripts/page-metadata";
const isEmpty = (x: string | null) => x == null || x === "";
@ -103,21 +98,19 @@ const indexInfo = {
provide("shouldOmitHeaderTitle", false);
let INFO = ref(indexInfo);
let childInfo = ref(null);
let narrow = ref(false);
let view = ref(null);
let pageProps = ref({});
let noMaintainerInformation =
const INFO = ref(indexInfo);
const childInfo = ref(null);
const narrow = ref(false);
const noMaintainerInformation =
isEmpty(instance.maintainerName) || isEmpty(instance.maintainerEmail);
let noBotProtection =
const noBotProtection =
!instance.disableRegistration &&
!instance.enableHcaptcha &&
!instance.enableRecaptcha;
let noEmailServer = !instance.enableEmail;
let thereIsUnresolvedAbuseReport = ref(false);
let updateAvailable = ref(false);
let currentPage = computed(() => router.currentRef.value.child);
const noEmailServer = !instance.enableEmail;
const thereIsUnresolvedAbuseReport = ref(false);
const updateAvailable = ref(false);
const currentPage = computed(() => router.currentRef.value.child);
os.api("admin/abuse-user-reports", {
state: "unresolved",

View File

@ -45,7 +45,6 @@
<script lang="ts" setup>
import { ref, computed } from "vue";
import {} from "vue";
import FormButton from "@/components/MkButton.vue";
import FormTextarea from "@/components/form/textarea.vue";
import FormSuspense from "@/components/form/suspense.vue";
@ -55,9 +54,9 @@ import { fetchInstance } from "@/instance";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
let blockedHosts: string = ref("");
let silencedHosts: string = ref("");
let tab = ref("block");
const blockedHosts = ref("");
const silencedHosts = ref("");
const tab = ref("block");
async function init() {
const meta = await os.api("admin/meta");

View File

@ -36,7 +36,6 @@
<script lang="ts" setup>
import { ref } from "vue";
import {} from "vue";
import FormSwitch from "@/components/form/switch.vue";
import FormInput from "@/components/form/input.vue";
import FormButton from "@/components/MkButton.vue";
@ -46,10 +45,10 @@ import * as os from "@/os";
import { fetchInstance } from "@/instance";
import { i18n } from "@/i18n";
let uri: string = ref("");
let enableDiscordIntegration: boolean = ref(false);
let discordClientId: string | null = ref(null);
let discordClientSecret: string | null = ref(null);
const uri = ref("");
const enableDiscordIntegration = ref(false);
const discordClientId = ref(null);
const discordClientSecret = ref(null);
async function init() {
const meta = await os.api("admin/meta");

View File

@ -36,7 +36,6 @@
<script lang="ts" setup>
import { ref } from "vue";
import {} from "vue";
import FormSwitch from "@/components/form/switch.vue";
import FormInput from "@/components/form/input.vue";
import FormButton from "@/components/MkButton.vue";
@ -46,10 +45,10 @@ import * as os from "@/os";
import { fetchInstance } from "@/instance";
import { i18n } from "@/i18n";
let uri: string = ref("");
let enableGithubIntegration: boolean = ref(false);
let githubClientId: string | null = ref(null);
let githubClientSecret: string | null = ref(null);
const uri = ref("");
const enableGithubIntegration = ref(false);
const githubClientId = ref(null);
const githubClientSecret = ref(null);
async function init() {
const meta = await os.api("admin/meta");

View File

@ -40,7 +40,6 @@
<script lang="ts" setup>
import { ref, computed } from "vue";
import {} from "vue";
import XGithub from "./integrations.github.vue";
import XDiscord from "./integrations.discord.vue";
import FormSuspense from "@/components/form/suspense.vue";
@ -49,13 +48,11 @@ import * as os from "@/os";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
let enableTwitterIntegration: boolean = ref(false);
let enableGithubIntegration: boolean = ref(false);
let enableDiscordIntegration: boolean = ref(false);
const enableGithubIntegration = ref(false);
const enableDiscordIntegration = ref(false);
async function init() {
const meta = await os.api("admin/meta");
enableTwitterIntegration.value = meta.enableTwitterIntegration;
enableGithubIntegration.value = meta.enableGithubIntegration;
enableDiscordIntegration.value = meta.enableDiscordIntegration;
}

View File

@ -151,7 +151,6 @@
<script lang="ts" setup>
import { ref, computed } from "vue";
import {} from "vue";
import FormSwitch from "@/components/form/switch.vue";
import FormInput from "@/components/form/input.vue";
import FormSuspense from "@/components/form/suspense.vue";
@ -161,19 +160,19 @@ import { fetchInstance } from "@/instance";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
let useObjectStorage: boolean = ref(false);
let objectStorageBaseUrl: string | null = ref(null);
let objectStorageBucket: string | null = ref(null);
let objectStoragePrefix: string | null = ref(null);
let objectStorageEndpoint: string | null = ref(null);
let objectStorageRegion: string | null = ref(null);
let objectStoragePort: number | null = ref(null);
let objectStorageAccessKey: string | null = ref(null);
let objectStorageSecretKey: string | null = ref(null);
let objectStorageUseSSL: boolean = ref(false);
let objectStorageUseProxy: boolean = ref(false);
let objectStorageSetPublicRead: boolean = ref(false);
let objectStorageS3ForcePathStyle: boolean = ref(true);
const useObjectStorage = ref(false);
const objectStorageBaseUrl = ref<string | null>(null);
const objectStorageBucket = ref<string | null>(null);
const objectStoragePrefix = ref<string | null>(null);
const objectStorageEndpoint = ref<string | null>(null);
const objectStorageRegion = ref<string | null>(null);
const objectStoragePort = ref<string | null>(null);
const objectStorageAccessKey = ref<string | null>(null);
const objectStorageSecretKey = ref<string | null>(null);
const objectStorageUseSSL = ref(false);
const objectStorageUseProxy = ref(false);
const objectStorageSetPublicRead = ref(false);
const objectStorageS3ForcePathStyle = ref(true);
async function init() {
const meta = await os.api("admin/meta");

View File

@ -15,7 +15,6 @@
<script lang="ts" setup>
import { computed } from "vue";
import {} from "vue";
import FormSuspense from "@/components/form/suspense.vue";
import * as os from "@/os";
import { fetchInstance } from "@/instance";

View File

@ -8,32 +8,22 @@
</template>
<script lang="ts" setup>
import {
markRaw,
version as vueVersion,
onMounted,
onBeforeUnmount,
nextTick,
shallowRef,
ref,
} from "vue";
import { onMounted, shallowRef, ref } from "vue";
import { Chart } from "chart.js";
import tinycolor from "tinycolor2";
import gradient from "chartjs-plugin-gradient";
import * as os from "@/os";
import { defaultStore } from "@/store";
import { useChartTooltip } from "@/scripts/use-chart-tooltip";
import { chartVLine } from "@/scripts/chart-vline";
import { alpha } from "@/scripts/color";
import { initChart } from "@/scripts/init-chart";
initChart();
const chartEl = shallowRef<HTMLCanvasElement>(null);
const chartEl = shallowRef<HTMLCanvasElement>();
const now = new Date();
let chartInstance: Chart = null;
let chartInstance: Chart | null = null;
const chartLimit = 7;
let fetching = ref(true);
const fetching = ref(true);
const { handler: externalTooltipHandler } = useChartTooltip();
@ -69,8 +59,6 @@ async function renderChart() {
const colorRead = "#eb6f92";
const colorWrite = "#f6c177";
const max = Math.max(...raw.read);
chartInstance = new Chart(chartEl.value, {
type: "bar",
data: {

View File

@ -15,15 +15,10 @@
</template>
<script lang="ts" setup>
import { onMounted, onUnmounted, ref, shallowRef } from "vue";
import { onMounted, ref, shallowRef } from "vue";
import { Chart } from "chart.js";
import gradient from "chartjs-plugin-gradient";
import tinycolor from "tinycolor2";
import MkMiniChart from "@/components/MkMiniChart.vue";
import * as os from "@/os";
import number from "@/filters/number";
import MkNumberDiff from "@/components/MkNumberDiff.vue";
import { i18n } from "@/i18n";
import { useChartTooltip } from "@/scripts/use-chart-tooltip";
import { chartVLine } from "@/scripts/chart-vline";
import { defaultStore } from "@/store";
@ -35,7 +30,7 @@ initChart();
const chartLimit = 50;
const chartEl = shallowRef<HTMLCanvasElement>();
const chartEl2 = shallowRef<HTMLCanvasElement>();
let fetching = ref(true);
const fetching = ref(true);
const { handler: externalTooltipHandler } = useChartTooltip();
const { handler: externalTooltipHandler2 } = useChartTooltip();
@ -76,9 +71,6 @@ onMounted(async () => {
const succColor = "#9ccfd8";
const failColor = "#f6c177";
const succMax = Math.max(...raw.deliverSucceeded);
const failMax = Math.max(...raw.deliverFailed);
new Chart(chartEl.value, {
type: "line",
data: {

View File

@ -56,24 +56,23 @@
</template>
<script lang="ts" setup>
import { onMounted, onUnmounted, ref } from "vue";
import { onMounted, ref } from "vue";
import XPie from "./overview.pie.vue";
import MkMiniChart from "@/components/MkMiniChart.vue";
import * as os from "@/os";
import number from "@/filters/number";
import MkNumberDiff from "@/components/MkNumberDiff.vue";
import { i18n } from "@/i18n";
import { useChartTooltip } from "@/scripts/use-chart-tooltip";
let topSubInstancesForPie: any = ref(null);
let topPubInstancesForPie: any = ref(null);
let federationPubActive = ref<number | null>(null);
let federationPubActiveDiff = ref<number | null>(null);
let federationSubActive = ref<number | null>(null);
let federationSubActiveDiff = ref<number | null>(null);
let fetching = ref(true);
const topSubInstancesForPie = ref<any>(null);
const topPubInstancesForPie = ref<any>(null);
const federationPubActive = ref<number | null>(null);
const federationPubActiveDiff = ref<number | null>(null);
const federationSubActive = ref<number | null>(null);
const federationSubActiveDiff = ref<number | null>(null);
const fetching = ref(true);
const { handler: externalTooltipHandler } = useChartTooltip();
useChartTooltip();
onMounted(async () => {
const chart = await os.apiGet("charts/federation", {

View File

@ -23,7 +23,7 @@ import { ref } from "vue";
import MkHeatmap from "@/components/MkHeatmap.vue";
import MkSelect from "@/components/form/select.vue";
let src = ref("notes");
const src = ref("notes");
</script>
<style lang="scss" module>

View File

@ -23,7 +23,7 @@
</template>
<script lang="ts" setup>
import { onMounted, onUnmounted, ref } from "vue";
import { ref } from "vue";
import * as os from "@/os";
import { useInterval } from "@/scripts/use-interval";
import MkInstanceCardMini from "@/components/MkInstanceCardMini.vue";

View File

@ -64,17 +64,17 @@ import { i18n } from "@/i18n";
const meta = await os.api("server-info", {});
const serverStats = await os.api("stats");
let cpuUsage: number = ref(0);
const cpuUsage = ref(0);
let memUsage: number = ref(0);
let memTotal: number = ref(0);
let memUsed: number = ref(0);
let memFree: number = ref(0);
const memUsage = ref(0);
const memTotal = ref(0);
const memUsed = ref(0);
const memFree = ref(0);
let meiliProgress: number = ref(0);
let meiliTotalSize: number = ref(0);
let meiliIndexCount: number = ref(0);
let meiliAvailable: string = ref("unavailable");
const meiliProgress = ref(0);
const meiliTotalSize = ref(0);
const meiliIndexCount = ref(0);
const meiliAvailable = ref("unavailable");
const diskUsage = computed(() => meta.fs.used / meta.fs.total);
const diskTotal = computed(() => meta.fs.total);

View File

@ -25,13 +25,11 @@
</template>
<script lang="ts" setup>
import { onMounted, onUnmounted, ref } from "vue";
import { onMounted, ref } from "vue";
import * as os from "@/os";
import number from "@/filters/number";
import { i18n } from "@/i18n";
let moderators: any = ref(null);
let fetching = ref(true);
const moderators = ref<any>(null);
const fetching = ref(true);
onMounted(async () => {
moderators.value = await os.api("admin/show-users", {

View File

@ -3,10 +3,8 @@
</template>
<script lang="ts" setup>
import { onMounted, onUnmounted, ref, shallowRef } from "vue";
import { onMounted, shallowRef } from "vue";
import { Chart } from "chart.js";
import number from "@/filters/number";
import { defaultStore } from "@/store";
import { useChartTooltip } from "@/scripts/use-chart-tooltip";
import { initChart } from "@/scripts/init-chart";
@ -21,7 +19,7 @@ const props = defineProps<{
}[];
}>();
const chartEl = shallowRef<HTMLCanvasElement>(null);
const chartEl = shallowRef<HTMLCanvasElement>();
const { handler: externalTooltipHandler } = useChartTooltip({
position: "middle",
@ -83,5 +81,3 @@ onMounted(() => {
});
});
</script>
<style lang="scss" scoped></style>

View File

@ -3,7 +3,7 @@
</template>
<script lang="ts" setup>
import { defineComponent, onMounted, onUnmounted, ref } from "vue";
import { onMounted, onUnmounted, ref } from "vue";
import {
Chart,
ArcElement,
@ -21,9 +21,6 @@ import {
SubTitle,
Filler,
} from "chart.js";
import number from "@/filters/number";
import * as os from "@/os";
import { defaultStore } from "@/store";
import { useChartTooltip } from "@/scripts/use-chart-tooltip";
Chart.register(
@ -56,11 +53,7 @@ const alpha = (hex, a) => {
return `rgba(${r}, ${g}, ${b}, ${a})`;
};
const chartEl = ref<HTMLCanvasElement>(null);
const gridColor = defaultStore.state.darkMode
? "rgba(255, 255, 255, 0.1)"
: "rgba(0, 0, 0, 0.1)";
const chartEl = ref<HTMLCanvasElement | null>(null);
//
Chart.defaults.color = getComputedStyle(
@ -72,7 +65,7 @@ const { handler: externalTooltipHandler } = useChartTooltip();
let chartInstance: Chart;
const onStats = (stats) => {
chartInstance.data.labels.push("");
chartInstance.data.labels?.push("");
chartInstance.data.datasets[0].data.push(
stats[props.domain].activeSincePrevTick,
);
@ -80,7 +73,7 @@ const onStats = (stats) => {
chartInstance.data.datasets[2].data.push(stats[props.domain].waiting);
chartInstance.data.datasets[3].data.push(stats[props.domain].delayed);
if (chartInstance.data.datasets[0].data.length > 100) {
chartInstance.data.labels.shift();
chartInstance.data.labels?.shift();
chartInstance.data.datasets[0].data.shift();
chartInstance.data.datasets[1].data.shift();
chartInstance.data.datasets[2].data.shift();
@ -91,7 +84,7 @@ const onStats = (stats) => {
const onStatsLog = (statsLog) => {
for (const stats of [...statsLog].reverse()) {
chartInstance.data.labels.push("");
chartInstance.data.labels?.push("");
chartInstance.data.datasets[0].data.push(
stats[props.domain].activeSincePrevTick,
);
@ -99,7 +92,7 @@ const onStatsLog = (statsLog) => {
chartInstance.data.datasets[2].data.push(stats[props.domain].waiting);
chartInstance.data.datasets[3].data.push(stats[props.domain].delayed);
if (chartInstance.data.datasets[0].data.length > 100) {
chartInstance.data.labels.shift();
chartInstance.data.labels?.shift();
chartInstance.data.datasets[0].data.shift();
chartInstance.data.datasets[1].data.shift();
chartInstance.data.datasets[2].data.shift();
@ -218,5 +211,3 @@ onUnmounted(() => {
props.connection.off("statsLog", onStatsLog);
});
</script>
<style lang="scss" scoped></style>

View File

@ -3,10 +3,8 @@
</template>
<script lang="ts" setup>
import { watch, onMounted, onUnmounted, ref, shallowRef } from "vue";
import { onMounted, shallowRef } from "vue";
import { Chart } from "chart.js";
import number from "@/filters/number";
import * as os from "@/os";
import { defaultStore } from "@/store";
import { useChartTooltip } from "@/scripts/use-chart-tooltip";
import { chartVLine } from "@/scripts/chart-vline";
@ -19,7 +17,7 @@ const props = defineProps<{
type: string;
}>();
const chartEl = shallowRef<HTMLCanvasElement>(null);
const chartEl = shallowRef<HTMLCanvasElement>();
const { handler: externalTooltipHandler } = useChartTooltip();
@ -28,10 +26,10 @@ let chartInstance: Chart;
function setData(values) {
if (chartInstance == null) return;
for (const value of values) {
chartInstance.data.labels.push("");
chartInstance.data.labels?.push("");
chartInstance.data.datasets[0].data.push(value);
if (chartInstance.data.datasets[0].data.length > 100) {
chartInstance.data.labels.shift();
chartInstance.data.labels?.shift();
chartInstance.data.datasets[0].data.shift();
}
}
@ -40,10 +38,10 @@ function setData(values) {
function pushData(value) {
if (chartInstance == null) return;
chartInstance.data.labels.push("");
chartInstance.data.labels?.push("");
chartInstance.data.datasets[0].data.push(value);
if (chartInstance.data.datasets[0].data.length > 100) {
chartInstance.data.labels.shift();
chartInstance.data.labels?.shift();
chartInstance.data.datasets[0].data.shift();
}
chartInstance.update();
@ -145,5 +143,3 @@ defineExpose({
pushData,
});
</script>
<style lang="scss" scoped></style>

View File

@ -45,9 +45,7 @@
import { markRaw, onMounted, onUnmounted, ref, shallowRef } from "vue";
import XChart from "./overview.queue.chart.vue";
import number from "@/filters/number";
import * as os from "@/os";
import { stream } from "@/stream";
import { i18n } from "@/i18n";
const connection = markRaw(stream.useChannel("queueStats"));
@ -55,10 +53,10 @@ const activeSincePrevTick = ref(0);
const active = ref(0);
const delayed = ref(0);
const waiting = ref(0);
let chartProcess = shallowRef<InstanceType<typeof XChart>>();
let chartActive = shallowRef<InstanceType<typeof XChart>>();
let chartDelayed = shallowRef<InstanceType<typeof XChart>>();
let chartWaiting = shallowRef<InstanceType<typeof XChart>>();
const chartProcess = shallowRef<InstanceType<typeof XChart>>();
const chartActive = shallowRef<InstanceType<typeof XChart>>();
const chartDelayed = shallowRef<InstanceType<typeof XChart>>();
const chartWaiting = shallowRef<InstanceType<typeof XChart>>();
const props = defineProps<{
domain: string;
@ -70,10 +68,10 @@ const onStats = (stats) => {
delayed.value = stats[props.domain].delayed;
waiting.value = stats[props.domain].waiting;
chartProcess.value.pushData(stats[props.domain].activeSincePrevTick);
chartActive.value.pushData(stats[props.domain].active);
chartDelayed.value.pushData(stats[props.domain].delayed);
chartWaiting.value.pushData(stats[props.domain].waiting);
chartProcess.value?.pushData(stats[props.domain].activeSincePrevTick);
chartActive.value?.pushData(stats[props.domain].active);
chartDelayed.value?.pushData(stats[props.domain].delayed);
chartWaiting.value?.pushData(stats[props.domain].waiting);
};
const onStatsLog = (statsLog) => {
@ -89,10 +87,10 @@ const onStatsLog = (statsLog) => {
dataWaiting.push(stats[props.domain].waiting);
}
chartProcess.value.setData(dataProcess);
chartActive.value.setData(dataActive);
chartDelayed.value.setData(dataDelayed);
chartWaiting.value.setData(dataWaiting);
chartProcess.value?.setData(dataProcess);
chartActive.value?.setData(dataActive);
chartDelayed.value?.setData(dataDelayed);
chartWaiting.value?.setData(dataWaiting);
};
onMounted(() => {

View File

@ -94,20 +94,18 @@
</template>
<script lang="ts" setup>
import { onMounted, onUnmounted, ref } from "vue";
import MkMiniChart from "@/components/MkMiniChart.vue";
import { onMounted, ref } from "vue";
import * as os from "@/os";
import number from "@/filters/number";
import MkNumberDiff from "@/components/MkNumberDiff.vue";
import MkNumber from "@/components/MkNumber.vue";
import { i18n } from "@/i18n";
let stats: any = ref(null);
let usersComparedToThePrevDay = ref<number>();
let notesComparedToThePrevDay = ref<number>();
let onlineUsersCount = ref(0);
let emojiCount = ref(0);
let fetching = ref(true);
const stats = ref(null);
const usersComparedToThePrevDay = ref<number>();
const notesComparedToThePrevDay = ref<number>();
const onlineUsersCount = ref(0);
const emojiCount = ref(0);
const fetching = ref(true);
onMounted(async () => {
const [_stats, _onlineUsersCount] = await Promise.all([

View File

@ -28,7 +28,7 @@ const props = defineProps<{
user: misskey.entities.User;
}>();
let chart = ref(null);
const chart = ref(null);
os.apiGet("charts/user/notes", {
userId: props.user.id,

View File

@ -7,7 +7,7 @@
<MkLoading v-if="fetching" />
<div v-else class="users">
<MkA
v-for="(user, i) in newUsers"
v-for="user in newUsers"
:key="user.id"
:to="`/user-info/${user.id}`"
class="user"
@ -20,13 +20,13 @@
</template>
<script lang="ts" setup>
import { onMounted, onUnmounted, ref } from "vue";
import { ref } from "vue";
import * as os from "@/os";
import { useInterval } from "@/scripts/use-interval";
import MkUserCardMini from "@/components/MkUserCardMini.vue";
let newUsers = ref(null);
let fetching = ref(true);
const newUsers = ref(null);
const fetching = ref(true);
const fetch = async () => {
const _newUsers = await os.api("admin/show-users", {

View File

@ -62,13 +62,11 @@
<script lang="ts" setup>
import {
markRaw,
version as vueVersion,
onMounted,
onBeforeUnmount,
nextTick,
shallowRef,
ref,
computed,
} from "vue";
import XFederation from "./overview.federation.vue";
import XInstances from "./overview.instances.vue";
@ -80,37 +78,23 @@ import XStats from "./overview.stats.vue";
import XModerators from "./overview.moderators.vue";
import XHeatmap from "./overview.heatmap.vue";
// import XMetrics from "./overview.metrics.vue";
import MkTagCloud from "@/components/MkTagCloud.vue";
import { version, url } from "@/config";
import * as os from "@/os";
import { stream } from "@/stream";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
import { defaultStore } from "@/store";
import MkFileListForAdmin from "@/components/MkFileListForAdmin.vue";
import MkFolder from "@/components/MkFolder.vue";
const rootEl = shallowRef<HTMLElement>();
let serverInfo: any = ref(null);
let topSubInstancesForPie: any = ref(null);
let topPubInstancesForPie: any = ref(null);
let federationPubActive = ref<number | null>(null);
let federationPubActiveDiff = ref<number | null>(null);
let federationSubActive = ref<number | null>(null);
let federationSubActiveDiff = ref<number | null>(null);
let newUsers = ref(null);
let activeInstances = shallowRef(null);
const serverInfo = ref<any>(null);
const topSubInstancesForPie = ref<any>(null);
const topPubInstancesForPie = ref<any>(null);
const federationPubActive = ref<number | null>(null);
const federationPubActiveDiff = ref<number | null>(null);
const federationSubActive = ref<number | null>(null);
const federationSubActiveDiff = ref<number | null>(null);
const newUsers = ref(null);
const activeInstances = shallowRef(null);
const queueStatsConnection = markRaw(stream.useChannel("queueStats"));
const now = new Date();
const filesPagination = {
endpoint: "admin/drive/files" as const,
limit: 9,
noPaging: true,
};
function onInstanceClick(i) {
os.pageWindow(`/instance-info/${i.host}`);
}
onMounted(async () => {
/*
@ -185,7 +169,7 @@ onMounted(async () => {
nextTick(() => {
queueStatsConnection.send("requestLog", {
id: Math.random().toString().substr(2, 8),
id: Math.random().toString().slice(2, 10),
length: 100,
});
});
@ -195,10 +179,6 @@ onBeforeUnmount(() => {
queueStatsConnection.dispose();
});
const headerActions = computed(() => []);
const headerTabs = computed(() => []);
definePageMetadata({
title: i18n.ts.dashboard,
icon: "ph-gauge ph-bold ph-lg",

View File

@ -65,7 +65,6 @@
<script lang="ts" setup>
import { ref, computed } from "vue";
import {} from "vue";
import MkButton from "@/components/MkButton.vue";
import MkInput from "@/components/form/input.vue";
import MkTextarea from "@/components/form/textarea.vue";
@ -76,12 +75,12 @@ import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
import { formatDateTimeString } from "@/scripts/format-time-string";
let ads: any[] = ref([]);
const ads = ref([]);
os.api("admin/ad/list").then((adsResponse) => {
ads.value = adsResponse;
// The date format should be changed to yyyy-MM-dd in order to be properly displayed
for (let i in ads.value) {
for (const i in ads.value) {
ads.value[i].expiresAt = ads.value[i].expiresAt.substr(0, 10);
}
});

View File

@ -37,7 +37,6 @@
<script lang="ts" setup>
import { ref, computed } from "vue";
import {} from "vue";
import MkKeyValue from "@/components/MkKeyValue.vue";
import MkButton from "@/components/MkButton.vue";
import MkInfo from "@/components/MkInfo.vue";
@ -47,8 +46,8 @@ import { fetchInstance } from "@/instance";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
let proxyAccount: any = ref(null);
let proxyAccountId: any = ref(null);
const proxyAccount = ref<any>(null);
const proxyAccountId = ref<any>(null);
async function init() {
const meta = await os.api("admin/meta");

View File

@ -3,7 +3,7 @@
</template>
<script lang="ts" setup>
import { watch, onMounted, onUnmounted, ref } from "vue";
import { onMounted, ref } from "vue";
import {
Chart,
ArcElement,
@ -21,8 +21,6 @@ import {
SubTitle,
Filler,
} from "chart.js";
import number from "@/filters/number";
import * as os from "@/os";
import { defaultStore } from "@/store";
import { useChartTooltip } from "@/scripts/use-chart-tooltip";
@ -55,7 +53,7 @@ const alpha = (hex, a) => {
return `rgba(${r}, ${g}, ${b}, ${a})`;
};
const chartEl = ref<HTMLCanvasElement>(null);
const chartEl = ref<HTMLCanvasElement | null>(null);
const gridColor = defaultStore.state.darkMode
? "rgba(255, 255, 255, 0.1)"
@ -189,5 +187,3 @@ defineExpose({
pushData,
});
</script>
<style lang="scss" scoped></style>

View File

@ -72,10 +72,10 @@ const active = ref(0);
const delayed = ref(0);
const waiting = ref(0);
const jobs = ref([]);
let chartProcess = ref<InstanceType<typeof XChart>>();
let chartActive = ref<InstanceType<typeof XChart>>();
let chartDelayed = ref<InstanceType<typeof XChart>>();
let chartWaiting = ref<InstanceType<typeof XChart>>();
const chartProcess = ref<InstanceType<typeof XChart>>();
const chartActive = ref<InstanceType<typeof XChart>>();
const chartDelayed = ref<InstanceType<typeof XChart>>();
const chartWaiting = ref<InstanceType<typeof XChart>>();
const props = defineProps<{
domain: string;

View File

@ -15,34 +15,13 @@
</template>
<script lang="ts" setup>
import {
markRaw,
onMounted,
onBeforeUnmount,
nextTick,
ref,
computed,
} from "vue";
import { ref, computed } from "vue";
import XQueue from "./queue.chart.vue";
import MkButton from "@/components/MkButton.vue";
import * as os from "@/os";
import * as config from "@/config";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
let tab = ref("deliver");
function clear() {
os.confirm({
type: "warning",
title: i18n.ts.clearQueueConfirmTitle,
text: i18n.ts.clearQueueConfirmText,
}).then(({ canceled }) => {
if (canceled) return;
os.apiWithDialog("admin/queue/clear");
});
}
const tab = ref("deliver");
const headerActions = computed(() => [
{

View File

@ -45,13 +45,12 @@
<script lang="ts" setup>
import { ref, computed } from "vue";
import {} from "vue";
import MkButton from "@/components/MkButton.vue";
import * as os from "@/os";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
let relays: any[] = ref([]);
const relays = ref([]);
async function addRelay() {
const { canceled, result: inbox } = await os.inputText({

View File

@ -257,12 +257,10 @@
<script lang="ts" setup>
import { ref, computed } from "vue";
import {} from "vue";
import XBotProtection from "./bot-protection.vue";
import FormFolder from "@/components/form/folder.vue";
import FormRadios from "@/components/form/radios.vue";
import FormSwitch from "@/components/form/switch.vue";
import FormInfo from "@/components/MkInfo.vue";
import FormSuspense from "@/components/form/suspense.vue";
import FormRange from "@/components/form/range.vue";
import FormInput from "@/components/form/input.vue";
@ -273,19 +271,19 @@ import { fetchInstance } from "@/instance";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
let summalyProxy: string = ref("");
let enableHcaptcha: boolean = ref(false);
let enableRecaptcha: boolean = ref(false);
let sensitiveMediaDetection: string = ref("none");
let sensitiveMediaDetectionSensitivity: number = ref(0);
let setSensitiveFlagAutomatically: boolean = ref(false);
let enableSensitiveMediaDetectionForVideos: boolean = ref(false);
let enableIpLogging: boolean = ref(false);
let enableActiveEmailValidation: boolean = ref(false);
const summalyProxy = ref("");
const enableHcaptcha = ref(false);
const enableRecaptcha = ref(false);
const sensitiveMediaDetection = ref("none");
const sensitiveMediaDetectionSensitivity = ref(0);
const setSensitiveFlagAutomatically = ref(false);
const enableSensitiveMediaDetectionForVideos = ref(false);
const enableIpLogging = ref(false);
const enableActiveEmailValidation = ref(false);
let secureMode: boolean = ref(false);
let privateMode: boolean = ref(false);
let allowedHosts: string = ref("");
const secureMode = ref(false);
const privateMode = ref(false);
const allowedHosts = ref("");
async function init() {
const meta = await os.api("admin/meta");

View File

@ -209,7 +209,7 @@
<FormInput v-model="themeColor" class="_formBlock">
<template #prefix
><i class="ph-palette ph-bold ph-lg"></i
><i class="ph-paconstte ph-bold ph-lg"></i
></template>
<template #label>{{
i18n.ts.themeColor
@ -442,42 +442,42 @@ import { fetchInstance } from "@/instance";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
let name: string | null = ref(null);
let description: string | null = ref(null);
let tosUrl: string | null = ref(null);
let maintainerName: string | null = ref(null);
let maintainerEmail: string | null = ref(null);
let donationLink: string | null = ref(null);
let iconUrl: string | null = ref(null);
let bannerUrl: string | null = ref(null);
let logoImageUrl: string | null = ref(null);
let backgroundImageUrl: string | null = ref(null);
let themeColor: any = ref(null);
let defaultLightTheme: any = ref(null);
let defaultDarkTheme: any = ref(null);
let enableLocalTimeline: boolean = ref(false);
let enableGlobalTimeline: boolean = ref(false);
let enableRecommendedTimeline: boolean = ref(false);
let pinnedUsers: string = ref("");
let customMOTD: string = ref("");
let recommendedInstances: string = ref("");
let customSplashIcons: string = ref("");
let cacheRemoteFiles: boolean = ref(false);
let localDriveCapacityMb: any = ref(0);
let remoteDriveCapacityMb: any = ref(0);
let enableRegistration: boolean = ref(false);
let emailRequiredForSignup: boolean = ref(false);
let enableServiceWorker: boolean = ref(false);
let swPublicKey: any = ref(null);
let swPrivateKey: any = ref(null);
let deeplAuthKey: string = ref("");
let deeplIsPro: boolean = ref(false);
let libreTranslateApiUrl: string = ref("");
let libreTranslateApiKey: string = ref("");
let defaultReaction: string = ref("");
let defaultReactionCustom: string = ref("");
let enableServerMachineStats: boolean = ref(false);
let enableIdenticonGeneration: boolean = ref(false);
const name = ref<string | null>(null);
const description = ref<string | null>(null);
const tosUrl = ref<string | null>(null);
const maintainerName = ref<string | null>(null);
const maintainerEmail = ref<string | null>(null);
const donationLink = ref<string | null>(null);
const iconUrl = ref<string | null>(null);
const bannerUrl = ref<string | null>(null);
const logoImageUrl = ref<string | null>(null);
const backgroundImageUrl = ref<string | null>(null);
const themeColor: any = ref(null);
const defaultLightTheme: any = ref(null);
const defaultDarkTheme: any = ref(null);
const enableLocalTimeline = ref(false);
const enableGlobalTimeline = ref(false);
const enableRecommendedTimeline = ref(false);
const pinnedUsers = ref("");
const customMOTD = ref("");
const recommendedInstances = ref("");
const customSplashIcons = ref("");
const cacheRemoteFiles = ref(false);
const localDriveCapacityMb = ref(0);
const remoteDriveCapacityMb = ref(0);
const enableRegistration = ref(false);
const emailRequiredForSignup = ref(false);
const enableServiceWorker = ref(false);
const swPublicKey = ref(null);
const swPrivateKey = ref(null);
const deeplAuthKey = ref("");
const deeplIsPro = ref(false);
const libreTranslateApiUrl = ref("");
const libreTranslateApiKey = ref("");
const defaultReaction = ref("");
const defaultReactionCustom = ref("");
const enableServerMachineStats = ref(false);
const enableIdenticonGeneration = ref(false);
async function init() {
const meta = await os.api("admin/meta");
@ -554,8 +554,8 @@ function save() {
customSplashIcons: customSplashIcons.value.split("\n"),
recommendedInstances: recommendedInstances.value.split("\n"),
cacheRemoteFiles: cacheRemoteFiles.value,
localDriveCapacityMb: parseInt(localDriveCapacityMb.value, 10),
remoteDriveCapacityMb: parseInt(remoteDriveCapacityMb.value, 10),
localDriveCapacityMb: localDriveCapacityMb.value,
remoteDriveCapacityMb: remoteDriveCapacityMb.value,
disableRegistration: !enableRegistration.value,
emailRequiredForSignup: emailRequiredForSignup.value,
enableServiceWorker: enableServiceWorker.value,

View File

@ -133,13 +133,13 @@ import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
import MkUserCardMini from "@/components/MkUserCardMini.vue";
let paginationComponent = ref<InstanceType<typeof MkPagination>>();
const paginationComponent = ref<InstanceType<typeof MkPagination>>();
let sort = ref("+createdAt");
let state = ref("all");
let origin = ref("local");
let searchUsername = ref("");
let searchHost = ref("");
const sort = ref("+createdAt");
const state = ref("all");
const origin = ref("local");
const searchUsername = ref("");
const searchHost = ref("");
const pagination = {
endpoint: "admin/show-users" as const,
limit: 10,

View File

@ -24,7 +24,7 @@
</template>
<script lang="ts" setup>
import { computed, inject, watch, ref } from "vue";
import { computed, watch, ref } from "vue";
import XTimeline from "@/components/MkTimeline.vue";
import * as os from "@/os";
import { useRouter } from "@/router";
@ -37,41 +37,28 @@ const props = defineProps<{
antennaId: string;
}>();
let antenna = ref(null);
let rootEl = ref<HTMLElement>();
let tlEl = ref<InstanceType<typeof XTimeline>>();
const antenna = ref(null);
const rootEl = ref<HTMLElement>();
const tlEl = ref<InstanceType<typeof XTimeline>>();
const keymap = computed(() => ({
t: focus,
}));
async function timetravel() {
const { canceled, result: date } = await os.inputDate({
title: i18n.ts.date,
});
if (canceled) return;
tlEl.value.timetravel(date);
}
function settings() {
router.push(`/my/antennas/${props.antennaId}`);
}
async function doMarkRead() {
const ret = await os.api("antennas/mark-read", {
antennaId: props.antennaId,
});
if (ret) {
return true;
}
throw new Error("Failed to mark all as read");
}
async function markRead() {
await os.promiseDialog(doMarkRead());
}
// async function doMarkRead() {
// const ret = await os.api("antennas/mark-read", {
// antennaId: props.antennaId,
// });
//
// if (ret) {
// return true;
// }
//
// throw new Error("Failed to mark all as read");
// }
function focus() {
tlEl.value.focus();
@ -90,21 +77,11 @@ watch(
const headerActions = computed(() =>
antenna.value
? [
// {
// icon: "ph-calendar-blank ph-bold ph-lg",
// text: i18n.ts.jumpToSpecifiedDate,
// handler: timetravel,
// },
{
icon: "ph-gear-six ph-bold ph-lg",
text: i18n.ts.settings,
handler: settings,
},
// {
// icon: "ph-check ph-bold ph-lg",
// text: i18n.ts.markAllAsRead,
// handler: markRead,
// },
]
: [],
);

View File

@ -26,7 +26,6 @@
</template>
<script lang="ts" setup>
import { defineComponent } from "vue";
import MkButton from "@/components/MkButton.vue";
import * as os from "@/os";
import { i18n } from "@/i18n";

View File

@ -150,5 +150,3 @@ export default defineComponent({
},
});
</script>
<style lang="scss" scoped></style>

View File

@ -40,7 +40,7 @@
</template>
<script lang="ts" setup>
import { computed, inject, watch, ref } from "vue";
import { computed, watch, ref } from "vue";
import MkTextarea from "@/components/form/textarea.vue";
import MkButton from "@/components/MkButton.vue";
import MkInput from "@/components/form/input.vue";
@ -56,11 +56,11 @@ const props = defineProps<{
channelId?: string;
}>();
let channel = ref(null);
let name = ref(null);
let description = ref(null);
let bannerUrl = ref<string | null>(null);
let bannerId = ref<string | null>(null);
const channel = ref(null);
const name = ref(null);
const description = ref(null);
const bannerUrl = ref<string | null>(null);
const bannerId = ref<string | null>(null);
watch(
() => bannerId.value,
@ -140,5 +140,3 @@ definePageMetadata(
),
);
</script>
<style lang="scss" scoped></style>

View File

@ -101,8 +101,7 @@
</template>
<script lang="ts" setup>
import { computed, inject, watch, ref } from "vue";
import MkContainer from "@/components/MkContainer.vue";
import { computed, watch, ref } from "vue";
import XPostForm from "@/components/MkPostForm.vue";
import XTimeline from "@/components/MkTimeline.vue";
import XChannelFollowButton from "@/components/MkChannelFollowButton.vue";
@ -118,8 +117,8 @@ const props = defineProps<{
channelId: string;
}>();
let channel = ref(null);
let showBanner = ref(true);
const channel = ref(null);
const showBanner = ref(true);
watch(
() => props.channelId,

View File

@ -111,16 +111,13 @@
</template>
<script lang="ts" setup>
import { computed, onMounted, defineComponent, inject, watch, ref } from "vue";
import { computed, onMounted, watch, ref } from "vue";
import { Virtual } from "swiper/modules";
import { Swiper, SwiperSlide } from "swiper/vue";
import MkChannelPreview from "@/components/MkChannelPreview.vue";
import MkChannelList from "@/components/MkChannelList.vue";
import MkPagination from "@/components/MkPagination.vue";
import MkInput from "@/components/form/input.vue";
import MkRadios from "@/components/form/radios.vue";
import MkButton from "@/components/MkButton.vue";
import MkFolder from "@/components/MkFolder.vue";
import MkInfo from "@/components/MkInfo.vue";
import { useRouter } from "@/router";
import { definePageMetadata } from "@/scripts/page-metadata";
@ -133,17 +130,17 @@ import "swiper/scss/virtual";
const router = useRouter();
const tabs = ["search", "featured", "following", "owned"];
let tab = ref(tabs[1]);
const tab = ref(tabs[1]);
watch(tab, () => syncSlide(tabs.indexOf(tab.value)));
const props = defineProps<{
query: string;
type?: string;
}>();
let key = ref("");
let searchQuery = ref("");
let searchType = ref("nameAndDescription");
let channelPagination = ref();
const key = ref("");
const searchQuery = ref("");
const searchType = ref("nameAndDescription");
const channelPagination = ref();
onMounted(() => {
searchQuery.value = props.query ?? "";
searchType.value = props.type ?? "nameAndDescription";

View File

@ -40,7 +40,7 @@ const props = defineProps<{
clipId: string;
}>();
let clip: misskey.entities.Clip = ref<misskey.entities.Clip>();
const clip = ref<misskey.entities.Clip>();
const pagination = {
endpoint: "clips/notes" as const,
limit: 10,

View File

@ -7,15 +7,10 @@
<script lang="ts" setup>
import { computed, ref } from "vue";
import XDrive from "@/components/MkDrive.vue";
import * as os from "@/os";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
let folder = ref(null);
const headerActions = computed(() => []);
const headerTabs = computed(() => []);
const folder = ref(null);
definePageMetadata(
computed(() => ({

View File

@ -9,7 +9,6 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import * as os from "@/os";
import copyToClipboard from "@/scripts/copy-to-clipboard";
import { i18n } from "@/i18n";

View File

@ -39,11 +39,5 @@ const paginationForRemote = {
},
};
// const paginationForRemote = {
// endpoint: 'notes/polls/recommendation' as const,
// limit: 10,
// offsetMode: true,
// };
let tab = ref("local");
const tab = ref("local");
</script>

View File

@ -145,20 +145,18 @@ import { computed, watch, ref } from "vue";
import XUserList from "@/components/MkUserList.vue";
import MkFolder from "@/components/MkFolder.vue";
import MkTab from "@/components/MkTab.vue";
import number from "@/filters/number";
import * as os from "@/os";
import { i18n } from "@/i18n";
import { $i } from "@/account";
import { instance } from "@/instance";
const props = defineProps<{
tag?: string;
}>();
let origin = ref("local");
let tagsEl = ref<InstanceType<typeof MkFolder>>();
let tagsLocal = ref([]);
let tagsRemote = ref([]);
const origin = ref("local");
const tagsEl = ref<InstanceType<typeof MkFolder>>();
const tagsLocal = ref([]);
const tagsRemote = ref([]);
watch(
() => props.tag,

View File

@ -50,7 +50,7 @@ import "swiper/scss";
import "swiper/scss/virtual";
const tabs = ["users", "featured"];
let tab = ref(tabs[0]);
const tab = ref(tabs[0]);
watch(tab, () => syncSlide(tabs.indexOf(tab.value)));
const headerActions = computed(() => []);

View File

@ -109,10 +109,6 @@ function reject(user) {
});
}
const headerActions = computed(() => []);
const headerTabs = computed(() => []);
definePageMetadata(
computed(() => ({
title: i18n.ts.followRequests,

View File

@ -3,7 +3,6 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import * as Acct from "firefish-js/built/acct";
import * as os from "@/os";
import { mainRouter } from "@/router";

View File

@ -63,7 +63,7 @@
</template>
<script lang="ts" setup>
import { computed, inject, watch, ref } from "vue";
import { computed, watch, ref } from "vue";
import FormButton from "@/components/MkButton.vue";
import FormInput from "@/components/form/input.vue";
import FormTextarea from "@/components/form/textarea.vue";
@ -81,11 +81,11 @@ const props = defineProps<{
postId?: string;
}>();
let init = ref(null);
let files = ref([]);
let description = ref(null);
let title = ref(null);
let isSensitive = ref(false);
const init = ref(null);
const files = ref([]);
const description = ref(null);
const title = ref(null);
const isSensitive = ref(false);
function selectFile(evt) {
selectFiles(evt.currentTarget ?? evt.target, null).then((selected) => {

View File

@ -106,7 +106,7 @@
</template>
<script lang="ts" setup>
import { computed, defineComponent, watch, onMounted, ref } from "vue";
import { computed, watch, onMounted, ref } from "vue";
import { Virtual } from "swiper/modules";
import { Swiper, SwiperSlide } from "swiper/vue";
import MkFolder from "@/components/MkFolder.vue";
@ -127,10 +127,10 @@ const props = defineProps<{
}>();
const tabs = ["explore", "liked", "my"];
let tab = ref(tabs[0]);
const tab = ref(tabs[0]);
watch(tab, () => syncSlide(tabs.indexOf(tab.value)));
let tagsRef = ref();
const tagsRef = ref();
const recentPostsPagination = {
endpoint: "gallery/posts" as const,

View File

@ -145,7 +145,7 @@
</template>
<script lang="ts" setup>
import { computed, defineComponent, inject, watch, ref } from "vue";
import { computed, watch, ref } from "vue";
import MkButton from "@/components/MkButton.vue";
import * as os from "@/os";
import MkContainer from "@/components/MkContainer.vue";
@ -164,8 +164,8 @@ const props = defineProps<{
postId: string;
}>();
let post = ref(null);
let error = ref(null);
const post = ref(null);
const error = ref(null);
const otherPostsPagination = {
endpoint: "users/gallery/posts" as const,
limit: 6,

View File

@ -378,16 +378,16 @@ const props = defineProps<{
let tabs = ["overview"];
if (iAmAdmin) tabs.push("chart", "users", "raw");
let tab = ref(tabs[0]);
const tab = ref(tabs[0]);
watch(tab, () => syncSlide(tabs.indexOf(tab.value)));
let chartSrc = ref("instance-requests");
let meta = ref<AugmentedInstanceMetadata | null>(null);
let instance = ref<AugmentedInstance | null>(null);
let suspended = ref(false);
let isBlocked = ref(false);
let isSilenced = ref(false);
let faviconUrl = ref(null);
const chartSrc = ref("instance-requests");
const meta = ref<AugmentedInstanceMetadata | null>(null);
const instance = ref<AugmentedInstance | null>(null);
const suspended = ref(false);
const isBlocked = ref(false);
const isSilenced = ref(false);
const faviconUrl = ref(null);
const usersPagination = {
endpoint: iAmAdmin ? "admin/show-users" : ("users" as const),
@ -506,7 +506,7 @@ if (iAmAdmin) {
);
}
let headerTabs = computed(() => theTabs);
const headerTabs = computed(() => theTabs);
definePageMetadata({
title: props.host,

View File

@ -108,11 +108,11 @@ import "swiper/scss/virtual";
const router = useRouter();
let messages = ref([]);
let connection = ref(null);
const messages = ref([]);
const connection = ref(null);
const tabs = ["dms", "groups"];
let tab = ref(tabs[0]);
const tab = ref(tabs[0]);
watch(tab, () => syncSlide(tabs.indexOf(tab.value)));
const MOBILE_THRESHOLD = 500;
@ -203,28 +203,6 @@ function onRead(ids): void {
}
}
function startMenu(ev) {
os.popupMenu(
[
{
text: i18n.ts.messagingWithUser,
icon: "ph-user ph-bold ph-lg",
action: () => {
startUser();
},
},
{
text: i18n.ts.messagingWithGroup,
icon: "ph-users-three ph-bold ph-lg",
action: () => {
startGroup();
},
},
],
ev.currentTarget ?? ev.target,
);
}
async function startUser(): void {
os.selectUser().then((user) => {
router.push(`/my/messaging/${Acct.toString(user)}`);

View File

@ -74,12 +74,12 @@ const props = defineProps<{
group?: Misskey.entities.UserGroup | null;
}>();
let textEl = ref<HTMLTextAreaElement>();
let fileEl = ref<HTMLInputElement>();
const textEl = ref<HTMLTextAreaElement>();
const fileEl = ref<HTMLInputElement>();
let text = ref<string>("");
let file = ref<Misskey.entities.DriveFile | null>(null);
let sending = ref(false);
const text = ref<string>("");
const file = ref<Misskey.entities.DriveFile | null>(null);
const sending = ref(false);
const typing = throttle(3000, () => {
stream.send(
"typingOnMessaging",
@ -87,10 +87,10 @@ const typing = throttle(3000, () => {
);
});
let draftKey = computed(() =>
const draftKey = computed(() =>
props.user ? "user:" + props.user.id : "group:" + props.group?.id,
);
let canSend = computed(
const canSend = computed(
() =>
(text.value != null && text.value.trim() !== "") || file.value != null,
);
@ -166,7 +166,7 @@ function onDrop(ev: DragEvent): void {
function onKeydown(ev: KeyboardEvent) {
typing();
let sendOnEnter =
const sendOnEnter =
localStorage.getItem("enterSendsMessage") === "true" ||
defaultStore.state.enterSendsMessage;
if (sendOnEnter) {

View File

@ -84,7 +84,6 @@
<script lang="ts" setup>
import { computed } from "vue";
import {} from "vue";
import * as mfm from "mfm-js";
import type * as Misskey from "firefish-js";
import XMediaList from "@/components/MkMediaList.vue";

View File

@ -129,21 +129,21 @@ const props = defineProps<{
groupId?: string;
}>();
let rootEl = ref<HTMLDivElement>();
let formEl = ref<InstanceType<typeof XForm>>();
let pagingComponent = ref<InstanceType<typeof MkPagination>>();
const rootEl = ref<HTMLDivElement>();
const formEl = ref<InstanceType<typeof XForm>>();
const pagingComponent = ref<InstanceType<typeof MkPagination>>();
let fetching = ref(true);
let user: Misskey.entities.UserDetailed | null = ref(null);
let group: Misskey.entities.UserGroup | null = ref(null);
let typers: Misskey.entities.User[] = ref([]);
let connection: Misskey.ChannelConnection<
const fetching = ref(true);
const user = ref<Misskey.entities.UserDetailed | null>(null);
const group = ref<Misskey.entities.UserGroup | null>(null);
const typers = ref<Misskey.entities.User[]>([]);
const connection: Misskey.ChannelConnection<
Misskey.Channels["messaging"]
> | null = ref(null);
let showIndicator = ref(false);
const showIndicator = ref(false);
const { animation } = defaultStore.reactiveState;
let pagination: Paging | null = ref(null);
const pagination = ref<Paging | null>(null);
watch([() => props.userAcct, () => props.groupId], () => {
if (connection.value) connection.value.dispose();
@ -323,7 +323,7 @@ function onIndicatorClick() {
thisScrollToBottom();
}
let scrollRemove: (() => void) | null = ref(null);
const scrollRemove = ref<(() => void) | null>(null);
function notifyNewMessage() {
showIndicator.value = true;

View File

@ -149,18 +149,18 @@
</div>
</div>
</div>
<!-- deprecated
<div class="section _block">
<div class="title">{{ i18n.ts._mfm.search }}</div>
<div class="content">
<p>{{ i18n.ts._mfm.searchDescription }}</p>
<div class="preview">
<Mfm :text="preview_search"/>
<MkTextarea v-model="preview_search"><template #label>MFM</template></MkTextarea>
<div class="section _block">
<div class="title">{{ i18n.ts._mfm.search }}</div>
<div class="content">
<p>{{ i18n.ts._mfm.searchDescription }}</p>
<div class="preview">
<Mfm :text="preview_search" />
<MkTextarea v-model="preview_search"
><template #label>MFM</template></MkTextarea
>
</div>
</div>
</div>
</div>
</div>
-->
<div class="section _block">
<div class="title">{{ i18n.ts._mfm.flip }}</div>
<div class="content">
@ -443,7 +443,7 @@
</template>
<script lang="ts" setup>
import { defineComponent, ref } from "vue";
import { ref } from "vue";
import MkTextarea from "@/components/form/textarea.vue";
import { definePageMetadata } from "@/scripts/page-metadata";
import { i18n } from "@/i18n";
@ -453,80 +453,82 @@ defineProps<{
popup?: boolean;
}>();
let preview_mention = ref("@example");
let preview_hashtag = ref("#test");
let preview_link = ref(`[${i18n.ts._mfm.dummy}](https://joinfirefish.org)`);
let preview_emoji = ref(
const preview_mention = ref("@example");
const preview_hashtag = ref("#test");
const preview_link = ref(`[${i18n.ts._mfm.dummy}](https://joinfirefish.org)`);
const preview_emoji = ref(
instance.emojis.length ? `:${instance.emojis[0].name}:` : ":emojiname:",
);
let preview_bold = ref(`**${i18n.ts._mfm.dummy}**`);
let preview_small = ref(
const preview_bold = ref(`**${i18n.ts._mfm.dummy}**`);
const preview_small = ref(
`<small>${i18n.ts._mfm.dummy}</small> $[small ${i18n.ts._mfm.dummy}]`,
);
let preview_center = ref(
`<center>${i18n.ts._mfm.dummy}</center> $[center ${i18n.ts._mfm.dummy}]`,
const preview_center = ref(
`<center>${i18n.ts._mfm.dummy}</center>\n$[center ${i18n.ts._mfm.dummy}]`,
);
let preview_inlineCode = ref('`<: "Hello, world!"`');
let preview_blockCode = ref(
const preview_inlineCode = ref('`<: "Hello, world!"`');
const preview_blockCode = ref(
'```\n~ (#i, 100) {\n\t<: ? ((i % 15) = 0) "FizzBuzz"\n\t\t.? ((i % 3) = 0) "Fizz"\n\t\t.? ((i % 5) = 0) "Buzz"\n\t\t. i\n}\n```',
);
let preview_inlineMath = ref("\\(x= \\frac{-b' \\pm \\sqrt{(b')^2-ac}}{a}\\)");
let preview_blockMath = ref("\\[x= \\frac{-b' \\pm \\sqrt{(b')^2-ac}}{a}\\]");
let preview_quote = ref(`> ${i18n.ts._mfm.dummy}`);
let preview_search = ref(
const preview_inlineMath = ref(
"\\(x= \\frac{-b' \\pm \\sqrt{(b')^2-ac}}{a}\\)",
);
const preview_blockMath = ref("\\[x= \\frac{-b' \\pm \\sqrt{(b')^2-ac}}{a}\\]");
const preview_quote = ref(`> ${i18n.ts._mfm.dummy}`);
const preview_search = ref(
`${i18n.ts._mfm.dummy} [search]\n${i18n.ts._mfm.dummy} [検索]\n${i18n.ts._mfm.dummy} 検索`,
);
let preview_jelly = ref(
const preview_jelly = ref(
"$[jelly 🍮] $[jelly.speed=3s 🍮] $[jelly.delay=3s 🍮] $[jelly.loop=3 🍮]",
);
let preview_tada = ref(
const preview_tada = ref(
"$[tada 🍮] $[tada.speed=3s 🍮] $[tada.delay=3s 🍮] $[tada.loop=3 🍮]",
);
let preview_jump = ref(
const preview_jump = ref(
"$[jump 🍮] $[jump.speed=3s 🍮] $[jump.delay=3s 🍮] $[jump.loop=3 🍮]",
);
let preview_bounce = ref(
const preview_bounce = ref(
"$[bounce 🍮] $[bounce.speed=3s 🍮] $[bounce.delay=3s 🍮] $[bounce.loop=3 🍮]",
);
let preview_shake = ref(
const preview_shake = ref(
"$[shake 🍮] $[shake.speed=3s 🍮] $[shake.delay=3s 🍮] $[shake.loop=3 🍮]",
);
let preview_twitch = ref(
const preview_twitch = ref(
"$[twitch 🍮] $[twitch.speed=3s 🍮] $[twitch.delay=3s 🍮] $[twitch.loop=3 🍮]",
);
let preview_spin = ref(
const preview_spin = ref(
"$[spin 🍮] $[spin.left 🍮] $[spin.alternate 🍮]\n$[spin.x 🍮] $[spin.x,left 🍮] $[spin.x,alternate 🍮]\n$[spin.y 🍮] $[spin.y,left 🍮] $[spin.y,alternate 🍮]\n\n$[spin.speed=3s 🍮] $[spin.delay=3s 🍮] $[spin.loop=3 🍮]",
);
let preview_flip = ref(
const preview_flip = ref(
`$[flip ${i18n.ts._mfm.dummy}]\n$[flip.v ${i18n.ts._mfm.dummy}]\n$[flip.h,v ${i18n.ts._mfm.dummy}]`,
);
let preview_font = ref(
const preview_font = ref(
`$[font.serif ${i18n.ts._mfm.dummy}]\n$[font.monospace ${i18n.ts._mfm.dummy}]\n$[font.cursive ${i18n.ts._mfm.dummy}]\n$[font.fantasy ${i18n.ts._mfm.dummy}]`,
);
let preview_x2 = ref("$[x2 🍮]");
let preview_x3 = ref("$[x3 🍮]");
let preview_x4 = ref("$[x4 🍮]");
let preview_blur = ref(`$[blur ${i18n.ts._mfm.dummy}]`);
let preview_rainbow = ref(
const preview_x2 = ref("$[x2 🍮]");
const preview_x3 = ref("$[x3 🍮]");
const preview_x4 = ref("$[x4 🍮]");
const preview_blur = ref(`$[blur ${i18n.ts._mfm.dummy}]`);
const preview_rainbow = ref(
"$[rainbow 🍮] $[rainbow.speed=3s 🍮] $[rainbow.delay=3s 🍮] $[rainbow.loop=3 🍮]",
);
let preview_sparkle = ref("$[sparkle 🍮]");
let preview_rotate = ref(
const preview_sparkle = ref("$[sparkle 🍮]");
const preview_rotate = ref(
"$[rotate 🍮]\n$[rotate.deg=45 🍮]\n$[rotate.x,deg=45 Hello, world!]",
);
let preview_position = ref("$[position.y=-1 🍮]\n$[position.x=-1 🍮]");
let preview_crop = ref(
const preview_position = ref("$[position.y=-1 🍮]\n$[position.x=-1 🍮]");
const preview_crop = ref(
"$[crop.top=50 🍮] $[crop.right=50 🍮] $[crop.bottom=50 🍮] $[crop.left=50 🍮]",
);
let preview_scale = ref(
const preview_scale = ref(
"$[scale.x=1.3 🍮]\n$[scale.x=1.5,y=3 🍮]\n$[scale.y=0.3 🍮]",
);
let preview_fg = ref("$[fg.color=eb6f92 Text color]");
let preview_bg = ref("$[bg.color=31748f Background color]");
let preview_plain = ref(
const preview_fg = ref("$[fg.color=eb6f92 Text color]");
const preview_bg = ref("$[bg.color=31748f Background color]");
const preview_plain = ref(
"<plain>**bold** @mention #hashtag `code` $[x2 🍮]</plain>",
);
let preview_fade = ref(
const preview_fade = ref(
"$[fade 🍮] $[fade.out 🍮] $[fade.speed=3s 🍮] $[fade.delay=3s 🍮]",
);

View File

@ -80,7 +80,6 @@
<script lang="ts" setup>
import { ref } from "vue";
import {} from "vue";
import MkSignin from "@/components/MkSignin.vue";
import MkButton from "@/components/MkButton.vue";
import * as os from "@/os";
@ -98,7 +97,7 @@ const props = defineProps<{
const _permissions = props.permission.split(",");
let state = ref<string | null>(null);
const state = ref<string | null>(null);
function getIcon(p: string) {
return p.includes("write") ? "pencil-simple" : "eye";

View File

@ -16,7 +16,7 @@ import { useRouter } from "@/router";
const router = useRouter();
let draft = ref({
const draft = ref({
name: "",
src: "all",
userListId: null,
@ -40,5 +40,3 @@ definePageMetadata({
icon: "ph-flying-saucer ph-bold ph-lg",
});
</script>
<style lang="scss" scoped></style>

View File

@ -9,7 +9,7 @@
</template>
<script lang="ts" setup>
import { inject, watch, ref, computed } from "vue";
import { ref } from "vue";
import XAntenna from "./editor.vue";
import * as os from "@/os";
import { i18n } from "@/i18n";
@ -18,7 +18,7 @@ import { definePageMetadata } from "@/scripts/page-metadata";
const router = useRouter();
let antenna: any = ref(null);
const antenna = ref();
const props = defineProps<{
antennaId: string;
@ -34,14 +34,8 @@ os.api("antennas/show", { antennaId: props.antennaId }).then(
},
);
const headerActions = computed(() => []);
const headerTabs = computed(() => []);
definePageMetadata({
title: i18n.ts.manageAntennas,
icon: "ph-flying-saucer ph-bold ph-lg",
});
</script>
<style lang="scss" scoped></style>

View File

@ -134,24 +134,24 @@ const emit = defineEmits<{
(ev: "deleted"): void;
}>();
let name: string = ref(props.antenna.name);
let src: string = ref(props.antenna.src);
let userListId: any = ref(props.antenna.userListId);
let userGroupId: any = ref(props.antenna.userGroupId);
let users: string = ref(props.antenna.users.join("\n"));
let instances: string = ref(props.antenna.instances.join("\n"));
let keywords: string = ref(
const name = ref<string>(props.antenna.name);
const src = ref<string>(props.antenna.src);
const userListId = ref(props.antenna.userListId);
const userGroupId = ref(props.antenna.userGroupId);
const users = ref<string>(props.antenna.users.join("\n"));
const instances = ref<string>(props.antenna.instances.join("\n"));
const keywords = ref<string>(
props.antenna.keywords.map((x) => x.join(" ")).join("\n"),
);
let excludeKeywords: string = ref(
const excludeKeywords = ref<string>(
props.antenna.excludeKeywords.map((x) => x.join(" ")).join("\n"),
);
let caseSensitive: boolean = ref(props.antenna.caseSensitive);
let withReplies: boolean = ref(props.antenna.withReplies);
let withFile: boolean = ref(props.antenna.withFile);
let notify: boolean = ref(props.antenna.notify);
let userLists: any = ref(null);
let userGroups: any = ref(null);
const caseSensitive = ref<boolean>(props.antenna.caseSensitive);
const withReplies = ref<boolean>(props.antenna.withReplies);
const withFile = ref<boolean>(props.antenna.withFile);
const notify = ref<boolean>(props.antenna.notify);
const userLists = ref<any>(null);
const userGroups = ref<any>(null);
watch(
() => src.value,

View File

@ -40,9 +40,7 @@
<script lang="ts" setup>
import { ref, computed } from "vue";
import {} from "vue";
import MkPagination from "@/components/MkPagination.vue";
import MkButton from "@/components/MkButton.vue";
import MkInfo from "@/components/MkInfo.vue";
import * as os from "@/os";
import { i18n } from "@/i18n";
@ -80,14 +78,6 @@ async function create() {
pagingComponent.value.reload();
}
function onClipCreated() {
pagingComponent.value.reload();
}
function onClipDeleted() {
pagingComponent.value.reload();
}
const headerActions = computed(() => []);
const headerTabs = computed(() => []);

View File

@ -44,7 +44,6 @@
<script lang="ts" setup>
import { ref, computed } from "vue";
import {} from "vue";
import MkPagination from "@/components/MkPagination.vue";
import MkButton from "@/components/MkButton.vue";
import MkAvatars from "@/components/MkAvatars.vue";

View File

@ -77,8 +77,8 @@ const props = defineProps<{
listId: string;
}>();
let list = ref(null);
let users = ref([]);
const list = ref<any>(null);
const users = ref([]);
function fetchList() {
os.api("users/lists/show", {

View File

@ -12,15 +12,9 @@
</template>
<script lang="ts" setup>
import { computed } from "vue";
import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata";
const headerActions = computed(() => []);
const headerTabs = computed(() => []);
definePageMetadata({
title: i18n.ts.notFound,
icon: "ph-warning ph-bold ph-lg",

View File

@ -69,7 +69,7 @@
</template>
<script lang="ts" setup>
import { computed, defineComponent, watch, ref } from "vue";
import { computed, watch, ref } from "vue";
import * as misskey from "firefish-js";
import XNoteDetailed from "@/components/MkNoteDetailed.vue";
import XNotes from "@/components/MkNotes.vue";
@ -83,14 +83,14 @@ const props = defineProps<{
noteId: string;
}>();
let note = ref<null | misskey.entities.Note>();
let hasPrev = ref(false);
let hasNext = ref(false);
let showPrev = ref(false);
let showNext = ref(false);
let error = ref();
let isRenote = ref(false);
let appearNote = ref<null | misskey.entities.Note>();
const note = ref<null | misskey.entities.Note>();
const hasPrev = ref(false);
const hasNext = ref(false);
const showPrev = ref(false);
const showNext = ref(false);
const error = ref();
const isRenote = ref(false);
const appearNote = ref<null | misskey.entities.Note>();
const prevPagination = {
endpoint: "users/notes" as const,

View File

@ -66,11 +66,10 @@ import "swiper/scss";
import "swiper/scss/virtual";
const tabs = ["all", "unread", "mentions", "directNotes"];
let tab = ref(tabs[0]);
const tab = ref(tabs[0]);
watch(tab, () => syncSlide(tabs.indexOf(tab.value)));
let includeTypes = ref<string[] | null>(null);
let unreadOnly = computed(() => tab.value === "unread");
const includeTypes = ref<string[] | null>(null);
os.api("notifications/mark-all-as-read");
const MOBILE_THRESHOLD = 500;

View File

@ -96,7 +96,6 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import XContainer from "../page-editor.container.vue";
import MkSelect from "@/components/form/select.vue";
import MkInput from "@/components/form/input.vue";

View File

@ -31,7 +31,6 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import XContainer from "../page-editor.container.vue";
import MkInput from "@/components/form/input.vue";
import { i18n } from "@/i18n";

View File

@ -29,7 +29,6 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import XContainer from "../page-editor.container.vue";
import MkInput from "@/components/form/input.vue";
import { i18n } from "@/i18n";

View File

@ -40,7 +40,7 @@ const props = withDefaults(
},
);
let file: any = ref(null);
const file = ref<any>(null);
async function choose() {
os.selectDriveFile(false).then((fileResponse: any) => {

View File

@ -56,8 +56,8 @@ const props = withDefaults(
},
);
let id: any = ref(props.value.note);
let note: any = ref(null);
const id = ref(props.value.note);
const note = ref(null);
watch(
id.value,

View File

@ -29,7 +29,6 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import XContainer from "../page-editor.container.vue";
import MkInput from "@/components/form/input.vue";
import { i18n } from "@/i18n";

View File

@ -26,7 +26,6 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import XContainer from "../page-editor.container.vue";
import MkTextarea from "@/components/form/textarea.vue";
import MkInput from "@/components/form/input.vue";

View File

@ -52,7 +52,7 @@ const props = withDefaults(
},
);
let values: string = ref(props.value.values.join("\n"));
const values = ref<string>(props.value.values.join("\n"));
watch(
values.value,

View File

@ -28,7 +28,6 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import XContainer from "../page-editor.container.vue";
import MkSwitch from "@/components/form/switch.vue";
import MkInput from "@/components/form/input.vue";

View File

@ -28,7 +28,6 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import XContainer from "../page-editor.container.vue";
import MkInput from "@/components/form/input.vue";
import { i18n } from "@/i18n";

View File

@ -12,7 +12,6 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import XContainer from "../page-editor.container.vue";
import { i18n } from "@/i18n";

View File

@ -28,7 +28,6 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import XContainer from "../page-editor.container.vue";
import MkTextarea from "@/components/form/textarea.vue";
import MkInput from "@/components/form/input.vue";

View File

@ -12,7 +12,6 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import XContainer from "../page-editor.container.vue";
import { i18n } from "@/i18n";

View File

@ -20,7 +20,7 @@
</template>
<script lang="ts">
import { defineComponent, defineAsyncComponent } from "vue";
import { defineComponent } from "vue";
import { VueDraggable } from "vue-draggable-plus";
import XSection from "./els/page-editor.el.section.vue";
import XText from "./els/page-editor.el.text.vue";
@ -37,7 +37,6 @@ import XCounter from "./els/page-editor.el.counter.vue";
import XRadioButton from "./els/page-editor.el.radio-button.vue";
import XCanvas from "./els/page-editor.el.canvas.vue";
import XNote from "./els/page-editor.el.note.vue";
import * as os from "@/os";
export default defineComponent({
components: {

View File

@ -160,7 +160,7 @@
</template>
<script lang="ts" setup>
import { defineAsyncComponent, computed, provide, watch, ref } from "vue";
import { computed, provide, watch, ref } from "vue";
import { v4 as uuid } from "uuid";
import XVariable from "./page-editor.script-block.vue";
import XBlocks from "./page-editor.blocks.vue";
@ -187,25 +187,25 @@ const props = defineProps<{
initUser?: string;
}>();
let tab = ref("settings");
let author = ref($i);
let readonly = ref(false);
let page = ref(null);
let pageId = ref(null);
let currentName = ref(null);
let title = ref("");
let summary = ref(null);
let name = ref(Date.now().toString());
let eyeCatchingImage = ref(null);
let eyeCatchingImageId = ref(null);
let font = ref("sans-serif");
let content = ref([]);
let alignCenter = ref(false);
let isPublic = ref(true);
let hideTitleWhenPinned = ref(false);
let variables = ref([]);
let hpml = ref(null);
let script = ref("");
const tab = ref("settings");
const author = ref($i);
const readonly = ref(false);
const page = ref(null);
const pageId = ref(null);
const currentName = ref(null);
const title = ref("");
const summary = ref(null);
const name = ref(Date.now().toString());
const eyeCatchingImage = ref(null);
const eyeCatchingImageId = ref(null);
const font = ref("sans-serif");
const content = ref([]);
const alignCenter = ref(false);
const isPublic = ref(true);
const hideTitleWhenPinned = ref(false);
const variables = ref([]);
const hpml = ref(null);
const script = ref("");
provide("readonly", readonly.value);
provide("getScriptBlockList", getScriptBlockList);

View File

@ -219,9 +219,9 @@ const props = defineProps<{
username: string;
}>();
let page = ref(null);
let bgImg = ref(null);
let error = ref(null);
const page = ref(null);
const bgImg = ref(null);
const error = ref(null);
const otherPostsPagination = {
endpoint: "users/pages" as const,
limit: 6,

Some files were not shown because too many files have changed in this diff Show More