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-divider type="vertical"/>
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
v-if="soft_delete&¶ms.trashed"
|
v-if="soft_delete&¶ms.trashed"
|
||||||
cancelText="{{restore.cancel_text}}"
|
:cancelText="cancel_text"
|
||||||
okText="{{restore.ok_text}}"
|
:okText="ok_text"
|
||||||
title="{{restore.title_text}}"
|
:title="restore_title_text"
|
||||||
@confirm="restore.exec(record[rowKey])">
|
@confirm="restore(record[rowKey])">
|
||||||
<a href="javascript:;">{{restore.action_text}}</a>
|
<a href="javascript:;">{{restore_action_text}}</a>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
v-else
|
v-else
|
||||||
cancelText="{{destroy.cancel_text}}"
|
:cancelText="cancel_text"
|
||||||
okText="{{destroy.ok_text}}"
|
:okText="ok_text"
|
||||||
title="{{destroy.title_text}}"
|
:title="destroy_title_text"
|
||||||
@confirm="destroy.exec(record[rowKey])">
|
@confirm="destroy(record[rowKey])">
|
||||||
<a href="javascript:;">{{destroy.action_text}}</a>
|
<a href="javascript:;">{{destroy_action_text}}</a>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
@ -129,75 +129,41 @@ export default {
|
||||||
return this.$gettext('Edit')
|
return this.$gettext('Edit')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
restore: {
|
restore_title_text: {
|
||||||
title_text: {
|
type: String,
|
||||||
type: String,
|
default() {
|
||||||
default() {
|
return this.$gettext('Are you sure you want to restore?')
|
||||||
return this.$gettext('Are you sure you want to restore?')
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
action_text: {
|
|
||||||
type: String,
|
|
||||||
default() {
|
|
||||||
return this.$gettext('Restore')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
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.restore(id).then(() => {
|
|
||||||
this.get_list()
|
|
||||||
this.$message.success('反删除 ID: ' + id + ' 成功')
|
|
||||||
}).catch(e => {
|
|
||||||
console.log(e)
|
|
||||||
this.$message.error(e?.message ?? '系统错误')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
destroy: {
|
restore_action_text: {
|
||||||
title_text: {
|
type: String,
|
||||||
type: String,
|
default() {
|
||||||
default() {
|
return this.$gettext('Restore')
|
||||||
return this.$gettext('Are you sure you want to destroy?')
|
}
|
||||||
}
|
},
|
||||||
},
|
ok_text: {
|
||||||
action_text: {
|
type: String,
|
||||||
type: String,
|
default() {
|
||||||
default() {
|
return this.$gettext('Yes, I\'m sure')
|
||||||
return this.$gettext('Destroy')
|
}
|
||||||
}
|
},
|
||||||
},
|
cancel_text: {
|
||||||
ok_text: {
|
type: String,
|
||||||
type: String,
|
default() {
|
||||||
default() {
|
return this.$gettext('No, I\'m rethink')
|
||||||
return this.$gettext('Yes, I\'m sure')
|
}
|
||||||
}
|
},
|
||||||
},
|
destroy_title_text: {
|
||||||
cancel_text: {
|
type: String,
|
||||||
type: String,
|
default() {
|
||||||
default() {
|
return this.$gettext('Are you sure you want to destroy?')
|
||||||
return this.$gettext('No, I\'m rethink')
|
}
|
||||||
}
|
},
|
||||||
},
|
destroy_action_text: {
|
||||||
exec(id) {
|
type: String,
|
||||||
this.api.destroy(id).then(() => {
|
default() {
|
||||||
this.get_list()
|
return this.$gettext('Destroy')
|
||||||
this.$message.success('删除 ID: ' + id + ' 成功')
|
}
|
||||||
}).catch(e => {
|
|
||||||
console.log(e)
|
|
||||||
this.$message.error(e?.message ?? '系统错误')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
deletable: {
|
deletable: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
@ -252,6 +218,24 @@ export default {
|
||||||
this.get_list()
|
this.get_list()
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
get_list(page_num = null) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
if (page_num) {
|
if (page_num) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue