Compare commits
25 Commits
10.102.4
...
11.0.0-alp
Author | SHA1 | Date | |
---|---|---|---|
ec73e2d237 | |||
c32b020535 | |||
c4441804e2 | |||
6c9d80d4e8 | |||
a231f8d26c | |||
08da258b63 | |||
5994926440 | |||
30f2da4215 | |||
1a2229f886 | |||
1e166490d9 | |||
1c57e6f80a | |||
a6537a8748 | |||
842b75977b | |||
9b3dccf60c | |||
2d533e0cd8 | |||
9e1925c808 | |||
142d59be85 | |||
d9a5e06b5b | |||
b6889e9ac6 | |||
dc82203e9b | |||
6a30d32e7d | |||
d9780606b3 | |||
fffa32df48 | |||
cad49892d3 | |||
f0a29721c9 |
5
.config/docker_example.env
Normal file
5
.config/docker_example.env
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# db settings
|
||||||
|
POSTGRES_PASSWORD="example-misskey-pass"
|
||||||
|
POSTGRES_USER="example-misskey-user"
|
||||||
|
POSTGRES_DB="misskey"
|
||||||
|
|
@ -1,8 +1,16 @@
|
|||||||
|
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
# Misskey configuration
|
||||||
|
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
|
||||||
|
# ┌─────┐
|
||||||
|
#───┘ URL └─────────────────────────────────────────────────────
|
||||||
|
|
||||||
# Final accessible URL seen by a user.
|
# Final accessible URL seen by a user.
|
||||||
url: https://example.tld/
|
url: https://example.tld/
|
||||||
|
|
||||||
|
# ┌───────────────────────┐
|
||||||
|
#───┘ Port and TLS settings └───────────────────────────────────
|
||||||
|
|
||||||
### Port and TLS settings ######################################
|
|
||||||
#
|
#
|
||||||
# Misskey supports two deployment options for public.
|
# Misskey supports two deployment options for public.
|
||||||
#
|
#
|
||||||
@ -30,28 +38,51 @@ url: https://example.tld/
|
|||||||
# You need to set Certificate in 'https' section.
|
# You need to set Certificate in 'https' section.
|
||||||
|
|
||||||
# To use option 1, uncomment below line.
|
# To use option 1, uncomment below line.
|
||||||
# port: 3000 # A port that your Misskey server should listen.
|
#port: 3000 # A port that your Misskey server should listen.
|
||||||
|
|
||||||
# To use option 2, uncomment below lines.
|
# To use option 2, uncomment below lines.
|
||||||
# port: 443
|
#port: 443
|
||||||
#
|
|
||||||
# https:
|
|
||||||
# # path for certification
|
|
||||||
# key: /etc/letsencrypt/live/example.tld/privkey.pem
|
|
||||||
# cert: /etc/letsencrypt/live/example.tld/fullchain.pem
|
|
||||||
|
|
||||||
################################################################
|
#https:
|
||||||
|
# # path for certification
|
||||||
|
# key: /etc/letsencrypt/live/example.tld/privkey.pem
|
||||||
|
# cert: /etc/letsencrypt/live/example.tld/fullchain.pem
|
||||||
|
|
||||||
|
# ┌──────────────────────────┐
|
||||||
|
#───┘ PostgreSQL configuration └────────────────────────────────
|
||||||
|
|
||||||
mongodb:
|
db:
|
||||||
host: localhost
|
host: localhost
|
||||||
port: 27017
|
port: 5432
|
||||||
|
|
||||||
|
# Database name
|
||||||
db: misskey
|
db: misskey
|
||||||
|
|
||||||
|
# Auth
|
||||||
user: example-misskey-user
|
user: example-misskey-user
|
||||||
pass: example-misskey-pass
|
pass: example-misskey-pass
|
||||||
|
|
||||||
|
# ┌─────────────────────┐
|
||||||
|
#───┘ Redis configuration └─────────────────────────────────────
|
||||||
|
|
||||||
|
#redis:
|
||||||
|
# host: localhost
|
||||||
|
# port: 6379
|
||||||
|
# pass: example-pass
|
||||||
|
|
||||||
|
# ┌─────────────────────────────┐
|
||||||
|
#───┘ Elasticsearch configuration └─────────────────────────────
|
||||||
|
|
||||||
|
#elasticsearch:
|
||||||
|
# host: localhost
|
||||||
|
# port: 9200
|
||||||
|
# pass: null
|
||||||
|
|
||||||
|
# ┌────────────────────────────────────┐
|
||||||
|
#───┘ File storage (Drive) configuration └──────────────────────
|
||||||
|
|
||||||
drive:
|
drive:
|
||||||
storage: 'db'
|
storage: 'fs'
|
||||||
|
|
||||||
# OR
|
# OR
|
||||||
|
|
||||||
@ -88,26 +119,44 @@ drive:
|
|||||||
# accessKey: XXX
|
# accessKey: XXX
|
||||||
# secretKey: YYY
|
# secretKey: YYY
|
||||||
|
|
||||||
|
# ┌───────────────┐
|
||||||
|
#───┘ ID generation └───────────────────────────────────────────
|
||||||
|
|
||||||
|
# You can select the ID generation method.
|
||||||
|
# You don't usually need to change this setting, but you can
|
||||||
|
# change it according to your preferences.
|
||||||
|
|
||||||
|
# Available methods:
|
||||||
|
# aid1 ... Use AID for ID generation (with random 1 char)
|
||||||
|
# aid2 ... Use AID for ID generation (with random 2 chars)
|
||||||
|
# aid3 ... Use AID for ID generation (with random 3 chars)
|
||||||
|
# aid4 ... Use AID for ID generation (with random 4 chars)
|
||||||
|
# ulid ... Use ulid for ID generation
|
||||||
|
# objectid ... This is left for backward compatibility.
|
||||||
|
|
||||||
|
# AID(n) is the original ID generation method.
|
||||||
|
# The trailing n represents the number of random characters that
|
||||||
|
# will be suffixed.
|
||||||
|
# The larger n is the safer. If n is small, the possibility of
|
||||||
|
# collision at the same time increases, but there are also
|
||||||
|
# advantages such as shortening of the URL.
|
||||||
|
|
||||||
|
# ULID: Universally Unique Lexicographically Sortable Identifier.
|
||||||
|
# for more details: https://github.com/ulid/spec
|
||||||
|
# * Normally, AID should be sufficient.
|
||||||
|
|
||||||
|
# ObjectID is the method used in previous versions of Misskey.
|
||||||
|
# * Choose this if you are migrating from a previous Misskey.
|
||||||
|
|
||||||
|
id: 'aid2'
|
||||||
|
|
||||||
|
# ┌─────────────────────┐
|
||||||
|
#───┘ Other configuration └─────────────────────────────────────
|
||||||
|
|
||||||
# If enabled:
|
# If enabled:
|
||||||
# The first account created is automatically marked as Admin.
|
# The first account created is automatically marked as Admin.
|
||||||
autoAdmin: true
|
autoAdmin: true
|
||||||
|
|
||||||
#
|
|
||||||
# Below settings are optional
|
|
||||||
#
|
|
||||||
|
|
||||||
# Redis
|
|
||||||
#redis:
|
|
||||||
# host: localhost
|
|
||||||
# port: 6379
|
|
||||||
# pass: example-pass
|
|
||||||
|
|
||||||
# Elasticsearch
|
|
||||||
#elasticsearch:
|
|
||||||
# host: localhost
|
|
||||||
# port: 9200
|
|
||||||
# pass: null
|
|
||||||
|
|
||||||
# Whether disable HSTS
|
# Whether disable HSTS
|
||||||
#disableHsts: true
|
#disableHsts: true
|
||||||
|
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
var user = {
|
|
||||||
user: 'example-misskey-user',
|
|
||||||
pwd: 'example-misskey-pass',
|
|
||||||
roles: [
|
|
||||||
{
|
|
||||||
role: 'readWrite',
|
|
||||||
db: 'misskey'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
db.createUser(user);
|
|
||||||
|
|
6
.dockerignore
Executable file → Normal file
6
.dockerignore
Executable file → Normal file
@ -5,8 +5,8 @@
|
|||||||
.vscode
|
.vscode
|
||||||
Dockerfile
|
Dockerfile
|
||||||
build/
|
build/
|
||||||
|
db/
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
node_modules/
|
|
||||||
mongo/
|
|
||||||
redis/
|
|
||||||
elasticsearch/
|
elasticsearch/
|
||||||
|
node_modules/
|
||||||
|
redis/
|
||||||
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -8,14 +8,15 @@
|
|||||||
built
|
built
|
||||||
/data
|
/data
|
||||||
/.cache-loader
|
/.cache-loader
|
||||||
|
/db
|
||||||
|
/elasticsearch
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
*.pem
|
*.pem
|
||||||
run.bat
|
run.bat
|
||||||
api-docs.json
|
api-docs.json
|
||||||
*.log
|
*.log
|
||||||
/redis
|
/redis
|
||||||
/mongo
|
|
||||||
/elasticsearch
|
|
||||||
*.code-workspace
|
*.code-workspace
|
||||||
yarn.lock
|
yarn.lock
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
/files
|
||||||
|
@ -5,6 +5,15 @@ If you encounter any problems with updating, please try the following:
|
|||||||
1. `npm run clean` or `npm run cleanall`
|
1. `npm run clean` or `npm run cleanall`
|
||||||
2. Retry update (Don't forget `npm i`)
|
2. Retry update (Don't forget `npm i`)
|
||||||
|
|
||||||
|
11.0.0
|
||||||
|
----------
|
||||||
|
* データベースがMongoDBからPostgreSQLに変更されました
|
||||||
|
|
||||||
|
### APIの破壊的変更
|
||||||
|
* v10時点で deprecated だったパラメータなどを削除
|
||||||
|
* notes/hybrid-timeline が notes/social-timeline にリネーム
|
||||||
|
* ストリームの hybridTimeline チャンネルが socialTimeline にリネーム
|
||||||
|
|
||||||
10.99.0
|
10.99.0
|
||||||
----------
|
----------
|
||||||
* manifest.json にインスタンス名を反映させるように
|
* manifest.json にインスタンス名を反映させるように
|
||||||
|
@ -75,3 +75,61 @@ src ... Source code
|
|||||||
test ... Test code
|
test ... Test code
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
### placeholder
|
||||||
|
SQLをクエリビルダで組み立てる際、使用するプレースホルダは重複してはならない
|
||||||
|
例えば
|
||||||
|
``` ts
|
||||||
|
query.andWhere(new Brackets(qb => {
|
||||||
|
for (const type of ps.fileType) {
|
||||||
|
qb.orWhere(`:type = ANY(note.attachedFileTypes)`, { type: type });
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
```
|
||||||
|
と書くと、ループ中で`type`というプレースホルダが複数回使われてしまいおかしくなる
|
||||||
|
だから次のようにする必要がある
|
||||||
|
```ts
|
||||||
|
query.andWhere(new Brackets(qb => {
|
||||||
|
for (const type of ps.fileType) {
|
||||||
|
const i = ps.fileType.indexOf(type);
|
||||||
|
qb.orWhere(`:type${i} = ANY(note.attachedFileTypes)`, { [`type${i}`]: type });
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
```
|
||||||
|
|
||||||
|
### `null` in SQL
|
||||||
|
SQLを発行する際、パラメータが`null`になる可能性のある場合はSQL文を出し分けなければならない
|
||||||
|
例えば
|
||||||
|
``` ts
|
||||||
|
query.where('file.folderId = :folderId', { folderId: ps.folderId });
|
||||||
|
```
|
||||||
|
という処理で、`ps.folderId`が`null`だと結果的に`file.folderId = null`のようなクエリが発行されてしまい、これは正しいSQLではないので期待した結果が得られない
|
||||||
|
だから次のようにする必要がある
|
||||||
|
``` ts
|
||||||
|
if (ps.folderId) {
|
||||||
|
query.where('file.folderId = :folderId', { folderId: ps.folderId });
|
||||||
|
} else {
|
||||||
|
query.where('file.folderId IS NULL');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `[]` in SQL
|
||||||
|
SQLを発行する際、`IN`のパラメータが`[]`(空の配列)になる可能性のある場合はSQL文を出し分けなければならない
|
||||||
|
例えば
|
||||||
|
``` ts
|
||||||
|
const users = await Users.find({
|
||||||
|
id: In(userIds)
|
||||||
|
});
|
||||||
|
```
|
||||||
|
という処理で、`userIds`が`[]`だと結果的に`user.id IN ()`のようなクエリが発行されてしまい、これは正しいSQLではないので期待した結果が得られない
|
||||||
|
だから次のようにする必要がある
|
||||||
|
``` ts
|
||||||
|
const users = userIds.length > 0 ? await Users.find({
|
||||||
|
id: In(userIds)
|
||||||
|
}) : [];
|
||||||
|
```
|
||||||
|
|
||||||
|
### `undefined`にご用心
|
||||||
|
MongoDBの時とは違い、findOneでレコードを取得する時に対象レコードが存在しない場合 **`undefined`** が返ってくるので注意。
|
||||||
|
MongoDBは`null`で返してきてたので、その感覚で`if (x === null)`とか書くとバグる。代わりに`if (x == null)`と書いてください
|
||||||
|
@ -23,8 +23,9 @@ RUN apk add --no-cache \
|
|||||||
zlib-dev
|
zlib-dev
|
||||||
RUN npm i -g yarn
|
RUN npm i -g yarn
|
||||||
|
|
||||||
COPY . ./
|
COPY package.json ./
|
||||||
RUN yarn install
|
RUN yarn install
|
||||||
|
COPY . ./
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<a href="https://ai.misskey.xyz/"><img src="https://github.com/syuilo/misskey/blob/develop/assets/ai-orig.png?raw=true" align="right" height="320px"/></a>
|
<a href="https://xn--931a.moe/"><img src="https://github.com/syuilo/misskey/blob/develop/assets/ai-orig.png?raw=true" align="right" height="320px"/></a>
|
||||||
|
|
||||||
[](https://misskey.xyz/)
|
[](https://misskey.xyz/)
|
||||||
================================================================
|
================================================================
|
||||||
@ -102,7 +102,7 @@ Please see the [Contribution Guide](./CONTRIBUTING.md).
|
|||||||
<!-- PATREON_START -->
|
<!-- PATREON_START -->
|
||||||
<table><tr>
|
<table><tr>
|
||||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/5888816/36da0f7c15954df0ab13f9abdf227f66/1?token-time=2145916800&token-hash=HGkZJ7s4bSaQVoOJ5q30mTWHTxDLiw1LuyaogKPLy24%3D" alt="Hiroshi Seki" width="100"></td>
|
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/5888816/36da0f7c15954df0ab13f9abdf227f66/1?token-time=2145916800&token-hash=HGkZJ7s4bSaQVoOJ5q30mTWHTxDLiw1LuyaogKPLy24%3D" alt="Hiroshi Seki" width="100"></td>
|
||||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12190916/fb7fa7983c14425f890369535b1506a4/1?token-time=2145916800&token-hash=WeuDzzz24cRXJogyIkU-mxARqkdyms-rcZKbO-GpGjw%3D" alt="weep" width="100"></td>
|
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12190916/fb7fa7983c14425f890369535b1506a4/3?token-time=2145916800&token-hash=gr7DF8BuwflHvNoP24He4aa-5j8_KycrAQe3fHwQIUE%3D" alt="weep" width="100"></td>
|
||||||
<td><img src="https://c8.patreon.com/2/200/12059069" alt="naga_rus" width="100"></td>
|
<td><img src="https://c8.patreon.com/2/200/12059069" alt="naga_rus" width="100"></td>
|
||||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12913507/f7181eacafe8469a93033d85f5969c29/4?token-time=2145916800&token-hash=vZdDTTF-ahiKBjjgppS2ev4rkD8H7TTKkXXoxsucs6Y%3D" alt="Melilot" width="100"></td>
|
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12913507/f7181eacafe8469a93033d85f5969c29/4?token-time=2145916800&token-hash=vZdDTTF-ahiKBjjgppS2ev4rkD8H7TTKkXXoxsucs6Y%3D" alt="Melilot" width="100"></td>
|
||||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/5670915/ee175f0bfb6347ffa4ea101a8c097bff/1?token-time=2145916800&token-hash=ubqJzjhBQUo8Nw6h_8jMDlJ5ocIO46EflpiRkp2jIw4%3D" alt="osapon" width="100"></td>
|
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/5670915/ee175f0bfb6347ffa4ea101a8c097bff/1?token-time=2145916800&token-hash=ubqJzjhBQUo8Nw6h_8jMDlJ5ocIO46EflpiRkp2jIw4%3D" alt="osapon" width="100"></td>
|
||||||
@ -158,7 +158,7 @@ Please see the [Contribution Guide](./CONTRIBUTING.md).
|
|||||||
<td><a href="https://www.patreon.com/user?u=12531784">Takashi Shibuya</a></td>
|
<td><a href="https://www.patreon.com/user?u=12531784">Takashi Shibuya</a></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
|
|
||||||
**Last updated:** Sat, 06 Apr 2019 03:35:05 UTC
|
**Last updated:** Sun, 07 Apr 2019 19:21:08 UTC
|
||||||
<!-- PATREON_END -->
|
<!-- PATREON_END -->
|
||||||
|
|
||||||
:four_leaf_clover: Copyright
|
:four_leaf_clover: Copyright
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
'targets': [
|
|
||||||
{
|
|
||||||
'target_name': 'crypto_key',
|
|
||||||
'sources': ['src/crypto_key.cc'],
|
|
||||||
'include_dirs': ['<!(node -e "require(\'nan\')")']
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
// for Node.js interpret
|
|
||||||
|
|
||||||
const chalk = require('chalk');
|
|
||||||
const sequential = require('promise-sequential');
|
|
||||||
|
|
||||||
const { default: User } = require('../../built/models/user');
|
|
||||||
const { default: DriveFile } = require('../../built/models/drive-file');
|
|
||||||
|
|
||||||
async function main() {
|
|
||||||
const promiseGens = [];
|
|
||||||
|
|
||||||
const count = await DriveFile.count({});
|
|
||||||
|
|
||||||
let prev;
|
|
||||||
|
|
||||||
for (let i = 0; i < count; i++) {
|
|
||||||
promiseGens.push(() => {
|
|
||||||
const promise = new Promise(async (res, rej) => {
|
|
||||||
const file = await DriveFile.findOne(prev ? {
|
|
||||||
_id: { $gt: prev._id }
|
|
||||||
} : {}, {
|
|
||||||
sort: {
|
|
||||||
_id: 1
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
prev = file;
|
|
||||||
|
|
||||||
const user = await User.findOne({ _id: file.metadata.userId });
|
|
||||||
|
|
||||||
DriveFile.update({
|
|
||||||
_id: file._id
|
|
||||||
}, {
|
|
||||||
$set: {
|
|
||||||
'metadata._user': {
|
|
||||||
host: user.host
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).then(() => {
|
|
||||||
res([i, file]);
|
|
||||||
}).catch(rej);
|
|
||||||
});
|
|
||||||
|
|
||||||
promise.then(([i, file]) => {
|
|
||||||
console.log(chalk`{gray ${i}} {green done: {bold ${file._id}} ${file.filename}}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
return promise;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return await sequential(promiseGens);
|
|
||||||
}
|
|
||||||
|
|
||||||
main().then(() => {
|
|
||||||
console.log('ALL DONE');
|
|
||||||
}).catch(console.error);
|
|
@ -1,71 +0,0 @@
|
|||||||
// for Node.js interpret
|
|
||||||
|
|
||||||
const chalk = require('chalk');
|
|
||||||
const sequential = require('promise-sequential');
|
|
||||||
|
|
||||||
const { default: User } = require('../../built/models/user');
|
|
||||||
const { default: DriveFile } = require('../../built/models/drive-file');
|
|
||||||
|
|
||||||
async function main() {
|
|
||||||
const promiseGens = [];
|
|
||||||
|
|
||||||
const count = await User.count({});
|
|
||||||
|
|
||||||
let prev;
|
|
||||||
|
|
||||||
for (let i = 0; i < count; i++) {
|
|
||||||
promiseGens.push(() => {
|
|
||||||
const promise = new Promise(async (res, rej) => {
|
|
||||||
const user = await User.findOne(prev ? {
|
|
||||||
_id: { $gt: prev._id }
|
|
||||||
} : {}, {
|
|
||||||
sort: {
|
|
||||||
_id: 1
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
prev = user;
|
|
||||||
|
|
||||||
const set = {};
|
|
||||||
|
|
||||||
if (user.avatarId != null) {
|
|
||||||
const file = await DriveFile.findOne({ _id: user.avatarId });
|
|
||||||
|
|
||||||
if (file && file.metadata.properties.avgColor) {
|
|
||||||
set.avatarColor = file.metadata.properties.avgColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user.bannerId != null) {
|
|
||||||
const file = await DriveFile.findOne({ _id: user.bannerId });
|
|
||||||
|
|
||||||
if (file && file.metadata.properties.avgColor) {
|
|
||||||
set.bannerColor = file.metadata.properties.avgColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Object.keys(set).length === 0) return res([i, user]);
|
|
||||||
|
|
||||||
User.update({
|
|
||||||
_id: user._id
|
|
||||||
}, {
|
|
||||||
$set: set
|
|
||||||
}).then(() => {
|
|
||||||
res([i, user]);
|
|
||||||
}).catch(rej);
|
|
||||||
});
|
|
||||||
|
|
||||||
promise.then(([i, user]) => {
|
|
||||||
console.log(chalk`{gray ${i}} {green done: {bold ${user._id}} @${user.username}}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
return promise;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return await sequential(promiseGens);
|
|
||||||
}
|
|
||||||
|
|
||||||
main().then(() => {
|
|
||||||
console.log('ALL DONE');
|
|
||||||
}).catch(console.error);
|
|
@ -1,9 +0,0 @@
|
|||||||
const { default: DriveFile } = require('../../built/models/drive-file');
|
|
||||||
|
|
||||||
DriveFile.update({}, {
|
|
||||||
$rename: {
|
|
||||||
'metadata.isMetaOnly': 'metadata.withoutChunks'
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
multi: true
|
|
||||||
});
|
|
@ -1,134 +0,0 @@
|
|||||||
const { default: Stats } = require('../../built/models/stats');
|
|
||||||
const { default: User } = require('../../built/models/user');
|
|
||||||
const { default: Note } = require('../../built/models/note');
|
|
||||||
const { default: DriveFile } = require('../../built/models/drive-file');
|
|
||||||
|
|
||||||
const now = new Date();
|
|
||||||
const y = now.getFullYear();
|
|
||||||
const m = now.getMonth();
|
|
||||||
const d = now.getDate();
|
|
||||||
const today = new Date(y, m, d);
|
|
||||||
|
|
||||||
async function main() {
|
|
||||||
const localUsersCount = await User.count({
|
|
||||||
host: null
|
|
||||||
});
|
|
||||||
|
|
||||||
const remoteUsersCount = await User.count({
|
|
||||||
host: { $ne: null }
|
|
||||||
});
|
|
||||||
|
|
||||||
const localNotesCount = await Note.count({
|
|
||||||
'_user.host': null
|
|
||||||
});
|
|
||||||
|
|
||||||
const remoteNotesCount = await Note.count({
|
|
||||||
'_user.host': { $ne: null }
|
|
||||||
});
|
|
||||||
|
|
||||||
const localDriveFilesCount = await DriveFile.count({
|
|
||||||
'metadata._user.host': null
|
|
||||||
});
|
|
||||||
|
|
||||||
const remoteDriveFilesCount = await DriveFile.count({
|
|
||||||
'metadata._user.host': { $ne: null }
|
|
||||||
});
|
|
||||||
|
|
||||||
const localDriveFilesSize = await DriveFile
|
|
||||||
.aggregate([{
|
|
||||||
$match: {
|
|
||||||
'metadata._user.host': null,
|
|
||||||
'metadata.deletedAt': { $exists: false }
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
$project: {
|
|
||||||
length: true
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
$group: {
|
|
||||||
_id: null,
|
|
||||||
usage: { $sum: '$length' }
|
|
||||||
}
|
|
||||||
}])
|
|
||||||
.then(aggregates => {
|
|
||||||
if (aggregates.length > 0) {
|
|
||||||
return aggregates[0].usage;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
const remoteDriveFilesSize = await DriveFile
|
|
||||||
.aggregate([{
|
|
||||||
$match: {
|
|
||||||
'metadata._user.host': { $ne: null },
|
|
||||||
'metadata.deletedAt': { $exists: false }
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
$project: {
|
|
||||||
length: true
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
$group: {
|
|
||||||
_id: null,
|
|
||||||
usage: { $sum: '$length' }
|
|
||||||
}
|
|
||||||
}])
|
|
||||||
.then(aggregates => {
|
|
||||||
if (aggregates.length > 0) {
|
|
||||||
return aggregates[0].usage;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
await Stats.insert({
|
|
||||||
date: today,
|
|
||||||
users: {
|
|
||||||
local: {
|
|
||||||
total: localUsersCount,
|
|
||||||
diff: 0
|
|
||||||
},
|
|
||||||
remote: {
|
|
||||||
total: remoteUsersCount,
|
|
||||||
diff: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
notes: {
|
|
||||||
local: {
|
|
||||||
total: localNotesCount,
|
|
||||||
diff: 0,
|
|
||||||
diffs: {
|
|
||||||
normal: 0,
|
|
||||||
reply: 0,
|
|
||||||
renote: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
remote: {
|
|
||||||
total: remoteNotesCount,
|
|
||||||
diff: 0,
|
|
||||||
diffs: {
|
|
||||||
normal: 0,
|
|
||||||
reply: 0,
|
|
||||||
renote: 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
drive: {
|
|
||||||
local: {
|
|
||||||
totalCount: localDriveFilesCount,
|
|
||||||
totalSize: localDriveFilesSize,
|
|
||||||
diffCount: 0,
|
|
||||||
diffSize: 0
|
|
||||||
},
|
|
||||||
remote: {
|
|
||||||
totalCount: remoteDriveFilesCount,
|
|
||||||
totalSize: remoteDriveFilesSize,
|
|
||||||
diffCount: 0,
|
|
||||||
diffSize: 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('done');
|
|
||||||
}
|
|
||||||
|
|
||||||
main();
|
|
@ -1,144 +0,0 @@
|
|||||||
const { default: Stats } = require('../../built/models/stats');
|
|
||||||
const { default: User } = require('../../built/models/user');
|
|
||||||
const { default: Note } = require('../../built/models/note');
|
|
||||||
const { default: DriveFile } = require('../../built/models/drive-file');
|
|
||||||
|
|
||||||
const now = new Date();
|
|
||||||
const y = now.getFullYear();
|
|
||||||
const m = now.getMonth();
|
|
||||||
const d = now.getDate();
|
|
||||||
const h = now.getHours();
|
|
||||||
const date = new Date(y, m, d, h);
|
|
||||||
|
|
||||||
async function main() {
|
|
||||||
await Stats.update({}, {
|
|
||||||
$set: {
|
|
||||||
span: 'day'
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
multi: true
|
|
||||||
});
|
|
||||||
|
|
||||||
const localUsersCount = await User.count({
|
|
||||||
host: null
|
|
||||||
});
|
|
||||||
|
|
||||||
const remoteUsersCount = await User.count({
|
|
||||||
host: { $ne: null }
|
|
||||||
});
|
|
||||||
|
|
||||||
const localNotesCount = await Note.count({
|
|
||||||
'_user.host': null
|
|
||||||
});
|
|
||||||
|
|
||||||
const remoteNotesCount = await Note.count({
|
|
||||||
'_user.host': { $ne: null }
|
|
||||||
});
|
|
||||||
|
|
||||||
const localDriveFilesCount = await DriveFile.count({
|
|
||||||
'metadata._user.host': null
|
|
||||||
});
|
|
||||||
|
|
||||||
const remoteDriveFilesCount = await DriveFile.count({
|
|
||||||
'metadata._user.host': { $ne: null }
|
|
||||||
});
|
|
||||||
|
|
||||||
const localDriveFilesSize = await DriveFile
|
|
||||||
.aggregate([{
|
|
||||||
$match: {
|
|
||||||
'metadata._user.host': null,
|
|
||||||
'metadata.deletedAt': { $exists: false }
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
$project: {
|
|
||||||
length: true
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
$group: {
|
|
||||||
_id: null,
|
|
||||||
usage: { $sum: '$length' }
|
|
||||||
}
|
|
||||||
}])
|
|
||||||
.then(aggregates => {
|
|
||||||
if (aggregates.length > 0) {
|
|
||||||
return aggregates[0].usage;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
const remoteDriveFilesSize = await DriveFile
|
|
||||||
.aggregate([{
|
|
||||||
$match: {
|
|
||||||
'metadata._user.host': { $ne: null },
|
|
||||||
'metadata.deletedAt': { $exists: false }
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
$project: {
|
|
||||||
length: true
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
$group: {
|
|
||||||
_id: null,
|
|
||||||
usage: { $sum: '$length' }
|
|
||||||
}
|
|
||||||
}])
|
|
||||||
.then(aggregates => {
|
|
||||||
if (aggregates.length > 0) {
|
|
||||||
return aggregates[0].usage;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
await Stats.insert({
|
|
||||||
date: date,
|
|
||||||
span: 'hour',
|
|
||||||
users: {
|
|
||||||
local: {
|
|
||||||
total: localUsersCount,
|
|
||||||
diff: 0
|
|
||||||
},
|
|
||||||
remote: {
|
|
||||||
total: remoteUsersCount,
|
|
||||||
diff: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
notes: {
|
|
||||||
local: {
|
|
||||||
total: localNotesCount,
|
|
||||||
diff: 0,
|
|
||||||
diffs: {
|
|
||||||
normal: 0,
|
|
||||||
reply: 0,
|
|
||||||
renote: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
remote: {
|
|
||||||
total: remoteNotesCount,
|
|
||||||
diff: 0,
|
|
||||||
diffs: {
|
|
||||||
normal: 0,
|
|
||||||
reply: 0,
|
|
||||||
renote: 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
drive: {
|
|
||||||
local: {
|
|
||||||
totalCount: localDriveFilesCount,
|
|
||||||
totalSize: localDriveFilesSize,
|
|
||||||
diffCount: 0,
|
|
||||||
diffSize: 0
|
|
||||||
},
|
|
||||||
remote: {
|
|
||||||
totalCount: remoteDriveFilesCount,
|
|
||||||
totalSize: remoteDriveFilesSize,
|
|
||||||
diffCount: 0,
|
|
||||||
diffSize: 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('done');
|
|
||||||
}
|
|
||||||
|
|
||||||
main();
|
|
@ -5,7 +5,7 @@ services:
|
|||||||
build: .
|
build: .
|
||||||
restart: always
|
restart: always
|
||||||
links:
|
links:
|
||||||
- mongo
|
- db
|
||||||
# - redis
|
# - redis
|
||||||
# - es
|
# - es
|
||||||
ports:
|
ports:
|
||||||
@ -19,21 +19,18 @@ services:
|
|||||||
# image: redis:4.0-alpine
|
# image: redis:4.0-alpine
|
||||||
# networks:
|
# networks:
|
||||||
# - internal_network
|
# - internal_network
|
||||||
### Uncomment to enable Redis persistance
|
# volumes:
|
||||||
## volumes:
|
# - ./redis:/data
|
||||||
## - ./redis:/data
|
|
||||||
|
|
||||||
mongo:
|
db:
|
||||||
restart: always
|
restart: always
|
||||||
image: mongo:4.1
|
image: postgres:11.2-alpine
|
||||||
networks:
|
networks:
|
||||||
- internal_network
|
- internal_network
|
||||||
environment:
|
env_file:
|
||||||
MONGO_INITDB_DATABASE: "misskey"
|
- .config/docker.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./.config/mongo_initdb.js:/docker-entrypoint-initdb.d/mongo_initdb.js:ro
|
- ./db:/var/lib/postgresql/data
|
||||||
### Uncomment to enable MongoDB persistance
|
|
||||||
# - ./mongo:/data
|
|
||||||
|
|
||||||
# es:
|
# es:
|
||||||
# restart: always
|
# restart: always
|
||||||
@ -42,9 +39,8 @@ services:
|
|||||||
# - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
|
# - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
|
||||||
# networks:
|
# networks:
|
||||||
# - internal_network
|
# - internal_network
|
||||||
#### Uncomment to enable ES persistence
|
# volumes:
|
||||||
## volumes:
|
# - ./elasticsearch:/usr/share/elasticsearch/data
|
||||||
## - ./elasticsearch:/usr/share/elasticsearch/data
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
internal_network:
|
internal_network:
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
Comment faire une sauvegarde de votre Misskey ?
|
|
||||||
==========================
|
|
||||||
|
|
||||||
Assurez-vous d'avoir installé **mongodb-tools**.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Dans votre terminal :
|
|
||||||
``` shell
|
|
||||||
$ mongodump --archive=db-backup -u <VotreNomdUtilisateur> -p <VotreMotDePasse>
|
|
||||||
```
|
|
||||||
|
|
||||||
Pour plus de détails, merci de consulter [la documentation de mongodump](https://docs.mongodb.com/manual/reference/program/mongodump/).
|
|
||||||
|
|
||||||
Restauration
|
|
||||||
-------
|
|
||||||
|
|
||||||
``` shell
|
|
||||||
$ mongorestore --archive=db-backup
|
|
||||||
```
|
|
||||||
|
|
||||||
Pour plus de détails, merci de consulter [la documentation de mongorestore](https://docs.mongodb.com/manual/reference/program/mongorestore/).
|
|
@ -1,22 +0,0 @@
|
|||||||
How to backup your Misskey
|
|
||||||
==========================
|
|
||||||
|
|
||||||
Make sure **mongodb-tools** installed.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
In your shell:
|
|
||||||
``` shell
|
|
||||||
$ mongodump --archive=db-backup -u <YourUserName> -p <YourPassword>
|
|
||||||
```
|
|
||||||
|
|
||||||
For details, please see [mongodump docs](https://docs.mongodb.com/manual/reference/program/mongodump/).
|
|
||||||
|
|
||||||
Restore
|
|
||||||
-------
|
|
||||||
|
|
||||||
``` shell
|
|
||||||
$ mongorestore --archive=db-backup
|
|
||||||
```
|
|
||||||
|
|
||||||
For details, please see [mongorestore docs](https://docs.mongodb.com/manual/reference/program/mongorestore/).
|
|
@ -15,9 +15,37 @@ This guide describes how to install and setup Misskey with Docker.
|
|||||||
|
|
||||||
*2.* Configure Misskey
|
*2.* Configure Misskey
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
1. `cp .config/example.yml .config/default.yml` Copy the `.config/example.yml` and rename it to `default.yml`.
|
|
||||||
2. `cp .config/mongo_initdb_example.js .config/mongo_initdb.js` Copy the `.config/mongo_initdb_example.js` and rename it to `mongo_initdb.js`.
|
Create configuration files with following:
|
||||||
3. Edit `default.yml` and `mongo_initdb.js`.
|
|
||||||
|
```bash
|
||||||
|
cd .config
|
||||||
|
cp example.yml default.yml
|
||||||
|
cp docker_example.env docker.env
|
||||||
|
```
|
||||||
|
|
||||||
|
### `default.yml`
|
||||||
|
|
||||||
|
Edit this file the same as non-Docker environment.
|
||||||
|
However hostname of Postgresql, Redis and Elasticsearch are not `localhost`, they are set in `docker-compose.yml`.
|
||||||
|
The following is default hostname:
|
||||||
|
|
||||||
|
| Service | Hostname |
|
||||||
|
|---------------|----------|
|
||||||
|
| Postgresql | `db` |
|
||||||
|
| Redis | `redis` |
|
||||||
|
| Elasticsearch | `es` |
|
||||||
|
|
||||||
|
### `docker.env`
|
||||||
|
|
||||||
|
Configure Postgresql in this file.
|
||||||
|
The minimum required settings are:
|
||||||
|
|
||||||
|
| name | Description |
|
||||||
|
|---------------------|---------------|
|
||||||
|
| `POSTGRES_PASSWORD` | Password |
|
||||||
|
| `POSTGRES_USER` | Username |
|
||||||
|
| `POSTGRES_DB` | Database name |
|
||||||
|
|
||||||
*3.* Configure Docker
|
*3.* Configure Docker
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
@ -13,11 +13,39 @@ Dockerを使ったMisskey構築方法
|
|||||||
2. `cd misskey` misskeyディレクトリに移動
|
2. `cd misskey` misskeyディレクトリに移動
|
||||||
3. `git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)` [最新のリリース](https://github.com/syuilo/misskey/releases/latest)を確認
|
3. `git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)` [最新のリリース](https://github.com/syuilo/misskey/releases/latest)を確認
|
||||||
|
|
||||||
*2.* 設定ファイルを作成する
|
*2.* 設定ファイルの作成と編集
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
1. `cp .config/example.yml .config/default.yml` `.config/example.yml`をコピーし名前を`default.yml`にする
|
|
||||||
2. `cp .config/mongo_initdb_example.js .config/mongo_initdb.js` `.config/mongo_initdb_example.js`をコピーし名前を`mongo_initdb.js`にする
|
下記コマンドで設定ファイルを作成してください。
|
||||||
3. `default.yml`と`mongo_initdb.js`を編集する
|
|
||||||
|
```bash
|
||||||
|
cd .config
|
||||||
|
cp example.yml default.yml
|
||||||
|
cp docker_example.env docker.env
|
||||||
|
```
|
||||||
|
|
||||||
|
### `default.yml`の編集
|
||||||
|
|
||||||
|
非Docker環境と同じ様に編集してください。
|
||||||
|
ただし、Postgresql、RedisとElasticsearchのホストは`localhost`ではなく、`docker-compose.yml`で設定されたサービス名になっています。
|
||||||
|
標準設定では次の通りです。
|
||||||
|
|
||||||
|
| サービス | ホスト名 |
|
||||||
|
|---------------|---------|
|
||||||
|
| Postgresql |`db` |
|
||||||
|
| Redis |`redis` |
|
||||||
|
| Elasticsearch |`es` |
|
||||||
|
|
||||||
|
### `docker.env`の編集
|
||||||
|
|
||||||
|
このファイルはPostgresqlの設定を記述します。
|
||||||
|
最低限記述する必要がある設定は次の通りです。
|
||||||
|
|
||||||
|
| 設定 | 内容 |
|
||||||
|
|---------------------|--------------|
|
||||||
|
| `POSTGRES_PASSWORD` | パスワード |
|
||||||
|
| `POSTGRES_USER` | ユーザー名 |
|
||||||
|
| `POSTGRES_DB` | データベース名 |
|
||||||
|
|
||||||
*3.* Dockerの設定
|
*3.* Dockerの設定
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
@ -22,8 +22,8 @@ adduser --disabled-password --disabled-login misskey
|
|||||||
Please install and setup these softwares:
|
Please install and setup these softwares:
|
||||||
|
|
||||||
#### Dependencies :package:
|
#### Dependencies :package:
|
||||||
* **[Node.js](https://nodejs.org/en/)** >= 10.0.0
|
* **[Node.js](https://nodejs.org/en/)** >= 11.7.0
|
||||||
* **[MongoDB](https://www.mongodb.com/)** >= 3.6
|
* **[PostgreSQL](https://www.postgresql.org/)** >= 10
|
||||||
|
|
||||||
##### Optional
|
##### Optional
|
||||||
* [Redis](https://redis.io/)
|
* [Redis](https://redis.io/)
|
||||||
@ -31,13 +31,9 @@ Please install and setup these softwares:
|
|||||||
* [Elasticsearch](https://www.elastic.co/) - required to enable the search feature
|
* [Elasticsearch](https://www.elastic.co/) - required to enable the search feature
|
||||||
* [FFmpeg](https://www.ffmpeg.org/)
|
* [FFmpeg](https://www.ffmpeg.org/)
|
||||||
|
|
||||||
*3.* Setup MongoDB
|
*3.* Setup PostgreSQL
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
As root:
|
:)
|
||||||
1. `mongo` Go to the mongo shell
|
|
||||||
2. `use misskey` Use the misskey database
|
|
||||||
3. `db.createUser( { user: "misskey", pwd: "<password>", roles: [ { role: "readWrite", db: "misskey" } ] } )` Create the misskey user.
|
|
||||||
4. `exit` You're done!
|
|
||||||
|
|
||||||
*4.* Install Misskey
|
*4.* Install Misskey
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
@ -68,7 +64,13 @@ If you're still encountering errors about some modules, use node-gyp:
|
|||||||
3. `node-gyp build`
|
3. `node-gyp build`
|
||||||
4. `NODE_ENV=production npm run build`
|
4. `NODE_ENV=production npm run build`
|
||||||
|
|
||||||
*7.* That is it.
|
*7.* Init DB
|
||||||
|
----------------------------------------------------------------
|
||||||
|
``` shell
|
||||||
|
npm run init
|
||||||
|
```
|
||||||
|
|
||||||
|
*8.* That is it.
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
Well done! Now, you have an environment that run to Misskey.
|
Well done! Now, you have an environment that run to Misskey.
|
||||||
|
|
||||||
|
@ -22,8 +22,8 @@ adduser --disabled-password --disabled-login misskey
|
|||||||
Installez les paquets suivants :
|
Installez les paquets suivants :
|
||||||
|
|
||||||
#### Dépendences :package:
|
#### Dépendences :package:
|
||||||
* **[Node.js](https://nodejs.org/en/)** >= 10.0.0
|
* **[Node.js](https://nodejs.org/en/)** >= 11.7.0
|
||||||
* **[MongoDB](https://www.mongodb.com/)** >= 3.6
|
* **[PostgreSQL](https://www.postgresql.org/)** >= 10
|
||||||
|
|
||||||
##### Optionnels
|
##### Optionnels
|
||||||
* [Redis](https://redis.io/)
|
* [Redis](https://redis.io/)
|
||||||
@ -31,13 +31,9 @@ Installez les paquets suivants :
|
|||||||
* [Elasticsearch](https://www.elastic.co/) - requis pour pouvoir activer la fonctionnalité de recherche
|
* [Elasticsearch](https://www.elastic.co/) - requis pour pouvoir activer la fonctionnalité de recherche
|
||||||
* [FFmpeg](https://www.ffmpeg.org/)
|
* [FFmpeg](https://www.ffmpeg.org/)
|
||||||
|
|
||||||
*3.* Paramètrage de MongoDB
|
*3.* Paramètrage de PostgreSQL
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
En root :
|
:)
|
||||||
1. `mongo` Ouvrez le shell mongo
|
|
||||||
2. `use misskey` Utilisez la base de données misskey
|
|
||||||
3. `db.createUser( { user: "misskey", pwd: "<password>", roles: [ { role: "readWrite", db: "misskey" } ] } )` Créez l'utilisateur misskey.
|
|
||||||
4. `exit` Vous avez terminé !
|
|
||||||
|
|
||||||
*4.* Installation de Misskey
|
*4.* Installation de Misskey
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
@ -22,8 +22,8 @@ adduser --disabled-password --disabled-login misskey
|
|||||||
これらのソフトウェアをインストール・設定してください:
|
これらのソフトウェアをインストール・設定してください:
|
||||||
|
|
||||||
#### 依存関係 :package:
|
#### 依存関係 :package:
|
||||||
* **[Node.js](https://nodejs.org/en/)** (10.0.0以上)
|
* **[Node.js](https://nodejs.org/en/)** (11.7.0以上)
|
||||||
* **[MongoDB](https://www.mongodb.com/)** (3.6以上)
|
* **[PostgreSQL](https://www.postgresql.org/)** (10以上)
|
||||||
|
|
||||||
##### オプション
|
##### オプション
|
||||||
* [Redis](https://redis.io/)
|
* [Redis](https://redis.io/)
|
||||||
@ -38,13 +38,9 @@ adduser --disabled-password --disabled-login misskey
|
|||||||
* 検索機能を有効にするためにはインストールが必要です。
|
* 検索機能を有効にするためにはインストールが必要です。
|
||||||
* [FFmpeg](https://www.ffmpeg.org/)
|
* [FFmpeg](https://www.ffmpeg.org/)
|
||||||
|
|
||||||
*3.* MongoDBの設定
|
*3.* PostgreSQLの設定
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
ルートで:
|
:)
|
||||||
1. `mongo` mongoシェルを起動
|
|
||||||
2. `use misskey` misskeyデータベースを使用
|
|
||||||
3. `db.createUser( { user: "misskey", pwd: "<password>", roles: [ { role: "readWrite", db: "misskey" } ] } )` misskeyユーザーを作成
|
|
||||||
4. `exit` mongoシェルを終了
|
|
||||||
|
|
||||||
*4.* Misskeyのインストール
|
*4.* Misskeyのインストール
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
@ -74,7 +70,13 @@ Debianをお使いであれば、`build-essential`パッケージをインスト
|
|||||||
3. `node-gyp build`
|
3. `node-gyp build`
|
||||||
4. `NODE_ENV=production npm run build`
|
4. `NODE_ENV=production npm run build`
|
||||||
|
|
||||||
*7.* 以上です!
|
*7.* データベースを初期化
|
||||||
|
----------------------------------------------------------------
|
||||||
|
``` shell
|
||||||
|
npm run init
|
||||||
|
```
|
||||||
|
|
||||||
|
*8.* 以上です!
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
お疲れ様でした。これでMisskeyを動かす準備は整いました。
|
お疲れ様でした。これでMisskeyを動かす準備は整いました。
|
||||||
|
|
||||||
|
@ -49,7 +49,6 @@ gulp.task('build:copy:views', () =>
|
|||||||
|
|
||||||
gulp.task('build:copy', gulp.parallel('build:copy:views', () =>
|
gulp.task('build:copy', gulp.parallel('build:copy:views', () =>
|
||||||
gulp.src([
|
gulp.src([
|
||||||
'./build/Release/crypto_key.node',
|
|
||||||
'./src/const.json',
|
'./src/const.json',
|
||||||
'./src/server/web/views/**/*',
|
'./src/server/web/views/**/*',
|
||||||
'./src/**/assets/**/*',
|
'./src/**/assets/**/*',
|
||||||
|
@ -73,6 +73,12 @@ common:
|
|||||||
followers: "フォロワー"
|
followers: "フォロワー"
|
||||||
favorites: "お気に入り"
|
favorites: "お気に入り"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
'read:account': "アカウントの情報を見る"
|
||||||
|
'write:account': "アカウントの情報を変更する"
|
||||||
|
'read:drive': "ドライブを見る"
|
||||||
|
'write:drive': "ドライブを操作する"
|
||||||
|
|
||||||
empty-timeline-info:
|
empty-timeline-info:
|
||||||
follow-users-to-make-your-timeline: "ユーザーをフォローすると投稿がタイムラインに表示されます。"
|
follow-users-to-make-your-timeline: "ユーザーをフォローすると投稿がタイムラインに表示されます。"
|
||||||
explore: "ユーザーを探索する"
|
explore: "ユーザーを探索する"
|
||||||
@ -299,15 +305,6 @@ common:
|
|||||||
auth/views/form.vue:
|
auth/views/form.vue:
|
||||||
share-access: "<i>{name}</i>があなたのアカウントにアクセスすることを許可しますか?"
|
share-access: "<i>{name}</i>があなたのアカウントにアクセスすることを許可しますか?"
|
||||||
permission-ask: "このアプリは次の権限を要求しています:"
|
permission-ask: "このアプリは次の権限を要求しています:"
|
||||||
account-read: "アカウントの情報を見る。"
|
|
||||||
account-write: "アカウントの情報を操作する。"
|
|
||||||
note-write: "投稿する。"
|
|
||||||
like-write: "いいねしたりいいね解除する。"
|
|
||||||
following-write: "フォローしたりフォロー解除する。"
|
|
||||||
drive-read: "ドライブを見る。"
|
|
||||||
drive-write: "ドライブを操作する。"
|
|
||||||
notification-read: "通知を見る。"
|
|
||||||
notification-write: "通知を操作する。"
|
|
||||||
cancel: "キャンセル"
|
cancel: "キャンセル"
|
||||||
accept: "アクセスを許可"
|
accept: "アクセスを許可"
|
||||||
|
|
||||||
@ -1091,7 +1088,7 @@ desktop/views/components/taskmanager.vue:
|
|||||||
desktop/views/components/timeline.vue:
|
desktop/views/components/timeline.vue:
|
||||||
home: "ホーム"
|
home: "ホーム"
|
||||||
local: "ローカル"
|
local: "ローカル"
|
||||||
hybrid: "ソーシャル"
|
social: "ソーシャル"
|
||||||
global: "グローバル"
|
global: "グローバル"
|
||||||
mentions: "あなた宛て"
|
mentions: "あなた宛て"
|
||||||
messages: "ダイレクト投稿"
|
messages: "ダイレクト投稿"
|
||||||
@ -1238,11 +1235,6 @@ admin/views/instance.vue:
|
|||||||
save: "保存"
|
save: "保存"
|
||||||
saved: "保存しました"
|
saved: "保存しました"
|
||||||
user-recommendation-config: "おすすめユーザー"
|
user-recommendation-config: "おすすめユーザー"
|
||||||
enable-external-user-recommendation: "外部ユーザーレコメンデーションを有効にする"
|
|
||||||
external-user-recommendation-engine: "エンジン"
|
|
||||||
external-user-recommendation-engine-desc: "例: https://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-misskey-api.cgi?{{host}}+{{user}}+{{limit}}+{{offset}}"
|
|
||||||
external-user-recommendation-timeout: "タイムアウト"
|
|
||||||
external-user-recommendation-timeout-desc: "ミリ秒単位 (例: 300000)"
|
|
||||||
email-config: "メールサーバーの設定"
|
email-config: "メールサーバーの設定"
|
||||||
email-config-info: "メールアドレス確認やパスワードリセットの際に使われます。"
|
email-config-info: "メールアドレス確認やパスワードリセットの際に使われます。"
|
||||||
enable-email: "メール配信を有効にする"
|
enable-email: "メール配信を有効にする"
|
||||||
@ -1673,7 +1665,7 @@ mobile/views/pages/following.vue:
|
|||||||
mobile/views/pages/home.vue:
|
mobile/views/pages/home.vue:
|
||||||
home: "ホーム"
|
home: "ホーム"
|
||||||
local: "ローカル"
|
local: "ローカル"
|
||||||
hybrid: "ソーシャル"
|
social: "ソーシャル"
|
||||||
global: "グローバル"
|
global: "グローバル"
|
||||||
mentions: "あなた宛て"
|
mentions: "あなた宛て"
|
||||||
messages: "ダイレクト投稿"
|
messages: "ダイレクト投稿"
|
||||||
@ -1743,7 +1735,7 @@ deck:
|
|||||||
widgets: "ウィジェット"
|
widgets: "ウィジェット"
|
||||||
home: "ホーム"
|
home: "ホーム"
|
||||||
local: "ローカル"
|
local: "ローカル"
|
||||||
hybrid: "ソーシャル"
|
social: "ソーシャル"
|
||||||
hashtag: "ハッシュタグ"
|
hashtag: "ハッシュタグ"
|
||||||
global: "グローバル"
|
global: "グローバル"
|
||||||
mentions: "あなた宛て"
|
mentions: "あなた宛て"
|
||||||
@ -1823,12 +1815,3 @@ dev/views/new-app.vue:
|
|||||||
authority: "権限"
|
authority: "権限"
|
||||||
authority-desc: "ここで要求した機能だけがAPIからアクセスできます。"
|
authority-desc: "ここで要求した機能だけがAPIからアクセスできます。"
|
||||||
authority-warning: "アプリ作成後も変更できますが、新たな権限を付与する場合、その時点で関連付けられているユーザーキーはすべて無効になります。"
|
authority-warning: "アプリ作成後も変更できますが、新たな権限を付与する場合、その時点で関連付けられているユーザーキーはすべて無効になります。"
|
||||||
account-read: "アカウントの情報を見る。"
|
|
||||||
account-write: "アカウントの情報を操作する。"
|
|
||||||
note-write: "投稿する。"
|
|
||||||
reaction-write: "リアクションしたりリアクションをキャンセルする。"
|
|
||||||
following-write: "フォローしたりフォロー解除する。"
|
|
||||||
drive-read: "ドライブを見る。"
|
|
||||||
drive-write: "ドライブを操作する。"
|
|
||||||
notification-read: "通知を見る。"
|
|
||||||
notification-write: "通知を操作する。"
|
|
||||||
|
28
package.json
28
package.json
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"author": "syuilo <i@syuilo.com>",
|
"author": "syuilo <i@syuilo.com>",
|
||||||
"version": "10.99.0",
|
"version": "11.0.0-alpha.3",
|
||||||
"codename": "nighthike",
|
"codename": "daybreak",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/syuilo/misskey.git"
|
"url": "https://github.com/syuilo/misskey.git"
|
||||||
@ -11,6 +11,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node ./index.js",
|
"start": "node ./index.js",
|
||||||
|
"init": "node ./built/init.js",
|
||||||
"debug": "DEBUG=misskey:* node ./index.js",
|
"debug": "DEBUG=misskey:* node ./index.js",
|
||||||
"build": "webpack && gulp build",
|
"build": "webpack && gulp build",
|
||||||
"webpack": "webpack",
|
"webpack": "webpack",
|
||||||
@ -62,10 +63,9 @@
|
|||||||
"@types/koa-send": "4.1.1",
|
"@types/koa-send": "4.1.1",
|
||||||
"@types/koa-views": "2.0.3",
|
"@types/koa-views": "2.0.3",
|
||||||
"@types/koa__cors": "2.2.3",
|
"@types/koa__cors": "2.2.3",
|
||||||
|
"@types/lolex": "3.1.1",
|
||||||
"@types/minio": "7.0.1",
|
"@types/minio": "7.0.1",
|
||||||
"@types/mkdirp": "0.5.2",
|
"@types/mocha": "5.2.6",
|
||||||
"@types/mocha": "5.2.5",
|
|
||||||
"@types/mongodb": "3.1.20",
|
|
||||||
"@types/node": "11.10.4",
|
"@types/node": "11.10.4",
|
||||||
"@types/nodemailer": "4.6.6",
|
"@types/nodemailer": "4.6.6",
|
||||||
"@types/nprogress": "0.0.29",
|
"@types/nprogress": "0.0.29",
|
||||||
@ -107,6 +107,7 @@
|
|||||||
"chai": "4.2.0",
|
"chai": "4.2.0",
|
||||||
"chai-http": "4.2.1",
|
"chai-http": "4.2.1",
|
||||||
"chalk": "2.4.2",
|
"chalk": "2.4.2",
|
||||||
|
"cli-highlight": "2.1.0",
|
||||||
"commander": "2.20.0",
|
"commander": "2.20.0",
|
||||||
"content-disposition": "0.5.3",
|
"content-disposition": "0.5.3",
|
||||||
"crc-32": "1.2.0",
|
"crc-32": "1.2.0",
|
||||||
@ -114,12 +115,10 @@
|
|||||||
"cssnano": "4.1.10",
|
"cssnano": "4.1.10",
|
||||||
"dateformat": "3.0.3",
|
"dateformat": "3.0.3",
|
||||||
"deep-equal": "1.0.1",
|
"deep-equal": "1.0.1",
|
||||||
"deepcopy": "0.6.3",
|
|
||||||
"diskusage": "1.0.0",
|
"diskusage": "1.0.0",
|
||||||
"double-ended-queue": "2.1.0-0",
|
"double-ended-queue": "2.1.0-0",
|
||||||
"elasticsearch": "15.4.1",
|
"elasticsearch": "15.4.1",
|
||||||
"emojilib": "2.4.0",
|
"emojilib": "2.4.0",
|
||||||
"escape-regexp": "0.0.1",
|
|
||||||
"eslint": "5.15.1",
|
"eslint": "5.15.1",
|
||||||
"eslint-plugin-vue": "5.2.2",
|
"eslint-plugin-vue": "5.2.2",
|
||||||
"eventemitter3": "3.1.0",
|
"eventemitter3": "3.1.0",
|
||||||
@ -163,23 +162,22 @@
|
|||||||
"koa-views": "6.2.0",
|
"koa-views": "6.2.0",
|
||||||
"langmap": "0.0.16",
|
"langmap": "0.0.16",
|
||||||
"loader-utils": "1.2.3",
|
"loader-utils": "1.2.3",
|
||||||
|
"lolex": "3.1.0",
|
||||||
"lookup-dns-cache": "2.1.0",
|
"lookup-dns-cache": "2.1.0",
|
||||||
"minio": "7.0.5",
|
"minio": "7.0.5",
|
||||||
"mkdirp": "0.5.1",
|
"mocha": "6.0.2",
|
||||||
"mocha": "5.2.0",
|
|
||||||
"moji": "0.5.1",
|
"moji": "0.5.1",
|
||||||
"moment": "2.24.0",
|
"moment": "2.24.0",
|
||||||
"mongodb": "3.2.2",
|
|
||||||
"monk": "6.0.6",
|
|
||||||
"ms": "2.1.1",
|
"ms": "2.1.1",
|
||||||
"nan": "2.12.1",
|
|
||||||
"nested-property": "0.0.7",
|
"nested-property": "0.0.7",
|
||||||
|
"node-fetch": "2.3.0",
|
||||||
"nodemailer": "5.1.1",
|
"nodemailer": "5.1.1",
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
"object-assign-deep": "0.4.0",
|
"object-assign-deep": "0.4.0",
|
||||||
"os-utils": "0.0.14",
|
"os-utils": "0.0.14",
|
||||||
"parse5": "5.1.0",
|
"parse5": "5.1.0",
|
||||||
"parsimmon": "1.12.0",
|
"parsimmon": "1.12.0",
|
||||||
|
"pg": "7.9.0",
|
||||||
"portscanner": "2.2.0",
|
"portscanner": "2.2.0",
|
||||||
"postcss-loader": "3.0.0",
|
"postcss-loader": "3.0.0",
|
||||||
"prismjs": "1.16.0",
|
"prismjs": "1.16.0",
|
||||||
@ -195,10 +193,12 @@
|
|||||||
"recaptcha-promise": "0.1.3",
|
"recaptcha-promise": "0.1.3",
|
||||||
"reconnecting-websocket": "4.1.10",
|
"reconnecting-websocket": "4.1.10",
|
||||||
"redis": "2.8.0",
|
"redis": "2.8.0",
|
||||||
|
"reflect-metadata": "0.1.13",
|
||||||
"rename": "1.0.4",
|
"rename": "1.0.4",
|
||||||
"request": "2.88.0",
|
"request": "2.88.0",
|
||||||
"request-promise-native": "1.0.7",
|
"request-promise-native": "1.0.7",
|
||||||
"request-stats": "3.0.0",
|
"request-stats": "3.0.0",
|
||||||
|
"require-all": "3.0.0",
|
||||||
"rimraf": "2.6.3",
|
"rimraf": "2.6.3",
|
||||||
"rndstr": "1.0.0",
|
"rndstr": "1.0.0",
|
||||||
"s-age": "1.1.2",
|
"s-age": "1.1.2",
|
||||||
@ -219,12 +219,14 @@
|
|||||||
"tinycolor2": "1.4.1",
|
"tinycolor2": "1.4.1",
|
||||||
"tmp": "0.0.33",
|
"tmp": "0.0.33",
|
||||||
"ts-loader": "5.3.3",
|
"ts-loader": "5.3.3",
|
||||||
"ts-node": "8.0.3",
|
"ts-node": "7.0.1",
|
||||||
"tslint": "5.13.1",
|
"tslint": "5.13.1",
|
||||||
"tslint-sonarts": "1.9.0",
|
"tslint-sonarts": "1.9.0",
|
||||||
|
"typeorm": "0.2.16-rc.1",
|
||||||
"typescript": "3.3.3333",
|
"typescript": "3.3.3333",
|
||||||
"typescript-eslint-parser": "22.0.0",
|
"typescript-eslint-parser": "22.0.0",
|
||||||
"uglify-es": "3.3.9",
|
"uglify-es": "3.3.9",
|
||||||
|
"ulid": "2.3.0",
|
||||||
"url-loader": "1.1.2",
|
"url-loader": "1.1.2",
|
||||||
"uuid": "3.3.2",
|
"uuid": "3.3.2",
|
||||||
"v-animate-css": "0.0.3",
|
"v-animate-css": "0.0.3",
|
||||||
|
19
src/@types/deepcopy.d.ts
vendored
19
src/@types/deepcopy.d.ts
vendored
@ -1,19 +0,0 @@
|
|||||||
declare module 'deepcopy' {
|
|
||||||
type DeepcopyCustomizerValueType = 'Object';
|
|
||||||
|
|
||||||
type DeepcopyCustomizer<T> = (
|
|
||||||
value: T,
|
|
||||||
valueType: DeepcopyCustomizerValueType) => T;
|
|
||||||
|
|
||||||
interface IDeepcopyOptions<T> {
|
|
||||||
customizer: DeepcopyCustomizer<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
function deepcopy<T>(
|
|
||||||
value: T,
|
|
||||||
options?: IDeepcopyOptions<T> | DeepcopyCustomizer<T>): T;
|
|
||||||
|
|
||||||
namespace deepcopy {} // Hack
|
|
||||||
|
|
||||||
export = deepcopy;
|
|
||||||
}
|
|
7
src/@types/escape-regexp.d.ts
vendored
7
src/@types/escape-regexp.d.ts
vendored
@ -1,7 +0,0 @@
|
|||||||
declare module 'escape-regexp' {
|
|
||||||
function escapeRegExp(str: string): string;
|
|
||||||
|
|
||||||
namespace escapeRegExp {} // Hack
|
|
||||||
|
|
||||||
export = escapeRegExp;
|
|
||||||
}
|
|
@ -15,5 +15,8 @@ program
|
|||||||
.parse(process.argv);
|
.parse(process.argv);
|
||||||
|
|
||||||
if (process.env.MK_ONLY_QUEUE) program.onlyQueue = true;
|
if (process.env.MK_ONLY_QUEUE) program.onlyQueue = true;
|
||||||
|
if (process.env.NODE_ENV === 'test') program.disableClustering = true;
|
||||||
|
if (process.env.NODE_ENV === 'test') program.quiet = true;
|
||||||
|
if (process.env.NODE_ENV === 'test') program.noDaemons = true;
|
||||||
|
|
||||||
export { program };
|
export { program };
|
||||||
|
77
src/boot/index.ts
Normal file
77
src/boot/index.ts
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
import * as cluster from 'cluster';
|
||||||
|
import chalk from 'chalk';
|
||||||
|
import Xev from 'xev';
|
||||||
|
|
||||||
|
import Logger from '../services/logger';
|
||||||
|
import { program } from '../argv';
|
||||||
|
|
||||||
|
// for typeorm
|
||||||
|
import 'reflect-metadata';
|
||||||
|
import { masterMain } from './master';
|
||||||
|
import { workerMain } from './worker';
|
||||||
|
|
||||||
|
const logger = new Logger('core', 'cyan');
|
||||||
|
const clusterLogger = logger.createSubLogger('cluster', 'orange', false);
|
||||||
|
const ev = new Xev();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Init process
|
||||||
|
*/
|
||||||
|
export default async function() {
|
||||||
|
process.title = `Misskey (${cluster.isMaster ? 'master' : 'worker'})`;
|
||||||
|
|
||||||
|
if (cluster.isMaster || program.disableClustering) {
|
||||||
|
await masterMain();
|
||||||
|
|
||||||
|
if (cluster.isMaster) {
|
||||||
|
ev.mount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cluster.isWorker || program.disableClustering) {
|
||||||
|
await workerMain();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ユニットテスト時にMisskeyが子プロセスで起動された時のため
|
||||||
|
// それ以外のときは process.send は使えないので弾く
|
||||||
|
if (process.send) {
|
||||||
|
process.send('ok');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//#region Events
|
||||||
|
|
||||||
|
// Listen new workers
|
||||||
|
cluster.on('fork', worker => {
|
||||||
|
clusterLogger.debug(`Process forked: [${worker.id}]`);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Listen online workers
|
||||||
|
cluster.on('online', worker => {
|
||||||
|
clusterLogger.debug(`Process is now online: [${worker.id}]`);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Listen for dying workers
|
||||||
|
cluster.on('exit', worker => {
|
||||||
|
// Replace the dead worker,
|
||||||
|
// we're not sentimental
|
||||||
|
clusterLogger.error(chalk.red(`[${worker.id}] died :(`));
|
||||||
|
cluster.fork();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Display detail of unhandled promise rejection
|
||||||
|
if (!program.quiet) {
|
||||||
|
process.on('unhandledRejection', console.dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display detail of uncaught exception
|
||||||
|
process.on('uncaughtException', err => {
|
||||||
|
logger.error(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Dying away...
|
||||||
|
process.on('exit', code => {
|
||||||
|
logger.info(`The process is going to exit with code ${code}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
//#endregion
|
176
src/boot/master.ts
Normal file
176
src/boot/master.ts
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
import * as os from 'os';
|
||||||
|
import * as cluster from 'cluster';
|
||||||
|
import chalk from 'chalk';
|
||||||
|
import * as portscanner from 'portscanner';
|
||||||
|
import * as isRoot from 'is-root';
|
||||||
|
|
||||||
|
import Logger from '../services/logger';
|
||||||
|
import loadConfig from '../config/load';
|
||||||
|
import { Config } from '../config/types';
|
||||||
|
import { lessThan } from '../prelude/array';
|
||||||
|
import * as pkg from '../../package.json';
|
||||||
|
import { program } from '../argv';
|
||||||
|
import { showMachineInfo } from '../misc/show-machine-info';
|
||||||
|
import { initDb } from '../db/postgre';
|
||||||
|
|
||||||
|
const logger = new Logger('core', 'cyan');
|
||||||
|
const bootLogger = logger.createSubLogger('boot', 'magenta', false);
|
||||||
|
|
||||||
|
function greet() {
|
||||||
|
if (!program.quiet) {
|
||||||
|
//#region Misskey logo
|
||||||
|
const v = `v${pkg.version}`;
|
||||||
|
console.log(' _____ _ _ ');
|
||||||
|
console.log(' | |_|___ ___| |_ ___ _ _ ');
|
||||||
|
console.log(' | | | | |_ -|_ -| \'_| -_| | |');
|
||||||
|
console.log(' |_|_|_|_|___|___|_,_|___|_ |');
|
||||||
|
console.log(' ' + chalk.gray(v) + (' |___|\n'.substr(v.length)));
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
console.log(' Misskey is maintained by @syuilo, @AyaMorisawa, @mei23, and @acid-chicken.');
|
||||||
|
console.log(chalk.keyword('orange')(' If you like Misskey, please donate to support development. https://www.patreon.com/syuilo'));
|
||||||
|
|
||||||
|
console.log('');
|
||||||
|
console.log(chalk`< ${os.hostname()} {gray (PID: ${process.pid.toString()})} >`);
|
||||||
|
}
|
||||||
|
|
||||||
|
bootLogger.info('Welcome to Misskey!');
|
||||||
|
bootLogger.info(`Misskey v${pkg.version}`, null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Init master process
|
||||||
|
*/
|
||||||
|
export async function masterMain() {
|
||||||
|
greet();
|
||||||
|
|
||||||
|
let config: Config;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// initialize app
|
||||||
|
config = await init();
|
||||||
|
|
||||||
|
if (config.port == null) {
|
||||||
|
bootLogger.error('The port is not configured. Please configure port.', null, true);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.platform === 'linux' && isWellKnownPort(config.port) && !isRoot()) {
|
||||||
|
bootLogger.error('You need root privileges to listen on well-known port on Linux', null, true);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!await isPortAvailable(config.port)) {
|
||||||
|
bootLogger.error(`Port ${config.port} is already in use`, null, true);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
bootLogger.error('Fatal error occurred during initialization', null, true);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
bootLogger.succ('Misskey initialized');
|
||||||
|
|
||||||
|
if (!program.disableClustering) {
|
||||||
|
await spawnWorkers(config.clusterLimit);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!program.noDaemons) {
|
||||||
|
require('../daemons/server-stats').default();
|
||||||
|
require('../daemons/notes-stats').default();
|
||||||
|
require('../daemons/queue-stats').default();
|
||||||
|
}
|
||||||
|
|
||||||
|
bootLogger.succ(`Now listening on port ${config.port} on ${config.url}`, null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
const runningNodejsVersion = process.version.slice(1).split('.').map(x => parseInt(x, 10));
|
||||||
|
const requiredNodejsVersion = [11, 7, 0];
|
||||||
|
const satisfyNodejsVersion = !lessThan(runningNodejsVersion, requiredNodejsVersion);
|
||||||
|
|
||||||
|
function isWellKnownPort(port: number): boolean {
|
||||||
|
return port < 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function isPortAvailable(port: number): Promise<boolean> {
|
||||||
|
return await portscanner.checkPortStatus(port, '127.0.0.1') === 'closed';
|
||||||
|
}
|
||||||
|
|
||||||
|
function showEnvironment(): void {
|
||||||
|
const env = process.env.NODE_ENV;
|
||||||
|
const logger = bootLogger.createSubLogger('env');
|
||||||
|
logger.info(typeof env == 'undefined' ? 'NODE_ENV is not set' : `NODE_ENV: ${env}`);
|
||||||
|
|
||||||
|
if (env !== 'production') {
|
||||||
|
logger.warn('The environment is not in production mode.');
|
||||||
|
logger.warn('DO NOT USE FOR PRODUCTION PURPOSE!', null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info(`You ${isRoot() ? '' : 'do not '}have root privileges`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Init app
|
||||||
|
*/
|
||||||
|
async function init(): Promise<Config> {
|
||||||
|
showEnvironment();
|
||||||
|
|
||||||
|
const nodejsLogger = bootLogger.createSubLogger('nodejs');
|
||||||
|
|
||||||
|
nodejsLogger.info(`Version ${runningNodejsVersion.join('.')}`);
|
||||||
|
|
||||||
|
if (!satisfyNodejsVersion) {
|
||||||
|
nodejsLogger.error(`Node.js version is less than ${requiredNodejsVersion.join('.')}. Please upgrade it.`, null, true);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
await showMachineInfo(bootLogger);
|
||||||
|
|
||||||
|
const configLogger = bootLogger.createSubLogger('config');
|
||||||
|
let config;
|
||||||
|
|
||||||
|
try {
|
||||||
|
config = loadConfig();
|
||||||
|
} catch (exception) {
|
||||||
|
if (typeof exception === 'string') {
|
||||||
|
configLogger.error(exception);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
if (exception.code === 'ENOENT') {
|
||||||
|
configLogger.error('Configuration file not found', null, true);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
configLogger.succ('Loaded');
|
||||||
|
|
||||||
|
// Try to connect to DB
|
||||||
|
try {
|
||||||
|
bootLogger.info('Connecting database...');
|
||||||
|
await initDb();
|
||||||
|
} catch (e) {
|
||||||
|
bootLogger.error('Cannot connect to database', null, true);
|
||||||
|
bootLogger.error(e);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function spawnWorkers(limit: number = Infinity) {
|
||||||
|
const workers = Math.min(limit, os.cpus().length);
|
||||||
|
bootLogger.info(`Starting ${workers} worker${workers === 1 ? '' : 's'}...`);
|
||||||
|
await Promise.all([...Array(workers)].map(spawnWorker));
|
||||||
|
bootLogger.succ('All workers started');
|
||||||
|
}
|
||||||
|
|
||||||
|
function spawnWorker(): Promise<void> {
|
||||||
|
return new Promise(res => {
|
||||||
|
const worker = cluster.fork();
|
||||||
|
worker.on('message', message => {
|
||||||
|
if (message !== 'ready') return;
|
||||||
|
res();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
20
src/boot/worker.ts
Normal file
20
src/boot/worker.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import * as cluster from 'cluster';
|
||||||
|
import { initDb } from '../db/postgre';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Init worker process
|
||||||
|
*/
|
||||||
|
export async function workerMain() {
|
||||||
|
await initDb();
|
||||||
|
|
||||||
|
// start server
|
||||||
|
await require('../server').default();
|
||||||
|
|
||||||
|
// start job queue
|
||||||
|
require('../queue').default();
|
||||||
|
|
||||||
|
if (cluster.isWorker) {
|
||||||
|
// Send a 'ready' message to parent process
|
||||||
|
process.send('ready');
|
||||||
|
}
|
||||||
|
}
|
@ -48,7 +48,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<span style="margin-right:16px;">{{ file.type }}</span>
|
<span style="margin-right:16px;">{{ file.type }}</span>
|
||||||
<span>{{ file.datasize | bytes }}</span>
|
<span>{{ file.size | bytes }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div><mk-time :time="file.createdAt" mode="detail"/></div>
|
<div><mk-time :time="file.createdAt" mode="detail"/></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<ui-card>
|
<ui-card>
|
||||||
<template #title>{{ $t('hided-tags') }}</template>
|
<template #title>{{ $t('hided-tags') }}</template>
|
||||||
<section>
|
<section>
|
||||||
<textarea class="jdnqwkzlnxcfftthoybjxrebyolvoucw" v-model="hidedTags"></textarea>
|
<textarea class="jdnqwkzlnxcfftthoybjxrebyolvoucw" v-model="hiddenTags"></textarea>
|
||||||
<ui-button @click="save">{{ $t('save') }}</ui-button>
|
<ui-button @click="save">{{ $t('save') }}</ui-button>
|
||||||
</section>
|
</section>
|
||||||
</ui-card>
|
</ui-card>
|
||||||
@ -18,18 +18,18 @@ export default Vue.extend({
|
|||||||
i18n: i18n('admin/views/hashtags.vue'),
|
i18n: i18n('admin/views/hashtags.vue'),
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
hidedTags: '',
|
hiddenTags: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$root.getMeta().then(meta => {
|
this.$root.getMeta().then(meta => {
|
||||||
this.hidedTags = meta.hidedTags.join('\n');
|
this.hiddenTags = meta.hiddenTags.join('\n');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
save() {
|
save() {
|
||||||
this.$root.api('admin/update-meta', {
|
this.$root.api('admin/update-meta', {
|
||||||
hidedTags: this.hidedTags.split('\n')
|
hiddenTags: this.hiddenTags.split('\n')
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
//this.$root.os.apis.dialog({ text: `Saved` });
|
//this.$root.os.apis.dialog({ text: `Saved` });
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
|
@ -77,12 +77,6 @@
|
|||||||
<header>summaly Proxy</header>
|
<header>summaly Proxy</header>
|
||||||
<ui-input v-model="summalyProxy">URL</ui-input>
|
<ui-input v-model="summalyProxy">URL</ui-input>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
|
||||||
<header><fa :icon="faUserPlus"/> {{ $t('user-recommendation-config') }}</header>
|
|
||||||
<ui-switch v-model="enableExternalUserRecommendation">{{ $t('enable-external-user-recommendation') }}</ui-switch>
|
|
||||||
<ui-input v-model="externalUserRecommendationEngine" :disabled="!enableExternalUserRecommendation">{{ $t('external-user-recommendation-engine') }}<template #desc>{{ $t('external-user-recommendation-engine-desc') }}</template></ui-input>
|
|
||||||
<ui-input v-model="externalUserRecommendationTimeout" type="number" :disabled="!enableExternalUserRecommendation">{{ $t('external-user-recommendation-timeout') }}<template #suffix>ms</template><template #desc>{{ $t('external-user-recommendation-timeout-desc') }}</template></ui-input>
|
|
||||||
</section>
|
|
||||||
<section>
|
<section>
|
||||||
<ui-button @click="updateMeta">{{ $t('save') }}</ui-button>
|
<ui-button @click="updateMeta">{{ $t('save') }}</ui-button>
|
||||||
</section>
|
</section>
|
||||||
@ -184,9 +178,6 @@ export default Vue.extend({
|
|||||||
discordClientSecret: null,
|
discordClientSecret: null,
|
||||||
proxyAccount: null,
|
proxyAccount: null,
|
||||||
inviteCode: null,
|
inviteCode: null,
|
||||||
enableExternalUserRecommendation: false,
|
|
||||||
externalUserRecommendationEngine: null,
|
|
||||||
externalUserRecommendationTimeout: null,
|
|
||||||
summalyProxy: null,
|
summalyProxy: null,
|
||||||
enableEmail: false,
|
enableEmail: false,
|
||||||
email: null,
|
email: null,
|
||||||
@ -205,8 +196,8 @@ export default Vue.extend({
|
|||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.$root.getMeta().then(meta => {
|
this.$root.getMeta().then(meta => {
|
||||||
this.maintainerName = meta.maintainer.name;
|
this.maintainerName = meta.maintainerName;
|
||||||
this.maintainerEmail = meta.maintainer.email;
|
this.maintainerEmail = meta.maintainerEmail;
|
||||||
this.disableRegistration = meta.disableRegistration;
|
this.disableRegistration = meta.disableRegistration;
|
||||||
this.disableLocalTimeline = meta.disableLocalTimeline;
|
this.disableLocalTimeline = meta.disableLocalTimeline;
|
||||||
this.disableGlobalTimeline = meta.disableGlobalTimeline;
|
this.disableGlobalTimeline = meta.disableGlobalTimeline;
|
||||||
@ -236,9 +227,6 @@ export default Vue.extend({
|
|||||||
this.enableDiscordIntegration = meta.enableDiscordIntegration;
|
this.enableDiscordIntegration = meta.enableDiscordIntegration;
|
||||||
this.discordClientId = meta.discordClientId;
|
this.discordClientId = meta.discordClientId;
|
||||||
this.discordClientSecret = meta.discordClientSecret;
|
this.discordClientSecret = meta.discordClientSecret;
|
||||||
this.enableExternalUserRecommendation = meta.enableExternalUserRecommendation;
|
|
||||||
this.externalUserRecommendationEngine = meta.externalUserRecommendationEngine;
|
|
||||||
this.externalUserRecommendationTimeout = meta.externalUserRecommendationTimeout;
|
|
||||||
this.summalyProxy = meta.summalyProxy;
|
this.summalyProxy = meta.summalyProxy;
|
||||||
this.enableEmail = meta.enableEmail;
|
this.enableEmail = meta.enableEmail;
|
||||||
this.email = meta.email;
|
this.email = meta.email;
|
||||||
@ -299,9 +287,6 @@ export default Vue.extend({
|
|||||||
enableDiscordIntegration: this.enableDiscordIntegration,
|
enableDiscordIntegration: this.enableDiscordIntegration,
|
||||||
discordClientId: this.discordClientId,
|
discordClientId: this.discordClientId,
|
||||||
discordClientSecret: this.discordClientSecret,
|
discordClientSecret: this.discordClientSecret,
|
||||||
enableExternalUserRecommendation: this.enableExternalUserRecommendation,
|
|
||||||
externalUserRecommendationEngine: this.externalUserRecommendationEngine,
|
|
||||||
externalUserRecommendationTimeout: parseInt(this.externalUserRecommendationTimeout, 10),
|
|
||||||
summalyProxy: this.summalyProxy,
|
summalyProxy: this.summalyProxy,
|
||||||
enableEmail: this.enableEmail,
|
enableEmail: this.enableEmail,
|
||||||
email: this.email,
|
email: this.email,
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
</ui-horizon-group>
|
</ui-horizon-group>
|
||||||
|
|
||||||
<div class="nqjzuvev">
|
<div class="nqjzuvev">
|
||||||
<code v-for="log in logs" :key="log._id" :class="log.level">
|
<code v-for="log in logs" :key="log.id" :class="log.level">
|
||||||
<details>
|
<details>
|
||||||
<summary><mk-time :time="log.createdAt"/> [{{ log.domain.join('.') }}] {{ log.message }}</summary>
|
<summary><mk-time :time="log.createdAt"/> [{{ log.domain.join('.') }}] {{ log.message }}</summary>
|
||||||
<vue-json-pretty v-if="log.data" :data="log.data"></vue-json-pretty>
|
<vue-json-pretty v-if="log.data" :data="log.data"></vue-json-pretty>
|
||||||
|
@ -165,7 +165,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
/** 処理対象ユーザーの情報を更新する */
|
/** 処理対象ユーザーの情報を更新する */
|
||||||
async refreshUser() {
|
async refreshUser() {
|
||||||
this.$root.api('admin/show-user', { userId: this.user._id }).then(info => {
|
this.$root.api('admin/show-user', { userId: this.user.id }).then(info => {
|
||||||
this.user = info;
|
this.user = info;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -173,7 +173,7 @@ export default Vue.extend({
|
|||||||
async resetPassword() {
|
async resetPassword() {
|
||||||
if (!await this.getConfirmed(this.$t('reset-password-confirm'))) return;
|
if (!await this.getConfirmed(this.$t('reset-password-confirm'))) return;
|
||||||
|
|
||||||
this.$root.api('admin/reset-password', { userId: this.user._id }).then(res => {
|
this.$root.api('admin/reset-password', { userId: this.user.id }).then(res => {
|
||||||
this.$root.dialog({
|
this.$root.dialog({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
text: this.$t('password-updated', { password: res.password })
|
text: this.$t('password-updated', { password: res.password })
|
||||||
@ -187,7 +187,7 @@ export default Vue.extend({
|
|||||||
this.verifying = true;
|
this.verifying = true;
|
||||||
|
|
||||||
const process = async () => {
|
const process = async () => {
|
||||||
await this.$root.api('admin/verify-user', { userId: this.user._id });
|
await this.$root.api('admin/verify-user', { userId: this.user.id });
|
||||||
this.$root.dialog({
|
this.$root.dialog({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
text: this.$t('verified')
|
text: this.$t('verified')
|
||||||
@ -212,7 +212,7 @@ export default Vue.extend({
|
|||||||
this.unverifying = true;
|
this.unverifying = true;
|
||||||
|
|
||||||
const process = async () => {
|
const process = async () => {
|
||||||
await this.$root.api('admin/unverify-user', { userId: this.user._id });
|
await this.$root.api('admin/unverify-user', { userId: this.user.id });
|
||||||
this.$root.dialog({
|
this.$root.dialog({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
text: this.$t('unverified')
|
text: this.$t('unverified')
|
||||||
@ -233,7 +233,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
async silenceUser() {
|
async silenceUser() {
|
||||||
const process = async () => {
|
const process = async () => {
|
||||||
await this.$root.api('admin/silence-user', { userId: this.user._id });
|
await this.$root.api('admin/silence-user', { userId: this.user.id });
|
||||||
this.$root.dialog({
|
this.$root.dialog({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
splash: true
|
splash: true
|
||||||
@ -252,7 +252,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
async unsilenceUser() {
|
async unsilenceUser() {
|
||||||
const process = async () => {
|
const process = async () => {
|
||||||
await this.$root.api('admin/unsilence-user', { userId: this.user._id });
|
await this.$root.api('admin/unsilence-user', { userId: this.user.id });
|
||||||
this.$root.dialog({
|
this.$root.dialog({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
splash: true
|
splash: true
|
||||||
@ -275,7 +275,7 @@ export default Vue.extend({
|
|||||||
this.suspending = true;
|
this.suspending = true;
|
||||||
|
|
||||||
const process = async () => {
|
const process = async () => {
|
||||||
await this.$root.api('admin/suspend-user', { userId: this.user._id });
|
await this.$root.api('admin/suspend-user', { userId: this.user.id });
|
||||||
this.$root.dialog({
|
this.$root.dialog({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
text: this.$t('suspended')
|
text: this.$t('suspended')
|
||||||
@ -300,7 +300,7 @@ export default Vue.extend({
|
|||||||
this.unsuspending = true;
|
this.unsuspending = true;
|
||||||
|
|
||||||
const process = async () => {
|
const process = async () => {
|
||||||
await this.$root.api('admin/unsuspend-user', { userId: this.user._id });
|
await this.$root.api('admin/unsuspend-user', { userId: this.user.id });
|
||||||
this.$root.dialog({
|
this.$root.dialog({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
text: this.$t('unsuspended')
|
text: this.$t('unsuspended')
|
||||||
@ -320,7 +320,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
async updateRemoteUser() {
|
async updateRemoteUser() {
|
||||||
this.$root.api('admin/update-remote-user', { userId: this.user._id }).then(res => {
|
this.$root.api('admin/update-remote-user', { userId: this.user.id }).then(res => {
|
||||||
this.$root.dialog({
|
this.$root.dialog({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
text: this.$t('remote-user-updated')
|
text: this.$t('remote-user-updated')
|
||||||
|
@ -14,15 +14,7 @@
|
|||||||
<h2>{{ $t('permission-ask') }}</h2>
|
<h2>{{ $t('permission-ask') }}</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<template v-for="p in app.permission">
|
<template v-for="p in app.permission">
|
||||||
<li v-if="p == 'account-read'">{{ $t('account-read') }}</li>
|
<li :key="p">{{ $t(`@.permissions.${p}`) }}</li>
|
||||||
<li v-if="p == 'account-write'">{{ $t('account-write') }}</li>
|
|
||||||
<li v-if="p == 'note-write'">{{ $t('note-write') }}</li>
|
|
||||||
<li v-if="p == 'like-write'">{{ $t('like-write') }}</li>
|
|
||||||
<li v-if="p == 'following-write'">{{ $t('following-write') }}</li>
|
|
||||||
<li v-if="p == 'drive-read'">{{ $t('drive-read') }}</li>
|
|
||||||
<li v-if="p == 'drive-write'">{{ $t('drive-write') }}</li>
|
|
||||||
<li v-if="p == 'notification-read'">{{ $t('notification-read') }}</li>
|
|
||||||
<li v-if="p == 'notification-write'">{{ $t('notification-write') }}</li>
|
|
||||||
</template>
|
</template>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
@ -45,15 +45,9 @@ export default function <T extends object>(data: {
|
|||||||
this.$watch('props', () => {
|
this.$watch('props', () => {
|
||||||
this.mergeProps();
|
this.mergeProps();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.bakeProps();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
bakeProps() {
|
|
||||||
this.bakedOldProps = JSON.stringify(this.props);
|
|
||||||
},
|
|
||||||
|
|
||||||
mergeProps() {
|
mergeProps() {
|
||||||
if (data.props) {
|
if (data.props) {
|
||||||
const defaultProps = data.props();
|
const defaultProps = data.props();
|
||||||
@ -65,17 +59,10 @@ export default function <T extends object>(data: {
|
|||||||
},
|
},
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
if (this.bakedOldProps == JSON.stringify(this.props)) return;
|
|
||||||
|
|
||||||
this.bakeProps();
|
|
||||||
|
|
||||||
if (this.platform == 'deck') {
|
if (this.platform == 'deck') {
|
||||||
this.$store.commit('device/updateDeckColumn', this.column);
|
this.$store.commit('device/updateDeckColumn', this.column);
|
||||||
} else {
|
} else {
|
||||||
this.$root.api('i/update_widget', {
|
this.$store.commit('device/updateWidget', this.widget);
|
||||||
id: this.id,
|
|
||||||
data: this.props
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,8 +70,8 @@ export default (opts: Opts = {}) => ({
|
|||||||
},
|
},
|
||||||
|
|
||||||
reactionsCount(): number {
|
reactionsCount(): number {
|
||||||
return this.appearNote.reactionCounts
|
return this.appearNote.reactions
|
||||||
? sum(Object.values(this.appearNote.reactionCounts))
|
? sum(Object.values(this.appearNote.reactions))
|
||||||
: 0;
|
: 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -87,16 +87,16 @@ export default prop => ({
|
|||||||
case 'reacted': {
|
case 'reacted': {
|
||||||
const reaction = body.reaction;
|
const reaction = body.reaction;
|
||||||
|
|
||||||
if (this.$_ns_target.reactionCounts == null) {
|
if (this.$_ns_target.reactions == null) {
|
||||||
Vue.set(this.$_ns_target, 'reactionCounts', {});
|
Vue.set(this.$_ns_target, 'reactions', {});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.$_ns_target.reactionCounts[reaction] == null) {
|
if (this.$_ns_target.reactions[reaction] == null) {
|
||||||
Vue.set(this.$_ns_target.reactionCounts, reaction, 0);
|
Vue.set(this.$_ns_target.reactions, reaction, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Increment the count
|
// Increment the count
|
||||||
this.$_ns_target.reactionCounts[reaction]++;
|
this.$_ns_target.reactions[reaction]++;
|
||||||
|
|
||||||
if (body.userId == this.$store.state.i.id) {
|
if (body.userId == this.$store.state.i.id) {
|
||||||
Vue.set(this.$_ns_target, 'myReaction', reaction);
|
Vue.set(this.$_ns_target, 'myReaction', reaction);
|
||||||
@ -107,16 +107,16 @@ export default prop => ({
|
|||||||
case 'unreacted': {
|
case 'unreacted': {
|
||||||
const reaction = body.reaction;
|
const reaction = body.reaction;
|
||||||
|
|
||||||
if (this.$_ns_target.reactionCounts == null) {
|
if (this.$_ns_target.reactions == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.$_ns_target.reactionCounts[reaction] == null) {
|
if (this.$_ns_target.reactions[reaction] == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decrement the count
|
// Decrement the count
|
||||||
if (this.$_ns_target.reactionCounts[reaction] > 0) this.$_ns_target.reactionCounts[reaction]--;
|
if (this.$_ns_target.reactions[reaction] > 0) this.$_ns_target.reactions[reaction]--;
|
||||||
|
|
||||||
if (body.userId == this.$store.state.i.id) {
|
if (body.userId == this.$store.state.i.id) {
|
||||||
Vue.set(this.$_ns_target, 'myReaction', null);
|
Vue.set(this.$_ns_target, 'myReaction', null);
|
||||||
@ -125,9 +125,11 @@ export default prop => ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
case 'pollVoted': {
|
case 'pollVoted': {
|
||||||
if (body.userId == this.$store.state.i.id) return;
|
|
||||||
const choice = body.choice;
|
const choice = body.choice;
|
||||||
this.$_ns_target.poll.choices.find(c => c.id === choice).votes++;
|
this.$_ns_target.poll.choices[choice].votes++;
|
||||||
|
if (body.userId == this.$store.state.i.id) {
|
||||||
|
Vue.set(this.$_ns_target.poll.choices[choice], 'isVoted', true);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,11 +55,12 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
icon(): any {
|
icon(): any {
|
||||||
return {
|
return {
|
||||||
backgroundColor: this.lightmode
|
backgroundColor: this.user.avatarColor ? this.lightmode
|
||||||
? `rgb(${this.user.avatarColor.slice(0, 3).join(',')})`
|
? this.user.avatarColor
|
||||||
: this.user.avatarColor && this.user.avatarColor.length == 3
|
: this.user.avatarColor.startsWith('rgb(')
|
||||||
? `rgb(${this.user.avatarColor.join(',')})`
|
? this.user.avatarColor
|
||||||
: null,
|
: null
|
||||||
|
: null,
|
||||||
backgroundImage: this.lightmode ? null : `url(${this.url})`,
|
backgroundImage: this.lightmode ? null : `url(${this.url})`,
|
||||||
borderRadius: this.$store.state.settings.circleIcons ? '100%' : null
|
borderRadius: this.$store.state.settings.circleIcons ? '100%' : null
|
||||||
};
|
};
|
||||||
@ -67,7 +68,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.user.avatarColor) {
|
if (this.user.avatarColor) {
|
||||||
this.$el.style.color = `rgb(${this.user.avatarColor.slice(0, 3).join(',')})`;
|
this.$el.style.color = this.user.avatarColor;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -24,11 +24,11 @@
|
|||||||
|
|
||||||
<div class="board">
|
<div class="board">
|
||||||
<div class="labels-x" v-if="this.$store.state.settings.games.reversi.showBoardLabels">
|
<div class="labels-x" v-if="this.$store.state.settings.games.reversi.showBoardLabels">
|
||||||
<span v-for="i in game.settings.map[0].length">{{ String.fromCharCode(64 + i) }}</span>
|
<span v-for="i in game.map[0].length">{{ String.fromCharCode(64 + i) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="labels-y" v-if="this.$store.state.settings.games.reversi.showBoardLabels">
|
<div class="labels-y" v-if="this.$store.state.settings.games.reversi.showBoardLabels">
|
||||||
<div v-for="i in game.settings.map.length">{{ i }}</div>
|
<div v-for="i in game.map.length">{{ i }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cells" :style="cellsStyle">
|
<div class="cells" :style="cellsStyle">
|
||||||
<div v-for="(stone, i) in o.board"
|
<div v-for="(stone, i) in o.board"
|
||||||
@ -46,11 +46,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="labels-y" v-if="this.$store.state.settings.games.reversi.showBoardLabels">
|
<div class="labels-y" v-if="this.$store.state.settings.games.reversi.showBoardLabels">
|
||||||
<div v-for="i in game.settings.map.length">{{ i }}</div>
|
<div v-for="i in game.map.length">{{ i }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="labels-x" v-if="this.$store.state.settings.games.reversi.showBoardLabels">
|
<div class="labels-x" v-if="this.$store.state.settings.games.reversi.showBoardLabels">
|
||||||
<span v-for="i in game.settings.map[0].length">{{ String.fromCharCode(64 + i) }}</span>
|
<span v-for="i in game.map[0].length">{{ String.fromCharCode(64 + i) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -71,9 +71,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<p v-if="game.settings.isLlotheo">{{ $t('is-llotheo') }}</p>
|
<p v-if="game.isLlotheo">{{ $t('is-llotheo') }}</p>
|
||||||
<p v-if="game.settings.loopedBoard">{{ $t('looped-map') }}</p>
|
<p v-if="game.loopedBoard">{{ $t('looped-map') }}</p>
|
||||||
<p v-if="game.settings.canPutEverywhere">{{ $t('can-put-everywhere') }}</p>
|
<p v-if="game.canPutEverywhere">{{ $t('can-put-everywhere') }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -160,8 +160,8 @@ export default Vue.extend({
|
|||||||
|
|
||||||
cellsStyle(): any {
|
cellsStyle(): any {
|
||||||
return {
|
return {
|
||||||
'grid-template-rows': `repeat(${this.game.settings.map.length}, 1fr)`,
|
'grid-template-rows': `repeat(${this.game.map.length}, 1fr)`,
|
||||||
'grid-template-columns': `repeat(${this.game.settings.map[0].length}, 1fr)`
|
'grid-template-columns': `repeat(${this.game.map[0].length}, 1fr)`
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -169,10 +169,10 @@ export default Vue.extend({
|
|||||||
watch: {
|
watch: {
|
||||||
logPos(v) {
|
logPos(v) {
|
||||||
if (!this.game.isEnded) return;
|
if (!this.game.isEnded) return;
|
||||||
this.o = new Reversi(this.game.settings.map, {
|
this.o = new Reversi(this.game.map, {
|
||||||
isLlotheo: this.game.settings.isLlotheo,
|
isLlotheo: this.game.isLlotheo,
|
||||||
canPutEverywhere: this.game.settings.canPutEverywhere,
|
canPutEverywhere: this.game.canPutEverywhere,
|
||||||
loopedBoard: this.game.settings.loopedBoard
|
loopedBoard: this.game.loopedBoard
|
||||||
});
|
});
|
||||||
for (const log of this.logs.slice(0, v)) {
|
for (const log of this.logs.slice(0, v)) {
|
||||||
this.o.put(log.color, log.pos);
|
this.o.put(log.color, log.pos);
|
||||||
@ -184,10 +184,10 @@ export default Vue.extend({
|
|||||||
created() {
|
created() {
|
||||||
this.game = this.initGame;
|
this.game = this.initGame;
|
||||||
|
|
||||||
this.o = new Reversi(this.game.settings.map, {
|
this.o = new Reversi(this.game.map, {
|
||||||
isLlotheo: this.game.settings.isLlotheo,
|
isLlotheo: this.game.isLlotheo,
|
||||||
canPutEverywhere: this.game.settings.canPutEverywhere,
|
canPutEverywhere: this.game.canPutEverywhere,
|
||||||
loopedBoard: this.game.settings.loopedBoard
|
loopedBoard: this.game.loopedBoard
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const log of this.game.logs) {
|
for (const log of this.game.logs) {
|
||||||
@ -286,10 +286,10 @@ export default Vue.extend({
|
|||||||
onRescue(game) {
|
onRescue(game) {
|
||||||
this.game = game;
|
this.game = game;
|
||||||
|
|
||||||
this.o = new Reversi(this.game.settings.map, {
|
this.o = new Reversi(this.game.map, {
|
||||||
isLlotheo: this.game.settings.isLlotheo,
|
isLlotheo: this.game.isLlotheo,
|
||||||
canPutEverywhere: this.game.settings.canPutEverywhere,
|
canPutEverywhere: this.game.canPutEverywhere,
|
||||||
loopedBoard: this.game.settings.loopedBoard
|
loopedBoard: this.game.loopedBoard
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const log of this.game.logs) {
|
for (const log of this.game.logs) {
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class="random" v-if="game.settings.map == null"><fa icon="dice"/></div>
|
<div class="random" v-if="game.map == null"><fa icon="dice"/></div>
|
||||||
<div class="board" v-else :style="{ 'grid-template-rows': `repeat(${ game.settings.map.length }, 1fr)`, 'grid-template-columns': `repeat(${ game.settings.map[0].length }, 1fr)` }">
|
<div class="board" v-else :style="{ 'grid-template-rows': `repeat(${ game.map.length }, 1fr)`, 'grid-template-columns': `repeat(${ game.map[0].length }, 1fr)` }">
|
||||||
<div v-for="(x, i) in game.settings.map.join('')"
|
<div v-for="(x, i) in game.map.join('')"
|
||||||
:data-none="x == ' '"
|
:data-none="x == ' '"
|
||||||
@click="onPixelClick(i, x)">
|
@click="onPixelClick(i, x)">
|
||||||
<fa v-if="x == 'b'" :icon="fasCircle"/>
|
<fa v-if="x == 'b'" :icon="fasCircle"/>
|
||||||
@ -35,9 +35,9 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<form-radio v-model="game.settings.bw" value="random" @change="updateSettings">{{ $t('random') }}</form-radio>
|
<form-radio v-model="game.bw" value="random" @change="updateSettings('bw')">{{ $t('random') }}</form-radio>
|
||||||
<form-radio v-model="game.settings.bw" :value="1" @change="updateSettings">{{ this.$t('black-is').split('{}')[0] }}<b><mk-user-name :user="game.user1"/></b>{{ this.$t('black-is').split('{}')[1] }}</form-radio>
|
<form-radio v-model="game.bw" :value="1" @change="updateSettings('bw')">{{ this.$t('black-is').split('{}')[0] }}<b><mk-user-name :user="game.user1"/></b>{{ this.$t('black-is').split('{}')[1] }}</form-radio>
|
||||||
<form-radio v-model="game.settings.bw" :value="2" @change="updateSettings">{{ this.$t('black-is').split('{}')[0] }}<b><mk-user-name :user="game.user2"/></b>{{ this.$t('black-is').split('{}')[1] }}</form-radio>
|
<form-radio v-model="game.bw" :value="2" @change="updateSettings('bw')">{{ this.$t('black-is').split('{}')[0] }}<b><mk-user-name :user="game.user2"/></b>{{ this.$t('black-is').split('{}')[1] }}</form-radio>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -47,9 +47,9 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<ui-switch v-model="game.settings.isLlotheo" @change="updateSettings">{{ $t('is-llotheo') }}</ui-switch>
|
<ui-switch v-model="game.isLlotheo" @change="updateSettings('isLlotheo')">{{ $t('is-llotheo') }}</ui-switch>
|
||||||
<ui-switch v-model="game.settings.loopedBoard" @change="updateSettings">{{ $t('looped-map') }}</ui-switch>
|
<ui-switch v-model="game.loopedBoard" @change="updateSettings('loopedBoard')">{{ $t('looped-map') }}</ui-switch>
|
||||||
<ui-switch v-model="game.settings.canPutEverywhere" @change="updateSettings">{{ $t('can-put-everywhere') }}</ui-switch>
|
<ui-switch v-model="game.canPutEverywhere" @change="updateSettings('canPutEverywhere')">{{ $t('can-put-everywhere') }}</ui-switch>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -159,8 +159,8 @@ export default Vue.extend({
|
|||||||
this.connection.on('initForm', this.onInitForm);
|
this.connection.on('initForm', this.onInitForm);
|
||||||
this.connection.on('message', this.onMessage);
|
this.connection.on('message', this.onMessage);
|
||||||
|
|
||||||
if (this.game.user1Id != this.$store.state.i.id && this.game.settings.form1) this.form = this.game.settings.form1;
|
if (this.game.user1Id != this.$store.state.i.id && this.game.form1) this.form = this.game.form1;
|
||||||
if (this.game.user2Id != this.$store.state.i.id && this.game.settings.form2) this.form = this.game.settings.form2;
|
if (this.game.user2Id != this.$store.state.i.id && this.game.form2) this.form = this.game.form2;
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
@ -189,18 +189,19 @@ export default Vue.extend({
|
|||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
},
|
},
|
||||||
|
|
||||||
updateSettings() {
|
updateSettings(key: string) {
|
||||||
this.connection.send('updateSettings', {
|
this.connection.send('updateSettings', {
|
||||||
settings: this.game.settings
|
key: key,
|
||||||
|
value: this.game[key]
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onUpdateSettings(settings) {
|
onUpdateSettings({ key, value }) {
|
||||||
this.game.settings = settings;
|
this.game[key] = value;
|
||||||
if (this.game.settings.map == null) {
|
if (this.game.map == null) {
|
||||||
this.mapName = null;
|
this.mapName = null;
|
||||||
} else {
|
} else {
|
||||||
const found = Object.values(maps).find(x => x.data.join('') == this.game.settings.map.join(''));
|
const found = Object.values(maps).find(x => x.data.join('') == this.game.map.join(''));
|
||||||
this.mapName = found ? found.name : '-Custom-';
|
this.mapName = found ? found.name : '-Custom-';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -224,27 +225,27 @@ export default Vue.extend({
|
|||||||
|
|
||||||
onMapChange() {
|
onMapChange() {
|
||||||
if (this.mapName == null) {
|
if (this.mapName == null) {
|
||||||
this.game.settings.map = null;
|
this.game.map = null;
|
||||||
} else {
|
} else {
|
||||||
this.game.settings.map = Object.values(maps).find(x => x.name == this.mapName).data;
|
this.game.map = Object.values(maps).find(x => x.name == this.mapName).data;
|
||||||
}
|
}
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
this.updateSettings();
|
this.updateSettings();
|
||||||
},
|
},
|
||||||
|
|
||||||
onPixelClick(pos, pixel) {
|
onPixelClick(pos, pixel) {
|
||||||
const x = pos % this.game.settings.map[0].length;
|
const x = pos % this.game.map[0].length;
|
||||||
const y = Math.floor(pos / this.game.settings.map[0].length);
|
const y = Math.floor(pos / this.game.map[0].length);
|
||||||
const newPixel =
|
const newPixel =
|
||||||
pixel == ' ' ? '-' :
|
pixel == ' ' ? '-' :
|
||||||
pixel == '-' ? 'b' :
|
pixel == '-' ? 'b' :
|
||||||
pixel == 'b' ? 'w' :
|
pixel == 'b' ? 'w' :
|
||||||
' ';
|
' ';
|
||||||
const line = this.game.settings.map[y].split('');
|
const line = this.game.map[y].split('');
|
||||||
line[x] = newPixel;
|
line[x] = newPixel;
|
||||||
this.$set(this.game.settings.map, y, line.join(''));
|
this.$set(this.game.map, y, line.join(''));
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
this.updateSettings();
|
this.updateSettings('map');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -106,7 +106,7 @@ export default Vue.extend({
|
|||||||
async nav(game, actualNav = true) {
|
async nav(game, actualNav = true) {
|
||||||
if (this.selfNav) {
|
if (this.selfNav) {
|
||||||
// 受け取ったゲーム情報が省略されたものなら完全な情報を取得する
|
// 受け取ったゲーム情報が省略されたものなら完全な情報を取得する
|
||||||
if (game != null && (game.settings == null || game.settings.map == null)) {
|
if (game != null && game.map == null) {
|
||||||
game = await this.$root.api('games/reversi/games/show', {
|
game = await this.$root.api('games/reversi/games/show', {
|
||||||
gameId: game.id
|
gameId: game.id
|
||||||
});
|
});
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="nhasjydimbopojusarffqjyktglcuxjy" v-if="meta">
|
<div class="nhasjydimbopojusarffqjyktglcuxjy" v-if="meta">
|
||||||
<div class="banner" :style="{ backgroundImage: meta.bannerUrl ? `url(${meta.bannerUrl})` : null }"></div>
|
<div class="banner" :style="{ backgroundImage: meta.bannerUrl ? `url(${meta.bannerUrl})` : null }"></div>
|
||||||
|
|
||||||
<h1>{{ meta.name }}</h1>
|
<h1>{{ meta.name || 'Misskey' }}</h1>
|
||||||
<p v-html="meta.description || this.$t('@.about')"></p>
|
<p v-html="meta.description || this.$t('@.about')"></p>
|
||||||
<router-link to="/">{{ $t('start') }}</router-link>
|
<router-link to="/">{{ $t('start') }}</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
@ -33,7 +33,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
canonical(): string {
|
canonical(): string {
|
||||||
return `@${this.username}@${toUnicode(this.host)}`;
|
return this.host === localHost ? `@${this.username}` : `@${this.username}@${toUnicode(this.host)}`;
|
||||||
},
|
},
|
||||||
isMe(): boolean {
|
isMe(): boolean {
|
||||||
return this.$store.getters.isSignedIn && this.canonical.toLowerCase() === `@${this.$store.state.i.username}@${toUnicode(localHost)}`.toLowerCase();
|
return this.$store.getters.isSignedIn && this.canonical.toLowerCase() === `@${this.$store.state.i.username}@${toUnicode(localHost)}`.toLowerCase();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mk-poll" :data-done="closed || isVoted">
|
<div class="mk-poll" :data-done="closed || isVoted">
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="choice in poll.choices" :key="choice.id" @click="vote(choice.id)" :class="{ voted: choice.voted }" :title="!closed && !isVoted ? $t('vote-to').replace('{}', choice.text) : ''">
|
<li v-for="(choice, i) in poll.choices" :key="i" @click="vote(i)" :class="{ voted: choice.voted }" :title="!closed && !isVoted ? $t('vote-to').replace('{}', choice.text) : ''">
|
||||||
<div class="backdrop" :style="{ 'width': `${showResult ? (choice.votes / total * 100) : 0}%` }"></div>
|
<div class="backdrop" :style="{ 'width': `${showResult ? (choice.votes / total * 100) : 0}%` }"></div>
|
||||||
<span>
|
<span>
|
||||||
<template v-if="choice.isVoted"><fa icon="check"/></template>
|
<template v-if="choice.isVoted"><fa icon="check"/></template>
|
||||||
@ -82,12 +82,6 @@ export default Vue.extend({
|
|||||||
noteId: this.note.id,
|
noteId: this.note.id,
|
||||||
choice: id
|
choice: id
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
for (const c of this.poll.choices) {
|
|
||||||
if (c.id == id) {
|
|
||||||
c.votes++;
|
|
||||||
Vue.set(c, 'isVoted', true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!this.showResult) this.showResult = !this.poll.multiple;
|
if (!this.showResult) this.showResult = !this.poll.multiple;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
reactions(): any {
|
reactions(): any {
|
||||||
return this.note.reactionCounts;
|
return this.note.reactions;
|
||||||
},
|
},
|
||||||
isMe(): boolean {
|
isMe(): boolean {
|
||||||
return this.$store.getters.isSignedIn && this.$store.state.i.id === this.note.userId;
|
return this.$store.getters.isSignedIn && this.$store.state.i.id === this.note.userId;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<ui-card>
|
<ui-card>
|
||||||
<template #title><fa :icon="['far', 'bell']"/> {{ $t('title') }}</template>
|
<template #title><fa :icon="['far', 'bell']"/> {{ $t('title') }}</template>
|
||||||
<section>
|
<section>
|
||||||
<ui-switch v-model="$store.state.i.settings.autoWatch" @change="onChangeAutoWatch">
|
<ui-switch v-model="$store.state.i.autoWatch" @change="onChangeAutoWatch">
|
||||||
{{ $t('auto-watch') }}<template #desc>{{ $t('auto-watch-desc') }}</template>
|
{{ $t('auto-watch') }}<template #desc>{{ $t('auto-watch-desc') }}</template>
|
||||||
</ui-switch>
|
</ui-switch>
|
||||||
<section>
|
<section>
|
||||||
|
@ -158,14 +158,14 @@ export default Vue.extend({
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
alwaysMarkNsfw: {
|
alwaysMarkNsfw: {
|
||||||
get() { return this.$store.state.i.settings.alwaysMarkNsfw; },
|
get() { return this.$store.state.i.alwaysMarkNsfw; },
|
||||||
set(value) { this.$root.api('i/update', { alwaysMarkNsfw: value }); }
|
set(value) { this.$root.api('i/update', { alwaysMarkNsfw: value }); }
|
||||||
},
|
},
|
||||||
|
|
||||||
bannerStyle(): any {
|
bannerStyle(): any {
|
||||||
if (this.$store.state.i.bannerUrl == null) return {};
|
if (this.$store.state.i.bannerUrl == null) return {};
|
||||||
return {
|
return {
|
||||||
backgroundColor: this.$store.state.i.bannerColor && this.$store.state.i.bannerColor.length == 3 ? `rgb(${ this.$store.state.i.bannerColor.join(',') })` : null,
|
backgroundColor: this.$store.state.i.bannerColor ? this.$store.state.i.bannerColor : null,
|
||||||
backgroundImage: `url(${ this.$store.state.i.bannerUrl })`
|
backgroundImage: `url(${ this.$store.state.i.bannerUrl })`
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -178,10 +178,10 @@ export default Vue.extend({
|
|||||||
this.email = this.$store.state.i.email;
|
this.email = this.$store.state.i.email;
|
||||||
this.name = this.$store.state.i.name;
|
this.name = this.$store.state.i.name;
|
||||||
this.username = this.$store.state.i.username;
|
this.username = this.$store.state.i.username;
|
||||||
this.location = this.$store.state.i.profile.location;
|
this.location = this.$store.state.i.location;
|
||||||
this.description = this.$store.state.i.description;
|
this.description = this.$store.state.i.description;
|
||||||
this.lang = this.$store.state.i.lang;
|
this.lang = this.$store.state.i.lang;
|
||||||
this.birthday = this.$store.state.i.profile.birthday;
|
this.birthday = this.$store.state.i.birthday;
|
||||||
this.avatarId = this.$store.state.i.avatarId;
|
this.avatarId = this.$store.state.i.avatarId;
|
||||||
this.bannerId = this.$store.state.i.bannerId;
|
this.bannerId = this.$store.state.i.bannerId;
|
||||||
this.isCat = this.$store.state.i.isCat;
|
this.isCat = this.$store.state.i.isCat;
|
||||||
|
@ -130,20 +130,6 @@ import * as tinycolor from 'tinycolor2';
|
|||||||
import * as JSON5 from 'json5';
|
import * as JSON5 from 'json5';
|
||||||
import { faMoon, faSun } from '@fortawesome/free-regular-svg-icons';
|
import { faMoon, faSun } from '@fortawesome/free-regular-svg-icons';
|
||||||
|
|
||||||
// 後方互換性のため
|
|
||||||
function convertOldThemedefinition(t) {
|
|
||||||
const t2 = {
|
|
||||||
id: t.meta.id,
|
|
||||||
name: t.meta.name,
|
|
||||||
author: t.meta.author,
|
|
||||||
base: t.meta.base,
|
|
||||||
vars: t.meta.vars,
|
|
||||||
props: t
|
|
||||||
};
|
|
||||||
delete t2.props.meta;
|
|
||||||
return t2;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
i18n: i18n('common/views/components/theme.vue'),
|
i18n: i18n('common/views/components/theme.vue'),
|
||||||
components: {
|
components: {
|
||||||
@ -231,20 +217,6 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeCreate() {
|
|
||||||
// migrate old theme definitions
|
|
||||||
// 後方互換性のため
|
|
||||||
this.$store.commit('device/set', {
|
|
||||||
key: 'themes', value: this.$store.state.device.themes.map(t => {
|
|
||||||
if (t.id == null) {
|
|
||||||
return convertOldThemedefinition(t);
|
|
||||||
} else {
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
install(code) {
|
install(code) {
|
||||||
let theme;
|
let theme;
|
||||||
@ -259,11 +231,6 @@ export default Vue.extend({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 後方互換性のため
|
|
||||||
if (theme.id == null && theme.meta != null) {
|
|
||||||
theme = convertOldThemedefinition(theme);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (theme.id == null) {
|
if (theme.id == null) {
|
||||||
this.$root.dialog({
|
this.$root.dialog({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<ui-input v-if="meta.disableRegistration" v-model="invitationCode" type="text" :autocomplete="Math.random()" spellcheck="false" required styl="fill">
|
<ui-input v-if="meta.disableRegistration" v-model="invitationCode" type="text" :autocomplete="Math.random()" spellcheck="false" required styl="fill">
|
||||||
<span>{{ $t('invitation-code') }}</span>
|
<span>{{ $t('invitation-code') }}</span>
|
||||||
<template #prefix><fa icon="id-card-alt"/></template>
|
<template #prefix><fa icon="id-card-alt"/></template>
|
||||||
<template #desc v-html="this.$t('invitation-info').replace('{}', 'mailto:' + meta.maintainer.email)"></template>
|
<template #desc v-html="this.$t('invitation-info').replace('{}', 'mailto:' + meta.maintainerEmail)"></template>
|
||||||
</ui-input>
|
</ui-input>
|
||||||
<ui-input v-model="username" type="text" pattern="^[a-zA-Z0-9_]{1,20}$" :autocomplete="Math.random()" spellcheck="false" required @input="onChangeUsername" styl="fill">
|
<ui-input v-model="username" type="text" pattern="^[a-zA-Z0-9_]{1,20}$" :autocomplete="Math.random()" spellcheck="false" required @input="onChangeUsername" styl="fill">
|
||||||
<span>{{ $t('username') }}</span>
|
<span>{{ $t('username') }}</span>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="cudqjmnl">
|
<div class="cudqjmnl">
|
||||||
<ui-card>
|
<ui-card>
|
||||||
<template #title><fa :icon="faList"/> {{ list.title }}</template>
|
<template #title><fa :icon="faList"/> {{ list.name }}</template>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<ui-button @click="rename"><fa :icon="faICursor"/> {{ $t('rename') }}</ui-button>
|
<ui-button @click="rename"><fa :icon="faICursor"/> {{ $t('rename') }}</ui-button>
|
||||||
@ -75,7 +75,7 @@ export default Vue.extend({
|
|||||||
this.$root.dialog({
|
this.$root.dialog({
|
||||||
title: this.$t('rename'),
|
title: this.$t('rename'),
|
||||||
input: {
|
input: {
|
||||||
default: this.list.title
|
default: this.list.name
|
||||||
}
|
}
|
||||||
}).then(({ canceled, result: title }) => {
|
}).then(({ canceled, result: title }) => {
|
||||||
if (canceled) return;
|
if (canceled) return;
|
||||||
@ -89,7 +89,7 @@ export default Vue.extend({
|
|||||||
del() {
|
del() {
|
||||||
this.$root.dialog({
|
this.$root.dialog({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
text: this.$t('delete-are-you-sure').replace('$1', this.list.title),
|
text: this.$t('delete-are-you-sure').replace('$1', this.list.name),
|
||||||
showCancelButton: true
|
showCancelButton: true
|
||||||
}).then(({ canceled }) => {
|
}).then(({ canceled }) => {
|
||||||
if (canceled) return;
|
if (canceled) return;
|
||||||
|
@ -50,7 +50,7 @@ export default Vue.extend({
|
|||||||
fetchingMoreUsers: false,
|
fetchingMoreUsers: false,
|
||||||
us: [],
|
us: [],
|
||||||
inited: false,
|
inited: false,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ export default Vue.extend({
|
|||||||
title: t,
|
title: t,
|
||||||
select: {
|
select: {
|
||||||
items: lists.map(list => ({
|
items: lists.map(list => ({
|
||||||
value: list.id, text: list.title
|
value: list.id, text: list.name
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
showCancelButton: true
|
showCancelButton: true
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<x-notifications-column v-else-if="column.type == 'notifications'" :column="column" :is-stacked="isStacked" v-on="$listeners"/>
|
<x-notifications-column v-else-if="column.type == 'notifications'" :column="column" :is-stacked="isStacked" v-on="$listeners"/>
|
||||||
<x-tl-column v-else-if="column.type == 'home'" :column="column" :is-stacked="isStacked" v-on="$listeners"/>
|
<x-tl-column v-else-if="column.type == 'home'" :column="column" :is-stacked="isStacked" v-on="$listeners"/>
|
||||||
<x-tl-column v-else-if="column.type == 'local'" :column="column" :is-stacked="isStacked" v-on="$listeners"/>
|
<x-tl-column v-else-if="column.type == 'local'" :column="column" :is-stacked="isStacked" v-on="$listeners"/>
|
||||||
<x-tl-column v-else-if="column.type == 'hybrid'" :column="column" :is-stacked="isStacked" v-on="$listeners"/>
|
<x-tl-column v-else-if="column.type == 'social'" :column="column" :is-stacked="isStacked" v-on="$listeners"/>
|
||||||
<x-tl-column v-else-if="column.type == 'global'" :column="column" :is-stacked="isStacked" v-on="$listeners"/>
|
<x-tl-column v-else-if="column.type == 'global'" :column="column" :is-stacked="isStacked" v-on="$listeners"/>
|
||||||
<x-tl-column v-else-if="column.type == 'list'" :column="column" :is-stacked="isStacked" v-on="$listeners"/>
|
<x-tl-column v-else-if="column.type == 'list'" :column="column" :is-stacked="isStacked" v-on="$listeners"/>
|
||||||
<x-tl-column v-else-if="column.type == 'hashtag'" :column="column" :is-stacked="isStacked" v-on="$listeners"/>
|
<x-tl-column v-else-if="column.type == 'hashtag'" :column="column" :is-stacked="isStacked" v-on="$listeners"/>
|
||||||
|
@ -28,12 +28,12 @@ export default Vue.extend({
|
|||||||
notes.pop();
|
notes.pop();
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: notes[notes.length - 1].id
|
more: true
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -37,12 +37,12 @@ export default Vue.extend({
|
|||||||
notes.pop();
|
notes.pop();
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: notes[notes.length - 1].id
|
more: true
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -28,7 +28,7 @@ export default Vue.extend({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
connection: null,
|
connection: null,
|
||||||
makePromise: cursor => this.$root.api('notes/search_by_tag', {
|
makePromise: cursor => this.$root.api('notes/search-by-tag', {
|
||||||
limit: fetchLimit + 1,
|
limit: fetchLimit + 1,
|
||||||
untilId: cursor ? cursor : undefined,
|
untilId: cursor ? cursor : undefined,
|
||||||
withFiles: this.mediaOnly,
|
withFiles: this.mediaOnly,
|
||||||
@ -41,12 +41,12 @@ export default Vue.extend({
|
|||||||
notes.pop();
|
notes.pop();
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: notes[notes.length - 1].id
|
more: true
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -41,12 +41,12 @@ export default Vue.extend({
|
|||||||
notes.pop();
|
notes.pop();
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: notes[notes.length - 1].id
|
more: true
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -27,12 +27,12 @@ export default Vue.extend({
|
|||||||
notes.pop();
|
notes.pop();
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: notes[notes.length - 1].id
|
more: true
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -26,8 +26,8 @@
|
|||||||
</template>
|
</template>
|
||||||
</component>
|
</component>
|
||||||
|
|
||||||
<footer v-if="cursor != null">
|
<footer v-if="more">
|
||||||
<button @click="more" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
|
<button @click="fetchMore()" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
|
||||||
<template v-if="!moreFetching">{{ $t('@.load-more') }}</template>
|
<template v-if="!moreFetching">{{ $t('@.load-more') }}</template>
|
||||||
<template v-if="moreFetching"><fa icon="spinner" pulse fixed-width/></template>
|
<template v-if="moreFetching"><fa icon="spinner" pulse fixed-width/></template>
|
||||||
</button>
|
</button>
|
||||||
@ -61,7 +61,7 @@ export default Vue.extend({
|
|||||||
fetching: true,
|
fetching: true,
|
||||||
moreFetching: false,
|
moreFetching: false,
|
||||||
inited: false,
|
inited: false,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ export default Vue.extend({
|
|||||||
this.notes = x;
|
this.notes = x;
|
||||||
} else {
|
} else {
|
||||||
this.notes = x.notes;
|
this.notes = x.notes;
|
||||||
this.cursor = x.cursor;
|
this.more = x.more;
|
||||||
}
|
}
|
||||||
this.inited = true;
|
this.inited = true;
|
||||||
this.fetching = false;
|
this.fetching = false;
|
||||||
@ -129,12 +129,12 @@ export default Vue.extend({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
more() {
|
fetchMore() {
|
||||||
if (this.cursor == null || this.moreFetching) return;
|
if (!this.more || this.moreFetching) return;
|
||||||
this.moreFetching = true;
|
this.moreFetching = true;
|
||||||
this.makePromise(this.cursor).then(x => {
|
this.makePromise(this.notes[this.notes.length - 1].id).then(x => {
|
||||||
this.notes = this.notes.concat(x.notes);
|
this.notes = this.notes.concat(x.notes);
|
||||||
this.cursor = x.cursor;
|
this.more = x.more;
|
||||||
this.moreFetching = false;
|
this.moreFetching = false;
|
||||||
}, e => {
|
}, e => {
|
||||||
this.moreFetching = false;
|
this.moreFetching = false;
|
||||||
@ -157,6 +157,7 @@ export default Vue.extend({
|
|||||||
// オーバーフローしたら古い投稿は捨てる
|
// オーバーフローしたら古い投稿は捨てる
|
||||||
if (this.notes.length >= displayLimit) {
|
if (this.notes.length >= displayLimit) {
|
||||||
this.notes = this.notes.slice(0, displayLimit);
|
this.notes = this.notes.slice(0, displayLimit);
|
||||||
|
this.more = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.queue.push(note);
|
this.queue.push(note);
|
||||||
@ -179,7 +180,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onBottom() {
|
onBottom() {
|
||||||
this.more();
|
this.fetchMore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="notification poll_vote" v-if="notification.type == 'poll_vote'">
|
<div class="notification pollVote" v-if="notification.type == 'pollVote'">
|
||||||
<mk-avatar class="avatar" :user="notification.user"/>
|
<mk-avatar class="avatar" :user="notification.user"/>
|
||||||
<div>
|
<div>
|
||||||
<header>
|
<header>
|
||||||
|
@ -39,7 +39,7 @@ export default Vue.extend({
|
|||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<fa v-if="column.type == 'home'" icon="home"/>
|
<fa v-if="column.type == 'home'" icon="home"/>
|
||||||
<fa v-if="column.type == 'local'" :icon="['far', 'comments']"/>
|
<fa v-if="column.type == 'local'" :icon="['far', 'comments']"/>
|
||||||
<fa v-if="column.type == 'hybrid'" icon="share-alt"/>
|
<fa v-if="column.type == 'social'" icon="share-alt"/>
|
||||||
<fa v-if="column.type == 'global'" icon="globe"/>
|
<fa v-if="column.type == 'global'" icon="globe"/>
|
||||||
<fa v-if="column.type == 'list'" icon="list"/>
|
<fa v-if="column.type == 'list'" icon="list"/>
|
||||||
<fa v-if="column.type == 'hashtag'" icon="hashtag"/>
|
<fa v-if="column.type == 'hashtag'" icon="hashtag"/>
|
||||||
@ -80,9 +80,9 @@ export default Vue.extend({
|
|||||||
switch (this.column.type) {
|
switch (this.column.type) {
|
||||||
case 'home': return this.$t('@deck.home');
|
case 'home': return this.$t('@deck.home');
|
||||||
case 'local': return this.$t('@deck.local');
|
case 'local': return this.$t('@deck.local');
|
||||||
case 'hybrid': return this.$t('@deck.hybrid');
|
case 'social': return this.$t('@deck.social');
|
||||||
case 'global': return this.$t('@deck.global');
|
case 'global': return this.$t('@deck.global');
|
||||||
case 'list': return this.column.list.title;
|
case 'list': return this.column.list.name;
|
||||||
case 'hashtag': return this.$store.state.settings.tagTimelines.find(x => x.id == this.column.tagTlId).title;
|
case 'hashtag': return this.$store.state.settings.tagTimelines.find(x => x.id == this.column.tagTlId).title;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ export default Vue.extend({
|
|||||||
switch (this.src) {
|
switch (this.src) {
|
||||||
case 'home': return this.$root.stream.useSharedConnection('homeTimeline');
|
case 'home': return this.$root.stream.useSharedConnection('homeTimeline');
|
||||||
case 'local': return this.$root.stream.useSharedConnection('localTimeline');
|
case 'local': return this.$root.stream.useSharedConnection('localTimeline');
|
||||||
case 'hybrid': return this.$root.stream.useSharedConnection('hybridTimeline');
|
case 'social': return this.$root.stream.useSharedConnection('socialTimeline');
|
||||||
case 'global': return this.$root.stream.useSharedConnection('globalTimeline');
|
case 'global': return this.$root.stream.useSharedConnection('globalTimeline');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -60,7 +60,7 @@ export default Vue.extend({
|
|||||||
switch (this.src) {
|
switch (this.src) {
|
||||||
case 'home': return 'notes/timeline';
|
case 'home': return 'notes/timeline';
|
||||||
case 'local': return 'notes/local-timeline';
|
case 'local': return 'notes/local-timeline';
|
||||||
case 'hybrid': return 'notes/hybrid-timeline';
|
case 'social': return 'notes/social-timeline';
|
||||||
case 'global': return 'notes/global-timeline';
|
case 'global': return 'notes/global-timeline';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -85,12 +85,12 @@ export default Vue.extend({
|
|||||||
notes.pop();
|
notes.pop();
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: notes[notes.length - 1].id
|
more: true
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -107,7 +107,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
this.$root.getMeta().then(meta => {
|
this.$root.getMeta().then(meta => {
|
||||||
this.disabled = !this.$store.state.i.isModerator && !this.$store.state.i.isAdmin && (
|
this.disabled = !this.$store.state.i.isModerator && !this.$store.state.i.isAdmin && (
|
||||||
meta.disableLocalTimeline && ['local', 'hybrid'].includes(this.src) ||
|
meta.disableLocalTimeline && ['local', 'social'].includes(this.src) ||
|
||||||
meta.disableGlobalTimeline && ['global'].includes(this.src));
|
meta.disableGlobalTimeline && ['global'].includes(this.src));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -95,12 +95,12 @@ export default Vue.extend({
|
|||||||
notes.pop();
|
notes.pop();
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: notes[notes.length - 1].id
|
more: true
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -106,16 +106,6 @@ export default Vue.extend({
|
|||||||
value: deck
|
value: deck
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 互換性のため
|
|
||||||
if (this.$store.state.device.deck != null && this.$store.state.device.deck.layout == null) {
|
|
||||||
this.$store.commit('device/set', {
|
|
||||||
key: 'deck',
|
|
||||||
value: Object.assign({}, this.$store.state.device.deck, {
|
|
||||||
layout: this.$store.state.device.deck.columns.map(c => [c.id])
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -155,11 +145,11 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
icon: 'share-alt',
|
icon: 'share-alt',
|
||||||
text: this.$t('@deck.hybrid'),
|
text: this.$t('@deck.social'),
|
||||||
action: () => {
|
action: () => {
|
||||||
this.$store.commit('device/addDeckColumn', {
|
this.$store.commit('device/addDeckColumn', {
|
||||||
id: uuid(),
|
id: uuid(),
|
||||||
type: 'hybrid'
|
type: 'social'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -199,7 +189,7 @@ export default Vue.extend({
|
|||||||
title: this.$t('@deck.select-list'),
|
title: this.$t('@deck.select-list'),
|
||||||
select: {
|
select: {
|
||||||
items: lists.map(list => ({
|
items: lists.map(list => ({
|
||||||
value: list.id, text: list.title
|
value: list.id, text: list.name
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
showCancelButton: true
|
showCancelButton: true
|
||||||
@ -312,7 +302,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
isTlColumn(id) {
|
isTlColumn(id) {
|
||||||
const column = this.columns.find(c => c.id === id);
|
const column = this.columns.find(c => c.id === id);
|
||||||
return ['home', 'local', 'hybrid', 'global', 'list', 'hashtag', 'mentions', 'direct'].includes(column.type);
|
return ['home', 'local', 'social', 'global', 'list', 'hashtag', 'mentions', 'direct'].includes(column.type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<ui-container :show-header="false" v-if="meta && stats">
|
<ui-container :show-header="false" v-if="meta && stats">
|
||||||
<div class="kpdsmpnk" :style="{ backgroundImage: meta.bannerUrl ? `url(${meta.bannerUrl})` : null }">
|
<div class="kpdsmpnk" :style="{ backgroundImage: meta.bannerUrl ? `url(${meta.bannerUrl})` : null }">
|
||||||
<div>
|
<div>
|
||||||
<router-link to="/explore" class="title">{{ $t('explore', { host: meta.name }) }}</router-link>
|
<router-link to="/explore" class="title">{{ $t('explore', { host: meta.name || 'Misskey' }) }}</router-link>
|
||||||
<span>{{ $t('users-info', { users: num(stats.originalUsersCount) }) }}</span>
|
<span>{{ $t('users-info', { users: num(stats.originalUsersCount) }) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -13,8 +13,8 @@
|
|||||||
<template #header><fa :icon="faHashtag" fixed-width/>{{ $t('popular-tags') }}</template>
|
<template #header><fa :icon="faHashtag" fixed-width/>{{ $t('popular-tags') }}</template>
|
||||||
|
|
||||||
<div class="vxjfqztj">
|
<div class="vxjfqztj">
|
||||||
<router-link v-for="tag in tagsLocal" :to="`/explore/tags/${tag.tag}`" :key="'local:' + tag.tag" class="local">{{ tag.tag }}</router-link>
|
<router-link v-for="tag in tagsLocal" :to="`/explore/tags/${tag.name}`" :key="'local:' + tag.name" class="local">{{ tag.name }}</router-link>
|
||||||
<router-link v-for="tag in tagsRemote" :to="`/explore/tags/${tag.tag}`" :key="'remote:' + tag.tag">{{ tag.tag }}</router-link>
|
<router-link v-for="tag in tagsRemote" :to="`/explore/tags/${tag.name}`" :key="'remote:' + tag.name">{{ tag.name }}</router-link>
|
||||||
</div>
|
</div>
|
||||||
</ui-container>
|
</ui-container>
|
||||||
|
|
||||||
|
@ -9,20 +9,30 @@ import Vue from 'vue';
|
|||||||
import parseAcct from '../../../../../misc/acct/parse';
|
import parseAcct from '../../../../../misc/acct/parse';
|
||||||
import i18n from '../../../i18n';
|
import i18n from '../../../i18n';
|
||||||
|
|
||||||
|
const fetchLimit = 30;
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
i18n: i18n(''),
|
i18n: i18n(),
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
makePromise: cursor => this.$root.api('users/followers', {
|
makePromise: cursor => this.$root.api('users/followers', {
|
||||||
...parseAcct(this.$route.params.user),
|
...parseAcct(this.$route.params.user),
|
||||||
limit: 30,
|
limit: fetchLimit + 1,
|
||||||
cursor: cursor ? cursor : undefined
|
untilId: cursor ? cursor : undefined,
|
||||||
}).then(x => {
|
}).then(followings => {
|
||||||
return {
|
if (followings.length == fetchLimit + 1) {
|
||||||
users: x.users,
|
followings.pop();
|
||||||
cursor: x.next
|
return {
|
||||||
};
|
users: followings.map(following => following.follower),
|
||||||
|
cursor: followings[followings.length - 1].id
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
users: followings.map(following => following.follower),
|
||||||
|
more: false
|
||||||
|
};
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -7,19 +7,32 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import parseAcct from '../../../../../misc/acct/parse';
|
import parseAcct from '../../../../../misc/acct/parse';
|
||||||
|
import i18n from '../../../i18n';
|
||||||
|
|
||||||
|
const fetchLimit = 30;
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
|
i18n: i18n(),
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
makePromise: cursor => this.$root.api('users/following', {
|
makePromise: cursor => this.$root.api('users/following', {
|
||||||
...parseAcct(this.$route.params.user),
|
...parseAcct(this.$route.params.user),
|
||||||
limit: 30,
|
limit: fetchLimit + 1,
|
||||||
cursor: cursor ? cursor : undefined
|
untilId: cursor ? cursor : undefined,
|
||||||
}).then(x => {
|
}).then(followings => {
|
||||||
return {
|
if (followings.length == fetchLimit + 1) {
|
||||||
users: x.users,
|
followings.pop();
|
||||||
cursor: x.next
|
return {
|
||||||
};
|
users: followings.map(following => following.followee),
|
||||||
|
cursor: followings[followings.length - 1].id
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
users: followings.map(following => following.followee),
|
||||||
|
more: false
|
||||||
|
};
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -42,7 +42,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$root.getMeta().then(meta => {
|
this.$root.getMeta().then(meta => {
|
||||||
this.name = meta.name;
|
this.name = meta.name || 'Misskey';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -176,10 +176,22 @@ export default define({
|
|||||||
post() {
|
post() {
|
||||||
this.posting = true;
|
this.posting = true;
|
||||||
|
|
||||||
|
let visibility = 'public';
|
||||||
|
let localOnly = false;
|
||||||
|
|
||||||
|
const m = this.$store.state.settings.defaultNoteVisibility.match(/^local-(.+)/);
|
||||||
|
if (m) {
|
||||||
|
visibility = m[1];
|
||||||
|
localOnly = true;
|
||||||
|
} else {
|
||||||
|
visibility = this.$store.state.settings.defaultNoteVisibility;
|
||||||
|
}
|
||||||
|
|
||||||
this.$root.api('notes/create', {
|
this.$root.api('notes/create', {
|
||||||
text: this.text == '' ? undefined : this.text,
|
text: this.text == '' ? undefined : this.text,
|
||||||
fileIds: this.files.length > 0 ? this.files.map(f => f.id) : undefined,
|
fileIds: this.files.length > 0 ? this.files.map(f => f.id) : undefined,
|
||||||
visibility: this.$store.state.settings.defaultNoteVisibility
|
visibility,
|
||||||
|
localOnly,
|
||||||
}).then(data => {
|
}).then(data => {
|
||||||
this.clear();
|
this.clear();
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<p>Maintainer: <b><a :href="'mailto:' + meta.maintainer.email" target="_blank">{{ meta.maintainer.name }}</a></b></p>
|
<p>Maintainer: <b><a :href="'mailto:' + meta.maintainerEmail" target="_blank">{{ meta.maintainerName }}</a></b></p>
|
||||||
<p>Machine: {{ meta.machine }}</p>
|
<p>Machine: {{ meta.machine }}</p>
|
||||||
<p>Node: {{ meta.node }}</p>
|
<p>Node: {{ meta.node }}</p>
|
||||||
<p>Version: {{ meta.version }} </p>
|
<p>Version: {{ meta.version }} </p>
|
||||||
|
@ -60,7 +60,7 @@ export default Vue.extend({
|
|||||||
return this.browser.selectedFiles.some(f => f.id == this.file.id);
|
return this.browser.selectedFiles.some(f => f.id == this.file.id);
|
||||||
},
|
},
|
||||||
title(): string {
|
title(): string {
|
||||||
return `${this.file.name}\n${this.file.type} ${Vue.filter('bytes')(this.file.datasize)}`;
|
return `${this.file.name}\n${this.file.type} ${Vue.filter('bytes')(this.file.size)}`;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -54,11 +54,11 @@
|
|||||||
</button>
|
</button>
|
||||||
<button v-if="!isMyNote && appearNote.myReaction == null" class="reactionButton button" @click="react()" ref="reactButton" :title="$t('add-reaction')">
|
<button v-if="!isMyNote && appearNote.myReaction == null" class="reactionButton button" @click="react()" ref="reactButton" :title="$t('add-reaction')">
|
||||||
<fa icon="plus"/>
|
<fa icon="plus"/>
|
||||||
<p class="count" v-if="Object.values(appearNote.reactionCounts).some(x => x)">{{ Object.values(appearNote.reactionCounts).reduce((a, c) => a + c, 0) }}</p>
|
<p class="count" v-if="Object.values(appearNote.reactions).some(x => x)">{{ Object.values(appearNote.reactions).reduce((a, c) => a + c, 0) }}</p>
|
||||||
</button>
|
</button>
|
||||||
<button v-if="!isMyNote && appearNote.myReaction != null" class="reactionButton reacted button" @click="undoReact(appearNote)" ref="reactButton" :title="$t('undo-reaction')">
|
<button v-if="!isMyNote && appearNote.myReaction != null" class="reactionButton reacted button" @click="undoReact(appearNote)" ref="reactButton" :title="$t('undo-reaction')">
|
||||||
<fa icon="minus"/>
|
<fa icon="minus"/>
|
||||||
<p class="count" v-if="Object.values(appearNote.reactionCounts).some(x => x)">{{ Object.values(appearNote.reactionCounts).reduce((a, c) => a + c, 0) }}</p>
|
<p class="count" v-if="Object.values(appearNote.reactions).some(x => x)">{{ Object.values(appearNote.reactions).reduce((a, c) => a + c, 0) }}</p>
|
||||||
</button>
|
</button>
|
||||||
<button @click="menu()" ref="menuButton" class="button">
|
<button @click="menu()" ref="menuButton" class="button">
|
||||||
<fa icon="ellipsis-h"/>
|
<fa icon="ellipsis-h"/>
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
</template>
|
</template>
|
||||||
</component>
|
</component>
|
||||||
|
|
||||||
<footer v-if="cursor != null">
|
<footer v-if="more">
|
||||||
<button @click="more" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
|
<button @click="fetchMore()" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
|
||||||
<template v-if="!moreFetching">{{ $t('@.load-more') }}</template>
|
<template v-if="!moreFetching">{{ $t('@.load-more') }}</template>
|
||||||
<template v-if="moreFetching"><fa icon="spinner" pulse fixed-width/></template>
|
<template v-if="moreFetching"><fa icon="spinner" pulse fixed-width/></template>
|
||||||
</button>
|
</button>
|
||||||
@ -58,7 +58,7 @@ export default Vue.extend({
|
|||||||
fetching: true,
|
fetching: true,
|
||||||
moreFetching: false,
|
moreFetching: false,
|
||||||
inited: false,
|
inited: false,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ export default Vue.extend({
|
|||||||
this.notes = x;
|
this.notes = x;
|
||||||
} else {
|
} else {
|
||||||
this.notes = x.notes;
|
this.notes = x.notes;
|
||||||
this.cursor = x.cursor;
|
this.more = x.more;
|
||||||
}
|
}
|
||||||
this.inited = true;
|
this.inited = true;
|
||||||
this.fetching = false;
|
this.fetching = false;
|
||||||
@ -122,12 +122,12 @@ export default Vue.extend({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
more() {
|
fetchMore() {
|
||||||
if (this.cursor == null || this.moreFetching) return;
|
if (!this.more || this.moreFetching) return;
|
||||||
this.moreFetching = true;
|
this.moreFetching = true;
|
||||||
this.makePromise(this.cursor).then(x => {
|
this.makePromise(this.notes[this.notes.length - 1].id).then(x => {
|
||||||
this.notes = this.notes.concat(x.notes);
|
this.notes = this.notes.concat(x.notes);
|
||||||
this.cursor = x.cursor;
|
this.more = x.more;
|
||||||
this.moreFetching = false;
|
this.moreFetching = false;
|
||||||
}, e => {
|
}, e => {
|
||||||
this.moreFetching = false;
|
this.moreFetching = false;
|
||||||
@ -157,6 +157,7 @@ export default Vue.extend({
|
|||||||
// オーバーフローしたら古い投稿は捨てる
|
// オーバーフローしたら古い投稿は捨てる
|
||||||
if (this.notes.length >= displayLimit) {
|
if (this.notes.length >= displayLimit) {
|
||||||
this.notes = this.notes.slice(0, displayLimit);
|
this.notes = this.notes.slice(0, displayLimit);
|
||||||
|
this.more = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.queue.push(note);
|
this.queue.push(note);
|
||||||
@ -181,7 +182,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
if (this.$store.state.settings.fetchOnScroll !== false) {
|
if (this.$store.state.settings.fetchOnScroll !== false) {
|
||||||
const current = window.scrollY + window.innerHeight;
|
const current = window.scrollY + window.innerHeight;
|
||||||
if (current > document.body.offsetHeight - 8) this.more();
|
if (current > document.body.offsetHeight - 8) this.fetchMore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="notification.type == 'poll_vote'">
|
<template v-if="notification.type == 'pollVote'">
|
||||||
<mk-avatar class="avatar" :user="notification.user"/>
|
<mk-avatar class="avatar" :user="notification.user"/>
|
||||||
<div class="text">
|
<div class="text">
|
||||||
<p><fa icon="chart-pie"/><a :href="notification.user | userPage" v-user-preview="notification.user.id">
|
<p><fa icon="chart-pie"/><a :href="notification.user | userPage" v-user-preview="notification.user.id">
|
||||||
|
@ -30,12 +30,12 @@ export default Vue.extend({
|
|||||||
notes.pop();
|
notes.pop();
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: notes[notes.length - 1].id
|
more: true
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<mk-window ref="window" width="450px" height="500px" @closed="destroyDom">
|
<mk-window ref="window" width="450px" height="500px" @closed="destroyDom">
|
||||||
<template #header><fa icon="list"/> {{ list.title }}</template>
|
<template #header><fa icon="list"/> {{ list.name }}</template>
|
||||||
|
|
||||||
<x-editor :list="list"/>
|
<x-editor :list="list"/>
|
||||||
</mk-window>
|
</mk-window>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<div class="xkxvokkjlptzyewouewmceqcxhpgzprp">
|
<div class="xkxvokkjlptzyewouewmceqcxhpgzprp">
|
||||||
<button class="ui" @click="add">{{ $t('create-list') }}</button>
|
<button class="ui" @click="add">{{ $t('create-list') }}</button>
|
||||||
<a v-for="list in lists" :key="list.id" @click="choice(list)">{{ list.title }}</a>
|
<a v-for="list in lists" :key="list.id" @click="choice(list)">{{ list.name }}</a>
|
||||||
</div>
|
</div>
|
||||||
</mk-window>
|
</mk-window>
|
||||||
</template>
|
</template>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</sequential-entrance>
|
</sequential-entrance>
|
||||||
<div class="more" v-if="existMore">
|
<div class="more" v-if="existMore">
|
||||||
<ui-button inline @click="more">{{ $t('@.load-more') }}</ui-button>
|
<ui-button inline @click="fetchMore()">{{ $t('@.load-more') }}</ui-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -48,7 +48,7 @@ export default Vue.extend({
|
|||||||
Progress.done();
|
Progress.done();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
more() {
|
fetchMore() {
|
||||||
this.moreFetching = true;
|
this.moreFetching = true;
|
||||||
this.$root.api('i/favorites', {
|
this.$root.api('i/favorites', {
|
||||||
limit: 11,
|
limit: 11,
|
||||||
|
@ -101,7 +101,7 @@ export default Vue.extend({
|
|||||||
computed: {
|
computed: {
|
||||||
home(): any[] {
|
home(): any[] {
|
||||||
if (this.$store.getters.isSignedIn) {
|
if (this.$store.getters.isSignedIn) {
|
||||||
return this.$store.state.settings.home || [];
|
return this.$store.state.device.home || [];
|
||||||
} else {
|
} else {
|
||||||
return [{
|
return [{
|
||||||
name: 'instance',
|
name: 'instance',
|
||||||
@ -182,12 +182,8 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
if (this.$store.state.settings.home == null) {
|
if (this.$store.state.device.home == null) {
|
||||||
this.$root.api('i/update_home', {
|
this.$store.commit('device/setHome', _defaultDesktopHomeWidgets);
|
||||||
home: _defaultDesktopHomeWidgets
|
|
||||||
}).then(() => {
|
|
||||||
this.$store.commit('settings/setHome', _defaultDesktopHomeWidgets);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -226,7 +222,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
addWidget() {
|
addWidget() {
|
||||||
this.$store.dispatch('settings/addHomeWidget', {
|
this.$store.commit('device/addHomeWidget', {
|
||||||
name: this.widgetAdderSelected,
|
name: this.widgetAdderSelected,
|
||||||
id: uuid(),
|
id: uuid(),
|
||||||
place: 'left',
|
place: 'left',
|
||||||
@ -237,12 +233,9 @@ export default Vue.extend({
|
|||||||
saveHome() {
|
saveHome() {
|
||||||
const left = this.widgets.left;
|
const left = this.widgets.left;
|
||||||
const right = this.widgets.right;
|
const right = this.widgets.right;
|
||||||
this.$store.commit('settings/setHome', left.concat(right));
|
this.$store.commit('device/setHome', left.concat(right));
|
||||||
for (const w of left) w.place = 'left';
|
for (const w of left) w.place = 'left';
|
||||||
for (const w of right) w.place = 'right';
|
for (const w of right) w.place = 'right';
|
||||||
this.$root.api('i/update_home', {
|
|
||||||
home: this.home
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
done() {
|
done() {
|
||||||
|
@ -35,7 +35,7 @@ export default Vue.extend({
|
|||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -21,7 +21,7 @@ export default Vue.extend({
|
|||||||
i18n: i18n('desktop/views/pages/tag.vue'),
|
i18n: i18n('desktop/views/pages/tag.vue'),
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
makePromise: cursor => this.$root.api('notes/search_by_tag', {
|
makePromise: cursor => this.$root.api('notes/search-by-tag', {
|
||||||
limit: limit + 1,
|
limit: limit + 1,
|
||||||
offset: cursor ? cursor : undefined,
|
offset: cursor ? cursor : undefined,
|
||||||
tag: this.$route.params.tag
|
tag: this.$route.params.tag
|
||||||
@ -35,7 +35,7 @@ export default Vue.extend({
|
|||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -58,7 +58,7 @@ export default Vue.extend({
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (this.src == 'tag') {
|
if (this.src == 'tag') {
|
||||||
this.endpoint = 'notes/search_by_tag';
|
this.endpoint = 'notes/search-by-tag';
|
||||||
this.query = {
|
this.query = {
|
||||||
query: this.tagTl.query
|
query: this.tagTl.query
|
||||||
};
|
};
|
||||||
@ -77,9 +77,9 @@ export default Vue.extend({
|
|||||||
this.endpoint = 'notes/local-timeline';
|
this.endpoint = 'notes/local-timeline';
|
||||||
this.connection = this.$root.stream.useSharedConnection('localTimeline');
|
this.connection = this.$root.stream.useSharedConnection('localTimeline');
|
||||||
this.connection.on('note', prepend);
|
this.connection.on('note', prepend);
|
||||||
} else if (this.src == 'hybrid') {
|
} else if (this.src == 'social') {
|
||||||
this.endpoint = 'notes/hybrid-timeline';
|
this.endpoint = 'notes/social-timeline';
|
||||||
this.connection = this.$root.stream.useSharedConnection('hybridTimeline');
|
this.connection = this.$root.stream.useSharedConnection('socialTimeline');
|
||||||
this.connection.on('note', prepend);
|
this.connection.on('note', prepend);
|
||||||
} else if (this.src == 'global') {
|
} else if (this.src == 'global') {
|
||||||
this.endpoint = 'notes/global-timeline';
|
this.endpoint = 'notes/global-timeline';
|
||||||
@ -113,12 +113,12 @@ export default Vue.extend({
|
|||||||
notes.pop();
|
notes.pop();
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: notes[notes.length - 1].id
|
more: true
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
<header class="zahtxcqi">
|
<header class="zahtxcqi">
|
||||||
<span :data-active="src == 'home'" @click="src = 'home'"><fa icon="home"/> {{ $t('home') }}</span>
|
<span :data-active="src == 'home'" @click="src = 'home'"><fa icon="home"/> {{ $t('home') }}</span>
|
||||||
<span :data-active="src == 'local'" @click="src = 'local'" v-if="enableLocalTimeline"><fa :icon="['far', 'comments']"/> {{ $t('local') }}</span>
|
<span :data-active="src == 'local'" @click="src = 'local'" v-if="enableLocalTimeline"><fa :icon="['far', 'comments']"/> {{ $t('local') }}</span>
|
||||||
<span :data-active="src == 'hybrid'" @click="src = 'hybrid'" v-if="enableLocalTimeline"><fa icon="share-alt"/> {{ $t('hybrid') }}</span>
|
<span :data-active="src == 'social'" @click="src = 'social'" v-if="enableLocalTimeline"><fa icon="share-alt"/> {{ $t('social') }}</span>
|
||||||
<span :data-active="src == 'global'" @click="src = 'global'" v-if="enableGlobalTimeline"><fa icon="globe"/> {{ $t('global') }}</span>
|
<span :data-active="src == 'global'" @click="src = 'global'" v-if="enableGlobalTimeline"><fa icon="globe"/> {{ $t('global') }}</span>
|
||||||
<span :data-active="src == 'tag'" @click="src = 'tag'" v-if="tagTl"><fa icon="hashtag"/> {{ tagTl.title }}</span>
|
<span :data-active="src == 'tag'" @click="src = 'tag'" v-if="tagTl"><fa icon="hashtag"/> {{ tagTl.title }}</span>
|
||||||
<span :data-active="src == 'list'" @click="src = 'list'" v-if="list"><fa icon="list"/> {{ list.title }}</span>
|
<span :data-active="src == 'list'" @click="src = 'list'" v-if="list"><fa icon="list"/> {{ list.name }}</span>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button :data-active="src == 'mentions'" @click="src = 'mentions'" :title="$t('mentions')"><fa icon="at"/><i class="indicator" v-if="$store.state.i.hasUnreadMentions"><fa icon="circle"/></i></button>
|
<button :data-active="src == 'mentions'" @click="src = 'mentions'" :title="$t('mentions')"><fa icon="at"/><i class="indicator" v-if="$store.state.i.hasUnreadMentions"><fa icon="circle"/></i></button>
|
||||||
<button :data-active="src == 'messages'" @click="src = 'messages'" :title="$t('messages')"><fa :icon="['far', 'envelope']"/><i class="indicator" v-if="$store.state.i.hasUnreadSpecifiedNotes"><fa icon="circle"/></i></button>
|
<button :data-active="src == 'messages'" @click="src = 'messages'" :title="$t('messages')"><fa :icon="['far', 'envelope']"/><i class="indicator" v-if="$store.state.i.hasUnreadSpecifiedNotes"><fa icon="circle"/></i></button>
|
||||||
@ -78,7 +78,7 @@ export default Vue.extend({
|
|||||||
) && this.src === 'global') this.src = 'local';
|
) && this.src === 'global') this.src = 'local';
|
||||||
if (!(
|
if (!(
|
||||||
this.enableLocalTimeline = !meta.disableLocalTimeline || this.$store.state.i.isModerator || this.$store.state.i.isAdmin
|
this.enableLocalTimeline = !meta.disableLocalTimeline || this.$store.state.i.isModerator || this.$store.state.i.isAdmin
|
||||||
) && ['local', 'hybrid'].includes(this.src)) this.src = 'home';
|
) && ['local', 'social'].includes(this.src)) this.src = 'home';
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.$store.state.device.tl) {
|
if (this.$store.state.device.tl) {
|
||||||
@ -89,7 +89,7 @@ export default Vue.extend({
|
|||||||
this.tagTl = this.$store.state.device.tl.arg;
|
this.tagTl = this.$store.state.device.tl.arg;
|
||||||
}
|
}
|
||||||
} else if (this.$store.state.i.followingCount == 0) {
|
} else if (this.$store.state.i.followingCount == 0) {
|
||||||
this.src = 'hybrid';
|
this.src = 'social';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ export default Vue.extend({
|
|||||||
|
|
||||||
menu = menu.concat(lists.map(list => ({
|
menu = menu.concat(lists.map(list => ({
|
||||||
icon: 'list',
|
icon: 'list',
|
||||||
text: list.title,
|
text: list.name,
|
||||||
action: () => {
|
action: () => {
|
||||||
this.list = list;
|
this.list = list;
|
||||||
this.src = 'list';
|
this.src = 'list';
|
||||||
|
@ -36,8 +36,8 @@
|
|||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<span class="location" v-if="user.host === null && user.profile.location"><fa icon="map-marker"/> {{ user.profile.location }}</span>
|
<span class="location" v-if="user.host === null && user.location"><fa icon="map-marker"/> {{ user.location }}</span>
|
||||||
<span class="birthday" v-if="user.host === null && user.profile.birthday"><fa icon="birthday-cake"/> {{ user.profile.birthday.replace('-', $t('year')).replace('-', $t('month')) + $t('day') }} ({{ $t('years-old', { age }) }})</span>
|
<span class="birthday" v-if="user.host === null && user.birthday"><fa icon="birthday-cake"/> {{ user.birthday.replace('-', $t('year')).replace('-', $t('month')) + $t('day') }} ({{ $t('years-old', { age }) }})</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="status">
|
<div class="status">
|
||||||
<router-link :to="user | userPage()" class="notes-count"><b>{{ user.notesCount | number }}</b>{{ $t('posts') }}</router-link>
|
<router-link :to="user | userPage()" class="notes-count"><b>{{ user.notesCount | number }}</b>{{ $t('posts') }}</router-link>
|
||||||
@ -71,7 +71,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
age(): number {
|
age(): number {
|
||||||
return age(this.user.profile.birthday);
|
return age(this.user.birthday);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -42,12 +42,12 @@ export default Vue.extend({
|
|||||||
notes.pop();
|
notes.pop();
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: notes[notes.length - 1].id
|
more: true
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
<div class="body">
|
<div class="body">
|
||||||
<div class="main block">
|
<div class="main block">
|
||||||
<div>
|
<div>
|
||||||
<h1 v-if="name != 'Misskey'">{{ name }}</h1>
|
<h1 v-if="name != null">{{ name }}</h1>
|
||||||
<h1 v-else><img svg-inline src="../../../../assets/title.svg" :alt="name"></h1>
|
<h1 v-else><img svg-inline src="../../../../assets/title.svg" alt="Misskey"></h1>
|
||||||
|
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<span><b>{{ host }}</b> - <span v-html="$t('powered-by-misskey')"></span></span>
|
<span><b>{{ host }}</b> - <span v-html="$t('powered-by-misskey')"></span></span>
|
||||||
@ -87,7 +87,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div v-if="meta" class="body">
|
<div v-if="meta" class="body">
|
||||||
<p>Version: <b>{{ meta.version }}</b></p>
|
<p>Version: <b>{{ meta.version }}</b></p>
|
||||||
<p>Maintainer: <b><a :href="'mailto:' + meta.maintainer.email" target="_blank">{{ meta.maintainer.name }}</a></b></p>
|
<p>Maintainer: <b><a :href="'mailto:' + meta.maintainerEmail" target="_blank">{{ meta.maintainerName }}</a></b></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -162,7 +162,7 @@ export default Vue.extend({
|
|||||||
banner: null,
|
banner: null,
|
||||||
copyright,
|
copyright,
|
||||||
host: toUnicode(host),
|
host: toUnicode(host),
|
||||||
name: 'Misskey',
|
name: null,
|
||||||
description: '',
|
description: '',
|
||||||
announcements: [],
|
announcements: [],
|
||||||
photos: []
|
photos: []
|
||||||
|
@ -15,15 +15,21 @@
|
|||||||
<b-form-group :description="$t('description')">
|
<b-form-group :description="$t('description')">
|
||||||
<b-alert show variant="warning"><fa icon="exclamation-triangle"/> {{ $t('authority-warning') }}</b-alert>
|
<b-alert show variant="warning"><fa icon="exclamation-triangle"/> {{ $t('authority-warning') }}</b-alert>
|
||||||
<b-form-checkbox-group v-model="permission" stacked>
|
<b-form-checkbox-group v-model="permission" stacked>
|
||||||
<b-form-checkbox value="account-read">{{ $t('account-read') }}</b-form-checkbox>
|
<b-form-checkbox value="read:account">{{ $t('read:account') }}</b-form-checkbox>
|
||||||
<b-form-checkbox value="account-write">{{ $t('account-write') }}</b-form-checkbox>
|
<b-form-checkbox value="write:account">{{ $t('write:account') }}</b-form-checkbox>
|
||||||
<b-form-checkbox value="note-write">{{ $t('note-write') }}</b-form-checkbox>
|
<b-form-checkbox value="write:notes">{{ $t('write:notes') }}</b-form-checkbox>
|
||||||
<b-form-checkbox value="reaction-write">{{ $t('reaction-write') }}</b-form-checkbox>
|
<b-form-checkbox value="read:reactions">{{ $t('read:reactions') }}</b-form-checkbox>
|
||||||
<b-form-checkbox value="following-write">{{ $t('following-write') }}</b-form-checkbox>
|
<b-form-checkbox value="write:reactions">{{ $t('write:reactions') }}</b-form-checkbox>
|
||||||
<b-form-checkbox value="drive-read">{{ $t('drive-read') }}</b-form-checkbox>
|
<b-form-checkbox value="read:following">{{ $t('read:following') }}</b-form-checkbox>
|
||||||
<b-form-checkbox value="drive-write">{{ $t('drive-write') }}</b-form-checkbox>
|
<b-form-checkbox value="write:following">{{ $t('write:following') }}</b-form-checkbox>
|
||||||
<b-form-checkbox value="notification-read">{{ $t('notification-read') }}</b-form-checkbox>
|
<b-form-checkbox value="read:mutes">{{ $t('read:mutes') }}</b-form-checkbox>
|
||||||
<b-form-checkbox value="notification-write">{{ $t('notification-write') }}</b-form-checkbox>
|
<b-form-checkbox value="write:mutes">{{ $t('write:mutes') }}</b-form-checkbox>
|
||||||
|
<b-form-checkbox value="read:blocks">{{ $t('read:blocks') }}</b-form-checkbox>
|
||||||
|
<b-form-checkbox value="write:blocks">{{ $t('write:blocks') }}</b-form-checkbox>
|
||||||
|
<b-form-checkbox value="read:drive">{{ $t('read:drive') }}</b-form-checkbox>
|
||||||
|
<b-form-checkbox value="write:drive">{{ $t('write:drive') }}</b-form-checkbox>
|
||||||
|
<b-form-checkbox value="read:notifications">{{ $t('read:notifications') }}</b-form-checkbox>
|
||||||
|
<b-form-checkbox value="write:notifications">{{ $t('write:notifications') }}</b-form-checkbox>
|
||||||
</b-form-checkbox-group>
|
</b-form-checkbox-group>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
</b-card>
|
</b-card>
|
||||||
|
@ -278,21 +278,6 @@ export default class MiOS extends EventEmitter {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('homeUpdated', x => {
|
|
||||||
this.store.commit('settings/setHome', x);
|
|
||||||
});
|
|
||||||
|
|
||||||
main.on('mobileHomeUpdated', x => {
|
|
||||||
this.store.commit('settings/setMobileHome', x);
|
|
||||||
});
|
|
||||||
|
|
||||||
main.on('widgetUpdated', x => {
|
|
||||||
this.store.commit('settings/updateWidget', {
|
|
||||||
id: x.id,
|
|
||||||
data: x.data
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// トークンが再生成されたとき
|
// トークンが再生成されたとき
|
||||||
// このままではMisskeyが利用できないので強制的にサインアウトさせる
|
// このままではMisskeyが利用できないので強制的にサインアウトさせる
|
||||||
main.on('myTokenRegenerated', () => {
|
main.on('myTokenRegenerated', () => {
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<span class="type"><mk-file-type-icon :type="file.type"/> {{ file.type }}</span>
|
<span class="type"><mk-file-type-icon :type="file.type"/> {{ file.type }}</span>
|
||||||
<span class="separator"></span>
|
<span class="separator"></span>
|
||||||
<span class="data-size">{{ file.datasize | bytes }}</span>
|
<span class="data-size">{{ file.size | bytes }}</span>
|
||||||
<span class="separator"></span>
|
<span class="separator"></span>
|
||||||
<span class="created-at" @click="showCreatedAt"><fa :icon="['far', 'clock']"/><mk-time :time="file.createdAt"/></span>
|
<span class="created-at" @click="showCreatedAt"><fa :icon="['far', 'clock']"/><mk-time :time="file.createdAt"/></span>
|
||||||
<template v-if="file.isSensitive">
|
<template v-if="file.isSensitive">
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<footer>
|
<footer>
|
||||||
<span class="type"><mk-file-type-icon :type="file.type"/>{{ file.type }}</span>
|
<span class="type"><mk-file-type-icon :type="file.type"/>{{ file.type }}</span>
|
||||||
<span class="separator"></span>
|
<span class="separator"></span>
|
||||||
<span class="data-size">{{ file.datasize | bytes }}</span>
|
<span class="data-size">{{ file.size | bytes }}</span>
|
||||||
<span class="separator"></span>
|
<span class="separator"></span>
|
||||||
<span class="created-at"><fa :icon="['far', 'clock']"/><mk-time :time="file.createdAt"/></span>
|
<span class="created-at"><fa :icon="['far', 'clock']"/><mk-time :time="file.createdAt"/></span>
|
||||||
<template v-if="file.isSensitive">
|
<template v-if="file.isSensitive">
|
||||||
|
@ -21,8 +21,8 @@
|
|||||||
</template>
|
</template>
|
||||||
</component>
|
</component>
|
||||||
|
|
||||||
<footer v-if="cursor != null">
|
<footer v-if="more">
|
||||||
<button @click="more" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
|
<button @click="fetchMore()" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
|
||||||
<template v-if="!moreFetching">{{ $t('@.load-more') }}</template>
|
<template v-if="!moreFetching">{{ $t('@.load-more') }}</template>
|
||||||
<template v-if="moreFetching"><fa icon="spinner" pulse fixed-width/></template>
|
<template v-if="moreFetching"><fa icon="spinner" pulse fixed-width/></template>
|
||||||
</button>
|
</button>
|
||||||
@ -53,7 +53,7 @@ export default Vue.extend({
|
|||||||
fetching: true,
|
fetching: true,
|
||||||
moreFetching: false,
|
moreFetching: false,
|
||||||
inited: false,
|
inited: false,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ export default Vue.extend({
|
|||||||
this.notes = x;
|
this.notes = x;
|
||||||
} else {
|
} else {
|
||||||
this.notes = x.notes;
|
this.notes = x.notes;
|
||||||
this.cursor = x.cursor;
|
this.more = x.more;
|
||||||
}
|
}
|
||||||
this.inited = true;
|
this.inited = true;
|
||||||
this.fetching = false;
|
this.fetching = false;
|
||||||
@ -123,12 +123,12 @@ export default Vue.extend({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
more() {
|
fetchMore() {
|
||||||
if (this.cursor == null || this.moreFetching) return;
|
if (!this.more || this.moreFetching) return;
|
||||||
this.moreFetching = true;
|
this.moreFetching = true;
|
||||||
this.makePromise(this.cursor).then(x => {
|
this.makePromise(this.notes[this.notes.length - 1].id).then(x => {
|
||||||
this.notes = this.notes.concat(x.notes);
|
this.notes = this.notes.concat(x.notes);
|
||||||
this.cursor = x.cursor;
|
this.more = x.more;
|
||||||
this.moreFetching = false;
|
this.moreFetching = false;
|
||||||
}, e => {
|
}, e => {
|
||||||
this.moreFetching = false;
|
this.moreFetching = false;
|
||||||
@ -151,6 +151,7 @@ export default Vue.extend({
|
|||||||
// オーバーフローしたら古い投稿は捨てる
|
// オーバーフローしたら古い投稿は捨てる
|
||||||
if (this.notes.length >= displayLimit) {
|
if (this.notes.length >= displayLimit) {
|
||||||
this.notes = this.notes.slice(0, displayLimit);
|
this.notes = this.notes.slice(0, displayLimit);
|
||||||
|
this.more = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.queue.push(note);
|
this.queue.push(note);
|
||||||
@ -180,7 +181,7 @@ export default Vue.extend({
|
|||||||
if (this.$el.offsetHeight == 0) return;
|
if (this.$el.offsetHeight == 0) return;
|
||||||
|
|
||||||
const current = window.scrollY + window.innerHeight;
|
const current = window.scrollY + window.innerHeight;
|
||||||
if (current > document.body.offsetHeight - 8) this.more();
|
if (current > document.body.offsetHeight - 8) this.fetchMore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="notification.type == 'poll_vote'">
|
<template v-if="notification.type == 'pollVote'">
|
||||||
<mk-avatar class="avatar" :user="notification.user"/>
|
<mk-avatar class="avatar" :user="notification.user"/>
|
||||||
<div class="text">
|
<div class="text">
|
||||||
<p><fa icon="chart-pie"/><mk-user-name :user="notification.user"/></p>
|
<p><fa icon="chart-pie"/><mk-user-name :user="notification.user"/></p>
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="notification poll_vote" v-if="notification.type == 'poll_vote'">
|
<div class="notification pollVote" v-if="notification.type == 'pollVote'">
|
||||||
<mk-avatar class="avatar" :user="notification.user"/>
|
<mk-avatar class="avatar" :user="notification.user"/>
|
||||||
<div>
|
<div>
|
||||||
<header>
|
<header>
|
||||||
|
@ -27,12 +27,12 @@ export default Vue.extend({
|
|||||||
notes.pop();
|
notes.pop();
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: notes[notes.length - 1].id
|
more: true
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
notes: notes,
|
notes: notes,
|
||||||
cursor: null
|
more: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user