fix language fie.
This commit is contained in:
@@ -687,7 +687,7 @@ EOT;
|
||||
$versions = $this->api->getReleaseListByApi($libID);
|
||||
if(!empty($versions))
|
||||
{
|
||||
$versionName = $version > 0 ? $versions[$version]->desc : $this->lang->api->defaultVersion;
|
||||
$versionName = $version > 0 ? $versions[$version]->version : $this->lang->api->defaultVersion;
|
||||
$output .= <<<EOT
|
||||
<div class='btn-group angle-btn'>
|
||||
<div class='btn-group'>
|
||||
@@ -707,7 +707,7 @@ EOT;
|
||||
foreach($versions as $key => $item)
|
||||
{
|
||||
$selected = $key == $version ? 'selected' : '';
|
||||
$output .= html::a(inlink('index', "libID=$libID&moduleID=0&apiID=0&version=0&release=$key"), $item->desc, '', "class='$selected' data-app='{$this->app->tab}'");
|
||||
$output .= html::a(inlink('index', "libID=$libID&moduleID=0&apiID=0&version=0&release=$key"), $item->version, '', "class='$selected' data-app='{$this->app->tab}'");
|
||||
}
|
||||
$output .= "</div></div></div></div></div>";
|
||||
}
|
||||
|
||||
+11
-3
@@ -220,8 +220,9 @@ try {
|
||||
template: `
|
||||
<tr>
|
||||
<td class="w-300px">
|
||||
<span v-for="item in value.sub" style="display: inline-block; width: 10px"></span>
|
||||
<input type="text" :placeholder="langField" autocomplete="off" class="form-control" style="display: inline-block;width: auto" v-model="value.field">
|
||||
<div :style="{'padding-left': 10 * value.sub + 'px'}">
|
||||
<input type="text" :placeholder="langField" autocomplete="off" class="form-control" v-model="value.field">
|
||||
</div>
|
||||
</td>
|
||||
<td class="w-100px">
|
||||
<select class="form-control" v-model="value.paramsType">
|
||||
@@ -305,7 +306,7 @@ try {
|
||||
created() {
|
||||
console.log(this.showType, this.structType)
|
||||
this.current = [this.getInitField()]
|
||||
if (this.attr) {
|
||||
if (this.attr && this.attr.length > 0) {
|
||||
const attr = [];
|
||||
this.decodeParams(this.attr, attr)
|
||||
this.current = attr
|
||||
@@ -387,6 +388,13 @@ try {
|
||||
}
|
||||
this.current = this.params[this.structType];
|
||||
console.log(this.current)
|
||||
},
|
||||
getPadding(sub) {
|
||||
var padding = 0;
|
||||
sub.forEach(item => {
|
||||
padding += 15;
|
||||
})
|
||||
return padding + 'px';
|
||||
}
|
||||
},
|
||||
template: `
|
||||
|
||||
+17
-5
@@ -6,7 +6,7 @@ var app = new Vue({
|
||||
body: [],
|
||||
params: "",
|
||||
response: "",
|
||||
defaultHeader: { field: '', required: '', desc: '' },
|
||||
defaultHeader: {field: '', required: '', desc: ''},
|
||||
},
|
||||
created() {
|
||||
this.header.push({...this.defaultHeader});
|
||||
@@ -40,13 +40,25 @@ var app = new Vue({
|
||||
this.response = JSON.stringify(val);
|
||||
},
|
||||
setParams() {
|
||||
const header = this.filterParams(this.header)
|
||||
const body = this.filterParams(this.body)
|
||||
const queryP = this.filterParams(this.queryP)
|
||||
const params = {
|
||||
header: this.header,
|
||||
params: this.body,
|
||||
query: this.queryP,
|
||||
header: header,
|
||||
params: body,
|
||||
query: queryP,
|
||||
}
|
||||
this.params = JSON.stringify(params);
|
||||
},
|
||||
filterParams(data) {
|
||||
const res = []
|
||||
data.forEach(item => {
|
||||
if (item.field && item.field.length > 0) {
|
||||
res.push(item)
|
||||
}
|
||||
})
|
||||
return res
|
||||
},
|
||||
del(data, key) {
|
||||
if (data.length <= 1) {
|
||||
return;
|
||||
@@ -55,7 +67,7 @@ var app = new Vue({
|
||||
},
|
||||
add(data, key, t) {
|
||||
if (t == "header" || t == 'query') {
|
||||
data.splice(key+1, 0, this.defaultHeader);
|
||||
data.splice(key + 1, 0, this.defaultHeader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+26
-10
@@ -7,16 +7,18 @@ var app = new Vue({
|
||||
response: "",
|
||||
params: "",
|
||||
defaultHeader: [
|
||||
{ field: '', required: '', desc: '' }
|
||||
{field: '', required: '', desc: ''}
|
||||
],
|
||||
attr: [],
|
||||
api
|
||||
},
|
||||
created() {
|
||||
this.header.push({...this.defaultHeader})
|
||||
this.queryP.push({...this.defaultHeader})
|
||||
if (api) {
|
||||
this.header = api.params.header
|
||||
this.queryP = api.params.query
|
||||
if(api) {
|
||||
if(api.params.header && api.params.header.length > 0) this.header = api.params.header
|
||||
if(api.params.query && api.params.query.length > 0) this.queryP = api.params.query
|
||||
if(api.params.params && api.params.params.length > 0) this.attr = api.params.params
|
||||
this.setParams();
|
||||
}
|
||||
},
|
||||
@@ -48,23 +50,37 @@ var app = new Vue({
|
||||
this.response = JSON.stringify(val)
|
||||
},
|
||||
setParams() {
|
||||
const header = this.filterParams(this.header)
|
||||
const body = this.filterParams(this.body)
|
||||
const queryP = this.filterParams(this.queryP)
|
||||
const params = {
|
||||
header: this.header,
|
||||
params: this.body,
|
||||
query: this.queryP,
|
||||
header: header,
|
||||
params: body,
|
||||
query: queryP,
|
||||
}
|
||||
// console.log(params)
|
||||
this.params = JSON.stringify(params);
|
||||
},
|
||||
filterParams(data) {
|
||||
const res = []
|
||||
if(data && data.length > 0) {
|
||||
data.forEach(item => {
|
||||
if(item.field && item.field.length > 0) {
|
||||
res.push(item)
|
||||
}
|
||||
})
|
||||
}
|
||||
return res
|
||||
},
|
||||
del(data, key) {
|
||||
if (data.length <= 1) {
|
||||
if(data.length <= 1) {
|
||||
return
|
||||
}
|
||||
data.splice(key, 1)
|
||||
},
|
||||
add(data, key, t) {
|
||||
if (t == "header" || t == 'query') {
|
||||
data.splice(key+1, 0, this.defaultHeader)
|
||||
if(t == "header" || t == 'query') {
|
||||
data.splice(key + 1, 0, this.defaultHeader)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,12 +167,6 @@ $lang->api->paramsTypeCustomOptions = array(
|
||||
'file' => 'file',
|
||||
'ref' => 'ref',
|
||||
);
|
||||
$lang->api->structParamsOptons = array_merge($lang->api->paramsTypeOptions, array('file' => 'file', 'ref' => 'ref'));
|
||||
$lang->api->allParamsTypeOptions = array_merge($lang->api->paramsTypeOptions, $lang->api->paramsTypeCustomOptions);
|
||||
$lang->api->requiredOptions = array(0 => 'No', 1 => 'Yes');
|
||||
|
||||
$lang->doclib = new stdclass();
|
||||
$lang->doclib->name = 'Interface Library Name';
|
||||
|
||||
$lang->api->position = 'Position';
|
||||
$lang->api->startLine = "%s,%s";
|
||||
@@ -186,6 +180,13 @@ $lang->api->data = 'Data';
|
||||
$lang->api->noParam = 'No parameters required if GET Debug';
|
||||
$lang->api->post = 'Refer to page list if POST Debug';
|
||||
|
||||
$lang->api->structParamsOptons = array_merge($lang->api->paramsTypeOptions, array('file' => 'file', 'ref' => 'ref'));
|
||||
$lang->api->allParamsTypeOptions = array_merge($lang->api->paramsTypeOptions, $lang->api->paramsTypeCustomOptions);
|
||||
$lang->api->requiredOptions = array(0 => 'No', 1 => 'Yes');
|
||||
|
||||
$lang->doclib = new stdclass();
|
||||
$lang->doclib->name = 'Interface Library Name';
|
||||
|
||||
$lang->api->error = new stdclass();
|
||||
$lang->api->error->onlySelect = 'SQL interface only allow SELECT query.';
|
||||
$lang->api->error->disabled = 'For security reasons, this feature is disabled. You can go to the config directory and modify the configuration item %s to open this function.';
|
||||
$lang->api->error->disabled = 'For security reasons, this feature is disabled. You can go to the config directory and modify the configuration item %s to open this function.';
|
||||
@@ -187,7 +187,7 @@ js::set('api', $api);
|
||||
<tr>
|
||||
<th><?php echo $lang->api->params;?></th>
|
||||
<td colspan='2'>
|
||||
<body-field @change="changeAttr" :attr="api.params.params"></body-field>
|
||||
<body-field @change="changeAttr" :attr="attr"></body-field>
|
||||
<input type="hidden" name="params" v-model="params">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -32,7 +32,10 @@ js::set('struct', $struct);
|
||||
<div id="mainContent" class="main-content">
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->api->createStruct;?></h2>
|
||||
<h2>
|
||||
<?php echo $struct->name;?>
|
||||
<small><?php echo $lang->arrow . ' ' . $lang->api->editStruct;?></small>
|
||||
</h2>
|
||||
</div>
|
||||
<form class="load-indicator main-form form-ajax" id="dataform" method='post' enctype='multipart/form-data'>
|
||||
<table class='table table-form'>
|
||||
|
||||
Reference in New Issue
Block a user