e.preventDefault()"
v-hotkey="keymap"
@@ -59,6 +60,10 @@ export default defineComponent({
type: String,
requried: false
},
+ width: {
+ type: Number,
+ required: false
+ },
},
emits: ['close'],
data() {
diff --git a/src/client/components/ui/popup-menu.vue b/src/client/components/ui/popup-menu.vue
index 23f7c89f3b..3ff4c658b1 100644
--- a/src/client/components/ui/popup-menu.vue
+++ b/src/client/components/ui/popup-menu.vue
@@ -1,6 +1,6 @@
-
+
@@ -24,6 +24,10 @@ export default defineComponent({
type: String,
required: false
},
+ width: {
+ type: Number,
+ required: false
+ },
viaKeyboard: {
type: Boolean,
required: false
diff --git a/src/client/os.ts b/src/client/os.ts
index 7ae774dd92..743d2d131f 100644
--- a/src/client/os.ts
+++ b/src/client/os.ts
@@ -372,12 +372,17 @@ export async function openEmojiPicker(src?: HTMLElement, opts, initialTextarea:
});
}
-export function popupMenu(items: any[] | Ref
, src?: HTMLElement, options?: { align?: string; viaKeyboard?: boolean }) {
+export function popupMenu(items: any[] | Ref, src?: HTMLElement, options?: {
+ align?: string;
+ width?: number;
+ viaKeyboard?: boolean;
+}) {
return new Promise((resolve, reject) => {
let dispose;
popup(import('@client/components/ui/popup-menu.vue'), {
items,
src,
+ width: options?.width,
align: options?.align,
viaKeyboard: options?.viaKeyboard
}, {
diff --git a/src/client/pages/instance-info.vue b/src/client/pages/instance-info.vue
index 4fbf104f0c..7a4cd5f016 100644
--- a/src/client/pages/instance-info.vue
+++ b/src/client/pages/instance-info.vue
@@ -65,17 +65,17 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -83,7 +83,7 @@
-
+
@@ -135,7 +135,7 @@
+
+
diff --git a/src/client/pages/instance/queue.chart.vue b/src/client/pages/instance/queue.chart.vue
index 887fe9a574..4f8fd762bb 100644
--- a/src/client/pages/instance/queue.chart.vue
+++ b/src/client/pages/instance/queue.chart.vue
@@ -67,7 +67,7 @@ export default defineComponent({
// TODO: var(--panel)の色が暗いか明るいかで判定する
const gridColor = this.$store.state.darkMode ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)';
- Chart.defaults.global.defaultFontColor = getComputedStyle(document.documentElement).getPropertyValue('--fg');
+ Chart.defaults.color = getComputedStyle(document.documentElement).getPropertyValue('--fg');
this.chart = markRaw(new Chart(this.$refs.chart, {
type: 'line',
diff --git a/src/client/scripts/hpml/lib.ts b/src/client/scripts/hpml/lib.ts
index 150a04732f..200faf820b 100644
--- a/src/client/scripts/hpml/lib.ts
+++ b/src/client/scripts/hpml/lib.ts
@@ -1,11 +1,11 @@
import * as tinycolor from 'tinycolor2';
-import Chart from 'chart.js';
import { Hpml } from './evaluator';
import { values, utils } from '@syuilo/aiscript';
import { Fn, HpmlScope } from '.';
import { Expr } from './expr';
import * as seedrandom from 'seedrandom';
+/*
// https://stackoverflow.com/questions/38493564/chart-area-background-color-chartjs
Chart.pluginService.register({
beforeDraw: (chart, easing) => {
@@ -18,6 +18,7 @@ Chart.pluginService.register({
}
}
});
+*/
export function initAiLib(hpml: Hpml) {
return {
@@ -49,11 +50,12 @@ export function initAiLib(hpml: Hpml) {
]));
}),
'MkPages:chart': values.FN_NATIVE(([id, opts]) => {
+ /* TODO
utils.assertString(id);
utils.assertObject(opts);
const canvas = hpml.canvases[id.value];
const color = getComputedStyle(document.documentElement).getPropertyValue('--accent');
- Chart.defaults.global.defaultFontColor = '#555';
+ Chart.defaults.color = '#555';
const chart = new Chart(canvas, {
type: opts.value.get('type').value,
data: {
@@ -122,6 +124,7 @@ export function initAiLib(hpml: Hpml) {
})
}
});
+ */
})
};
}
diff --git a/src/client/scripts/theme.ts b/src/client/scripts/theme.ts
index ad1b033edf..8b63821293 100644
--- a/src/client/scripts/theme.ts
+++ b/src/client/scripts/theme.ts
@@ -27,6 +27,7 @@ export const builtinThemes = [
require('@client/themes/d-astro.json5'),
require('@client/themes/d-future.json5'),
require('@client/themes/d-botanical.json5'),
+ require('@client/themes/d-pumpkin.json5'),
require('@client/themes/d-black.json5'),
] as Theme[];
diff --git a/src/client/themes/d-astro.json5 b/src/client/themes/d-astro.json5
index 2350e3d46d..c6a927ec3a 100644
--- a/src/client/themes/d-astro.json5
+++ b/src/client/themes/d-astro.json5
@@ -1,7 +1,7 @@
{
id: '080a01c5-377d-4fbb-88cc-6bb5d04977ea',
base: 'dark',
- name: 'Mi Astro',
+ name: 'Mi Astro Dark',
author: 'syuilo',
props: {
bg: '#232125',
diff --git a/src/client/themes/d-future.json5 b/src/client/themes/d-future.json5
index 1882609121..b6fa1ab0c1 100644
--- a/src/client/themes/d-future.json5
+++ b/src/client/themes/d-future.json5
@@ -1,7 +1,7 @@
{
id: '32a637ef-b47a-4775-bb7b-bacbb823f865',
- name: 'Mi Future',
+ name: 'Mi Future Dark',
author: 'syuilo',
base: 'dark',
diff --git a/src/client/themes/d-persimmon.json5 b/src/client/themes/d-persimmon.json5
index 11e9994f5e..e36265ff10 100644
--- a/src/client/themes/d-persimmon.json5
+++ b/src/client/themes/d-persimmon.json5
@@ -1,7 +1,7 @@
{
id: 'c503d768-7c70-4db2-a4e6-08264304bc8d',
- name: 'Mi Persimmon',
+ name: 'Mi Persimmon Dark',
author: 'syuilo',
base: 'dark',
diff --git a/src/client/themes/d-pumpkin.json5 b/src/client/themes/d-pumpkin.json5
new file mode 100644
index 0000000000..064ca4577b
--- /dev/null
+++ b/src/client/themes/d-pumpkin.json5
@@ -0,0 +1,88 @@
+{
+ id: '0b64fef3-02c7-20b5-dd87-b3f77e2b4301',
+
+ name: 'Mi Pumpkin Dark',
+ author: 'syuilo',
+
+ base: 'dark',
+
+ props: {
+ X2: ':darken<2<@panel',
+ X3: 'rgba(255, 255, 255, 0.05)',
+ X4: 'rgba(255, 255, 255, 0.1)',
+ X5: 'rgba(255, 255, 255, 0.05)',
+ X6: 'rgba(255, 255, 255, 0.15)',
+ X7: 'rgba(255, 255, 255, 0.05)',
+ X8: ':lighten<5<@accent',
+ X9: ':darken<5<@accent',
+ bg: 'rgb(37, 32, 47)',
+ fg: '#e0d5c0',
+ X10: ':alpha<0.4<@accent',
+ X11: 'rgba(0, 0, 0, 0.3)',
+ X12: 'rgba(255, 255, 255, 0.1)',
+ X13: 'rgba(255, 255, 255, 0.15)',
+ X14: ':alpha<0.5<@navBg',
+ X15: ':alpha<0<@panel',
+ X16: ':alpha<0.7<@panel',
+ X17: ':alpha<0.8<@bg',
+ cwBg: '#687390',
+ cwFg: '#393f4f',
+ link: 'rgb(172, 193, 68)',
+ warn: '#ecb637',
+ badge: '#31b1ce',
+ error: '#ec4137',
+ focus: ':alpha<0.3<@accent',
+ navBg: '@panel',
+ navFg: '@fg',
+ panel: ':lighten<3<@bg',
+ popup: ':lighten<3<@panel',
+ accent: 'rgb(242, 133, 36)',
+ header: ':alpha<0.7<@panel',
+ infoBg: '#253142',
+ infoFg: '#fff',
+ renote: 'rgb(110, 179, 72)',
+ shadow: 'rgba(0, 0, 0, 0.3)',
+ divider: 'rgba(255, 255, 255, 0.1)',
+ hashtag: 'rgb(188, 90, 255)',
+ mention: 'rgb(72, 179, 139)',
+ modalBg: 'rgba(0, 0, 0, 0.5)',
+ success: '#86b300',
+ buttonBg: 'rgba(255, 255, 255, 0.05)',
+ switchBg: 'rgba(255, 255, 255, 0.15)',
+ acrylicBg: ':alpha<0.5<@bg',
+ cwHoverBg: '#707b97',
+ indicator: '@accent',
+ mentionMe: '@accent',
+ messageBg: '@bg',
+ navActive: '@accent',
+ accentedBg: ':alpha<0.15<@accent',
+ fgOnAccent: '#000',
+ infoWarnBg: '#42321c',
+ infoWarnFg: '#ffbd3e',
+ navHoverFg: ':lighten<17<@fg',
+ dateLabelFg: '@fg',
+ inputBorder: 'rgba(255, 255, 255, 0.1)',
+ panelBorder: '" solid 1px var(--divider)',
+ accentDarken: ':darken<10<@accent',
+ acrylicPanel: ':alpha<0.5<@panel',
+ navIndicator: '@indicator',
+ accentLighten: ':lighten<10<@accent',
+ buttonHoverBg: 'rgba(255, 255, 255, 0.1)',
+ driveFolderBg: ':alpha<0.3<@accent',
+ fgHighlighted: ':lighten<3<@fg',
+ fgTransparent: ':alpha<0.5<@fg',
+ panelHeaderBg: ':lighten<3<@panel',
+ panelHeaderFg: '@fg',
+ buttonGradateA: '@accent',
+ buttonGradateB: ':hue<20<@accent',
+ htmlThemeColor: '@bg',
+ panelHighlight: ':lighten<3<@panel',
+ listItemHoverBg: 'rgba(255, 255, 255, 0.03)',
+ scrollbarHandle: 'rgba(255, 255, 255, 0.2)',
+ inputBorderHover: 'rgba(255, 255, 255, 0.2)',
+ wallpaperOverlay: 'rgba(0, 0, 0, 0.5)',
+ fgTransparentWeak: ':alpha<0.75<@fg',
+ panelHeaderDivider: 'rgba(0, 0, 0, 0)',
+ scrollbarHandleHover: 'rgba(255, 255, 255, 0.4)',
+ },
+}
diff --git a/src/client/themes/l-apricot.json5 b/src/client/themes/l-apricot.json5
index 74cb24d407..1ed5525575 100644
--- a/src/client/themes/l-apricot.json5
+++ b/src/client/themes/l-apricot.json5
@@ -1,7 +1,7 @@
{
id: '0ff48d43-aab3-46e7-ab12-8492110d2e2b',
- name: 'Mi Apricot',
+ name: 'Mi Apricot Light',
author: 'syuilo',
base: 'light',
diff --git a/src/client/themes/l-rainy.json5 b/src/client/themes/l-rainy.json5
index 1edde1cabf..283dd74c6c 100644
--- a/src/client/themes/l-rainy.json5
+++ b/src/client/themes/l-rainy.json5
@@ -1,7 +1,7 @@
{
id: 'a58a0abb-ff8c-476a-8dec-0ad7837e7e96',
- name: 'Mi Rainy',
+ name: 'Mi Rainy Light',
author: 'syuilo',
base: 'light',
diff --git a/src/client/themes/l-vivid.json5 b/src/client/themes/l-vivid.json5
index 0f4abe0a45..b3c08f38ae 100644
--- a/src/client/themes/l-vivid.json5
+++ b/src/client/themes/l-vivid.json5
@@ -1,7 +1,7 @@
{
id: '6128c2a9-5c54-43fe-a47d-17942356470b',
- name: 'Mi Vivid',
+ name: 'Mi Vivid Light',
author: 'syuilo',
base: 'light',
diff --git a/src/queue/index.ts b/src/queue/index.ts
index 43c062bae7..37eb809604 100644
--- a/src/queue/index.ts
+++ b/src/queue/index.ts
@@ -10,7 +10,7 @@ import procesObjectStorage from './processors/object-storage/index';
import { queueLogger } from './logger';
import { DriveFile } from '@/models/entities/drive-file';
import { getJobInfo } from './get-job-info';
-import { dbQueue, deliverQueue, inboxQueue, objectStorageQueue } from './queues';
+import { systemQueue, dbQueue, deliverQueue, inboxQueue, objectStorageQueue } from './queues';
import { ThinUser } from './types';
import { IActivity } from '@/remote/activitypub/type';
@@ -22,11 +22,20 @@ function renderError(e: Error): any {
};
}
+const systemLogger = queueLogger.createSubLogger('system');
const deliverLogger = queueLogger.createSubLogger('deliver');
const inboxLogger = queueLogger.createSubLogger('inbox');
const dbLogger = queueLogger.createSubLogger('db');
const objectStorageLogger = queueLogger.createSubLogger('objectStorage');
+systemQueue
+ .on('waiting', (jobId) => systemLogger.debug(`waiting id=${jobId}`))
+ .on('active', (job) => systemLogger.debug(`active id=${job.id}`))
+ .on('completed', (job, result) => systemLogger.debug(`completed(${result}) id=${job.id}`))
+ .on('failed', (job, err) => systemLogger.warn(`failed(${err}) id=${job.id}`, { job, e: renderError(err) }))
+ .on('error', (job: any, err: Error) => systemLogger.error(`error ${err}`, { job, e: renderError(err) }))
+ .on('stalled', (job) => systemLogger.warn(`stalled id=${job.id}`));
+
deliverQueue
.on('waiting', (jobId) => deliverLogger.debug(`waiting id=${jobId}`))
.on('active', (job) => deliverLogger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`))
@@ -220,12 +229,17 @@ export function createCleanRemoteFilesJob() {
}
export default function() {
- if (!envOption.onlyServer) {
- deliverQueue.process(config.deliverJobConcurrency || 128, processDeliver);
- inboxQueue.process(config.inboxJobConcurrency || 16, processInbox);
- processDb(dbQueue);
- procesObjectStorage(objectStorageQueue);
- }
+ if (envOption.onlyServer) return;
+
+ deliverQueue.process(config.deliverJobConcurrency || 128, processDeliver);
+ inboxQueue.process(config.inboxJobConcurrency || 16, processInbox);
+ processDb(dbQueue);
+ procesObjectStorage(objectStorageQueue);
+
+ systemQueue.add('resyncCharts', {
+ }, {
+ repeat: { cron: '0 0 * * *' }
+ });
}
export function destroy() {
diff --git a/src/queue/processors/system/index.ts b/src/queue/processors/system/index.ts
new file mode 100644
index 0000000000..52b7868105
--- /dev/null
+++ b/src/queue/processors/system/index.ts
@@ -0,0 +1,12 @@
+import * as Bull from 'bull';
+import { resyncCharts } from './resync-charts';
+
+const jobs = {
+ resyncCharts,
+} as Record