2022-06-30 18:30:50 +08:00
|
|
|
<DModalBody @class="install-theme" @title="admin.customize.theme.install">
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#unless this.directRepoInstall}}
|
2021-02-19 01:51:44 +08:00
|
|
|
<div class="install-theme-items">
|
2022-12-28 20:28:11 +08:00
|
|
|
<InstallThemeItem
|
|
|
|
@value="popular"
|
|
|
|
@selection={{this.selection}}
|
|
|
|
@label="admin.customize.theme.install_popular"
|
|
|
|
/>
|
|
|
|
<InstallThemeItem
|
|
|
|
@value="local"
|
|
|
|
@selection={{this.selection}}
|
|
|
|
@label="admin.customize.theme.install_upload"
|
|
|
|
/>
|
|
|
|
<InstallThemeItem
|
|
|
|
@value="remote"
|
|
|
|
@selection={{this.selection}}
|
|
|
|
@label="admin.customize.theme.install_git_repo"
|
|
|
|
/>
|
|
|
|
<InstallThemeItem
|
|
|
|
@value="create"
|
|
|
|
@selection={{this.selection}}
|
|
|
|
@label="admin.customize.theme.install_create"
|
|
|
|
@showIcon={{true}}
|
|
|
|
/>
|
2021-02-19 01:51:44 +08:00
|
|
|
</div>
|
|
|
|
{{/unless}}
|
2019-02-21 03:58:31 +08:00
|
|
|
<div class="install-theme-content">
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.popular}}
|
2019-02-21 03:58:31 +08:00
|
|
|
<div class="popular-theme-items">
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#each this.themes as |theme|}}
|
2020-05-09 03:38:41 +08:00
|
|
|
<div class="popular-theme-item" data-name={{theme.name}}>
|
2019-02-21 03:58:31 +08:00
|
|
|
<div class="popular-theme-name">
|
2022-12-28 20:28:11 +08:00
|
|
|
<a
|
|
|
|
href={{theme.meta_url}}
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
target="_blank"
|
|
|
|
>
|
2019-02-21 03:58:31 +08:00
|
|
|
{{#if theme.component}}
|
2022-12-28 20:28:11 +08:00
|
|
|
{{d-icon
|
|
|
|
"puzzle-piece"
|
|
|
|
title="admin.customize.theme.component"
|
|
|
|
}}
|
2019-02-21 03:58:31 +08:00
|
|
|
{{/if}}
|
|
|
|
{{theme.name}}
|
|
|
|
</a>
|
|
|
|
<div class="popular-theme-description">
|
|
|
|
{{theme.description}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="popular-theme-buttons">
|
|
|
|
{{#if theme.installed}}
|
2020-03-11 16:23:10 +08:00
|
|
|
<span>{{i18n "admin.customize.theme.installed"}}</span>
|
2019-02-21 03:58:31 +08:00
|
|
|
{{else}}
|
2022-12-28 20:28:11 +08:00
|
|
|
<DButton
|
|
|
|
@class="btn-small"
|
|
|
|
@label="admin.customize.theme.install"
|
|
|
|
@disabled={{this.installDisabled}}
|
|
|
|
@icon="upload"
|
|
|
|
@action={{action "installThemeFromList" theme.value}}
|
|
|
|
/>
|
2019-02-21 03:58:31 +08:00
|
|
|
|
|
|
|
{{#if theme.preview}}
|
2022-12-28 20:28:11 +08:00
|
|
|
<a
|
|
|
|
href={{theme.preview}}
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
target="_blank"
|
|
|
|
>{{d-icon "desktop"}}
|
|
|
|
{{i18n "admin.customize.theme.preview"}}</a>
|
2019-02-21 03:58:31 +08:00
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/each}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.local}}
|
2019-02-21 03:58:31 +08:00
|
|
|
<div class="inputs">
|
2022-12-28 20:28:11 +08:00
|
|
|
<input
|
|
|
|
onchange={{action "uploadLocaleFile"}}
|
|
|
|
type="file"
|
|
|
|
id="file-input"
|
|
|
|
accept=".dcstyle.json,application/json,.tar.gz,application/x-gzip,.zip,application/zip"
|
|
|
|
/><br />
|
|
|
|
<span class="description">{{i18n
|
|
|
|
"admin.customize.theme.import_file_tip"
|
|
|
|
}}</span>
|
2019-02-21 03:58:31 +08:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.remote}}
|
2019-02-21 03:58:31 +08:00
|
|
|
<div class="inputs">
|
|
|
|
<div class="repo">
|
2022-12-28 20:28:11 +08:00
|
|
|
<div class="label">{{i18n
|
|
|
|
"admin.customize.theme.import_web_tip"
|
|
|
|
}}</div>
|
|
|
|
<Input
|
|
|
|
@value={{this.uploadUrl}}
|
|
|
|
placeholder={{this.urlPlaceholder}}
|
|
|
|
/>
|
2019-02-21 03:58:31 +08:00
|
|
|
</div>
|
|
|
|
|
2022-12-28 20:28:11 +08:00
|
|
|
<DButton
|
|
|
|
@class="btn-small advanced-repo"
|
|
|
|
@action={{action "toggleAdvanced"}}
|
|
|
|
@label="admin.customize.theme.import_web_advanced"
|
|
|
|
/>
|
2019-02-21 03:58:31 +08:00
|
|
|
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.advancedVisible}}
|
2019-02-21 03:58:31 +08:00
|
|
|
<div class="branch">
|
2022-12-28 20:28:11 +08:00
|
|
|
<div class="label">{{i18n
|
|
|
|
"admin.customize.theme.remote_branch"
|
|
|
|
}}</div>
|
2022-07-06 01:41:31 +08:00
|
|
|
<Input @value={{this.branch}} placeholder="main" />
|
2019-02-21 03:58:31 +08:00
|
|
|
</div>
|
2022-11-02 00:33:17 +08:00
|
|
|
{{/if}}
|
2019-02-21 03:58:31 +08:00
|
|
|
|
2022-11-02 00:33:17 +08:00
|
|
|
{{#if this.showPublicKey}}
|
|
|
|
<div class="public-key">
|
|
|
|
<div class="label">{{i18n "admin.customize.theme.public_key"}}</div>
|
|
|
|
<div class="public-key-text-wrapper">
|
2022-12-28 20:28:11 +08:00
|
|
|
<Textarea
|
|
|
|
class="public-key-value"
|
|
|
|
readonly={{true}}
|
|
|
|
@value={{this.publicKey}}
|
|
|
|
/>
|
|
|
|
<CopyButton @selector="textarea.public-key-value" />
|
2019-02-21 03:58:31 +08:00
|
|
|
</div>
|
2022-11-02 00:33:17 +08:00
|
|
|
</div>
|
2019-02-21 03:58:31 +08:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.create}}
|
2019-02-21 03:58:31 +08:00
|
|
|
<div class="inputs">
|
2020-03-11 16:23:10 +08:00
|
|
|
<div class="label">{{i18n "admin.customize.theme.create_name"}}</div>
|
2022-07-06 01:41:31 +08:00
|
|
|
<Input @value={{this.name}} placeholder={{this.placeholder}} />
|
2019-02-21 03:58:31 +08:00
|
|
|
|
2020-03-11 16:23:10 +08:00
|
|
|
<div class="label">{{i18n "admin.customize.theme.create_type"}}</div>
|
2022-12-28 20:28:11 +08:00
|
|
|
<ComboBox
|
|
|
|
@valueProperty="value"
|
|
|
|
@content={{this.createTypes}}
|
|
|
|
@value={{this.selectedType}}
|
|
|
|
@onChange={{action (mut this.selectedType)}}
|
|
|
|
/>
|
2019-02-21 03:58:31 +08:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2021-02-19 01:51:44 +08:00
|
|
|
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.directRepoInstall}}
|
2021-02-19 01:51:44 +08:00
|
|
|
<div class="repo">
|
2022-12-28 20:28:11 +08:00
|
|
|
<div class="label">{{html-safe
|
|
|
|
(i18n
|
|
|
|
"admin.customize.theme.direct_install_tip" name=this.uploadName
|
|
|
|
)
|
|
|
|
}}</div>
|
2022-07-06 01:41:31 +08:00
|
|
|
<pre><code>{{this.uploadUrl}}</code></pre>
|
2021-02-19 01:51:44 +08:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2019-02-21 03:58:31 +08:00
|
|
|
</div>
|
|
|
|
|
2022-06-30 18:30:50 +08:00
|
|
|
</DModalBody>
|
2019-02-21 03:58:31 +08:00
|
|
|
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#unless this.popular}}
|
2019-02-21 03:58:31 +08:00
|
|
|
<div class="modal-footer">
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.duplicateRemoteThemeWarning}}
|
2021-01-08 02:03:35 +08:00
|
|
|
<div class="install-theme-warning">
|
2022-12-28 20:28:11 +08:00
|
|
|
⚠️
|
|
|
|
{{this.duplicateRemoteThemeWarning}}
|
2021-01-08 02:03:35 +08:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2022-08-10 18:30:18 +08:00
|
|
|
{{#if this.themeCannotBeInstalled}}
|
|
|
|
<div class="install-theme-warning">
|
2022-12-28 20:28:11 +08:00
|
|
|
⚠️
|
|
|
|
{{this.themeCannotBeInstalled}}
|
2022-08-10 18:30:18 +08:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2022-12-28 20:28:11 +08:00
|
|
|
<DButton
|
|
|
|
@action={{action "installTheme"}}
|
|
|
|
@disabled={{this.installDisabled}}
|
|
|
|
@class="btn {{if this.themeCannotBeInstalled 'btn-danger' 'btn-primary'}}"
|
|
|
|
@label={{this.submitLabel}}
|
|
|
|
/>
|
2022-06-30 18:30:50 +08:00
|
|
|
<DModalCancel @close={{route-action "closeModal"}} />
|
2019-02-21 03:58:31 +08:00
|
|
|
</div>
|
2022-12-28 20:28:11 +08:00
|
|
|
{{/unless}}
|