1
0

fakedns_modal.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. {{define "fakednsModal"}}
  2. <a-modal id="fakedns-modal" v-model="fakednsModal.visible" :title="fakednsModal.title" @ok="fakednsModal.ok"
  3. :closable="true" :mask-closable="false"
  4. :ok-text="fakednsModal.okText" cancel-text='{{ i18n "close" }}' :class="themeSwitcher.currentTheme">
  5. <a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
  6. <a-form-item label='{{ i18n "pages.xray.fakedns.ipPool" }}'>
  7. <a-input v-model.trim="fakednsModal.fakeDns.ipPool"></a-input>
  8. </a-form-item>
  9. <a-form-item label='{{ i18n "pages.xray.fakedns.poolSize" }}'>
  10. <a-input-number style="width: 100%;" type="number" min="1" v-model.trim="fakednsModal.fakeDns.poolSize"></a-input-number>
  11. </a-form-item>
  12. </a-form>
  13. </a-modal>
  14. <script>
  15. const fakednsModal = {
  16. title: '',
  17. visible: false,
  18. okText: '{{ i18n "confirm" }}',
  19. isEdit: false,
  20. confirm: null,
  21. fakeDns: {
  22. ipPool: "198.18.0.0/16",
  23. poolSize: 65535,
  24. },
  25. ok() {
  26. ObjectUtil.execute(fakednsModal.confirm, fakednsModal.fakeDns);
  27. },
  28. show({ title='', okText='{{ i18n "confirm" }}', fakeDns, confirm=(fakeDns)=>{}, isEdit=false }) {
  29. this.title = title;
  30. this.okText = okText;
  31. this.confirm = confirm;
  32. this.visible = true;
  33. if(isEdit) {
  34. this.fakeDns = fakeDns;
  35. } else {
  36. this.fakeDns = {
  37. ipPool: "198.18.0.0/16",
  38. poolSize: 65535,
  39. }
  40. }
  41. this.isEdit = isEdit;
  42. },
  43. close() {
  44. fakednsModal.visible = false;
  45. },
  46. };
  47. new Vue({
  48. delimiters: ['[[', ']]'],
  49. el: '#fakedns-modal',
  50. data: {
  51. fakednsModal: fakednsModal,
  52. }
  53. });
  54. </script>
  55. {{end}}