Added project spec seting

master
alexey 1 month ago
parent e0d169e679
commit aee02beb03

@ -621,8 +621,16 @@ get "/gitspec/:id/:git_id" do
print_error_page(503, "Путь к проектам не существует") print_error_page(503, "Путь к проектам не существует")
else else
git_info = repo.get_repo_short_info_by_id(params["git_id"].to_i) git_info = repo.get_repo_short_info_by_id(params["git_id"].to_i)
@spec_file = db.get_project_repo_spec(params["id"], params["git_id"]) spec_f = db.get_project_repo_spec(params["id"], params["git_id"])
if spec_f.nil?
@spec_file = ""
else
@spec_file = spec_f[:spec_name]
end
@page_name = "#{prj_info[:projname]} редактирование spec для git проекта #{git_info[:reponame]}" @page_name = "#{prj_info[:projname]} редактирование spec для git проекта #{git_info[:reponame]}"
@proj_name = prj_info[:projname]
@proj_descr = prj_info[:descr]
@git_name = git_info[:reponame]
@proj_id = prj_info[:id] @proj_id = prj_info[:id]
@git_id = git_info[:id] @git_id = git_info[:id]
git_path = prj.get_project_path_git(prj_info[:id], git_info[:reponame]) git_path = prj.get_project_path_git(prj_info[:id], git_info[:reponame])
@ -638,6 +646,44 @@ get "/gitspec/:id/:git_id" do
end end
end end
post "/gitspec/:id/:git_id" do
prj = ProjectsActions.new(cfg.get_projects_path, db)
if prj.path.nil?
print_error_page(503, "Путь к проектам не существует")
else
repo = GitRepo.new(cfg.get_repo, db)
if repo.path.nil?
print_error_page(503, "Путь к репозиториям не существует")
else
prj_info = prj.get_project(params["id"])
if prj_info.nil?
print_error_page(503, "Путь к проектам не существует")
else
git_info = repo.get_repo_short_info_by_id(params["git_id"].to_i)
unless params["cancel"].nil?
redirect "/prjedit/#{params["id"]}"
else
unless params["save"].nil?
save_spec = ""
if params["useCustom"].nil?
save_spec = params["filelst"].strip
else
save_spec = params["speccustom"].strip
end
if save_spec != ""
db.save_project_repo_spec(prj_info[:id], git_info[:id], save_spec)
end
redirect "/prjedit/#{params["id"]}"
else
db.delete_project_repo_spec(prj_info[:id], git_info[:id])
redirect "/prjedit/#{params["id"]}"
end
end
end
end
end
end
not_found do not_found do
status 404 status 404
@page_name = "Кто-то потерялся" @page_name = "Кто-то потерялся"

@ -21,6 +21,9 @@ end
class ProjectsReposSpec < Sequel::Model(:projects_repos_spec) class ProjectsReposSpec < Sequel::Model(:projects_repos_spec)
end end
class ProjectsProjects < Sequel::Model(:projects_projects)
end
class DBase class DBase
attr :error, :last_id attr :error, :last_id
@ -166,4 +169,23 @@ class DBase
def get_project_repo_spec(prj_id, git_id) def get_project_repo_spec(prj_id, git_id)
ProjectsReposSpec.where(proj_id: prj_id.to_i, repo_id: git_id.to_i).first ProjectsReposSpec.where(proj_id: prj_id.to_i, repo_id: git_id.to_i).first
end end
def save_project_repo_spec(prj_id, git_id, spec)
rep = ProjectsReposSpec.where(proj_id: prj_id.to_i, repo_id: git_id.to_i).first
if rep.nil?
id = ProjectsReposSpec.insert(proj_id: prj_id.to_i, repo_id: git_id.to_i, spec_name: spec)
@last_id = id
else
ProjectsReposSpec.where(proj_id: prj_id.to_i, repo_id: git_id.to_i).update(spec_name: spec)
@last_id = nil
end
end
def delete_project_repo_spec(prj_id, git_id)
ProjectsReposSpec.where(proj_id: prj_id.to_i, repo_id: git_id.to_i).delete
end
def get_projects_links(prj_id)
ProjectsProjects.where(proj_id: prj_id.to_i).all
end
end end

@ -24,28 +24,25 @@ class GitRepo
def create_git(project_name, description) def create_git(project_name, description)
@error = nil @error = nil
ret_val = 0 ret_val = 0
File.open("locks/gitcreate", "r") do |f| fname = File.expand_path("#{project_name}.git", @path)
f.flock(File::LOCK_EX) if File.exist?(fname)
fname = File.expand_path("#{project_name}.git", @path) @error = "Репозиторий с таким именем уже существует: #{project_name}"
if File.exist?(fname) ret_val = 1
@error = "Репозиторий с таким именем уже существует: #{project_name}" else
ret_val = 1 Dir.mkdir(fname)
else Rugged::Repository.init_at(fname, :bare)
Dir.mkdir(fname) repo = Rugged::Repository.new(fname)
Rugged::Repository.init_at(fname, :bare) created = false
repo = Rugged::Repository.new(fname) if repo.bare?
created = false @error = @db.creategit(project_name, description)
if repo.bare? if @error.nil?
@error = @db.creategit(project_name, description) created = true
if @error.nil?
created = true
end
else
@error = "Репозиторий почему-то не пустой"
end
unless created
FileUtils.rm_rf(fname, secure: true)
end end
else
@error = "Репозиторий почему-то не пустой"
end
unless created
FileUtils.rm_rf(fname, secure: true)
end end
end end
ret_val ret_val
@ -58,20 +55,17 @@ class GitRepo
def getrepos def getrepos
repos_data = [] repos_data = []
File.open("locks/gitcreate", "r") do |f| repos_files = Dir[File.join(@path, "*.git")]
f.flock(File::LOCK_SH) repos_files.each do |fl|
repos_files = Dir[File.join(@path, "*.git")] repo_name = File.basename(fl, ".git")
repos_files.each do |fl| db_info = @db.get_repo_info_by_name(repo_name)
repo_name = File.basename(fl, ".git") unless db_info.nil?
db_info = @db.get_repo_info_by_name(repo_name) repos_data << { :reponame => db_info.reponame, :descr => db_info.descr, :public => db_info.public, :id => db_info.id }
unless db_info.nil? else
result = create_git_db_only(repo_name)
if result.nil?
db_info = @db.get_repo_info_by_name(repo_name)
repos_data << { :reponame => db_info.reponame, :descr => db_info.descr, :public => db_info.public, :id => db_info.id } repos_data << { :reponame => db_info.reponame, :descr => db_info.descr, :public => db_info.public, :id => db_info.id }
else
result = create_git_db_only(repo_name)
if result.nil?
db_info = @db.get_repo_info_by_name(repo_name)
repos_data << { :reponame => db_info.reponame, :descr => db_info.descr, :public => db_info.public, :id => db_info.id }
end
end end
end end
end end
@ -84,53 +78,50 @@ class GitRepo
@error = nil @error = nil
repos_data = { :full => 0 } repos_data = { :full => 0 }
git_path = File.join(@path, reponame + ".git") git_path = File.join(@path, reponame + ".git")
File.open("locks/gitcreate", "r") do |f| if File.exist?(git_path)
f.flock(File::LOCK_SH) repo = Rugged::Repository.new(git_path)
if File.exist?(git_path) db_info = @db.get_repo_info_by_name(reponame)
repo = Rugged::Repository.new(git_path) unless db_info.nil?
db_info = @db.get_repo_info_by_name(reponame) db_info = db_info.first
unless db_info.nil? repos_data = { :reponame => db_info.reponame, :descr => db_info.descr, :public => db_info.public, :full => 1 }
else
result = create_git_db_only(reponame)
if result.nil?
db_info = @db.get_repo_info_by_name(reponame)
db_info = db_info.first db_info = db_info.first
repos_data = { :reponame => db_info.reponame, :descr => db_info.descr, :public => db_info.public, :full => 1 } repos_data = { :reponame => db_info.reponame, :descr => db_info.descr, :public => db_info.public, :full => 1 }
end
end
if repos_data[:full] == 1
info[:info] = repos_data
if repo.empty?
info[:commits] = []
info[:branches] = []
info[:tags] = []
else else
result = create_git_db_only(reponame) ref = repo.head
if result.nil? unless branch.nil?
db_info = @db.get_repo_info_by_name(reponame) ref_name = File.join("refs/heads/", branch)
db_info = db_info.first ref = repo.references[ref_name]
repos_data = { :reponame => db_info.reponame, :descr => db_info.descr, :public => db_info.public, :full => 1 }
end end
end commits = []
if repos_data[:full] == 1 unless ref.nil?
info[:info] = repos_data walker = Rugged::Walker.new(repo)
if repo.empty? walker.sorting(Rugged::SORT_DATE)
info[:commits] = [] walker.push(ref.target)
info[:branches] = [] commits = walker.map do |commit|
info[:tags] = [] { :message => commit.message, :author => commit.author, :time => commit.time, :sha => commit.oid }
else end.first(10)
ref = repo.head
unless branch.nil?
ref_name = File.join("refs/heads/", branch)
ref = repo.references[ref_name]
end
commits = []
unless ref.nil?
walker = Rugged::Walker.new(repo)
walker.sorting(Rugged::SORT_DATE)
walker.push(ref.target)
commits = walker.map do |commit|
{ :message => commit.message, :author => commit.author, :time => commit.time, :sha => commit.oid }
end.first(10)
end
info[:commits] = commits
info[:branches] = repo.branches.each_name(:local).sort
info[:tags] = repo.tags.map { |tag| tag.name }
end end
else info[:commits] = commits
@error = result info[:branches] = repo.branches.each_name(:local).sort
info[:tags] = repo.tags.map { |tag| tag.name }
end end
else else
@error = "Репозиторий отсутсвует" @error = result
end end
else
@error = "Репозиторий отсутсвует"
end end
info[:error] = @error info[:error] = @error
info info
@ -138,12 +129,9 @@ class GitRepo
def delete_repo(reponame) def delete_repo(reponame)
git_path = File.expand_path(reponame + ".git", @path) git_path = File.expand_path(reponame + ".git", @path)
File.open("locks/gitcreate", "r") do |f| if File.exist?(git_path)
f.flock(File::LOCK_EX) FileUtils.rm_rf(git_path, secure: true)
if File.exist?(git_path) @db.delete_repo_by_name(reponame)
FileUtils.rm_rf(git_path, secure: true)
@db.delete_repo_by_name(reponame)
end
end end
end end
@ -155,23 +143,20 @@ class GitRepo
@error = nil @error = nil
repo_info = @db.get_repo_info_by_id(id) repo_info = @db.get_repo_info_by_id(id)
unless repo_info.nil? unless repo_info.nil?
File.open("locks/gitcreate", "r") do |f| git_path = File.join(@path, repo_info[:reponame] + ".git")
f.flock(File::LOCK_SH) if File.exist?(git_path)
git_path = File.join(@path, repo_info[:reponame] + ".git") repo = Rugged::Repository.new(git_path)
if File.exist?(git_path) if repo.empty?
repo = Rugged::Repository.new(git_path) @error = "Репозиторий пустой, нельзя добавить в проект пустой репозиторий"
if repo.empty?
@error = "Репозиторий пустой, нельзя добавить в проект пустой репозиторий"
else
if File.exist?(path)
FileUtils.rm_rf(path, secure: true)
end
Dir.mkdir(path)
Rugged::Repository.clone_at(repo.path, path)
end
else else
@error = "Файла репозитория не существует" if File.exist?(path)
FileUtils.rm_rf(path, secure: true)
end
Dir.mkdir(path)
Rugged::Repository.clone_at(repo.path, path)
end end
else
@error = "Файла репозитория не существует"
end end
else else
@error = "Нет информации о репозитории" @error = "Нет информации о репозитории"
@ -182,12 +167,9 @@ class GitRepo
def is_repos_sync(repo_name, prj_repo_path) def is_repos_sync(repo_name, prj_repo_path)
res = false res = false
repo = Rugged::Repository.new(prj_repo_path) repo = Rugged::Repository.new(prj_repo_path)
File.open("locks/gitcreate", "r") do |f| git_path = File.join(@path, repo_name + ".git")
f.flock(File::LOCK_SH) bare_repo = Rugged::Repository.new(git_path)
git_path = File.join(@path, repo_name + ".git") res = (bare_repo.head.target.tree.oid == repo.head.target.tree.oid)
bare_repo = Rugged::Repository.new(git_path)
res = (bare_repo.head.target.tree.oid == repo.head.target.tree.oid)
end
res res
end end
end end

@ -1,5 +1,6 @@
require "fileutils" require "fileutils"
require_relative "db" require_relative "db"
require_relative "repomanage"
PROJECTS_STRUCTURE = { PROJECTS_STRUCTURE = {
:REPO => "repo", :REPO => "repo",
@ -30,21 +31,11 @@ class ProjectsActions
end end
def get_projects def get_projects
prj = [] @db.proj_list
File.open("locks/prjcreate", "r") do |f|
f.flock(File::LOCK_SH)
prj = @db.proj_list
end
prj
end end
def get_project(id) def get_project(id)
prj = nil @db.proj(id.to_i)
File.open("locks/prjcreate", "r") do |f|
f.flock(File::LOCK_SH)
prj = @db.proj(id.to_i)
end
prj
end end
def get_project_path(id) def get_project_path(id)
@ -77,71 +68,109 @@ class ProjectsActions
File.join(proj_path, PROJECTS_STRUCTURE[:SRC], gitname) File.join(proj_path, PROJECTS_STRUCTURE[:SRC], gitname)
end end
def generate_linked_repos(id, proj_path, proj_name)
linked_prj = []
proj_repo_path = File.join(proj_path, PROJECTS_STRUCTURE[:REPO])
proj_repo = <<~PRJ_CFG
[#{proj_name}-repository]
name=Project repository #{proj_name}
baseurl=file://#{proj_repo_path}
enabled=1
priority=80
skip_if_unavailable=True
PRJ_CFG
linked_prj << proj_repo
unless id.nil?
link_prj_list = @db.get_projects_links(id)
unless link_prj_list.nil?
link_prj_list.each do |item|
internal_repo = ProjectsActions.new(@path, @db)
internal_path = internal_repo.get_project_path(item[:proj_id_repository])
internal_repo_path = File.join(internal_path, PROJECTS_STRUCTURE[:REPO])
internal_proj_info = internal_repo.get_project(item[:proj_id_repository])
proj_repo = <<~PRJ_CFG
[#{internal_proj_info[:projname]}-repository]
name=Project repository #{internal_proj_info[:projname]}
baseurl=file://#{internal_repo_path}
enabled=1
skip_if_unavailable=True
PRJ_CFG
linked_prj << proj_repo
end
end
end
File.open(prj_incl_path, "w") { |f| f << linked_prj.join("\n\n\n") }
end
def generate_config(id, configuration_path, proj_path, proj_name)
proj_conf_path = File.join(proj_path, PROJECTS_STRUCTURE[:CONFIGS], "#{proj_name}.cfg")
conf_path = File.join(proj_path, PROJECTS_STRUCTURE[:CONFIGS])
prj_incl_path = File.join(conf_path, "repos_include.tpl")
proj_config = <<~PRJ_CFG
include("#{configuration}")
include("#{prj_incl_path}")
config_opts['plugin_conf']['ccache_enable'] = True
config_opts['plugin_conf']['ccache_opts']['max_cache_size'] = '4G'
config_opts['plugin_conf']['ccache_opts']['hashdir'] = True
config_opts['plugin_conf']['ccache_opts']['debug'] = False
config_opts['plugin_conf']['ccache_opts']['show_stats'] = True
config_opts['plugin_conf']['package_state_enable'] = True
config_opts['plugin_conf']['procenv_enable'] = True
config_opts['plugin_conf']['root_cache_enable'] = True
config_opts['plugin_conf']['showrc_enable'] = True
config_opts['plugin_conf']['yum_cache_enable'] = True
PRJ_CFG
File.open(proj_conf_path, "w") { |f| f << proj_config }
generate_linked_repos(id, proj_path, proj_name)
end
def create_project(name, description, configuration) def create_project(name, description, configuration)
@error = nil @error = nil
ret_val = 0 ret_val = 0
project_name = sanitize_rcptname(name) project_name = sanitize_rcptname(name)
File.open("locks/prjcreate", "r") do |f| fname = File.expand_path("#{project_name}.prj", @path)
f.flock(File::LOCK_EX) if File.exist?(fname)
fname = File.expand_path("#{project_name}.prj", @path) @error = "Проект с таким именем уже существует: #{project_name}"
if File.exist?(fname) ret_val = 1
@error = "Проект с таким именем уже существует: #{project_name}" else
ret_val = 1 created = false
else begin
created = false Dir.mkdir(fname)
begin PROJECTS_STRUCTURE.each_pair do |key, value|
Dir.mkdir(fname) new_path = File.join(fname, value)
PROJECTS_STRUCTURE.each_pair do |key, value| Dir.mkdir(new_path)
new_path = File.join(fname, value) end
Dir.mkdir(new_path) if File.exist?(configuration)
end generate_config(nil, configuration, fname, project_name)
if File.exist?(configuration) @error = @db.proj_create(project_name, description)
conf_path = File.join(fname, PROJECTS_STRUCTURE[:CONFIGS], "#{project_name}.cfg") if @error.nil?
proj_config = <<~PRJ_CFG created = true
include("#{configuration}")
config_opts['plugin_conf']['ccache_enable'] = True
config_opts['plugin_conf']['ccache_opts']['max_cache_size'] = '4G'
config_opts['plugin_conf']['ccache_opts']['hashdir'] = True
config_opts['plugin_conf']['ccache_opts']['debug'] = False
config_opts['plugin_conf']['ccache_opts']['show_stats'] = True
config_opts['plugin_conf']['package_state_enable'] = True
config_opts['plugin_conf']['procenv_enable'] = True
config_opts['plugin_conf']['root_cache_enable'] = True
config_opts['plugin_conf']['showrc_enable'] = True
config_opts['plugin_conf']['yum_cache_enable'] = True
PRJ_CFG
File.open(conf_path, "w") { |f| f << proj_config }
@error = @db.proj_create(project_name, description)
if @error.nil?
created = true
end
else
ret_val = 1
@error = "Конфигурация #{configuration} не существует"
end end
rescue => e repo_path = File.join(fname, PROJECTS_STRUCTURE[:REPO])
repoman = RepoManager.new(repo_path)
repoman.create_repo
else
ret_val = 1 ret_val = 1
@error = e.message @error = "Конфигурация #{configuration} не существует"
end
unless created
FileUtils.rm_rf(fname, secure: true)
end end
rescue => e
ret_val = 1
@error = e.message
end
unless created
FileUtils.rm_rf(fname, secure: true)
end end
end end
ret_val ret_val
end end
def get_project_gits(id, repo) def get_project_gits(id, repo)
res = [] res = @db.get_gits_for_projects(id)
File.open("locks/prjcreate", "r") do |f| res_sync = res.map do |item|
f.flock(File::LOCK_EX) prj_p = get_project_path(id)
res = @db.get_gits_for_projects(id) path = File.join(prj_p, PROJECTS_STRUCTURE[:SRC], item[:reponame])
res_sync = res.map do |item| item[:is_repo_synced] = repo.is_repos_sync(item[:reponame], path)
prj_p = get_project_path(id) item
path = File.join(prj_p, PROJECTS_STRUCTURE[:SRC], item[:reponame])
item[:is_repo_synced] = repo.is_repos_sync(item[:reponame], path)
item
end
end end
res res
end end

@ -0,0 +1,14 @@
class RepoManager
attr :path, :error
def initialize(path)
@error = nil
unless File.exist? (path)
Dir.mkdir(path)
end
@path = path
end
def create_repo
end
end

@ -0,0 +1,49 @@
<%= erb :header %>
<script src="/js/jquery.dropdown.min.js"></script>
<div class="container">
<div class="row">
<div class="col-4">
<h3 class="bg-secondary-subtle text-center border-bottom border-primary-subtle rounded-1 pb-1 mb-2">
project 1
</h3>
<div class="pb-2">gfhs ag jahsg jhasgfjhgfjf ha jhf</div>
</div>
<div class="col-8">
<div class="vstack gap-3">
<form action="/rcpcrt" method="post">
<div class="mb-3">
<label for="prjlst" class="form-label">Выбирете проекты, от которых зависит данный
проект</label>
<div class="prjlist">
<select class="form-control" id="prjlst" name="prjlst" multiple>
<option value="1" selected>test1</option>
<option value="2">tets2</option>
<option value="3">test33</option>
<option value="4">test44</option>
</select>
</div>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="disableLinks"
name="disableLinks" value="disableLinks">
<label class="form-check-label" for="disableLinks">Удалить связи со всеми проектами</label>
</div>
<div class="container">
<div style="padding-top: 45px;"></div>
</div>
<div class="mb-3 text-center">
<button type="submit" class="btn btn-primary" name="save" value="save">Сохранить</button>
<button type="submit" class="btn btn-secondary" name="cancel"
value="cansel">Отменить</button>
</div>
</form>
</div>
</div>
</div>
</div>
<script>
$('.prjlist').dropdown({
searchNoData: '<li style="color:#ddd">Нет данных</li>',
});
</script>
<%= erb :footer %>

@ -1,35 +1,67 @@
<%= erb :header %> <%= erb :header %>
<script src="js/jquery.dropdown.min.js"></script> <script src="/js/jquery.dropdown.min.js"></script>
<div class="container"> <div class="container">
<form action="/gitspec/<%= ERB::Util.url_encode(@proj_id) %>/<%= ERB::Util.url_encode(@git_id) %>" method="post"> <div class="modal fade" id="modalData" aria-hidden="true" aria-labelledby="modalDataLabel"
<div class="mb-3"> tabindex="-1">
<label for="projname" class="form-label">Установить имя spec файла для гит проекта</label> <div class="modal-dialog modal-dialog-centered">
<input type="text" class="form-control" id="speccustom" name="speccustom" value="<%= @spec_file %>"> <div class="modal-content">
</div> <div class="modal-body">
<div class="mb-3"> Вы уверены, что хотите удалить привязку spec файла?
<label for="description" class="form-label">Доступные spec файлы</label> </div>
<div class="filelist"> <div class="modal-footer">
<select class="form-control" id="filelst" name="filelst"> <button class="btn btn-primary" data-bs-dismiss="modal">Отмена</button>
<% @files_list.each do |item| %> <button class="btn btn-danger" data-bs-dismiss="modal" id="btnDelete">Удалить</button>
<% if !@spec_file.nil? && item.include?(@spec_file) %> </div>
<option value="<%= item %>" selected><%= item %></option>
<% else %>
<option value="<%= item %>"><%= item %></option>
<% end %>
<% end %>
</select>
</div> </div>
</div> </div>
<div class="mb-3 text-center"> </div>
<button type="submit" class="btn btn-primary" name="save" value="1">Сохранить</button> <div class="row">
<button type="submit" class="btn btn-danger" name="delete" value="2">Удалить установленный spec</button> <div class="col-4">
<button type="submit" class="btn btn-secondary" name="delete" value="2">Отмена</button> <h3 class="bg-secondary-subtle text-center border-bottom border-primary-subtle rounded-1 pb-1 mb-2">
<a href="/prjedit/<%= ERB::Util.url_encode(@proj_id) %>"><%= @proj_name %></a>
</h3>
<div class="pb-2"><%= @proj_descr %></div>
<div class="pb-2">git репозиторий <%= @git_name %></div>
</div>
<div class="col-8">
<form action="/gitspec/<%= ERB::Util.url_encode(@proj_id) %>/<%= ERB::Util.url_encode(@git_id) %>" method="post" id="sndFrm">
<div class="mb-3">
<label for="projname" class="form-label">Установить имя spec файла для гит проекта</label>
<input type="text" class="form-control" id="speccustom" name="speccustom" value="<%= @spec_file %>">
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="useCustom" name="useCustom" value="useCustom">
<label class="form-check-label" for="speccustom">Использовать spec файл, заданный вручную</label>
</div>
<div class="mb-3">
<label for="description" class="form-label">Доступные spec файлы</label>
<div class="filelist">
<select class="form-control" id="filelst" name="filelst">
<% @files_list.each do |item| %>
<% if !@spec_file.nil? && item.include?(@spec_file) %>
<option value="<%= item %>" selected><%= item %></option>
<% else %>
<option value="<%= item %>"><%= item %></option>
<% end %>
<% end %>
</select>
</div>
</div>
<div class="mb-3 text-center">
<button type="submit" class="btn btn-primary" name="save" value="1">Сохранить</button>
<button type="button" class="btn btn-danger" name="delete" value="2" id="btnDDD" data-bs-toggle="modal" data-bs-target="#modalData">Удалить установленный spec</button>
<button type="submit" class="btn btn-secondary" name="cancel" value="3">Отмена</button>
</div>
</form>
</div> </div>
</form> </div>
</div> </div>
<script> <script>
$('.filelist').dropdown({ $('.filelist').dropdown({
searchNoData: '<li style="color:#ddd">Нет данных</li>', searchNoData: '<li style="color:#ddd">Нет данных</li>',
}); });
$('#btnDelete').on("click", function(){
$("#sndFrm").trigger("submit");
});
</script> </script>
<%= erb :footer %> <%= erb :footer %>
Loading…
Cancel
Save