mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-12 13:10:05 +00:00
no message
This commit is contained in:
parent
2ee06803ee
commit
3a9853b1b0
1 changed files with 124 additions and 125 deletions
|
@ -1,9 +1,14 @@
|
|||
{{ define "page/blocked_domains" }}
|
||||
<template>
|
||||
<div>
|
||||
{{ template "page/head_start" .}}
|
||||
{{ template "page/head_end" .}}
|
||||
|
||||
{{ template "page/body_start" .}}
|
||||
<a-layout id="app" v-cloak :class="themeSwitcher.currentTheme">
|
||||
<a-sidebar></a-sidebar>
|
||||
<a-layout id="content-layout">
|
||||
<a-layout-content>
|
||||
<a-card :title="i18n('menu.blocked_domains')">
|
||||
<a-button type="primary" @click="showAddModal = true" style="margin-bottom: 16px;">
|
||||
{{ i18n "add" }}
|
||||
[[ i18n('add') ]]
|
||||
</a-button>
|
||||
<a-table-sortable
|
||||
:data-source="domains"
|
||||
|
@ -12,8 +17,8 @@
|
|||
style="margin-bottom: 16px;"
|
||||
>
|
||||
<a-table-column title="#" :customRender="(_, __, i) => i + 1" width="50" />
|
||||
<a-table-column title="{{ i18n "domain" }}" dataIndex="domain" key="domain" />
|
||||
<a-table-column title="{{ i18n "comment" }}" dataIndex="comment" key="comment" />
|
||||
<a-table-column title="[[ i18n('domain') ]]" dataIndex="domain" key="domain" />
|
||||
<a-table-column title="[[ i18n('comment') ]]" dataIndex="comment" key="comment" />
|
||||
<a-table-column
|
||||
:title="i18n('action')"
|
||||
key="action"
|
||||
|
@ -42,10 +47,16 @@
|
|||
</a-form>
|
||||
</a-modal>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
</a-layout-content>
|
||||
</a-layout>
|
||||
</a-layout>
|
||||
|
||||
{{ template "page/body_scripts" .}}
|
||||
{{ template "component/aSidebar" .}}
|
||||
{{ template "component/aThemeSwitch" .}}
|
||||
<script>
|
||||
new Vue({
|
||||
const app = new Vue({
|
||||
delimiters: ['[[', ']]'],
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
|
@ -58,19 +69,7 @@ new Vue({
|
|||
},
|
||||
methods: {
|
||||
i18n(key) {
|
||||
// Простейший i18n, можно заменить на глобальный
|
||||
const dict = {
|
||||
'menu.blocked_domains': 'Запрещённые сайты',
|
||||
'add': 'Добавить',
|
||||
'domain': 'Домен',
|
||||
'comment': 'Комментарий',
|
||||
'action': 'Действия',
|
||||
'add_domain': 'Добавить домен',
|
||||
'edit_domain': 'Редактировать домен',
|
||||
'edit': 'Редактировать',
|
||||
'delete': 'Удалить',
|
||||
};
|
||||
return dict[key] || key;
|
||||
return I18nManager ? I18nManager.t(key) : key;
|
||||
},
|
||||
fetchDomains() {
|
||||
axios.get('blocked-domains/').then(res => {
|
||||
|
@ -112,8 +111,8 @@ new Vue({
|
|||
},
|
||||
actionRender(record) {
|
||||
return (
|
||||
`<a @click="editDomainShow(${record.id})">${this.i18n('edit')}</a> |
|
||||
<a @click="deleteDomain(${record.id})">${this.i18n('delete')}</a>`
|
||||
`<a @click=\"editDomainShow(${record.id})\">${this.i18n('edit')}</a> | ` +
|
||||
`<a @click=\"deleteDomain(${record.id})\">${this.i18n('delete')}</a>`
|
||||
);
|
||||
},
|
||||
editDomainShow(id) {
|
||||
|
@ -127,6 +126,6 @@ new Vue({
|
|||
mounted() {
|
||||
this.fetchDomains();
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
{{ template "page/body_end" .}}
|
Loading…
Reference in a new issue