diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5f81a15..e2d28bd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,6 +22,7 @@ jobs: - name: "Build" run: yarn build env: + REACT_APP_ROOM_ID: 1 REACT_APP_BACKEND: "https://api.hole-thu-qwertyuiop.xyz/" REACT_APP_STORAGE: "https://file.hole-thu-qwertyuiop.xyz/" REACT_APP_BUILD_INFO: "v-${{steps.date.outputs.date}}" diff --git a/src/Config.js b/src/Config.js index 87ea1b3..6ddbbc3 100644 --- a/src/Config.js +++ b/src/Config.js @@ -22,11 +22,12 @@ const BUILTIN_IMGS = { const DEFAULT_CONFIG = { background_img: - '//cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/gbp.jpg', + 'https://cdn.jsdelivr.net/gh/thuhole/webhole@gh-pages/static/bg/gbp.jpg', background_color: '#113366', pressure: false, easter_egg: true, color_scheme: 'default', + show_all_rooms: false, block_tmp: true, block_cw: ['xxg', 'zzxg'], block_words_v4: ['πŸ•·οΈ', '[系统θ‡ͺεŠ¨δ»£ε‘]'], @@ -363,6 +364,13 @@ export class ConfigUI extends PureComponent { callback={this.save_changes_bound} />
+ +
#{info.pid} + {info.room_id !== parseInt(process.env.REACT_APP_ROOM_ID) && ( + <> @{info.room_id} + )}   diff --git a/src/Title.js b/src/Title.js index f75f443..5558cac 100644 --- a/src/Title.js +++ b/src/Title.js @@ -206,6 +206,7 @@ export function Title(props) { } > ζ–°Tζ ‘ζ΄ž + {process.env.REACT_APP_ROOM_ID || '?'}

diff --git a/src/UserAction.js b/src/UserAction.js index e3f7250..32a39cf 100644 --- a/src/UserAction.js +++ b/src/UserAction.js @@ -588,7 +588,7 @@ export class PostForm extends Component { text: text, allow_search: allow_search ? '1' : '', use_title: use_title ? '1' : '', - type: 'text', + room_id: process.env.REACT_APP_ROOM_ID, }); if (has_poll) { poll_options.forEach((opt) => { diff --git a/src/flows_api.js b/src/flows_api.js index a32d343..e2d4856 100644 --- a/src/flows_api.js +++ b/src/flows_api.js @@ -168,7 +168,9 @@ export const API = { get_list: async (page, token, submode) => { let response = await fetch( - `${get_api_base()}/getlist?p=${page}&order_mode=${submode}`, + `${get_api_base()}/getlist?p=${page}&order_mode=${submode}&room_id=${ + window.config.show_all_rooms ? '' : process.env.REACT_APP_ROOM_ID + }`, { headers: { 'User-Token': token }, }, @@ -178,9 +180,9 @@ export const API = { get_search: async (page, keyword, token, submode) => { let response = await fetch( - `${get_api_base()}/search?search_mode=${submode}&page=${page}&keywords=${encodeURIComponent( - keyword, - )}&pagesize=${SEARCH_PAGESIZE}`, + `${get_api_base()}/search?search_mode=${submode}&page=${page}&room_id=${ + window.config.show_all_rooms ? '' : process.env.REACT_APP_ROOM_ID + }&keywords=${encodeURIComponent(keyword)}&pagesize=${SEARCH_PAGESIZE}`, { headers: { 'User-Token': token }, },