Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 17:30:29 +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 { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||||
import { ajax } from 'discourse/lib/ajax';
|
import { ajax } from 'discourse/lib/ajax';
|
||||||
import { notEmpty } from "@ember/object/computed";
|
import { notEmpty } from "@ember/object/computed";
|
||||||
|
import CustomWizardLogs from '../models/custom-wizard-logs';
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Ember.Controller.extend({
|
||||||
refreshing: false,
|
refreshing: false,
|
||||||
|
@ -15,11 +16,7 @@ export default Ember.Controller.extend({
|
||||||
|
|
||||||
this.set("refreshing", true);
|
this.set("refreshing", true);
|
||||||
|
|
||||||
ajax('/admin/wizards/logs', {
|
CustomWizardLogs.list()
|
||||||
data: {
|
|
||||||
page: this.page
|
|
||||||
}
|
|
||||||
}).catch(popupAjaxError)
|
|
||||||
.then(result => {
|
.then(result => {
|
||||||
if (!result || result.length === 0) {
|
if (!result || result.length === 0) {
|
||||||
this.set('canLoadMore', false);
|
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">
|
<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>
|
</div>
|
||||||
|
|
||||||
{{#load-more selector=".log-list tr" action=(action "loadMore")}}
|
{{#load-more selector=".log-list tr" action=(action "loadMore") class="wizard-logs"}}
|
||||||
{{#if noResults}}
|
{{#if noResults}}
|
||||||
<p>{{i18n 'search.no_results'}}</p>
|
<p>{{i18n 'search.no_results'}}</p>
|
||||||
{{else}}
|
{{else}}
|
||||||
|
@ -10,14 +16,14 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Message</th>
|
<th>Message</th>
|
||||||
<th>Date</th>
|
<th class="date">Date</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{#each logs as |log|}}
|
{{#each logs as |log|}}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{log.message}}</td>
|
<td>{{log.message}}</td>
|
||||||
<td>{{bound-date log.date}}</td>
|
<td class="date">{{bound-date log.date}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -21,8 +21,14 @@
|
||||||
|
|
||||||
<div class="wizard-message">
|
<div class="wizard-message">
|
||||||
{{d-icon 'question-circle'}}
|
{{d-icon 'question-circle'}}
|
||||||
|
<span>{{i18n 'admin.wizard.message.help'}}</span>
|
||||||
|
|
||||||
<a href="https://thepavilion.io/c/knowledge/custom-wizard" target="_blank">
|
<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>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -30,6 +30,20 @@
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.admin-wizards-logs {
|
||||||
|
.admin-wizard-controls {
|
||||||
|
h3 {
|
||||||
|
margin: 0 7px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.wizard-logs {
|
||||||
|
.date {
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.wizard-settings-parent {
|
.wizard-settings-parent {
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
|
|
@ -58,7 +58,9 @@ en:
|
||||||
select: "Select a wizard, or create a new one"
|
select: "Select a wizard, or create a new one"
|
||||||
edit: "You're editing a wizard"
|
edit: "You're editing a wizard"
|
||||||
create: "You're creating a new 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:
|
editor:
|
||||||
show: "Show"
|
show: "Show"
|
||||||
|
|
Laden …
In neuem Issue referenzieren