mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
Merge pull request #14 from vorobalek/master
fix my own fault (previous version of bindings did not work)
This commit is contained in:
commit
14774832c3
1 changed files with 62 additions and 78 deletions
|
@ -68,19 +68,19 @@
|
|||
<a-divider type="vertical"/>
|
||||
<a-popconfirm
|
||||
v-if="soft_delete&¶ms.trashed"
|
||||
cancelText="{{restore.cancel_text}}"
|
||||
okText="{{restore.ok_text}}"
|
||||
title="{{restore.title_text}}"
|
||||
@confirm="restore.exec(record[rowKey])">
|
||||
<a href="javascript:;">{{restore.action_text}}</a>
|
||||
:cancelText="cancel_text"
|
||||
:okText="ok_text"
|
||||
:title="restore_title_text"
|
||||
@confirm="restore(record[rowKey])">
|
||||
<a href="javascript:;">{{restore_action_text}}</a>
|
||||
</a-popconfirm>
|
||||
<a-popconfirm
|
||||
v-else
|
||||
cancelText="{{destroy.cancel_text}}"
|
||||
okText="{{destroy.ok_text}}"
|
||||
title="{{destroy.title_text}}"
|
||||
@confirm="destroy.exec(record[rowKey])">
|
||||
<a href="javascript:;">{{destroy.action_text}}</a>
|
||||
:cancelText="cancel_text"
|
||||
:okText="ok_text"
|
||||
:title="destroy_title_text"
|
||||
@confirm="destroy(record[rowKey])">
|
||||
<a href="javascript:;">{{destroy_action_text}}</a>
|
||||
</a-popconfirm>
|
||||
</template>
|
||||
</div>
|
||||
|
@ -129,14 +129,13 @@ export default {
|
|||
return this.$gettext('Edit')
|
||||
}
|
||||
},
|
||||
restore: {
|
||||
title_text: {
|
||||
restore_title_text: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$gettext('Are you sure you want to restore?')
|
||||
}
|
||||
},
|
||||
action_text: {
|
||||
restore_action_text: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$gettext('Restore')
|
||||
|
@ -154,51 +153,18 @@ export default {
|
|||
return this.$gettext('No, I\'m rethink')
|
||||
}
|
||||
},
|
||||
exec(id) {
|
||||
this.api.restore(id).then(() => {
|
||||
this.get_list()
|
||||
this.$message.success('反删除 ID: ' + id + ' 成功')
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
this.$message.error(e?.message ?? '系统错误')
|
||||
})
|
||||
},
|
||||
},
|
||||
destroy: {
|
||||
title_text: {
|
||||
destroy_title_text: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$gettext('Are you sure you want to destroy?')
|
||||
}
|
||||
},
|
||||
action_text: {
|
||||
destroy_action_text: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$gettext('Destroy')
|
||||
}
|
||||
},
|
||||
ok_text: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$gettext('Yes, I\'m sure')
|
||||
}
|
||||
},
|
||||
cancel_text: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$gettext('No, I\'m rethink')
|
||||
}
|
||||
},
|
||||
exec(id) {
|
||||
this.api.destroy(id).then(() => {
|
||||
this.get_list()
|
||||
this.$message.success('删除 ID: ' + id + ' 成功')
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
this.$message.error(e?.message ?? '系统错误')
|
||||
})
|
||||
},
|
||||
},
|
||||
deletable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
|
@ -252,6 +218,24 @@ export default {
|
|||
this.get_list()
|
||||
},
|
||||
methods: {
|
||||
restore(id) {
|
||||
this.api.restore(id).then(() => {
|
||||
this.get_list()
|
||||
this.$message.success('反删除 ID: ' + id + ' 成功')
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
this.$message.error(e?.message ?? '系统错误')
|
||||
})
|
||||
},
|
||||
destroy(id) {
|
||||
this.api.destroy(id).then(() => {
|
||||
this.get_list()
|
||||
this.$message.success('删除 ID: ' + id + ' 成功')
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
this.$message.error(e?.message ?? '系统错误')
|
||||
})
|
||||
},
|
||||
get_list(page_num = null) {
|
||||
this.loading = true
|
||||
if (page_num) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue