From 3f7117cd607296ac16eb8525dce2d27a62e1a979 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 17 May 2018 04:58:40 +0200 Subject: [PATCH 1/6] [mod] retab --- src/views/service/service_list.ms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/service/service_list.ms b/src/views/service/service_list.ms index 01b2d772..0c01fa1b 100644 --- a/src/views/service/service_list.ms +++ b/src/views/service/service_list.ms @@ -16,6 +16,6 @@ {{status}} - + {{/services}} From 32b43120786addc4141de0626dcdd9e6a629e253 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 17 May 2018 05:08:41 +0200 Subject: [PATCH 2/6] [enh] display service description --- src/js/yunohost/controllers/services.js | 2 +- src/locales/en.json | 1 + src/views/service/service_list.ms | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/yunohost/controllers/services.js b/src/js/yunohost/controllers/services.js index 49a59dd4..8313603c 100644 --- a/src/js/yunohost/controllers/services.js +++ b/src/js/yunohost/controllers/services.js @@ -110,4 +110,4 @@ ); }); -})(); \ No newline at end of file +})(); diff --git a/src/locales/en.json b/src/locales/en.json index 33b363d8..80e7f112 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -248,6 +248,7 @@ "running": "Running", "save": "Save", "select_user": "Select user", + "service_description": "Description:", "service_log": "%s log", "service_start_on_boot": "Start on boot: ", "service_status": "Status: ", diff --git a/src/views/service/service_list.ms b/src/views/service/service_list.ms index 0c01fa1b..2f9c670a 100644 --- a/src/views/service/service_list.ms +++ b/src/views/service/service_list.ms @@ -9,7 +9,7 @@ {{#services}} -

{{name}}

+

{{name}} {{description}}

{{t 'service_status'}} From 459697a33a236e4bc1375996748c47fe0d353a55 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 17 May 2018 05:42:06 +0200 Subject: [PATCH 3/6] [enh] display when the service as been started --- src/locales/en.json | 1 + src/views/service/service_list.ms | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/locales/en.json b/src/locales/en.json index 80e7f112..bcafc934 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -258,6 +258,7 @@ "size": "Size", "skip": "Skip", "start": "Start", + "started_at": "Started at:", "status": "Status", "stop": "Stop", "storage_create": "Add remote storage", diff --git a/src/views/service/service_list.ms b/src/views/service/service_list.ms index 2f9c670a..883c9c22 100644 --- a/src/views/service/service_list.ms +++ b/src/views/service/service_list.ms @@ -15,6 +15,9 @@ {{status}} +
+ {{t 'started_at'}} + {{active_at.human}}
{{/services}} From 5dbbbb36500621f5bae7cb8f953ce3aabb1d9d0a Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 17 May 2018 05:51:02 +0200 Subject: [PATCH 4/6] [enh] display when the service has been started on info page --- src/views/service/service_info.ms | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/views/service/service_info.ms b/src/views/service/service_info.ms index aeffc7e6..6ef85a47 100644 --- a/src/views/service/service_info.ms +++ b/src/views/service/service_info.ms @@ -24,6 +24,9 @@ {{status}} +
+ {{t 'started_at'}} + {{active_at.human}}
From 3b3509392efcaf845dab85bb2dfbe73d839f7b1a Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 17 May 2018 05:56:01 +0200 Subject: [PATCH 5/6] [enh] display more information on service info page --- src/views/service/service_info.ms | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/views/service/service_info.ms b/src/views/service/service_info.ms index 6ef85a47..cc584758 100644 --- a/src/views/service/service_info.ms +++ b/src/views/service/service_info.ms @@ -9,7 +9,24 @@
-

{{t 'status'}}

+

{{t 'infos'}}

+
+
+ {{#service}} +
+
{{t 'name'}}
+
{{name}}
+
{{t 'description'}}
+
{{description}}
+
+ {{/service}} +
+
+ + +
+
+

{{t 'status'}}

From 39e166c8fb9191880c76f31c324ffbd2eda20bf4 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Thu, 17 May 2018 06:38:02 +0200 Subject: [PATCH 6/6] [enh] sort services by names --- src/js/yunohost/controllers/services.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/js/yunohost/controllers/services.js b/src/js/yunohost/controllers/services.js index 8313603c..ffb6fa1d 100644 --- a/src/js/yunohost/controllers/services.js +++ b/src/js/yunohost/controllers/services.js @@ -24,6 +24,17 @@ v.loaded = y18n.t(v.loaded); data2.services.push(v); }); + + data2.services.sort(function (a, b) { + if (a.name > b.name) { + return 1; + } + else if (a.name < b.name) { + return -1; + } + return 0; + }); + c.view('service/service_list', data2); }); });