forked from aptos-labs/aptos-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
385f0da
commit 1a4622e
Showing
65 changed files
with
827 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ruby 3.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
ecosystem/platform/server/app/assets/stylesheets/application.tailwind.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
ecosystem/platform/server/app/controllers/it1_profiles_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# frozen_string_literal: true | ||
|
||
class It1ProfilesController < ApplicationController | ||
before_action :authenticate_user! | ||
before_action :set_it1_profile, only: %i[show edit update destroy] | ||
|
||
# GET /it1_profiles/new | ||
def new | ||
@it1_profile = It1Profile.new | ||
end | ||
|
||
# GET /it1_profiles/1/edit | ||
def edit; end | ||
|
||
# POST /it1_profiles or /it1_profiles.json | ||
def create | ||
params = it1_profile_params | ||
params[:user] = current_user | ||
@it1_profile = It1Profile.new(params) | ||
|
||
respond_to do |format| | ||
if @it1_profile.save | ||
format.html { redirect_to overview_index_path, notice: 'IT1 application was successfully created.' } | ||
else | ||
format.html { render :new, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# PATCH/PUT /it1_profiles/1 or /it1_profiles/1.json | ||
def update | ||
respond_to do |format| | ||
if @it1_profile.update(it1_profile_params) | ||
format.html { redirect_to overview_index_path, notice: 'IT1 application was successfully updated.' } | ||
else | ||
format.html { render :edit, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
private | ||
|
||
# Use callbacks to share common setup or constraints between actions. | ||
def set_it1_profile | ||
@it1_profile = It1Profile.find(params[:id]) | ||
head :forbidden unless @it1_profile.user_id == current_user.id | ||
end | ||
|
||
# Only allow a list of trusted parameters through. | ||
def it1_profile_params | ||
params.fetch(:it1_profile, {}).permit(:consensus_key, :account_key, :network_key, :validator_address, | ||
:validator_port, :metrics_port, :fullnode_address, :fullnode_port, :terms) | ||
end | ||
end |
18 changes: 18 additions & 0 deletions
18
ecosystem/platform/server/app/controllers/onboarding_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
class OnboardingController < ApplicationController | ||
def email | ||
@oauth_username = current_user.authorizations.pluck(:username).first | ||
@oauth_email = current_user.authorizations.pluck(:email).first | ||
end | ||
|
||
def email_update | ||
email_params = params.require(:user).permit(:email) | ||
if current_user.update(email_params) | ||
current_user.send_confirmation_instructions | ||
redirect_to overview_index_path | ||
else | ||
render :email, status: :unprocessable_entity | ||
end | ||
end | ||
end |
7 changes: 7 additions & 0 deletions
7
ecosystem/platform/server/app/controllers/overview_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class OverviewController < ApplicationController | ||
before_action :authenticate_user! | ||
|
||
def index; end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
ecosystem/platform/server/app/controllers/welcome_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class WelcomeController < ApplicationController | ||
def index; end | ||
|
||
def it1; end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
module It1ProfilesHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
module OnboardingHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
module OverviewHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
module WelcomeHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
class It1Profile < ApplicationRecord | ||
belongs_to :user | ||
|
||
validates :consensus_key, presence: true, uniqueness: true, format: { with: /\A0x[a-f0-9]{64}\z/i } | ||
validates :account_key, presence: true, uniqueness: true, format: { with: /\A0x[a-f0-9]{64}\z/i } | ||
validates :network_key, presence: true, uniqueness: true, format: { with: /\A0x[a-f0-9]{64}\z/i } | ||
|
||
validates :validator_address, presence: true | ||
validates :validator_port, presence: true, numericality: { only_integer: true } | ||
validates :metrics_port, presence: true, numericality: { only_integer: true } | ||
|
||
validates :fullnode_port, numericality: { only_integer: true }, allow_nil: true | ||
|
||
validates :terms, acceptance: true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 0 additions & 43 deletions
43
ecosystem/platform/server/app/views/devise/registrations/edit.html.erb
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
ecosystem/platform/server/app/views/devise/registrations/new.html.erb
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.