Commit d65a7c65 authored by 谭长生's avatar 谭长生

20220617提交

parents
#-*- coding : utf-8 -*-
# coding: utf-8
from flask import Flask, request, redirect, url_for,send_file,send_from_directory
from plot_types import SamplePlotType
from shot_data_read import shot_tag_xy, shot_tags
import numpy as np
import os
app = Flask(__name__) #改版静态文件的路径的访问的url, static_folder='test', static_url_path="/test"
@app.route("/plot/<path:path>/", methods=['POST', 'GET'])
def send_pic(path):
"""
a url like: /plot/sample_type/1046400-&-DRMP_DC_io2-Ihfp-DRMP_DC_io2-Ihfp.png
"""
# detect filepath and init plot arguments
filePath='http://127.0.0.1:8087/static/plot/' + path
plotTypeName=str(path).split("/")[0]
plotArgument = str(path).split("/")[1]
savepath = os.path.abspath(".") + "/static/plot/" + plotTypeName + "/"
if not os.path.exists(savepath):
print("该type不存在,已创建文件夹: ")
os.makedirs(savepath)
else:
print("该type已存在")
print("该type的图片将存放在:",os.path.abspath(savepath))
if (os.path.isfile(os.path.abspath(".") + "/static/plot/"+path)==True) :
print ("图片已存在")
return redirect(url_for('static', filename='plot/'+path))
else:
# new all plot types
plotTypes={}
plotTypes["sample_type"]=SamplePlotType(plotTypeName,plotArgument)
# plotTypes["type1"]=BasicPlotType()
# plotTypes["type2"]=BasicPlotType()
# plot and save
fig1 = plotTypes[plotTypeName]
#fig1.line()
fig1.line_overlying()
print("finished plotting")
fig1.plotsave()
print("文件查找在" + filePath)
return redirect(url_for('static', filename='plot/'+path))
app.run(debug=True, host='0.0.0.0', port='8087')
from matplotlib import pyplot as plt
import matplotlib
import numpy as np
from matplotlib.pyplot import figure, subplots
from shot_data_read import shot_tag_xy,tag_xy
# from download_data import tag_xy
import os
#plt.rcParams['font.family']=['STFangsong']
#plt.rcParams['font.sas-serig']=['SimHei'] #用来正常显示中文标签''STFangsong''
class SamplePlotType:
def __init__(self,plotTypeName,plotArgument):
'''
plotArgument like: 1046400-&-DRMP_DC_io2-Ihfp-DRMP_DC_io2-Ihfp.png
'''
plt.rcParams['axes.unicode_minus']=False #用来正常显示负号
self.plotTypeName = plotTypeName
self.plotArgument = plotArgument
Argument = str(plotArgument).split(".")[0].split("-")
self.UserDefined_Identifier = str(plotArgument).split(".")[1] # such as : #$& to make different details of the same type
self.shotno = Argument[0]
self.plotstyle = Argument[1]
self.tagnames = Argument[2:]
def plotsave(self,):
abspath = os.path.abspath(".") # 本文件路径
savepath = abspath + "/static/plot/" + self.plotTypeName + "/" + self.plotArgument
print("存放在" + savepath)
plt.savefig(savepath, dpi=300, bbox_inches="tight") # bbox_inches="tight" 可以保存图上所有的信息
print("已存储")
plt.close('all')
# 画单图
def line(self,
title = 'title',color="black",linestyle='-',linewidth=0.4,
xlabel = 'x 轴',ylabel = 'y 轴',
text = '在这里是关于此实验的一些备注',
isshow = False,):#ispathdetect用于对已有图片覆盖重写
file_name = self.shotno
tagname = str("\\") + str(self.tagnames[0])
print(tagname)
print(file_name)
#label在图示(legend)中显示。若为数学公式,则最好在字符串前后添加"$"符号
#x,y = shot_tag_xy(file_name = file_name ,tagname = tagname)
x,y = tag_xy(shotno = int(file_name), tag = tagname)
#figure(num=None, figsize=(2.8, 1.7), dpi=300)# figsize的2.8和1.7指的是英寸,dpi指定图片分辨率。那么图片就是(2.8*300)*(1.7*300)像素大小
plt.plot(x,y,label=tagname,color=color,linestyle=linestyle,linewidth=linewidth)#marker="o",markersize=0.5, markerfacecolor="red",markeredgewidth=0.6,markeredgecolor="grey") 蓝色,线宽,圆点,点尺寸,点填充红色,点边缘宽度,点边缘灰色
# plt.title(title, fontdict={'family' : 'SimHei', 'size':8})
# 指定横纵坐标的字体以及字体大小
plt.autoscale(True)
if isshow == True:
plt.show()# 先savefig,再show
def line_overlying(self,
title = 'title',
color=['b','black','g','r','c','m','y','k','w'],
linestyle=['-','--','-.',':'],linewidth=0.4,
xlabel = 'x',ylabel = 'y',
istext = False,text = 'abcd',text_xloc=0,text_yloc=0.4,
):
'''
tagname中列表传入需画的各标签
line()中所有参数请按列表传入,如color=['b','black','g','r','c','m','y','k','w']
'''
file_name = self.shotno
tagname = self.tagnames
tagnames = []
for i in range(0,len(tagname)):
tagnames.append(str("\\") + str(tagname[i]))
if istext == True:
plt.text(text_xloc, text_yloc, text,
bbox=dict(boxstyle='square,pad=0.4',facecolor='white',alpha=1.0,lw=0.5),
fontdict = {
#'family': 'SimHei', # 标注文本字体
'fontsize': 8, # 文本大小
'fontweight': 'bold', # 字体粗细
'fontstyle': 'italic', # 字体风格
'color': 'black', # 文本颜色
'backgroundcolor': 'white', # 背景颜色
})
for i in range(0,len(tagnames)):
x,y = tag_xy(shotno = int(file_name),tag = tagnames[i],)
#figure(num=None, figsize=(2.8, 1.7), dpi=300)# figsize的2.8和1.7指的是英寸,dpi指定图片分辨率。那么图片就是(2.8*300)*(1.7*300)像素大小
plt.plot(x,y,label=tagname[i],color= color[i], linestyle=linestyle[i],linewidth=linewidth)#marker="o",markersize=0.5, markerfacecolor="red",markeredgewidth=0.6,markeredgecolor="grey") 蓝色,线宽,圆点,点尺寸,点填充红色,点边缘宽度,点边缘灰色
# plt.title(title, fontdict={'family' : 'SimHei', 'size':8})
# 指定横纵坐标的字体以及字体大小
plt.autoscale(True)
#plt.xlim()
#plt.ylim()
# plt.xticks(fontproperties = 'SimHei', fontsize=8)
# plt.yticks(fontproperties = 'SimHei', fontsize=8)
# plt.xlabel(xlabel, fontdict={'family' : 'SimHei', 'size':8})
# plt.ylabel(ylabel, fontdict={'family' : 'SimHei', 'size':8})
# plt.legend(loc='best', prop={'family':'SimHei', 'size':8}) #loc='lower right'
import h5py #导入工具包
import numpy as np
from MDSplus import connection
import pandas as pd
#查看数据所有tag
def shot_tags(file_name = '1046400.hdf5' , isprint = True):
openfile = h5py.File(file_name,'r') #打开h5文件
tags = openfile['data'] #取出主键为data的所有的二级键值 (取所有标签名)
tag_list = list(tags)
if isprint == True:
print(tag_list)
return tag_list
#查看数据某tag里的数据
def shot_tag_data(file_name = '1046400.hdf5' , tagname = '\\DRMP_DC_io2', isprint = True):
openfile = h5py.File(file_name,'r') #打开h5文件
tags = openfile['data'] #取出主键为data的所有的二级键值 (取所有标签名)
tag_data = tags[tagname] #取出主键data,二级键值tagname='\\DRMP_DC_io2'的值(即该tag实验数据)
tag_data_list = list(tag_data)
if isprint == True:
print(list(tag_data_list))
return tag_data_list
#查看数据某tag的属性:采样率、开始时间
def shot_tag_attrs(file_name = '1046400.hdf5' ,tagname = '\\DRMP_DC_io2', isprint = True):
'''
SampleRate :
StartTime :
'''
openfile = h5py.File(file_name,'r') #打开h5文件
tags = openfile['data'] #取出主键为data的所有的二级键值 (取所有标签名)
tag_data = tags[tagname] #取出主键data,二级键值tagname='\\DRMP_DC_io2'的值(即该tag实验数据)
if isprint == True:
for key in tag_data.attrs.keys():
print(key, ":", tag_data.attrs[key])
return tag_data.attrs['SampleRate'],tag_data.attrs['StartTime']
#HDF5的读取xy坐标:
def shot_tag_xy(file_name = '1046400.hdf5' ,tagname = '\\DRMP_DC_io2'):
'''
读取hdf5文件,取所需tag的数据、采样率、开始时间。输出x(时间),y(数据)坐标轴数组
file_name = '1046400.hdf5'
tagname = '\\vs_c3_aa008'
'''
openfile = h5py.File(file_name,'r') #打开h5文件
tags = openfile['data'] #取出主键为data的所有的二级键值 (取所有标签名)
tag_data = tags[tagname] #取出主键data,二级键值tagname='\\DRMP_DC_io2'的值(即该tag实验数据)
tag_data_list = list(tag_data)
x_num = len(tag_data_list)
time_span = 1/tag_data.attrs['SampleRate']
start = tag_data.attrs['StartTime']
stop = (x_num - 1) * time_span
x_datalist = np.linspace(start, stop, x_num)
y_datalist = tag_data_list
openfile.close()
return x_datalist,y_datalist
def tag_xy(shotno = 1051501, tag = "\\IP",ip = '222.20.94.136'):
c = connection.Connection(ip)
print('Connected')
c.openTree('jtext', shot=shotno)
y = list(c.get(tag))
x = list(c.get(r'DIM_OF(BUILD_PATH({}))'.format(tag)))
return x,y
\ No newline at end of file
#-*- coding : utf-8 -*-
# coding: utf-8
from flask import Flask, request, redirect, url_for,send_file,send_from_directory
from plot_types import SamplePlotType
from shot_data_read import shot_tag_xy, shot_tags
import numpy as np
import os
app = Flask(__name__) #改版静态文件的路径的访问的url, static_folder='test', static_url_path="/test"
@app.route("/plot/<path:path>/", methods=['POST', 'GET'])
def send_pic(path):
"""
a url like: /plot/sample_type/1046400-&-DRMP_DC_io2-Ihfp-DRMP_DC_io2-Ihfp.png
先检测用户需要的绘图类型sample_type是否存在文件夹否则创建,再检测是否绘制并保存过该图,是则直接返回该图
"""
# detect filepath and init plot arguments
filePath='http://127.0.0.1:5000/static/plot/' + path
plotTypeName=str(path).split("/")[0]
plotArgument = str(path).split("/")[1]
savepath = os.path.abspath(".") + "\\static\\plot\\" + plotTypeName + "\\"
if not os.path.exists(savepath):
print("该type不存在,已创建文件夹: ")
os.makedirs(savepath)
else:
print("该type已存在")
print("该type的图片将存放在:",os.path.abspath(savepath))
if (os.path.isfile(os.path.abspath(".") + "\\static\\plot\\"+path)==True) :
print ("图片已存在")
return redirect(filePath)
else:
# new all plot types
plotTypes={}
plotTypes["sample_type"]=SamplePlotType(plotTypeName,plotArgument)
# plotTypes["type1"]=BasicPlotType()
# plotTypes["type2"]=BasicPlotType()
# plot and save
fig1 = plotTypes[plotTypeName]
#fig1.line()
fig1.line_overlying()
fig1.plotsave()
print("文件查找在" + filePath)
return redirect(filePath)
app.run(debug=True)
\ No newline at end of file
# 模板自定义绘图类,解析前端URL指令以绘图。
from matplotlib import pyplot as plt
import matplotlib
import numpy as np
from matplotlib.pyplot import figure, subplots
from shot_data_read import shot_tag_xy,tag_xy
# from download_data import tag_xy
import os
plt.rcParams['font.family']=['STFangsong']
#plt.rcParams['font.sas-serig']=['SimHei'] #用来正常显示中文标签''STFangsong''
class SamplePlotType:
def __init__(self,plotTypeName,plotArgument):
'''
plotArgument like: 1046400-&-DRMP_DC_io2-Ihfp-DRMP_DC_io2-Ihfp.png
'''
plt.rcParams['axes.unicode_minus']=False #用来正常显示负号
self.plotTypeName = plotTypeName
self.plotArgument = plotArgument
Argument = str(plotArgument).split(".")[0].split("-")
self.UserDefined_Identifier = str(plotArgument).split(".")[1] # such as : #$& to make different details of the same type
self.shotno = Argument[0]
self.plotstyle = Argument[1]
self.tagnames = Argument[2:]
def plotsave(self,):
abspath = os.path.abspath(".") # 本文件路径
savepath = abspath + "\\static\\plot\\" + self.plotTypeName + "\\" + self.plotArgument
print("存放在" + savepath)
plt.savefig(savepath, dpi=300, bbox_inches="tight")# bbox_inches="tight" 可以保存图上所有的信息
plt.close('all')
# 画单图
def line(self,
title = 'title',color="black",linestyle='-',linewidth=0.4,
xlabel = 'x 轴',ylabel = 'y 轴',
text = '在这里是关于此实验的一些备注',
isshow = False,):#ispathdetect用于对已有图片覆盖重写
file_name = self.shotno
tagname = str("\\") + str(self.tagnames[0])
print(tagname)
print(file_name)
#label在图示(legend)中显示。若为数学公式,则最好在字符串前后添加"$"符号
#x,y = shot_tag_xy(file_name = file_name ,tagname = tagname)
x,y = tag_xy(shotno = int(file_name), tag = tagname)
#figure(num=None, figsize=(2.8, 1.7), dpi=300)# figsize的2.8和1.7指的是英寸,dpi指定图片分辨率。那么图片就是(2.8*300)*(1.7*300)像素大小
plt.plot(x,y,label=tagname,color=color,linestyle=linestyle,linewidth=linewidth)#marker="o",markersize=0.5, markerfacecolor="red",markeredgewidth=0.6,markeredgecolor="grey") 蓝色,线宽,圆点,点尺寸,点填充红色,点边缘宽度,点边缘灰色
plt.title(title, fontdict={'family' : 'SimHei', 'size':8})
# 指定横纵坐标的字体以及字体大小
plt.autoscale(True)
if isshow == True:
plt.show()# 先savefig,再show
# 画叠加图
def line_overlying(self,
title = 'title',
color=['b','black','g','r','c','m','y','k','w'],
linestyle=['-','--','-.',':'],linewidth=0.4,
xlabel = 'x 轴',ylabel = 'y 轴',
istext = True,text = '在这里是关于此实验的一些备注',text_xloc=0,text_yloc=0.4,
):
'''
tagname中列表传入需画的各标签
line()中所有参数请按列表传入,如color=['b','black','g','r','c','m','y','k','w']
'''
file_name = self.shotno
tagname = self.tagnames
tagnames = []
for i in range(0,len(tagname)):
tagnames.append(str("\\") + str(tagname[i]))
if istext == True:
plt.text(text_xloc, text_yloc, text,
bbox=dict(boxstyle='square,pad=0.4',facecolor='white',alpha=1.0,lw=0.5),
fontdict = {
'family': 'SimHei', # 标注文本字体
'fontsize': 8, # 文本大小
'fontweight': 'bold', # 字体粗细
'fontstyle': 'italic', # 字体风格
'color': 'black', # 文本颜色
'backgroundcolor': 'white', # 背景颜色
})
for i in range(0,len(tagnames)):
x,y = tag_xy(shotno = int(file_name),tag = tagnames[i],)
#figure(num=None, figsize=(2.8, 1.7), dpi=300)# figsize的2.8和1.7指的是英寸,dpi指定图片分辨率。那么图片就是(2.8*300)*(1.7*300)像素大小
plt.plot(x,y,label=tagname[i],color= color[i], linestyle=linestyle[i],linewidth=linewidth)#marker="o",markersize=0.5, markerfacecolor="red",markeredgewidth=0.6,markeredgecolor="grey") 蓝色,线宽,圆点,点尺寸,点填充红色,点边缘宽度,点边缘灰色
plt.title(title, fontdict={'family' : 'SimHei', 'size':8})
# 指定横纵坐标的字体以及字体大小
plt.autoscale(True)
#plt.xlim()
#plt.ylim()
plt.xticks(fontproperties = 'SimHei', fontsize=8)
plt.yticks(fontproperties = 'SimHei', fontsize=8)
plt.xlabel(xlabel, fontdict={'family' : 'SimHei', 'size':8})
plt.ylabel(ylabel, fontdict={'family' : 'SimHei', 'size':8})
plt.legend(loc='best', prop={'family':'SimHei', 'size':8}) #loc='lower right'
# 读绘图所需坐标轴数据列表的方法
# 服务器只用最后一个mdsplus函数tag_xy,其他的是hdf5格式数据读取
import h5py #导入工具包
import numpy as np
from MDSplus import connection
import pandas as pd
#查看数据所有tag
def shot_tags(file_name = '1046400.hdf5' , isprint = True):
openfile = h5py.File(file_name,'r') #打开h5文件
tags = openfile['data'] #取出主键为data的所有的二级键值 (取所有标签名)
tag_list = list(tags)
if isprint == True:
print(tag_list)
return tag_list
#查看数据某tag里的数据
def shot_tag_data(file_name = '1046400.hdf5' , tagname = '\\DRMP_DC_io2', isprint = True):
openfile = h5py.File(file_name,'r') #打开h5文件
tags = openfile['data'] #取出主键为data的所有的二级键值 (取所有标签名)
tag_data = tags[tagname] #取出主键data,二级键值tagname='\\DRMP_DC_io2'的值(即该tag实验数据)
tag_data_list = list(tag_data)
if isprint == True:
print(list(tag_data_list))
return tag_data_list
#查看数据某tag的属性:采样率、开始时间
def shot_tag_attrs(file_name = '1046400.hdf5' ,tagname = '\\DRMP_DC_io2', isprint = True):
'''
SampleRate :
StartTime :
'''
openfile = h5py.File(file_name,'r') #打开h5文件
tags = openfile['data'] #取出主键为data的所有的二级键值 (取所有标签名)
tag_data = tags[tagname] #取出主键data,二级键值tagname='\\DRMP_DC_io2'的值(即该tag实验数据)
if isprint == True:
for key in tag_data.attrs.keys():
print(key, ":", tag_data.attrs[key])
return tag_data.attrs['SampleRate'],tag_data.attrs['StartTime']
#HDF5的读取xy坐标:
def shot_tag_xy(file_name = '1046400.hdf5' ,tagname = '\\DRMP_DC_io2'):
'''
读取hdf5文件,取所需tag的数据、采样率、开始时间。输出x(时间),y(数据)坐标轴数组
file_name = '1046400.hdf5'
tagname = '\\vs_c3_aa008'
'''
openfile = h5py.File(file_name,'r') #打开h5文件
tags = openfile['data'] #取出主键为data的所有的二级键值 (取所有标签名)
tag_data = tags[tagname] #取出主键data,二级键值tagname='\\DRMP_DC_io2'的值(即该tag实验数据)
tag_data_list = list(tag_data)
x_num = len(tag_data_list)
time_span = 1/tag_data.attrs['SampleRate']
start = tag_data.attrs['StartTime']
stop = (x_num - 1) * time_span
x_datalist = np.linspace(start, stop, x_num)
y_datalist = tag_data_list
openfile.close()
return x_datalist,y_datalist
def tag_xy(shotno = 1051501, tag = "\\IP",ip = '222.20.94.136'):
c = connection.Connection(ip)
print('Connected')
c.openTree('jtext', shot=shotno)
y = list(c.get(tag))
x = list(c.get(r'DIM_OF(BUILD_PATH({}))'.format(tag)))
return x,y
\ No newline at end of file
akshare==0.5.97
beautifulsoup4==4.9.1
bson==0.5.10
certifi==2021.10.8
chardet==3.0.4
click==8.0.3
colorama==0.4.4
cycler @ file:///tmp/build/80754af9/cycler_1637851556182/work
decorator==4.4.2
demjson==2.2.4
et-xmlfile==1.0.1
Flask @ file:///tmp/build/80754af9/flask_1634118196080/work
fonttools==4.25.0
h5py==2.8.0
html5lib==1.1
idna==2.10
itsdangerous @ file:///tmp/build/80754af9/itsdangerous_1621432558163/work
jdcal==1.4.1
Jinja2 @ file:///tmp/build/80754af9/jinja2_1635780242639/work
joblib==0.16.0
jsonpath==0.82
kiwisolver @ file:///C:/ci/kiwisolver_1612282618948/work
lxml==4.5.2
MarkupSafe @ file:///C:/ci/markupsafe_1621528383308/work
matplotlib==3.1.1
mplfinance==0.12.7a0
munkres==1.1.4
numpy==1.15.1
olefile==0.46
openpyxl==3.0.4
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
pandas==1.1.0
Pillow==7.2.0
PyExecJS==1.5.1
pymongo==3.2
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pypinyin==0.38.1
pyreadline==2.1
python-dateutil @ file:///tmp/build/80754af9/python-dateutil_1626374649649/work
pytz==2020.1
requests==2.24.0
scikit-learn==0.23.2
scipy==1.5.2
six @ file:///tmp/build/80754af9/six_1623709665295/work
soupsieve==2.0.1
tabulate==0.8.7
TBB==0.2
threadpoolctl==2.1.0
tornado @ file:///C:/ci/tornado_1606935947090/work
tqdm==4.48.2
webencodings==0.5.1
websocket-client==0.57.0
Werkzeug @ file:///tmp/build/80754af9/werkzeug_1635505089296/work
wincertstore==0.2
xlrd==1.2.0
name: Jtext
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
dependencies:
- blas=1.0=mkl
- brotli=1.0.9=ha925a31_2
- ca-certificates=2021.10.26=haa95532_2
- certifi=2021.10.8=py37haa95532_0
- click=8.0.3=pyhd3eb1b0_0
- cycler=0.11.0=pyhd3eb1b0_0
- dataclasses=0.8=pyh6d0b6a4_7
- flask=2.0.2=pyhd3eb1b0_0
- fonttools=4.25.0=pyhd3eb1b0_0
- freetype=2.10.4=hd328e21_0
- hdf5=1.10.4=h7ebc959_0
- icc_rt=2019.0.0=h0cc432a_1
- icu=58.2=ha925a31_3
- intel-openmp=2021.4.0=haa95532_3556
- itsdangerous=2.0.1=pyhd3eb1b0_0
- jinja2=3.0.2=pyhd3eb1b0_0
- jpeg=9d=h2bbff1b_0
- kiwisolver=1.3.1=py37hd77b12b_0
- libpng=1.6.37=h2a8f88b_0
- libtiff=4.2.0=hd0e1b90_0
- libwebp=1.2.0=h2bbff1b_0
- lz4-c=1.9.3=h2bbff1b_1
- markupsafe=2.0.1=py37h2bbff1b_0
- matplotlib=3.1.1=py37hc8f65d3_0
- mkl=2018.0.3=1
- munkres=1.1.4=py_0
- olefile=0.46=py37_0
- openssl=1.1.1l=h2bbff1b_0
- packaging=21.3=pyhd3eb1b0_0
- pillow=8.4.0=py37hd45dc43_0
- pip=21.2.4=py37haa95532_0
- pyparsing=3.0.4=pyhd3eb1b0_0
- pyqt=5.9.2=py37h6538335_2
- pyreadline=2.1=py37_1
- python=3.7.11=h6244533_0
- python-dateutil=2.8.2=pyhd3eb1b0_0
- pytz=2021.3=pyhd3eb1b0_0
- qt=5.9.7=vc14h73c81de_0
- setuptools=58.0.4=py37haa95532_0
- sip=4.19.8=py37h6538335_0
- six=1.16.0=pyhd3eb1b0_0
- sqlite=3.37.0=h2bbff1b_0
- tbb=2021.4.0=h59b6b97_0
- tbb4py=2021.4.0=py37h59b6b97_0
- tk=8.6.11=h2bbff1b_0
- tornado=6.1=py37h2bbff1b_0
- vc=14.2=h21ff451_1
- vs2015_runtime=14.27.29016=h5e58377_2
- werkzeug=2.0.2=pyhd3eb1b0_0
- wheel=0.37.0=pyhd3eb1b0_1
- wincertstore=0.2=py37haa95532_2
- xz=5.2.5=h62dcd97_0
- zlib=1.2.11=h8cc25b3_4
- zstd=1.4.9=h19a0ad4_0
- pip:
- bson==0.5.10
- colorama==0.4.4
- h5py==2.8.0
- numpy==1.15.1
- pymongo==3.2
- xlrd==1.2.0
prefix: C:\somesoftware\software\envs\Jtext
This diff is collapsed.
# J-text数据上传网站使用须知
## 一、上传网站的打开与使用
### 1.1服务器开启
在服务器中打开cmd命令行或anaconda prompt, 输入activate Jtext,回车再输入python "D:\Upload\Jtext-beta\upload.py"。即可开启服务器.
### 1.2项目依赖
见Jtextenv.yaml和Jtextenv.txt文件
### 1.3 浏览器选择(问题已解决)
请尽量使用edge、chrome浏览器。
无法点击页面按钮,Flask后端 debug提示“#"GET /favicon.ico HTTP/1.1" 404 ”。
原因:
360浏览器在浏览网页的时候,它会忽略端口。
也就是说http://localhost:3529/home.html,
firefox请求的是:link 的href所对应的图标。
搜狗浏览器等:请求的是http://localhost:3529/favicon.ico.
360浏览器等:请求的是http://localhost/favicon.ico,
也就是不管你请求的是http://host/home.html,还是http://host:333/home.html,还是http://host/test/home.html。它请求的都是http://host/favicon.ico.
解决方案:
前端框架使用bootstrip5,图表等均为其云服务,本地加一个icon文件。
### 1.4常见错误
#### 1.4.1 不显示上传按钮(已解决)
原因:可能是前端框架提供者Bootstrap File Input Options - © Kartik (krajee.com)出错。
解决方案:等待几小时即可恢复。可访问Bootstrap File Input Options - © Kartik (krajee.com)验证
其页面正常格式如上,如出现问题,他们的网站格式大概率也出现问题
修复方案:下载5.2.9版本fileinput文件css、js文件在本地调用。文件存放在项目static文件夹中。源文件是kartik-v-bootstrap-fileinput-v5.2.8-1-g1706cb8.Zip
#### 1.4.2 shotlog界面不显示最新数据
如果显示上传成功,但shotlog网页没有最新数据,可以输入炮号查看是否存在。或在服务器数据库查看是否存在数据。存在及上传成功。问题不知道出在哪里,可能是网站logbook的问题?更有可能是用户上传日期设置不规范。
## 二、Excel文件编辑时的注意事项
2.1 模板的正确使用
1. 网站提供三个模板,上传时请确认模板。
2. 上传文件时需检查excel表A1单元格是否标记“模板N”,后台根据该单元格标记匹配模板到数据库。
3. 上传的文件实验数据的tag记录位置需严格与模板数据匹配。(按列对应)
4. 上传的数据以炮号为唯一标志,无炮号数据集不会被上传,重复炮号数据将以最新上传的为准,查找并覆盖数据库同一炮号数据集内容。
!!!炮号一列请勿记录其他数据!!!
5. 只有文本内容会上传至数据库,Excel中空白内容、颜色标记、插入图片图表等内容不会在数据库中体现。
6. Excel中非数据库字段索引名称的tag会全部放在remarks。另外数据库字段索引内容中如excel中未记录,文本内容会被标记为空白(空字符串),数字内容会被标记为 -1,查询界面会添加单位,如vacuum为空记录值,标记-1,单位E19m~-3.
7. 注意!!!为匹配mongodb中shottime使用的date格式,excel中时间一列必须设置为下列任一种格式:
(1)设置单元格格式为“自定义”或“日期”类型中不含中文的格式,或DBNum格式:(推荐)
例:yyyy/m/d h:mm、yyyy/m/d、[DBNum1][$-804]yyyy"年"m"月"d"日"。
(2)设置单元格格式为“常规”类型请输入这种格式:(符号为英文输入法)
例:2021-02-03-08:45。
8. 一个excel中尽量只有一个sheet工作表,并且当日实验当日上传。这样的好习惯会在意外报错后查找、清洗数据库错误数据减少工作量,带来很大方便。当然程序也支持多文件上传、多sheet上传。
## 三、功能说明
1. 提供多文件上传、多工作表上传功能。
2. 提供日志打印功能。对数据库更新数据进行汇总打印
3. 提供查重功能。上传数据时与已有数据库进行比较与更新操作,避免多次上传相同炮号实验数据。
4. 提供检测功能。对文件格式、模板格式进行检测如图,请只上传xlsx、xls格式。
6. 提供报错提醒功能。对用户不规范操作及错误数据进行错误提醒。
7. 提供参考模板,模板中记录格式是可识别格式。
## 四、开发与维护
### 4.1 后续开发可能遇到的问题
#### 4.1.1 时间错误
数据库shottime中存放的时间是utc时间(世界标准时间),中国时间与UTC的时差均为+8(UTC+8)。Excel中记录时间是中国时间,直接上传到mongodb中默认上传了UTC,数值依旧不变,但未处理时差。故在开发时将excel时间-8h处理后上传到了数据库。
可能出现的问题:
显示打印的时间可能会自动根据时区打印不同的结果,所以打印了UTC+8,如需打印查询请注意可能的错误:-8h。
#### 4.1.2 数据库_id错误
上传时可能出现报错“After applying the update to the document {_id: ObjectId('55a930b9417274900a190000') , ...}, the (immutable) field '_id' was found to have been altered to {_id: ObjectId('55a930b9417274900a190000') , ...}”
原因:
数据库_id使用binary格式,不知道数据库最开始的开发者使用的生成策略是什么。这次开发时为匹配格式使用uuid1生成唯一序列。不排除极小概率事件下新id生成策略会与已记录的数据的id撞车。且uuid1有暴漏MAC地址的风险请注意。
### 4.2 维护相关
#### 4.2.1 数据库管理
服务器电脑搜索mongochef,进入界面点击local进行数据库链接,成功后点击界面左侧logbook中shotlog集合即可看到上传的数据。删除数据请右键remove document。
/*!
* FileInput <_LANG_> Translations
*
* This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or
* any HTML markup tags in the messages must not be converted or translated.
*
* @see http://github.com/kartik-v/bootstrap-fileinput
*
* NOTE: this file must be saved in UTF-8 encoding.
*/
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else if (typeof module === 'object' && typeof module.exports === 'object') {
factory(require('jquery'));
} else {
factory(window.jQuery);
}
}(function ($) {
"use strict";
$.fn.fileinputLocales['_LANG_'] = {
sizeUnits: ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
bitRateUnits: ['B/s', 'KB/s', 'MB/s', 'GB/s', 'TB/s', 'PB/s', 'EB/s', 'ZB/s', 'YB/s'],
fileSingle: 'file',
filePlural: 'files',
browseLabel: 'Browse &hellip;',
removeLabel: 'Remove',
removeTitle: 'Clear selected files',
cancelLabel: 'Cancel',
cancelTitle: 'Abort ongoing upload',
pauseLabel: 'Pause',
pauseTitle: 'Pause ongoing upload',
uploadLabel: 'Upload',
uploadTitle: 'Upload selected files',
msgNo: 'No',
msgNoFilesSelected: 'No files selected',
msgPaused: 'Paused',
msgCancelled: 'Cancelled',
msgPlaceholder: 'Select {files} ...',
msgZoomModalHeading: 'Detailed Preview',
msgFileRequired: 'You must select a file to upload.',
msgSizeTooSmall: 'File "{name}" (<b>{size}</b>) is too small and must be larger than <b>{minSize}</b>.',
msgSizeTooLarge: 'File "{name}" (<b>{size}</b>) exceeds maximum allowed upload size of <b>{maxSize}</b>.',
msgFilesTooLess: 'You must select at least <b>{n}</b> {files} to upload.',
msgFilesTooMany: 'Number of files selected for upload <b>({n})</b> exceeds maximum allowed limit of <b>{m}</b>.',
msgTotalFilesTooMany: 'You can upload a maximum of <b>{m}</b> files (<b>{n}</b> files detected).',
msgFileNotFound: 'File "{name}" not found!',
msgFileSecured: 'Security restrictions prevent reading the file "{name}".',
msgFileNotReadable: 'File "{name}" is not readable.',
msgFilePreviewAborted: 'File preview aborted for "{name}".',
msgFilePreviewError: 'An error occurred while reading the file "{name}".',
msgInvalidFileName: 'Invalid or unsupported characters in file name "{name}".',
msgInvalidFileType: 'Invalid type for file "{name}". Only "{types}" files are supported.',
msgInvalidFileExtension: 'Invalid extension for file "{name}". Only "{extensions}" files are supported.',
msgFileTypes: {
'image': 'image',
'html': 'HTML',
'text': 'text',
'video': 'video',
'audio': 'audio',
'flash': 'flash',
'pdf': 'PDF',
'object': 'object'
},
msgUploadAborted: 'The file upload was aborted',
msgUploadThreshold: 'Processing &hellip;',
msgUploadBegin: 'Initializing &hellip;',
msgUploadEnd: 'Done',
msgUploadResume: 'Resuming upload &hellip;',
msgUploadEmpty: 'No valid data available for upload.',
msgUploadError: 'Upload Error',
msgDeleteError: 'Delete Error',
msgProgressError: 'Error',
msgValidationError: 'Validation Error',
msgLoading: 'Loading file {index} of {files} &hellip;',
msgProgress: 'Loading file {index} of {files} - {name} - {percent}% completed.',
msgSelected: '{n} {files} selected',
msgProcessing: 'Processing ...',
msgFoldersNotAllowed: 'Drag & drop files only! Skipped {n} dropped folder(s).',
msgImageWidthSmall: 'Width of image file "{name}" must be at least <b>{size} px</b> (detected <b>{dimension} px</b>).',
msgImageHeightSmall: 'Height of image file "{name}" must be at least <b>{size} px</b> (detected <b>{dimension} px</b>).',
msgImageWidthLarge: 'Width of image file "{name}" cannot exceed <b>{size} px</b> (detected <b>{dimension} px</b>).',
msgImageHeightLarge: 'Height of image file "{name}" cannot exceed <b>{size} px</b> (detected <b>{dimension} px</b>).',
msgImageResizeError: 'Could not get the image dimensions to resize.',
msgImageResizeException: 'Error while resizing the image.<pre>{errors}</pre>',
msgAjaxError: 'Something went wrong with the {operation} operation. Please try again later!',
msgAjaxProgressError: '{operation} failed',
msgDuplicateFile: 'File "{name}" of same size "{size}" has already been selected earlier. Skipping duplicate selection.',
msgResumableUploadRetriesExceeded: 'Upload aborted beyond <b>{max}</b> retries for file <b>{file}</b>! Error Details: <pre>{error}</pre>',
msgPendingTime: '{time} remaining',
msgCalculatingTime: 'calculating time remaining',
ajaxOperations: {
deleteThumb: 'file delete',
uploadThumb: 'file upload',
uploadBatch: 'batch file upload',
uploadExtra: 'form data upload'
},
dropZoneTitle: 'Drag & drop files here &hellip;',
dropZoneClickTitle: '<br>(or click to select {files})',
fileActionSettings: {
removeTitle: 'Remove file',
uploadTitle: 'Upload file',
uploadRetryTitle: 'Retry upload',
downloadTitle: 'Download file',
zoomTitle: 'View details',
dragTitle: 'Move / Rearrange',
indicatorNewTitle: 'Not uploaded yet',
indicatorSuccessTitle: 'Uploaded',
indicatorErrorTitle: 'Upload Error',
indicatorPausedTitle: 'Upload Paused',
indicatorLoadingTitle: 'Uploading &hellip;'
},
previewZoomButtonTitles: {
prev: 'View previous file',
next: 'View next file',
toggleheader: 'Toggle header',
fullscreen: 'Toggle full screen',
borderless: 'Toggle borderless mode',
close: 'Close detailed preview'
}
};
}));
\ No newline at end of file
/*!
* bootstrap-fileinput v5.2.9
* http://plugins.krajee.com/file-input
*
* Krajee default styling for bootstrap-fileinput.
*
* Author: Kartik Visweswaran
* Copyright: 2014 - 2022, Kartik Visweswaran, Krajee.com
*
* Licensed under the BSD-3-Clause
* https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
*/.btn-file input[type=file],.file-caption-icon,.file-no-browse,.file-preview .fileinput-remove,.file-zoom-dialog .btn-navigate,.file-zoom-dialog .floating-buttons,.krajee-default .file-thumb-progress{position:absolute}.file-loading input[type=file],input[type=file].file-loading{width:0;height:0}.file-no-browse{left:50%;bottom:20%;width:1px;height:1px;font-size:0;opacity:0;border:none;background:0 0;outline:0;box-shadow:none}.file-caption-icon,.file-input-ajax-new .fileinput-remove-button,.file-input-ajax-new .fileinput-upload-button,.file-input-ajax-new .no-browse .input-group-btn,.file-input-new .close,.file-input-new .file-preview,.file-input-new .fileinput-remove-button,.file-input-new .fileinput-upload-button,.file-input-new .glyphicon-file,.file-input-new .no-browse .input-group-btn,.file-zoom-dialog .modal-header:after,.file-zoom-dialog .modal-header:before,.hide-content .kv-file-content,.is-locked .fileinput-remove-button,.is-locked .fileinput-upload-button,.kv-hidden{display:none}.file-caption .input-group{align-items:center}.file-caption-icon .kv-caption-icon{line-height:inherit}.btn-file,.file-caption,.file-input,.file-loading:before,.file-preview,.file-zoom-dialog .modal-dialog,.krajee-default .file-thumbnail-footer,.krajee-default.file-preview-frame{position:relative}.file-error-message pre,.file-error-message ul,.krajee-default .file-actions,.krajee-default .file-other-error{text-align:left}.file-error-message pre,.file-error-message ul{margin:0}.krajee-default .file-drag-handle,.krajee-default .file-upload-indicator{float:left;margin-top:10px;width:16px;height:16px}.file-thumb-progress .progress,.file-thumb-progress .progress-bar{font-family:Verdana,Helvetica,sans-serif;font-size:.7rem}.krajee-default .file-thumb-progress .progress,.kv-upload-progress .progress{background-color:#ccc}.krajee-default .file-caption-info,.krajee-default .file-size-info{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:160px;height:15px;margin:auto}.file-zoom-content>.file-object.type-flash,.file-zoom-content>.file-object.type-image,.file-zoom-content>.file-object.type-video{max-width:100%;max-height:100%;width:auto}.file-zoom-content>.file-object.type-flash,.file-zoom-content>.file-object.type-video{height:100%}.file-zoom-content>.file-object.type-default,.file-zoom-content>.file-object.type-html,.file-zoom-content>.file-object.type-pdf,.file-zoom-content>.file-object.type-text{width:100%}.file-loading:before{content:" Loading...";display:inline-block;padding-left:20px;line-height:16px;font-size:13px;font-variant:small-caps;color:#999;background:url(../img/loading.gif) top left no-repeat}.file-object{margin:0 0 -5px;padding:0}.btn-file{overflow:hidden}.btn-file input[type=file]{top:0;left:0;min-width:100%;min-height:100%;text-align:right;opacity:0;background:none;cursor:inherit;display:block}.btn-file ::-ms-browse{font-size:10000px;width:100%;height:100%}.file-caption.icon-visible .file-caption-icon{display:inline-block}.file-caption.icon-visible .file-caption-name{padding-left:25px}.file-caption.icon-visible>.input-group-lg .file-caption-name{padding-left:30px}.file-caption.icon-visible>.input-group-sm .file-caption-name{padding-left:22px}.file-caption-name:not(.file-caption-disabled){background-color:transparent}.file-caption-name.file-processing{font-style:italic;border-color:#bbb;opacity:.5}.file-caption-icon{padding:7px 5px;left:4px}.input-group-lg .file-caption-icon{font-size:1.25rem}.input-group-sm .file-caption-icon{font-size:.875rem;padding:.25rem}.file-error-message{color:#a94442;background-color:#f2dede;margin:5px;border:1px solid #ebccd1;border-radius:4px;padding:15px}.file-error-message pre{margin:5px 0}.file-caption-disabled{background-color:#eee;cursor:not-allowed;opacity:1}.file-preview{border-radius:5px;border:1px solid #ddd;padding:8px;width:100%;margin-bottom:5px}.file-preview .btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.file-preview .fileinput-remove{top:1px;right:1px;line-height:10px}.file-preview .clickable{cursor:pointer}.file-preview-image{font:40px Impact,Charcoal,sans-serif;color:green;width:auto;height:auto;max-width:100%;max-height:100%}.krajee-default.file-preview-frame{margin:8px;border:1px solid rgba(0,0,0,.2);box-shadow:0 0 10px 0 rgba(0,0,0,.2);padding:6px;float:left;text-align:center}.krajee-default.file-preview-frame .kv-file-content{width:213px;height:160px}.krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered{width:400px}.krajee-default.file-preview-frame[data-template=audio] .kv-file-content{width:240px;height:55px}.krajee-default.file-preview-frame .file-thumbnail-footer{height:70px}.krajee-default.file-preview-frame:not(.file-preview-error):hover{border:1px solid rgba(0,0,0,.3);box-shadow:0 0 10px 0 rgba(0,0,0,.4)}.krajee-default .file-preview-text{color:#428bca;border:1px solid #ddd;outline:0;resize:none}.krajee-default .file-preview-html{border:1px solid #ddd}.krajee-default .file-other-icon{font-size:6em;line-height:1}.krajee-default .file-footer-buttons{float:right}.krajee-default .file-footer-caption{display:block;text-align:center;padding-top:4px;font-size:11px;color:#777;margin-bottom:30px}.file-upload-stats{font-size:10px;text-align:center;width:100%}.kv-upload-progress .file-upload-stats{font-size:12px;margin:-10px 0 5px}.krajee-default .file-preview-error{opacity:.65;box-shadow:none}.krajee-default .file-thumb-progress{top:37px;left:0;right:0}.krajee-default.kvsortable-ghost{background:#e1edf7;border:2px solid #a1abff}.krajee-default .file-preview-other:hover{opacity:.8}.krajee-default .file-preview-frame:not(.file-preview-error) .file-footer-caption:hover{color:#000}.kv-upload-progress .progress{height:20px;margin:10px 0;overflow:hidden}.kv-upload-progress .progress-bar{height:20px;font-family:Verdana,Helvetica,sans-serif}.file-zoom-dialog .file-other-icon{font-size:22em;font-size:50vmin}.file-zoom-dialog .modal-dialog{width:auto}.file-zoom-dialog .modal-header{display:flex;align-items:center;justify-content:space-between}.file-zoom-dialog .btn-navigate{margin:0 .1rem;padding:0;font-size:1.2rem;width:2.4rem;height:2.4rem;top:50%;border-radius:50%;text-align:center}.btn-navigate *{width:auto}.file-zoom-dialog .floating-buttons{top:5px;right:10px}.file-zoom-dialog .btn-kv-prev{left:0}.file-zoom-dialog .btn-kv-next{right:0}.file-zoom-dialog .kv-zoom-header{padding:.5rem}.file-zoom-dialog .kv-zoom-body{padding:.25rem}.file-zoom-dialog .kv-zoom-description{position:absolute;opacity:.8;font-size:.8rem;background-color:#1a1a1a;padding:1rem;text-align:center;border-radius:.5rem;color:#fff;left:15%;right:15%;bottom:15%}.file-zoom-dialog .kv-desc-hide{float:right;color:#fff;padding:0 .1rem;background:0 0;border:none}.file-zoom-dialog .kv-desc-hide:hover{opacity:.7}.file-zoom-dialog .kv-desc-hide:focus{opacity:.9}.file-input-ajax-new .no-browse .form-control,.file-input-new .no-browse .form-control{border-top-right-radius:4px;border-bottom-right-radius:4px}.file-caption{width:100%;position:relative}.file-thumb-loading{background:url(../img/loading.gif) center center no-repeat content-box!important}.file-drop-zone{border:1px dashed #aaa;min-height:260px;border-radius:4px;text-align:center;vertical-align:middle;margin:12px 15px 12px 12px;padding:5px}.file-drop-zone.clickable:hover{border:2px dashed #999}.file-drop-zone.clickable:focus{border:2px solid #5acde2}.file-drop-zone .file-preview-thumbnails{cursor:default}.file-drop-zone-title{color:#aaa;font-size:1.6em;text-align:center;padding:85px 10px;cursor:default}.file-highlighted{border:2px dashed #999!important;background-color:#eee}.file-uploading{background:url(../img/loading-sm.gif) center bottom 10px no-repeat;opacity:.65}.file-zoom-fullscreen .modal-dialog{min-width:100%;margin:0}.file-zoom-fullscreen .modal-content{border-radius:0;box-shadow:none;min-height:100vh}.file-zoom-fullscreen .kv-zoom-body{overflow-y:auto}.floating-buttons{z-index:3000}.floating-buttons .btn-kv{margin-left:3px;z-index:3000}.kv-zoom-actions{min-width:140px}.kv-zoom-actions .btn-kv{margin-left:3px}.file-zoom-content{text-align:center;white-space:nowrap;min-height:300px}.file-zoom-content:hover{background:0 0}.file-zoom-content .file-preview-image,.file-zoom-content .file-preview-video{max-height:100%}.file-zoom-content>.file-object.type-image{height:auto;min-height:inherit}.file-zoom-content>.file-object.type-audio{width:auto;height:30px}@media (min-width:576px){.file-zoom-dialog .modal-dialog{max-width:500px}}@media (min-width:992px){.file-zoom-dialog .modal-lg{max-width:800px}}@media (max-width:767px){.file-preview-thumbnails{display:flex;justify-content:center;align-items:center;flex-direction:column}.file-zoom-dialog .modal-header{flex-direction:column}}@media (max-width:350px){.krajee-default.file-preview-frame:not([data-template=audio]) .kv-file-content{width:160px}}@media (max-width:420px){.krajee-default.file-preview-frame .kv-file-content.kv-pdf-rendered{width:100%}}.file-loading[dir=rtl]:before{background:url(../img/loading.gif) top right no-repeat;padding-left:0;padding-right:20px}.clickable .file-drop-zone-title{cursor:pointer}.file-sortable .file-drag-handle:hover{opacity:.7}.file-sortable .file-drag-handle{cursor:grab;opacity:1}.file-grabbing,.file-grabbing *{cursor:not-allowed!important}.file-grabbing .file-preview-thumbnails *{cursor:grabbing!important}.file-preview-frame.sortable-chosen{background-color:#d9edf7;border-color:#17a2b8;box-shadow:none!important}.file-preview .kv-zoom-cache{display:none}.file-preview-object,.file-preview-other-frame,.kv-zoom-body{display:flex;align-items:center;justify-content:center}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at kartikv2@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
Contributing to bootstrap-fileinput
===================================
Looking to contribute something to bootstrap-fileinput? **Here's how you can help.**
Please take a moment to review this document in order to make the contribution
process easy and effective for everyone involved.
Following these guidelines helps to communicate that you respect the time of
the developers managing and developing this open source project. In return,
they should reciprocate that respect in addressing your issue or assessing
patches and features.
Using the issue tracker
-----------------------
When [reporting bugs][reporting-bugs] or
[requesting features][requesting-features], the
[issue tracker on GitHub][issue-tracker] is the recommended channel to use.
The issue tracker **is not** a place for support requests. Refer the
[plugin documentation](http://plugins.krajee.com/file-input),
[plugin demos](http://plugins.krajee.com/file-input/demo), and / or refer to the
[webtips Q & A forum](http://webtips.krajee.com/questions) which are the better places to get help.
Reporting bugs with bootstrap-fileinput
---------------------------------------
We really appreciate clear bug reports that _consistently_ show an issue
_within bootstrap-fileinput_.
The ideal bug report follows these guidelines:
1. **Use the [GitHub issue search][issue-search]** &mdash; Check if the issue
has already been reported.
2. **Check if the issue has been fixed** &mdash; Try to reproduce the problem
using the code in the `master` branch.
3. **Isolate the problem** &mdash; Try to create an
[isolated js fiddle][isolated-case] that consistently reproduces the problem.
Please try to be as detailed as possible in your bug report, especially if an
isolated test case cannot be made. Some useful questions to include the answer
to are:
- What steps can be used to reproduce the issue?
- What is the bug and what is the expected outcome?
- What browser(s) and Operating System have you tested with?
- Does the bug happen consistently across all tested browsers?
- What version of jQuery are you using? And what version of bootstrap-fileinput?
- Are you using bootstrap-fileinput with other plugins?
All of these questions will help others fix and identify any potential bugs.
Requesting features in bootstrap-fileinput
------------------------------------------
Before starting work on a major feature for bootstrap-fileinput, **read the
[documentation](http://plugins.krajee.com/file-input) first** or you may risk spending a considerable amount of
time on something which the project developers are not interested in bringing into the project.
### Submitting a pull request
We use GitHub's pull request system for submitting patches. Here are some
guidelines to follow when creating the pull request for your fix.
1. Make sure to create a ticket for your pull request. This will serve as the
bug ticket, and any discussion about the bug will take place there. Your pull
request will be focused on the specific changes that fix the bug.
2. Make sure to reference the ticket you are fixing within your pull request.
This will allow us to close off the ticket once we merge the pull request, or
follow up on the ticket if there are any related blocking issues.
3. Explain why the specific change was made. Not everyone who is reviewing your
pull request will be familiar with the problem it is fixing.
4. Run your tests first. If your tests aren't passing, the pull request won't
be able to be merged. If you're breaking existing tests, make sure that you
aren't causing any breaking changes.
5. Only include source changes. While it's not required, only including changes
from the `src` directory will prevent merge conflicts from occuring. Making
this happen can be as a simple as not committing changes from the `dist`
directory.
By following these steps, you will make it easier for your pull request to be
reviewed and eventually merged.
Triaging issues and pull requests
---------------------------------
Anyone can help the project maintainers triage issues and review pull requests.
### Handling new issues
bootstrap-fileinput regularly receives new issues which need to be tested and organized.
When a new issue that comes in that is similar to another existing issue, it
should be checked to make sure it is not a duplicate. Duplicates issues should
be marked by replying to the issue with "Duplicate of #[issue number]" where
`[issue number]` is the url or issue number for the existing issue. This will
allow the project maintainers to quickly close off additional issues and keep
the discussion focused within a single issue.
If you can test issues that are reported to bootstrap-fileinput that contain test cases and
confirm under what conditions bugs happen, that will allow others to identify
what causes a bug quicker.
### Reviewing pull requests
It is very common for pull requests to be opened for issues that contain a clear
solution to the problem. These pull requests should be rigorously reviewed by
the community before being accepted. If you are not sure about a piece of
submitted code, or know of a better way to do something, do not hesitate to make
a comment on the pull request.
### Reviving old tickets
If you come across tickets which have not been updated for a while, you are
encouraged to revive them. While this can be as simple as saying `:+1:`, it is
best if you can include more information on the issue. Common bugs and feature
requests are more likely to be fixed, whether it is by the community or the
developers, so keeping tickets up to date is encouraged.
Licensing
---------
It should also be made clear that **all code contributed to bootstrap-fileinput** must be
licensable under the [BSD-3 license][licensing]. Code that cannot be released
under this license **cannot be accepted** into the project.
[isolated-case]: https://jsfiddle.net/
[issue-search]: https://github.com/kartik-v/bootstrap-fileinput/search?q=&type=Issues
[issue-tracker]: https://github.com/kartik-v/bootstrap-fileinput/issues
[licensing]: https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
[reporting-bugs]: #reporting-bugs-with-bootstrap-fileinput
[requesting-features]: #requesting-features-in-bootstrap-fileinput
\ No newline at end of file
# These are supported funding model platforms
# github: [kartik-v]
open_collective: bootstrap-fileinput
## Prerequisites
- [ ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- [ ] The issue still exists against the latest `master` branch of bootstrap-fileinput.
- [ ] This is not an usage question. I confirm having read the plugin [documentation](http://plugins.krajee.com/file-input) and [demos](http://plugins.krajee.com/file-input/demo).
- [ ] This is not a general programming / coding question. (Those should be directed to the [webtips Q & A forum](http://webtips.krajee.com/questions)).
- [ ] I have attempted to find the simplest possible steps to reproduce the issue.
- [ ] I have included a failing test as a pull request (Optional).
## Steps to reproduce the issue
1.
2.
3.
## Expected behavior and actual behavior
When I follow those steps, I see...
I was expecting...
## Environment
Browsers
- [ ] Google Chrome
- [ ] Mozilla Firefox
- [ ] Internet Explorer
- [ ] Safari
Operating System
- [ ] Windows
- [ ] Mac OS X
- [ ] Linux
- [ ] Mobile
Libraries
- jQuery version:
- bootstrap-fileinput version:
## Isolating the problem
- [ ] This bug happens [on the plugin demos page](http://plugins.krajee.com/file-input/demo)
- [ ] The bug happens consistently across all tested browsers
- [ ] This bug happens when using bootstrap-fileinput without other plugins
- [ ] I can reproduce this bug in [a jsbin](https://jsbin.com/)
## Scope
This pull request includes a
- [ ] Bug fix
- [ ] New feature
- [ ] Translation
## Changes
The following changes were made
-
-
-
## Related Issues
If this is related to an existing ticket, include a link to it as well.
\ No newline at end of file
# Configuration for sentiment-bot - https://github.com/behaviorbot/sentiment-bot
# *Required* toxicity threshold between 0 and .99 with the higher numbers being the most toxic
# Anything higher than this threshold will be marked as toxic and commented on
sentimentBotToxicityThreshold: .7
# *Required* Comment to reply with
sentimentBotReplyComment: >
Please be sure to review the code of conduct and be respectful of other users. cc/ @kartik-v
\ No newline at end of file
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- bug
- enhancement
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
\ No newline at end of file
nuget/content/
nuget/bootstrap-fileinput.*.nupkg
.DS_Store
.idea
\ No newline at end of file
.git
.github
.DS_Store
.idea
composer.json
bower.json
nuget
examples
\ No newline at end of file
This diff is collapsed.
Copyright (c) 2014 - 2022, Kartik Visweswaran
Krajee.com
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 names of Kartik Visweswaran or Krajee 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.
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment