Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-25 18:50:27 +01:00
Improve log UI
Dieser Commit ist enthalten in:
Ursprung
9694b7b7d3
Commit
147b8a787c
7 geänderte Dateien mit 64 neuen und 11 gelöschten Zeilen
|
@ -2,6 +2,7 @@ import { default as computed } from 'discourse-common/utils/decorators';
|
|||
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||
import { ajax } from 'discourse/lib/ajax';
|
||||
import { notEmpty } from "@ember/object/computed";
|
||||
import CustomWizardLogs from '../models/custom-wizard-logs';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
refreshing: false,
|
||||
|
@ -15,11 +16,7 @@ export default Ember.Controller.extend({
|
|||
|
||||
this.set("refreshing", true);
|
||||
|
||||
ajax('/admin/wizards/logs', {
|
||||
data: {
|
||||
page: this.page
|
||||
}
|
||||
}).catch(popupAjaxError)
|
||||
CustomWizardLogs.list()
|
||||
.then(result => {
|
||||
if (!result || result.length === 0) {
|
||||
this.set('canLoadMore', false);
|
||||
|
|
17
assets/javascripts/discourse/models/custom-wizard-logs.js.es6
Normale Datei
17
assets/javascripts/discourse/models/custom-wizard-logs.js.es6
Normale Datei
|
@ -0,0 +1,17 @@
|
|||
import { ajax } from 'discourse/lib/ajax';
|
||||
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||
import EmberObject from "@ember/object";
|
||||
|
||||
const CustomWizardLogs = EmberObject.extend();
|
||||
|
||||
CustomWizardLogs.reopenClass({
|
||||
list(page = 0) {
|
||||
return ajax('/admin/wizards/logs', {
|
||||
data: {
|
||||
page
|
||||
}
|
||||
}).catch(popupAjaxError);
|
||||
}
|
||||
});
|
||||
|
||||
export default CustomWizardLogs;
|
11
assets/javascripts/discourse/routes/admin-wizards-logs.js.es6
Normale Datei
11
assets/javascripts/discourse/routes/admin-wizards-logs.js.es6
Normale Datei
|
@ -0,0 +1,11 @@
|
|||
import CustomWizardLogs from '../models/custom-wizard-logs';
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
model() {
|
||||
return CustomWizardLogs.list();
|
||||
},
|
||||
|
||||
setupController(controller, model) {
|
||||
controller.set('logs', model);
|
||||
}
|
||||
})
|
|
@ -1,8 +1,14 @@
|
|||
<div class="admin-wizard-controls">
|
||||
{{d-button label="refresh" icon="refresh" action="refresh"}}
|
||||
<h3>{{i18n 'admin.wizard.log.nav_label'}}</h3>
|
||||
|
||||
{{d-button
|
||||
label="refresh"
|
||||
icon="refresh"
|
||||
action="refresh"
|
||||
class="refresh"}}
|
||||
</div>
|
||||
|
||||
{{#load-more selector=".log-list tr" action=(action "loadMore")}}
|
||||
{{#load-more selector=".log-list tr" action=(action "loadMore") class="wizard-logs"}}
|
||||
{{#if noResults}}
|
||||
<p>{{i18n 'search.no_results'}}</p>
|
||||
{{else}}
|
||||
|
@ -10,14 +16,14 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>Message</th>
|
||||
<th>Date</th>
|
||||
<th class="date">Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each logs as |log|}}
|
||||
<tr>
|
||||
<td>{{log.message}}</td>
|
||||
<td>{{bound-date log.date}}</td>
|
||||
<td class="date">{{bound-date log.date}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
|
|
|
@ -21,8 +21,14 @@
|
|||
|
||||
<div class="wizard-message">
|
||||
{{d-icon 'question-circle'}}
|
||||
<span>{{i18n 'admin.wizard.message.help'}}</span>
|
||||
|
||||
<a href="https://thepavilion.io/c/knowledge/custom-wizard" target="_blank">
|
||||
{{i18n 'admin.wizard.message.help'}}
|
||||
{{i18n 'admin.wizard.message.documentation'}}
|
||||
</a>
|
||||
|
||||
<a href="mailto:help@thepavilion.io" target="_blank">
|
||||
{{i18n 'admin.wizard.message.contact'}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -30,6 +30,20 @@
|
|||
overflow: scroll;
|
||||
}
|
||||
|
||||
.admin-wizards-logs {
|
||||
.admin-wizard-controls {
|
||||
h3 {
|
||||
margin: 0 7px;
|
||||
}
|
||||
}
|
||||
|
||||
.wizard-logs {
|
||||
.date {
|
||||
width: 100px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wizard-settings-parent {
|
||||
margin-bottom: 30px;
|
||||
padding: 20px;
|
||||
|
|
|
@ -58,7 +58,9 @@ en:
|
|||
select: "Select a wizard, or create a new one"
|
||||
edit: "You're editing a wizard"
|
||||
create: "You're creating a new wizard"
|
||||
help: "Need help? Check out the documentation"
|
||||
help: "Need help?"
|
||||
documentation: "Check out the documentation"
|
||||
contact: "Contact the developer"
|
||||
|
||||
editor:
|
||||
show: "Show"
|
||||
|
|
Laden …
In neuem Issue referenzieren