Skip to content

Sync #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 17, 2020
Merged

Sync #47

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2020, Chunlin Zhang
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion demo/apps/tables/templates/Tables/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<card>
<div style="min-height: 600px;">
{{if role!="ADMIN":}}
<div class="alert alert-warning" role="alert">You should <a class="btn btn-primary btn-sm" href="{{=url_for('uliweb_apps.login.views.login')}}" role="button">login</a> with user <strong>admin</strong> to view all the tables</div>
<div class="alert alert-warning" role="alert">You should <a class="btn btn-primary btn-sm" href="{{=url_for('uliweb_comapps.auth.login.views.login')}}" role="button">login</a> with user <strong>admin</strong> to view all the tables</div>
{{pass #if}}
<div id="app" class='box'>
<div class="box-body">
Expand Down
12 changes: 9 additions & 3 deletions uliweb_apijson/apijson/templates/vue/inc_apijson_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
"custom_tcolumns_render_generator",
"hook_init", //hook_init(vm), will invoke in mounted()
"hook_ajax_params", //hook_ajax_params(method,action,params), will invoke before ajax action
"hook_add" //hook_add(vm), customize the add action
"hook_add", //hook_add(vm), customize the add action
"hook_viewedit" //hook_viewedit(vm), customize the add action
],
template: `<div>
<div v-if="config_editable && config_add_fields!=null"><i-button type="primary" @click="add">Add</i-button> <br><br> </div>
<Spin size="large" fix v-if="loading"></Spin>
<i-table stripe border :columns="tcolumns" :data="tlist" @on-sort-change="table_on_sort_change"></i-table>
<page :total="total" :page-size="query_count" :current.sync="current_page" :page-size-opts="[10, 20, 50, 100]" show-sizer @on-change="page_on_change" @on-page-size-change="page_on_page_size_change"></page>
<modal v-model="modal_add" title="Add">
<i-form @submit.native.prevent :label-width="80">
<i-form @submit.native.prevent :label-width="100">
<form-item v-for="item in add_items" :key="item.key" :label="item.title">
<i-input v-if="item.component=='input'" v-model="item.value"></i-input>
<checkbox v-if="item.component=='checkbox'" v-model="item.value"></checkbox>
Expand All @@ -31,7 +32,7 @@
</div>
</modal>
<modal v-model="modal_view" :title="viewedit_label">
<i-form @submit.native.prevent :label-width="80">
<i-form @submit.native.prevent :label-width="100">
<form-item v-for="item in viewedit_items" :key="item.key" :label="item.title">
<i-input v-if="item.component=='input'" v-model="item.value" :readonly="!editable(item)"></i-input>
<checkbox v-if="item.component=='checkbox'" v-model="item.value" :disabled="!editable(item)"></checkbox>
Expand Down Expand Up @@ -246,6 +247,11 @@
})
},
show: function(params){
if (this.hook_viewedit!=null) {
this.hook_viewedit(this)
return
}

var row = params.row
this.viewedit_items = []
if (this.config_viewedit_fields!=null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<i-input v-if="item.component=='input'" v-model="item.value" :readonly="!editable(item)"></i-input>
<checkbox v-if="item.component=='checkbox'" v-model="item.value" :disabled="!editable(item)"></checkbox>
<i-input v-if="item.component=='textarea'" v-model="item.value" type="textarea" :autosize="{minRows: 2,maxRows: 5}"></i-input>
{{block custom_viewedit_componet}}{{end custom_viewedit_componet}}
{{block custom_viewedit_component}}{{end custom_viewedit_component}}
</form-item>
<form-item v-if="config_editable" label="Action">
<i-button type="info" icon="ios-download" size="large" @click="save">Save</i-button>
Expand Down