add module update button

This commit is contained in:
JiangRu 2014-12-31 15:13:49 +08:00
parent 76397de5ef
commit 4425063a68
4 changed files with 22 additions and 0 deletions

View File

@ -126,6 +126,8 @@
<div style="height: 55px;"> <div style="height: 55px;">
<% if @store_permissions["permission_granted"] %> <% if @store_permissions["permission_granted"] %>
<button id="update_btn" class="btn btn-primary pull-right" style="margin: 10px;"><i class="icon-inbox icon-white"></i> <%= t("update_manager_.system_update") %></button> <button id="update_btn" class="btn btn-primary pull-right" style="margin: 10px;"><i class="icon-inbox icon-white"></i> <%= t("update_manager_.system_update") %></button>
<button id="module_update_btn" class="btn btn-primary pull-right" style="margin: 10px;"><i class="icon-inbox icon-white"></i> <%= t("update_manager_.module_update") %></button>
<% else %> <% else %>
<a href="/<%= I18n.locale.to_s %>/admin/designs" class="pull-right">Please register here.</a> <a href="/<%= I18n.locale.to_s %>/admin/designs" class="pull-right">Please register here.</a>
<% end %> <% end %>
@ -245,10 +247,27 @@
} }
} }
function check_module_updates(){
$("#progress_msg").html("<strong><%= t("update_manager_.updating_orbit") %></strong>");
$("#new_update_container").fadeOut(function(){
$("#update_done").fadeOut(function(){
$("#update_status").fadeIn(function(){
$("#update_progress").fadeIn();
$.get("<%= admin_site_bundle_install_path %>",function(result){
$("#update_progress").fadeOut(function(){$("#update_done").fadeIn();});
$("#update_status").fadeIn();
});
});
});
});
}
$(document).ready(function(){ $(document).ready(function(){
check_updates(); check_updates();
get_update_history(); get_update_history();
$("#module_update_btn").click(check_module_updates);
$("#chech_update_btn").click(check_updates); $("#chech_update_btn").click(check_updates);
$("#update_btn").click(function(){ $("#update_btn").click(function(){

View File

@ -603,6 +603,7 @@ en:
check_update: Check Update check_update: Check Update
checking_update: Checking for Updates checking_update: Checking for Updates
system_update: Install Updates system_update: Install Updates
module_update: Module Updates
update_done: System is update to date update_done: System is update to date
update_faild: Update failed. Merge is require in the update. Please login to server and update manually. update_faild: Update failed. Merge is require in the update. Please login to server and update manually.
update_history: Update Histroy update_history: Update Histroy

View File

@ -612,6 +612,7 @@ zh_tw:
check_update: 檢查更新 check_update: 檢查更新
checking_update: 檢查更新中 checking_update: 檢查更新中
system_update: 安裝更新 system_update: 安裝更新
module_update: 模組更新
update_done: 系統已是最新版本 update_done: 系統已是最新版本
update_faild: 更新失敗. 更新需要合併程式碼. 請登入伺服器手動進行更新. update_faild: 更新失敗. 更新需要合併程式碼. 請登入伺服器手動進行更新.
update_history: 更新紀錄 update_history: 更新紀錄

View File

@ -197,6 +197,7 @@ Orbit::Application.routes.draw do
get 'get_update_history' get 'get_update_history'
get 'check_updates' get 'check_updates'
get 'update_orbit' get 'update_orbit'
get 'bundle_install'
get 'restart_server' get 'restart_server'
get 'delete_mail_log' get 'delete_mail_log'
end end