Merge branch 'develop' into notification-read-api
This commit is contained in:
commit
557e1faccf
89 changed files with 1898 additions and 1518 deletions
17
CHANGELOG.md
17
CHANGELOG.md
|
@ -7,6 +7,23 @@
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
## 12.x.x (unreleased)
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
- API: /antennas/notes API で日付による絞り込みができるように
|
||||||
|
- クライアント: アンケートに投票する際に確認ダイアログを出すように
|
||||||
|
- クライアント: Renoteなノート詳細ページから元のノートページに遷移できるように
|
||||||
|
|
||||||
|
### Bugfixes
|
||||||
|
- クライアント: ログインにおいてパスワードが誤っている際のエラーメッセージが正しく表示されない問題を修正
|
||||||
|
- クライアント: リアクションツールチップ、Renoteツールチップのユーザーの並び順を修正
|
||||||
|
- クライアント: サウンドのマスターボリュームが正しく保存されない問題を修正
|
||||||
|
- クライアント: 一部環境において通知が表示されると操作不能になる問題を修正
|
||||||
|
- クライアント: モバイルでタップしたときにツールチップが表示される問題を修正
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
- クライアント: ノートにモデレーターバッジを表示するのを廃止
|
||||||
|
|
||||||
## 12.97.0 (2021/11/19)
|
## 12.97.0 (2021/11/19)
|
||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
|
|
127
README.md
127
README.md
|
@ -1,116 +1,57 @@
|
||||||
[![Misskey](https://github.com/misskey-dev/assets/blob/main/banner.png?raw=true)](https://join.misskey.page/)
|
[![Misskey](https://github.com/misskey-dev/assets/blob/main/banner.png?raw=true)](https://join.misskey.page/)
|
||||||
|
|
||||||
<h1 align="center">Misskey</h1>
|
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
[![Dependencies](https://img.shields.io/david/misskey-dev/misskey.svg?style=for-the-badge&logo=npm)](https://david-dm.org/misskey-dev/misskey)
|
**🌎 A forever evolving, interplanetary microblogging platform. 🚀**
|
||||||
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge&logo=github)](http://makeapullrequest.com)
|
|
||||||
[![Awesome Humane Tech](https://raw.githubusercontent.com/humanetech-community/awesome-humane-tech/main/humane-tech-badge.svg?sanitize=true)](https://github.com/humanetech-community/awesome-humane-tech)
|
|
||||||
|
|
||||||
**A forever evolving, interplanetary microblogging platform.**
|
**Misskey** is a distributed microblogging platform with advanced features such as Reactions and a highly customizable UI.
|
||||||
|
|
||||||
<a href="https://join.misskey.page/">Misskey</a> is a decentralized microblogging platform born on Earth.
|
[Learn more](https://misskey-hub.net/)
|
||||||
Since it exists within the Fediverse (a universe where various social media platforms are organized),
|
|
||||||
it is mutually linked with other social media platforms.
|
---
|
||||||
Why don't you take a short break from the hustle and bustle of the city, and dive into a new Internet? <a href="https://join.misskey.page/">Find an instance!</a>
|
|
||||||
|
[✨ Find an instance](https://misskey-hub.net/instances.html)
|
||||||
|
•
|
||||||
|
[📦 Create your own instance](https://misskey-hub.net/docs/install.html)
|
||||||
|
•
|
||||||
|
[🛠️ Contribute](./CONTRIBUTING.md)
|
||||||
|
•
|
||||||
|
[🚀 Join the community](https://discord.gg/Wp8gVStHW3)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
<a href="https://www.patreon.com/syuilo"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" alt="Become a Patron!" width="160" /></a>
|
<a href="https://www.patreon.com/syuilo"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" alt="Become a Patron!" width="160" /></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
---
|
<div>
|
||||||
|
|
||||||
Do you have a question? Or are you experiencing trouble?
|
<a href="https://xn--931a.moe/"><img src="https://github.com/misskey-dev/misskey/blob/develop/assets/ai.png?raw=true" align="right" height="320px"/></a>
|
||||||
Visit [our forum](https://forum.misskey.io/)!
|
|
||||||
|
|
||||||
---
|
## ✨ Features
|
||||||
|
- **ActivityPub support**\
|
||||||
|
It is possible to interact with other software.
|
||||||
|
- **Reactions**\
|
||||||
|
You can add "reactions" to each post, making it easy for you to express your feelings.
|
||||||
|
- **Drive**\
|
||||||
|
An interface to manage uploaded files such as images, videos, sounds, etc.
|
||||||
|
You can also organize your favorite content into folders, making it easy to share again.
|
||||||
|
- **Rich Web UI**\
|
||||||
|
Misskey has a rich WebUI by default.
|
||||||
|
It is highly customizable by flexibly changing the layout and installing various widgets and themes.
|
||||||
|
Furthermore, plug-ins can be created using AiScript, a original programming language.
|
||||||
|
- and more...
|
||||||
|
|
||||||
![](https://ja.mstdn.wiki/images/e/ed/Deck.jpg)
|
</div>
|
||||||
|
|
||||||
:sparkles: Features
|
<div style="clear: both;"></div>
|
||||||
----------------------------------------------------------------
|
|
||||||
<a href="https://xn--931a.moe/"><img src="https://github.com/misskey-dev/misskey/blob/develop/assets/ai-orig.png?raw=true" align="right" height="320px"/></a>
|
|
||||||
|
|
||||||
<h3>Posting</h3>
|
## Sponsors
|
||||||
<p>
|
|
||||||
Post your ideas, discussion topics, fun moments, or anything else you want to share! Misskey supports text, emoji, pictures, videos, and polls!
|
|
||||||
</p>
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<h3 >Reactions</h3>
|
|
||||||
<p>
|
|
||||||
Reactions are the simplest way to respond to others' posts. Simply pick a reaction emote from the list! Reactions on Misskey are much more expressive than other social media services which only allow “liking”.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<h3>Interface</h3>
|
|
||||||
<p>
|
|
||||||
Customize the UI to your own tastes! No UI will work for everyone, so Misskey is completely customizable. Make Misskey *yours* by editing the style, adjusting timeline layouts, and placing widgets.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<h3>Misskey Drive</h3>
|
|
||||||
<p>
|
|
||||||
Organize and store your files! Want to post a picture you have already uploaded? Wish you could organize your files into folders? Misskey Drive is a solution!
|
|
||||||
</p>
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
...and more!
|
|
||||||
|
|
||||||
:package: Create your own instance
|
|
||||||
----------------------------------------------------------------
|
|
||||||
Please see the [Setup and Installation Guide](https://misskey-hub.net/docs/install/install.html).
|
|
||||||
|
|
||||||
:wrench: Contribution
|
|
||||||
----------------------------------------------------------------
|
|
||||||
Please see the [Contribution Guide](./CONTRIBUTING.md).
|
|
||||||
|
|
||||||
### Collaborators
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td><img src="https://avatars3.githubusercontent.com/u/4439005?s=460&v=4" alt="syuilo" width="100"></td>
|
|
||||||
<td><img src="https://avatars0.githubusercontent.com/u/10798641?s=460&v=4" alt="AyaMorisawa" width="100"></td>
|
|
||||||
<td><img src="https://avatars1.githubusercontent.com/u/30769358?s=460&v=4" alt="mei23" width="100"></td>
|
|
||||||
<td><img src="https://avatars2.githubusercontent.com/u/20679825?s=460&v=4" alt="acid-chicken" width="100"></td>
|
|
||||||
<td><img src="https://avatars2.githubusercontent.com/u/6533808?s=460&v=4" alt="rinsuki" width="100"></td>
|
|
||||||
<td><img src="https://avatars0.githubusercontent.com/u/7973572?s=460&v=4" alt="tamaina" width="100"></td>
|
|
||||||
<td><img src="https://avatars1.githubusercontent.com/u/7106976?s=460&v=4" alt="Xeltica" width="100"></td>
|
|
||||||
<td><img src="https://avatars1.githubusercontent.com/u/17376330?s=460&v=4" alt="u1-liquid" width="100"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="center"><a href="https://github.com/syuilo">@syuilo</a></td>
|
|
||||||
<td align="center"><a href="https://github.com/AyaMorisawa">@AyaMorisawa</a></td>
|
|
||||||
<td align="center"><a href="https://github.com/mei23">@mei23</a></td>
|
|
||||||
<td align="center"><a href="https://github.com/acid-chicken">@acid-chicken</a></td>
|
|
||||||
<td align="center"><a href="https://github.com/rinsuki">@rinsuki</a></td>
|
|
||||||
<td align="center"><a href="https://github.com/tamaina">@tamaina</a></td>
|
|
||||||
<td align="center"><a href="https://github.com/Xeltica">@Xeltica</a></td>
|
|
||||||
<td align="center"><a href="https://github.com/u1-liquid">@u1-liquid</a></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
To receive updates of this repo, follow [@repo@misskey.io](https://misskey.io/@repo) on fediverse.
|
|
||||||
|
|
||||||
Related projects
|
|
||||||
----------------------------------------------------------------
|
|
||||||
- [misskey.js](https://github.com/misskey-dev/misskey.js) - Misskey SDK for JavaScript
|
|
||||||
- [mfm.js](https://github.com/misskey-dev/mfm.js) - MFM parser
|
|
||||||
|
|
||||||
Sponsors
|
|
||||||
----------------------------------------------------------------
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<a class="rss3" title="RSS3" href="https://rss3.io/" target="_blank" style="display: inline-block;"><img src="https://rss3.io/assets/images/Logo.svg" alt="RSS3" style="display: inline-block; height: 60px;"></a>
|
<a class="rss3" title="RSS3" href="https://rss3.io/" target="_blank" style="display: inline-block;"><img src="https://rss3.io/assets/images/Logo.svg" alt="RSS3" style="display: inline-block; height: 60px;"></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
:heart: Backers
|
## Backers
|
||||||
----------------------------------------------------------------
|
|
||||||
<!-- PATREON_START -->
|
<!-- PATREON_START -->
|
||||||
<table><tr>
|
<table><tr>
|
||||||
<td><img src="https://c8.patreon.com/2/200/20832595" alt="Roujo " width="100"></td>
|
<td><img src="https://c8.patreon.com/2/200/20832595" alt="Roujo " width="100"></td>
|
||||||
|
|
|
@ -931,6 +931,8 @@ _mfm:
|
||||||
rainbowDescription: "Makes the content appear in rainbow colors."
|
rainbowDescription: "Makes the content appear in rainbow colors."
|
||||||
sparkle: "Sparkle"
|
sparkle: "Sparkle"
|
||||||
sparkleDescription: "Gives content a sparkling particle effect."
|
sparkleDescription: "Gives content a sparkling particle effect."
|
||||||
|
rotate: "Rotate"
|
||||||
|
rotateDescription: "Rotates the content by 90 degrees"
|
||||||
_reversi:
|
_reversi:
|
||||||
reversi: "Reversi"
|
reversi: "Reversi"
|
||||||
gameSettings: "Game settings"
|
gameSettings: "Game settings"
|
||||||
|
|
|
@ -808,6 +808,8 @@ ffVisibility: "つながりの公開範囲"
|
||||||
ffVisibilityDescription: "自分のフォロー/フォロワー情報の公開範囲を設定できます。"
|
ffVisibilityDescription: "自分のフォロー/フォロワー情報の公開範囲を設定できます。"
|
||||||
continueThread: "さらにスレッドを見る"
|
continueThread: "さらにスレッドを見る"
|
||||||
deleteAccountConfirm: "アカウントが削除されます。よろしいですか?"
|
deleteAccountConfirm: "アカウントが削除されます。よろしいですか?"
|
||||||
|
incorrectPassword: "パスワードが間違っています。"
|
||||||
|
voteConfirm: "「{choice}」に投票しますか?"
|
||||||
|
|
||||||
_emailUnavailable:
|
_emailUnavailable:
|
||||||
used: "既に使用されています"
|
used: "既に使用されています"
|
||||||
|
@ -823,7 +825,7 @@ _ffVisibility:
|
||||||
|
|
||||||
_signup:
|
_signup:
|
||||||
almostThere: "ほとんど完了です"
|
almostThere: "ほとんど完了です"
|
||||||
emailAddressInfo: "あなたが使っているメールアドレスを入力してください。"
|
emailAddressInfo: "あなたが使っているメールアドレスを入力してください。メールアドレスが公開されることはありません。"
|
||||||
emailSent: "入力されたメールアドレス({email})宛に確認のメールが送信されました。メールに記載されたリンクにアクセスすると、アカウントの作成が完了します。"
|
emailSent: "入力されたメールアドレス({email})宛に確認のメールが送信されました。メールに記載されたリンクにアクセスすると、アカウントの作成が完了します。"
|
||||||
|
|
||||||
_accountDelete:
|
_accountDelete:
|
||||||
|
@ -944,6 +946,8 @@ _mfm:
|
||||||
rainbowDescription: "内容をレインボーにします。"
|
rainbowDescription: "内容をレインボーにします。"
|
||||||
sparkle: "キラキラ"
|
sparkle: "キラキラ"
|
||||||
sparkleDescription: "キラキラしたパーティクルのエフェクトを追加します。"
|
sparkleDescription: "キラキラしたパーティクルのエフェクトを追加します。"
|
||||||
|
rotate: "回転"
|
||||||
|
rotateDescription: "指定した角度で回転させます。"
|
||||||
|
|
||||||
_reversi:
|
_reversi:
|
||||||
reversi: "リバーシ"
|
reversi: "リバーシ"
|
||||||
|
|
|
@ -33,6 +33,14 @@ export const meta = {
|
||||||
untilId: {
|
untilId: {
|
||||||
validator: $.optional.type(ID),
|
validator: $.optional.type(ID),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
sinceDate: {
|
||||||
|
validator: $.optional.num,
|
||||||
|
},
|
||||||
|
|
||||||
|
untilDate: {
|
||||||
|
validator: $.optional.num,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
errors: {
|
errors: {
|
||||||
|
@ -68,7 +76,8 @@ export default define(meta, async (ps, user) => {
|
||||||
.select('joining.noteId')
|
.select('joining.noteId')
|
||||||
.where('joining.antennaId = :antennaId', { antennaId: antenna.id });
|
.where('joining.antennaId = :antennaId', { antennaId: antenna.id });
|
||||||
|
|
||||||
const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId)
|
const query = makePaginationQuery(Notes.createQueryBuilder('note'),
|
||||||
|
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
|
||||||
.andWhere(`note.id IN (${ antennaQuery.getQuery() })`)
|
.andWhere(`note.id IN (${ antennaQuery.getQuery() })`)
|
||||||
.innerJoinAndSelect('note.user', 'user')
|
.innerJoinAndSelect('note.user', 'user')
|
||||||
.leftJoinAndSelect('note.reply', 'reply')
|
.leftJoinAndSelect('note.reply', 'reply')
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
import { Emojis } from '@/models/index';
|
import { initDb } from '@/db/postgre';
|
||||||
import { genId } from '@/misc/gen-id';
|
import { genId } from '@/misc/gen-id';
|
||||||
|
|
||||||
async function main(name: string, url: string, alias?: string): Promise<any> {
|
async function main(name: string, url: string, alias?: string): Promise<any> {
|
||||||
|
await initDb();
|
||||||
|
const { Emojis } = await import('@/models/index');
|
||||||
|
|
||||||
const aliases = alias != null ? [ alias ] : [];
|
const aliases = alias != null ? [ alias ] : [];
|
||||||
|
|
||||||
await Emojis.save({
|
await Emojis.save({
|
|
@ -1,13 +1,11 @@
|
||||||
import { initDb } from '../db/postgre';
|
import { initDb } from '../db/postgre';
|
||||||
import { getRepository } from 'typeorm';
|
|
||||||
import { User } from '@/models/entities/user';
|
|
||||||
|
|
||||||
async function main(username: string) {
|
async function main(username: string) {
|
||||||
if (!username) throw `username required`;
|
if (!username) throw `username required`;
|
||||||
username = username.replace(/^@/, '');
|
username = username.replace(/^@/, '');
|
||||||
|
|
||||||
await initDb();
|
await initDb();
|
||||||
const Users = getRepository(User);
|
const { Users } = await import('@/models/index');
|
||||||
|
|
||||||
const res = await Users.update({
|
const res = await Users.update({
|
||||||
usernameLower: username.toLowerCase(),
|
usernameLower: username.toLowerCase(),
|
|
@ -1,13 +1,11 @@
|
||||||
import { initDb } from '../db/postgre';
|
import { initDb } from '../db/postgre';
|
||||||
import { getRepository } from 'typeorm';
|
|
||||||
import { User } from '@/models/entities/user';
|
|
||||||
|
|
||||||
async function main(username: string) {
|
async function main(username: string) {
|
||||||
if (!username) throw `username required`;
|
if (!username) throw `username required`;
|
||||||
username = username.replace(/^@/, '');
|
username = username.replace(/^@/, '');
|
||||||
|
|
||||||
await initDb();
|
await initDb();
|
||||||
const Users = getRepository(User);
|
const { Users } = await import('@/models/index');
|
||||||
|
|
||||||
const res = await Users.update({
|
const res = await Users.update({
|
||||||
usernameLower: username.toLowerCase(),
|
usernameLower: username.toLowerCase(),
|
|
@ -1,6 +1,9 @@
|
||||||
import { updateQuestion } from '@/remote/activitypub/models/question';
|
import { initDb } from '@/db/postgre';
|
||||||
|
|
||||||
async function main(uri: string): Promise<any> {
|
async function main(uri: string): Promise<any> {
|
||||||
|
await initDb();
|
||||||
|
const { updateQuestion } = await import('@/remote/activitypub/models/question');
|
||||||
|
|
||||||
return await updateQuestion(uri);
|
return await updateQuestion(uri);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Users, Signins } from '@/models/index';
|
import { initDb } from '@/db/postgre';
|
||||||
|
|
||||||
// node built/tools/show-signin-history username
|
// node built/tools/show-signin-history username
|
||||||
// => {Success} {Date} {IPAddrsss}
|
// => {Success} {Date} {IPAddrsss}
|
||||||
|
@ -10,6 +10,9 @@ import { Users, Signins } from '@/models/index';
|
||||||
// with full request headers
|
// with full request headers
|
||||||
|
|
||||||
async function main(username: string, headers?: string[]) {
|
async function main(username: string, headers?: string[]) {
|
||||||
|
await initDb();
|
||||||
|
const { Users, Signins } = await import('@/models/index');
|
||||||
|
|
||||||
const user = await Users.findOne({
|
const user = await Users.findOne({
|
||||||
host: null,
|
host: null,
|
||||||
usernameLower: username.toLowerCase(),
|
usernameLower: username.toLowerCase(),
|
|
@ -1,26 +0,0 @@
|
||||||
"use strict";
|
|
||||||
// ex) node built/tools/accept-migration Yo 1000000000001
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const typeorm_1 = require("typeorm");
|
|
||||||
const index_1 = require("@/config/index");
|
|
||||||
(0, typeorm_1.createConnection)({
|
|
||||||
type: 'postgres',
|
|
||||||
host: index_1.default.db.host,
|
|
||||||
port: index_1.default.db.port,
|
|
||||||
username: index_1.default.db.user,
|
|
||||||
password: index_1.default.db.pass,
|
|
||||||
database: index_1.default.db.db,
|
|
||||||
extra: index_1.default.db.extra,
|
|
||||||
synchronize: false,
|
|
||||||
dropSchema: false,
|
|
||||||
}).then(c => {
|
|
||||||
c.query(`INSERT INTO migrations(timestamp,name) VALUES (${process.argv[3]}, '${process.argv[2]}${process.argv[3]}');`).then(() => {
|
|
||||||
console.log('done');
|
|
||||||
process.exit(0);
|
|
||||||
}).catch(e => {
|
|
||||||
console.log('ERROR:');
|
|
||||||
console.log(e);
|
|
||||||
process.exit(1);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=accept-migration.js.map
|
|
|
@ -1 +0,0 @@
|
||||||
{"version":3,"file":"accept-migration.js","sourceRoot":"","sources":["accept-migration.ts"],"names":[],"mappings":";AAAA,yDAAyD;;AAEzD,qCAA2C;AAC3C,0CAAoC;AAEpC,IAAA,0BAAgB,EAAC;IAChB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,eAAM,CAAC,EAAE,CAAC,IAAI;IACpB,IAAI,EAAE,eAAM,CAAC,EAAE,CAAC,IAAI;IACpB,QAAQ,EAAE,eAAM,CAAC,EAAE,CAAC,IAAI;IACxB,QAAQ,EAAE,eAAM,CAAC,EAAE,CAAC,IAAI;IACxB,QAAQ,EAAE,eAAM,CAAC,EAAE,CAAC,EAAE;IACtB,KAAK,EAAE,eAAM,CAAC,EAAE,CAAC,KAAK;IACtB,WAAW,EAAE,KAAK;IAClB,UAAU,EAAE,KAAK;CACjB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;IACX,CAAC,CAAC,KAAK,CAAC,kDAAkD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;QAChI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;QACZ,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
|
@ -1,30 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const index_1 = require("@/models/index");
|
|
||||||
const gen_id_1 = require("@/misc/gen-id");
|
|
||||||
async function main(name, url, alias) {
|
|
||||||
const aliases = alias != null ? [alias] : [];
|
|
||||||
await index_1.Emojis.save({
|
|
||||||
id: (0, gen_id_1.genId)(),
|
|
||||||
host: null,
|
|
||||||
name,
|
|
||||||
url,
|
|
||||||
aliases,
|
|
||||||
updatedAt: new Date()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
const args = process.argv.slice(2);
|
|
||||||
const name = args[0];
|
|
||||||
const url = args[1];
|
|
||||||
if (!name)
|
|
||||||
throw new Error('require name');
|
|
||||||
if (!url)
|
|
||||||
throw new Error('require url');
|
|
||||||
main(name, url).then(() => {
|
|
||||||
console.log('success');
|
|
||||||
process.exit(0);
|
|
||||||
}).catch(e => {
|
|
||||||
console.warn(e);
|
|
||||||
process.exit(1);
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=add-emoji.js.map
|
|
|
@ -1 +0,0 @@
|
||||||
{"version":3,"file":"add-emoji.js","sourceRoot":"","sources":["add-emoji.ts"],"names":[],"mappings":";;AAAA,0CAAwC;AACxC,0CAAsC;AAEtC,KAAK,UAAU,IAAI,CAAC,IAAY,EAAE,GAAW,EAAE,KAAc;IAC5D,MAAM,OAAO,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAE,KAAK,CAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAE/C,MAAM,cAAM,CAAC,IAAI,CAAC;QACjB,EAAE,EAAE,IAAA,cAAK,GAAE;QACX,IAAI,EAAE,IAAI;QACV,IAAI;QACJ,GAAG;QACH,OAAO;QACP,SAAS,EAAE,IAAI,IAAI,EAAE;KACrB,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACrB,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAEpB,IAAI,CAAC,IAAI;IAAE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;AAC3C,IAAI,CAAC,GAAG;IAAE,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;AAEzC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;IACzB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
|
@ -1,30 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const postgre_1 = require("../db/postgre");
|
|
||||||
const typeorm_1 = require("typeorm");
|
|
||||||
const user_1 = require("@/models/entities/user");
|
|
||||||
async function main(username) {
|
|
||||||
if (!username)
|
|
||||||
throw `username required`;
|
|
||||||
username = username.replace(/^@/, '');
|
|
||||||
await (0, postgre_1.initDb)();
|
|
||||||
const Users = (0, typeorm_1.getRepository)(user_1.User);
|
|
||||||
const res = await Users.update({
|
|
||||||
usernameLower: username.toLowerCase(),
|
|
||||||
host: null
|
|
||||||
}, {
|
|
||||||
isAdmin: false
|
|
||||||
});
|
|
||||||
if (res.affected !== 1) {
|
|
||||||
throw 'Failed';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const args = process.argv.slice(2);
|
|
||||||
main(args[0]).then(() => {
|
|
||||||
console.log('Success');
|
|
||||||
process.exit(0);
|
|
||||||
}).catch(e => {
|
|
||||||
console.error(`Error: ${e.message || e}`);
|
|
||||||
process.exit(1);
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=demote-admin.js.map
|
|
|
@ -1 +0,0 @@
|
||||||
{"version":3,"file":"demote-admin.js","sourceRoot":"","sources":["demote-admin.ts"],"names":[],"mappings":";;AAAA,2CAAuC;AACvC,qCAAwC;AACxC,iDAA8C;AAE9C,KAAK,UAAU,IAAI,CAAC,QAAgB;IACnC,IAAI,CAAC,QAAQ;QAAE,MAAM,mBAAmB,CAAC;IACzC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAEtC,MAAM,IAAA,gBAAM,GAAE,CAAC;IACf,MAAM,KAAK,GAAG,IAAA,uBAAa,EAAC,WAAI,CAAC,CAAC;IAElC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC;QAC9B,aAAa,EAAE,QAAQ,CAAC,WAAW,EAAE;QACrC,IAAI,EAAE,IAAI;KACV,EAAE;QACF,OAAO,EAAE,KAAK;KACd,CAAC,CAAC;IAEH,IAAI,GAAG,CAAC,QAAQ,KAAK,CAAC,EAAE;QACvB,MAAM,QAAQ,CAAC;KACf;AACF,CAAC;AAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;IACvB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IACZ,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
|
@ -1,30 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const postgre_1 = require("../db/postgre");
|
|
||||||
const typeorm_1 = require("typeorm");
|
|
||||||
const user_1 = require("@/models/entities/user");
|
|
||||||
async function main(username) {
|
|
||||||
if (!username)
|
|
||||||
throw `username required`;
|
|
||||||
username = username.replace(/^@/, '');
|
|
||||||
await (0, postgre_1.initDb)();
|
|
||||||
const Users = (0, typeorm_1.getRepository)(user_1.User);
|
|
||||||
const res = await Users.update({
|
|
||||||
usernameLower: username.toLowerCase(),
|
|
||||||
host: null
|
|
||||||
}, {
|
|
||||||
isAdmin: true
|
|
||||||
});
|
|
||||||
if (res.affected !== 1) {
|
|
||||||
throw 'Failed';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const args = process.argv.slice(2);
|
|
||||||
main(args[0]).then(() => {
|
|
||||||
console.log('Success');
|
|
||||||
process.exit(0);
|
|
||||||
}).catch(e => {
|
|
||||||
console.error(`Error: ${e.message || e}`);
|
|
||||||
process.exit(1);
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=mark-admin.js.map
|
|
|
@ -1 +0,0 @@
|
||||||
{"version":3,"file":"mark-admin.js","sourceRoot":"","sources":["mark-admin.ts"],"names":[],"mappings":";;AAAA,2CAAuC;AACvC,qCAAwC;AACxC,iDAA8C;AAE9C,KAAK,UAAU,IAAI,CAAC,QAAgB;IACnC,IAAI,CAAC,QAAQ;QAAE,MAAM,mBAAmB,CAAC;IACzC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAEtC,MAAM,IAAA,gBAAM,GAAE,CAAC;IACf,MAAM,KAAK,GAAG,IAAA,uBAAa,EAAC,WAAI,CAAC,CAAC;IAElC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC;QAC9B,aAAa,EAAE,QAAQ,CAAC,WAAW,EAAE;QACrC,IAAI,EAAE,IAAI;KACV,EAAE;QACF,OAAO,EAAE,IAAI;KACb,CAAC,CAAC;IAEH,IAAI,GAAG,CAAC,QAAQ,KAAK,CAAC,EAAE;QACvB,MAAM,QAAQ,CAAC;KACf;AACF,CAAC;AAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;IACvB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IACZ,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
|
@ -1,14 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const question_1 = require("@/remote/activitypub/models/question");
|
|
||||||
async function main(uri) {
|
|
||||||
return await (0, question_1.updateQuestion)(uri);
|
|
||||||
}
|
|
||||||
const args = process.argv.slice(2);
|
|
||||||
const uri = args[0];
|
|
||||||
main(uri).then(result => {
|
|
||||||
console.log(`Done: ${result}`);
|
|
||||||
}).catch(e => {
|
|
||||||
console.warn(e);
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=refresh-question.js.map
|
|
|
@ -1 +0,0 @@
|
||||||
{"version":3,"file":"refresh-question.js","sourceRoot":"","sources":["refresh-question.ts"],"names":[],"mappings":";;AAAA,mEAAsE;AAEtE,KAAK,UAAU,IAAI,CAAC,GAAW;IAC9B,OAAO,MAAM,IAAA,yBAAc,EAAC,GAAG,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAEpB,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;IACvB,OAAO,CAAC,GAAG,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;AAChC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
|
@ -1,26 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const postgre_1 = require("@/db/postgre");
|
|
||||||
const Acct = require("misskey-js/built/acct");
|
|
||||||
async function main(acct) {
|
|
||||||
await (0, postgre_1.initDb)();
|
|
||||||
const { resolveUser } = await Promise.resolve().then(() => require('@/remote/resolve-user'));
|
|
||||||
const { username, host } = Acct.parse(acct);
|
|
||||||
await resolveUser(username, host, {}, true);
|
|
||||||
}
|
|
||||||
// get args
|
|
||||||
const args = process.argv.slice(2);
|
|
||||||
let acct = args[0];
|
|
||||||
// normalize args
|
|
||||||
acct = acct.replace(/^@/, '');
|
|
||||||
// check args
|
|
||||||
if (!acct.match(/^\w+@\w/)) {
|
|
||||||
throw `Invalid acct format. Valid format are user@host`;
|
|
||||||
}
|
|
||||||
console.log(`resync ${acct}`);
|
|
||||||
main(acct).then(() => {
|
|
||||||
console.log('Done');
|
|
||||||
}).catch(e => {
|
|
||||||
console.warn(e);
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=resync-remote-user.js.map
|
|
|
@ -1 +0,0 @@
|
||||||
{"version":3,"file":"resync-remote-user.js","sourceRoot":"","sources":["resync-remote-user.ts"],"names":[],"mappings":";;AAAA,0CAAsC;AACtC,8CAA8C;AAE9C,KAAK,UAAU,IAAI,CAAC,IAAY;IAC/B,MAAM,IAAA,gBAAM,GAAE,CAAC;IACf,MAAM,EAAE,WAAW,EAAE,GAAG,2CAAa,uBAAuB,EAAC,CAAC;IAE9D,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,WAAW,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;AAC7C,CAAC;AAED,WAAW;AACX,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,IAAI,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAEnB,iBAAiB;AACjB,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAE9B,aAAa;AACb,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;IAC3B,MAAM,iDAAiD,CAAC;CACxD;AAED,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;AAE9B,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;IACpB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACrB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
|
@ -1,47 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const index_1 = require("@/models/index");
|
|
||||||
// node built/tools/show-signin-history username
|
|
||||||
// => {Success} {Date} {IPAddrsss}
|
|
||||||
// node built/tools/show-signin-history username user-agent,x-forwarded-for
|
|
||||||
// with user-agent and x-forwarded-for
|
|
||||||
// node built/tools/show-signin-history username all
|
|
||||||
// with full request headers
|
|
||||||
async function main(username, headers) {
|
|
||||||
const user = await index_1.Users.findOne({
|
|
||||||
host: null,
|
|
||||||
usernameLower: username.toLowerCase(),
|
|
||||||
});
|
|
||||||
if (user == null)
|
|
||||||
throw new Error('User not found');
|
|
||||||
const history = await index_1.Signins.find({
|
|
||||||
userId: user.id
|
|
||||||
});
|
|
||||||
for (const signin of history) {
|
|
||||||
console.log(`${signin.success ? 'OK' : 'NG'} ${signin.createdAt ? signin.createdAt.toISOString() : 'Unknown'} ${signin.ip}`);
|
|
||||||
// headers
|
|
||||||
if (headers != null) {
|
|
||||||
for (const key of Object.keys(signin.headers)) {
|
|
||||||
if (headers.includes('all') || headers.includes(key)) {
|
|
||||||
console.log(` ${key}: ${signin.headers[key]}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// get args
|
|
||||||
const args = process.argv.slice(2);
|
|
||||||
let username = args[0];
|
|
||||||
let headers;
|
|
||||||
if (args[1] != null) {
|
|
||||||
headers = args[1].split(/,/).map(header => header.toLowerCase());
|
|
||||||
}
|
|
||||||
// normalize args
|
|
||||||
username = username.replace(/^@/, '');
|
|
||||||
main(username, headers).then(() => {
|
|
||||||
process.exit(0);
|
|
||||||
}).catch(e => {
|
|
||||||
console.warn(e);
|
|
||||||
process.exit(1);
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=show-signin-history.js.map
|
|
|
@ -1 +0,0 @@
|
||||||
{"version":3,"file":"show-signin-history.js","sourceRoot":"","sources":["show-signin-history.ts"],"names":[],"mappings":";;AAAA,0CAAgD;AAEhD,gDAAgD;AAChD,mCAAmC;AAEnC,2EAA2E;AAC3E,uCAAuC;AAEvC,oDAAoD;AACpD,6BAA6B;AAE7B,KAAK,UAAU,IAAI,CAAC,QAAgB,EAAE,OAAkB;IACvD,MAAM,IAAI,GAAG,MAAM,aAAK,CAAC,OAAO,CAAC;QAChC,IAAI,EAAE,IAAI;QACV,aAAa,EAAE,QAAQ,CAAC,WAAW,EAAE;KACrC,CAAC,CAAC;IAEH,IAAI,IAAI,IAAI,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAEpD,MAAM,OAAO,GAAG,MAAM,eAAO,CAAC,IAAI,CAAC;QAClC,MAAM,EAAE,IAAI,CAAC,EAAE;KACf,CAAC,CAAC;IAEH,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC7B,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QAE7H,UAAU;QACV,IAAI,OAAO,IAAI,IAAI,EAAE;YACpB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;gBAC9C,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBACrD,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,KAAK,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;iBACjD;aACD;SACD;KACD;AACF,CAAC;AAED,WAAW;AACX,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,IAAI,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACvB,IAAI,OAA6B,CAAC;AAElC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE;IACpB,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;CACjE;AAED,iBAAiB;AACjB,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAEtC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;IACjC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
|
@ -14,7 +14,9 @@
|
||||||
</div>
|
</div>
|
||||||
<header v-if="title"><Mfm :text="title"/></header>
|
<header v-if="title"><Mfm :text="title"/></header>
|
||||||
<div v-if="text" class="body"><Mfm :text="text"/></div>
|
<div v-if="text" class="body"><Mfm :text="text"/></div>
|
||||||
<MkInput v-if="input" v-model="inputValue" autofocus :type="input.type || 'text'" :placeholder="input.placeholder" @keydown="onInputKeydown"></MkInput>
|
<MkInput v-if="input" v-model="inputValue" autofocus :type="input.type || 'text'" :placeholder="input.placeholder" @keydown="onInputKeydown">
|
||||||
|
<template v-if="input.type === 'password'" #prefix><i class="fas fa-lock"></i></template>
|
||||||
|
</MkInput>
|
||||||
<MkSelect v-if="select" v-model="selectedValue" autofocus>
|
<MkSelect v-if="select" v-model="selectedValue" autofocus>
|
||||||
<template v-if="select.items">
|
<template v-if="select.items">
|
||||||
<option v-for="item in select.items" :value="item.value">{{ item.text }}</option>
|
<option v-for="item in select.items" :value="item.value">{{ item.text }}</option>
|
||||||
|
@ -165,6 +167,10 @@ export default defineComponent({
|
||||||
> .icon {
|
> .icon {
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
|
|
||||||
|
&.info {
|
||||||
|
color: #55c4dd;
|
||||||
|
}
|
||||||
|
|
||||||
&.success {
|
&.success {
|
||||||
color: var(--success);
|
color: var(--success);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<MkPopup ref="popup" #default="{point}" :manual-showing="manualShowing" :src="src" :front="true" @click="$refs.popup.close()" @opening="opening" @close="$emit('close')" @closed="$emit('closed')">
|
<MkPopup ref="popup" v-slot="{ point, close }" :manual-showing="manualShowing" :src="src" :front="true" @click="close()" @opening="opening" @close="$emit('close')" @closed="$emit('closed')">
|
||||||
<MkEmojiPicker ref="picker" class="ryghynhb _popup _shadow" :class="{ pointer: point === 'top' }" :show-pinned="showPinned" :as-reaction-picker="asReactionPicker" @chosen="chosen"/>
|
<MkEmojiPicker ref="picker" class="ryghynhb _popup _shadow" :class="{ pointer: point === 'top' }" :show-pinned="showPinned" :as-reaction-picker="asReactionPicker" @chosen="chosen"/>
|
||||||
</MkPopup>
|
</MkPopup>
|
||||||
</template>
|
</template>
|
||||||
|
|
35
packages/client/src/components/form/group.vue
Normal file
35
packages/client/src/components/form/group.vue
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<template>
|
||||||
|
<div v-sticky-container v-panel class="adfeebaf _formBlock">
|
||||||
|
<div class="label"><slot name="label"></slot></div>
|
||||||
|
<div class="main _formRoot">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent } from 'vue';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.adfeebaf {
|
||||||
|
padding: 24px 24px;
|
||||||
|
border-radius: var(--radius);
|
||||||
|
|
||||||
|
> .label {
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 0 0 16px 0;
|
||||||
|
|
||||||
|
&:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> .main {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -5,6 +5,7 @@
|
||||||
<div ref="prefixEl" class="prefix"><slot name="prefix"></slot></div>
|
<div ref="prefixEl" class="prefix"><slot name="prefix"></slot></div>
|
||||||
<input ref="inputEl"
|
<input ref="inputEl"
|
||||||
v-model="v"
|
v-model="v"
|
||||||
|
v-panel
|
||||||
:type="type"
|
:type="type"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:required="required"
|
:required="required"
|
||||||
|
@ -27,7 +28,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="caption"><slot name="caption"></slot></div>
|
<div class="caption"><slot name="caption"></slot></div>
|
||||||
|
|
||||||
<MkButton v-if="manualSave && changed" primary @click="updated"><i class="fas fa-save"></i> {{ $ts.save }}</MkButton>
|
<MkButton v-if="manualSave && changed" primary class="save" @click="updated"><i class="fas fa-check"></i> {{ $ts.save }}</MkButton>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -114,9 +115,9 @@ export default defineComponent({
|
||||||
const changed = ref(false);
|
const changed = ref(false);
|
||||||
const invalid = ref(false);
|
const invalid = ref(false);
|
||||||
const filled = computed(() => v.value !== '' && v.value != null);
|
const filled = computed(() => v.value !== '' && v.value != null);
|
||||||
const inputEl = ref(null);
|
const inputEl = ref<HTMLElement>();
|
||||||
const prefixEl = ref(null);
|
const prefixEl = ref<HTMLElement>();
|
||||||
const suffixEl = ref(null);
|
const suffixEl = ref<HTMLElement>();
|
||||||
|
|
||||||
const focus = () => inputEl.value.focus();
|
const focus = () => inputEl.value.focus();
|
||||||
const onInput = (ev) => {
|
const onInput = (ev) => {
|
||||||
|
@ -208,7 +209,7 @@ export default defineComponent({
|
||||||
.matxzzsk {
|
.matxzzsk {
|
||||||
> .label {
|
> .label {
|
||||||
font-size: 0.85em;
|
font-size: 0.85em;
|
||||||
padding: 0 0 8px 12px;
|
padding: 0 0 8px 0;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
&:empty {
|
&:empty {
|
||||||
|
@ -217,8 +218,8 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
> .caption {
|
> .caption {
|
||||||
font-size: 0.8em;
|
font-size: 0.85em;
|
||||||
padding: 8px 0 0 12px;
|
padding: 8px 0 0 0;
|
||||||
color: var(--fgTransparentWeak);
|
color: var(--fgTransparentWeak);
|
||||||
|
|
||||||
&:empty {
|
&:empty {
|
||||||
|
@ -242,8 +243,7 @@ export default defineComponent({
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
color: var(--fg);
|
color: var(--fg);
|
||||||
background: var(--panel);
|
border: solid 0.5px var(--panel);
|
||||||
border: solid 0.5px var(--inputBorder);
|
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
outline: none;
|
outline: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
@ -311,5 +311,9 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
> .save {
|
||||||
|
margin: 8px 0 0 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
112
packages/client/src/components/form/link.vue
Normal file
112
packages/client/src/components/form/link.vue
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
<template>
|
||||||
|
<div class="ffcbddfc" :class="{ inline }">
|
||||||
|
<a v-if="external" class="main _button" :href="to" target="_blank">
|
||||||
|
<span class="icon"><slot name="icon"></slot></span>
|
||||||
|
<span class="text"><slot></slot></span>
|
||||||
|
<span class="right">
|
||||||
|
<span class="text"><slot name="suffix"></slot></span>
|
||||||
|
<i class="fas fa-external-link-alt icon"></i>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
<MkA v-else class="main _button" :class="{ active }" :to="to" :behavior="behavior">
|
||||||
|
<span class="icon"><slot name="icon"></slot></span>
|
||||||
|
<span class="text"><slot></slot></span>
|
||||||
|
<span class="right">
|
||||||
|
<span class="text"><slot name="suffix"></slot></span>
|
||||||
|
<i class="fas fa-chevron-right icon"></i>
|
||||||
|
</span>
|
||||||
|
</MkA>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent } from 'vue';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
props: {
|
||||||
|
to: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
active: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
external: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
behavior: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
inline: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.ffcbddfc {
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
&.inline {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .main {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 12px 14px 12px 14px;
|
||||||
|
background: var(--buttonBg);
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 0.9em;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
background: var(--buttonHoverBg);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
color: var(--accent);
|
||||||
|
background: var(--buttonHoverBg);
|
||||||
|
}
|
||||||
|
|
||||||
|
> .icon {
|
||||||
|
margin-right: 0.75em;
|
||||||
|
flex-shrink: 0;
|
||||||
|
text-align: center;
|
||||||
|
opacity: 0.8;
|
||||||
|
|
||||||
|
&:empty {
|
||||||
|
display: none;
|
||||||
|
|
||||||
|
& + .text {
|
||||||
|
padding-left: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> .text {
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
padding-right: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .right {
|
||||||
|
margin-left: auto;
|
||||||
|
opacity: 0.7;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
> .text:not(:empty) {
|
||||||
|
margin-right: 0.75em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
44
packages/client/src/components/form/pagination.vue
Normal file
44
packages/client/src/components/form/pagination.vue
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
<template>
|
||||||
|
<FormSlot>
|
||||||
|
<template #label><slot name="label"></slot></template>
|
||||||
|
<div class="abcaccfa">
|
||||||
|
<slot :items="items"></slot>
|
||||||
|
<div v-if="empty" key="_empty_" class="empty">
|
||||||
|
<slot name="empty"></slot>
|
||||||
|
</div>
|
||||||
|
<MkButton v-show="more" class="button" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }" @click="fetchMore">
|
||||||
|
<template v-if="!moreFetching">{{ $ts.loadMore }}</template>
|
||||||
|
<template v-if="moreFetching"><MkLoading inline/></template>
|
||||||
|
</MkButton>
|
||||||
|
</div>
|
||||||
|
</FormSlot>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent } from 'vue';
|
||||||
|
import MkButton from '@/components/ui/button.vue';
|
||||||
|
import FormSlot from './slot.vue';
|
||||||
|
import paging from '@/scripts/paging';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
components: {
|
||||||
|
MkButton,
|
||||||
|
FormSlot,
|
||||||
|
},
|
||||||
|
|
||||||
|
mixins: [
|
||||||
|
paging({}),
|
||||||
|
],
|
||||||
|
|
||||||
|
props: {
|
||||||
|
pagination: {
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.abcaccfa {
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,5 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
|
v-panel
|
||||||
class="novjtctn"
|
class="novjtctn"
|
||||||
:class="{ disabled, checked }"
|
:class="{ disabled, checked }"
|
||||||
:aria-checked="checked"
|
:aria-checked="checked"
|
||||||
|
@ -50,9 +51,10 @@ export default defineComponent({
|
||||||
.novjtctn {
|
.novjtctn {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin: 8px 20px 0 0;
|
|
||||||
text-align: left;
|
text-align: left;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
padding: 11px 14px;
|
||||||
|
border-radius: 6px;
|
||||||
transition: all 0.3s;
|
transition: all 0.3s;
|
||||||
|
|
||||||
> * {
|
> * {
|
||||||
|
@ -68,6 +70,14 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
&.checked {
|
&.checked {
|
||||||
|
background: var(--accentedBg) !important;
|
||||||
|
border-color: var(--accent);
|
||||||
|
color: var(--accent);
|
||||||
|
|
||||||
|
&, * {
|
||||||
|
cursor: default !important;
|
||||||
|
}
|
||||||
|
|
||||||
> .button {
|
> .button {
|
||||||
border-color: var(--accent);
|
border-color: var(--accent);
|
||||||
|
|
||||||
|
@ -79,6 +89,11 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-color: var(--inputBorderHover);
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
> input {
|
> input {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 0;
|
width: 0;
|
||||||
|
@ -89,8 +104,8 @@ export default defineComponent({
|
||||||
|
|
||||||
> .button {
|
> .button {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 20px;
|
width: 14px;
|
||||||
height: 20px;
|
height: 14px;
|
||||||
background: none;
|
background: none;
|
||||||
border: solid 2px var(--inputBorder);
|
border: solid 2px var(--inputBorder);
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
|
@ -114,7 +129,6 @@ export default defineComponent({
|
||||||
> .label {
|
> .label {
|
||||||
margin-left: 28px;
|
margin-left: 28px;
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 16px;
|
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,8 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
let options = this.$slots.default();
|
let options = this.$slots.default();
|
||||||
|
const label = this.$slots.label && this.$slots.label();
|
||||||
|
const caption = this.$slots.caption && this.$slots.caption();
|
||||||
|
|
||||||
// なぜかFragmentになることがあるため
|
// なぜかFragmentになることがあるため
|
||||||
if (options.length === 1 && options[0].props == null) options = options[0].children;
|
if (options.length === 1 && options[0].props == null) options = options[0].children;
|
||||||
|
@ -30,12 +32,21 @@ export default defineComponent({
|
||||||
return h('div', {
|
return h('div', {
|
||||||
class: 'novjtcto'
|
class: 'novjtcto'
|
||||||
}, [
|
}, [
|
||||||
...options.map(option => h(MkRadio, {
|
...(label ? [h('div', {
|
||||||
|
class: 'label'
|
||||||
|
}, [label])] : []),
|
||||||
|
h('div', {
|
||||||
|
class: 'body'
|
||||||
|
}, options.map(option => h(MkRadio, {
|
||||||
key: option.key,
|
key: option.key,
|
||||||
value: option.props.value,
|
value: option.props.value,
|
||||||
modelValue: this.value,
|
modelValue: this.value,
|
||||||
'onUpdate:modelValue': value => this.value = value,
|
'onUpdate:modelValue': value => this.value = value,
|
||||||
}, option.children))
|
}, option.children)),
|
||||||
|
),
|
||||||
|
...(caption ? [h('div', {
|
||||||
|
class: 'caption'
|
||||||
|
}, [caption])] : []),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -43,12 +54,30 @@ export default defineComponent({
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.novjtcto {
|
.novjtcto {
|
||||||
&:first-child {
|
> .label {
|
||||||
margin-top: 0;
|
font-size: 0.85em;
|
||||||
|
padding: 0 0 8px 0;
|
||||||
|
user-select: none;
|
||||||
|
|
||||||
|
&:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:last-child {
|
> .body {
|
||||||
margin-bottom: 0;
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||||
|
grid-gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .caption {
|
||||||
|
font-size: 0.85em;
|
||||||
|
padding: 8px 0 0 0;
|
||||||
|
color: var(--fgTransparentWeak);
|
||||||
|
|
||||||
|
&:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,29 +1,27 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="timctyfi" :class="{ focused, disabled }">
|
<div class="timctyfi" :class="{ disabled }">
|
||||||
<div class="icon"><slot name="icon"></slot></div>
|
<div class="label"><slot name="label"></slot></div>
|
||||||
<span class="label"><slot name="label"></slot></span>
|
<div v-panel class="body">
|
||||||
<input
|
<div ref="containerEl" class="container">
|
||||||
ref="input"
|
<div class="track">
|
||||||
v-model="v"
|
<div class="highlight" :style="{ width: (steppedValue * 100) + '%' }"></div>
|
||||||
type="range"
|
</div>
|
||||||
:disabled="disabled"
|
<div v-if="steps" class="ticks">
|
||||||
:min="min"
|
<div v-for="i in (steps + 1)" class="tick" :style="{ left: (((i - 1) / steps) * 100) + '%' }"></div>
|
||||||
:max="max"
|
</div>
|
||||||
:step="step"
|
<div ref="thumbEl" v-tooltip="textConverter(finalValue)" class="thumb" :style="{ left: thumbPosition + 'px' }" @mousedown="onMousedown" @touchstart="onMousedown"></div>
|
||||||
:autofocus="autofocus"
|
</div>
|
||||||
@focus="focused = true"
|
</div>
|
||||||
@blur="focused = false"
|
|
||||||
@input="$emit('update:value', $event.target.value)"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { computed, defineComponent, ref, watch } from 'vue';
|
||||||
|
import * as os from '@/os';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
value: {
|
modelValue: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: false,
|
required: false,
|
||||||
default: 0
|
default: 0
|
||||||
|
@ -51,88 +49,198 @@ export default defineComponent({
|
||||||
autofocus: {
|
autofocus: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false
|
required: false
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data() {
|
textConverter: {
|
||||||
|
type: Function,
|
||||||
|
required: false,
|
||||||
|
default: (v) => v.toString(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
setup(props, context) {
|
||||||
|
const rawValue = ref((props.modelValue - props.min) / (props.max - props.min));
|
||||||
|
const steppedValue = computed(() => {
|
||||||
|
if (props.step) {
|
||||||
|
const step = props.step / (props.max - props.min);
|
||||||
|
return (step * Math.round(rawValue.value / step));
|
||||||
|
} else {
|
||||||
|
return rawValue.value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const finalValue = computed(() => {
|
||||||
|
return (steppedValue.value * (props.max - props.min)) + props.min;
|
||||||
|
});
|
||||||
|
watch(finalValue, () => {
|
||||||
|
context.emit('update:modelValue', finalValue.value);
|
||||||
|
});
|
||||||
|
|
||||||
|
const thumbWidth = computed(() => {
|
||||||
|
if (thumbEl.value == null) return 0;
|
||||||
|
return thumbEl.value!.offsetWidth;
|
||||||
|
});
|
||||||
|
const thumbPosition = computed(() => {
|
||||||
|
if (containerEl.value == null) return 0;
|
||||||
|
return (containerEl.value.offsetWidth - thumbWidth.value) * steppedValue.value;
|
||||||
|
});
|
||||||
|
const steps = computed(() => {
|
||||||
|
if (props.step) {
|
||||||
|
return (props.max - props.min) / props.step;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const containerEl = ref<HTMLElement>();
|
||||||
|
const thumbEl = ref<HTMLElement>();
|
||||||
|
|
||||||
|
const onMousedown = (ev: MouseEvent | TouchEvent) => {
|
||||||
|
ev.preventDefault();
|
||||||
|
|
||||||
|
const tooltipShowing = ref(true);
|
||||||
|
os.popup(import('@/components/ui/tooltip.vue'), {
|
||||||
|
showing: tooltipShowing,
|
||||||
|
text: computed(() => {
|
||||||
|
return props.textConverter(finalValue.value);
|
||||||
|
}),
|
||||||
|
source: thumbEl,
|
||||||
|
}, {}, 'closed');
|
||||||
|
|
||||||
|
const style = document.createElement('style');
|
||||||
|
style.appendChild(document.createTextNode('* { cursor: grabbing !important; } body * { pointer-events: none !important; }'));
|
||||||
|
document.head.appendChild(style);
|
||||||
|
|
||||||
|
const onDrag = (ev: MouseEvent | TouchEvent) => {
|
||||||
|
ev.preventDefault();
|
||||||
|
const containerRect = containerEl.value!.getBoundingClientRect();
|
||||||
|
const pointerX = ev.touches && ev.touches.length > 0 ? ev.touches[0].clientX : ev.clientX;
|
||||||
|
const pointerPositionOnContainer = pointerX - (containerRect.left + (thumbWidth.value / 2));
|
||||||
|
rawValue.value = Math.min(1, Math.max(0, pointerPositionOnContainer / (containerEl.value!.offsetWidth - thumbWidth.value)));
|
||||||
|
};
|
||||||
|
|
||||||
|
const onMouseup = () => {
|
||||||
|
document.head.removeChild(style);
|
||||||
|
tooltipShowing.value = false;
|
||||||
|
window.removeEventListener('mousemove', onDrag);
|
||||||
|
window.removeEventListener('touchmove', onDrag);
|
||||||
|
window.removeEventListener('mouseup', onMouseup);
|
||||||
|
window.removeEventListener('touchend', onMouseup);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('mousemove', onDrag);
|
||||||
|
window.addEventListener('touchmove', onDrag);
|
||||||
|
window.addEventListener('mouseup', onMouseup, { once: true });
|
||||||
|
window.addEventListener('touchend', onMouseup, { once: true });
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
v: this.value,
|
rawValue,
|
||||||
focused: false
|
finalValue,
|
||||||
|
steppedValue,
|
||||||
|
onMousedown,
|
||||||
|
containerEl,
|
||||||
|
thumbEl,
|
||||||
|
thumbPosition,
|
||||||
|
steps,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
value(v) {
|
|
||||||
this.v = parseFloat(v);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
if (this.autofocus) {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.input.focus();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@use "sass:math";
|
||||||
|
|
||||||
.timctyfi {
|
.timctyfi {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 8px;
|
|
||||||
|
|
||||||
> .icon {
|
> .label {
|
||||||
display: inline-block;
|
font-size: 0.85em;
|
||||||
width: 24px;
|
padding: 0 0 8px 0;
|
||||||
text-align: center;
|
user-select: none;
|
||||||
|
|
||||||
|
&:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> .title {
|
> .caption {
|
||||||
pointer-events: none;
|
font-size: 0.85em;
|
||||||
font-size: 16px;
|
padding: 8px 0 0 0;
|
||||||
color: var(--inputLabel);
|
color: var(--fgTransparentWeak);
|
||||||
overflow: hidden;
|
|
||||||
|
&:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> input {
|
$thumbHeight: 20px;
|
||||||
-webkit-appearance: none;
|
$thumbWidth: 20px;
|
||||||
-moz-appearance: none;
|
|
||||||
appearance: none;
|
|
||||||
background: var(--X10);
|
|
||||||
height: 7px;
|
|
||||||
margin: 0 8px;
|
|
||||||
outline: 0;
|
|
||||||
border: 0;
|
|
||||||
border-radius: 7px;
|
|
||||||
|
|
||||||
&.disabled {
|
> .body {
|
||||||
opacity: 0.6;
|
padding: 12px;
|
||||||
cursor: not-allowed;
|
border-radius: 6px;
|
||||||
}
|
|
||||||
|
|
||||||
&::-webkit-slider-thumb {
|
> .container {
|
||||||
-webkit-appearance: none;
|
position: relative;
|
||||||
appearance: none;
|
height: $thumbHeight;
|
||||||
cursor: pointer;
|
|
||||||
width: 20px;
|
> .track {
|
||||||
height: 20px;
|
position: absolute;
|
||||||
display: block;
|
top: 0;
|
||||||
border-radius: 50%;
|
bottom: 0;
|
||||||
border: none;
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: auto;
|
||||||
|
width: calc(100% - #{$thumbWidth});
|
||||||
|
height: 3px;
|
||||||
|
background: rgba(0, 0, 0, 0.1);
|
||||||
|
border-radius: 999px;
|
||||||
|
overflow: clip;
|
||||||
|
|
||||||
|
> .highlight {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 100%;
|
||||||
background: var(--accent);
|
background: var(--accent);
|
||||||
box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
|
opacity: 0.5;
|
||||||
box-sizing: content-box;
|
transition: width 0.2s cubic-bezier(0,0,0,1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-moz-range-thumb {
|
> .ticks {
|
||||||
-moz-appearance: none;
|
$tickWidth: 3px;
|
||||||
appearance: none;
|
|
||||||
cursor: pointer;
|
position: absolute;
|
||||||
width: 20px;
|
top: 0;
|
||||||
height: 20px;
|
bottom: 0;
|
||||||
display: block;
|
left: 0;
|
||||||
border-radius: 50%;
|
right: 0;
|
||||||
border: none;
|
margin: auto;
|
||||||
|
width: calc(100% - #{$thumbWidth});
|
||||||
|
|
||||||
|
> .tick {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
width: $tickWidth;
|
||||||
|
height: 3px;
|
||||||
|
margin-left: - math.div($tickWidth, 2);
|
||||||
|
background: var(--divider);
|
||||||
|
border-radius: 999px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> .thumb {
|
||||||
|
position: absolute;
|
||||||
|
width: $thumbWidth;
|
||||||
|
height: $thumbHeight;
|
||||||
|
cursor: grab;
|
||||||
background: var(--accent);
|
background: var(--accent);
|
||||||
box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
|
border-radius: 999px;
|
||||||
|
transition: left 0.2s cubic-bezier(0,0,0,1);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: var(--accentLighten);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-size="{ max: [500] }" v-sticky-container class="vrtktovh">
|
<div v-size="{ max: [500] }" v-sticky-container class="vrtktovh _formBlock">
|
||||||
<div class="label"><slot name="label"></slot></div>
|
<div class="label"><slot name="label"></slot></div>
|
||||||
<div class="main">
|
<div class="main _formRoot">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -17,15 +17,33 @@ export default defineComponent({
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.vrtktovh {
|
.vrtktovh {
|
||||||
|
margin: 0;
|
||||||
border-top: solid 0.5px var(--divider);
|
border-top: solid 0.5px var(--divider);
|
||||||
|
border-bottom: solid 0.5px var(--divider);
|
||||||
|
padding: 24px 0;
|
||||||
|
|
||||||
|
& + .vrtktovh {
|
||||||
|
border-top: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
border-top: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
> .label {
|
> .label {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
padding: 24px 0 16px 0;
|
padding: 0 0 16px 0;
|
||||||
|
|
||||||
|
&:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> .main {
|
> .main {
|
||||||
margin-bottom: 32px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="label" @click="focus"><slot name="label"></slot></div>
|
<div class="label" @click="focus"><slot name="label"></slot></div>
|
||||||
<div ref="container" class="input" :class="{ inline, disabled, focused }" @click.prevent="onClick">
|
<div ref="container" class="input" :class="{ inline, disabled, focused }" @click.prevent="onClick">
|
||||||
<div ref="prefixEl" class="prefix"><slot name="prefix"></slot></div>
|
<div ref="prefixEl" class="prefix"><slot name="prefix"></slot></div>
|
||||||
<select ref="inputEl" v-model="v"
|
<select ref="inputEl" v-model="v" v-panel
|
||||||
class="select"
|
class="select"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:required="required"
|
:required="required"
|
||||||
|
@ -201,7 +201,7 @@ export default defineComponent({
|
||||||
.vblkjoeq {
|
.vblkjoeq {
|
||||||
> .label {
|
> .label {
|
||||||
font-size: 0.85em;
|
font-size: 0.85em;
|
||||||
padding: 0 0 8px 12px;
|
padding: 0 0 8px 0;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
&:empty {
|
&:empty {
|
||||||
|
@ -210,8 +210,8 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
> .caption {
|
> .caption {
|
||||||
font-size: 0.8em;
|
font-size: 0.85em;
|
||||||
padding: 8px 0 0 12px;
|
padding: 8px 0 0 0;
|
||||||
color: var(--fgTransparentWeak);
|
color: var(--fgTransparentWeak);
|
||||||
|
|
||||||
&:empty {
|
&:empty {
|
||||||
|
@ -242,8 +242,7 @@ export default defineComponent({
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
color: var(--fg);
|
color: var(--fg);
|
||||||
background: var(--panel);
|
border: solid 1px var(--panel);
|
||||||
border: solid 1px var(--inputBorder);
|
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
outline: none;
|
outline: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
|
|
@ -18,11 +18,9 @@ export default defineComponent({
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.adhpbeou {
|
.adhpbeou {
|
||||||
margin: 1.5em 0;
|
|
||||||
|
|
||||||
> .label {
|
> .label {
|
||||||
font-size: 0.85em;
|
font-size: 0.85em;
|
||||||
padding: 0 0 8px 12px;
|
padding: 0 0 8px 0;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
&:empty {
|
&:empty {
|
||||||
|
@ -31,20 +29,13 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
> .caption {
|
> .caption {
|
||||||
font-size: 0.8em;
|
font-size: 0.85em;
|
||||||
padding: 8px 0 0 12px;
|
padding: 8px 0 0 0;
|
||||||
color: var(--fgTransparentWeak);
|
color: var(--fgTransparentWeak);
|
||||||
|
|
||||||
&:empty {
|
&:empty {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> .content {
|
|
||||||
position: relative;
|
|
||||||
background: var(--panel);
|
|
||||||
border: solid 0.5px var(--inputBorder);
|
|
||||||
border-radius: 6px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
98
packages/client/src/components/form/suspense.vue
Normal file
98
packages/client/src/components/form/suspense.vue
Normal file
|
@ -0,0 +1,98 @@
|
||||||
|
<template>
|
||||||
|
<transition name="fade" mode="out-in">
|
||||||
|
<div v-if="pending">
|
||||||
|
<MkLoading/>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="resolved">
|
||||||
|
<slot :result="result"></slot>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<div class="wszdbhzo">
|
||||||
|
<div><i class="fas fa-exclamation-triangle"></i> {{ $ts.somethingHappened }}</div>
|
||||||
|
<MkButton inline class="retry" @click="retry"><i class="fas fa-redo-alt"></i> {{ $ts.retry }}</MkButton>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent, PropType, ref, watch } from 'vue';
|
||||||
|
import MkButton from '@/components/ui/button.vue';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
components: {
|
||||||
|
MkButton
|
||||||
|
},
|
||||||
|
|
||||||
|
props: {
|
||||||
|
p: {
|
||||||
|
type: Function as PropType<() => Promise<any>>,
|
||||||
|
required: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
setup(props, context) {
|
||||||
|
const pending = ref(true);
|
||||||
|
const resolved = ref(false);
|
||||||
|
const rejected = ref(false);
|
||||||
|
const result = ref(null);
|
||||||
|
|
||||||
|
const process = () => {
|
||||||
|
if (props.p == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const promise = props.p();
|
||||||
|
pending.value = true;
|
||||||
|
resolved.value = false;
|
||||||
|
rejected.value = false;
|
||||||
|
promise.then((_result) => {
|
||||||
|
pending.value = false;
|
||||||
|
resolved.value = true;
|
||||||
|
result.value = _result;
|
||||||
|
});
|
||||||
|
promise.catch(() => {
|
||||||
|
pending.value = false;
|
||||||
|
rejected.value = true;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(() => props.p, () => {
|
||||||
|
process();
|
||||||
|
}, {
|
||||||
|
immediate: true
|
||||||
|
});
|
||||||
|
|
||||||
|
const retry = () => {
|
||||||
|
process();
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
pending,
|
||||||
|
resolved,
|
||||||
|
rejected,
|
||||||
|
result,
|
||||||
|
retry,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.fade-enter-active,
|
||||||
|
.fade-leave-active {
|
||||||
|
transition: opacity 0.125s ease;
|
||||||
|
}
|
||||||
|
.fade-enter-from,
|
||||||
|
.fade-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wszdbhzo {
|
||||||
|
padding: 16px;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
> .retry {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -18,7 +18,7 @@
|
||||||
</span>
|
</span>
|
||||||
<span class="label">
|
<span class="label">
|
||||||
<span><slot></slot></span>
|
<span><slot></slot></span>
|
||||||
<p><slot name="caption"></slot></p>
|
<p class="caption"><slot name="caption"></slot></p>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -118,10 +118,14 @@ export default defineComponent({
|
||||||
transition: inherit;
|
transition: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
> p {
|
> .caption {
|
||||||
margin: 0;
|
margin: 8px 0 0 0;
|
||||||
color: var(--fgTransparentWeak);
|
color: var(--fgTransparentWeak);
|
||||||
font-size: 90%;
|
font-size: 0.85em;
|
||||||
|
|
||||||
|
&:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<div class="input" :class="{ disabled, focused, tall, pre }">
|
<div class="input" :class="{ disabled, focused, tall, pre }">
|
||||||
<textarea ref="inputEl"
|
<textarea ref="inputEl"
|
||||||
v-model="v"
|
v-model="v"
|
||||||
|
v-panel
|
||||||
:class="{ code, _monospace: code }"
|
:class="{ code, _monospace: code }"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:required="required"
|
:required="required"
|
||||||
|
@ -20,7 +21,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="caption"><slot name="caption"></slot></div>
|
<div class="caption"><slot name="caption"></slot></div>
|
||||||
|
|
||||||
<MkButton v-if="manualSave && changed" primary @click="updated"><i class="fas fa-save"></i> {{ $ts.save }}</MkButton>
|
<MkButton v-if="manualSave && changed" primary class="save" @click="updated"><i class="fas fa-save"></i> {{ $ts.save }}</MkButton>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -174,7 +175,7 @@ export default defineComponent({
|
||||||
.adhpbeos {
|
.adhpbeos {
|
||||||
> .label {
|
> .label {
|
||||||
font-size: 0.85em;
|
font-size: 0.85em;
|
||||||
padding: 0 0 8px 12px;
|
padding: 0 0 8px 0;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
&:empty {
|
&:empty {
|
||||||
|
@ -183,8 +184,8 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
> .caption {
|
> .caption {
|
||||||
font-size: 0.8em;
|
font-size: 0.85em;
|
||||||
padding: 8px 0 0 12px;
|
padding: 8px 0 0 0;
|
||||||
color: var(--fgTransparentWeak);
|
color: var(--fgTransparentWeak);
|
||||||
|
|
||||||
&:empty {
|
&:empty {
|
||||||
|
@ -209,8 +210,7 @@ export default defineComponent({
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
color: var(--fg);
|
color: var(--fg);
|
||||||
background: var(--panel);
|
border: solid 0.5px var(--panel);
|
||||||
border: solid 0.5px var(--inputBorder);
|
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
outline: none;
|
outline: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
@ -248,5 +248,9 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
> .save {
|
||||||
|
margin: 8px 0 0 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -15,19 +15,29 @@ export default defineComponent({
|
||||||
type: Number,
|
type: Number,
|
||||||
required: false,
|
required: false,
|
||||||
default: null,
|
default: null,
|
||||||
}
|
},
|
||||||
|
marginMin: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: 12,
|
||||||
|
},
|
||||||
|
marginMax: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: 32,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
setup(props, context) {
|
setup(props, context) {
|
||||||
let ro: ResizeObserver;
|
let ro: ResizeObserver;
|
||||||
const root = ref<HTMLElement>(null);
|
const root = ref<HTMLElement>();
|
||||||
const content = ref<HTMLElement>(null);
|
const content = ref<HTMLElement>();
|
||||||
const margin = ref(0);
|
const margin = ref(0);
|
||||||
const adjust = (rect: { width: number; height: number; }) => {
|
const adjust = (rect: { width: number; height: number; }) => {
|
||||||
if (rect.width > (props.contentMax || 500)) {
|
if (rect.width > (props.contentMax || 500)) {
|
||||||
margin.value = 32;
|
margin.value = props.marginMax;
|
||||||
} else {
|
} else {
|
||||||
margin.value = 12;
|
margin.value = props.marginMin;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -40,14 +50,14 @@ export default defineComponent({
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
adjust({
|
adjust({
|
||||||
width: root.value.offsetWidth,
|
width: root.value!.offsetWidth,
|
||||||
height: root.value.offsetHeight,
|
height: root.value!.offsetHeight,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
ro.observe(root.value);
|
ro.observe(root.value!);
|
||||||
|
|
||||||
if (props.contentMax) {
|
if (props.contentMax) {
|
||||||
content.value.style.maxWidth = `${props.contentMax}px`;
|
content.value!.style.maxWidth = `${props.contentMax}px`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
48
packages/client/src/components/key-value.vue
Normal file
48
packages/client/src/components/key-value.vue
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
<template>
|
||||||
|
<div class="alqyeyti">
|
||||||
|
<div class="key">
|
||||||
|
<slot name="key"></slot>
|
||||||
|
</div>
|
||||||
|
<div class="value">
|
||||||
|
<slot name="value"></slot>
|
||||||
|
<button v-if="copy" v-tooltip="$ts.copy" class="_textButton" style="margin-left: 0.5em;" @click="copy_"><i class="far fa-copy"></i></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent } from 'vue';
|
||||||
|
import copyToClipboard from '@/scripts/copy-to-clipboard';
|
||||||
|
import * as os from '@/os';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
props: {
|
||||||
|
copy: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
setup(props) {
|
||||||
|
const copy_ = () => {
|
||||||
|
copyToClipboard(props.copy);
|
||||||
|
os.success();
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
copy_
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.alqyeyti {
|
||||||
|
> .key {
|
||||||
|
font-size: 0.85em;
|
||||||
|
padding: 0 0 0.25em 0;
|
||||||
|
opacity: 0.75;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -184,6 +184,11 @@ export default defineComponent({
|
||||||
count, speed,
|
count, speed,
|
||||||
}, genEl(token.children));
|
}, genEl(token.children));
|
||||||
}
|
}
|
||||||
|
case 'rotate': {
|
||||||
|
const degrees = parseInt(token.props.args.deg) || '90';
|
||||||
|
style = `transform: rotate(${degrees}deg); transform-origin: center center;`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (style == null) {
|
if (style == null) {
|
||||||
return h('span', {}, ['$[', token.props.name, ' ', ...genEl(token.children), ']']);
|
return h('span', {}, ['$[', token.props.name, ' ', ...genEl(token.children), ']']);
|
||||||
|
|
|
@ -42,8 +42,6 @@
|
||||||
<MkUserName :user="appearNote.user"/>
|
<MkUserName :user="appearNote.user"/>
|
||||||
</MkA>
|
</MkA>
|
||||||
<span v-if="appearNote.user.isBot" class="is-bot">bot</span>
|
<span v-if="appearNote.user.isBot" class="is-bot">bot</span>
|
||||||
<span v-if="appearNote.user.isAdmin" class="admin"><i class="fas fa-bookmark"></i></span>
|
|
||||||
<span v-if="!appearNote.user.isAdmin && appearNote.user.isModerator" class="moderator"><i class="far fa-bookmark"></i></span>
|
|
||||||
<span v-if="appearNote.visibility !== 'public'" class="visibility">
|
<span v-if="appearNote.visibility !== 'public'" class="visibility">
|
||||||
<i v-if="appearNote.visibility === 'home'" class="fas fa-home"></i>
|
<i v-if="appearNote.visibility === 'home'" class="fas fa-home"></i>
|
||||||
<i v-else-if="appearNote.visibility === 'followers'" class="fas fa-unlock"></i>
|
<i v-else-if="appearNote.visibility === 'followers'" class="fas fa-unlock"></i>
|
||||||
|
@ -86,7 +84,9 @@
|
||||||
</div>
|
</div>
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<MkTime class="created-at" :time="appearNote.createdAt" mode="detail"/>
|
<MkA class="created-at" :to="notePage(appearNote)">
|
||||||
|
<MkTime :time="appearNote.createdAt" mode="detail"/>
|
||||||
|
</MkA>
|
||||||
</div>
|
</div>
|
||||||
<XReactionsViewer ref="reactionsViewer" :note="appearNote"/>
|
<XReactionsViewer ref="reactionsViewer" :note="appearNote"/>
|
||||||
<button class="button _button" @click="reply()">
|
<button class="button _button" @click="reply()">
|
||||||
|
@ -138,6 +138,7 @@ import { url } from '@/config';
|
||||||
import copyToClipboard from '@/scripts/copy-to-clipboard';
|
import copyToClipboard from '@/scripts/copy-to-clipboard';
|
||||||
import { checkWordMute } from '@/scripts/check-word-mute';
|
import { checkWordMute } from '@/scripts/check-word-mute';
|
||||||
import { userPage } from '@/filters/user';
|
import { userPage } from '@/filters/user';
|
||||||
|
import { notePage } from '@/filters/note';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import { noteActions, noteViewInterruptors } from '@/store';
|
import { noteActions, noteViewInterruptors } from '@/store';
|
||||||
import { reactionPicker } from '@/scripts/reaction-picker';
|
import { reactionPicker } from '@/scripts/reaction-picker';
|
||||||
|
@ -183,6 +184,7 @@ export default defineComponent({
|
||||||
muted: false,
|
muted: false,
|
||||||
translation: null,
|
translation: null,
|
||||||
translating: false,
|
translating: false,
|
||||||
|
notePage,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1017,12 +1019,6 @@ export default defineComponent({
|
||||||
border: solid 0.5px var(--divider);
|
border: solid 0.5px var(--divider);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .admin,
|
|
||||||
> .moderator {
|
|
||||||
margin-right: 0.5em;
|
|
||||||
color: var(--badge);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,6 @@
|
||||||
</MkA>
|
</MkA>
|
||||||
<div v-if="note.user.isBot" class="is-bot">bot</div>
|
<div v-if="note.user.isBot" class="is-bot">bot</div>
|
||||||
<div class="username"><MkAcct :user="note.user"/></div>
|
<div class="username"><MkAcct :user="note.user"/></div>
|
||||||
<div v-if="note.user.isAdmin" class="admin"><i class="fas fa-bookmark"></i></div>
|
|
||||||
<div v-if="!note.user.isAdmin && note.user.isModerator" class="moderator"><i class="far fa-bookmark"></i></div>
|
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<MkA class="created-at" :to="notePage(note)">
|
<MkA class="created-at" :to="notePage(note)">
|
||||||
<MkTime :time="note.createdAt"/>
|
<MkTime :time="note.createdAt"/>
|
||||||
|
@ -23,7 +21,7 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import notePage from '@/filters/note';
|
import { notePage } from '@/filters/note';
|
||||||
import { userPage } from '@/filters/user';
|
import { userPage } from '@/filters/user';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
|
|
||||||
|
@ -79,13 +77,6 @@ export default defineComponent({
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .admin,
|
|
||||||
> .moderator {
|
|
||||||
flex-shrink: 0;
|
|
||||||
margin-right: 0.5em;
|
|
||||||
color: var(--badge);
|
|
||||||
}
|
|
||||||
|
|
||||||
> .username {
|
> .username {
|
||||||
flex-shrink: 9999999;
|
flex-shrink: 9999999;
|
||||||
margin: 0 .5em 0 0;
|
margin: 0 .5em 0 0;
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import notePage from '@/filters/note';
|
import { notePage } from '@/filters/note';
|
||||||
import XNoteHeader from './note-header.vue';
|
import XNoteHeader from './note-header.vue';
|
||||||
import XSubNoteContent from './sub-note-content.vue';
|
import XSubNoteContent from './sub-note-content.vue';
|
||||||
import XCwButton from './cw-button.vue';
|
import XCwButton from './cw-button.vue';
|
||||||
|
|
|
@ -858,6 +858,7 @@ export default defineComponent({
|
||||||
.tkcbzcuz {
|
.tkcbzcuz {
|
||||||
position: relative;
|
position: relative;
|
||||||
transition: box-shadow 0.1s ease;
|
transition: box-shadow 0.1s ease;
|
||||||
|
font-size: 1.05em;
|
||||||
overflow: clip;
|
overflow: clip;
|
||||||
contain: content;
|
contain: content;
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ import { getNoteSummary } from '@/scripts/get-note-summary';
|
||||||
import XReactionIcon from './reaction-icon.vue';
|
import XReactionIcon from './reaction-icon.vue';
|
||||||
import MkFollowButton from './follow-button.vue';
|
import MkFollowButton from './follow-button.vue';
|
||||||
import XReactionTooltip from './reaction-tooltip.vue';
|
import XReactionTooltip from './reaction-tooltip.vue';
|
||||||
import notePage from '@/filters/note';
|
import { notePage } from '@/filters/note';
|
||||||
import { userPage } from '@/filters/user';
|
import { userPage } from '@/filters/user';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
|
@ -107,28 +107,25 @@ export default defineComponent({
|
||||||
const reactionRef = ref(null);
|
const reactionRef = ref(null);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
let readObserver: IntersectionObserver | null = null;
|
|
||||||
let connection = null;
|
|
||||||
|
|
||||||
if (!props.notification.isRead) {
|
if (!props.notification.isRead) {
|
||||||
readObserver = new IntersectionObserver((entries, observer) => {
|
const readObserver = new IntersectionObserver((entries, observer) => {
|
||||||
if (!entries.some(entry => entry.isIntersecting)) return;
|
if (!entries.some(entry => entry.isIntersecting)) return;
|
||||||
os.stream.send('readNotification', {
|
os.stream.send('readNotification', {
|
||||||
id: props.notification.id
|
id: props.notification.id
|
||||||
});
|
});
|
||||||
entries.map(({ target }) => observer.unobserve(target));
|
observer.disconnect();
|
||||||
});
|
});
|
||||||
|
|
||||||
readObserver.observe(elRef.value);
|
readObserver.observe(elRef.value);
|
||||||
|
|
||||||
connection = os.stream.useChannel('main');
|
const connection = os.stream.useChannel('main');
|
||||||
connection.on('readAllNotifications', () => readObserver.unobserve(elRef.value));
|
connection.on('readAllNotifications', () => readObserver.disconnect());
|
||||||
}
|
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
if (readObserver) readObserver.unobserve(elRef.value);
|
readObserver.disconnect();
|
||||||
if (connection) connection.dispose();
|
connection.dispose();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const followRequestDone = ref(false);
|
const followRequestDone = ref(false);
|
||||||
|
|
|
@ -87,14 +87,20 @@ export default defineComponent({
|
||||||
toggleShowResult() {
|
toggleShowResult() {
|
||||||
this.showResult = !this.showResult;
|
this.showResult = !this.showResult;
|
||||||
},
|
},
|
||||||
vote(id) {
|
async vote(id) {
|
||||||
if (this.readOnly || this.closed || !this.poll.multiple && this.poll.choices.some(c => c.isVoted)) return;
|
if (this.readOnly || this.closed || !this.poll.multiple && this.poll.choices.some(c => c.isVoted)) return;
|
||||||
os.api('notes/polls/vote', {
|
|
||||||
|
const { canceled } = await os.confirm({
|
||||||
|
type: 'question',
|
||||||
|
text: this.$t('voteConfirm', { choice: this.poll.choices[id].text }),
|
||||||
|
});
|
||||||
|
if (canceled) return;
|
||||||
|
|
||||||
|
await os.api('notes/polls/vote', {
|
||||||
noteId: this.note.id,
|
noteId: this.note.id,
|
||||||
choice: id
|
choice: id
|
||||||
}).then(() => {
|
|
||||||
if (!this.showResult) this.showResult = !this.poll.multiple;
|
|
||||||
});
|
});
|
||||||
|
if (!this.showResult) this.showResult = !this.poll.multiple;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -97,9 +97,7 @@ export default defineComponent({
|
||||||
limit: 11
|
limit: 11
|
||||||
});
|
});
|
||||||
|
|
||||||
const users = reactions
|
const users = reactions.map(x => x.user);
|
||||||
.sort((a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime())
|
|
||||||
.map(x => x.user);
|
|
||||||
|
|
||||||
os.popup(XDetails, {
|
os.popup(XDetails, {
|
||||||
showing,
|
showing,
|
||||||
|
|
|
@ -48,9 +48,7 @@ export default defineComponent({
|
||||||
limit: 11
|
limit: 11
|
||||||
});
|
});
|
||||||
|
|
||||||
const users = renotes
|
const users = renotes.map(x => x.user);
|
||||||
.sort((a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime())
|
|
||||||
.map(x => x.user);
|
|
||||||
|
|
||||||
if (users.length < 1) return;
|
if (users.length < 1) return;
|
||||||
|
|
||||||
|
|
|
@ -197,6 +197,14 @@ export default defineComponent({
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case '932c904e-9460-45b7-9ce6-7ed33be7eb2c': {
|
||||||
|
os.alert({
|
||||||
|
type: 'error',
|
||||||
|
title: this.$ts.loginFailed,
|
||||||
|
text: this.$ts.incorrectPassword,
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'e03a5f46-d309-4865-9b69-56282d94e1eb': {
|
case 'e03a5f46-d309-4865-9b69-56282d94e1eb': {
|
||||||
showSuspendedDialog();
|
showSuspendedDialog();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -142,12 +142,12 @@ export default defineComponent({
|
||||||
padding: 8px 14px;
|
padding: 8px 14px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-size: 0.8em;
|
font-size: 0.9em;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
background: var(--buttonBg);
|
background: var(--buttonBg);
|
||||||
border-radius: 4px;
|
border-radius: 5px;
|
||||||
overflow: clip;
|
overflow: clip;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
transition: background 0.1s ease;
|
transition: background 0.1s ease;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div ref="items" v-hotkey="keymap"
|
<div ref="items" v-hotkey="keymap"
|
||||||
class="rrevdjwt"
|
class="rrevdjwt"
|
||||||
:class="{ center: align === 'center' }"
|
:class="{ center: align === 'center' }"
|
||||||
:style="{ width: width ? width + 'px' : null }"
|
:style="{ width: width ? width + 'px' : null, maxHeight: maxHeight ? maxHeight + 'px' : null }"
|
||||||
@contextmenu.self="e => e.preventDefault()"
|
@contextmenu.self="e => e.preventDefault()"
|
||||||
>
|
>
|
||||||
<template v-for="(item, i) in items2">
|
<template v-for="(item, i) in items2">
|
||||||
|
@ -64,6 +64,10 @@ export default defineComponent({
|
||||||
type: Number,
|
type: Number,
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
|
maxHeight: {
|
||||||
|
type: Number,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
},
|
},
|
||||||
emits: ['close'],
|
emits: ['close'],
|
||||||
data() {
|
data() {
|
||||||
|
@ -146,8 +150,8 @@ export default defineComponent({
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.rrevdjwt {
|
.rrevdjwt {
|
||||||
padding: 8px 0;
|
padding: 8px 0;
|
||||||
|
box-sizing: border-box;
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
max-height: 90vh;
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
&.center {
|
&.center {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<MkPopup ref="popup" :src="src" @closed="$emit('closed')">
|
<MkPopup ref="popup" v-slot="{ maxHeight, close }" :src="src" @closed="$emit('closed')">
|
||||||
<MkMenu :items="items" :align="align" :width="width" class="_popup _shadow" @close="$refs.popup.close()"/>
|
<MkMenu :items="items" :align="align" :width="width" :max-height="maxHeight" class="_popup _shadow" @close="close()"/>
|
||||||
</MkPopup>
|
</MkPopup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<transition :name="$store.state.animation ? 'popup-menu' : ''" appear @after-leave="onClosed" @enter="$emit('opening')" @after-enter="childRendered">
|
<transition :name="$store.state.animation ? 'popup-menu' : ''" appear @after-leave="$emit('closed')" @enter="$emit('opening')">
|
||||||
<div v-show="manualShowing != null ? manualShowing : showing" ref="content" class="ccczpooj" :class="{ front, fixed, top: position === 'top' }" :style="{ pointerEvents: (manualShowing != null ? manualShowing : showing) ? 'auto' : 'none', '--transformOrigin': transformOrigin }">
|
<div v-show="manualShowing != null ? manualShowing : showing" ref="content" class="ccczpooj" :class="{ front, fixed, top: position === 'top' }" :style="{ pointerEvents: (manualShowing != null ? manualShowing : showing) ? 'auto' : 'none', '--transformOrigin': transformOrigin }">
|
||||||
<slot></slot>
|
<slot :max-height="maxHeight" :close="close"></slot>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, PropType } from 'vue';
|
import { defineComponent, nextTick, onMounted, onUnmounted, PropType, ref, watch } from 'vue';
|
||||||
|
|
||||||
function getFixedContainer(el: Element | null): Element | null {
|
function getFixedContainer(el: Element | null | undefined): Element | null {
|
||||||
if (el == null || el.tagName === 'BODY') return null;
|
if (el == null || el.tagName === 'BODY') return null;
|
||||||
const position = window.getComputedStyle(el).getPropertyValue('position');
|
const position = window.getComputedStyle(el).getPropertyValue('position');
|
||||||
if (position === 'fixed') {
|
if (position === 'fixed') {
|
||||||
|
@ -41,55 +41,40 @@ export default defineComponent({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
default: false,
|
default: false,
|
||||||
}
|
},
|
||||||
|
noOverlap: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
emits: ['opening', 'click', 'esc', 'close', 'closed'],
|
emits: ['opening', 'click', 'esc', 'close', 'closed'],
|
||||||
|
|
||||||
data() {
|
setup(props, context) {
|
||||||
return {
|
const maxHeight = ref<number>();
|
||||||
showing: true,
|
const fixed = ref(false);
|
||||||
fixed: false,
|
const transformOrigin = ref('center');
|
||||||
transformOrigin: 'center',
|
const showing = ref(true);
|
||||||
contentClicking: false,
|
const content = ref<HTMLElement>();
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
const close = () => {
|
||||||
this.$watch('src', () => {
|
|
||||||
if (this.src) {
|
|
||||||
// eslint-disable-next-line vue/no-mutating-props
|
// eslint-disable-next-line vue/no-mutating-props
|
||||||
this.src.style.pointerEvents = 'none';
|
if (props.src) props.src.style.pointerEvents = 'auto';
|
||||||
}
|
showing.value = false;
|
||||||
this.fixed = getFixedContainer(this.src) != null;
|
context.emit('close');
|
||||||
this.$nextTick(() => {
|
};
|
||||||
this.align();
|
|
||||||
});
|
|
||||||
}, { immediate: true });
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
const MARGIN = 16;
|
||||||
const popover = this.$refs.content as any;
|
|
||||||
new ResizeObserver((entries, observer) => {
|
|
||||||
this.align();
|
|
||||||
}).observe(popover);
|
|
||||||
});
|
|
||||||
|
|
||||||
document.addEventListener('mousedown', this.onDocumentClick, { passive: true });
|
const align = () => {
|
||||||
},
|
if (props.src == null) return;
|
||||||
|
|
||||||
beforeUnmount() {
|
const popover = content.value!;
|
||||||
document.removeEventListener('mousedown', this.onDocumentClick);
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
align() {
|
|
||||||
if (this.src == null) return;
|
|
||||||
|
|
||||||
const popover = this.$refs.content as any;
|
|
||||||
|
|
||||||
if (popover == null) return;
|
if (popover == null) return;
|
||||||
|
|
||||||
const rect = this.src.getBoundingClientRect();
|
const rect = props.src.getBoundingClientRect();
|
||||||
|
|
||||||
const width = popover.offsetWidth;
|
const width = popover.offsetWidth;
|
||||||
const height = popover.offsetHeight;
|
const height = popover.offsetHeight;
|
||||||
|
@ -97,81 +82,84 @@ export default defineComponent({
|
||||||
let left;
|
let left;
|
||||||
let top;
|
let top;
|
||||||
|
|
||||||
if (this.srcCenter) {
|
if (props.srcCenter) {
|
||||||
const x = rect.left + (this.fixed ? 0 : window.pageXOffset) + (this.src.offsetWidth / 2);
|
const x = rect.left + (fixed.value ? 0 : window.pageXOffset) + (props.src.offsetWidth / 2);
|
||||||
const y = rect.top + (this.fixed ? 0 : window.pageYOffset) + (this.src.offsetHeight / 2);
|
const y = rect.top + (fixed.value ? 0 : window.pageYOffset) + (props.src.offsetHeight / 2);
|
||||||
left = (x - (width / 2));
|
left = (x - (width / 2));
|
||||||
top = (y - (height / 2));
|
top = (y - (height / 2));
|
||||||
} else {
|
} else {
|
||||||
const x = rect.left + (this.fixed ? 0 : window.pageXOffset) + (this.src.offsetWidth / 2);
|
const x = rect.left + (fixed.value ? 0 : window.pageXOffset) + (props.src.offsetWidth / 2);
|
||||||
const y = rect.top + (this.fixed ? 0 : window.pageYOffset) + this.src.offsetHeight;
|
const y = rect.top + (fixed.value ? 0 : window.pageYOffset) + props.src.offsetHeight;
|
||||||
left = (x - (width / 2));
|
left = (x - (width / 2));
|
||||||
top = y;
|
top = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.fixed) {
|
if (fixed.value) {
|
||||||
|
// 画面から横にはみ出る場合
|
||||||
if (left + width > window.innerWidth) {
|
if (left + width > window.innerWidth) {
|
||||||
left = window.innerWidth - width;
|
left = window.innerWidth - width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (top + height > window.innerHeight) {
|
// 画面から縦にはみ出る場合
|
||||||
top = window.innerHeight - height;
|
if (top + height > (window.innerHeight - MARGIN)) {
|
||||||
|
if (props.noOverlap) {
|
||||||
|
const underSpace = (window.innerHeight - MARGIN) - top;
|
||||||
|
const upperSpace = (rect.top - MARGIN);
|
||||||
|
if (underSpace >= (upperSpace / 3)) {
|
||||||
|
maxHeight.value = underSpace;
|
||||||
|
} else {
|
||||||
|
maxHeight.value = upperSpace;
|
||||||
|
top = (upperSpace + MARGIN) - height;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
top = (window.innerHeight - MARGIN) - height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 画面から横にはみ出る場合
|
||||||
if (left + width - window.pageXOffset > window.innerWidth) {
|
if (left + width - window.pageXOffset > window.innerWidth) {
|
||||||
left = window.innerWidth - width + window.pageXOffset - 1;
|
left = window.innerWidth - width + window.pageXOffset - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (top + height - window.pageYOffset > window.innerHeight) {
|
// 画面から縦にはみ出る場合
|
||||||
top = window.innerHeight - height + window.pageYOffset - 1;
|
if (top + height - window.pageYOffset > (window.innerHeight - MARGIN)) {
|
||||||
|
if (props.noOverlap) {
|
||||||
|
const underSpace = (window.innerHeight - MARGIN) - (top - window.pageYOffset);
|
||||||
|
const upperSpace = (rect.top - MARGIN);
|
||||||
|
if (underSpace >= (upperSpace / 3)) {
|
||||||
|
maxHeight.value = underSpace;
|
||||||
|
} else {
|
||||||
|
maxHeight.value = upperSpace;
|
||||||
|
top = window.pageYOffset + ((upperSpace + MARGIN) - height);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
top = (window.innerHeight - MARGIN) - height + window.pageYOffset - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (top < 0) {
|
if (top < 0) {
|
||||||
top = 0;
|
top = MARGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (left < 0) {
|
if (left < 0) {
|
||||||
left = 0;
|
left = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (top > rect.top + (this.fixed ? 0 : window.pageYOffset)) {
|
if (top > rect.top + (fixed.value ? 0 : window.pageYOffset)) {
|
||||||
this.transformOrigin = 'center top';
|
transformOrigin.value = 'center top';
|
||||||
|
} else if ((top + height) <= rect.top + (fixed.value ? 0 : window.pageYOffset)) {
|
||||||
|
transformOrigin.value = 'center bottom';
|
||||||
} else {
|
} else {
|
||||||
this.transformOrigin = 'center';
|
transformOrigin.value = 'center';
|
||||||
}
|
}
|
||||||
|
|
||||||
popover.style.left = left + 'px';
|
popover.style.left = left + 'px';
|
||||||
popover.style.top = top + 'px';
|
popover.style.top = top + 'px';
|
||||||
},
|
};
|
||||||
|
|
||||||
childRendered() {
|
const onDocumentClick = (ev: MouseEvent) => {
|
||||||
// モーダルコンテンツにマウスボタンが押され、コンテンツ外でマウスボタンが離されたときにモーダルバックグラウンドクリックと判定させないためにマウスイベントを監視しフラグ管理する
|
const flyoutElement = content.value;
|
||||||
const content = this.$refs.content.children[0];
|
|
||||||
content.addEventListener('mousedown', e => {
|
|
||||||
this.contentClicking = true;
|
|
||||||
window.addEventListener('mouseup', e => {
|
|
||||||
// click イベントより先に mouseup イベントが発生するかもしれないのでちょっと待つ
|
|
||||||
setTimeout(() => {
|
|
||||||
this.contentClicking = false;
|
|
||||||
}, 100);
|
|
||||||
}, { passive: true, once: true });
|
|
||||||
}, { passive: true });
|
|
||||||
},
|
|
||||||
|
|
||||||
close() {
|
|
||||||
// eslint-disable-next-line vue/no-mutating-props
|
|
||||||
if (this.src) this.src.style.pointerEvents = 'auto';
|
|
||||||
this.showing = false;
|
|
||||||
this.$emit('close');
|
|
||||||
},
|
|
||||||
|
|
||||||
onClosed() {
|
|
||||||
this.$emit('closed');
|
|
||||||
},
|
|
||||||
|
|
||||||
onDocumentClick(ev) {
|
|
||||||
const flyoutElement = this.$refs.content;
|
|
||||||
let targetElement = ev.target;
|
let targetElement = ev.target;
|
||||||
do {
|
do {
|
||||||
if (targetElement === flyoutElement) {
|
if (targetElement === flyoutElement) {
|
||||||
|
@ -179,9 +167,45 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
targetElement = targetElement.parentNode;
|
targetElement = targetElement.parentNode;
|
||||||
} while (targetElement);
|
} while (targetElement);
|
||||||
this.close();
|
close();
|
||||||
}
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
watch(() => props.src, async () => {
|
||||||
|
if (props.src) {
|
||||||
|
// eslint-disable-next-line vue/no-mutating-props
|
||||||
|
props.src.style.pointerEvents = 'none';
|
||||||
}
|
}
|
||||||
|
fixed.value = getFixedContainer(props.src) != null;
|
||||||
|
|
||||||
|
await nextTick()
|
||||||
|
|
||||||
|
align();
|
||||||
|
}, { immediate: true, });
|
||||||
|
|
||||||
|
nextTick(() => {
|
||||||
|
const popover = content.value;
|
||||||
|
new ResizeObserver((entries, observer) => {
|
||||||
|
align();
|
||||||
|
}).observe(popover!);
|
||||||
|
});
|
||||||
|
|
||||||
|
document.addEventListener('mousedown', onDocumentClick, { passive: true });
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
document.removeEventListener('mousedown', onDocumentClick);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
showing,
|
||||||
|
fixed,
|
||||||
|
content,
|
||||||
|
transformOrigin,
|
||||||
|
maxHeight,
|
||||||
|
close,
|
||||||
|
};
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,6 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
> .title {
|
> .title {
|
||||||
font-size: 0.9em;
|
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
margin: 0 0 8px 12px;
|
margin: 0 0 8px 12px;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +63,6 @@ export default defineComponent({
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 10px 16px 10px 8px;
|
padding: 10px 16px 10px 8px;
|
||||||
border-radius: 9px;
|
border-radius: 9px;
|
||||||
font-size: 0.9em;
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<transition name="tooltip" appear @after-leave="$emit('closed')">
|
<transition name="tooltip" appear @after-leave="$emit('closed')">
|
||||||
<div v-show="showing" ref="content" class="buebdbiu _acrylic _shadow" :style="{ maxWidth: maxWidth + 'px' }">
|
<div v-show="showing" ref="el" class="buebdbiu _acrylic _shadow" :style="{ maxWidth: maxWidth + 'px' }">
|
||||||
<slot>{{ text }}</slot>
|
<slot>{{ text }}</slot>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent, nextTick, onMounted, onUnmounted, ref } from 'vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
|
@ -31,35 +31,64 @@ export default defineComponent({
|
||||||
|
|
||||||
emits: ['closed'],
|
emits: ['closed'],
|
||||||
|
|
||||||
mounted() {
|
setup(props, context) {
|
||||||
this.$nextTick(() => {
|
const el = ref<HTMLElement>();
|
||||||
if (this.source == null) {
|
|
||||||
this.$emit('closed');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const rect = this.source.getBoundingClientRect();
|
const setPosition = () => {
|
||||||
|
if (el.value == null) return;
|
||||||
|
|
||||||
const contentWidth = this.$refs.content.offsetWidth;
|
const rect = props.source.getBoundingClientRect();
|
||||||
const contentHeight = this.$refs.content.offsetHeight;
|
|
||||||
|
|
||||||
let left = rect.left + window.pageXOffset + (this.source.offsetWidth / 2);
|
const contentWidth = el.value.offsetWidth;
|
||||||
|
const contentHeight = el.value.offsetHeight;
|
||||||
|
|
||||||
|
let left = rect.left + window.pageXOffset + (props.source.offsetWidth / 2);
|
||||||
let top = rect.top + window.pageYOffset - contentHeight;
|
let top = rect.top + window.pageYOffset - contentHeight;
|
||||||
|
|
||||||
left -= (this.$el.offsetWidth / 2);
|
left -= (el.value.offsetWidth / 2);
|
||||||
|
|
||||||
if (left + contentWidth - window.pageXOffset > window.innerWidth) {
|
if (left + contentWidth - window.pageXOffset > window.innerWidth) {
|
||||||
left = window.innerWidth - contentWidth + window.pageXOffset - 1;
|
left = window.innerWidth - contentWidth + window.pageXOffset - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (top - window.pageYOffset < 0) {
|
if (top - window.pageYOffset < 0) {
|
||||||
top = rect.top + window.pageYOffset + this.source.offsetHeight;
|
top = rect.top + window.pageYOffset + props.source.offsetHeight;
|
||||||
this.$refs.content.style.transformOrigin = 'center top';
|
el.value.style.transformOrigin = 'center top';
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$el.style.left = left + 'px';
|
el.value.style.left = left + 'px';
|
||||||
this.$el.style.top = top + 'px';
|
el.value.style.top = top + 'px';
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
nextTick(() => {
|
||||||
|
if (props.source == null) {
|
||||||
|
context.emit('closed');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setPosition();
|
||||||
|
|
||||||
|
let loopHandler;
|
||||||
|
|
||||||
|
const loop = () => {
|
||||||
|
loopHandler = window.requestAnimationFrame(() => {
|
||||||
|
setPosition();
|
||||||
|
loop();
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
loop();
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
window.cancelAnimationFrame(loopHandler);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
el,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -10,6 +10,7 @@ import appear from './appear';
|
||||||
import anim from './anim';
|
import anim from './anim';
|
||||||
import stickyContainer from './sticky-container';
|
import stickyContainer from './sticky-container';
|
||||||
import clickAnime from './click-anime';
|
import clickAnime from './click-anime';
|
||||||
|
import panel from './panel';
|
||||||
|
|
||||||
export default function(app: App) {
|
export default function(app: App) {
|
||||||
app.directive('userPreview', userPreview);
|
app.directive('userPreview', userPreview);
|
||||||
|
@ -23,4 +24,5 @@ export default function(app: App) {
|
||||||
app.directive('anim', anim);
|
app.directive('anim', anim);
|
||||||
app.directive('click-anime', clickAnime);
|
app.directive('click-anime', clickAnime);
|
||||||
app.directive('sticky-container', stickyContainer);
|
app.directive('sticky-container', stickyContainer);
|
||||||
|
app.directive('panel', panel);
|
||||||
}
|
}
|
||||||
|
|
24
packages/client/src/directives/panel.ts
Normal file
24
packages/client/src/directives/panel.ts
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
import { Directive } from 'vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mounted(src, binding, vn) {
|
||||||
|
const getBgColor = (el: HTMLElement) => {
|
||||||
|
const style = window.getComputedStyle(el);
|
||||||
|
if (style.backgroundColor && !['rgba(0, 0, 0, 0)', 'rgba(0,0,0,0)', 'transparent'].includes(style.backgroundColor)) {
|
||||||
|
return style.backgroundColor;
|
||||||
|
} else {
|
||||||
|
return getBgColor(el.parentElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const parentBg = getBgColor(src.parentElement);
|
||||||
|
|
||||||
|
const myBg = getComputedStyle(document.documentElement).getPropertyValue('--panel');
|
||||||
|
|
||||||
|
if (parentBg === myBg) {
|
||||||
|
src.style.backgroundColor = 'var(--bg)';
|
||||||
|
} else {
|
||||||
|
src.style.backgroundColor = 'var(--panel)';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
} as Directive;
|
|
@ -1,3 +1,3 @@
|
||||||
export default note => {
|
export const notePage = note => {
|
||||||
return `/notes/${note.id}`;
|
return `/notes/${note.id}`;
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,6 +12,16 @@ import { resolve } from '@/router';
|
||||||
import { $i } from '@/account';
|
import { $i } from '@/account';
|
||||||
import { defaultStore } from '@/store';
|
import { defaultStore } from '@/store';
|
||||||
|
|
||||||
|
export let isScreenTouching = false;
|
||||||
|
|
||||||
|
window.addEventListener('touchstart', () => {
|
||||||
|
isScreenTouching = true;
|
||||||
|
}, { passive: true });
|
||||||
|
|
||||||
|
window.addEventListener('touchend', () => {
|
||||||
|
isScreenTouching = false;
|
||||||
|
}, { passive: true });
|
||||||
|
|
||||||
export const stream = markRaw(new Misskey.Stream(url, $i));
|
export const stream = markRaw(new Misskey.Stream(url, $i));
|
||||||
|
|
||||||
export const pendingApiRequestsCount = ref(0);
|
export const pendingApiRequestsCount = ref(0);
|
||||||
|
@ -214,6 +224,10 @@ export function modalPageWindow(path: string) {
|
||||||
}, {}, 'closed');
|
}, {}, 'closed');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function toast(message: string) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
export function alert(props: {
|
export function alert(props: {
|
||||||
type?: 'error' | 'info' | 'success' | 'warning' | 'waiting' | 'question';
|
type?: 'error' | 'info' | 'success' | 'warning' | 'waiting' | 'question';
|
||||||
title?: string | null;
|
title?: string | null;
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="overflow: clip;">
|
<div style="overflow: clip;">
|
||||||
<FormBase class="znqjceqz">
|
<MkSpacer :content-max="600" :margin-min="20">
|
||||||
|
<div class="_formRoot znqjceqz">
|
||||||
<div id="debug"></div>
|
<div id="debug"></div>
|
||||||
<section class="_debobigegoItem about">
|
<div ref="about" v-panel class="_formBlock about" :class="{ playing: easterEggEngine != null }">
|
||||||
<div ref="about" class="_debobigegoPanel panel" :class="{ playing: easterEggEngine != null }">
|
|
||||||
<img src="/client-assets/about-icon.png" alt="" class="icon" draggable="false" @load="iconLoaded" @click="gravity"/>
|
<img src="/client-assets/about-icon.png" alt="" class="icon" draggable="false" @load="iconLoaded" @click="gravity"/>
|
||||||
<div class="misskey">Misskey</div>
|
<div class="misskey">Misskey</div>
|
||||||
<div class="version">v{{ version }}</div>
|
<div class="version">v{{ version }}</div>
|
||||||
<span v-for="emoji in easterEggEmojis" :key="emoji.id" class="emoji" :data-physics-x="emoji.left" :data-physics-y="emoji.top" :class="{ _physics_circle_: !emoji.emoji.startsWith(':') }"><MkEmoji class="emoji" :emoji="emoji.emoji" :custom-emojis="$instance.emojis" :is-reaction="false" :normal="true" :no-style="true"/></span>
|
<span v-for="emoji in easterEggEmojis" :key="emoji.id" class="emoji" :data-physics-x="emoji.left" :data-physics-y="emoji.top" :class="{ _physics_circle_: !emoji.emoji.startsWith(':') }"><MkEmoji class="emoji" :emoji="emoji.emoji" :custom-emojis="$instance.emojis" :is-reaction="false" :normal="true" :no-style="true"/></span>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
<div class="_formBlock" style="text-align: center;">
|
||||||
<section class="_debobigegoItem" style="text-align: center; padding: 0 16px;">
|
|
||||||
{{ $ts._aboutMisskey.about }}<br><a href="https://misskey-hub.net/docs/misskey.html" target="_blank" class="_link">{{ $ts.learnMore }}</a>
|
{{ $ts._aboutMisskey.about }}<br><a href="https://misskey-hub.net/docs/misskey.html" target="_blank" class="_link">{{ $ts.learnMore }}</a>
|
||||||
</section>
|
</div>
|
||||||
<FormGroup>
|
<FormSection>
|
||||||
|
<div class="_formLinks">
|
||||||
<FormLink to="https://github.com/misskey-dev/misskey" external>
|
<FormLink to="https://github.com/misskey-dev/misskey" external>
|
||||||
<template #icon><i class="fas fa-code"></i></template>
|
<template #icon><i class="fas fa-code"></i></template>
|
||||||
{{ $ts._aboutMisskey.source }}
|
{{ $ts._aboutMisskey.source }}
|
||||||
|
@ -29,9 +29,11 @@
|
||||||
{{ $ts._aboutMisskey.donate }}
|
{{ $ts._aboutMisskey.donate }}
|
||||||
<template #suffix>Patreon</template>
|
<template #suffix>Patreon</template>
|
||||||
</FormLink>
|
</FormLink>
|
||||||
</FormGroup>
|
</div>
|
||||||
<FormGroup>
|
</FormSection>
|
||||||
|
<FormSection>
|
||||||
<template #label>{{ $ts._aboutMisskey.contributors }}</template>
|
<template #label>{{ $ts._aboutMisskey.contributors }}</template>
|
||||||
|
<div class="_formLinks">
|
||||||
<FormLink to="https://github.com/syuilo" external>@syuilo</FormLink>
|
<FormLink to="https://github.com/syuilo" external>@syuilo</FormLink>
|
||||||
<FormLink to="https://github.com/AyaMorisawa" external>@AyaMorisawa</FormLink>
|
<FormLink to="https://github.com/AyaMorisawa" external>@AyaMorisawa</FormLink>
|
||||||
<FormLink to="https://github.com/mei23" external>@mei23</FormLink>
|
<FormLink to="https://github.com/mei23" external>@mei23</FormLink>
|
||||||
|
@ -41,24 +43,25 @@
|
||||||
<FormLink to="https://github.com/Xeltica" external>@Xeltica</FormLink>
|
<FormLink to="https://github.com/Xeltica" external>@Xeltica</FormLink>
|
||||||
<FormLink to="https://github.com/u1-liquid" external>@u1-liquid</FormLink>
|
<FormLink to="https://github.com/u1-liquid" external>@u1-liquid</FormLink>
|
||||||
<FormLink to="https://github.com/marihachi" external>@marihachi</FormLink>
|
<FormLink to="https://github.com/marihachi" external>@marihachi</FormLink>
|
||||||
|
</div>
|
||||||
<template #caption><MkLink url="https://github.com/misskey-dev/misskey/graphs/contributors">{{ $ts._aboutMisskey.allContributors }}</MkLink></template>
|
<template #caption><MkLink url="https://github.com/misskey-dev/misskey/graphs/contributors">{{ $ts._aboutMisskey.allContributors }}</MkLink></template>
|
||||||
</FormGroup>
|
</FormSection>
|
||||||
<FormGroup>
|
<FormSection>
|
||||||
<template #label><Mfm text="[jelly ❤]"/> {{ $ts._aboutMisskey.patrons }}</template>
|
<template #label><Mfm text="$[jelly ❤]"/> {{ $ts._aboutMisskey.patrons }}</template>
|
||||||
<FormKeyValueView v-for="patron in patrons" :key="patron"><template #key>{{ patron }}</template></FormKeyValueView>
|
<div v-for="patron in patrons" :key="patron">{{ patron }}</div>
|
||||||
<template #caption>{{ $ts._aboutMisskey.morePatrons }}</template>
|
<template #caption>{{ $ts._aboutMisskey.morePatrons }}</template>
|
||||||
</FormGroup>
|
</FormSection>
|
||||||
</FormBase>
|
</div>
|
||||||
|
</MkSpacer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { version } from '@/config';
|
import { version } from '@/config';
|
||||||
import FormLink from '@/components/debobigego/link.vue';
|
import FormLink from '@/components/form/link.vue';
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import FormGroup from '@/components/debobigego/group.vue';
|
import MkKeyValue from '@/components/key-value.vue';
|
||||||
import FormKeyValueView from '@/components/debobigego/key-value-view.vue';
|
|
||||||
import MkLink from '@/components/link.vue';
|
import MkLink from '@/components/link.vue';
|
||||||
import { physics } from '@/scripts/physics';
|
import { physics } from '@/scripts/physics';
|
||||||
import * as symbols from '@/symbols';
|
import * as symbols from '@/symbols';
|
||||||
|
@ -122,10 +125,9 @@ const patrons = [
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
FormBase,
|
FormSection,
|
||||||
FormGroup,
|
|
||||||
FormLink,
|
FormLink,
|
||||||
FormKeyValueView,
|
MkKeyValue,
|
||||||
MkLink,
|
MkLink,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -178,15 +180,11 @@ export default defineComponent({
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.znqjceqz {
|
.znqjceqz {
|
||||||
max-width: 800px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin: 0 auto;
|
|
||||||
|
|
||||||
> .about {
|
> .about {
|
||||||
> .panel {
|
|
||||||
position: relative;
|
position: relative;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
|
border-radius: var(--radius);
|
||||||
|
|
||||||
&.playing {
|
&.playing {
|
||||||
&, * {
|
&, * {
|
||||||
|
@ -233,6 +231,5 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,70 +1,80 @@
|
||||||
<template>
|
<template>
|
||||||
<FormBase>
|
<MkSpacer :content-max="600" :margin-min="20">
|
||||||
<div class="_debobigegoItem">
|
<div class="_formRoot">
|
||||||
<div class="_debobigegoPanel fwhjspax">
|
<div class="_formBlock fwhjspax" :style="{ backgroundImage: `url(${ $instance.bannerUrl })` }">
|
||||||
|
<div class="content">
|
||||||
<img :src="$instance.iconUrl || $instance.faviconUrl || '/favicon.ico'" alt="" class="icon"/>
|
<img :src="$instance.iconUrl || $instance.faviconUrl || '/favicon.ico'" alt="" class="icon"/>
|
||||||
<span class="name">{{ $instance.name || host }}</span>
|
<div class="name">
|
||||||
|
<b>{{ $instance.name || host }}</b>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<FormTextarea readonly :value="$instance.description">
|
<MkKeyValue class="_formBlock">
|
||||||
</FormTextarea>
|
<template #key>{{ $ts.description }}</template>
|
||||||
|
<template #value>{{ $instance.description }}</template>
|
||||||
|
</MkKeyValue>
|
||||||
|
|
||||||
<FormGroup>
|
<FormSection>
|
||||||
<FormKeyValueView>
|
<MkKeyValue class="_formBlock" :copy="version">
|
||||||
<template #key>Misskey</template>
|
<template #key>Misskey</template>
|
||||||
<template #value>v{{ version }}</template>
|
<template #value>{{ version }}</template>
|
||||||
</FormKeyValueView>
|
</MkKeyValue>
|
||||||
<FormLink to="/about-misskey">{{ $ts.aboutMisskey }}</FormLink>
|
<FormLink to="/about-misskey">{{ $ts.aboutMisskey }}</FormLink>
|
||||||
</FormGroup>
|
</FormSection>
|
||||||
|
|
||||||
<FormGroup>
|
<FormSection>
|
||||||
<FormKeyValueView>
|
<div class="_inputSplit">
|
||||||
|
<MkKeyValue class="_formBlock">
|
||||||
<template #key>{{ $ts.administrator }}</template>
|
<template #key>{{ $ts.administrator }}</template>
|
||||||
<template #value>{{ $instance.maintainerName }}</template>
|
<template #value>{{ $instance.maintainerName }}</template>
|
||||||
</FormKeyValueView>
|
</MkKeyValue>
|
||||||
<FormKeyValueView>
|
<MkKeyValue class="_formBlock">
|
||||||
<template #key>{{ $ts.contact }}</template>
|
<template #key>{{ $ts.contact }}</template>
|
||||||
<template #value>{{ $instance.maintainerEmail }}</template>
|
<template #value>{{ $instance.maintainerEmail }}</template>
|
||||||
</FormKeyValueView>
|
</MkKeyValue>
|
||||||
</FormGroup>
|
</div>
|
||||||
|
</FormSection>
|
||||||
|
|
||||||
<FormLink v-if="$instance.tosUrl" :to="$instance.tosUrl" external>{{ $ts.tos }}</FormLink>
|
<FormLink v-if="$instance.tosUrl" :to="$instance.tosUrl" external>{{ $ts.tos }}</FormLink>
|
||||||
|
|
||||||
<FormSuspense :p="initStats">
|
<FormSuspense :p="initStats">
|
||||||
<FormGroup>
|
<FormSection>
|
||||||
<template #label>{{ $ts.statistics }}</template>
|
<template #label>{{ $ts.statistics }}</template>
|
||||||
<FormKeyValueView>
|
<div class="_inputSplit">
|
||||||
|
<MkKeyValue class="_formBlock">
|
||||||
<template #key>{{ $ts.users }}</template>
|
<template #key>{{ $ts.users }}</template>
|
||||||
<template #value>{{ number(stats.originalUsersCount) }}</template>
|
<template #value>{{ number(stats.originalUsersCount) }}</template>
|
||||||
</FormKeyValueView>
|
</MkKeyValue>
|
||||||
<FormKeyValueView>
|
<MkKeyValue class="_formBlock">
|
||||||
<template #key>{{ $ts.notes }}</template>
|
<template #key>{{ $ts.notes }}</template>
|
||||||
<template #value>{{ number(stats.originalNotesCount) }}</template>
|
<template #value>{{ number(stats.originalNotesCount) }}</template>
|
||||||
</FormKeyValueView>
|
</MkKeyValue>
|
||||||
</FormGroup>
|
</div>
|
||||||
|
</FormSection>
|
||||||
</FormSuspense>
|
</FormSuspense>
|
||||||
|
|
||||||
<FormGroup>
|
<FormSection>
|
||||||
<template #label>Well-known resources</template>
|
<template #label>Well-known resources</template>
|
||||||
|
<div class="_formLinks">
|
||||||
<FormLink :to="`/.well-known/host-meta`" external>host-meta</FormLink>
|
<FormLink :to="`/.well-known/host-meta`" external>host-meta</FormLink>
|
||||||
<FormLink :to="`/.well-known/host-meta.json`" external>host-meta.json</FormLink>
|
<FormLink :to="`/.well-known/host-meta.json`" external>host-meta.json</FormLink>
|
||||||
<FormLink :to="`/.well-known/nodeinfo`" external>nodeinfo</FormLink>
|
<FormLink :to="`/.well-known/nodeinfo`" external>nodeinfo</FormLink>
|
||||||
<FormLink :to="`/robots.txt`" external>robots.txt</FormLink>
|
<FormLink :to="`/robots.txt`" external>robots.txt</FormLink>
|
||||||
<FormLink :to="`/manifest.json`" external>manifest.json</FormLink>
|
<FormLink :to="`/manifest.json`" external>manifest.json</FormLink>
|
||||||
</FormGroup>
|
</div>
|
||||||
</FormBase>
|
</FormSection>
|
||||||
|
</div>
|
||||||
|
</MkSpacer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { version, instanceName } from '@/config';
|
import { version, instanceName } from '@/config';
|
||||||
import FormLink from '@/components/debobigego/link.vue';
|
import FormLink from '@/components/form/link.vue';
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import FormGroup from '@/components/debobigego/group.vue';
|
import FormSuspense from '@/components/form/suspense.vue';
|
||||||
import FormKeyValueView from '@/components/debobigego/key-value-view.vue';
|
import MkKeyValue from '@/components/key-value.vue';
|
||||||
import FormTextarea from '@/components/debobigego/textarea.vue';
|
|
||||||
import FormSuspense from '@/components/debobigego/suspense.vue';
|
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import number from '@/filters/number';
|
import number from '@/filters/number';
|
||||||
import * as symbols from '@/symbols';
|
import * as symbols from '@/symbols';
|
||||||
|
@ -72,11 +82,9 @@ import { host } from '@/config';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
FormBase,
|
MkKeyValue,
|
||||||
FormGroup,
|
FormSection,
|
||||||
FormLink,
|
FormLink,
|
||||||
FormKeyValueView,
|
|
||||||
FormTextarea,
|
|
||||||
FormSuspense,
|
FormSuspense,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -105,19 +113,29 @@ export default defineComponent({
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.fwhjspax {
|
.fwhjspax {
|
||||||
padding: 16px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
border-radius: 10px;
|
||||||
|
overflow: clip;
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center center;
|
||||||
|
|
||||||
|
> .content {
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
> .icon {
|
> .icon {
|
||||||
display: block;
|
display: block;
|
||||||
margin: auto;
|
margin: 16px auto 0 auto;
|
||||||
height: 64px;
|
height: 64px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .name {
|
> .name {
|
||||||
display: block;
|
display: block;
|
||||||
margin-top: 12px;
|
padding: 16px;
|
||||||
|
color: #fff;
|
||||||
|
text-shadow: 0 0 8px #000;
|
||||||
|
background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="taeiyria">
|
<MkSpacer :content-max="1000">
|
||||||
|
<div class="taeiyria">
|
||||||
<div class="query">
|
<div class="query">
|
||||||
<MkInput v-model="host" :debounce="true" class="">
|
<MkInput v-model="host" :debounce="true" class="">
|
||||||
<template #prefix><i class="fas fa-search"></i></template>
|
<template #prefix><i class="fas fa-search"></i></template>
|
||||||
<template #label>{{ $ts.host }}</template>
|
<template #label>{{ $ts.host }}</template>
|
||||||
</MkInput>
|
</MkInput>
|
||||||
<div class="_inputSplit">
|
<div class="_inputSplit" style="margin-top: var(--margin);">
|
||||||
<MkSelect v-model="state">
|
<MkSelect v-model="state">
|
||||||
<template #label>{{ $ts.state }}</template>
|
<template #label>{{ $ts.state }}</template>
|
||||||
<option value="all">{{ $ts.all }}</option>
|
<option value="all">{{ $ts.all }}</option>
|
||||||
|
@ -90,7 +91,8 @@
|
||||||
</MkA>
|
</MkA>
|
||||||
</div>
|
</div>
|
||||||
</MkPagination>
|
</MkPagination>
|
||||||
</div>
|
</div>
|
||||||
|
</MkSpacer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
@ -169,7 +171,7 @@ export default defineComponent({
|
||||||
.taeiyria {
|
.taeiyria {
|
||||||
> .query {
|
> .query {
|
||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
padding: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +179,6 @@ export default defineComponent({
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
|
||||||
grid-gap: 12px;
|
grid-gap: 12px;
|
||||||
padding: 16px;
|
|
||||||
|
|
||||||
> .instance {
|
> .instance {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
|
|
|
@ -281,6 +281,16 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="section _block">
|
||||||
|
<div class="title">{{ $ts._mfm.rotate }}</div>
|
||||||
|
<div class="content">
|
||||||
|
<p>{{ $ts._mfm.rotateDescription }}</p>
|
||||||
|
<div class="preview">
|
||||||
|
<Mfm :text="preview_rotate"/>
|
||||||
|
<MkTextarea v-model="preview_rotate"><span>MFM</span></MkTextarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -328,6 +338,7 @@ export default defineComponent({
|
||||||
preview_blur: `$[blur ${this.$ts._mfm.dummy}]`,
|
preview_blur: `$[blur ${this.$ts._mfm.dummy}]`,
|
||||||
preview_rainbow: `$[rainbow 🍮]`,
|
preview_rainbow: `$[rainbow 🍮]`,
|
||||||
preview_sparkle: `$[sparkle 🍮]`,
|
preview_sparkle: `$[sparkle 🍮]`,
|
||||||
|
preview_rotate: `$[rotate 🍮]`,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<section class="_card">
|
<div>
|
||||||
<div class="_title"><i class="fas fa-lock"></i> {{ $ts.twoStepAuthentication }}</div>
|
|
||||||
<div class="_content">
|
|
||||||
<MkButton v-if="!data && !$i.twoFactorEnabled" @click="register">{{ $ts._2fa.registerDevice }}</MkButton>
|
<MkButton v-if="!data && !$i.twoFactorEnabled" @click="register">{{ $ts._2fa.registerDevice }}</MkButton>
|
||||||
<template v-if="$i.twoFactorEnabled">
|
<template v-if="$i.twoFactorEnabled">
|
||||||
<p>{{ $ts._2fa.alreadyRegistered }}</p>
|
<p>{{ $ts._2fa.alreadyRegistered }}</p>
|
||||||
|
@ -62,8 +60,7 @@
|
||||||
</ol>
|
</ol>
|
||||||
<MkInfo>{{ $ts._2fa.step4 }}</MkInfo>
|
<MkInfo>{{ $ts._2fa.step4 }}</MkInfo>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
@ -82,18 +79,11 @@ import * as symbols from '@/symbols';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
FormBase,
|
|
||||||
MkButton, MkInfo, MkInput, MkSwitch
|
MkButton, MkInfo, MkInput, MkSwitch
|
||||||
},
|
},
|
||||||
|
|
||||||
emits: ['info'],
|
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
[symbols.PAGE_INFO]: {
|
|
||||||
title: this.$ts.twoStepAuthentication,
|
|
||||||
icon: 'fas fa-lock'
|
|
||||||
},
|
|
||||||
data: null,
|
data: null,
|
||||||
supportsCredentials: !!navigator.credentials,
|
supportsCredentials: !!navigator.credentials,
|
||||||
usePasswordLessLogin: this.$i.usePasswordLessLogin,
|
usePasswordLessLogin: this.$i.usePasswordLessLogin,
|
||||||
|
|
|
@ -1,44 +1,43 @@
|
||||||
<template>
|
<template>
|
||||||
<FormBase class="">
|
<div class="_formRoot">
|
||||||
<FormGroup v-if="!fetching">
|
<FormSection v-if="!fetching">
|
||||||
<template #label>{{ $ts.usageAmount }}</template>
|
<template #label>{{ $ts.usageAmount }}</template>
|
||||||
<div class="_debobigegoItem uawsfosz">
|
<div class="_formBlock uawsfosz">
|
||||||
<div class="_debobigegoPanel">
|
|
||||||
<div class="meter"><div :style="meterStyle"></div></div>
|
<div class="meter"><div :style="meterStyle"></div></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="_inputSplit _formBlock">
|
||||||
<FormKeyValueView>
|
<MkKeyValue class="_formBlock">
|
||||||
<template #key>{{ $ts.capacity }}</template>
|
<template #key>{{ $ts.capacity }}</template>
|
||||||
<template #value>{{ bytes(capacity, 1) }}</template>
|
<template #value>{{ bytes(capacity, 1) }}</template>
|
||||||
</FormKeyValueView>
|
</MkKeyValue>
|
||||||
<FormKeyValueView>
|
<MkKeyValue class="_formBlock">
|
||||||
<template #key>{{ $ts.inUse }}</template>
|
<template #key>{{ $ts.inUse }}</template>
|
||||||
<template #value>{{ bytes(usage, 1) }}</template>
|
<template #value>{{ bytes(usage, 1) }}</template>
|
||||||
</FormKeyValueView>
|
</MkKeyValue>
|
||||||
</FormGroup>
|
</div>
|
||||||
|
</FormSection>
|
||||||
|
|
||||||
<div class="_debobigegoItem">
|
<FormSection>
|
||||||
<div class="_debobigegoLabel">{{ $ts.statistics }}</div>
|
<template #label>{{ $ts.statistics }}</template>
|
||||||
<div class="_debobigegoPanel">
|
|
||||||
<div ref="chart"></div>
|
<div ref="chart"></div>
|
||||||
</div>
|
</FormSection>
|
||||||
</div>
|
|
||||||
|
|
||||||
<FormButton :center="false" primary @click="chooseUploadFolder()">
|
<FormSection>
|
||||||
|
<FormLink @click="chooseUploadFolder()">
|
||||||
{{ $ts.uploadFolder }}
|
{{ $ts.uploadFolder }}
|
||||||
<template #suffix>{{ uploadFolder ? uploadFolder.name : '-' }}</template>
|
<template #suffix>{{ uploadFolder ? uploadFolder.name : '-' }}</template>
|
||||||
<template #suffixIcon><i class="fas fa-folder-open"></i></template>
|
<template #suffixIcon><i class="fas fa-folder-open"></i></template>
|
||||||
</FormButton>
|
</FormLink>
|
||||||
</FormBase>
|
</FormSection>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import * as tinycolor from 'tinycolor2';
|
import * as tinycolor from 'tinycolor2';
|
||||||
import FormButton from '@/components/debobigego/button.vue';
|
import FormLink from '@/components/form/link.vue';
|
||||||
import FormGroup from '@/components/debobigego/group.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import FormKeyValueView from '@/components/debobigego/key-value-view.vue';
|
import MkKeyValue from '@/components/key-value.vue';
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import bytes from '@/filters/bytes';
|
import bytes from '@/filters/bytes';
|
||||||
import * as symbols from '@/symbols';
|
import * as symbols from '@/symbols';
|
||||||
|
@ -47,10 +46,9 @@ import * as symbols from '@/symbols';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
FormBase,
|
FormLink,
|
||||||
FormButton,
|
FormSection,
|
||||||
FormGroup,
|
MkKeyValue,
|
||||||
FormKeyValueView,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
emits: ['info'],
|
emits: ['info'],
|
||||||
|
@ -128,8 +126,6 @@ export default defineComponent({
|
||||||
@use "sass:math";
|
@use "sass:math";
|
||||||
|
|
||||||
.uawsfosz {
|
.uawsfosz {
|
||||||
> div {
|
|
||||||
padding: 24px;
|
|
||||||
|
|
||||||
> .meter {
|
> .meter {
|
||||||
$size: 12px;
|
$size: 12px;
|
||||||
|
@ -142,6 +138,5 @@ export default defineComponent({
|
||||||
border-radius: math.div($size, 2);
|
border-radius: math.div($size, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,68 +0,0 @@
|
||||||
<template>
|
|
||||||
<FormBase>
|
|
||||||
<FormGroup>
|
|
||||||
<FormInput v-model="emailAddress" type="email">
|
|
||||||
{{ $ts.emailAddress }}
|
|
||||||
<template v-if="$i.email && !$i.emailVerified" #desc>{{ $ts.verificationEmailSent }}</template>
|
|
||||||
<template v-else-if="emailAddress === $i.email && $i.emailVerified" #desc>{{ $ts.emailVerified }}</template>
|
|
||||||
</FormInput>
|
|
||||||
</FormGroup>
|
|
||||||
<FormButton primary @click="save">{{ $ts.save }}</FormButton>
|
|
||||||
</FormBase>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import { defineComponent } from 'vue';
|
|
||||||
import FormButton from '@/components/debobigego/button.vue';
|
|
||||||
import FormInput from '@/components/form/input.vue';
|
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
|
||||||
import FormGroup from '@/components/debobigego/group.vue';
|
|
||||||
import * as os from '@/os';
|
|
||||||
import * as symbols from '@/symbols';
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
components: {
|
|
||||||
FormBase,
|
|
||||||
FormInput,
|
|
||||||
FormButton,
|
|
||||||
FormGroup,
|
|
||||||
},
|
|
||||||
|
|
||||||
emits: ['info'],
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
[symbols.PAGE_INFO]: {
|
|
||||||
title: this.$ts.emailAddress,
|
|
||||||
icon: 'fas fa-envelope',
|
|
||||||
bg: 'var(--bg)',
|
|
||||||
},
|
|
||||||
emailAddress: null,
|
|
||||||
code: null,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
created() {
|
|
||||||
this.emailAddress = this.$i.email;
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.$emit('info', this[symbols.PAGE_INFO]);
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
save() {
|
|
||||||
os.inputText({
|
|
||||||
title: this.$ts.password,
|
|
||||||
type: 'password'
|
|
||||||
}).then(({ canceled, result: password }) => {
|
|
||||||
if (canceled) return;
|
|
||||||
os.apiWithDialog('i/update-email', {
|
|
||||||
password: password,
|
|
||||||
email: this.emailAddress,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
|
@ -1,91 +0,0 @@
|
||||||
<template>
|
|
||||||
<FormBase>
|
|
||||||
<FormGroup>
|
|
||||||
<FormSwitch v-model="mention">
|
|
||||||
{{ $ts._notification._types.mention }}
|
|
||||||
</FormSwitch>
|
|
||||||
<FormSwitch v-model="reply">
|
|
||||||
{{ $ts._notification._types.reply }}
|
|
||||||
</FormSwitch>
|
|
||||||
<FormSwitch v-model="quote">
|
|
||||||
{{ $ts._notification._types.quote }}
|
|
||||||
</FormSwitch>
|
|
||||||
<FormSwitch v-model="follow">
|
|
||||||
{{ $ts._notification._types.follow }}
|
|
||||||
</FormSwitch>
|
|
||||||
<FormSwitch v-model="receiveFollowRequest">
|
|
||||||
{{ $ts._notification._types.receiveFollowRequest }}
|
|
||||||
</FormSwitch>
|
|
||||||
<FormSwitch v-model="groupInvited">
|
|
||||||
{{ $ts._notification._types.groupInvited }}
|
|
||||||
</FormSwitch>
|
|
||||||
</FormGroup>
|
|
||||||
</FormBase>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import { defineComponent } from 'vue';
|
|
||||||
import FormButton from '@/components/debobigego/button.vue';
|
|
||||||
import FormSwitch from '@/components/form/switch.vue';
|
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
|
||||||
import FormGroup from '@/components/debobigego/group.vue';
|
|
||||||
import * as os from '@/os';
|
|
||||||
import * as symbols from '@/symbols';
|
|
||||||
import * as symbols from '@/symbols';
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
components: {
|
|
||||||
FormBase,
|
|
||||||
FormSwitch,
|
|
||||||
FormButton,
|
|
||||||
FormGroup,
|
|
||||||
},
|
|
||||||
|
|
||||||
emits: ['info'],
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
[symbols.PAGE_INFO]: {
|
|
||||||
title: this.$ts.emailNotification,
|
|
||||||
icon: 'fas fa-envelope',
|
|
||||||
bg: 'var(--bg)',
|
|
||||||
},
|
|
||||||
|
|
||||||
mention: this.$i.emailNotificationTypes.includes('mention'),
|
|
||||||
reply: this.$i.emailNotificationTypes.includes('reply'),
|
|
||||||
quote: this.$i.emailNotificationTypes.includes('quote'),
|
|
||||||
follow: this.$i.emailNotificationTypes.includes('follow'),
|
|
||||||
receiveFollowRequest: this.$i.emailNotificationTypes.includes('receiveFollowRequest'),
|
|
||||||
groupInvited: this.$i.emailNotificationTypes.includes('groupInvited'),
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
created() {
|
|
||||||
this.$watch('mention', this.save);
|
|
||||||
this.$watch('reply', this.save);
|
|
||||||
this.$watch('quote', this.save);
|
|
||||||
this.$watch('follow', this.save);
|
|
||||||
this.$watch('receiveFollowRequest', this.save);
|
|
||||||
this.$watch('groupInvited', this.save);
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.$emit('info', this[symbols.PAGE_INFO]);
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
save() {
|
|
||||||
os.api('i/update', {
|
|
||||||
emailNotificationTypes: [
|
|
||||||
...[this.mention ? 'mention' : null],
|
|
||||||
...[this.reply ? 'reply' : null],
|
|
||||||
...[this.quote ? 'quote' : null],
|
|
||||||
...[this.follow ? 'follow' : null],
|
|
||||||
...[this.receiveFollowRequest ? 'receiveFollowRequest' : null],
|
|
||||||
...[this.groupInvited ? 'groupInvited' : null],
|
|
||||||
].filter(x => x != null)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
|
@ -1,66 +1,133 @@
|
||||||
<template>
|
<template>
|
||||||
<FormBase>
|
<div class="_formRoot">
|
||||||
<FormGroup>
|
<FormSection>
|
||||||
<template #label>{{ $ts.emailAddress }}</template>
|
<template #label>{{ $ts.emailAddress }}</template>
|
||||||
<FormLink to="/settings/email/address">
|
<FormInput v-model="emailAddress" type="email" manual-save>
|
||||||
<template v-if="$i.email && !$i.emailVerified" #icon><i class="fas fa-exclamation-triangle" style="color: var(--warn);"></i></template>
|
<template #prefix><i class="fas fa-envelope"></i></template>
|
||||||
<template v-else-if="$i.email && $i.emailVerified" #icon><i class="fas fa-check" style="color: var(--success);"></i></template>
|
<template v-if="$i.email && !$i.emailVerified" #caption>{{ $ts.verificationEmailSent }}</template>
|
||||||
{{ $i.email || $ts.notSet }}
|
<template v-else-if="emailAddress === $i.email && $i.emailVerified" #caption><i class="fas fa-check" style="color: var(--success);"></i> {{ $ts.emailVerified }}</template>
|
||||||
</FormLink>
|
</FormInput>
|
||||||
</FormGroup>
|
</FormSection>
|
||||||
|
|
||||||
<FormLink to="/settings/email/notification">
|
|
||||||
<template #icon><i class="fas fa-bell"></i></template>
|
|
||||||
{{ $ts.emailNotification }}
|
|
||||||
</FormLink>
|
|
||||||
|
|
||||||
|
<FormSection>
|
||||||
<FormSwitch :value="$i.receiveAnnouncementEmail" @update:modelValue="onChangeReceiveAnnouncementEmail">
|
<FormSwitch :value="$i.receiveAnnouncementEmail" @update:modelValue="onChangeReceiveAnnouncementEmail">
|
||||||
{{ $ts.receiveAnnouncementFromInstance }}
|
{{ $ts.receiveAnnouncementFromInstance }}
|
||||||
</FormSwitch>
|
</FormSwitch>
|
||||||
</FormBase>
|
</FormSection>
|
||||||
|
|
||||||
|
<FormSection>
|
||||||
|
<template #label>{{ $ts.emailNotification }}</template>
|
||||||
|
<FormSwitch v-model="emailNotification_mention" class="_formBlock">
|
||||||
|
{{ $ts._notification._types.mention }}
|
||||||
|
</FormSwitch>
|
||||||
|
<FormSwitch v-model="emailNotification_reply" class="_formBlock">
|
||||||
|
{{ $ts._notification._types.reply }}
|
||||||
|
</FormSwitch>
|
||||||
|
<FormSwitch v-model="emailNotification_quote" class="_formBlock">
|
||||||
|
{{ $ts._notification._types.quote }}
|
||||||
|
</FormSwitch>
|
||||||
|
<FormSwitch v-model="emailNotification_follow" class="_formBlock">
|
||||||
|
{{ $ts._notification._types.follow }}
|
||||||
|
</FormSwitch>
|
||||||
|
<FormSwitch v-model="emailNotification_receiveFollowRequest" class="_formBlock">
|
||||||
|
{{ $ts._notification._types.receiveFollowRequest }}
|
||||||
|
</FormSwitch>
|
||||||
|
<FormSwitch v-model="emailNotification_groupInvited" class="_formBlock">
|
||||||
|
{{ $ts._notification._types.groupInvited }}
|
||||||
|
</FormSwitch>
|
||||||
|
</FormSection>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent, onMounted, ref, watch } from 'vue';
|
||||||
import FormButton from '@/components/debobigego/button.vue';
|
import FormButton from '@/components/debobigego/button.vue';
|
||||||
import FormLink from '@/components/debobigego/link.vue';
|
import FormLink from '@/components/debobigego/link.vue';
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import FormGroup from '@/components/debobigego/group.vue';
|
import FormInput from '@/components/form/input.vue';
|
||||||
import FormSwitch from '@/components/debobigego/switch.vue';
|
import FormSwitch from '@/components/form/switch.vue';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import * as symbols from '@/symbols';
|
import * as symbols from '@/symbols';
|
||||||
|
import { $i } from '@/account';
|
||||||
|
import { i18n } from '@/i18n';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
FormBase,
|
FormSection,
|
||||||
FormLink,
|
FormLink,
|
||||||
FormButton,
|
FormButton,
|
||||||
FormSwitch,
|
FormSwitch,
|
||||||
FormGroup,
|
FormInput,
|
||||||
},
|
},
|
||||||
|
|
||||||
emits: ['info'],
|
emits: ['info'],
|
||||||
|
|
||||||
data() {
|
setup(props, context) {
|
||||||
return {
|
const emailAddress = ref($i.email);
|
||||||
[symbols.PAGE_INFO]: {
|
|
||||||
title: this.$ts.email,
|
const INFO = {
|
||||||
|
title: i18n.locale.email,
|
||||||
icon: 'fas fa-envelope',
|
icon: 'fas fa-envelope',
|
||||||
bg: 'var(--bg)',
|
bg: 'var(--bg)',
|
||||||
},
|
};
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
const onChangeReceiveAnnouncementEmail = (v) => {
|
||||||
this.$emit('info', this[symbols.PAGE_INFO]);
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
onChangeReceiveAnnouncementEmail(v) {
|
|
||||||
os.api('i/update', {
|
os.api('i/update', {
|
||||||
receiveAnnouncementEmail: v
|
receiveAnnouncementEmail: v
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const saveEmailAddress = () => {
|
||||||
|
os.inputText({
|
||||||
|
title: i18n.locale.password,
|
||||||
|
type: 'password'
|
||||||
|
}).then(({ canceled, result: password }) => {
|
||||||
|
if (canceled) return;
|
||||||
|
os.apiWithDialog('i/update-email', {
|
||||||
|
password: password,
|
||||||
|
email: emailAddress.value,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const emailNotification_mention = ref($i.emailNotificationTypes.includes('mention'));
|
||||||
|
const emailNotification_reply = ref($i.emailNotificationTypes.includes('reply'));
|
||||||
|
const emailNotification_quote = ref($i.emailNotificationTypes.includes('quote'));
|
||||||
|
const emailNotification_follow = ref($i.emailNotificationTypes.includes('follow'));
|
||||||
|
const emailNotification_receiveFollowRequest = ref($i.emailNotificationTypes.includes('receiveFollowRequest'));
|
||||||
|
const emailNotification_groupInvited = ref($i.emailNotificationTypes.includes('groupInvited'));
|
||||||
|
|
||||||
|
const saveNotificationSettings = () => {
|
||||||
|
os.api('i/update', {
|
||||||
|
emailNotificationTypes: [
|
||||||
|
...[emailNotification_mention.value ? 'mention' : null],
|
||||||
|
...[emailNotification_reply.value ? 'reply' : null],
|
||||||
|
...[emailNotification_quote.value ? 'quote' : null],
|
||||||
|
...[emailNotification_follow.value ? 'follow' : null],
|
||||||
|
...[emailNotification_receiveFollowRequest.value ? 'receiveFollowRequest' : null],
|
||||||
|
...[emailNotification_groupInvited.value ? 'groupInvited' : null],
|
||||||
|
].filter(x => x != null)
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch([emailNotification_mention, emailNotification_reply, emailNotification_quote, emailNotification_follow, emailNotification_receiveFollowRequest, emailNotification_groupInvited], () => {
|
||||||
|
saveNotificationSettings();
|
||||||
|
});
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
context.emit('info', INFO);
|
||||||
|
|
||||||
|
watch(emailAddress, () => {
|
||||||
|
saveEmailAddress();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
[symbols.PAGE_INFO]: INFO,
|
||||||
|
emailAddress,
|
||||||
|
onChangeReceiveAnnouncementEmail,
|
||||||
|
emailNotification_mention, emailNotification_reply, emailNotification_quote, emailNotification_follow, emailNotification_receiveFollowRequest, emailNotification_groupInvited,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<FormBase>
|
<div class="_formRoot">
|
||||||
<FormSwitch v-model="showFixedPostForm">{{ $ts.showFixedPostForm }}</FormSwitch>
|
<FormSelect v-model="lang" class="_formBlock">
|
||||||
|
|
||||||
<FormSelect v-model="lang">
|
|
||||||
<template #label>{{ $ts.uiLanguage }}</template>
|
<template #label>{{ $ts.uiLanguage }}</template>
|
||||||
<option v-for="x in langs" :key="x[0]" :value="x[0]">{{ x[1] }}</option>
|
<option v-for="x in langs" :key="x[0]" :value="x[0]">{{ x[1] }}</option>
|
||||||
<template #caption>
|
<template #caption>
|
||||||
|
@ -14,57 +12,59 @@
|
||||||
</template>
|
</template>
|
||||||
</FormSelect>
|
</FormSelect>
|
||||||
|
|
||||||
<FormGroup>
|
<FormSwitch v-model="showFixedPostForm" class="_formBlock">{{ $ts.showFixedPostForm }}</FormSwitch>
|
||||||
<template #label>{{ $ts.behavior }}</template>
|
|
||||||
<FormSwitch v-model="imageNewTab">{{ $ts.openImageInNewTab }}</FormSwitch>
|
|
||||||
<FormSwitch v-model="enableInfiniteScroll">{{ $ts.enableInfiniteScroll }}</FormSwitch>
|
|
||||||
<FormSwitch v-model="useReactionPickerForContextMenu">{{ $ts.useReactionPickerForContextMenu }}</FormSwitch>
|
|
||||||
<FormSwitch v-model="disablePagesScript">{{ $ts.disablePagesScript }}</FormSwitch>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormSelect v-model="serverDisconnectedBehavior">
|
<FormSection>
|
||||||
|
<template #label>{{ $ts.behavior }}</template>
|
||||||
|
<FormSwitch v-model="imageNewTab" class="_formBlock">{{ $ts.openImageInNewTab }}</FormSwitch>
|
||||||
|
<FormSwitch v-model="enableInfiniteScroll" class="_formBlock">{{ $ts.enableInfiniteScroll }}</FormSwitch>
|
||||||
|
<FormSwitch v-model="useReactionPickerForContextMenu" class="_formBlock">{{ $ts.useReactionPickerForContextMenu }}</FormSwitch>
|
||||||
|
<FormSwitch v-model="disablePagesScript" class="_formBlock">{{ $ts.disablePagesScript }}</FormSwitch>
|
||||||
|
|
||||||
|
<FormSelect v-model="serverDisconnectedBehavior" class="_formBlock">
|
||||||
<template #label>{{ $ts.whenServerDisconnected }}</template>
|
<template #label>{{ $ts.whenServerDisconnected }}</template>
|
||||||
<option value="reload">{{ $ts._serverDisconnectedBehavior.reload }}</option>
|
<option value="reload">{{ $ts._serverDisconnectedBehavior.reload }}</option>
|
||||||
<option value="dialog">{{ $ts._serverDisconnectedBehavior.dialog }}</option>
|
<option value="dialog">{{ $ts._serverDisconnectedBehavior.dialog }}</option>
|
||||||
<option value="quiet">{{ $ts._serverDisconnectedBehavior.quiet }}</option>
|
<option value="quiet">{{ $ts._serverDisconnectedBehavior.quiet }}</option>
|
||||||
</FormSelect>
|
</FormSelect>
|
||||||
|
</FormSection>
|
||||||
|
|
||||||
<FormGroup>
|
<FormSection>
|
||||||
<template #label>{{ $ts.appearance }}</template>
|
<template #label>{{ $ts.appearance }}</template>
|
||||||
<FormSwitch v-model="disableAnimatedMfm">{{ $ts.disableAnimatedMfm }}</FormSwitch>
|
<FormSwitch v-model="disableAnimatedMfm" class="_formBlock">{{ $ts.disableAnimatedMfm }}</FormSwitch>
|
||||||
<FormSwitch v-model="reduceAnimation">{{ $ts.reduceUiAnimation }}</FormSwitch>
|
<FormSwitch v-model="reduceAnimation" class="_formBlock">{{ $ts.reduceUiAnimation }}</FormSwitch>
|
||||||
<FormSwitch v-model="useBlurEffect">{{ $ts.useBlurEffect }}</FormSwitch>
|
<FormSwitch v-model="useBlurEffect" class="_formBlock">{{ $ts.useBlurEffect }}</FormSwitch>
|
||||||
<FormSwitch v-model="useBlurEffectForModal">{{ $ts.useBlurEffectForModal }}</FormSwitch>
|
<FormSwitch v-model="useBlurEffectForModal" class="_formBlock">{{ $ts.useBlurEffectForModal }}</FormSwitch>
|
||||||
<FormSwitch v-model="showGapBetweenNotesInTimeline">{{ $ts.showGapBetweenNotesInTimeline }}</FormSwitch>
|
<FormSwitch v-model="showGapBetweenNotesInTimeline" class="_formBlock">{{ $ts.showGapBetweenNotesInTimeline }}</FormSwitch>
|
||||||
<FormSwitch v-model="loadRawImages">{{ $ts.loadRawImages }}</FormSwitch>
|
<FormSwitch v-model="loadRawImages" class="_formBlock">{{ $ts.loadRawImages }}</FormSwitch>
|
||||||
<FormSwitch v-model="disableShowingAnimatedImages">{{ $ts.disableShowingAnimatedImages }}</FormSwitch>
|
<FormSwitch v-model="disableShowingAnimatedImages" class="_formBlock">{{ $ts.disableShowingAnimatedImages }}</FormSwitch>
|
||||||
<FormSwitch v-model="squareAvatars">{{ $ts.squareAvatars }}</FormSwitch>
|
<FormSwitch v-model="squareAvatars" class="_formBlock">{{ $ts.squareAvatars }}</FormSwitch>
|
||||||
<FormSwitch v-model="useSystemFont">{{ $ts.useSystemFont }}</FormSwitch>
|
<FormSwitch v-model="useSystemFont" class="_formBlock">{{ $ts.useSystemFont }}</FormSwitch>
|
||||||
<FormSwitch v-model="useOsNativeEmojis">{{ $ts.useOsNativeEmojis }}
|
<FormSwitch v-model="useOsNativeEmojis" class="_formBlock">{{ $ts.useOsNativeEmojis }}
|
||||||
<div><Mfm :key="useOsNativeEmojis" text="🍮🍦🍭🍩🍰🍫🍬🥞🍪"/></div>
|
<div><Mfm :key="useOsNativeEmojis" text="🍮🍦🍭🍩🍰🍫🍬🥞🍪"/></div>
|
||||||
</FormSwitch>
|
</FormSwitch>
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
<FormRadios v-model="fontSize" class="_formBlock">
|
||||||
<FormSwitch v-model="aiChanMode">{{ $ts.aiChanMode }}</FormSwitch>
|
<template #label>{{ $ts.fontSize }}</template>
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormRadios v-model="fontSize">
|
|
||||||
<template #desc>{{ $ts.fontSize }}</template>
|
|
||||||
<option value="small"><span style="font-size: 14px;">Aa</span></option>
|
<option value="small"><span style="font-size: 14px;">Aa</span></option>
|
||||||
<option :value="null"><span style="font-size: 16px;">Aa</span></option>
|
<option :value="null"><span style="font-size: 16px;">Aa</span></option>
|
||||||
<option value="large"><span style="font-size: 18px;">Aa</span></option>
|
<option value="large"><span style="font-size: 18px;">Aa</span></option>
|
||||||
<option value="veryLarge"><span style="font-size: 20px;">Aa</span></option>
|
<option value="veryLarge"><span style="font-size: 20px;">Aa</span></option>
|
||||||
</FormRadios>
|
</FormRadios>
|
||||||
|
</FormSection>
|
||||||
|
|
||||||
<FormSelect v-model="instanceTicker">
|
<FormSection>
|
||||||
|
<FormSwitch v-model="aiChanMode">{{ $ts.aiChanMode }}</FormSwitch>
|
||||||
|
</FormSection>
|
||||||
|
|
||||||
|
<FormSelect v-model="instanceTicker" class="_formBlock">
|
||||||
<template #label>{{ $ts.instanceTicker }}</template>
|
<template #label>{{ $ts.instanceTicker }}</template>
|
||||||
<option value="none">{{ $ts._instanceTicker.none }}</option>
|
<option value="none">{{ $ts._instanceTicker.none }}</option>
|
||||||
<option value="remote">{{ $ts._instanceTicker.remote }}</option>
|
<option value="remote">{{ $ts._instanceTicker.remote }}</option>
|
||||||
<option value="always">{{ $ts._instanceTicker.always }}</option>
|
<option value="always">{{ $ts._instanceTicker.always }}</option>
|
||||||
</FormSelect>
|
</FormSelect>
|
||||||
|
|
||||||
<FormSelect v-model="nsfw">
|
<FormSelect v-model="nsfw" class="_formBlock">
|
||||||
<template #label>{{ $ts.nsfw }}</template>
|
<template #label>{{ $ts.nsfw }}</template>
|
||||||
<option value="respect">{{ $ts._nsfw.respect }}</option>
|
<option value="respect">{{ $ts._nsfw.respect }}</option>
|
||||||
<option value="ignore">{{ $ts._nsfw.ignore }}</option>
|
<option value="ignore">{{ $ts._nsfw.ignore }}</option>
|
||||||
|
@ -76,28 +76,27 @@
|
||||||
<FormSwitch v-model="defaultSideView">{{ $ts.openInSideView }}</FormSwitch>
|
<FormSwitch v-model="defaultSideView">{{ $ts.openInSideView }}</FormSwitch>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
<FormSelect v-model="chatOpenBehavior">
|
<FormSelect v-model="chatOpenBehavior" class="_formBlock">
|
||||||
<template #label>{{ $ts.chatOpenBehavior }}</template>
|
<template #label>{{ $ts.chatOpenBehavior }}</template>
|
||||||
<option value="page">{{ $ts.showInPage }}</option>
|
<option value="page">{{ $ts.showInPage }}</option>
|
||||||
<option value="window">{{ $ts.openInWindow }}</option>
|
<option value="window">{{ $ts.openInWindow }}</option>
|
||||||
<option value="popout">{{ $ts.popout }}</option>
|
<option value="popout">{{ $ts.popout }}</option>
|
||||||
</FormSelect>
|
</FormSelect>
|
||||||
|
|
||||||
<FormLink to="/settings/deck">{{ $ts.deck }}</FormLink>
|
<FormLink to="/settings/deck" class="_formBlock">{{ $ts.deck }}</FormLink>
|
||||||
|
|
||||||
<FormLink to="/settings/custom-css"><template #icon><i class="fas fa-code"></i></template>{{ $ts.customCss }}</FormLink>
|
<FormLink to="/settings/custom-css" class="_formBlock"><template #icon><i class="fas fa-code"></i></template>{{ $ts.customCss }}</FormLink>
|
||||||
</FormBase>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import FormSwitch from '@/components/debobigego/switch.vue';
|
import FormSwitch from '@/components/form/switch.vue';
|
||||||
import FormSelect from '@/components/debobigego/select.vue';
|
import FormSelect from '@/components/form/select.vue';
|
||||||
import FormRadios from '@/components/debobigego/radios.vue';
|
import FormRadios from '@/components/form/radios.vue';
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
import FormGroup from '@/components/form/group.vue';
|
||||||
import FormGroup from '@/components/debobigego/group.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import FormLink from '@/components/debobigego/link.vue';
|
import FormLink from '@/components/form/link.vue';
|
||||||
import FormButton from '@/components/debobigego/button.vue';
|
|
||||||
import MkLink from '@/components/link.vue';
|
import MkLink from '@/components/link.vue';
|
||||||
import { langs } from '@/config';
|
import { langs } from '@/config';
|
||||||
import { defaultStore } from '@/store';
|
import { defaultStore } from '@/store';
|
||||||
|
@ -112,10 +111,9 @@ export default defineComponent({
|
||||||
FormSwitch,
|
FormSwitch,
|
||||||
FormSelect,
|
FormSelect,
|
||||||
FormRadios,
|
FormRadios,
|
||||||
FormBase,
|
|
||||||
FormGroup,
|
FormGroup,
|
||||||
FormLink,
|
FormLink,
|
||||||
FormButton,
|
FormSection,
|
||||||
},
|
},
|
||||||
|
|
||||||
emits: ['info'],
|
emits: ['info'],
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="margin: 16px;">
|
<div class="_formRoot">
|
||||||
<FormSection>
|
<FormSection>
|
||||||
<template #label>{{ $ts._exportOrImport.allNotes }}</template>
|
<template #label>{{ $ts._exportOrImport.allNotes }}</template>
|
||||||
<MkButton :class="$style.button" inline @click="doExport('notes')"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
|
<MkButton :class="$style.button" inline @click="doExport('notes')"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
|
||||||
|
|
|
@ -10,7 +10,12 @@
|
||||||
</MkSpacer>
|
</MkSpacer>
|
||||||
</div>
|
</div>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<component :is="component" :key="page" v-bind="pageProps"/>
|
<MkSpacer :content-max="600" :margin-min="20">
|
||||||
|
<div class="bkzroven">
|
||||||
|
<div v-if="childInfo" class="title">{{ childInfo.title }}</div>
|
||||||
|
<component :is="component" :key="page" v-bind="pageProps" @info="onInfo"/>
|
||||||
|
</div>
|
||||||
|
</MkSpacer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -52,6 +57,7 @@ export default defineComponent({
|
||||||
const narrow = ref(false);
|
const narrow = ref(false);
|
||||||
const view = ref(null);
|
const view = ref(null);
|
||||||
const el = ref(null);
|
const el = ref(null);
|
||||||
|
const childInfo = ref(null);
|
||||||
const menuDef = computed(() => [{
|
const menuDef = computed(() => [{
|
||||||
title: i18n.locale.basicSettings,
|
title: i18n.locale.basicSettings,
|
||||||
items: [{
|
items: [{
|
||||||
|
@ -192,8 +198,6 @@ export default defineComponent({
|
||||||
case 'other': return defineAsyncComponent(() => import('./other.vue'));
|
case 'other': return defineAsyncComponent(() => import('./other.vue'));
|
||||||
case 'general': return defineAsyncComponent(() => import('./general.vue'));
|
case 'general': return defineAsyncComponent(() => import('./general.vue'));
|
||||||
case 'email': return defineAsyncComponent(() => import('./email.vue'));
|
case 'email': return defineAsyncComponent(() => import('./email.vue'));
|
||||||
case 'email/address': return defineAsyncComponent(() => import('./email-address.vue'));
|
|
||||||
case 'email/notification': return defineAsyncComponent(() => import('./email-notification.vue'));
|
|
||||||
case 'theme': return defineAsyncComponent(() => import('./theme.vue'));
|
case 'theme': return defineAsyncComponent(() => import('./theme.vue'));
|
||||||
case 'theme/install': return defineAsyncComponent(() => import('./theme.install.vue'));
|
case 'theme/install': return defineAsyncComponent(() => import('./theme.install.vue'));
|
||||||
case 'theme/manage': return defineAsyncComponent(() => import('./theme.manage.vue'));
|
case 'theme/manage': return defineAsyncComponent(() => import('./theme.manage.vue'));
|
||||||
|
@ -259,6 +263,10 @@ export default defineComponent({
|
||||||
|
|
||||||
const emailNotConfigured = computed(() => instance.enableEmail && ($i.email == null || !$i.emailVerified));
|
const emailNotConfigured = computed(() => instance.enableEmail && ($i.email == null || !$i.emailVerified));
|
||||||
|
|
||||||
|
const onInfo = (info) => {
|
||||||
|
childInfo.value = info;
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
[symbols.PAGE_INFO]: INFO,
|
[symbols.PAGE_INFO]: INFO,
|
||||||
page,
|
page,
|
||||||
|
@ -269,6 +277,8 @@ export default defineComponent({
|
||||||
pageProps,
|
pageProps,
|
||||||
component,
|
component,
|
||||||
emailNotConfigured,
|
emailNotConfigured,
|
||||||
|
onInfo,
|
||||||
|
childInfo,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -285,7 +295,7 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
> .info {
|
> .info {
|
||||||
margin: 0 16px;
|
margin: 16px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .accounts {
|
> .accounts {
|
||||||
|
@ -299,6 +309,16 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
> .main {
|
||||||
|
.bkzroven {
|
||||||
|
> .title {
|
||||||
|
margin: 4px 0 20px 0;
|
||||||
|
font-size: 1.5em;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&.wide {
|
&.wide {
|
||||||
display: flex;
|
display: flex;
|
||||||
max-width: 1000px;
|
max-width: 1000px;
|
||||||
|
@ -321,6 +341,12 @@ export default defineComponent({
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
|
.bkzroven {
|
||||||
|
> .title {
|
||||||
|
margin: 6px 0 24px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
<template>
|
<template>
|
||||||
<FormBase>
|
<div class="_formRoot">
|
||||||
<FormTextarea v-model="items" tall manual-save>
|
<FormTextarea v-model="items" tall manual-save class="_formBlock">
|
||||||
<span>{{ $ts.menu }}</span>
|
<template #label>{{ $ts.menu }}</template>
|
||||||
<template #desc><button class="_textButton" @click="addItem">{{ $ts.addItem }}</button></template>
|
<template #caption><button class="_textButton" @click="addItem">{{ $ts.addItem }}</button></template>
|
||||||
</FormTextarea>
|
</FormTextarea>
|
||||||
|
|
||||||
<FormRadios v-model="menuDisplay">
|
<FormRadios v-model="menuDisplay" class="_formBlock">
|
||||||
<template #desc>{{ $ts.display }}</template>
|
<template #label>{{ $ts.display }}</template>
|
||||||
<option value="sideFull">{{ $ts._menuDisplay.sideFull }}</option>
|
<option value="sideFull">{{ $ts._menuDisplay.sideFull }}</option>
|
||||||
<option value="sideIcon">{{ $ts._menuDisplay.sideIcon }}</option>
|
<option value="sideIcon">{{ $ts._menuDisplay.sideIcon }}</option>
|
||||||
<option value="top">{{ $ts._menuDisplay.top }}</option>
|
<option value="top">{{ $ts._menuDisplay.top }}</option>
|
||||||
<!-- <MkRadio v-model="menuDisplay" value="hide" disabled>{{ $ts._menuDisplay.hide }}</MkRadio>--> <!-- TODO: サイドバーを完全に隠せるようにすると、別途ハンバーガーボタンのようなものをUIに表示する必要があり面倒 -->
|
<!-- <MkRadio v-model="menuDisplay" value="hide" disabled>{{ $ts._menuDisplay.hide }}</MkRadio>--> <!-- TODO: サイドバーを完全に隠せるようにすると、別途ハンバーガーボタンのようなものをUIに表示する必要があり面倒 -->
|
||||||
</FormRadios>
|
</FormRadios>
|
||||||
|
|
||||||
<FormButton danger @click="reset()"><i class="fas fa-redo"></i> {{ $ts.default }}</FormButton>
|
<FormButton danger class="_formBlock" @click="reset()"><i class="fas fa-redo"></i> {{ $ts.default }}</FormButton>
|
||||||
</FormBase>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import FormTextarea from '@/components/debobigego/textarea.vue';
|
import FormTextarea from '@/components/form/textarea.vue';
|
||||||
import FormRadios from '@/components/debobigego/radios.vue';
|
import FormRadios from '@/components/form/radios.vue';
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
import FormBase from '@/components/debobigego/base.vue';
|
||||||
import FormButton from '@/components/debobigego/button.vue';
|
import FormButton from '@/components/ui/button.vue';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import { menuDef } from '@/menu';
|
import { menuDef } from '@/menu';
|
||||||
import { defaultStore } from '@/store';
|
import { defaultStore } from '@/store';
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
<template>
|
<template>
|
||||||
<FormBase>
|
<div class="_formRoot">
|
||||||
<FormLink @click="configure">{{ $ts.notificationSetting }}</FormLink>
|
<FormLink class="_formBlock" @click="configure"><template #icon><i class="fas fa-cog"></i></template>{{ $ts.notificationSetting }}</FormLink>
|
||||||
<FormGroup>
|
<FormSection>
|
||||||
<FormButton @click="readAllNotifications">{{ $ts.markAsReadAllNotifications }}</FormButton>
|
<FormLink class="_formBlock" @click="readAllNotifications">{{ $ts.markAsReadAllNotifications }}</FormLink>
|
||||||
<FormButton @click="readAllUnreadNotes">{{ $ts.markAsReadAllUnreadNotes }}</FormButton>
|
<FormLink class="_formBlock" @click="readAllUnreadNotes">{{ $ts.markAsReadAllUnreadNotes }}</FormLink>
|
||||||
<FormButton @click="readAllMessagingMessages">{{ $ts.markAsReadAllTalkMessages }}</FormButton>
|
<FormLink class="_formBlock" @click="readAllMessagingMessages">{{ $ts.markAsReadAllTalkMessages }}</FormLink>
|
||||||
</FormGroup>
|
</FormSection>
|
||||||
</FormBase>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import FormButton from '@/components/debobigego/button.vue';
|
import FormButton from '@/components/ui/button.vue';
|
||||||
import FormLink from '@/components/debobigego/link.vue';
|
import FormLink from '@/components/form/link.vue';
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
import FormBase from '@/components/debobigego/base.vue';
|
||||||
import FormGroup from '@/components/debobigego/group.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import { notificationTypes } from 'misskey-js';
|
import { notificationTypes } from 'misskey-js';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import * as symbols from '@/symbols';
|
import * as symbols from '@/symbols';
|
||||||
|
@ -24,7 +24,7 @@ export default defineComponent({
|
||||||
FormBase,
|
FormBase,
|
||||||
FormLink,
|
FormLink,
|
||||||
FormButton,
|
FormButton,
|
||||||
FormGroup,
|
FormSection,
|
||||||
},
|
},
|
||||||
|
|
||||||
emits: ['info'],
|
emits: ['info'],
|
||||||
|
|
|
@ -1,64 +1,66 @@
|
||||||
<template>
|
<template>
|
||||||
<FormBase>
|
<div class="_formRoot">
|
||||||
<FormGroup>
|
<FormSwitch v-model="isLocked" class="_formBlock" @update:modelValue="save()">{{ $ts.makeFollowManuallyApprove }}<template #caption>{{ $ts.lockedAccountInfo }}</template></FormSwitch>
|
||||||
<FormSwitch v-model="isLocked" @update:modelValue="save()">{{ $ts.makeFollowManuallyApprove }}</FormSwitch>
|
<FormSwitch v-if="isLocked" v-model="autoAcceptFollowed" class="_formBlock" @update:modelValue="save()">{{ $ts.autoAcceptFollowed }}</FormSwitch>
|
||||||
<FormSwitch v-model="autoAcceptFollowed" :disabled="!isLocked" @update:modelValue="save()">{{ $ts.autoAcceptFollowed }}</FormSwitch>
|
|
||||||
<template #caption>{{ $ts.lockedAccountInfo }}</template>
|
<FormSwitch v-model="publicReactions" class="_formBlock" @update:modelValue="save()">
|
||||||
</FormGroup>
|
|
||||||
<FormSwitch v-model="publicReactions" @update:modelValue="save()">
|
|
||||||
{{ $ts.makeReactionsPublic }}
|
{{ $ts.makeReactionsPublic }}
|
||||||
<template #desc>{{ $ts.makeReactionsPublicDescription }}</template>
|
<template #caption>{{ $ts.makeReactionsPublicDescription }}</template>
|
||||||
</FormSwitch>
|
</FormSwitch>
|
||||||
<FormGroup>
|
|
||||||
|
<FormSelect v-model="ffVisibility" class="_formBlock">
|
||||||
<template #label>{{ $ts.ffVisibility }}</template>
|
<template #label>{{ $ts.ffVisibility }}</template>
|
||||||
<FormSelect v-model="ffVisibility">
|
|
||||||
<option value="public">{{ $ts._ffVisibility.public }}</option>
|
<option value="public">{{ $ts._ffVisibility.public }}</option>
|
||||||
<option value="followers">{{ $ts._ffVisibility.followers }}</option>
|
<option value="followers">{{ $ts._ffVisibility.followers }}</option>
|
||||||
<option value="private">{{ $ts._ffVisibility.private }}</option>
|
<option value="private">{{ $ts._ffVisibility.private }}</option>
|
||||||
</FormSelect>
|
|
||||||
<template #caption>{{ $ts.ffVisibilityDescription }}</template>
|
<template #caption>{{ $ts.ffVisibilityDescription }}</template>
|
||||||
</FormGroup>
|
</FormSelect>
|
||||||
<FormSwitch v-model="hideOnlineStatus" @update:modelValue="save()">
|
|
||||||
|
<FormSwitch v-model="hideOnlineStatus" class="_formBlock" @update:modelValue="save()">
|
||||||
{{ $ts.hideOnlineStatus }}
|
{{ $ts.hideOnlineStatus }}
|
||||||
<template #desc>{{ $ts.hideOnlineStatusDescription }}</template>
|
<template #caption>{{ $ts.hideOnlineStatusDescription }}</template>
|
||||||
</FormSwitch>
|
</FormSwitch>
|
||||||
<FormSwitch v-model="noCrawle" @update:modelValue="save()">
|
<FormSwitch v-model="noCrawle" class="_formBlock" @update:modelValue="save()">
|
||||||
{{ $ts.noCrawle }}
|
{{ $ts.noCrawle }}
|
||||||
<template #desc>{{ $ts.noCrawleDescription }}</template>
|
<template #caption>{{ $ts.noCrawleDescription }}</template>
|
||||||
</FormSwitch>
|
</FormSwitch>
|
||||||
<FormSwitch v-model="isExplorable" @update:modelValue="save()">
|
<FormSwitch v-model="isExplorable" class="_formBlock" @update:modelValue="save()">
|
||||||
{{ $ts.makeExplorable }}
|
{{ $ts.makeExplorable }}
|
||||||
<template #desc>{{ $ts.makeExplorableDescription }}</template>
|
<template #caption>{{ $ts.makeExplorableDescription }}</template>
|
||||||
</FormSwitch>
|
</FormSwitch>
|
||||||
<FormSwitch v-model="rememberNoteVisibility" @update:modelValue="save()">{{ $ts.rememberNoteVisibility }}</FormSwitch>
|
|
||||||
<FormGroup v-if="!rememberNoteVisibility">
|
<FormSection>
|
||||||
|
<FormSwitch v-model="rememberNoteVisibility" class="_formBlock" @update:modelValue="save()">{{ $ts.rememberNoteVisibility }}</FormSwitch>
|
||||||
|
<FormGroup v-if="!rememberNoteVisibility" class="_formBlock">
|
||||||
<template #label>{{ $ts.defaultNoteVisibility }}</template>
|
<template #label>{{ $ts.defaultNoteVisibility }}</template>
|
||||||
<FormSelect v-model="defaultNoteVisibility">
|
<FormSelect v-model="defaultNoteVisibility" class="_formBlock">
|
||||||
<option value="public">{{ $ts._visibility.public }}</option>
|
<option value="public">{{ $ts._visibility.public }}</option>
|
||||||
<option value="home">{{ $ts._visibility.home }}</option>
|
<option value="home">{{ $ts._visibility.home }}</option>
|
||||||
<option value="followers">{{ $ts._visibility.followers }}</option>
|
<option value="followers">{{ $ts._visibility.followers }}</option>
|
||||||
<option value="specified">{{ $ts._visibility.specified }}</option>
|
<option value="specified">{{ $ts._visibility.specified }}</option>
|
||||||
</FormSelect>
|
</FormSelect>
|
||||||
<FormSwitch v-model="defaultNoteLocalOnly">{{ $ts._visibility.localOnly }}</FormSwitch>
|
<FormSwitch v-model="defaultNoteLocalOnly" class="_formBlock">{{ $ts._visibility.localOnly }}</FormSwitch>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
<FormSwitch v-model="keepCw" @update:modelValue="save()">{{ $ts.keepCw }}</FormSwitch>
|
</FormSection>
|
||||||
</FormBase>
|
|
||||||
|
<FormSwitch v-model="keepCw" class="_formBlock" @update:modelValue="save()">{{ $ts.keepCw }}</FormSwitch>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import FormSwitch from '@/components/debobigego/switch.vue';
|
import FormSwitch from '@/components/form/switch.vue';
|
||||||
import FormSelect from '@/components/debobigego/select.vue';
|
import FormSelect from '@/components/form/select.vue';
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import FormGroup from '@/components/debobigego/group.vue';
|
import FormGroup from '@/components/form/group.vue';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import { defaultStore } from '@/store';
|
import { defaultStore } from '@/store';
|
||||||
import * as symbols from '@/symbols';
|
import * as symbols from '@/symbols';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
FormBase,
|
|
||||||
FormSelect,
|
FormSelect,
|
||||||
|
FormSection,
|
||||||
FormGroup,
|
FormGroup,
|
||||||
FormSwitch,
|
FormSwitch,
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,59 +1,58 @@
|
||||||
<template>
|
<template>
|
||||||
<FormBase>
|
<div class="_formRoot">
|
||||||
<FormGroup>
|
<div class="llvierxe" :style="{ backgroundImage: $i.bannerUrl ? `url(${ $i.bannerUrl })` : null }">
|
||||||
<div class="_debobigegoItem _debobigegoPanel llvierxe" :style="{ backgroundImage: $i.bannerUrl ? `url(${ $i.bannerUrl })` : null }">
|
<div class="avatar _acrylic">
|
||||||
<MkAvatar class="avatar" :user="$i"/>
|
<MkAvatar class="avatar" :user="$i" :disable-link="true" @click="changeAvatar"/>
|
||||||
|
<MkButton primary class="avatarEdit" @click="changeAvatar">{{ $ts._profile.changeAvatar }}</MkButton>
|
||||||
|
</div>
|
||||||
|
<MkButton primary class="bannerEdit" @click="changeBanner">{{ $ts._profile.changeBanner }}</MkButton>
|
||||||
</div>
|
</div>
|
||||||
<FormButton primary @click="changeAvatar">{{ $ts._profile.changeAvatar }}</FormButton>
|
|
||||||
<FormButton primary @click="changeBanner">{{ $ts._profile.changeBanner }}</FormButton>
|
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormInput v-model="name" :max="30" manual-save>
|
<FormInput v-model="name" :max="30" manual-save class="_formBlock">
|
||||||
<span>{{ $ts._profile.name }}</span>
|
<template #label>{{ $ts._profile.name }}</template>
|
||||||
</FormInput>
|
</FormInput>
|
||||||
|
|
||||||
<FormTextarea v-model="description" :max="500" tall manual-save>
|
<FormTextarea v-model="description" :max="500" tall manual-save class="_formBlock">
|
||||||
<span>{{ $ts._profile.description }}</span>
|
<template #label>{{ $ts._profile.description }}</template>
|
||||||
<template #desc>{{ $ts._profile.youCanIncludeHashtags }}</template>
|
<template #caption>{{ $ts._profile.youCanIncludeHashtags }}</template>
|
||||||
</FormTextarea>
|
</FormTextarea>
|
||||||
|
|
||||||
<FormInput v-model="location" manual-save>
|
<FormInput v-model="location" manual-save class="_formBlock">
|
||||||
<span>{{ $ts.location }}</span>
|
<template #label>{{ $ts.location }}</template>
|
||||||
<template #prefix><i class="fas fa-map-marker-alt"></i></template>
|
<template #prefix><i class="fas fa-map-marker-alt"></i></template>
|
||||||
</FormInput>
|
</FormInput>
|
||||||
|
|
||||||
<FormInput v-model="birthday" type="date" manual-save>
|
<FormInput v-model="birthday" type="date" manual-save class="_formBlock">
|
||||||
<span>{{ $ts.birthday }}</span>
|
<template #label>{{ $ts.birthday }}</template>
|
||||||
<template #prefix><i class="fas fa-birthday-cake"></i></template>
|
<template #prefix><i class="fas fa-birthday-cake"></i></template>
|
||||||
</FormInput>
|
</FormInput>
|
||||||
|
|
||||||
<FormSelect v-model="lang">
|
<FormSelect v-model="lang" class="_formBlock">
|
||||||
<template #label>{{ $ts.language }}</template>
|
<template #label>{{ $ts.language }}</template>
|
||||||
<option v-for="x in langs" :key="x[0]" :value="x[0]">{{ x[1] }}</option>
|
<option v-for="x in langs" :key="x[0]" :value="x[0]">{{ x[1] }}</option>
|
||||||
</FormSelect>
|
</FormSelect>
|
||||||
|
|
||||||
<FormGroup>
|
<FormSlot>
|
||||||
<FormButton primary @click="editMetadata">{{ $ts._profile.metadataEdit }}</FormButton>
|
<MkButton @click="editMetadata">{{ $ts._profile.metadataEdit }}</MkButton>
|
||||||
<template #caption>{{ $ts._profile.metadataDescription }}</template>
|
<template #caption>{{ $ts._profile.metadataDescription }}</template>
|
||||||
</FormGroup>
|
</FormSlot>
|
||||||
|
|
||||||
<FormSwitch v-model="isCat">{{ $ts.flagAsCat }}<template #desc>{{ $ts.flagAsCatDescription }}</template></FormSwitch>
|
<FormSwitch v-model="isCat" class="_formBlock">{{ $ts.flagAsCat }}<template #caption>{{ $ts.flagAsCatDescription }}</template></FormSwitch>
|
||||||
|
|
||||||
<FormSwitch v-model="isBot">{{ $ts.flagAsBot }}<template #desc>{{ $ts.flagAsBotDescription }}</template></FormSwitch>
|
<FormSwitch v-model="isBot" class="_formBlock">{{ $ts.flagAsBot }}<template #caption>{{ $ts.flagAsBotDescription }}</template></FormSwitch>
|
||||||
|
|
||||||
<FormSwitch v-model="alwaysMarkNsfw">{{ $ts.alwaysMarkSensitive }}</FormSwitch>
|
<FormSwitch v-model="alwaysMarkNsfw" class="_formBlock">{{ $ts.alwaysMarkSensitive }}</FormSwitch>
|
||||||
</FormBase>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import FormButton from '@/components/debobigego/button.vue';
|
import MkButton from '@/components/ui/button.vue';
|
||||||
import FormInput from '@/components/debobigego/input.vue';
|
import FormInput from '@/components/form/input.vue';
|
||||||
import FormTextarea from '@/components/debobigego/textarea.vue';
|
import FormTextarea from '@/components/form/textarea.vue';
|
||||||
import FormSwitch from '@/components/debobigego/switch.vue';
|
import FormSwitch from '@/components/form/switch.vue';
|
||||||
import FormSelect from '@/components/debobigego/select.vue';
|
import FormSelect from '@/components/form/select.vue';
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
import FormSlot from '@/components/form/slot.vue';
|
||||||
import FormGroup from '@/components/debobigego/group.vue';
|
|
||||||
import { host, langs } from '@/config';
|
import { host, langs } from '@/config';
|
||||||
import { selectFile } from '@/scripts/select-file';
|
import { selectFile } from '@/scripts/select-file';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
|
@ -61,13 +60,12 @@ import * as symbols from '@/symbols';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
FormButton,
|
MkButton,
|
||||||
FormInput,
|
FormInput,
|
||||||
FormTextarea,
|
FormTextarea,
|
||||||
FormSwitch,
|
FormSwitch,
|
||||||
FormSelect,
|
FormSelect,
|
||||||
FormBase,
|
FormSlot,
|
||||||
FormGroup,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
emits: ['info'],
|
emits: ['info'],
|
||||||
|
@ -257,25 +255,28 @@ export default defineComponent({
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.llvierxe {
|
.llvierxe {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 150px;
|
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
|
border-radius: 10px;
|
||||||
> * {
|
overflow: clip;
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .avatar {
|
> .avatar {
|
||||||
position: absolute;
|
display: inline-block;
|
||||||
top: 0;
|
text-align: center;
|
||||||
bottom: 0;
|
padding: 16px;
|
||||||
left: 0;
|
|
||||||
right: 0;
|
> .avatar {
|
||||||
display: block;
|
display: inline-block;
|
||||||
width: 72px;
|
width: 72px;
|
||||||
height: 72px;
|
height: 72px;
|
||||||
margin: auto;
|
margin: 0 auto 16px auto;
|
||||||
box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.5);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> .bannerEdit {
|
||||||
|
position: absolute;
|
||||||
|
top: 16px;
|
||||||
|
right: 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<FormBase>
|
<div class="_formRoot">
|
||||||
<div class="_debobigegoItem">
|
<FromSlot class="_formBlock">
|
||||||
<div class="_debobigegoLabel">{{ $ts.reactionSettingDescription }}</div>
|
<template #label>{{ $ts.reactionSettingDescription }}</template>
|
||||||
<div class="_debobigegoPanel">
|
<div v-panel style="border-radius: 6px;">
|
||||||
<XDraggable v-model="reactions" class="zoaiodol" :item-key="item => item" animation="150" delay="100" delay-on-touch-only="true">
|
<XDraggable v-model="reactions" class="zoaiodol" :item-key="item => item" animation="150" delay="100" delay-on-touch-only="true">
|
||||||
<template #item="{element}">
|
<template #item="{element}">
|
||||||
<button class="_button item" @click="remove(element, $event)">
|
<button class="_button item" @click="remove(element, $event)">
|
||||||
|
@ -14,33 +14,38 @@
|
||||||
</template>
|
</template>
|
||||||
</XDraggable>
|
</XDraggable>
|
||||||
</div>
|
</div>
|
||||||
<div class="_debobigegoCaption">{{ $ts.reactionSettingDescription2 }} <button class="_textButton" @click="preview">{{ $ts.preview }}</button></div>
|
<template #caption>{{ $ts.reactionSettingDescription2 }} <button class="_textButton" @click="preview">{{ $ts.preview }}</button></template>
|
||||||
</div>
|
</FromSlot>
|
||||||
|
|
||||||
<FormRadios v-model="reactionPickerWidth">
|
<FormRadios v-model="reactionPickerWidth" class="_formBlock">
|
||||||
<template #desc>{{ $ts.width }}</template>
|
<template #label>{{ $ts.width }}</template>
|
||||||
<option :value="1">{{ $ts.small }}</option>
|
<option :value="1">{{ $ts.small }}</option>
|
||||||
<option :value="2">{{ $ts.medium }}</option>
|
<option :value="2">{{ $ts.medium }}</option>
|
||||||
<option :value="3">{{ $ts.large }}</option>
|
<option :value="3">{{ $ts.large }}</option>
|
||||||
</FormRadios>
|
</FormRadios>
|
||||||
<FormRadios v-model="reactionPickerHeight">
|
<FormRadios v-model="reactionPickerHeight" class="_formBlock">
|
||||||
<template #desc>{{ $ts.height }}</template>
|
<template #label>{{ $ts.height }}</template>
|
||||||
<option :value="1">{{ $ts.small }}</option>
|
<option :value="1">{{ $ts.small }}</option>
|
||||||
<option :value="2">{{ $ts.medium }}</option>
|
<option :value="2">{{ $ts.medium }}</option>
|
||||||
<option :value="3">{{ $ts.large }}</option>
|
<option :value="3">{{ $ts.large }}</option>
|
||||||
</FormRadios>
|
</FormRadios>
|
||||||
|
<FormSection>
|
||||||
<FormButton @click="preview"><i class="fas fa-eye"></i> {{ $ts.preview }}</FormButton>
|
<FormButton @click="preview"><i class="fas fa-eye"></i> {{ $ts.preview }}</FormButton>
|
||||||
|
</FormSection>
|
||||||
|
<FormSection>
|
||||||
<FormButton danger @click="setDefault"><i class="fas fa-undo"></i> {{ $ts.default }}</FormButton>
|
<FormButton danger @click="setDefault"><i class="fas fa-undo"></i> {{ $ts.default }}</FormButton>
|
||||||
</FormBase>
|
</FormSection>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import XDraggable from 'vuedraggable';
|
import XDraggable from 'vuedraggable';
|
||||||
import FormInput from '@/components/debobigego/input.vue';
|
import FormInput from '@/components/form/input.vue';
|
||||||
import FormRadios from '@/components/debobigego/radios.vue';
|
import FormRadios from '@/components/form/radios.vue';
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
import FromSlot from '@/components/form/slot.vue';
|
||||||
import FormButton from '@/components/debobigego/button.vue';
|
import FormButton from '@/components/ui/button.vue';
|
||||||
|
import FormSection from '@/components/form/section.vue';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import { defaultStore } from '@/store';
|
import { defaultStore } from '@/store';
|
||||||
import * as symbols from '@/symbols';
|
import * as symbols from '@/symbols';
|
||||||
|
@ -49,8 +54,9 @@ export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
FormInput,
|
FormInput,
|
||||||
FormButton,
|
FormButton,
|
||||||
FormBase,
|
FromSlot,
|
||||||
FormRadios,
|
FormRadios,
|
||||||
|
FormSection,
|
||||||
XDraggable,
|
XDraggable,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -135,7 +141,8 @@ export default defineComponent({
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.zoaiodol {
|
.zoaiodol {
|
||||||
padding: 16px;
|
padding: 12px;
|
||||||
|
font-size: 1.1em;
|
||||||
|
|
||||||
> .item {
|
> .item {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
|
@ -1,12 +1,21 @@
|
||||||
<template>
|
<template>
|
||||||
<FormBase>
|
<div class="_formRoot">
|
||||||
<X2fa/>
|
<FormSection>
|
||||||
<FormLink to="/settings/2fa"><template #icon><i class="fas fa-mobile-alt"></i></template>{{ $ts.twoStepAuthentication }}</FormLink>
|
<template #label>{{ $ts.password }}</template>
|
||||||
<FormButton primary @click="change()">{{ $ts.changePassword }}</FormButton>
|
<FormButton primary @click="change()">{{ $ts.changePassword }}</FormButton>
|
||||||
<FormPagination :pagination="pagination">
|
</FormSection>
|
||||||
|
|
||||||
|
<FormSection>
|
||||||
|
<template #label>{{ $ts.twoStepAuthentication }}</template>
|
||||||
|
<X2fa/>
|
||||||
|
</FormSection>
|
||||||
|
|
||||||
|
<FormSection>
|
||||||
<template #label>{{ $ts.signinHistory }}</template>
|
<template #label>{{ $ts.signinHistory }}</template>
|
||||||
|
<FormPagination :pagination="pagination">
|
||||||
<template #default="{items}">
|
<template #default="{items}">
|
||||||
<div v-for="item in items" :key="item.id" class="_debobigegoPanel timnmucd">
|
<div>
|
||||||
|
<div v-for="item in items" :key="item.id" v-panel class="timnmucd">
|
||||||
<header>
|
<header>
|
||||||
<i v-if="item.success" class="fas fa-check icon succ"></i>
|
<i v-if="item.success" class="fas fa-check icon succ"></i>
|
||||||
<i v-else class="fas fa-times-circle icon fail"></i>
|
<i v-else class="fas fa-times-circle icon fail"></i>
|
||||||
|
@ -14,32 +23,39 @@
|
||||||
<MkTime :time="item.createdAt" class="time"/>
|
<MkTime :time="item.createdAt" class="time"/>
|
||||||
</header>
|
</header>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</FormPagination>
|
</FormPagination>
|
||||||
<FormGroup>
|
</FormSection>
|
||||||
|
|
||||||
|
<FormSection>
|
||||||
|
<FormSlot>
|
||||||
<FormButton danger @click="regenerateToken"><i class="fas fa-sync-alt"></i> {{ $ts.regenerateLoginToken }}</FormButton>
|
<FormButton danger @click="regenerateToken"><i class="fas fa-sync-alt"></i> {{ $ts.regenerateLoginToken }}</FormButton>
|
||||||
<template #caption>{{ $ts.regenerateLoginTokenDescription }}</template>
|
<template #caption>{{ $ts.regenerateLoginTokenDescription }}</template>
|
||||||
</FormGroup>
|
</FormSlot>
|
||||||
</FormBase>
|
</FormSection>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import FormLink from '@/components/debobigego/link.vue';
|
import FormLink from '@/components/debobigego/link.vue';
|
||||||
import FormGroup from '@/components/debobigego/group.vue';
|
import FormSlot from '@/components/form/slot.vue';
|
||||||
import FormButton from '@/components/debobigego/button.vue';
|
import FormButton from '@/components/ui/button.vue';
|
||||||
import FormPagination from '@/components/debobigego/pagination.vue';
|
import FormPagination from '@/components/form/pagination.vue';
|
||||||
|
import X2fa from './2fa.vue';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import * as symbols from '@/symbols';
|
import * as symbols from '@/symbols';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
FormBase,
|
FormSection,
|
||||||
FormLink,
|
FormLink,
|
||||||
FormButton,
|
FormButton,
|
||||||
FormPagination,
|
FormPagination,
|
||||||
FormGroup,
|
FormSlot,
|
||||||
|
X2fa,
|
||||||
},
|
},
|
||||||
|
|
||||||
emits: ['info'],
|
emits: ['info'],
|
||||||
|
@ -115,6 +131,20 @@ export default defineComponent({
|
||||||
.timnmucd {
|
.timnmucd {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
border-top-left-radius: 6px;
|
||||||
|
border-top-right-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom-left-radius: 6px;
|
||||||
|
border-bottom-right-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:not(:last-child) {
|
||||||
|
border-bottom: solid 0.5px var(--divider);
|
||||||
|
}
|
||||||
|
|
||||||
> header {
|
> header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
@ -1,29 +1,28 @@
|
||||||
<template>
|
<template>
|
||||||
<FormBase>
|
<div class="_formRoot">
|
||||||
<FormRange v-model="masterVolume" :min="0" :max="1" :step="0.05">
|
<FormRange v-model="masterVolume" :min="0" :max="1" :step="0.05" :text-converter="(v) => `${Math.floor(v * 100)}%`" class="_formBlock">
|
||||||
<template #label><i class="fas fa-volume-icon"></i> {{ $ts.masterVolume }}</template>
|
<template #label>{{ $ts.masterVolume }}</template>
|
||||||
</FormRange>
|
</FormRange>
|
||||||
|
|
||||||
<FormGroup>
|
<FormSection>
|
||||||
<template #label>{{ $ts.sounds }}</template>
|
<template #label>{{ $ts.sounds }}</template>
|
||||||
<FormButton v-for="type in Object.keys(sounds)" :key="type" :center="false" @click="edit(type)">
|
<FormLink v-for="type in Object.keys(sounds)" :key="type" style="margin-bottom: 8px;" @click="edit(type)">
|
||||||
{{ $t('_sfx.' + type) }}
|
{{ $t('_sfx.' + type) }}
|
||||||
<template #suffix>{{ sounds[type].type || $ts.none }}</template>
|
<template #suffix>{{ sounds[type].type || $ts.none }}</template>
|
||||||
<template #suffixIcon><i class="fas fa-chevron-down"></i></template>
|
<template #suffixIcon><i class="fas fa-chevron-down"></i></template>
|
||||||
</FormButton>
|
</FormLink>
|
||||||
</FormGroup>
|
</FormSection>
|
||||||
|
|
||||||
<FormButton danger @click="reset()"><i class="fas fa-redo"></i> {{ $ts.default }}</FormButton>
|
<FormButton danger class="_formBlock" @click="reset()"><i class="fas fa-redo"></i> {{ $ts.default }}</FormButton>
|
||||||
</FormBase>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import FormRange from '@/components/debobigego/range.vue';
|
import FormRange from '@/components/form/range.vue';
|
||||||
import FormSelect from '@/components/debobigego/select.vue';
|
import FormButton from '@/components/ui/button.vue';
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
import FormLink from '@/components/form/link.vue';
|
||||||
import FormButton from '@/components/debobigego/button.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import FormGroup from '@/components/debobigego/group.vue';
|
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import { ColdDeviceStorage } from '@/store';
|
import { ColdDeviceStorage } from '@/store';
|
||||||
import { playFile } from '@/scripts/sound';
|
import { playFile } from '@/scripts/sound';
|
||||||
|
@ -58,11 +57,10 @@ const soundsTypes = [
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
FormSelect,
|
FormLink,
|
||||||
FormButton,
|
FormButton,
|
||||||
FormBase,
|
|
||||||
FormRange,
|
FormRange,
|
||||||
FormGroup,
|
FormSection,
|
||||||
},
|
},
|
||||||
|
|
||||||
emits: ['info'],
|
emits: ['info'],
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<FormBase>
|
<div class="_formRoot">
|
||||||
<FormGroup>
|
<div v-panel class="rfqxtzch _formBlock">
|
||||||
<div class="rfqxtzch _debobigegoItem _debobigegoPanel">
|
<div class="toggle">
|
||||||
<div class="darkMode">
|
|
||||||
<div class="toggleWrapper">
|
<div class="toggleWrapper">
|
||||||
<input id="dn" v-model="darkMode" type="checkbox" class="dn"/>
|
<input id="dn" v-model="darkMode" type="checkbox" class="dn"/>
|
||||||
<label for="dn" class="toggle">
|
<label for="dn" class="toggle">
|
||||||
|
@ -22,13 +21,15 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="sync">
|
||||||
<FormSwitch v-model="syncDeviceDarkMode">{{ $ts.syncDeviceDarkMode }}</FormSwitch>
|
<FormSwitch v-model="syncDeviceDarkMode">{{ $ts.syncDeviceDarkMode }}</FormSwitch>
|
||||||
</FormGroup>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<template v-if="darkMode">
|
<template v-if="darkMode">
|
||||||
<FormSelect v-model="darkThemeId">
|
<FormSelect v-model="darkThemeId" class="_formBlock">
|
||||||
<template #label>{{ $ts.themeForDarkMode }}</template>
|
<template #label>{{ $ts.themeForDarkMode }}</template>
|
||||||
|
<template #prefix><i class="fas fa-moon"></i></template>
|
||||||
<optgroup :label="$ts.darkThemes">
|
<optgroup :label="$ts.darkThemes">
|
||||||
<option v-for="x in darkThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
|
<option v-for="x in darkThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
|
@ -36,8 +37,9 @@
|
||||||
<option v-for="x in lightThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
|
<option v-for="x in lightThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
</FormSelect>
|
</FormSelect>
|
||||||
<FormSelect v-model="lightThemeId">
|
<FormSelect v-model="lightThemeId" class="_formBlock">
|
||||||
<template #label>{{ $ts.themeForLightMode }}</template>
|
<template #label>{{ $ts.themeForLightMode }}</template>
|
||||||
|
<template #prefix><i class="fas fa-sun"></i></template>
|
||||||
<optgroup :label="$ts.lightThemes">
|
<optgroup :label="$ts.lightThemes">
|
||||||
<option v-for="x in lightThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
|
<option v-for="x in lightThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
|
@ -47,8 +49,9 @@
|
||||||
</FormSelect>
|
</FormSelect>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<FormSelect v-model="lightThemeId">
|
<FormSelect v-model="lightThemeId" class="_formBlock">
|
||||||
<template #label>{{ $ts.themeForLightMode }}</template>
|
<template #label>{{ $ts.themeForLightMode }}</template>
|
||||||
|
<template #prefix><i class="fas fa-sun"></i></template>
|
||||||
<optgroup :label="$ts.lightThemes">
|
<optgroup :label="$ts.lightThemes">
|
||||||
<option v-for="x in lightThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
|
<option v-for="x in lightThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
|
@ -56,8 +59,9 @@
|
||||||
<option v-for="x in darkThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
|
<option v-for="x in darkThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
</FormSelect>
|
</FormSelect>
|
||||||
<FormSelect v-model="darkThemeId">
|
<FormSelect v-model="darkThemeId" class="_formBlock">
|
||||||
<template #label>{{ $ts.themeForDarkMode }}</template>
|
<template #label>{{ $ts.themeForDarkMode }}</template>
|
||||||
|
<template #prefix><i class="fas fa-moon"></i></template>
|
||||||
<optgroup :label="$ts.darkThemes">
|
<optgroup :label="$ts.darkThemes">
|
||||||
<option v-for="x in darkThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
|
<option v-for="x in darkThemes" :key="x.id" :value="x.id">{{ x.name }}</option>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
|
@ -67,31 +71,28 @@
|
||||||
</FormSelect>
|
</FormSelect>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<FormButton v-if="wallpaper == null" primary @click="setWallpaper">{{ $ts.setWallpaper }}</FormButton>
|
<FormSection>
|
||||||
<FormButton v-else primary @click="wallpaper = null">{{ $ts.removeWallpaper }}</FormButton>
|
<div class="_formLinksGrid">
|
||||||
|
<FormLink to="/settings/theme/manage"><template #icon><i class="fas fa-folder-open"></i></template>{{ $ts._theme.manage }}<template #suffix>{{ themesCount }}</template></FormLink>
|
||||||
<FormGroup>
|
|
||||||
<FormLink to="https://assets.misskey.io/theme/list" external><template #icon><i class="fas fa-globe"></i></template>{{ $ts._theme.explore }}</FormLink>
|
<FormLink to="https://assets.misskey.io/theme/list" external><template #icon><i class="fas fa-globe"></i></template>{{ $ts._theme.explore }}</FormLink>
|
||||||
<FormLink to="/settings/theme/install"><template #icon><i class="fas fa-download"></i></template>{{ $ts._theme.install }}</FormLink>
|
<FormLink to="/settings/theme/install"><template #icon><i class="fas fa-download"></i></template>{{ $ts._theme.install }}</FormLink>
|
||||||
</FormGroup>
|
|
||||||
|
|
||||||
<FormGroup>
|
|
||||||
<FormLink to="/theme-editor"><template #icon><i class="fas fa-paint-roller"></i></template>{{ $ts._theme.make }}</FormLink>
|
<FormLink to="/theme-editor"><template #icon><i class="fas fa-paint-roller"></i></template>{{ $ts._theme.make }}</FormLink>
|
||||||
<!--<FormLink to="/advanced-theme-editor"><template #icon><i class="fas fa-paint-roller"></i></template>{{ $ts._theme.make }} ({{ $ts.advanced }})</FormLink>-->
|
</div>
|
||||||
</FormGroup>
|
</FormSection>
|
||||||
|
|
||||||
<FormLink to="/settings/theme/manage"><template #icon><i class="fas fa-folder-open"></i></template>{{ $ts._theme.manage }}<template #suffix>{{ themesCount }}</template></FormLink>
|
<FormButton v-if="wallpaper == null" class="_formBlock" @click="setWallpaper">{{ $ts.setWallpaper }}</FormButton>
|
||||||
</FormBase>
|
<FormButton v-else class="_formBlock" @click="wallpaper = null">{{ $ts.removeWallpaper }}</FormButton>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computed, defineComponent, onActivated, onMounted, ref, watch } from 'vue';
|
import { computed, defineComponent, onActivated, onMounted, ref, watch } from 'vue';
|
||||||
import FormSwitch from '@/components/debobigego/switch.vue';
|
import FormSwitch from '@/components/form/switch.vue';
|
||||||
import FormSelect from '@/components/debobigego/select.vue';
|
import FormSelect from '@/components/form/select.vue';
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
import FormGroup from '@/components/form/group.vue';
|
||||||
import FormGroup from '@/components/debobigego/group.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import FormLink from '@/components/debobigego/link.vue';
|
import FormLink from '@/components/form/link.vue';
|
||||||
import FormButton from '@/components/debobigego/button.vue';
|
import FormButton from '@/components/ui/button.vue';
|
||||||
import { builtinThemes } from '@/scripts/theme';
|
import { builtinThemes } from '@/scripts/theme';
|
||||||
import { selectFile } from '@/scripts/select-file';
|
import { selectFile } from '@/scripts/select-file';
|
||||||
import { isDeviceDarkmode } from '@/scripts/is-device-darkmode';
|
import { isDeviceDarkmode } from '@/scripts/is-device-darkmode';
|
||||||
|
@ -105,8 +106,8 @@ export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
FormSwitch,
|
FormSwitch,
|
||||||
FormSelect,
|
FormSelect,
|
||||||
FormBase,
|
|
||||||
FormGroup,
|
FormGroup,
|
||||||
|
FormSection,
|
||||||
FormLink,
|
FormLink,
|
||||||
FormButton,
|
FormButton,
|
||||||
},
|
},
|
||||||
|
@ -198,11 +199,12 @@ export default defineComponent({
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.rfqxtzch {
|
.rfqxtzch {
|
||||||
padding: 16px;
|
border-radius: 6px;
|
||||||
|
|
||||||
> .darkMode {
|
> .toggle {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 32px 0;
|
padding: 26px 0;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
&.disabled {
|
&.disabled {
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
|
@ -212,13 +214,11 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.toggleWrapper {
|
> .toggleWrapper {
|
||||||
position: absolute;
|
display: inline-block;
|
||||||
top: 50%;
|
text-align: left;
|
||||||
left: 50%;
|
overflow: clip;
|
||||||
overflow: hidden;
|
|
||||||
padding: 0 100px;
|
padding: 0 100px;
|
||||||
transform: translate3d(-50%, -50%, 0);
|
|
||||||
|
|
||||||
input {
|
input {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -239,7 +239,6 @@ export default defineComponent({
|
||||||
> .before, > .after {
|
> .before, > .after {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 15px;
|
top: 15px;
|
||||||
font-size: 18px;
|
|
||||||
transition: color 1s ease;
|
transition: color 1s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,5 +419,10 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
> .sync {
|
||||||
|
padding: 14px 16px;
|
||||||
|
border-top: solid 0.5px var(--divider);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,32 +1,30 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="_formRoot">
|
||||||
<MkTab v-model="tab">
|
<MkTab v-model="tab" class="_formBlock">
|
||||||
<option value="soft">{{ $ts._wordMute.soft }}</option>
|
<option value="soft">{{ $ts._wordMute.soft }}</option>
|
||||||
<option value="hard">{{ $ts._wordMute.hard }}</option>
|
<option value="hard">{{ $ts._wordMute.hard }}</option>
|
||||||
</MkTab>
|
</MkTab>
|
||||||
<FormBase>
|
<div class="_formBlock">
|
||||||
<div class="_debobigegoItem">
|
|
||||||
<div v-show="tab === 'soft'">
|
<div v-show="tab === 'soft'">
|
||||||
<FormInfo>{{ $ts._wordMute.softDescription }}</FormInfo>
|
<MkInfo class="_formBlock">{{ $ts._wordMute.softDescription }}</MkInfo>
|
||||||
<FormTextarea v-model="softMutedWords">
|
<FormTextarea v-model="softMutedWords" class="_formBlock">
|
||||||
<span>{{ $ts._wordMute.muteWords }}</span>
|
<span>{{ $ts._wordMute.muteWords }}</span>
|
||||||
<template #desc>{{ $ts._wordMute.muteWordsDescription }}<br>{{ $ts._wordMute.muteWordsDescription2 }}</template>
|
<template #caption>{{ $ts._wordMute.muteWordsDescription }}<br>{{ $ts._wordMute.muteWordsDescription2 }}</template>
|
||||||
</FormTextarea>
|
</FormTextarea>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="tab === 'hard'">
|
<div v-show="tab === 'hard'">
|
||||||
<FormInfo>{{ $ts._wordMute.hardDescription }}</FormInfo>
|
<MkInfo class="_formBlock">{{ $ts._wordMute.hardDescription }}</MkInfo>
|
||||||
<FormTextarea v-model="hardMutedWords">
|
<FormTextarea v-model="hardMutedWords" class="_formBlock">
|
||||||
<span>{{ $ts._wordMute.muteWords }}</span>
|
<span>{{ $ts._wordMute.muteWords }}</span>
|
||||||
<template #desc>{{ $ts._wordMute.muteWordsDescription }}<br>{{ $ts._wordMute.muteWordsDescription2 }}</template>
|
<template #caption>{{ $ts._wordMute.muteWordsDescription }}<br>{{ $ts._wordMute.muteWordsDescription2 }}</template>
|
||||||
</FormTextarea>
|
</FormTextarea>
|
||||||
<FormKeyValueView v-if="hardWordMutedNotesCount != null">
|
<MkKeyValue v-if="hardWordMutedNotesCount != null" class="_formBlock">
|
||||||
<template #key>{{ $ts._wordMute.mutedNotes }}</template>
|
<template #key>{{ $ts._wordMute.mutedNotes }}</template>
|
||||||
<template #value>{{ number(hardWordMutedNotesCount) }}</template>
|
<template #value>{{ number(hardWordMutedNotesCount) }}</template>
|
||||||
</FormKeyValueView>
|
</MkKeyValue>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<FormButton primary inline :disabled="!changed" @click="save()"><i class="fas fa-save"></i> {{ $ts.save }}</FormButton>
|
<MkButton primary inline :disabled="!changed" @click="save()"><i class="fas fa-save"></i> {{ $ts.save }}</MkButton>
|
||||||
</FormBase>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -34,9 +32,9 @@
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import FormTextarea from '@/components/form/textarea.vue';
|
import FormTextarea from '@/components/form/textarea.vue';
|
||||||
import FormBase from '@/components/debobigego/base.vue';
|
import FormBase from '@/components/debobigego/base.vue';
|
||||||
import FormKeyValueView from '@/components/debobigego/key-value-view.vue';
|
import MkKeyValue from '@/components/key-value.vue';
|
||||||
import FormButton from '@/components/debobigego/button.vue';
|
import MkButton from '@/components/ui/button.vue';
|
||||||
import FormInfo from '@/components/debobigego/info.vue';
|
import MkInfo from '@/components/ui/info.vue';
|
||||||
import MkTab from '@/components/tab.vue';
|
import MkTab from '@/components/tab.vue';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import number from '@/filters/number';
|
import number from '@/filters/number';
|
||||||
|
@ -45,11 +43,11 @@ import * as symbols from '@/symbols';
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
FormBase,
|
FormBase,
|
||||||
FormButton,
|
MkButton,
|
||||||
FormTextarea,
|
FormTextarea,
|
||||||
FormKeyValueView,
|
MkKeyValue,
|
||||||
MkTab,
|
MkTab,
|
||||||
FormInfo,
|
MkInfo,
|
||||||
},
|
},
|
||||||
|
|
||||||
emits: ['info'],
|
emits: ['info'],
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { getStaticImageUrl } from '@/scripts/get-static-image-url';
|
import { getStaticImageUrl } from '@/scripts/get-static-image-url';
|
||||||
import notePage from '@/filters/note';
|
import { notePage } from '@/filters/note';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import MkContainer from '@/components/ui/container.vue';
|
import MkContainer from '@/components/ui/container.vue';
|
||||||
import ImgWithBlurhash from '@/components/img-with-blurhash.vue';
|
import ImgWithBlurhash from '@/components/img-with-blurhash.vue';
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'font', 'blur', 'rainbow', 'sparkle'];
|
export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'font', 'blur', 'rainbow', 'sparkle', 'rotate'];
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { isScreenTouching } from '@/os';
|
||||||
import { Ref, ref } from 'vue';
|
import { Ref, ref } from 'vue';
|
||||||
|
|
||||||
export function useTooltip(onShow: (showing: Ref<boolean>) => void) {
|
export function useTooltip(onShow: (showing: Ref<boolean>) => void) {
|
||||||
|
@ -10,6 +11,10 @@ export function useTooltip(onShow: (showing: Ref<boolean>) => void) {
|
||||||
close();
|
close();
|
||||||
if (!isHovering) return;
|
if (!isHovering) return;
|
||||||
|
|
||||||
|
// iOS(Androidも?)では、要素をタップした直後に(おせっかいで)mouseoverイベントを発火させたりするため、その対策
|
||||||
|
// これが無いと、画面に触れてないのにツールチップが出たりしてしまう
|
||||||
|
if (!isScreenTouching) return;
|
||||||
|
|
||||||
const showing = ref(true);
|
const showing = ref(true);
|
||||||
onShow(showing);
|
onShow(showing);
|
||||||
changeShowingState = () => {
|
changeShowingState = () => {
|
||||||
|
|
|
@ -29,6 +29,7 @@ html {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
font-family: "BIZ UDGothic", Roboto, HelveticaNeue, Arial, sans-serif;
|
font-family: "BIZ UDGothic", Roboto, HelveticaNeue, Arial, sans-serif;
|
||||||
|
font-size: 15px;
|
||||||
line-height: 1.35;
|
line-height: 1.35;
|
||||||
text-size-adjust: 100%;
|
text-size-adjust: 100%;
|
||||||
tab-size: 2;
|
tab-size: 2;
|
||||||
|
@ -387,9 +388,8 @@ hr {
|
||||||
|
|
||||||
._inputSplit {
|
._inputSplit {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
|
||||||
grid-gap: 8px;
|
grid-gap: 12px;
|
||||||
margin: 1em 0;
|
|
||||||
|
|
||||||
> * {
|
> * {
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
|
@ -397,7 +397,7 @@ hr {
|
||||||
}
|
}
|
||||||
|
|
||||||
._formBlock {
|
._formBlock {
|
||||||
margin: 20px 0;
|
margin: 1.5em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
._formRoot {
|
._formRoot {
|
||||||
|
@ -410,6 +410,18 @@ hr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
._formLinksGrid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
||||||
|
grid-gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
._formLinks {
|
||||||
|
> *:not(:last-child) {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
._table {
|
._table {
|
||||||
> ._row {
|
> ._row {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -5,8 +5,6 @@
|
||||||
</MkA>
|
</MkA>
|
||||||
<span v-if="note.user.isBot" class="is-bot">bot</span>
|
<span v-if="note.user.isBot" class="is-bot">bot</span>
|
||||||
<span class="username"><MkAcct :user="note.user"/></span>
|
<span class="username"><MkAcct :user="note.user"/></span>
|
||||||
<span v-if="note.user.isAdmin" class="admin"><i class="fas fa-bookmark"></i></span>
|
|
||||||
<span v-if="!note.user.isAdmin && note.user.isModerator" class="moderator"><i class="far fa-bookmark"></i></span>
|
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<MkA class="created-at" :to="notePage(note)">
|
<MkA class="created-at" :to="notePage(note)">
|
||||||
<MkTime :time="note.createdAt"/>
|
<MkTime :time="note.createdAt"/>
|
||||||
|
@ -23,7 +21,7 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import notePage from '@/filters/note';
|
import { notePage } from '@/filters/note';
|
||||||
import { userPage } from '@/filters/user';
|
import { userPage } from '@/filters/user';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
|
|
||||||
|
@ -79,12 +77,6 @@ export default defineComponent({
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .admin,
|
|
||||||
> .moderator {
|
|
||||||
margin-right: 0.5em;
|
|
||||||
color: var(--badge);
|
|
||||||
}
|
|
||||||
|
|
||||||
> .username {
|
> .username {
|
||||||
margin: 0 .5em 0 0;
|
margin: 0 .5em 0 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
Loading…
Reference in a new issue