Release v1.0.0: in-panel settings (gear icon), default URL 127.0.0.1:8899
This commit is contained in:
@@ -8,18 +8,14 @@ import com.intellij.openapi.components.Storage
|
||||
import com.intellij.openapi.diagnostic.Logger
|
||||
|
||||
/**
|
||||
* 插件设置:目前仅保存一个「浏览器起始地址」。
|
||||
*
|
||||
* 该地址必须是一个允许被嵌入的 Web 应用地址(例如本地 Harness 服务地址),
|
||||
* 并且需要在页面上开启允许被 iframe/嵌入浏览(X-Frame-Options / CSP frame-ancestors)
|
||||
* 或者由 Harness 提供专门的无 frame 限制入口。
|
||||
* 插件设置:仅保存「浏览器起始地址」。
|
||||
*/
|
||||
@State(name = "HarmnessToolwindowSettings", storages = [Storage("harmness-toolwindow.xml")])
|
||||
@Service(Service.Level.APP)
|
||||
class SettingsState : PersistentStateComponent<SettingsState.State> {
|
||||
|
||||
data class State(
|
||||
var startUrl: String = "http://127.0.0.1:8888",
|
||||
var startUrl: String = DEFAULT_URL,
|
||||
)
|
||||
|
||||
private var myState = State()
|
||||
@@ -39,7 +35,8 @@ class SettingsState : PersistentStateComponent<SettingsState.State> {
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val DEFAULT_URL = "http://127.0.0.1:8888"
|
||||
// 与 DSH Web GUI 默认端口一致
|
||||
const val DEFAULT_URL = "http://127.0.0.1:8899"
|
||||
|
||||
fun getInstance(): SettingsState =
|
||||
ServiceManager.getService(SettingsState::class.java)
|
||||
|
||||
Reference in New Issue
Block a user