Skip to content

Commit d9ab83b

Browse files
committed
change: add Env.Api to store api links
1 parent 271a25c commit d9ab83b

File tree

4 files changed

+31
-8
lines changed

4 files changed

+31
-8
lines changed

src/api/Env.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ type Repo =
3636
urlDemoVault?: HttpsUrl
3737
}
3838

39+
/*
40+
Api Strings
41+
*/
42+
43+
type Api =
44+
{
45+
github?: HttpsUrl
46+
}
47+
3948
/*
4049
Class > Env
4150
*/
@@ -46,6 +55,10 @@ export abstract class Env
4655
private static _obsidianApiVer: string
4756
private static _manifest: PluginManifest
4857

58+
/*
59+
Repo Links
60+
*/
61+
4962
public static readonly Links: Repo =
5063
{
5164
urlDocs: 'https://aetherinox.github.io/obsidian-gistr',
@@ -58,6 +71,15 @@ export abstract class Env
5871
urlDemoVault: 'https://github.com/Aetherinox/obsidian-gistr/tree/main/tests/gistr-vault',
5972
}
6073

74+
/*
75+
Api
76+
*/
77+
78+
public static readonly Api: Api =
79+
{
80+
github: 'https://www.githubstatus.com/api/v2/summary.json',
81+
}
82+
6183
/*
6284
Initialize
6385
*/

src/lang/locale/en.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,15 @@ export default
149149
*/
150150

151151
cfg_tab_su_desc: 'The following buttons are associated to useful resources for this plugin.',
152-
cfg_tab_su_doc_name: 'Documentation',
153-
cfg_tab_su_doc_desc: 'View the official Gistr documentation',
154-
cfg_tab_su_doc_btn: 'View',
155152
cfg_tab_su_gs_name: 'Introduction',
156153
cfg_tab_su_gs_desc: 'View brief introduction to getting started with this plugin',
157154
cfg_tab_su_gs_btn: 'Open',
158-
cfg_tab_su_repo_label: 'Plugin repo',
155+
cfg_tab_su_repo_label: 'Gistr repo',
159156
cfg_tab_su_repo_btn: 'View',
160-
cfg_tab_su_vault_label: 'Plugin demo vault',
157+
cfg_tab_su_doc_name: 'Gistr Documentation',
158+
cfg_tab_su_doc_desc: 'View the official Gistr documentation',
159+
cfg_tab_su_doc_btn: 'View',
160+
cfg_tab_su_vault_label: 'Gistr demo vault',
161161
cfg_tab_su_vault_btn: 'View',
162162
cfg_tab_su_ogrepo_label: 'OpenGist: download',
163163
cfg_tab_su_ogrepo_url: 'https://github.com/thomiceli/opengist/releases',
@@ -255,7 +255,7 @@ export default
255255
Tab > Sync
256256
*/
257257

258-
cfg_tab_sy_list_save_showall_name: 'Save list: Show All Saves',
258+
cfg_tab_sy_list_save_showall_name: 'Save list: Show all saves',
259259
cfg_tab_sy_list_save_showall_desc: 'This setting effects how the gist save list displays saved gists.<br><br><span class="gistr-settings-elm-note">Enabled</span>: When saving an existing gist, the suggestion box will display ALL saves for that note in the same list; both public and secret.<br><br><span class="gistr-settings-elm-important">Disabled</span>: Public and secret gist saves will be separated when being displayed in the existing gist save list.',
260260

261261
cfg_tab_sy_list_icon_name: 'Save list: Icon color',

src/modals/GettingStartedModal.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import { App, Modal, ButtonComponent, Setting, requestUrl, MarkdownRenderer } from "obsidian"
66
import GistrPlugin from "src/main"
7+
import { Env } from 'src/api'
78
import { GistrSettings } from 'src/settings/'
89
import { lng } from 'src/lang'
910

@@ -115,7 +116,7 @@ export default class ModalGettingStarted extends Modal
115116
*/
116117

117118
let json_delay = 1 * 1000
118-
const gh_status = requestUrl( "https://www.githubstatus.com/api/v2/summary.json" ).then( ( res ) =>
119+
const gh_status = requestUrl( Env.Api[ "github" ] ).then( ( res ) =>
119120
{
120121
if ( res.status === 200 )
121122
return res.json.components[ 0 ].status || lng( "gist_status_issues" )

src/settings/sections/SettingsSection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ export class SettingsSection extends PluginSettingTab
867867
*/
868868

869869
let json_delay = 0.5 * 1000
870-
const gh_status = requestUrl( "https://www.githubstatus.com/api/v2/summary.json" ).then( ( res ) =>
870+
const gh_status = requestUrl( Env.Api[ "github" ] ).then( ( res ) =>
871871
{
872872
if ( res.status === 200 )
873873
return res.json.components[ 0 ].status || lng( "gist_status_issues" )

0 commit comments

Comments
 (0)