1
0
Fork 0
Dieser Commit ist enthalten in:
Angus McLeod 2020-04-15 12:10:39 +10:00
Ursprung 9694b7b7d3
Commit 147b8a787c
7 geänderte Dateien mit 64 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -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);

Datei anzeigen

@ -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;

Datei anzeigen

@ -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);
}
})

Datei anzeigen

@ -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>

Datei anzeigen

@ -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>

Datei anzeigen

@ -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;

Datei anzeigen

@ -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"