|
1 | 1 | {{extend "layout_demo.html"}}
|
2 | 2 |
|
3 |
| -{{blockcontent_header_title}}<h1>uliweb-apijsonapi examples</h1>{{endcontent_header_title}} |
| 3 | +{{blocktitle}}uliweb-apijsondemo: requests{{endtitle}} |
4 | 4 |
|
5 |
| -{{block content_main}} |
6 |
| -{{use "ui.vue"}} |
7 |
| -{{use "ui.iview"}} |
| 5 | +{{block content_wrapper}} |
| 6 | +<card> |
| 7 | +<divstyle="min-height: 600px;"> |
| 8 | +<tabsv-model:value="tab_current"type="card":animated="false"> |
| 9 | +<tab-panelabel="apijson get"name="tab_get"></tab-pane> |
| 10 | +<tab-panelabel="apijson head"name="tab_head"></tab-pane> |
| 11 | +<tab-panelabel="apijson post"name="tab_post"></tab-pane> |
| 12 | +<tab-panelabel="apijson put"name="tab_put"></tab-pane> |
| 13 | +<tab-panelabel="apijson delete"name="tab_delete"></tab-pane> |
| 14 | +</tabs> |
| 15 | +<layout> |
| 16 | +<siderhide-trigger:style="{height: '80vh', width:'360px', 'min-width': '360px', 'max-width': '380px', overflow: 'auto', background: '#fff'}"> |
| 17 | +<i-menu:active-name="0"@on-select="on_select_get"width="360px"ref='menu_get'> |
| 18 | +<menu-grouptitle="apijson get examples"v-if="tab_current==='tab_get'"> |
| 19 | +<menu-itemv-for="(item,index) in request_get":name="index":key="index"> |
| 20 | +<iclass="fa fa-fw fa-file-code-o"></i> {item.label} |
| 21 | +</menu-item> |
| 22 | +</menu-group> |
| 23 | +</i-menu> |
| 24 | +<i-menu:active-name="0"@on-select="on_select_head"width="360px"> |
| 25 | +<menu-grouptitle="apijson head examples"v-if="tab_current==='tab_head'"> |
| 26 | +<menu-itemv-for="(item,index) in request_head":name="index":key="index"> |
| 27 | +<iclass="fa fa-fw fa-file-code-o"></i> {item.label} |
| 28 | +</menu-item> |
| 29 | +</menu-group> |
| 30 | +</i-menu> |
| 31 | +<i-menu:active-name="0"@on-select="on_select_post"width="360px"> |
| 32 | +<menu-grouptitle="apijson post examples"v-if="tab_current==='tab_post'"> |
| 33 | +<menu-itemv-for="(item,index) in request_post":name="index":key="index"> |
| 34 | +<iclass="fa fa-fw fa-file-code-o"></i> {item.label} |
| 35 | +</menu-item> |
| 36 | +</menu-group> |
| 37 | +</i-menu> |
| 38 | +<i-menu:active-name="0"@on-select="on_select_put"width="360px"> |
| 39 | +<menu-grouptitle="apijson put examples"v-if="tab_current==='tab_put'"> |
| 40 | +<menu-itemv-for="(item,index) in request_put":name="index":key="index"> |
| 41 | +<iclass="fa fa-fw fa-file-code-o"></i> {item.label} |
| 42 | +</menu-item> |
| 43 | +</menu-group> |
| 44 | +</i-menu> |
| 45 | +<i-menu:active-name="0"@on-select="on_select_delete"width="360px"> |
| 46 | +<menu-grouptitle="apijson delete examples"v-if="tab_current==='tab_delete'"> |
| 47 | +<menu-itemv-for="(item,index) in request_delete":name="index":key="index"> |
| 48 | +<iclass="fa fa-fw fa-file-code-o"></i> {item.label} |
| 49 | +</menu-item> |
| 50 | +</menu-group> |
| 51 | +</i-menu> |
| 52 | +</sider> |
| 53 | +<i-content:style="{padding: '24px', minHeight: '280px', background: '#fff'}"> |
| 54 | +<Row> |
| 55 | +<i-colspan="3"><divalign="center">login user</div></i-col> |
| 56 | +<i-colspan="18"><i-inputvalue="{{=user_info}}"readonly/></i-col> |
| 57 | + {{if request.user:}} |
| 58 | +<i-colspan="1"><divalign="center"><i-buttontype="warning"size="large"@click="logout">Logout</i-button></div></i-col> |
| 59 | + {{else:}} |
| 60 | +<i-colspan="1"><divalign="center"><i-buttontype="primary"size="large"@click="login">Login</i-button></div></i-col> |
| 61 | + {{pass}} |
| 62 | +</Row> |
| 63 | +<Rowv-if="tab_current==='tab_get'"> |
| 64 | +<i-colspan="3"><divalign="center">HTTP POST URL</div></i-col> |
| 65 | +<i-colspan="18"><i-inputvalue="/apijson/get"readonly/></i-col> |
| 66 | +</Row> |
| 67 | +<Rowv-if="tab_current==='tab_get'"> |
| 68 | +<i-colspan="3"><divalign="center">example name</div></i-col> |
| 69 | +<i-colspan="18"><strong><i-input:value="request_get[cmenu_get].label"readonly/></strong></i-col> |
| 70 | +</Row> |
| 71 | + |
| 72 | +<Rowv-if="tab_current==='tab_head'"> |
| 73 | +<i-colspan="3"><divalign="center">HTTP HEAD URL</div></i-col> |
| 74 | +<i-colspan="18"><i-inputvalue="/apijson/head"readonly/></i-col> |
| 75 | +</Row> |
| 76 | +<Rowv-if="tab_current==='tab_head'"> |
| 77 | +<i-colspan="3"><divalign="center">example name</div></i-col> |
| 78 | +<i-colspan="18"><strong><i-input:value="request_head[cmenu_head].label"readonly/></strong></i-col> |
| 79 | +</Row> |
| 80 | + |
| 81 | +<Rowv-if="tab_current==='tab_post'"> |
| 82 | +<i-colspan="3"><divalign="center">POST URL</div></i-col> |
| 83 | +<i-colspan="18"><i-inputvalue="/apijson/post"readonly/></i-col> |
| 84 | +</Row> |
| 85 | +<Rowv-if="tab_current==='tab_post'"> |
| 86 | +<i-colspan="3"><divalign="center">example name</div></i-col> |
| 87 | +<i-colspan="18"><strong><i-input:value="request_post[cmenu_post].label"readonly/></strong></i-col> |
| 88 | +</Row> |
| 89 | + |
| 90 | +<Rowv-if="tab_current==='tab_put'"> |
| 91 | +<i-colspan="3"><divalign="center">PUT URL</div></i-col> |
| 92 | +<i-colspan="18"><i-inputvalue="/apijson/put"readonly/></i-col> |
| 93 | +</Row> |
| 94 | +<Rowv-if="tab_current==='tab_put'"> |
| 95 | +<i-colspan="3"><divalign="center">example name</div></i-col> |
| 96 | +<i-colspan="18"><strong><i-input:value="request_put[cmenu_put].label"readonly/></strong></i-col> |
| 97 | +</Row> |
| 98 | + |
| 99 | +<Rowv-if="tab_current==='tab_delete'"> |
| 100 | +<i-colspan="3"><divalign="center">DELETE URL</div></i-col> |
| 101 | +<i-colspan="18"><i-inputvalue="/apijson/delete"readonly/></i-col> |
| 102 | +</Row> |
| 103 | +<Rowv-if="tab_current==='tab_delete'"> |
| 104 | +<i-colspan="3"><divalign="center">example name</div></i-col> |
| 105 | +<i-colspan="18"><strong><i-input:value="request_delete[cmenu_delete].label"readonly/></strong></i-col> |
| 106 | +</Row> |
| 107 | + |
| 108 | +<Row> |
| 109 | +<i-colspan="3"><divalign="center">request data</div></i-col> |
| 110 | +<i-colspan="18"><i-inputv-model="request_data"type="textarea":autosize="{minRows: 3,maxRows: 15}"placeholder="request data"/></i-col> |
| 111 | +<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> |
| 112 | +</Row> |
| 113 | +<Row> |
| 114 | +<i-colspan="3"><divalign="center">response data</div></i-col> |
| 115 | +<i-colspan="18"><i-inputv-model="response_data"type="textarea"readonly:autosize="{minRows: 5,maxRows: 30}"/></i-col> |
| 116 | +</Row> |
| 117 | +</i-content> |
| 118 | +</layout> |
| 119 | +</div> |
| 120 | +</card> |
| 121 | +{{end content_wrapper}} |
8 | 122 |
|
9 |
| -<style> |
10 |
| - .notice |
11 |
| - { |
12 |
| -color:red; |
13 |
| -font-size:150%; |
14 |
| - } |
15 |
| -</style> |
16 |
| - |
17 |
| -<divid="app"class='box'> |
18 |
| -<divclass="box-body"> |
19 |
| -<tabsv-model:value="tab_current"type="card":animated="false"> |
20 |
| -<tab-panelabel="apijson get"name="tab_get"></tab-pane> |
21 |
| -<tab-panelabel="apijson head"name="tab_head"></tab-pane> |
22 |
| -<tab-panelabel="apijson post"name="tab_post"></tab-pane> |
23 |
| -<tab-panelabel="apijson put"name="tab_put"></tab-pane> |
24 |
| -<tab-panelabel="apijson delete"name="tab_delete"></tab-pane> |
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 |
| -<iclass="fa fa-fw fa-file-code-o"></i> {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 |
| -<iclass="fa fa-fw fa-file-code-o"></i> {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 |
| -<iclass="fa fa-fw fa-file-code-o"></i> {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 |
| -<iclass="fa fa-fw fa-file-code-o"></i> {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 |
| -<iclass="fa fa-fw fa-file-code-o"></i> {item.label} |
60 |
| -</menu-item> |
61 |
| -</menu-group> |
62 |
| -</i-menu> |
63 |
| -</sider> |
64 |
| -<i-content:style="{padding: '24px', minHeight: '280px', background: '#fff'}"> |
65 |
| -<Row> |
66 |
| -<i-colspan="3"><divalign="center">login user</div></i-col> |
67 |
| -<i-colspan="18"><i-inputvalue="{{=user_info}}"readonly/></i-col> |
68 |
| - {{if request.user:}} |
69 |
| -<i-colspan="1"><divalign="center"><i-buttontype="warning"size="large"@click="logout">Logout</i-button></div></i-col> |
70 |
| - {{else:}} |
71 |
| -<i-colspan="1"><divalign="center"><i-buttontype="primary"size="large"@click="login">Login</i-button></div></i-col> |
72 |
| - {{pass}} |
73 |
| -</Row> |
74 |
| -<Rowv-if="tab_current==='tab_get'"> |
75 |
| -<i-colspan="3"><divalign="center">HTTP POST URL</div></i-col> |
76 |
| -<i-colspan="18"><i-inputvalue="/apijson/get"readonly/></i-col> |
77 |
| -</Row> |
78 |
| -<Rowv-if="tab_current==='tab_get'"> |
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> |
81 |
| -</Row> |
82 |
| - |
83 |
| -<Rowv-if="tab_current==='tab_head'"> |
84 |
| -<i-colspan="3"><divalign="center">HTTP HEAD URL</div></i-col> |
85 |
| -<i-colspan="18"><i-inputvalue="/apijson/head"readonly/></i-col> |
86 |
| -</Row> |
87 |
| -<Rowv-if="tab_current==='tab_head'"> |
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> |
90 |
| -</Row> |
91 |
| - |
92 |
| -<Rowv-if="tab_current==='tab_post'"> |
93 |
| -<i-colspan="3"><divalign="center">POST URL</div></i-col> |
94 |
| -<i-colspan="18"><i-inputvalue="/apijson/post"readonly/></i-col> |
95 |
| -</Row> |
96 |
| -<Rowv-if="tab_current==='tab_post'"> |
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> |
99 |
| -</Row> |
100 |
| - |
101 |
| -<Rowv-if="tab_current==='tab_put'"> |
102 |
| -<i-colspan="3"><divalign="center">PUT URL</div></i-col> |
103 |
| -<i-colspan="18"><i-inputvalue="/apijson/put"readonly/></i-col> |
104 |
| -</Row> |
105 |
| -<Rowv-if="tab_current==='tab_put'"> |
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> |
108 |
| -</Row> |
109 |
| - |
110 |
| -<Rowv-if="tab_current==='tab_delete'"> |
111 |
| -<i-colspan="3"><divalign="center">DELETE URL</div></i-col> |
112 |
| -<i-colspan="18"><i-inputvalue="/apijson/delete"readonly/></i-col> |
113 |
| -</Row> |
114 |
| -<Rowv-if="tab_current==='tab_delete'"> |
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> |
117 |
| -</Row> |
118 |
| - |
119 |
| -<Row> |
120 |
| -<i-colspan="3"><divalign="center">request data</div></i-col> |
121 |
| -<i-colspan="18"><i-inputv-model="request_data"type="textarea":autosize="{minRows: 3,maxRows: 15}"placeholder="request data"/></i-col> |
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> |
123 |
| -</Row> |
124 |
| -<Row> |
125 |
| -<i-colspan="3"><divalign="center">response data</div></i-col> |
126 |
| -<i-colspan="18"><i-inputv-model="response_data"type="textarea"readonly:autosize="{minRows: 5,maxRows: 30}"/></i-col> |
127 |
| -</Row> |
128 |
| -</i-content> |
129 |
| -</layout> |
130 |
| -</div> |
131 |
| -</div> |
| 123 | +{{block mainapp_vue}} |
132 | 124 | <script>
|
133 | 125 | varvm=newVue({
|
134 |
| -el:'#app', |
| 126 | +el:'#mainapp', |
135 | 127 | delimiters:['{','}'],
|
136 | 128 | data:{
|
137 | 129 | request_get :{{<<request_get_json}},
|
|
204 | 196 | }
|
205 | 197 | })
|
206 | 198 | },
|
207 |
| -login:function(){window.location.href="{{=url_for('uliweb_apps.login.views.login')}}"}, |
208 |
| -logout:function(){window.location.href="{{=url_for('uliweb_apps.login.views.logout')}}"} |
| 199 | +login:function(){window.location.href="{{=url_for('uliweb_comapps.auth.login.views.login')}}"}, |
| 200 | +logout:function(){window.location.href="{{=url_for('uliweb_comapps.auth.login.views.logout')}}"} |
209 | 201 | },
|
210 | 202 | watch:{
|
211 | 203 | request_data :function(n,o){
|
|
233 | 225 | })
|
234 | 226 | vm.init_default()
|
235 | 227 | </script>
|
236 |
| -{{endcontent_main}} |
| 228 | +{{endmainapp_vue}} |