|
23 | 23 | <tab-panelabel="apijson put"name="tab_put"></tab-pane>
|
24 | 24 | <tab-panelabel="apijson delete"name="tab_delete"></tab-pane>
|
25 | 25 | </tabs>
|
| 26 | +<layout> |
| 27 | +<siderhide-trigger:style="{height: '80vh', width:'360px', 'min-width': '360px', 'max-width': '380px', overflow: 'auto', background: '#fff'}"> |
| 28 | +<i-menu:active-name="0"@on-select="on_select_get"width="360px"ref='menu_get'> |
| 29 | +<menu-grouptitle="apijson get examples"v-if="tab_current==='tab_get'"> |
| 30 | +<menu-itemv-for="(item,index) in request_get":name="index":key="index"> |
| 31 | + 📋 {item.label} |
| 32 | +</menu-item> |
| 33 | +</menu-group> |
| 34 | +</i-menu> |
| 35 | +<i-menu:active-name="0"@on-select="on_select_head"width="360px"> |
| 36 | +<menu-grouptitle="apijson head examples"v-if="tab_current==='tab_head'"> |
| 37 | +<menu-itemv-for="(item,index) in request_head":name="index":key="index"> |
| 38 | + 📋 {item.label} |
| 39 | +</menu-item> |
| 40 | +</menu-group> |
| 41 | +</i-menu> |
| 42 | +<i-menu:active-name="0"@on-select="on_select_post"width="360px"> |
| 43 | +<menu-grouptitle="apijson post examples"v-if="tab_current==='tab_post'"> |
| 44 | +<menu-itemv-for="(item,index) in request_post":name="index":key="index"> |
| 45 | + 📋 {item.label} |
| 46 | +</menu-item> |
| 47 | +</menu-group> |
| 48 | +</i-menu> |
| 49 | +<i-menu:active-name="0"@on-select="on_select_put"width="360px"> |
| 50 | +<menu-grouptitle="apijson put examples"v-if="tab_current==='tab_put'"> |
| 51 | +<menu-itemv-for="(item,index) in request_put":name="index":key="index"> |
| 52 | + 📋 {item.label} |
| 53 | +</menu-item> |
| 54 | +</menu-group> |
| 55 | +</i-menu> |
| 56 | +<i-menu:active-name="0"@on-select="on_select_delete"width="360px"> |
| 57 | +<menu-grouptitle="apijson delete examples"v-if="tab_current==='tab_delete'"> |
| 58 | +<menu-itemv-for="(item,index) in request_delete":name="index":key="index"> |
| 59 | + 📋 {item.label} |
| 60 | +</menu-item> |
| 61 | +</menu-group> |
| 62 | +</i-menu> |
| 63 | +</sider> |
| 64 | +<i-content:style="{padding: '24px', minHeight: '280px', background: '#fff'}"> |
26 | 65 | <Row>
|
27 | 66 | <i-colspan="3"><divalign="center">login user</div></i-col>
|
28 |
| -<i-colspan="8"><i-inputvalue="{{=user_info}}"readonly/></i-col> |
| 67 | +<i-colspan="18"><i-inputvalue="{{=user_info}}"readonly/></i-col> |
29 | 68 | {{if request.user:}}
|
30 | 69 | <i-colspan="1"><divalign="center"><i-buttontype="warning"size="large"@click="logout">Logout</i-button></div></i-col>
|
31 | 70 | {{else:}}
|
32 | 71 | <i-colspan="1"><divalign="center"><i-buttontype="primary"size="large"@click="login">Login</i-button></div></i-col>
|
33 | 72 | {{pass}}
|
34 | 73 | </Row>
|
35 | 74 | <Rowv-if="tab_current==='tab_get'">
|
36 |
| -<i-colspan="3"><divalign="center">HTTP POST URL</div></i-col> |
37 |
| -<i-colspan="8"><i-inputvalue="/apijson/get"readonly/></i-col> |
| 75 | +<i-colspan="3"><divalign="center">HTTP POST URL</div></i-col> |
| 76 | +<i-colspan="18"><i-inputvalue="/apijson/get"readonly/></i-col> |
38 | 77 | </Row>
|
39 | 78 | <Rowv-if="tab_current==='tab_get'">
|
40 |
| -<i-colspan="3"><divalign="center"><strong>apijson get</strong> request<spanclass="notice">{request_get.length}</span> examples</div></i-col> |
41 |
| -<i-colspan="8"> |
42 |
| -<i-selectv-model="select_current"> |
43 |
| -<i-optionv-for="(item,index) in request_get":value="item.value":key="item.value">{index+1}. {item.label}</i-option> |
44 |
| -</i-select> |
45 |
| -</i-col> |
| 79 | +<i-colspan="3"><divalign="center">example name</div></i-col> |
| 80 | +<i-colspan="18"><strong><i-input:value="request_get[cmenu_get].label"readonly/></strong></i-col> |
46 | 81 | </Row>
|
47 | 82 |
|
48 | 83 | <Rowv-if="tab_current==='tab_head'">
|
49 | 84 | <i-colspan="3"><divalign="center">HTTP HEAD URL</div></i-col>
|
50 |
| -<i-colspan="8"><i-inputvalue="/apijson/head"readonly/></i-col> |
| 85 | +<i-colspan="18"><i-inputvalue="/apijson/head"readonly/></i-col> |
51 | 86 | </Row>
|
52 | 87 | <Rowv-if="tab_current==='tab_head'">
|
53 |
| -<i-colspan="3"><divalign="center"><strong>apijson head</strong> request<spanclass="notice">{request_head.length}</span> examples</div></i-col> |
54 |
| -<i-colspan="8"> |
55 |
| -<i-selectv-model="select_current"> |
56 |
| -<i-optionv-for="(item,index) in request_head":value="item.value":key="item.value">{index+1}. {item.label}</i-option> |
57 |
| -</i-select> |
58 |
| -</i-col> |
| 88 | +<i-colspan="3"><divalign="center">example name</div></i-col> |
| 89 | +<i-colspan="18"><strong><i-input:value="request_head[cmenu_head].label"readonly/></strong></i-col> |
59 | 90 | </Row>
|
60 | 91 |
|
61 | 92 | <Rowv-if="tab_current==='tab_post'">
|
62 |
| -<i-colspan="3"><divalign="center">POST URL</div></i-col> |
63 |
| -<i-colspan="8"><i-inputvalue="/apijson/post"readonly/></i-col> |
| 93 | +<i-colspan="3"><divalign="center">POST URL</div></i-col> |
| 94 | +<i-colspan="18"><i-inputvalue="/apijson/post"readonly/></i-col> |
64 | 95 | </Row>
|
65 | 96 | <Rowv-if="tab_current==='tab_post'">
|
66 |
| -<i-colspan="3"><divalign="center"><strong>apijson post</strong> request<spanclass="notice">{request_post.length}</span> examples</div></i-col> |
67 |
| -<i-colspan="8"> |
68 |
| -<i-selectv-model="select_current"> |
69 |
| -<i-optionv-for="(item,index) in request_post":value="item.value":key="item.value">{index+1}. {item.label}</i-option> |
70 |
| -</i-select> |
71 |
| -</i-col> |
| 97 | +<i-colspan="3"><divalign="center">example name</div></i-col> |
| 98 | +<i-colspan="18"><strong><i-input:value="request_post[cmenu_post].label"readonly/></strong></i-col> |
72 | 99 | </Row>
|
73 | 100 |
|
74 | 101 | <Rowv-if="tab_current==='tab_put'">
|
75 | 102 | <i-colspan="3"><divalign="center">PUT URL</div></i-col>
|
76 |
| -<i-colspan="8"><i-inputvalue="/apijson/put"readonly/></i-col> |
| 103 | +<i-colspan="18"><i-inputvalue="/apijson/put"readonly/></i-col> |
77 | 104 | </Row>
|
78 | 105 | <Rowv-if="tab_current==='tab_put'">
|
79 |
| -<i-colspan="3"><divalign="center"><strong>apijson put</strong> request<spanclass="notice">{request_put.length}</span> examples</div></i-col> |
80 |
| -<i-colspan="8"> |
81 |
| -<i-selectv-model="select_current"> |
82 |
| -<i-optionv-for="(item,index) in request_put":value="item.value":key="item.value">{index+1}. {item.label}</i-option> |
83 |
| -</i-select> |
84 |
| -</i-col> |
| 106 | +<i-colspan="3"><divalign="center">example name</div></i-col> |
| 107 | +<i-colspan="18"><strong><i-input:value="request_put[cmenu_put].label"readonly/></strong></i-col> |
85 | 108 | </Row>
|
86 | 109 |
|
87 | 110 | <Rowv-if="tab_current==='tab_delete'">
|
88 | 111 | <i-colspan="3"><divalign="center">DELETE URL</div></i-col>
|
89 |
| -<i-colspan="8"><i-inputvalue="/apijson/delete"readonly/></i-col> |
| 112 | +<i-colspan="18"><i-inputvalue="/apijson/delete"readonly/></i-col> |
90 | 113 | </Row>
|
91 | 114 | <Rowv-if="tab_current==='tab_delete'">
|
92 |
| -<i-colspan="3"><divalign="center"><strong>apijson delete</strong> request<spanclass="notice">{request_delete.length}</span> examples</div></i-col> |
93 |
| -<i-colspan="8"> |
94 |
| -<i-selectv-model="select_current"> |
95 |
| -<i-optionv-for="(item,index) in request_delete":value="item.value":key="item.value">{index+1}. {item.label}</i-option> |
96 |
| -</i-select> |
97 |
| -</i-col> |
| 115 | +<i-colspan="3"><divalign="center">example name</div></i-col> |
| 116 | +<i-colspan="18"><strong><i-input:value="request_delete[cmenu_delete].label"readonly/></strong></i-col> |
98 | 117 | </Row>
|
99 | 118 |
|
100 | 119 | <Row>
|
101 | 120 | <i-colspan="3"><divalign="center">request data</div></i-col>
|
102 |
| -<i-colspan="8"><i-inputv-model="request_data"type="textarea":autosize="{minRows: 3,maxRows: 15}"placeholder="request data"/></i-col> |
| 121 | +<i-colspan="18"><i-inputv-model="request_data"type="textarea":autosize="{minRows: 3,maxRows: 15}"placeholder="request data"/></i-col> |
103 | 122 | <i-colspan="1"><divalign="center"><i-buttontype="primary"size="large"@click="post_request_data"v-bind:disabled="!can_post">Post</i-button></div></i-col>
|
104 | 123 | </Row>
|
105 | 124 | <Row>
|
106 | 125 | <i-colspan="3"><divalign="center">response data</div></i-col>
|
107 |
| -<i-colspan="8"><i-inputv-model="response_data"type="textarea"readonly:autosize="{minRows: 5,maxRows: 30}"/></i-col> |
| 126 | +<i-colspan="18"><i-inputv-model="response_data"type="textarea"readonly:autosize="{minRows: 5,maxRows: 30}"/></i-col> |
108 | 127 | </Row>
|
| 128 | +</i-content> |
| 129 | +</layout> |
109 | 130 | </div>
|
110 | 131 | </div>
|
111 | 132 | <script>
|
|
119 | 140 | request_put :{{<<request_put_json}},
|
120 | 141 | request_delete :{{<<request_delete_json}},
|
121 | 142 | request_data :"",
|
122 |
| -select_current :"", |
| 143 | + |
| 144 | +cmenu_get :0, |
| 145 | +cmenu_head :0, |
| 146 | +cmenu_post :0, |
| 147 | +cmenu_put :0, |
| 148 | +cmenu_delete :0, |
| 149 | + |
123 | 150 | can_post :true,
|
124 | 151 | response_data :"",
|
125 | 152 | tab_current :"tab_get",
|
|
134 | 161 | methods:{
|
135 | 162 | init_default:function(){
|
136 | 163 | vm.request_data=vm.request_get[0].value
|
137 |
| -vm.select_current=vm.request_data |
| 164 | +}, |
| 165 | +on_select_get:function(name){ |
| 166 | +vm.cmenu_get=parseInt(name) |
| 167 | +vm.request_data=vm.request_get[vm.cmenu_get].value |
| 168 | +vm.response_data="" |
| 169 | +vm.can_post=true |
| 170 | +}, |
| 171 | +on_select_head:function(name){ |
| 172 | +vm.cmenu_head=parseInt(name) |
| 173 | +vm.request_data=vm.request_head[vm.cmenu_head].value |
| 174 | +vm.response_data="" |
| 175 | +vm.can_post=true |
| 176 | +}, |
| 177 | +on_select_post:function(name){ |
| 178 | +vm.cmenu_post=parseInt(name) |
| 179 | +vm.request_data=vm.request_post[vm.cmenu_post].value |
| 180 | +vm.response_data="" |
| 181 | +vm.can_post=true |
| 182 | +}, |
| 183 | +on_select_put:function(name){ |
| 184 | +vm.cmenu_put=parseInt(name) |
| 185 | +vm.request_data=vm.request_put[vm.cmenu_put].value |
| 186 | +vm.response_data="" |
| 187 | +vm.can_post=true |
| 188 | +}, |
| 189 | +on_select_delete:function(name){ |
| 190 | +vm.cmenu_delete=parseInt(name) |
| 191 | +vm.request_data=vm.request_delete[vm.cmenu_delete].value |
| 192 | +vm.response_data="" |
| 193 | +vm.can_post=true |
138 | 194 | },
|
139 | 195 | post_request_data:function(){
|
140 | 196 | $.ajax({
|
|
171 | 227 | elseif(n=="tab_delete"){
|
172 | 228 | vm.request_data=vm.request_delete[0].value
|
173 | 229 | }
|
174 |
| -vm.select_current=vm.request_data |
175 | 230 | vm.response_data=""
|
176 |
| -}, |
177 |
| -select_current :function(n,o){ |
178 |
| -if(n!=null&&n!=""&&n!==vm.request_data){ |
179 |
| -vm.request_data=n |
180 |
| -} |
181 |
| -else{ |
182 |
| -vm.select_current=vm.request_data |
183 |
| -} |
184 | 231 | }
|
185 | 232 | }
|
186 | 233 | })
|
|