Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Jan 20, 2020
1 parent 614260c commit 3f6a783
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 13 deletions.
5 changes: 5 additions & 0 deletions locales/ja-JP.yml
Expand Up @@ -259,6 +259,11 @@ watch: "ウォッチ"
unwatch: "ウォッチ解除"
accept: "許可"
reject: "拒否"
instanceName: "インスタンス名"
instanceDescription: "インスタンスの紹介"
maintainerName: "管理者の名前"
maintainerEmail: "管理者のメールアドレス"
tosUrl: "インスタンス"

_widgets:
memo: "付箋"
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
"version": "12.0.0-alpha.1",
"author": "syuilo <syuilotan@yahoo.co.jp>",
"version": "12.0.0-alpha.2",
"codename": "daybreak",
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions src/client/components/signup.vue
Expand Up @@ -37,13 +37,13 @@
<p v-if="passwordRetypeState == 'not-match'" style="color:#FF1161"><fa icon="exclamation-triangle" fixed-width/> {{ $t('password-not-matched') }}</p>
</template>
</x-input>
<x-switch v-model="ToSAgreement" v-if="meta.ToSUrl">
<x-switch v-model="ToSAgreement" v-if="meta.tosUrl">
<i18n path="agreeTo">
<a :href="meta.ToSUrl" target="_blank">{{ $t('tos') }}</a>
<a :href="meta.tosUrl" target="_blank">{{ $t('tos') }}</a>
</i18n>
</x-switch>
<div v-if="meta.enableRecaptcha" class="g-recaptcha" :data-sitekey="meta.recaptchaSiteKey" style="margin: 16px 0;"></div>
<x-button type="submit" :disabled=" submitting || !(meta.ToSUrl ? ToSAgreement : true) || passwordRetypeState == 'not-match'" primary>{{ $t('start') }}</x-button>
<x-button type="submit" :disabled=" submitting || !(meta.tosUrl ? ToSAgreement : true) || passwordRetypeState == 'not-match'" primary>{{ $t('start') }}</x-button>
</template>
</form>
</template>
Expand Down
34 changes: 31 additions & 3 deletions src/client/pages/instance/index.vue
Expand Up @@ -19,6 +19,19 @@
</div>
</section>

<section class="_section">
<div class="_content">
<x-input v-model="name">{{ $t('instanceName') }}</x-input>
<x-textarea v-model="description">{{ $t('instanceDescription') }}</x-textarea>
<x-input v-model="tosUrl"><template #icon><fa :icon="faLink"/></template>{{ $t('tosUrl') }}</x-input>
<x-input v-model="maintainerName">{{ $t('maintainerName') }}</x-input>
<x-input v-model="maintainerEmail" type="email"><template #icon><fa :icon="faEnvelope"/></template>{{ $t('maintainerEmail') }}</x-input>
</div>
<div class="_footer">
<x-button primary @click="save()"><fa :icon="faSave"/> {{ $t('save') }}</x-button>
</div>
</section>

<section class="_section">
<div class="_title"><fa :icon="faCloud"/> {{ $t('files') }}</div>
<div class="_content">
Expand Down Expand Up @@ -56,8 +69,8 @@

<script lang="ts">
import Vue from 'vue';
import { faGhost, faCog, faPlus, faCloud, faInfoCircle, faBan, faSave, faServer } from '@fortawesome/free-solid-svg-icons';
import { faTrashAlt } from '@fortawesome/free-regular-svg-icons';
import { faGhost, faCog, faPlus, faCloud, faInfoCircle, faBan, faSave, faServer, faLink } from '@fortawesome/free-solid-svg-icons';
import { faTrashAlt, faEnvelope } from '@fortawesome/free-regular-svg-icons';
import XButton from '../../components/ui/button.vue';
import XInput from '../../components/ui/input.vue';
import XTextarea from '../../components/ui/textarea.vue';
Expand Down Expand Up @@ -91,13 +104,23 @@ export default Vue.extend({
cacheRemoteFiles: false,
remoteDriveCapacityMb: 0,
blockedHosts: '',
faTrashAlt, faGhost, faCog, faPlus, faCloud, faInfoCircle, faBan, faSave, faServer
maintainerName: null,
maintainerEmail: null,
name: null,
description: null,
tosUrl: null,
faTrashAlt, faGhost, faCog, faPlus, faCloud, faInfoCircle, faBan, faSave, faServer, faLink, faEnvelope
}
},
created() {
this.$root.getMeta().then(meta => {
this.meta = meta;
this.name = this.meta.name;
this.description = this.meta.description;
this.tosUrl = this.meta.tosUrl;
this.maintainerName = this.meta.maintainerName;
this.maintainerEmail = this.meta.maintainerEmail;
this.proxyAccount = this.meta.proxyAccount;
this.cacheRemoteFiles = this.meta.cacheRemoteFiles;
this.remoteDriveCapacityMb = this.meta.driveCapacityPerRemoteUserMb;
Expand All @@ -116,6 +139,11 @@ export default Vue.extend({
methods: {
save() {
this.$root.api('admin/update-meta', {
name: this.name,
description: this.description,
tosUrl: this.tosUrl,
maintainerName: this.maintainerName,
maintainerEmail: this.maintainerEmail,
proxyAccount: this.proxyAccount,
cacheRemoteFiles: this.cacheRemoteFiles,
remoteDriveCapacityMb: this.remoteDriveCapacityMb,
Expand Down
6 changes: 3 additions & 3 deletions src/server/api/endpoints/admin/update-meta.ts
Expand Up @@ -333,7 +333,7 @@ export const meta = {
}
},

ToSUrl: {
tosUrl: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': '利用規約のURL'
Expand Down Expand Up @@ -579,8 +579,8 @@ export default define(meta, async (ps, me) => {
set.swPrivateKey = ps.swPrivateKey;
}

if (ps.ToSUrl !== undefined) {
set.ToSUrl = ps.ToSUrl;
if (ps.tosUrl !== undefined) {
set.ToSUrl = ps.tosUrl;
}

if (ps.repositoryUrl !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion src/server/api/endpoints/meta.ts
Expand Up @@ -111,7 +111,7 @@ export default define(meta, async (ps, me) => {
uri: config.url,
description: instance.description,
langs: instance.langs,
ToSUrl: instance.ToSUrl,
tosUrl: instance.ToSUrl,
repositoryUrl: instance.repositoryUrl,
feedbackUrl: instance.feedbackUrl,

Expand Down
2 changes: 1 addition & 1 deletion src/server/nodeinfo.ts
Expand Up @@ -59,7 +59,7 @@ const nodeinfo2 = async () => {
email: meta.maintainerEmail
},
langs: meta.langs,
ToSUrl: meta.ToSUrl,
tosUrl: meta.ToSUrl,
repositoryUrl: meta.repositoryUrl,
feedbackUrl: meta.feedbackUrl,
disableRegistration: meta.disableRegistration,
Expand Down

0 comments on commit 3f6a783

Please sign in to comment.