Welcome to mirror list, hosted at ThFree Co, Russian Federation.

xray_fakedns_modal.html « modals « html « web - github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 20768f0bf095929538469743ee5293c5b08df2b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{{define "modals/fakednsModal"}}
<a-modal id="fakedns-modal" v-model="fakednsModal.visible" :title="fakednsModal.title" @ok="fakednsModal.ok"
  :closable="true" :mask-closable="false" :ok-text="fakednsModal.okText" cancel-text='{{ i18n "close" }}'
  :class="themeSwitcher.currentTheme">
  <a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
    <a-form-item label='{{ i18n "pages.xray.fakedns.ipPool" }}'>
      <a-input v-model.trim="fakednsModal.fakeDns.ipPool"></a-input>
    </a-form-item>
    <a-form-item label='{{ i18n "pages.xray.fakedns.poolSize" }}'>
      <a-input-number v-model.number="fakednsModal.fakeDns.poolSize" :min="1"></a-input-number>
    </a-form-item>
  </a-form>
</a-modal>
<script>
  const fakednsDefaultData = {
    ipPool: "198.18.0.0/16",
    poolSize: 65535,
  }

  const fakednsModal = {
    title: '',
    visible: false,
    okText: '{{ i18n "confirm" }}',
    isEdit: false,
    confirm: null,
    fakeDns: {
      ...fakednsDefaultData
    },
    ok() {
      ObjectUtil.execute(fakednsModal.confirm, fakednsModal.fakeDns);
    },
    show({
      title = '',
      okText = '{{ i18n "confirm" }}',
      fakeDns,
      confirm = (fakeDns) => {},
      isEdit = false
    }) {
      this.title = title;
      this.okText = okText;
      this.confirm = confirm;
      this.visible = true;
      if (isEdit) {
        this.fakeDns = fakeDns;
      } else {
        this.fakeDns = {
          ...fakednsDefaultData
        }
      }
      this.isEdit = isEdit;
    },
    close() {
      fakednsModal.visible = false;
    },
  };

  new Vue({
    delimiters: ['[[', ']]'],
    el: '#fakedns-modal',
    data: {
      fakednsModal: fakednsModal,
    }
  });
</script>
{{end}}