-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
80 changed files
with
2,185 additions
and
752 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {MigrationInterface, QueryRunner} from "typeorm"; | ||
|
||
export class pubRelay1589023282116 implements MigrationInterface { | ||
name = 'pubRelay1589023282116' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`CREATE TYPE "relay_status_enum" AS ENUM('requesting', 'accepted', 'rejected')`, undefined); | ||
await queryRunner.query(`CREATE TABLE "relay" ("id" character varying(32) NOT NULL, "inbox" character varying(512) NOT NULL, "status" "relay_status_enum" NOT NULL, CONSTRAINT "PK_78ebc9cfddf4292633b7ba57aee" PRIMARY KEY ("id"))`, undefined); | ||
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0d9a1738f2cf7f3b1c3334dfab" ON "relay" ("inbox") `, undefined); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`DROP INDEX "IDX_0d9a1738f2cf7f3b1c3334dfab"`, undefined); | ||
await queryRunner.query(`DROP TABLE "relay"`, undefined); | ||
await queryRunner.query(`DROP TYPE "relay_status_enum"`, undefined); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<template> | ||
<div> | ||
<ui-card> | ||
<template #title><fa icon="plus"/> {{ $t('add-relay') }}</template> | ||
<section class="fit-top"> | ||
<ui-horizon-group inputs> | ||
<ui-input v-model="inbox"> | ||
<span>{{ $t('inbox') }}</span> | ||
</ui-input> | ||
</ui-horizon-group> | ||
<ui-button @click="add(inbox)">{{ $t('add') }}</ui-button> | ||
</section> | ||
</ui-card> | ||
|
||
<ui-card> | ||
<template #title><fa :icon="faProjectDiagram"/> {{ $t('added-relays') }}</template> | ||
<section v-for="relay in relays" :key="relay.inbox" class="relayath"> | ||
<div>{{ relay.inbox }}</div> | ||
<div>{{ $t(`status.${relay.status}`) }}</div> | ||
<ui-button @click="remove(relay.inbox)">{{ $t('remove') }}</ui-button> | ||
</section> | ||
</ui-card> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from 'vue'; | ||
import i18n from '../../i18n'; | ||
import { faProjectDiagram } from '@fortawesome/free-solid-svg-icons'; | ||
export default Vue.extend({ | ||
i18n: i18n('admin/views/relay.vue'), | ||
data() { | ||
return { | ||
relays: [], | ||
inbox: '', | ||
faProjectDiagram | ||
}; | ||
}, | ||
created() { | ||
this.reload(); | ||
}, | ||
computed: { | ||
}, | ||
methods: { | ||
add(inbox: string) { | ||
this.$root.api('admin/relays/add', { | ||
inbox | ||
}).then((relay: any) => { | ||
this.inbox = ''; | ||
this.reload(); | ||
}).catch((e: any) => { | ||
this.$root.dialog({ | ||
type: 'error', | ||
text: e.message || e | ||
}); | ||
}); | ||
}, | ||
remove(inbox: string) { | ||
this.$root.api('admin/relays/remove', { | ||
inbox | ||
}).then(() => { | ||
this.reload(); | ||
}).catch((e: any) => { | ||
this.$root.dialog({ | ||
type: 'error', | ||
text: e.message || e | ||
}); | ||
}); | ||
}, | ||
reload() { | ||
this.$root.api('admin/relays/list').then((relays: any) => { | ||
this.relays = relays; | ||
}); | ||
} | ||
} | ||
}); | ||
</script> | ||
|
||
<style lang="stylus" scoped> | ||
.relayath | ||
> div | ||
margin 0.3em | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.