Skip to content

Commit

Permalink
Update AdminLTE to v3, Bootstrap to v4, jQuery to v3
Browse files Browse the repository at this point in the history
  • Loading branch information
nekketsuuu committed Mar 5, 2024
1 parent 5dda9ea commit 975717d
Show file tree
Hide file tree
Showing 60 changed files with 4,704 additions and 981 deletions.
105 changes: 90 additions & 15 deletions app/javascript/dmemo.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,103 @@
.skin-blue {
a {
color: #3c8dbc;

&:active,
&:focus,
&:hover {
outline: none;
text-decoration: none;
color: #72afd2;
}
}

.btn {
color: #ffffff;
}

.btn-primary {
background: #3c8dbc;
}

.main-header.navbar {
background: #3c8dbc;
border-bottom: 0 solid transparent;

.nav-item > a {
color: #ffffff;

&:active,
&:focus,
&:hover {
background: rgba(0, 0, 0, 0.1);
color: #f6f6f6;
}
}
}

.main-sidebar {
background: #222d32;

.brand-link {
background: #367fa9;
border-bottom: 0 solid transparent;
color: #ffffff;

padding: 0.8rem 0.5rem;

&:active,
&:hover {
background-color: #357ca5;
}
}

.sidebar {
.user-panel .info {
color: #b8c7ce;
}

.nav-item {
a {
color: #b8c7ce;
}

&:active > .nav-link,
&:hover > .nav-link {
background: rgba(255, 255, 255, 0.1);
color: #ffffff;
}
}

.btn,
.form-control {
background-color: #374850;
border: 1px solid #56606a;
color: white;
}
}
}
}

.brand-text {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 300;
}

.memo-block {
.timeline-header {
text-align: right;

img {
width: 20px;
height: 20px;
width: 1rem;
height: 1rem;
}
}
}

.markdown-block {
h1, h2, h3 {
margin-top: 10px;
margin-bottom: 10px;
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
}

Expand All @@ -30,23 +115,13 @@ a.editable-click, a.editable-click:hover {
}
}

.data-box {
.data-card {
overflow: auto;
}

.sidebar-menu {
li.treeview.opened .treeview-menu {
display: block;
}
}

.truncate-td {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 0;
}

.leftmost-th {
width: 400px;
}
4 changes: 2 additions & 2 deletions app/javascript/dmemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ function markdownEditor() {
}, 300);
};

$(document).ready(() => {
$(() => {
$('.markdown-editor').on('keyup', markdownEditor);
$(document).bind('cbox_complete', () => $('#colorbox .markdown-editor').on('keyup', markdownEditor));
$(document).on('cbox_complete', () => $('#colorbox .markdown-editor').on('keyup', markdownEditor));

$('a.colorbox').colorbox({closeButton: false, width: '600px', maxWidth: '1200px'});

Expand Down
8 changes: 3 additions & 5 deletions app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import '@fortawesome/fontawesome-free/css/brands.css';
import '@fortawesome/fontawesome-free/css/fontawesome.css';
import '@fortawesome/fontawesome-free/css/regular.css';
import '@fortawesome/fontawesome-free/css/solid.css';
import 'admin-lte/bootstrap/css/bootstrap.css';
import 'admin-lte/dist/css/AdminLTE.css';
import 'admin-lte/dist/css/skins/skin-blue.css';
import 'admin-lte/dist/css/adminlte.css';
import 'jquery-colorbox/example4/colorbox.css';
import 'pygments-css/github.css';
import '../dmemo.css';

import 'admin-lte/bootstrap/js/bootstrap';
import 'admin-lte/dist/js/app';
import 'admin-lte/dist/js/adminlte';
import 'admin-lte/node_modules/bootstrap/dist/js/bootstrap';
import 'jquery-colorbox/jquery.colorbox';
import Rails from '@rails/ujs';
import '../dmemo';
Expand Down
5 changes: 4 additions & 1 deletion app/views/column_memo_logs/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
%ul.timeline
.timeline
= render partial: "shared/description_log", collection: @column_memo_logs
- # The ending icon for the timeline.
%div
%i.fas.fa-clock.bg-gray
9 changes: 5 additions & 4 deletions app/views/column_memos/edit.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.box.box-info.with-border
.box-header
%h4
.card
.card-header.border-0
%h4.card-title
= @column_memo.name
= render "shared/description_editor", memo: @column_memo
.card-body
= render "shared/description_editor", memo: @column_memo
62 changes: 31 additions & 31 deletions app/views/data_sources/_form.html.haml
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
.box-header.with-border
%h2.box-title Data Source Adapter Setting
= form_for @data_source, html: { class: "form-horizontal" } do |f|
.box-body
.form-group
= f.label :name, class: "col-sm-2 control-label"
.card-header
%h2.card-title Data Source Adapter Setting
= form_for @data_source do |f|
.card-body
.form-group.row
= f.label :name, class: "col-sm-2 col-form-label"
.col-sm-10= f.text_field :name, class: "form-control", placeholder: "localhost"
.form-group
= f.label :description, class: "col-sm-2 control-label"
.form-group.row
= f.label :description, class: "col-sm-2 col-form-label"
.col-sm-10= f.text_field :description, class: "form-control", placeholder: "localhost database"
.form-group
= f.label :adapter, class: "col-sm-2 control-label"
.form-group.row
= f.label :adapter, class: "col-sm-2 col-form-label"
.col-sm-10= f.select :adapter, DataSourceAdapters.adapter_names, {}, class: "form-control"

#standard-config-fields.adapter-config
.form-group
= f.label :host, class: "col-sm-2 control-label"
.form-group.row
= f.label :host, class: "col-sm-2 col-form-label"
.col-sm-10= f.text_field :host, class: "form-control", placeholder: "localhost"
.form-group
= f.label :port, class: "col-sm-2 control-label"
.form-group.row
= f.label :port, class: "col-sm-2 col-form-label"
.col-sm-10= f.text_field :port, class: "form-control", placeholder: "5432"
.form-group
= f.label :dbname, "Database Name", class: "col-sm-2 control-label"
.form-group.row
= f.label :dbname, "Database Name", class: "col-sm-2 col-form-label"
.col-sm-10= f.text_field :dbname, class: "form-control", placeholder: "dmemo"
.form-group
= f.label :user, class: "col-sm-2 control-label"
.form-group.row
= f.label :user, class: "col-sm-2 col-form-label"
.col-sm-10= f.text_field :user, class: "form-control", placeholder: "root"
.form-group
= f.label :password, class: "col-sm-2 control-label"
.form-group.row
= f.label :password, class: "col-sm-2 col-form-label"
.col-sm-10= f.password_field :password, class: "form-control", value: @data_source.password
.form-group
= f.label :encoding, class: "col-sm-2 control-label"
.form-group.row
= f.label :encoding, class: "col-sm-2 col-form-label"
.col-sm-10= f.text_field :encoding, class: "form-control"

#bigquery-config-fields.adapter-config
= f.fields_for :bigquery_config, @data_source.bigquery_config || BigqueryConfig.new do |bq|
.form-group
= bq.label :project_id, class: "col-sm-2 control-label"
.form-group.row
= bq.label :project_id, class: "col-sm-2 col-form-label"
.col-sm-10= bq.text_field :project_id, class: "form-control", placeholder: "project-1234"
.form-group
= bq.label :dataset, class: "col-sm-2 control-label"
.form-group.row
= bq.label :dataset, class: "col-sm-2 col-form-label"
.col-sm-10= bq.text_field :dataset, class: "form-control", placeholder: "public"
.form-group
= bq.label :credentials, class: "col-sm-2 control-label"
.form-group.row
= bq.label :credentials, class: "col-sm-2 col-form-label"
.col-sm-10= bq.file_field :credentials, class: "form-control", placeholder: "public"


.box-footer
= f.submit class: "btn btn-primary pull-right"
.card-footer
= f.submit class: "btn btn-primary float-right"

:javascript
$(function() {
$(() => {
var standardAdpaters = #{DataSourceAdapters.standard_adapter_names.to_json.html_safe};
function toggleAdapter(adapterName) {
if (standardAdpaters.includes(adapterName)) {
Expand Down
106 changes: 55 additions & 51 deletions app/views/data_sources/_schema.html.haml
Original file line number Diff line number Diff line change
@@ -1,53 +1,57 @@
.box-header.with-border
%h2.box-title Schema Candidates
.card-header
%h2.card-title Schema Candidates

.box-body
%p
Schema Candidates is a whitelist of schemas to be imported. Only
%span.label.label-success subscribe
status schemas will be imported by batch. Click the Import button to add a schema to the whitelist.
%p
This schemas list is retrieved from
- case @data_source.adapter
- when 'postgresql'
%code pg_catalog.pg_namespace
- when 'mysql2'
%code database_name
- when 'redshift'
%code pg_catalog.pg_namespace
- else
%code (catalog table)
, so it has no effect on search_path or Ignored Tables on the setting page.
.card-body.p-0
.m-2
%p
Schema Candidates is a whitelist of schemas to be imported. Only
%span.badge.badge-success subscribe
status schemas will be imported by batch. Click the Import button to add a schema to the whitelist.
%p
This schemas list is retrieved from
- case @data_source.adapter
- when 'postgresql'
%code pg_catalog.pg_namespace
- when 'mysql2'
%code database_name
- when 'redshift'
%code pg_catalog.pg_namespace
- else
%code (catalog table)
, so it has no effect on search_path or Ignored Tables on the setting page.

%table.table.table-hover.table-bordered.table-striped{ role: "grid" }
%tr
%th schema name
%th schema owner
%th{ width: "90px"} subscribe status
%th{ width: "90px"} data source status
%th{ width: "170px"}
- @all_schemas.each do |schema_name, schema_owner|
%tr
%td
= schema_name
%td
= schema_owner
%td
- if subscribe?(schema_name)
%span.label.label-success Subscribe
- else
%span.label.label-danger Unsubscribe
%td
- if exist?(schema_name)
%span.label.label-success Exist
- else
%span.label.label-danger Disappeared
%td
= link_to import_schema_path(@data_source.id, schema_name), method: :patch,
class: "btn btn-primary pull-left #{disable_import_button(schema_name)}",
data: { confirm: "Import information of #{schema_name} schema? (Subscribe)" } do
Import
= link_to unlink_schema_path(@data_source.id, schema_name), method: :patch,
class: "btn btn-primary pull-right #{disable_unlink_button(schema_name)}",
data: { confirm: "Unlink #{schema_name} schema? \n(Not Delete, only unlink & stop subscribe)" } do
Unlink
.table-responsive
%table.table.table-hover.table-bordered.table-striped{ role: "grid" }
%thead
%tr
%th schema name
%th schema owner
%th.col-sm-1 subscribe status
%th.col-sm-1 data source status
%th.col-sm-2
%tbody
- @all_schemas.each do |schema_name, schema_owner|
%tr
%td
= schema_name
%td
= schema_owner
%td
- if subscribe?(schema_name)
%span.badge.badge-success Subscribe
- else
%span.badge.badge-danger Unsubscribe
%td
- if exist?(schema_name)
%span.badge.badge-success Exist
- else
%span.badge.badge-danger Disappeared
%td
= link_to import_schema_path(@data_source.id, schema_name), method: :patch,
class: "btn btn-primary float-left #{disable_import_button(schema_name)}",
data: { confirm: "Import information of #{schema_name} schema? (Subscribe)" } do
Import
= link_to unlink_schema_path(@data_source.id, schema_name), method: :patch,
class: "btn btn-primary float-right #{disable_unlink_button(schema_name)}",
data: { confirm: "Unlink #{schema_name} schema? \n(Not Delete, only unlink & stop subscribe)" } do
Unlink
Loading

0 comments on commit 975717d

Please sign in to comment.