Skip to content

Commit 8dcda58

Browse files
Benjamin Wittwerschneider-felix
andauthored
feat: Unify snippets (#325)
* Unify snippets * Add missing elasticsearch readme section * Fix typos * fix: change translation for resetting the queue * Update `$tc` to `$t` * fix: change parameters for and remove unused error variable * fix: typo in snippet file --------- Co-authored-by: Felix Schneider <felix.schneider@wimmelbach.de>
1 parent 9f7d428 commit 8dcda58

17 files changed

Lines changed: 174 additions & 146 deletions

File tree

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ This plugin contains some utility functions for managing a Shopware 6 shop.
44

55
The current feature set consists of:
66

7-
- **System Status**
7+
- **System-Status**
88
- Checks PHP Version, MySQL, Queue is working etc.
99
- Checks for performance optimizations and links documentation
10-
- **Cache manager**
10+
- **Cache Manager**
1111
- Lists App and Http Cache and all folders in var/cache
1212
- Clear specific caches
1313
- Compile theme
@@ -18,11 +18,16 @@ The current feature set consists of:
1818
- **Queue Manager**
1919
- Shows the amount of messages in the queue
2020
- Reset queue
21-
- **Log viewer**
21+
- **Elasticsearch Manager**
22+
- Shows the current status of the Elasticsearch nodes & cluster
23+
- Lists all indices of the Elasticsearch instance
24+
- Quick actions for index handling
25+
- Execute Elasticsearch console commands
26+
- **Log Viewer**
2227
- Shows the entries of /var/log/*.log files
23-
- **Shopware file checker**
28+
- **Shopware File Checker**
2429
- Checks if core files have been changed
25-
- **State Machine Visualisation**
30+
- **State Machine Viewer**
2631
- basic view of order, transaction and delivery states
2732
- **Override system config by config files**
2833
- Overwrite any system config value with static or environment values

src/Components/Health/Checker/HealthChecker/SystemTimeChecker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function collect(HealthCollection $collection): void
2020
private function checkSystemTime(HealthCollection $collection): void
2121
{
2222
$url = 'https://cloudflare.com/cdn-cgi/trace';
23-
$snippet = 'System time';
23+
$snippet = 'System time offset';
2424
$recommended = 'max 5 seconds';
2525

2626
try {

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-cache/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Component.register('frosh-tools-tab-cache', {
9999
if (theme) {
100100
await this.themeService.assignTheme(theme.id, salesChannel.id)
101101
this.createNotificationSuccess({
102-
message: `${salesChannel.translated.name}: ${this.$tc('frosh-tools.themeCompiled')}`,
102+
message: `${salesChannel.translated.name}: ${this.$t('frosh-tools.themeCompiled')}`,
103103
})
104104
}
105105
}

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-cache/template.twig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<sw-card-view>
22
<sw-card
33
class="frosh-tools-tab-cache__cache-card"
4-
:title="$tc('frosh-tools.tabs.cache.title')"
4+
:title="$t('frosh-tools.tabs.cache.title')"
55
:isLoading="isLoading"
66
:large="true"
77
positionIdentifier="frosh-tools-tab-cache"
@@ -29,7 +29,7 @@
2929
appearance="pill"
3030
v-if="item.active"
3131
>
32-
{{ $tc('frosh-tools.active') }}
32+
{{ $t('frosh-tools.active') }}
3333
</sw-label>
3434
<sw-label
3535
variant="primary"
@@ -43,7 +43,7 @@
4343

4444
<template #column-size="{ item }">
4545
<template v-if="item.size < 0">
46-
unknown
46+
{{ $t('frosh-tools.unknown') }}
4747
</template>
4848

4949
<template v-else>
@@ -53,7 +53,7 @@
5353

5454
<template #column-freeSpace="{ item }">
5555
<template v-if="item.freeSpace < 0">
56-
unknown
56+
{{ $t('frosh-tools.unknown') }}
5757
</template>
5858

5959
<template v-else>
@@ -66,14 +66,14 @@
6666
variant="danger"
6767
@click="clearCache(item)"
6868
>
69-
{{ $tc('frosh-tools.clear') }}
69+
{{ $t('frosh-tools.clear') }}
7070
</sw-context-menu-item>
7171
</template>
7272
</sw-data-grid>
7373
</sw-card>
7474
<sw-card
7575
class="frosh-tools-tab-cache__action-card"
76-
:title="$tc('frosh-tools.actions')"
76+
:title="$t('frosh-tools.actions')"
7777
:isLoading="isLoading"
7878
:large="true"
7979
positionIdentifier="frosh-tools-tab-cache-action"
@@ -82,7 +82,7 @@
8282
variant="primary"
8383
@click="compileTheme"
8484
>
85-
{{ $tc('frosh-tools.compileTheme') }}
85+
{{ $t('frosh-tools.compileTheme') }}
8686
</sw-button>
8787
</sw-card>
8888
</sw-card-view>

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-elasticsearch/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Component.register('frosh-tools-tab-elasticsearch', {
5454

5555
try {
5656
this.statusInfo = await this.froshElasticSearch.status()
57-
} catch (err) {
57+
} catch {
5858
// eslint-disable-line
5959
this.isActive = false
6060
this.isLoading = false
@@ -117,7 +117,7 @@ Component.register('frosh-tools-tab-elasticsearch', {
117117
await this.froshElasticSearch.reindex()
118118

119119
this.createNotificationSuccess({
120-
message: this.$tc('global.default.success'),
120+
message: this.$t('global.default.success'),
121121
})
122122

123123
await this.createdComponent()
@@ -127,7 +127,7 @@ Component.register('frosh-tools-tab-elasticsearch', {
127127
await this.froshElasticSearch.switchAlias()
128128

129129
this.createNotificationSuccess({
130-
message: this.$tc('global.default.success'),
130+
message: this.$t('global.default.success'),
131131
})
132132

133133
await this.createdComponent()
@@ -137,7 +137,7 @@ Component.register('frosh-tools-tab-elasticsearch', {
137137
await this.froshElasticSearch.flushAll()
138138

139139
this.createNotificationSuccess({
140-
message: this.$tc('global.default.success'),
140+
message: this.$t('global.default.success'),
141141
})
142142

143143
await this.createdComponent()
@@ -147,7 +147,7 @@ Component.register('frosh-tools-tab-elasticsearch', {
147147
await this.froshElasticSearch.reset()
148148

149149
this.createNotificationSuccess({
150-
message: this.$tc('global.default.success'),
150+
message: this.$t('global.default.success'),
151151
})
152152

153153
await this.createdComponent()
@@ -157,7 +157,7 @@ Component.register('frosh-tools-tab-elasticsearch', {
157157
await this.froshElasticSearch.cleanup()
158158

159159
this.createNotificationSuccess({
160-
message: this.$tc('global.default.success'),
160+
message: this.$t('global.default.success'),
161161
})
162162

163163
await this.createdComponent()

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-elasticsearch/template.twig

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
<sw-card-view>
22
<sw-card
3-
:title="$tc('frosh-tools.tabs.elasticsearch.title')"
3+
:title="$t('frosh-tools.tabs.elasticsearch.title')"
44
:large="true"
55
:isLoading="isLoading"
66
positionIdentifier="frosh-tools-tab-elasticsearch"
77
>
88
<sw-alert
99
variant="error"
1010
v-if="!isLoading && !isActive"
11-
>Elasticsearch is not enabled</sw-alert>
11+
>
12+
{{ $t('frosh-tools.tabs.elasticsearch.disabled') }}
13+
</sw-alert>
1214
<div v-if="!isLoading && isActive">
1315
<div>
14-
<strong>Elasticsearch version: </strong>
16+
<strong>{{ $t('frosh-tools.tabs.elasticsearch.version') }}: </strong>
1517
{{ statusInfo.info.version.number }}
1618
</div>
1719
<div>
18-
<strong>Nodes: </strong>
20+
<strong>{{ $t('frosh-tools.tabs.elasticsearch.nodes') }}: </strong>
1921
{{ statusInfo.health.number_of_nodes }}
2022
</div>
2123
<div>
22-
<strong>Cluster status: </strong>
24+
<strong>{{ $t('frosh-tools.tabs.elasticsearch.status') }}: </strong>
2325
{{ statusInfo.health.status }}
2426
</div>
2527
</div>
2628
</sw-card>
2729
<sw-card
28-
title="Indices"
30+
:title="$t('frosh-tools.tabs.elasticsearch.indices')"
2931
v-if="!isLoading && isActive"
3032
:large="true"
3133
positionIdentifier="frosh-tools-tab-elasticsearch-indices"
@@ -54,7 +56,7 @@
5456
appearance="pill"
5557
v-if="item.aliases.length"
5658
>
57-
{{ $tc('frosh-tools.active') }}
59+
{{ $t('frosh-tools.active') }}
5860
</sw-label>
5961
{{ item.name }}
6062
<br/>
@@ -70,31 +72,31 @@
7072
variant="danger"
7173
@click="deleteIndex(item.name)"
7274
>
73-
{{ $tc('frosh-tools.delete') }}
75+
{{ $t('frosh-tools.delete') }}
7476
</sw-context-menu-item>
7577
</template>
7678
</sw-data-grid>
7779
</sw-card>
7880
<sw-card
79-
title="Actions"
81+
:title="$t('frosh-tools.actions')"
8082
v-if="!isLoading && isActive"
8183
:large="true"
8284
positionIdentifier="frosh-tools-tab-elasticsearch-health"
8385
>
8486
<sw-button
8587
@click="reindex"
8688
variant="primary"
87-
>Reindex</sw-button>
88-
<sw-button @click="switchAlias">Trigger alias switching</sw-button>
89-
<sw-button @click="flushAll">Flush all indices</sw-button>
90-
<sw-button @click="cleanup">Cleanup unused Indices</sw-button>
89+
>{{ $t('frosh-tools.tabs.elasticsearch.action.reindex') }}</sw-button>
90+
<sw-button @click="switchAlias">{{ $t('frosh-tools.tabs.elasticsearch.action.switchAlias') }}</sw-button>
91+
<sw-button @click="flushAll">{{ $t('frosh-tools.tabs.elasticsearch.action.flushAll') }}</sw-button>
92+
<sw-button @click="cleanup">{{ $t('frosh-tools.tabs.elasticsearch.action.cleanup') }}</sw-button>
9193
<sw-button
9294
@click="resetElasticsearch"
9395
variant="danger"
94-
>Delete all indices</sw-button>
96+
>{{ $t('frosh-tools.tabs.elasticsearch.action.reset') }}</sw-button>
9597
</sw-card>
9698
<sw-card
97-
title="Elasticsearch Console"
99+
:title="$t('frosh-tools.tabs.elasticsearch.console.title')"
98100
v-if="!isLoading && isActive"
99101
:large="true"
100102
positionIdentifier="frosh-tools-tab-elasticsearch-console"
@@ -108,9 +110,9 @@
108110
:sanitizeInput="false"
109111
v-model="consoleInput"
110112
></sw-code-editor>
111-
<sw-button @click="onConsoleEnter">Send</sw-button>
113+
<sw-button @click="onConsoleEnter">{{ $t('frosh-tools.tabs.elasticsearch.console.send') }}</sw-button>
112114
<div>
113-
<strong>Output:</strong>
115+
<strong>{{ $t('frosh-tools.tabs.elasticsearch.console.output') }}:</strong>
114116
</div>
115117
<pre>{{ consoleOutput }}</pre>
116118
</sw-card>

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-files/template.twig

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<sw-card
33
class="frosh-tools-tab-files__files-card"
44
:class="isLoadingClass"
5-
:title="$tc('frosh-tools.tabs.files.title')"
5+
:title="$t('frosh-tools.tabs.files.title')"
66
:isLoading="isLoading"
77
:large="true"
88
positionIdentifier="frosh-tools-tab-files__files-card"
@@ -15,13 +15,13 @@
1515
variant="success"
1616
v-if="items.ok"
1717
>
18-
{{ $tc('frosh-tools.tabs.files.allFilesOk') }}
18+
{{ $t('frosh-tools.tabs.files.allFilesOk') }}
1919
</sw-alert>
2020
<sw-alert
2121
variant="warning"
2222
v-else-if="items.files"
2323
>
24-
{{ $tc('frosh-tools.tabs.files.notOk') }}
24+
{{ $t('frosh-tools.tabs.files.notOk') }}
2525
</sw-alert>
2626
<template #toolbar>
2727
<!-- @todo: Make the refresh button fancy -->
@@ -44,25 +44,25 @@
4444
<template #column-name="{ item }">
4545
<a
4646
@click="diff(item)"
47-
:title="$tc('frosh-tools.tabs.files.restore.diff')"
47+
:title="$t('frosh-tools.tabs.files.restore.diff')"
4848
>{{ item.name }}</a>
4949
</template>
5050

5151
<template #column-expected="{ item }">
5252
<span v-if="item.expected">
53-
{{ $tc('frosh-tools.tabs.files.expectedProject') }}
53+
{{ $t('frosh-tools.tabs.files.expectedProject') }}
5454
</span>
5555
<span v-else>
56-
{{ $tc('frosh-tools.tabs.files.expectedAll') }}
56+
{{ $t('frosh-tools.tabs.files.expectedAll') }}
5757
</span>
5858
</template>
5959

6060
<template #actions="{ item }">
6161
<sw-context-menu-item @click="openUrl(item.shopwareUrl)">
62-
{{ $tc('frosh-tools.tabs.files.openOriginal') }}
62+
{{ $t('frosh-tools.tabs.files.openOriginal') }}
6363
</sw-context-menu-item>
6464
<sw-context-menu-item @click="diff(item)">
65-
{{ $tc('frosh-tools.tabs.files.restore.diff') }}
65+
{{ $t('frosh-tools.tabs.files.restore.diff') }}
6666
</sw-context-menu-item>
6767
</template>
6868
</sw-data-grid>
@@ -84,7 +84,7 @@
8484
:disabled="diffData.file.expected"
8585
>
8686
<sw-icon name="regular-exclamation-triangle"></sw-icon>
87-
{{ $tc('frosh-tools.tabs.files.restore.restoreFile') }}
87+
{{ $t('frosh-tools.tabs.files.restore.restoreFile') }}
8888
</sw-button>
8989
</template>
9090
</sw-modal>

0 commit comments

Comments
 (0)