feat: 🎸 show session status in list
This commit is contained in:
4 files changed
+13
-1
No files matched your search
@@ -19,6 +19,7 @@
|
||||
<row.headerCell>{{t "resources.user"}}</row.headerCell>
|
||||
<row.headerCell>{{t "resources.target"}}</row.headerCell>
|
||||
<row.headerCell>{{t "form.label.started"}}</row.headerCell>
|
||||
<row.headerCell>{{t "form.label.status"}}</row.headerCell>
|
||||
<row.headerCell>{{t "titles.actions"}}</row.headerCell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
@@ -35,6 +36,9 @@
|
||||
{{format-date-iso-human sessionAggregate.session.created_time}}
|
||||
</time>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{sessionAggregate.session.status}}</Rose::Badge>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Button @style="secondary" {{on "click" (route-action "cancelSession" sessionAggregate.session)}}>
|
||||
{{t "actions.cancel"}}
|
||||
|
||||
@@ -308,7 +308,7 @@ export default function() {
|
||||
version: attrs.version
|
||||
};
|
||||
if (method === 'cancel') {
|
||||
updatedAttrs.status = 'canceled';
|
||||
updatedAttrs.status = 'canceling';
|
||||
}
|
||||
return session.update(updatedAttrs);
|
||||
});
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
import factory from '../generated/factories/target';
|
||||
import { trait } from 'ember-cli-mirage';
|
||||
import { random } from 'faker';
|
||||
|
||||
export default factory.extend({
|
||||
|
||||
id: (i) => `session-id-${i}`,
|
||||
status: () => random.arrayElement([
|
||||
'pending',
|
||||
'active',
|
||||
'canceling',
|
||||
'terminated'
|
||||
]),
|
||||
|
||||
/**
|
||||
* Sessions generated with this trait will automatically form
|
||||
|
||||
@@ -163,6 +163,7 @@ form:
|
||||
current_password: Current Password
|
||||
new_password: New Password
|
||||
started: Started
|
||||
status: Status
|
||||
errors:
|
||||
titles:
|
||||
unauthenticated-error: You are not signed in
|
||||
|
||||
Reference in new issue
Block a user