diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1b2bc475..7fd78bfa 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -837,6 +837,12 @@ class ApplicationController < ActionController::Base end private + def update_last_login_on + if current_user.logged? + current_user.update_column(:last_login_on, Time.now) + end + end + def object_not_found uid_logger("Missing template or cant't find record, responding with 404") render json: {message: "您访问的页面不存在或已被删除", status: 404} diff --git a/app/models/gitea/pull.rb b/app/models/gitea/pull.rb index 591e36c4..c554680c 100644 --- a/app/models/gitea/pull.rb +++ b/app/models/gitea/pull.rb @@ -6,9 +6,6 @@ # type :integer # status :integer # conflicted_files :text(65535) -# commits_ahead :integer -# commits_behind :integer -# changed_protected_files :text(65535) # issue_id :integer # index :integer # head_repo_id :integer @@ -20,6 +17,11 @@ # merged_commit_id :string(40) # merger_id :integer # merged_unix :integer +# commits_ahead :integer +# commits_behind :integer +# changed_protected_files :text(65535) +# commit_num :integer +# changed_files :integer # # Indexes # diff --git a/app/models/gitea/webhook.rb b/app/models/gitea/webhook.rb index 77aa3c7d..827badb0 100644 --- a/app/models/gitea/webhook.rb +++ b/app/models/gitea/webhook.rb @@ -6,19 +6,21 @@ # repo_id :integer # org_id :integer # url :text(65535) -# signature :text(65535) # http_method :string(255) # content_type :integer # secret :text(65535) # events :text(65535) -# is_ssl :boolean # is_active :boolean -# hook_task_type :integer # meta :text(65535) # last_status :integer # created_unix :integer # updated_unix :integer # is_system_webhook :boolean default("0"), not null +# type :string(16) +# branch_filter :text(65535) +# signature :text(65535) +# is_ssl :boolean +# hook_task_type :integer # # Indexes # diff --git a/app/models/gitea/webhook_task.rb b/app/models/gitea/webhook_task.rb index 21f42c6a..2c2d97a6 100644 --- a/app/models/gitea/webhook_task.rb +++ b/app/models/gitea/webhook_task.rb @@ -6,19 +6,19 @@ # repo_id :integer # hook_id :integer # uuid :string(255) -# type :integer -# url :text(65535) -# signature :text(65535) # payload_content :text(65535) -# http_method :string(255) -# content_type :integer # event_type :string(255) -# is_ssl :boolean # is_delivered :boolean # delivered :integer # is_succeed :boolean # request_content :text(65535) # response_content :text(65535) +# type :string(255) +# url :text(65535) +# signature :text(65535) +# http_method :string(255) +# content_type :integer +# is_ssl :boolean # # Indexes # diff --git a/app/models/statistic.rb b/app/models/statistic.rb index 4785060f..0b7da64b 100644 --- a/app/models/statistic.rb +++ b/app/models/statistic.rb @@ -6,6 +6,8 @@ # dau :integer # created_at :datetime not null # updated_at :datetime not null +# wau :integer +# mau :integer # class Statistic < ApplicationRecord diff --git a/db/migrate/20211224071147_add_column_to_statistics.rb b/db/migrate/20211224071147_add_column_to_statistics.rb new file mode 100644 index 00000000..609f3595 --- /dev/null +++ b/db/migrate/20211224071147_add_column_to_statistics.rb @@ -0,0 +1,6 @@ +class AddColumnToStatistics < ActiveRecord::Migration[5.2] + def change + add_column :statistics, :wau, :integer + add_column :statistics, :mau, :integer + end +end