テーマインストール時の動作をわかりやすくしたりテーマをアンインストールできるようにしたり
This commit is contained in:
		
							parent
							
								
									1b9b8912ae
								
							
						
					
					
						commit
						ff76c815b1
					
				
					 2 changed files with 14 additions and 1 deletions
				
			
		| 
						 | 
					@ -291,6 +291,7 @@ common/views/components/theme.vue:
 | 
				
			||||||
  install-a-theme: "テーマのインストール"
 | 
					  install-a-theme: "テーマのインストール"
 | 
				
			||||||
  theme-code: "テーマコード"
 | 
					  theme-code: "テーマコード"
 | 
				
			||||||
  install: "インストール"
 | 
					  install: "インストール"
 | 
				
			||||||
 | 
					  installed: "「{}」をインストールしました"
 | 
				
			||||||
  create-a-theme: "テーマの作成"
 | 
					  create-a-theme: "テーマの作成"
 | 
				
			||||||
  save-created-theme: "テーマを保存"
 | 
					  save-created-theme: "テーマを保存"
 | 
				
			||||||
  primary-color: "プライマリ カラー"
 | 
					  primary-color: "プライマリ カラー"
 | 
				
			||||||
| 
						 | 
					@ -306,6 +307,8 @@ common/views/components/theme.vue:
 | 
				
			||||||
  saved: "保存しました"
 | 
					  saved: "保存しました"
 | 
				
			||||||
  installed-themes: "インストールされたテーマ"
 | 
					  installed-themes: "インストールされたテーマ"
 | 
				
			||||||
  select-theme: "テーマを選択してください"
 | 
					  select-theme: "テーマを選択してください"
 | 
				
			||||||
 | 
					  uninstall: "アンインストール"
 | 
				
			||||||
 | 
					  uninstalled: "「{}」をアンインストールしました"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
common/views/components/cw-button.vue:
 | 
					common/views/components/cw-button.vue:
 | 
				
			||||||
  hide: "隠す"
 | 
					  hide: "隠す"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -58,13 +58,13 @@
 | 
				
			||||||
		<ui-textarea readonly :value="selectedInstalledThemeCode">
 | 
							<ui-textarea readonly :value="selectedInstalledThemeCode">
 | 
				
			||||||
			<span>%i18n:@theme-code%</span>
 | 
								<span>%i18n:@theme-code%</span>
 | 
				
			||||||
		</ui-textarea>
 | 
							</ui-textarea>
 | 
				
			||||||
 | 
							<ui-button @click="uninstall()">%i18n:@uninstall%</ui-button>
 | 
				
			||||||
	</details>
 | 
						</details>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script lang="ts">
 | 
					<script lang="ts">
 | 
				
			||||||
import Vue from 'vue';
 | 
					import Vue from 'vue';
 | 
				
			||||||
import { apiUrl, docsUrl } from '../../../config';
 | 
					 | 
				
			||||||
import { lightTheme, darkTheme, builtinThemes, applyTheme } from '../../../theme';
 | 
					import { lightTheme, darkTheme, builtinThemes, applyTheme } from '../../../theme';
 | 
				
			||||||
import { Chrome } from 'vue-color';
 | 
					import { Chrome } from 'vue-color';
 | 
				
			||||||
import * as uuid from 'uuid';
 | 
					import * as uuid from 'uuid';
 | 
				
			||||||
| 
						 | 
					@ -151,6 +151,16 @@ export default Vue.extend({
 | 
				
			||||||
			this.$store.commit('device/set', {
 | 
								this.$store.commit('device/set', {
 | 
				
			||||||
				key: 'themes', value: themes
 | 
									key: 'themes', value: themes
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
 | 
								alert('%i18n:@installed%'.replace('{}', theme.meta.name));
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							uninstall() {
 | 
				
			||||||
 | 
								const theme = this.installedThemes.find(x => x.meta.id == this.selectedInstalledTheme);
 | 
				
			||||||
 | 
								const themes = this.$store.state.device.themes.filter(t => t.meta.id != theme.meta.id);
 | 
				
			||||||
 | 
								this.$store.commit('device/set', {
 | 
				
			||||||
 | 
									key: 'themes', value: themes
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
								alert('%i18n:@uninstalled%'.replace('{}', theme.meta.name));
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		preview() {
 | 
							preview() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue