Skip to content

Commit

Permalink
修改上传模板,前端获取文件名失败
Browse files Browse the repository at this point in the history
  • Loading branch information
bibinbin committed Jun 22, 2017
1 parent 746b130 commit 050de50
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html class=no-js lang=en><head><meta charset=utf-8><meta content="IE=edge,chrome=1" http-equiv=X-UA-Compatible><title>Elastic HD Dashboard</title><meta content=bibinbin name=author><meta content="elasticsearch go Edition head plugin" name=description><meta content=ElasticHD name=keywords><link href=/static/css/app.64c3c1953f23623e2fc954ac3bc5f0f6.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.716df97a49718cfd7183.js></script><script type=text/javascript src=/static/js/vendor.661d7e9a2eddc40ecf43.js></script><script type=text/javascript src=/static/js/app.8ac9c3048194f4e70a31.js></script></body></html>
<!DOCTYPE html><html class=no-js lang=en><head><meta charset=utf-8><meta content="IE=edge,chrome=1" http-equiv=X-UA-Compatible><title>Elastic HD Dashboard</title><meta content=bibinbin name=author><meta content="elasticsearch go Edition head plugin" name=description><meta content=ElasticHD name=keywords><link href=/static/css/app.64c3c1953f23623e2fc954ac3bc5f0f6.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.3b7a4333a2fa155a81fd.js></script><script type=text/javascript src=/static/js/vendor.661d7e9a2eddc40ecf43.js></script><script type=text/javascript src=/static/js/app.2578e2ab5e128427d2eb.js></script></body></html>
2 changes: 2 additions & 0 deletions dist/static/js/app.2578e2ab5e128427d2eb.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/static/js/app.2578e2ab5e128427d2eb.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/static/js/app.8ac9c3048194f4e70a31.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/static/js/app.8ac9c3048194f4e70a31.js.map

This file was deleted.

2 changes: 2 additions & 0 deletions dist/static/js/manifest.3b7a4333a2fa155a81fd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/static/js/manifest.716df97a49718cfd7183.js

This file was deleted.

4 changes: 3 additions & 1 deletion main/search/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ func (se *Search) clusterStats(w http.ResponseWriter, r *http.Request) {
return
}
var elasticStats = Stats{}
elasticStats.CPUUsed = stats.Nodes.Process.CPU.Percent
elasticStats.CPUFree = 100 - stats.Nodes.Process.CPU.Percent
elasticStats.ClusterName = stats.ClusterName
elasticStats.Docs = stats.Indices.Docs.Count
elasticStats.FieldDataMemUsed = stats.Indices.Fielddata.MemorySizeInBytes
Expand All @@ -166,7 +168,7 @@ func (se *Search) clusterStats(w http.ResponseWriter, r *http.Request) {
for _, item := range stats.Nodes.Jvm.Versions {
elasticStats.JvmVersions += item.Version + ","
}
elasticStats.MemFree = stats.Nodes.Os.Mem.FreeInBytes
elasticStats.MemFree = stats.Nodes.Os.Mem.TotalInBytes - stats.Nodes.Os.Mem.UsedInBytes
elasticStats.MemToatl = stats.Nodes.Os.Mem.TotalInBytes
elasticStats.MemUsed = stats.Nodes.Os.Mem.UsedInBytes
elasticStats.Plugins = stats.Nodes.Plugins
Expand Down
2 changes: 2 additions & 0 deletions main/search/struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ type Stats struct {
FieldDataMemUsed int64 `json:"fielddata_mem_used"`
QueryCache interface{} `json:"query_cache"`
Timestamp int64 `json:"timestamp"`
CPUUsed int `json:"cpuused"`
CPUFree int `json:"cpufree"`
}

// System ...
Expand Down
2 changes: 1 addition & 1 deletion main/statik/statik.go

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/components/mapping.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<section id="mapping-view">
<el-row :gutter="0">
<el-col :xs="24" :sm="24" :md="8" :lg="8">
<el-card :body-style="{ padding: '0px' }">
<el-card :body-style="{ padding: '0px', height: '300px' }">
<img src="../assets/hero.svg" class="image">
<div style="background-color:#D3DCE6;">
<div style="text-align:center;">Indices Templates</div>
Expand All @@ -23,12 +23,12 @@
</el-col>
<el-col :xs="24" :sm="12" :md="8" :lg="8">
<div>
<el-upload class="upload-demo" drag :action="action" :on-change="handleChange" :file-list="fileList" :before-upload="beforeFileUpload" :on-success="fileUploadSuccess" :on-error="fileUploadError" style="width:369px;">
<el-upload class="upload-demo" drag :action="action" :on-change="handleChange" :file-list="fileList" :before-upload="beforeFileUpload" :on-success="fileUploadSuccess" :on-error="fileUploadError" style="width:400px;">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或
<em>点击上传</em>
</div>
<div class="el-upload__tip" style="text-align:center; background-color:#D3DCE6;margin-top:0px; width:369px" slot="tip">更新ElasticSerach Index Template: 要求只能上传application/json文件、不超过2M、且文件名是对应的Index Template名称</div>
<div class="el-upload__tip" style="text-align:center; background-color:#D3DCE6;margin-top:0px; width:360px" slot="tip">更新ElasticSerach Index Template: 要求只能上传application/json文件、不超过2M、且文件名是对应的Index Template名称</div>
</el-upload>
</div>
</el-col>
Expand Down Expand Up @@ -147,8 +147,8 @@ export default {
fileUploadError (file, error) {
this.$message.error(error.name + ' 模板部署失败,请打开开发者模式查看错误信息提示')
},
fileUploadSuccess (file) {
console.log(file)
fileUploadSuccess (res, file) {
// console.log(res, file, 2222)
this.$message.success(file.name + ' 模板部署成功')
},
handleChange (file, fileList) {
Expand Down
4 changes: 3 additions & 1 deletion src/store/modules/overviewx.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ const overviewx = {
fstotal: response.body.data.fstotal,
fsfree: response.body.data.fsfree,
fielddata_mem_used: response.body.data.fielddata_mem_used,
query_cache_memory_size: response.body.data.query_cache.memory_size_in_bytes
query_cache_memory_size: response.body.data.query_cache.memory_size_in_bytes,
cpuused: response.body.data.cpuused,
cpufree: response.body.data.cpufree
}
commit('SET_CHARTS', chart)
}
Expand Down

0 comments on commit 050de50

Please sign in to comment.