0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-25 18:50:27 +01:00

Style and other fixes for API features

Dieser Commit ist enthalten in:
Angus McLeod 2022-06-02 16:45:20 +02:00
Ursprung eb8b289b50
Commit cf33fb9792
6 geänderte Dateien mit 43 neuen und 24 gelöschten Zeilen

Datei anzeigen

@ -88,6 +88,11 @@ export default Controller.extend({
twoLeggedOauth: equal("api.authType", "oauth_2"), twoLeggedOauth: equal("api.authType", "oauth_2"),
threeLeggedOauth: equal("api.authType", "oauth_3"), threeLeggedOauth: equal("api.authType", "oauth_3"),
@discourseComputed("api.isNew")
nameClass(isNew) {
return isNew ? "new" : "saved";
},
actions: { actions: {
addParam() { addParam() {
this.get("api.authParams").pushObject({}); this.get("api.authParams").pushObject({});

Datei anzeigen

@ -21,11 +21,11 @@
{{/if}} {{/if}}
</div> </div>
<div class="wizard-header"> <div class="wizard-header large">
{{#if api.isNew}} {{#if api.isNew}}
{{i18n "admin.wizard.api.new"}} {{i18n "admin.wizard.api.new"}}
{{else}} {{else}}
{{api.title}} <span>{{api.title}}</span>
{{/if}} {{/if}}
</div> </div>
@ -35,12 +35,12 @@
{{input value=api.title placeholder=(i18n "admin.wizard.api.title_placeholder")}} {{input value=api.title placeholder=(i18n "admin.wizard.api.title_placeholder")}}
</div> </div>
<div class="name"> <div class="name {{nameClass}}">
<label>{{i18n "admin.wizard.api.name"}}</label> <label>{{i18n "admin.wizard.api.name"}}</label>
{{#if api.isNew}} {{#if api.isNew}}
{{input value=api.name placeholder=(i18n "admin.wizard.api.name_placeholder")}} {{input value=api.name placeholder=(i18n "admin.wizard.api.name_placeholder")}}
{{else}} {{else}}
{{api.name}} <span>{{api.name}}</span>
{{/if}} {{/if}}
</div> </div>
</div> </div>
@ -63,7 +63,7 @@
{{/if}} {{/if}}
</div> </div>
<div class="wizard-header"> <div class="wizard-header medium">
{{i18n "admin.wizard.api.auth.label"}} {{i18n "admin.wizard.api.auth.label"}}
</div> </div>
</div> </div>
@ -71,7 +71,7 @@
<div class="wizard-api-authentication"> <div class="wizard-api-authentication">
<div class="settings"> <div class="settings">
<div class="wizard-header medium"> <div class="wizard-header small">
{{i18n "admin.wizard.api.auth.settings"}} {{i18n "admin.wizard.api.auth.settings"}}
</div> </div>
@ -174,7 +174,7 @@
{{/if}} {{/if}}
</div> </div>
<div class="wizard-header medium"> <div class="wizard-header small">
{{i18n "admin.wizard.api.status.label"}} {{i18n "admin.wizard.api.status.label"}}
</div> </div>
@ -220,7 +220,7 @@
{{/if}} {{/if}}
</div> </div>
<div class="wizard-header"> <div class="wizard-header medium">
{{i18n "admin.wizard.api.endpoint.label"}} {{i18n "admin.wizard.api.endpoint.label"}}
</div> </div>
@ -277,11 +277,15 @@
{{/if}} {{/if}}
</div> </div>
<div class="wizard-header"> <div class="wizard-header medium">
{{i18n "admin.wizard.api.log.label"}} {{i18n "admin.wizard.api.log.label"}}
{{d-button action=(action "clearLogs")
icon="trash-alt" <div class="controls">
class="clear-logs"}} {{d-button
action=(action "clearLogs")
class="clear-logs"
label="admin.wizard.api.log.clear"}}
</div>
</div> </div>
<div class="wizard-api-log"> <div class="wizard-api-log">
@ -300,7 +304,7 @@
<td>{{logentry.time}}</td> <td>{{logentry.time}}</td>
<td class="user-image"> <td class="user-image">
<div class="user-image-inner"> <div class="user-image-inner">
<a href={{logentry.userpath}} data-user-card={{logentry.username}}>{{avatar logentry imageSize="large"}}</a> <a href={{logentry.userpath}} data-user-card={{logentry.username}}>{{avatar logentry imageSize="medium"}}</a>
</div> </div>
</td> </td>
<td>{{logentry.status}}</td> <td>{{logentry.status}}</td>

Datei anzeigen

@ -79,7 +79,8 @@ $error: #ef1700;
} }
} }
& + div { & + div,
& + div + div {
margin-top: 30px; margin-top: 30px;
} }
} }
@ -212,6 +213,7 @@ $error: #ef1700;
.wizard-header { .wizard-header {
margin-bottom: 20px; margin-bottom: 20px;
display: flex;
&.large { &.large {
font-size: 1.5em; font-size: 1.5em;
@ -253,11 +255,12 @@ $error: #ef1700;
} }
&.medium { &.medium {
font-size: 1.3em; font-size: 1.2em;
} }
&.small { &.small {
font-size: 1em; font-size: 1em;
font-weight: 700;
margin-bottom: 5px; margin-bottom: 5px;
} }
@ -266,8 +269,9 @@ $error: #ef1700;
} }
.controls { .controls {
font-size: 1rem;
display: flex;
margin-left: auto; margin-left: auto;
margin-right: 0.5rem;
} }
} }

Datei anzeigen

@ -40,9 +40,18 @@
float: right; float: right;
} }
.wizard-header { .metadata {
overflow: hidden; display: flex;
font-size: 1.3em;
.title {
margin-right: 1em;
}
.name.saved span {
display: inline-block;
padding: 6px 12px;
background-color: var(--primary-low);
}
} }
} }
@ -74,10 +83,6 @@
width: 50%; width: 50%;
max-width: 50%; max-width: 50%;
.wizard-header {
overflow: hidden;
}
.authorization { .authorization {
float: right; float: right;
} }

Datei anzeigen

@ -447,6 +447,7 @@ en:
log: log:
label: "Logs" label: "Logs"
clear: clear
log: log:
nav_label: "Logs" nav_label: "Logs"

Datei anzeigen

@ -27,7 +27,7 @@ class CustomWizard::Api::LogEntry
log_id = new_data['log_id'] log_id = new_data['log_id']
else else
data = {} data = {}
log_id = SecureRandom.hex(3) log_id = SecureRandom.hex(8)
end end
new_data.each do |k, v| new_data.each do |k, v|